@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.
- package/package.json +21 -8
- package/src/App.vue +76 -17
- package/src/appearance/appearance.ts +14 -4
- package/src/appearance/components/ThemePresetPreview.vue +52 -8
- package/src/appearance/interface-font.ts +99 -0
- package/src/appearance/theme.ts +26 -10
- package/src/appearance/use-interface-font.ts +30 -0
- package/src/assets/mail-provider-icons/NOTICE.txt +27 -0
- package/src/assets/mail-provider-icons/aliyun-mail.svg +3 -0
- package/src/assets/mail-provider-icons/gmail.svg +1 -0
- package/src/assets/mail-provider-icons/icloud.svg +12 -0
- package/src/assets/mail-provider-icons/netease-126.svg +5 -0
- package/src/assets/mail-provider-icons/netease-163.svg +5 -0
- package/src/assets/mail-provider-icons/qq.svg +9 -0
- package/src/assets/mail-provider-icons/tencent-exmail.svg +4 -0
- package/src/assistant/components/AssistantChangeList.vue +98 -21
- package/src/assistant/components/AssistantPanel.vue +424 -7
- package/src/assistant/components/PluginToolProposalCard.vue +235 -0
- package/src/assistant/engine.ts +56 -3
- package/src/assistant/files.ts +5 -13
- package/src/assistant/inbox.ts +1 -148
- package/src/assistant/locales/de-DE.json +4 -1
- package/src/assistant/locales/en-US.json +4 -1
- package/src/assistant/locales/es-ES.json +4 -1
- package/src/assistant/locales/ja-JP.json +4 -1
- package/src/assistant/locales/zh-CN.json +4 -1
- package/src/assistant/locales/zh-TW.json +4 -1
- package/src/assistant/mention-autocomplete.ts +69 -0
- package/src/assistant/prompts.ts +7 -0
- package/src/assistant/results.ts +20 -86
- package/src/assistant/store.ts +319 -12
- package/src/assistant/structures.ts +7 -5
- package/src/assistant/tasks.ts +3 -5
- package/src/assistant/workspace-bridge.ts +1 -1
- package/src/composables/use-document-actions.ts +38 -20
- package/src/composables/use-file-tree-controller.ts +7 -12
- package/src/composables/use-workbench-history.ts +2 -4
- package/src/composables/use-workbench-modals.ts +6 -1
- package/src/composables/use-workbench-outline.ts +0 -5
- package/src/composables/use-workbench-shortcuts.ts +26 -22
- package/src/data-tables/data-tables.ts +1 -2
- package/src/documents/components/DocumentHistoryPanel.vue +3 -1
- package/src/features.ts +1 -0
- package/src/fonts/Inter-Latin-Italic.woff2 +0 -0
- package/src/fonts/Inter-Latin.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Bold.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Medium.woff2 +0 -0
- package/src/fonts/TanoUISansSC-Regular.woff2 +0 -0
- package/src/help/help-milestones.ts +3 -5
- package/src/i18n/locales/de-DE.json +349 -3
- package/src/i18n/locales/en-US.json +349 -2
- package/src/i18n/locales/es-ES.json +349 -3
- package/src/i18n/locales/ja-JP.json +348 -2
- package/src/i18n/locales/zh-TW.json +348 -2
- package/src/mail/components/MailAccountDialog.vue +449 -0
- package/src/mail/components/MailComposerDialog.vue +325 -0
- package/src/mail/components/MailProviderIcon.vue +30 -0
- package/src/mail/components/MailWorkspaceView.vue +820 -0
- package/src/mail/components/SidebarMail.vue +133 -0
- package/src/mail/mail-avatar.ts +17 -0
- package/src/mail/mail-bridge.ts +68 -0
- package/src/mail/mail-calendar.ts +208 -0
- package/src/mail/mail-markdown.ts +195 -0
- package/src/mail/types.ts +226 -0
- package/src/objects/components/ObjectDetailModal.vue +1001 -0
- package/src/objects/workspace-objects.ts +1 -1
- package/src/plan-sync/types.ts +6 -3
- package/src/plans/calendar-interaction.ts +194 -0
- package/src/plans/calendar.ts +63 -7
- package/src/plans/components/CalendarDayPopover.vue +172 -39
- package/src/plans/components/CalendarView.vue +1736 -276
- package/src/plans/components/PlanArchiveDialog.vue +295 -0
- package/src/plans/components/PlanDateField.vue +6 -4
- package/src/plans/components/PlanDetailPanel.vue +227 -32
- package/src/plans/components/PlanEventList.vue +16 -4
- package/src/plans/components/SidebarPlan.vue +22 -15
- package/src/plans/components/TaskRepeatControls.vue +169 -30
- package/src/plans/local-reminders.ts +149 -0
- package/src/plans/personal-plans.ts +10 -1
- package/src/plans/plan-date.ts +8 -1
- package/src/plans/plan-migration.ts +95 -0
- package/src/plans/recurrence.ts +95 -0
- package/src/plans/task-repeat.ts +8 -8
- package/src/plans/timeline-layout.ts +92 -0
- package/src/plugins/assistant-bridge.ts +520 -0
- package/src/plugins/attachment-reader.ts +3 -1
- package/src/plugins/cache-storage.ts +42 -2
- package/src/plugins/components/PluginAutomations.vue +3 -3
- package/src/plugins/components/PluginCatalogBrowser.vue +17 -8
- package/src/plugins/components/PluginChangeSummary.vue +16 -3
- package/src/plugins/components/PluginConnections.vue +1 -1
- package/src/plugins/components/PluginCustomView.vue +2 -2
- package/src/plugins/components/PluginDetailPage.vue +129 -54
- package/src/plugins/components/PluginDocumentSlot.vue +63 -0
- package/src/plugins/components/PluginExplorer.vue +15 -21
- package/src/plugins/components/PluginImportDialog.vue +410 -0
- package/src/plugins/components/PluginInstaller.vue +39 -145
- package/src/plugins/components/PluginListItem.vue +3 -0
- package/src/plugins/components/PluginMaintenance.vue +21 -6
- package/src/plugins/components/PluginRuntimePanel.vue +3 -3
- package/src/plugins/components/PluginSettingsForm.vue +111 -0
- package/src/plugins/components/PluginStatusBar.vue +161 -0
- package/src/plugins/components/PluginSurface.vue +18 -6
- package/src/plugins/components/PluginUiDialog.vue +452 -0
- package/src/plugins/excalidraw/bundle.tano-plugin.json +1 -1
- package/src/plugins/excalidraw/manifest.json +12 -1
- package/src/plugins/host.ts +662 -43
- package/src/plugins/native.ts +2 -10
- package/src/plugins/overlay-mapping.ts +125 -0
- package/src/plugins/packages.ts +73 -1
- package/src/plugins/plugin-permissions.ts +57 -0
- package/src/plugins/plugin-sdk.ts +174 -8
- package/src/plugins/policy.ts +53 -3
- package/src/plugins/presentation-preview/bundle.tano-plugin.json +1 -1
- package/src/plugins/presentation-preview/manifest.json +2 -1
- package/src/plugins/queries.ts +3 -1
- package/src/plugins/sandbox.ts +15 -1
- package/src/plugins/use-plugin-actions.ts +67 -20
- package/src/plugins/user-plugins.ts +254 -0
- package/src/plugins/word-preview/bundle.tano-plugin.json +1 -1
- package/src/plugins/word-preview/manifest.json +13 -1
- package/src/plugins/workbench.ts +175 -2
- package/src/plugins/worker.js +105 -8
- package/src/plugins/workspace-plugin-runtime.ts +23 -7
- package/src/plugins/workspace-plugins.ts +212 -21
- package/src/runtime.ts +101 -3
- package/src/settings/components/SettingsAppearancePage.vue +46 -0
- package/src/settings/components/SettingsDocumentsPage.vue +0 -1
- package/src/settings/components/settings-search.ts +2 -3
- package/src/shell/components/SidebarNavigation.vue +22 -2
- package/src/shell/components/WorkbenchContextMenus.vue +21 -8
- package/src/shell/components/WorkbenchModals.vue +27 -46
- package/src/shell/components/WorkbenchPanes.vue +267 -84
- package/src/shell/components/WorkspaceBreadcrumb.vue +6 -14
- package/src/shell/components/WorkspaceViewSwitcher.vue +12 -7
- package/src/shell/use-workbench.ts +116 -145
- package/src/shell/workbench-async-components.ts +14 -5
- package/src/stores/mail.ts +414 -0
- package/src/stores/plan-sync.ts +2 -1
- package/src/stores/plans.ts +2 -9
- package/src/stores/workspace-knowledge.ts +1 -113
- package/src/stores/workspace-plugins-state.ts +537 -14
- package/src/stores/workspace-tabs-layout.ts +5 -43
- package/src/stores/workspace.ts +69 -66
- package/src/styles/agent-diff-modals.css +0 -7
- package/src/styles/dark-theme.css +3 -3
- package/src/styles/inspector.css +0 -59
- package/src/styles/layout-themes.css +346 -0
- package/src/styles/mail.css +1568 -0
- package/src/styles/mobile.css +2 -2
- package/src/styles/recent-and-media.css +0 -17
- package/src/styles/theme-contract.css +3 -3
- package/src/styles/workbench-shell.css +110 -17
- package/src/styles/workspace-states.css +9 -33
- package/src/styles.css +1 -1
- package/src/tabs/components/DesktopTabs.vue +0 -3
- package/src/tabs/components/NewTabPicker.vue +10 -4
- package/src/tabs/tab-label.ts +0 -1
- package/src/workspace/components/WorkspaceGeneralSettings.vue +0 -13
- package/src/workspace/components/WorkspaceIconPicker.vue +28 -6
- package/src/workspace/workspace-comments.ts +11 -151
- package/src/workspace/workspace-welcome.ts +1 -1
- package/src/documents/components/FormulaMenu.vue +0 -50
- package/src/files/components/FileDatabasePage.vue +0 -152
- package/src/files/components/FolderHomeIcon.vue +0 -12
- package/src/objects/components/ObjectDatabasePage.vue +0 -100
- package/src/objects/components/ObjectPanel.vue +0 -554
- package/src/plans/components/PersonalPlanDialog.vue +0 -105
- package/src/shell/components/WorkspaceViewPage.vue +0 -127
- package/src/shell/components/WorkspaceViewTab.vue +0 -24
- package/src/styles/object-panel.css +0 -163
- package/src/workspace/components/GitInspectionPanel.vue +0 -35
- package/src/workspace/components/WorkspaceSyncPanel.vue +0 -50
- package/src/workspace/welcome-slogans.ts +0 -11
- package/src/workspace/workspace-git.ts +0 -35
- package/src/workspace/workspace-sync.ts +0 -46
- package/src/workspace/workspace-views.ts +0 -48
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Mail provider brand icons
|
|
2
|
+
|
|
3
|
+
These marks identify supported mail services. Brand and trademark rights
|
|
4
|
+
remain with their respective owners. No affiliation or endorsement is implied.
|
|
5
|
+
|
|
6
|
+
qq.svg — QQ Mail app icon from Tencent's webmail sign-in page, traced into SVG.
|
|
7
|
+
https://res.wx.qq.com/t/webmail/webmail/res/images/logo_app_20@2x.b90d16b.png
|
|
8
|
+
|
|
9
|
+
netease-163.svg — Red 163 mark cropped from the official header and traced.
|
|
10
|
+
https://mimg.127.net/p/freemail/index/unified/static/2026/css/style.52d41eed807f372e4154.css
|
|
11
|
+
|
|
12
|
+
netease-126.svg — Green 126 mark cropped from the official header and traced.
|
|
13
|
+
https://mimg.127.net/p/freemail/index/unified/static/2026/css/style.f725ce8b2ece3e1a366f.css
|
|
14
|
+
|
|
15
|
+
gmail.svg — Original Gmail SVG from Google Workspace.
|
|
16
|
+
https://www.gstatic.com/images/branding/productlogos/gmail_2026/v2/web/192px.svg
|
|
17
|
+
https://about.google/brand-resource-center/products-and-services/
|
|
18
|
+
|
|
19
|
+
icloud.svg — Mail icon shown for iCloud Mail in Apple's iCloud guide, traced.
|
|
20
|
+
https://support.apple.com/en-ca/guide/icloud/mm203ae070a2/icloud
|
|
21
|
+
https://help.apple.com/assets/6AAB1A7B3D258762A20204E6/6AAB1A7EA2303D266D0C0FD9/en_CA/9a1224c90714bed734cb49d2b96ebfaa.png
|
|
22
|
+
|
|
23
|
+
tencent-exmail.svg — Tencent Exmail symbol cropped from the official header sprite and traced.
|
|
24
|
+
https://rescdn.qqmail.com/bizmail/zh_CN/htmledition/images/wwbiz/indexIcons_2x7a90f5.png
|
|
25
|
+
|
|
26
|
+
aliyun-mail.svg — Alibaba Mail symbol cropped from the official sign-in logo and traced.
|
|
27
|
+
https://qiye.aliyun.com/static/0.2.9/images/forNetCN/logo.png
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 51 32">
|
|
2
|
+
<path d="M0 0 C10.06 -0.62 10.06 -0.62 13.44 1.62 C13.95 2.41 14.47 3.19 15 4 C15.37 4.53 15.73 5.06 16.11 5.6 C17.11 7.05 18.06 8.52 19 10 C22.77 6.37 22.77 6.37 23.99 4.4 C25.22 2.51 26.17 1.34 28 0 C30.69 -0.27 30.69 -0.27 33.68 -0.17 C34.68 -0.15 35.67 -0.12 36.7 -0.1 C37.46 -0.06 38.22 -0.03 39 0 C39.86 3.91 40.71 7.83 41.56 11.74 C41.85 13.07 42.14 14.4 42.44 15.74 C42.86 17.65 43.27 19.57 43.69 21.48 C43.82 22.08 43.95 22.67 44.09 23.28 C44.72 26.23 45.16 28.98 45 32 C40.63 31.49 37.41 30.86 34 28 C31.87 23.93 30.71 19.53 30 15 C26.1 18.68 23.01 22.56 20 27 C15.8 23.28 13 18.68 10 14 C9.78 14.89 9.56 15.78 9.34 16.7 C6.52 27.39 6.52 27.39 3.12 29.75 C0.04 30.98 -2.73 31.51 -6 32 C-4.53 21.22 -2.32 10.63 0 0 Z " fill="#E23C39" transform="translate(6,0)"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" fill="none" viewBox="0 0 192 192"><path fill="url(#a)" d="M146 44h38v110c0 6.627-5.373 12-12 12h-20a6 6 0 0 1-6-6z"/><path fill="#fc413d" d="M46 44H8v110c0 6.627 5.373 12 12 12h20a6 6 0 0 0 6-6z"/><path fill="url(#b)" d="M39.226 30.456c-8.033-6.752-20.018-5.714-26.77 2.319-6.752 8.032-5.714 20.017 2.319 26.77l76.078 63.949a8 8 0 0 0 10.295 0l76.078-63.95c8.032-6.752 9.07-18.737 2.318-26.77-6.752-8.032-18.737-9.07-26.769-2.318L96 78.18z"/><defs><linearGradient id="a" x1="165" x2="165" y1="44" y2="166" gradientUnits="userSpaceOnUse"><stop stop-color="#60d673"/><stop offset=".17" stop-color="#42c868"/><stop offset=".39" stop-color="#0ebc5f"/><stop offset=".62" stop-color="#00a9bb"/><stop offset=".86" stop-color="#3c90ff"/><stop offset="1" stop-color="#3186ff"/></linearGradient><linearGradient id="b" x1="8" x2="184" y1="46.13" y2="46.13" gradientUnits="userSpaceOnUse"><stop offset=".08" stop-color="#ff63a0"/><stop offset=".3" stop-color="#fc413d"/><stop offset=".5" stop-color="#fc413d"/><stop offset=".65" stop-color="#fc413d"/><stop offset=".72" stop-color="#fc5c30"/><stop offset=".86" stop-color="#feb10c"/><stop offset=".91" stop-color="#fec700"/><stop offset=".96" stop-color="#ffdb0f"/></linearGradient></defs></svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="background" x2="0" y2="1">
|
|
4
|
+
<stop stop-color="#1d6ff1"/><stop offset="1" stop-color="#1ac9fc"/>
|
|
5
|
+
</linearGradient>
|
|
6
|
+
</defs>
|
|
7
|
+
<path d="M0 0 C1.61 -0 3.23 -0 4.84 -0 C8.2 -0.01 11.56 0.01 14.92 0.03 C19.2 0.06 23.48 0.06 27.75 0.04 C31.08 0.04 34.41 0.04 37.73 0.06 C39.31 0.06 40.88 0.06 42.46 0.06 C54.37 0.04 66.54 0.2 75.52 9.06 C82.3 16.46 84.07 23.97 84.09 33.88 C84.1 34.61 84.1 35.33 84.11 36.08 C84.12 38.47 84.13 40.87 84.13 43.26 C84.13 43.67 84.13 43.67 84.14 45.75 C84.16 50.1 84.17 54.45 84.17 58.79 C84.18 63.27 84.2 67.74 84.23 72.21 C84.25 75.66 84.25 79.12 84.25 82.58 C84.26 84.22 84.26 85.87 84.28 87.52 C84.44 109.93 84.44 109.93 76.93 118.5 C76.48 119.01 76.04 119.52 75.57 120.05 C67.38 128.19 55.56 129.01 44.63 129.03 C43.13 129.02 41.62 129 40.11 128.99 C38.52 128.99 36.93 128.99 35.35 129 C32.04 129 28.73 128.99 25.42 128.96 C21.21 128.93 17 128.94 12.8 128.95 C9.52 128.96 6.25 128.95 2.97 128.94 C1.42 128.93 -0.13 128.93 -1.68 128.94 C-14.15 128.95 -26.63 128.78 -36.07 119.5 C-45.18 109.98 -44.52 96.65 -44.47 84.37 C-44.47 82.73 -44.47 81.08 -44.48 79.44 C-44.48 76.02 -44.48 72.6 -44.46 69.17 C-44.44 64.81 -44.45 60.45 -44.47 56.08 C-44.48 52.7 -44.48 49.31 -44.47 45.93 C-44.47 44.32 -44.47 42.71 -44.48 41.11 C-44.55 19.03 -44.55 19.03 -37.07 10.5 C-36.62 9.98 -36.18 9.47 -35.71 8.94 C-26.28 -0.43 -12.36 -0.1 0 0 Z " fill="url(#background)" transform="translate(44.0703125,-0.49609375)"/>
|
|
8
|
+
<path d="M0 0 C27.06 0 54.12 0 82 0 C82 3 82 3 80.82 4.56 C80.54 4.83 80.54 4.83 79.14 6.23 C78.83 6.55 78.83 6.55 77.25 8.14 C76.57 8.82 75.88 9.49 75.18 10.19 C74.83 10.54 74.83 10.54 73.06 12.31 C71.58 13.79 70.09 15.26 68.6 16.73 C66.33 18.98 64.07 21.24 61.81 23.51 C60.37 24.94 58.93 26.38 57.49 27.81 C57.15 28.15 57.15 28.15 55.45 29.86 C46.79 38.39 46.79 38.39 41.19 38.56 C33.17 38.09 26.97 30.26 21.66 24.85 C21 24.19 20.35 23.54 19.67 22.86 C17.61 20.79 15.56 18.71 13.5 16.62 C12.09 15.21 10.68 13.79 9.27 12.37 C5.84 8.92 2.42 5.46 -1 2 C-0.67 1.34 -0.34 0.68 0 0 Z " fill="#FFFFFF" transform="translate(23,35)"/>
|
|
9
|
+
<path d="M0 0 C0.24 0.21 0.24 0.21 1.43 1.25 C2.05 1.79 2.67 2.33 3.32 2.88 C3.62 3.15 3.62 3.15 5.18 4.5 C9.5 8.06 13.46 9.58 18.99 9.35 C25.09 8.28 29.38 3.85 34 0 C42.25 8.25 50.5 16.5 59 25 C58.67 25.66 58.34 26.32 58 27 C30.94 27 3.88 27 -24 27 C-24 24 -24 24 -21.8 21.46 C-20.79 20.45 -19.77 19.45 -18.75 18.46 C-18.22 17.93 -17.68 17.4 -17.14 16.86 C-15.43 15.17 -13.72 13.49 -12 11.81 C-10.84 10.67 -9.69 9.53 -8.53 8.38 C-5.7 5.58 -2.85 2.79 0 0 Z " fill="#FFFFFF" transform="translate(47,66)"/>
|
|
10
|
+
<path d="M0 0 C0 17.16 0 34.32 0 52 C-4.14 48.45 -8.03 45.09 -11.84 41.26 C-12.25 40.84 -12.66 40.43 -13.09 40.01 C-14.37 38.71 -15.66 37.42 -16.94 36.12 C-17.82 35.24 -18.7 34.35 -19.59 33.46 C-21.73 31.31 -23.86 29.16 -26 27 C-24.42 23.1 -21.75 20.48 -18.81 17.58 C-18.3 17.07 -17.8 16.57 -17.28 16.05 C-16.21 14.99 -15.15 13.93 -14.08 12.87 C-12.43 11.25 -10.8 9.61 -9.17 7.98 C-8.13 6.95 -7.09 5.92 -6.06 4.89 C-5.57 4.4 -5.08 3.91 -4.57 3.4 C-1.12 0 -1.12 0 0 0 Z " fill="#FFFFFF" transform="translate(109,38)"/>
|
|
11
|
+
<path d="M0 0 C4.14 3.55 8.03 6.91 11.84 10.74 C12.25 11.16 12.66 11.57 13.09 11.99 C14.37 13.29 15.66 14.58 16.94 15.88 C17.82 16.76 18.7 17.65 19.59 18.54 C21.73 20.69 23.86 22.84 26 25 C24.42 28.9 21.75 31.52 18.81 34.42 C18.3 34.93 17.8 35.43 17.28 35.95 C16.21 37.01 15.15 38.07 14.08 39.13 C12.43 40.75 10.8 42.39 9.17 44.02 C8.13 45.05 7.09 46.08 6.06 47.11 C5.81 47.35 5.81 47.35 4.57 48.6 C1.12 52 1.12 52 0 52 C0 34.84 0 17.68 0 0 Z " fill="#FFFFFF" transform="translate(19,38)"/>
|
|
12
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 121 61">
|
|
2
|
+
<path d="M0 0 C-1.6 4.96 -4.53 8.7 -7.62 12.81 C-7.88 13.16 -7.88 13.16 -9.19 14.91 C-10.45 16.61 -11.72 18.31 -13 20 C-11.92 19.97 -10.84 19.95 -9.73 19.92 C-3.49 19.93 1.6 22.6 6 27 C8.96 31.66 9.91 36.56 9 42 C6.98 48.62 2.62 53.13 -3 57 C-7.51 59.4 -11.83 59.37 -16.81 59.38 C-17.58 59.4 -18.35 59.42 -19.14 59.45 C-25.86 59.48 -31 57.65 -36.06 53.18 C-36.29 52.9 -36.29 52.9 -37.44 51.44 C-37.91 50.86 -38.38 50.28 -38.87 49.68 C-42.15 44.79 -41.57 38.62 -41 33 C-38.51 24.42 -31.92 17.38 -26.3 10.64 C-25 9 -25 9 -23.11 6.11 C-17.23 -2.32 -9.31 -0.86 0 0 Z M-22.83 34.4 C-24.99 37.34 -25.13 39.34 -25 43 C-23.23 45.49 -21.83 46.63 -19.06 47.88 C-16.19 48.05 -14.52 47.36 -12 46 C-9.35 43.26 -8.19 40.82 -8 37 C-9 34.25 -9 34.25 -11 32 C-16.12 30.26 -18.9 30.61 -22.83 34.4 Z " fill="#1E7E3E" transform="translate(112,2)"/>
|
|
3
|
+
<path d="M0 0 C3.45 3.55 4.95 6.63 5.5 11.56 C5.11 19.32 0.83 25.56 -3.56 31.69 C-4.07 32.41 -4.58 33.14 -5.11 33.89 C-6.36 35.66 -7.62 37.43 -8.88 39.19 C-3.92 39.52 1.02 39.85 6.12 40.19 C5.67 45.91 5.28 49.8 3.12 55.19 C-11.4 55.19 -25.92 55.19 -40.88 55.19 C-34.25 46.35 -34.25 46.35 -30.56 42.44 C-27.16 38.71 -23.98 34.89 -20.94 30.88 C-20.75 30.63 -20.75 30.63 -19.79 29.39 C-17 25.64 -15.21 22.17 -14.44 17.56 C-14.88 15.19 -14.88 15.19 -16.69 13.25 C-21.6 11.61 -25.94 12.99 -30.88 14.19 C-30.73 12.27 -30.59 10.35 -30.44 8.44 C-30.36 7.37 -30.28 6.3 -30.19 5.2 C-29.64 -0.07 -29.64 -0.07 -28.88 -1.81 C-19.3 -6.73 -8.93 -5.63 0 0 Z " fill="#1E7E3E" transform="translate(61.875,5.8125)"/>
|
|
4
|
+
<path d="M0 0 C1.41 2.81 0.73 4.55 0.2 7.64 C0.15 7.93 0.15 7.93 -0.1 9.39 C-0.42 11.29 -0.76 13.2 -1.09 15.1 C-1.32 16.42 -1.54 17.74 -1.77 19.06 C-2.36 22.54 -2.96 26.01 -3.57 29.49 C-4.18 33.03 -4.79 36.58 -5.4 40.12 C-6.59 47.08 -7.79 54.04 -9 61 C-14.28 61 -19.56 61 -25 61 C-24.42 53.15 -23.32 45.52 -21.84 37.8 C-21.5 35.98 -21.16 34.15 -20.82 32.32 C-19.15 23.46 -19.15 23.46 -18 20 C-20.97 20 -23.94 20 -27 20 C-27.52 15.06 -27.52 15.06 -26 12 C-21.64 8.98 -16.89 7.02 -12 5 C-10.8 4.49 -9.6 3.97 -8.4 3.45 C-5.62 2.26 -2.82 1.12 0 0 Z " fill="#1E7E3E" transform="translate(27,0)"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 60">
|
|
2
|
+
<path d="M0 0 C0 1.98 0 3.96 0 6 C-0.87 6.23 -1.74 6.46 -2.63 6.7 C-11.66 9.21 -17.13 11.56 -22 20 C-21.58 19.97 -21.58 19.97 -19.47 19.79 C-12.32 19.44 -7.6 19.67 -1.75 24.31 C2.7 28.61 3.18 31.86 3.44 37.88 C3.25 44.78 1.58 49.42 -3.31 54.31 C-10.53 58.84 -16.64 60.17 -25.17 58.6 C-31.06 56.84 -34.71 53.08 -38 48 C-41.66 40.63 -41.68 32.95 -40 25 C-36.36 14.87 -31.17 7.78 -21.44 3.12 C-14.17 0.11 -7.78 -0.14 0 0 Z M-26 30 C-26.69 43.97 -26.69 43.97 -24.12 47.81 C-21.55 50.46 -20.74 50.94 -17.06 51.25 C-14 51 -14 51 -12.19 49.69 C-9.67 46.11 -9.5 42.22 -10 38 C-11.11 34.42 -12.33 31.67 -15 29 C-19.28 27.57 -21.85 28.51 -26 30 Z " fill="#DB0816" transform="translate(73,1)"/>
|
|
3
|
+
<path d="M0 0 C2.54 1.99 4.54 4.08 6 7 C6.58 12.88 5.3 16.15 2 21 C2.21 21.24 2.21 21.24 3.28 22.46 C3.83 23.09 4.37 23.72 4.94 24.38 C5.48 25 6.03 25.63 6.59 26.27 C10.11 30.58 9.53 35.68 9 41 C6.92 46.74 1.22 51.04 -4.06 53.75 C-10.36 56.21 -18.46 56.87 -25.06 55.38 C-28.62 53.71 -29.87 52.24 -32 49 C-30.55 44.42 -30.55 44.42 -28.19 42.62 C-25.35 41.81 -23.81 42.11 -21 43 C-20.26 43.52 -19.52 44.03 -18.75 44.56 C-14.85 46.6 -11.31 46.74 -7 46 C-4.94 44.38 -4.94 44.38 -4 42 C-3.75 39 -3.75 39 -4 36 C-4.04 35.26 -4.08 34.52 -4.12 33.75 C-5 32 -5 32 -7.38 30.81 C-12.12 29.5 -17.11 29.33 -22 29 C-22 27.35 -22 25.7 -22 24 C-21.16 23.59 -20.31 23.18 -19.45 22.76 C-18.34 22.21 -17.23 21.67 -16.12 21.12 C-15.57 20.86 -15.01 20.59 -14.44 20.31 C-11.92 19.06 -10 18 -8 16 C-7.75 13.5 -7.75 13.5 -8 11 C-10.49 8.51 -11.43 8.68 -14.88 8.62 C-19.61 8.72 -19.61 8.72 -22.44 10.75 C-22.7 11.12 -22.7 11.12 -24 13 C-24.58 13.74 -25.16 14.48 -25.75 15.25 C-26.16 15.83 -26.58 16.41 -27 17 C-28.65 16.01 -30.3 15.02 -32 14 C-31.33 8.28 -28.72 4.68 -24.69 0.75 C-16.93 -4.3 -8.11 -4.32 0 0 Z " fill="#DB0816" transform="translate(111,4)"/>
|
|
4
|
+
<path d="M0 0 C0.33 16.83 0.66 33.66 1 51 C3.64 51.66 6.28 52.32 9 53 C9 54.98 9 56.96 9 59 C-0.9 59 -10.8 59 -21 59 C-21 57.02 -21 55.04 -21 53 C-18.69 52.34 -16.38 51.68 -14 51 C-13.67 38.79 -13.34 26.58 -13 14 C-15.97 14.66 -18.94 15.32 -22 16 C-22 14.02 -22 12.04 -22 10 C-2.3 0 -2.3 0 0 0 Z " fill="#DB0816" transform="translate(22,0)"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="background" x1="80%" y1="0%" x2="24%" y2="100%">
|
|
4
|
+
<stop stop-color="#d2ee15"/><stop offset=".4" stop-color="#f5dc12"/><stop offset=".72" stop-color="#ff9c03"/><stop offset="1" stop-color="#ff6d00"/>
|
|
5
|
+
</linearGradient>
|
|
6
|
+
</defs>
|
|
7
|
+
<path d="M0 0 C1.79 0.03 3.57 0 5.35 -0.03 C14.92 0.02 14.92 0.02 18.06 2.38 C21.09 6.42 20.53 12.06 20.44 16.86 C20.41 18.65 20.44 20.43 20.47 22.21 C20.42 31.78 20.42 31.78 18.06 34.93 C14.03 37.95 8.38 37.39 3.58 37.3 C1.79 37.28 0.01 37.3 -1.77 37.34 C-11.34 37.28 -11.34 37.28 -14.48 34.93 C-17.51 30.89 -16.95 25.25 -16.86 20.44 C-16.84 18.65 -16.86 16.88 -16.89 15.09 C-16.84 5.52 -16.84 5.52 -14.48 2.38 C-10.45 -0.65 -4.8 -0.09 0 0 Z " fill="url(#background)" transform="translate(16.2109375,-0.65185546875)"/>
|
|
8
|
+
<path d="M0 0 C0.98 -0 1.97 -0 2.98 -0 C4.02 -0 5.06 0 6.12 0.01 C6.64 0.01 6.64 0.01 9.27 -0 C10.25 -0 11.24 -0 12.25 0 C13.16 0 14.07 0 15.01 0 C17.12 0.13 17.12 0.13 18.12 1.13 C18.25 2.7 18.25 2.7 18.26 4.7 C18.26 5.05 18.26 5.05 18.26 6.86 C18.26 7.61 18.25 8.36 18.25 9.13 C18.25 9.51 18.25 9.51 18.26 11.41 C18.26 12.12 18.26 12.83 18.26 13.57 C18.26 14.23 18.26 14.89 18.25 15.57 C18.12 17.13 18.12 17.13 17.12 18.13 C15.5 18.23 13.88 18.26 12.25 18.27 C11.27 18.27 10.28 18.27 9.27 18.27 C8.23 18.27 7.19 18.26 6.12 18.26 C5.61 18.26 5.61 18.26 2.98 18.27 C2 18.27 1.01 18.27 0 18.27 C-0.91 18.26 -1.82 18.26 -2.76 18.26 C-4.88 18.13 -4.88 18.13 -5.88 17.13 C-6 15.57 -6 15.57 -6.01 13.57 C-6.01 12.86 -6.01 12.14 -6.01 11.41 C-6.01 10.66 -6 9.91 -6 9.13 C-6 8.38 -6.01 7.63 -6.01 6.86 C-6.01 6.15 -6.01 5.43 -6.01 4.7 C-6.01 4.04 -6.01 3.38 -6 2.7 C-5.71 -0.85 -2.92 0 0 0 Z M-0.88 3.13 C3.12 7.13 3.12 7.13 5 8.13 C8.49 8.13 10.4 6.24 13.12 4.13 C13.12 3.8 13.12 3.47 13.12 3.13 C8.5 3.13 3.88 3.13 -0.88 3.13 Z M-3.88 5.13 C-3.88 8.43 -3.88 11.73 -3.88 15.13 C2.73 15.13 9.33 15.13 16.12 15.13 C16.12 11.83 16.12 8.53 16.12 5.13 C15.43 5.57 15.43 5.57 11.94 7.76 C7.51 10.21 7.51 10.21 4.44 9.63 C3.67 9.14 2.91 8.64 2.12 8.13 C1.03 7.58 -0.08 7.04 -1.19 6.51 C-2.07 6.05 -2.96 5.6 -3.88 5.13 Z " fill="#FFFFFF" transform="translate(11.875,8.8671875)"/>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 54 38">
|
|
2
|
+
<path d="M0 0 C0.68 -0.03 1.36 -0.05 2.05 -0.08 C4.92 0.38 6.08 1.17 8.12 3.25 C8.52 5.79 8.66 7.9 8.62 10.44 C8.62 11.14 8.62 11.84 8.63 12.56 C8.62 14.03 8.61 15.51 8.59 16.98 C8.56 19.24 8.57 21.5 8.58 23.76 C8.58 25.19 8.57 26.63 8.56 28.06 C8.56 28.74 8.56 29.41 8.57 30.11 C8.51 32.96 8.43 34.82 6.73 37.17 C3.52 39.33 -0.18 38.82 -3.88 38.25 C-8.77 35.45 -12.26 30.53 -15.88 26.25 C-16.39 25.67 -16.9 25.1 -17.43 24.5 C-20.88 20.59 -20.88 20.59 -20.88 17.25 C-17.44 17.83 -15.91 18.9 -13.56 21.44 C-11.18 23.91 -8.8 26.33 -6.25 28.62 C-5.72 29.11 -5.19 29.59 -4.65 30.09 C-2.88 31.25 -2.88 31.25 2.12 32.25 C2.12 23.67 2.12 15.09 2.12 6.25 C-3.81 8.23 -5.83 9.74 -10.04 13.89 C-10.65 14.34 -11.25 14.79 -11.88 15.25 C-12.87 14.92 -13.86 14.59 -14.88 14.25 C-13.4 11.02 -11.56 8.36 -9.38 5.56 C-8.77 4.77 -8.16 3.99 -7.53 3.18 C-5.15 0.41 -3.52 0.08 0 0 Z " fill="#2984EF" transform="translate(45.875,-0.25)"/>
|
|
3
|
+
<path d="M0 0 C2.14 1.68 3.37 2.93 5 5 C5.28 5.29 5.28 5.29 6.67 6.79 C9.93 10.31 9.93 10.31 11 12 C10.67 12.99 10.34 13.98 10 15 C6.31 13.33 3.79 11.11 0.88 8.34 C-1 7 -1 7 -6 6 C-6 14.58 -6 23.16 -6 32 C-1.03 30.34 1.07 29.49 4.88 26.38 C5.66 25.74 6.44 25.11 7.24 24.46 C7.82 23.98 8.4 23.5 9 23 C9.66 23.33 10.32 23.66 11 24 C8.53 29.3 5.32 34.04 1 38 C-2.21 39.01 -4.79 39 -8 38 C-10.1 36.91 -10.1 36.91 -12 35 C-12.41 32.46 -12.56 30.35 -12.53 27.81 C-12.54 27.11 -12.54 26.41 -12.54 25.69 C-12.55 24.22 -12.54 22.74 -12.52 21.27 C-12.5 19.01 -12.52 16.75 -12.55 14.49 C-12.54 13.06 -12.54 11.62 -12.53 10.19 C-12.54 9.51 -12.55 8.84 -12.56 8.14 C-12.49 4.94 -12.39 3.4 -10.09 1.08 C-6.69 -0.68 -3.73 -0.78 0 0 Z " fill="#2984EF" transform="translate(12,0)"/>
|
|
4
|
+
</svg>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { t } from '../../i18n/i18n';
|
|
3
|
-
import { computed, ref } from 'vue';
|
|
4
|
-
import { Check, ChevronRight, FileText, Pencil, Search, Undo2, X } from 'lucide-vue-next';
|
|
3
|
+
import { computed, ref, watch } from 'vue';
|
|
4
|
+
import { Check, ChevronRight, FileText, Pencil, Plug, Search, Undo2, X } from 'lucide-vue-next';
|
|
5
5
|
import type { AssistantProposal, ReferenceIdentity } from '@tano/protocol';
|
|
6
6
|
import { isDataTableFilePath } from '@tano/protocol';
|
|
7
|
+
import { resolveAssistantExtension, useWorkbenchRuntime, type WorkbenchAssistantProposalCardDescriptor } from '../../runtime';
|
|
7
8
|
import ChangeDiff from './ChangeDiff.vue';
|
|
9
|
+
import PluginToolProposalCard from './PluginToolProposalCard.vue';
|
|
8
10
|
import TaskProposalPreview from './TaskProposalPreview.vue';
|
|
9
11
|
|
|
10
12
|
const props = defineProps<{ proposals: AssistantProposal[]; busy: boolean }>();
|
|
@@ -12,66 +14,140 @@ const emit = defineEmits<{
|
|
|
12
14
|
review: [proposal: AssistantProposal, apply?: boolean]; reject: [proposal: AssistantProposal];
|
|
13
15
|
verify: [proposal: AssistantProposal]; undo: [proposal: AssistantProposal];
|
|
14
16
|
suggestions: [proposal: AssistantProposal]; openReference: [identity: ReferenceIdentity];
|
|
17
|
+
sendFollowUp: [payload: { prompt: string; autoSend?: boolean }];
|
|
15
18
|
}>();
|
|
16
19
|
const checks = ref<Record<string, boolean>>({});
|
|
17
20
|
const expanded = ref<Record<string, boolean>>({});
|
|
21
|
+
const assistantExtension = computed(() => {
|
|
22
|
+
try {
|
|
23
|
+
return resolveAssistantExtension(useWorkbenchRuntime());
|
|
24
|
+
} catch {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const isPluginOrExtension = (proposal: AssistantProposal) =>
|
|
29
|
+
proposal.kind === 'plugin' || proposal.kind === 'extension';
|
|
30
|
+
const proposalEffect = (proposal: AssistantProposal) =>
|
|
31
|
+
proposal.kind === 'extension' ? proposal.extensionAction?.effect : proposal.pluginAction?.effect;
|
|
32
|
+
function extensionCard(proposal: AssistantProposal): WorkbenchAssistantProposalCardDescriptor | undefined {
|
|
33
|
+
return isPluginOrExtension(proposal) ? assistantExtension.value?.proposalCard?.(proposal) : undefined;
|
|
34
|
+
}
|
|
18
35
|
const statuses = { ready: '', get applying() { return t('正在应用'); }, applied: '', get rejected() { return t('已放弃'); }, get conflicted() { return t('存在冲突'); }, get unknown() { return t('结果待核对'); } };
|
|
19
|
-
const labels = { get create() { return t('新增'); }, get edit() { return t('修改'); }, get delete() { return t('删除'); }, get rename() { return t('重命名'); }, get move() { return t('移动'); }, get object() { return t('对象'); }, get relation() { return t('关系'); } };
|
|
20
|
-
const isFile = (proposal: AssistantProposal) => !['object', 'relation'].includes(proposal.kind);
|
|
21
|
-
const canUndo = (proposal: AssistantProposal) =>
|
|
22
|
-
(proposal.
|
|
36
|
+
const labels = { get create() { return t('新增'); }, get edit() { return t('修改'); }, get delete() { return t('删除'); }, get rename() { return t('重命名'); }, get move() { return t('移动'); }, get object() { return t('对象'); }, get relation() { return t('关系'); }, get plugin() { return t('插件操作'); }, get extension() { return t('扩展操作'); } };
|
|
37
|
+
const isFile = (proposal: AssistantProposal) => !['object', 'relation', 'plugin', 'extension'].includes(proposal.kind);
|
|
38
|
+
const canUndo = (proposal: AssistantProposal) => {
|
|
39
|
+
if (proposal.status !== 'applied') return false;
|
|
40
|
+
if (isPluginOrExtension(proposal)) return !!assistantExtension.value?.canUndoProposal?.(proposal);
|
|
41
|
+
return proposal.kind === 'edit' || (proposal.kind === 'create' && !isDataTableFilePath(proposal.path));
|
|
42
|
+
};
|
|
23
43
|
const groups = computed(() => {
|
|
24
44
|
const result = new Map<string, { key: string; file: boolean; proposals: AssistantProposal[] }>();
|
|
25
45
|
for (const proposal of props.proposals) {
|
|
26
46
|
const file = isFile(proposal);
|
|
27
|
-
const key = file
|
|
47
|
+
const key = file
|
|
48
|
+
? `file:${proposal.fileId ?? proposal.applied?.fileId ?? proposal.path}`
|
|
49
|
+
: isPluginOrExtension(proposal)
|
|
50
|
+
? `${proposal.kind}:${proposal.id}`
|
|
51
|
+
: `${proposal.kind}:${proposal.fileId ?? proposal.path}`;
|
|
28
52
|
if (!result.has(key)) result.set(key, { key, file, proposals: [] });
|
|
29
53
|
result.get(key)!.proposals.push(proposal);
|
|
30
54
|
}
|
|
31
55
|
return [...result.values()];
|
|
32
56
|
});
|
|
33
57
|
const fileCount = computed(() => groups.value.filter(group => group.file).length);
|
|
34
|
-
const
|
|
58
|
+
const proposalKindLabel = (proposal: AssistantProposal) => {
|
|
59
|
+
if (isPluginOrExtension(proposal)) {
|
|
60
|
+
const custom = extensionCard(proposal);
|
|
61
|
+
if (custom?.kindLabel) return custom.kindLabel;
|
|
62
|
+
if (proposal.kind === 'extension') {
|
|
63
|
+
return proposal.extensionAction?.label || (proposalEffect(proposal) === 'external' ? t('外部调用') : t('扩展操作'));
|
|
64
|
+
}
|
|
65
|
+
return proposalEffect(proposal) === 'external' ? t('外部调用') : t('插件写入');
|
|
66
|
+
}
|
|
67
|
+
return labels[proposal.kind];
|
|
68
|
+
};
|
|
69
|
+
const groupLabel = (proposals: AssistantProposal[]) => [...new Set(proposals.map(proposalKindLabel))].join('、');
|
|
35
70
|
const proposalStatus = (proposal: AssistantProposal) => proposal.suggestionGroupId ? t('文档中审阅') : proposal.execution === 'direct' && proposal.status === 'ready' ? t('未完成') : statuses[proposal.status];
|
|
36
71
|
const groupStatus = (proposals: AssistantProposal[]) => [...new Set(proposals.map(proposalStatus).filter(Boolean))].join(' · ');
|
|
72
|
+
function defaultGroupOpen(group: { key: string; file: boolean; proposals: AssistantProposal[] }): boolean {
|
|
73
|
+
return !group.file && group.proposals.some(proposal => {
|
|
74
|
+
if (!isPluginOrExtension(proposal)) return false;
|
|
75
|
+
const custom = extensionCard(proposal);
|
|
76
|
+
return custom ? custom.defaultOpen !== false : true;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
watch(groups, list => {
|
|
80
|
+
for (const group of list) {
|
|
81
|
+
if (!Object.prototype.hasOwnProperty.call(expanded.value, group.key) && defaultGroupOpen(group)) {
|
|
82
|
+
expanded.value[group.key] = true;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, { immediate: true });
|
|
86
|
+
function applyButtonLabel(proposal: AssistantProposal): string {
|
|
87
|
+
if (proposal.kind === 'delete') return t('删除文件');
|
|
88
|
+
if (proposal.kind === 'rename') return t('应用重命名');
|
|
89
|
+
if (proposal.kind === 'move') return t('应用移动');
|
|
90
|
+
if (isPluginOrExtension(proposal)) {
|
|
91
|
+
const custom = extensionCard(proposal);
|
|
92
|
+
if (custom?.applyLabel) return custom.applyLabel;
|
|
93
|
+
if (proposal.kind === 'extension') {
|
|
94
|
+
return proposal.extensionAction?.label || (proposalEffect(proposal) === 'external' ? t('确认发起外部调用') : t('确认执行扩展操作'));
|
|
95
|
+
}
|
|
96
|
+
return proposalEffect(proposal) === 'external' ? t('确认发起外部调用') : t('确认执行插件操作');
|
|
97
|
+
}
|
|
98
|
+
return t('应用修改');
|
|
99
|
+
}
|
|
37
100
|
</script>
|
|
38
101
|
|
|
39
102
|
<template>
|
|
40
103
|
<section v-if="proposals.length" class="assistant-change-list" :aria-label="t('本轮文件变更清单')">
|
|
41
104
|
<header>
|
|
42
105
|
<div class="change-list-heading">
|
|
43
|
-
<strong>{{ fileCount ? t('文件变更') : t('工作区变更') }}</strong
|
|
106
|
+
<strong>{{ fileCount ? t('文件变更') : t('工作区变更') }}</strong>
|
|
107
|
+
<span v-if="fileCount">{{ fileCount }} {{ t('个文件 ·') }} {{ proposals.length }} {{ t('项操作') }}</span>
|
|
108
|
+
<span v-else>{{ proposals.length }} {{ t('项操作') }}</span>
|
|
44
109
|
</div>
|
|
45
110
|
</header>
|
|
46
|
-
<details v-for="group in groups" :key="group.key" class="assistant-file-change" @toggle="expanded[group.key] = ($event.target as HTMLDetailsElement).open">
|
|
111
|
+
<details v-for="group in groups" :key="group.key" class="assistant-file-change" v-bind="defaultGroupOpen(group) ? { open: true } : {}" @toggle="expanded[group.key] = ($event.target as HTMLDetailsElement).open">
|
|
47
112
|
<summary>
|
|
48
|
-
<ChevronRight class="change-chevron" :size="14" /><FileText :size="14" />
|
|
113
|
+
<ChevronRight class="change-chevron" :size="14" /><Plug v-if="isPluginOrExtension(group.proposals[0])" :size="14" /><FileText v-else :size="14" />
|
|
49
114
|
<span class="change-file-heading">
|
|
50
115
|
<span class="change-file-name">{{ group.proposals[0].preview?.path ?? group.proposals[0].path }}<span v-if="group.proposals.some(proposal => proposal.destination)" class="change-destination">→ {{ group.proposals.filter(proposal => proposal.destination).at(-1)?.destination }}</span></span>
|
|
51
|
-
<span class="change-kind" :class="`change-kind-${group.proposals[0].kind}
|
|
116
|
+
<span class="change-kind" :class="[`change-kind-${group.proposals[0].kind}`, proposalEffect(group.proposals[0]) === 'external' ? 'change-kind-external' : '']">{{ groupLabel(group.proposals) }}</span>
|
|
52
117
|
<small v-if="groupStatus(group.proposals)" class="change-file-status">{{ groupStatus(group.proposals) }}</small>
|
|
53
118
|
</span>
|
|
54
|
-
<button v-if="group.proposals.length === 1 && canUndo(group.proposals[0])" class="change-undo-action" :disabled="busy" @click.stop.prevent="emit('undo', group.proposals[0])"><Undo2 :size="14" />{{ t('撤回内容') }}</button>
|
|
119
|
+
<button v-if="group.proposals.length === 1 && canUndo(group.proposals[0])" class="change-undo-action" :disabled="busy" @click.stop.prevent="emit('undo', group.proposals[0])"><Undo2 :size="14" />{{ isPluginOrExtension(group.proposals[0]) ? t('撤回') : t('撤回内容') }}</button>
|
|
55
120
|
</summary>
|
|
56
121
|
<div v-if="expanded[group.key]" class="change-file-details">
|
|
57
122
|
<section v-for="proposal in group.proposals" :key="proposal.id" class="assistant-proposal" :aria-label="t('修改建议 {0}', [proposal.path])">
|
|
58
123
|
<div class="assistant-proposal-heading">
|
|
59
|
-
<strong>{{
|
|
60
|
-
<button v-if="group.proposals.length > 1 && canUndo(proposal)" class="change-undo-action" :disabled="busy" @click="emit('undo', proposal)"><Undo2 :size="14" />{{ t('撤回内容') }}</button>
|
|
124
|
+
<strong>{{ proposalKindLabel(proposal) }} · {{ proposal.preview?.path ?? proposal.path }}</strong><small v-if="group.proposals.length > 1 && proposalStatus(proposal)">{{ proposalStatus(proposal) }}</small>
|
|
125
|
+
<button v-if="group.proposals.length > 1 && canUndo(proposal)" class="change-undo-action" :disabled="busy" @click="emit('undo', proposal)"><Undo2 :size="14" />{{ isPluginOrExtension(proposal) ? t('撤回') : t('撤回内容') }}</button>
|
|
61
126
|
</div>
|
|
62
127
|
<p v-if="proposal.destination" class="proposal-path">{{ proposal.preview?.path ?? proposal.path }} → {{ proposal.destination }}</p>
|
|
63
128
|
<p>{{ proposal.reason }}</p>
|
|
64
129
|
<p v-if="proposal.kind === 'delete'" class="delete-note">{{ proposal.status === 'applied' ? t('文件已删除。') : t('将删除此文件。') }}{{ t('桌面文件可从回收站恢复;浏览器演示存储会直接删除。') }}</p>
|
|
65
|
-
<TaskProposalPreview v-if="!group.file" :proposal="proposal" @open-reference="emit('openReference', $event)" @ready="checks[proposal.id] = $event" />
|
|
130
|
+
<TaskProposalPreview v-if="!group.file && !isPluginOrExtension(proposal)" :proposal="proposal" @open-reference="emit('openReference', $event)" @ready="checks[proposal.id] = $event" />
|
|
131
|
+
<component
|
|
132
|
+
:is="extensionCard(proposal)!.component"
|
|
133
|
+
v-if="isPluginOrExtension(proposal) && extensionCard(proposal)"
|
|
134
|
+
:proposal="proposal"
|
|
135
|
+
:busy="busy"
|
|
136
|
+
@review="(target: AssistantProposal, apply?: boolean) => emit('review', target, apply)"
|
|
137
|
+
@reject="(target: AssistantProposal) => emit('reject', target)"
|
|
138
|
+
@undo="(target: AssistantProposal) => emit('undo', target)"
|
|
139
|
+
@send-follow-up="(payload: { prompt: string; autoSend?: boolean }) => emit('sendFollowUp', payload)"
|
|
140
|
+
/>
|
|
141
|
+
<PluginToolProposalCard v-else-if="proposal.kind === 'plugin'" :proposal="proposal" :busy="busy" />
|
|
66
142
|
<p v-if="proposal.error" class="assistant-message-error" role="alert">{{ proposal.error }}</p>
|
|
67
143
|
<p v-if="['rename', 'move'].includes(proposal.kind)" class="panel-hint">{{ t('文件内容保持不变。') }}</p>
|
|
68
|
-
<ChangeDiff v-else :before="proposal.applied?.before ?? proposal.preview?.before ?? proposal.base" :after="proposal.applied?.after ?? proposal.preview?.after ?? proposal.content"
|
|
69
|
-
:before-label="proposal.kind === 'create' ? t('尚未创建') : t('修改前')" :after-label="proposal.kind === 'delete' ? t('文件删除') : t('修改后')" />
|
|
70
|
-
<div v-if="['ready', 'conflicted', 'unknown'].includes(proposal.status)" class="assistant-proposal-actions">
|
|
144
|
+
<ChangeDiff v-else-if="!isPluginOrExtension(proposal) || extensionCard(proposal)?.hideDefaultDiff === false" :before="proposal.applied?.before ?? proposal.preview?.before ?? proposal.base" :after="proposal.applied?.after ?? proposal.preview?.after ?? proposal.content"
|
|
145
|
+
:before-label="proposal.kind === 'create' ? t('尚未创建') : isPluginOrExtension(proposal) ? t('执行前') : t('修改前')" :after-label="proposal.kind === 'delete' ? t('文件删除') : isPluginOrExtension(proposal) ? (proposal.status === 'applied' ? t('执行结果') : t('调用参数')) : t('修改后')" />
|
|
146
|
+
<div v-if="['ready', 'conflicted', 'unknown'].includes(proposal.status) && !extensionCard(proposal)?.hideDefaultActions" class="assistant-proposal-actions">
|
|
71
147
|
<button v-if="proposal.kind === 'edit' && !isDataTableFilePath(proposal.path) && ['ready', 'conflicted'].includes(proposal.status)" class="secondary-button" :disabled="busy" @click="emit('suggestions', proposal)"><Pencil :size="14" />{{ proposal.suggestionGroupId ? t('打开文档建议') : t('在文档中逐项审阅') }}</button>
|
|
72
148
|
<template v-if="!proposal.suggestionGroupId && ['ready', 'conflicted'].includes(proposal.status)">
|
|
73
|
-
<button class="secondary-button" :disabled="busy" @click="emit('review', proposal)"><Search :size="14" />{{ t('查看差异') }}</button>
|
|
74
|
-
<button v-if="proposal.preview && proposal.status === 'ready'" class="primary-button" :class="{ destructive: proposal.kind === 'delete' }" :disabled="busy || checks[proposal.id] === false" @click="emit('review', proposal, true)"><Check :size="14" />{{
|
|
149
|
+
<button v-if="!isPluginOrExtension(proposal)" class="secondary-button" :disabled="busy" @click="emit('review', proposal)"><Search :size="14" />{{ t('查看差异') }}</button>
|
|
150
|
+
<button v-if="(proposal.preview || isPluginOrExtension(proposal)) && proposal.status === 'ready'" class="primary-button" :class="{ destructive: proposal.kind === 'delete' }" :disabled="busy || checks[proposal.id] === false" @click="emit('review', proposal, true)"><Check :size="14" />{{ applyButtonLabel(proposal) }}</button>
|
|
75
151
|
<button class="icon-button" :data-tooltip="t('放弃建议')" :aria-label="t('放弃修改建议')" :disabled="busy" @click="emit('reject', proposal)"><X :size="15" /></button>
|
|
76
152
|
</template>
|
|
77
153
|
<button v-if="proposal.status === 'unknown'" class="secondary-button" :disabled="busy" @click="emit('verify', proposal)"><Search :size="14" />{{ t('核对写入结果') }}</button>
|
|
@@ -101,6 +177,7 @@ details[open] .change-chevron { transform: rotate(90deg); }
|
|
|
101
177
|
.change-destination { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
|
|
102
178
|
.change-kind { font-size: 10px; border-radius: 4px; padding: 2px 5px; background: var(--accent); color: var(--muted); }
|
|
103
179
|
.change-kind-create { color: var(--green); }
|
|
180
|
+
.change-kind-external { color: var(--warning, #9a620b); }
|
|
104
181
|
.change-kind-delete, .delete-note, .assistant-message-error { color: var(--danger); }
|
|
105
182
|
.change-file-details { padding: 0 12px 12px; }
|
|
106
183
|
.assistant-proposal + .assistant-proposal { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
|