@yancyyu/openhermit 1.6.42 → 1.6.43
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/README.md +98 -89
- package/bin/hermit.mjs +96 -0
- package/dist-renderer/assets/{ProjectEditorOverlay-DlFQ6mai.js → ProjectEditorOverlay-C98qSs7-.js} +1 -1
- package/dist-renderer/assets/{TeamGraphOverlay-D2TPMPGR.js → TeamGraphOverlay-CsBbZwcL.js} +1 -1
- package/dist-renderer/assets/{_basePickBy-Cmd0RHLQ.js → _basePickBy-ZOyLWjMK.js} +1 -1
- package/dist-renderer/assets/{_baseUniq-BI_iy8ea.js → _baseUniq-DBb726rt.js} +1 -1
- package/dist-renderer/assets/{arc-NzW2mjTP.js → arc-CdiTaR_R.js} +1 -1
- package/dist-renderer/assets/{architectureDiagram-VXUJARFQ-Bzq85AYv.js → architectureDiagram-VXUJARFQ-Cz3sc5TH.js} +1 -1
- package/dist-renderer/assets/{blockDiagram-VD42YOAC-D1PvYS-b.js → blockDiagram-VD42YOAC-DE4c-KJ3.js} +1 -1
- package/dist-renderer/assets/{c4Diagram-YG6GDRKO-D49RKzPC.js → c4Diagram-YG6GDRKO-CmTMDTrV.js} +1 -1
- package/dist-renderer/assets/channel-KTpqi9eT.js +1 -0
- package/dist-renderer/assets/{chunk-4BX2VUAB-fmI_MQmQ.js → chunk-4BX2VUAB-rhHy3tFl.js} +1 -1
- package/dist-renderer/assets/{chunk-55IACEB6-Xsv9RCXZ.js → chunk-55IACEB6-fLZBzuo_.js} +1 -1
- package/dist-renderer/assets/{chunk-B4BG7PRW-BE1KO8Um.js → chunk-B4BG7PRW-DOzxQhim.js} +1 -1
- package/dist-renderer/assets/{chunk-DI55MBZ5-tqJ7Mv7f.js → chunk-DI55MBZ5-COQCcXC5.js} +1 -1
- package/dist-renderer/assets/{chunk-FMBD7UC4-DMD45MVJ.js → chunk-FMBD7UC4-IKU9U_Y4.js} +1 -1
- package/dist-renderer/assets/{chunk-QN33PNHL-DOhGrz-q.js → chunk-QN33PNHL-D6WV154X.js} +1 -1
- package/dist-renderer/assets/{chunk-QZHKN3VN-D8yDgJdD.js → chunk-QZHKN3VN-D90_2DQp.js} +1 -1
- package/dist-renderer/assets/{chunk-TZMSLE5B-BcsEDu7A.js → chunk-TZMSLE5B-BQEil57G.js} +1 -1
- package/dist-renderer/assets/classDiagram-2ON5EDUG-lpzulY5X.js +1 -0
- package/dist-renderer/assets/classDiagram-v2-WZHVMYZB-lpzulY5X.js +1 -0
- package/dist-renderer/assets/clone-CriGymY9.js +1 -0
- package/dist-renderer/assets/{cose-bilkent-S5V4N54A-DlSqGHMX.js → cose-bilkent-S5V4N54A-6WiK6U2P.js} +1 -1
- package/dist-renderer/assets/{dagre-6UL2VRFP-BTT9tSAx.js → dagre-6UL2VRFP-DF4MMuTn.js} +1 -1
- package/dist-renderer/assets/{diagram-PSM6KHXK-Du-U-mK2.js → diagram-PSM6KHXK-CcF1eZ7E.js} +1 -1
- package/dist-renderer/assets/{diagram-QEK2KX5R-jFdHeKas.js → diagram-QEK2KX5R-DYlOVPQB.js} +1 -1
- package/dist-renderer/assets/{diagram-S2PKOQOG-DKLNK2bu.js → diagram-S2PKOQOG-BHXWsZOP.js} +1 -1
- package/dist-renderer/assets/{erDiagram-Q2GNP2WA-CZxHgIIo.js → erDiagram-Q2GNP2WA-GjmuBx8d.js} +1 -1
- package/dist-renderer/assets/{flowDiagram-NV44I4VS-v4XStCD0.js → flowDiagram-NV44I4VS-BuS7YVHk.js} +1 -1
- package/dist-renderer/assets/{ganttDiagram-JELNMOA3-DJjD_BEL.js → ganttDiagram-JELNMOA3-3Teu5tAa.js} +1 -1
- package/dist-renderer/assets/{gitGraphDiagram-V2S2FVAM-BNy-jr03.js → gitGraphDiagram-V2S2FVAM-BiLdCYu5.js} +1 -1
- package/dist-renderer/assets/{graph-DDTrn6je.js → graph-CDP_R8ct.js} +1 -1
- package/dist-renderer/assets/{index-BBp78BAu.js → index-BSZdT-g-.js} +1 -1
- package/dist-renderer/assets/{index-eotrJaYy.js → index-BhWvMqsz.js} +1 -1
- package/dist-renderer/assets/{index-D8_B-cfs.js → index-C2_AupSj.js} +1 -1
- package/dist-renderer/assets/{index-BQrwHZ-k.js → index-C5ujiwAR.js} +580 -588
- package/dist-renderer/assets/index-CIS2CTK9.css +1 -0
- package/dist-renderer/assets/{index-CRKQSG9S.js → index-CVNjLwkq.js} +1 -1
- package/dist-renderer/assets/{index-DR6Wz52b.js → index-CwG3se0q.js} +1 -1
- package/dist-renderer/assets/{infoDiagram-HS3SLOUP-DqnOsuza.js → infoDiagram-HS3SLOUP-DLHUFo72.js} +1 -1
- package/dist-renderer/assets/{journeyDiagram-XKPGCS4Q-DTobaO1d.js → journeyDiagram-XKPGCS4Q-BE07RpJD.js} +1 -1
- package/dist-renderer/assets/{kanban-definition-3W4ZIXB7-HbwVOvWc.js → kanban-definition-3W4ZIXB7-DDHZy4NB.js} +1 -1
- package/dist-renderer/assets/{layout--VYmTcw2.js → layout-5nA5wUxO.js} +1 -1
- package/dist-renderer/assets/{linear-BsJh89Mr.js → linear-BtF1i2qN.js} +1 -1
- package/dist-renderer/assets/{mindmap-definition-VGOIOE7T-BZqUZePd.js → mindmap-definition-VGOIOE7T-Z1Ui9Sqy.js} +1 -1
- package/dist-renderer/assets/{pieDiagram-ADFJNKIX-B1q_nH6P.js → pieDiagram-ADFJNKIX-LCjxckWv.js} +1 -1
- package/dist-renderer/assets/{quadrantDiagram-AYHSOK5B-UD8QhSEu.js → quadrantDiagram-AYHSOK5B-BOwKjSco.js} +1 -1
- package/dist-renderer/assets/{requirementDiagram-UZGBJVZJ-BA_i7Nw8.js → requirementDiagram-UZGBJVZJ-pChP8Znd.js} +1 -1
- package/dist-renderer/assets/{sankeyDiagram-TZEHDZUN-CMTnX-2d.js → sankeyDiagram-TZEHDZUN-DifZ2qpo.js} +1 -1
- package/dist-renderer/assets/{sequenceDiagram-WL72ISMW-BQXDB615.js → sequenceDiagram-WL72ISMW-CJg-WYyY.js} +1 -1
- package/dist-renderer/assets/{splashScene-D0YB9uxm.js → splashScene-94xWCzLA.js} +1 -1
- package/dist-renderer/assets/{stateDiagram-FKZM4ZOC-BAsPXy6X.js → stateDiagram-FKZM4ZOC-DWHOoFdv.js} +1 -1
- package/dist-renderer/assets/stateDiagram-v2-4FDKWEC3-CGYZOoMb.js +1 -0
- package/dist-renderer/assets/{timeline-definition-IT6M3QCI-BdasmVkC.js → timeline-definition-IT6M3QCI-CPgokIo8.js} +1 -1
- package/dist-renderer/assets/{treemap-GDKQZRPO-BkKQqIui.js → treemap-GDKQZRPO-DAVqSR9L.js} +1 -1
- package/dist-renderer/assets/{xychartDiagram-PRI3JC2R-EAlPHOdx.js → xychartDiagram-PRI3JC2R-CCOcGbrD.js} +1 -1
- package/dist-renderer/chat-community-qr.jpg +0 -0
- package/dist-renderer/fonts/Agave-Bold.ttf +0 -0
- package/dist-renderer/fonts/Agave-Regular.ttf +0 -0
- package/dist-renderer/icon.png +0 -0
- package/dist-renderer/icon.rar +0 -0
- package/dist-renderer/index.html +3 -3
- package/package.json +21 -26
- package/src/features/worker-society/core/application/WorkerSocietyService.test.ts +802 -0
- package/src/features/worker-society/core/application/WorkerSocietyService.ts +428 -0
- package/src/features/worker-society/core/application/fakes.ts +101 -0
- package/src/features/worker-society/core/application/ports.ts +70 -0
- package/src/features/worker-society/core/domain/models/society.ts +141 -0
- package/src/features/worker-society/core/domain/policies/societyPolicies.test.ts +739 -0
- package/src/features/worker-society/core/domain/policies/societyPolicies.ts +496 -0
- package/src/features/worker-society/main/adapters/input/societyMcp.test.ts +317 -0
- package/src/features/worker-society/main/adapters/input/societyMcp.ts +257 -0
- package/src/features/worker-society/main/adapters/input/societyRoutes.test.ts +695 -0
- package/src/features/worker-society/main/adapters/input/societyRoutes.ts +194 -0
- package/src/features/worker-society/main/composition/societyComposition.test.ts +74 -0
- package/src/features/worker-society/main/composition/societyComposition.ts +70 -0
- package/src/features/worker-society/main/composition/workerSocietyPlugin.test.ts +69 -0
- package/src/features/worker-society/main/composition/workerSocietyPlugin.ts +67 -0
- package/src/features/worker-society/main/infrastructure/crossTeamMessageGateway.test.ts +132 -0
- package/src/features/worker-society/main/infrastructure/crossTeamMessageGateway.ts +84 -0
- package/src/features/worker-society/main/infrastructure/fsStores.test.ts +216 -0
- package/src/features/worker-society/main/infrastructure/fsStores.ts +113 -0
- package/src/features/worker-society/main/infrastructure/mergingProfileStore.test.ts +195 -0
- package/src/features/worker-society/main/infrastructure/mergingProfileStore.ts +96 -0
- package/src/features/worker-society/renderer/SocietyGraph.tsx +166 -0
- package/src/features/worker-society/renderer/SocietyNodeLabels.tsx +139 -0
- package/src/features/worker-society/renderer/SocietyNodeOverlay.tsx +339 -0
- package/src/features/worker-society/renderer/SocietyView.tsx +437 -0
- package/src/features/worker-society/renderer/index.ts +11 -0
- package/src/features/worker-society/renderer/societyApi.test.ts +259 -0
- package/src/features/worker-society/renderer/societyApi.ts +144 -0
- package/src/features/worker-society/renderer/societyGraphAdapter.test.ts +321 -0
- package/src/features/worker-society/renderer/societyGraphAdapter.ts +240 -0
- package/src/features/worker-society/renderer/societyOverlayActions.test.ts +57 -0
- package/src/features/worker-society/renderer/societyOverlayActions.ts +49 -0
- package/src/features/worker-society/renderer/societyStore.test.ts +218 -0
- package/src/features/worker-society/renderer/societyStore.ts +146 -0
- package/src/features/worker-society/renderer/societyViewUtils.test.ts +81 -0
- package/src/features/worker-society/renderer/societyViewUtils.ts +68 -0
- package/src/main/ipc/extensions.ts +27 -0
- package/src/main/server.ts +1709 -534
- package/src/main/services/ccConnect/CcConnectBridge.ts +26 -11
- package/src/main/services/ccConnect/CcConnectClient.ts +9 -2
- package/src/main/services/ccConnect/workDirReconcile.test.ts +57 -0
- package/src/main/services/ccConnect/workDirReconcile.ts +36 -0
- package/src/main/services/direct-cli/DirectCliSessionManager.test.ts +397 -0
- package/src/main/services/direct-cli/DirectCliSessionManager.ts +508 -0
- package/src/main/services/direct-cli/DirectCliSessionStore.test.ts +79 -0
- package/src/main/services/direct-cli/DirectCliSessionStore.ts +97 -0
- package/src/main/services/direct-cli/__tests__/directCliMessageId.test.ts +40 -0
- package/src/main/services/direct-cli/directCliMessageId.ts +21 -0
- package/src/main/services/direct-cli/index.ts +17 -0
- package/src/main/services/extensions/capability-packs/CapabilityPackLoaderService.ts +637 -0
- package/src/main/services/extensions/catalog/PluginCatalogService.ts +2 -2
- package/src/main/services/loop-assets/LoopAssetsScannerService.ts +657 -0
- package/src/main/services/runtime/providerAwareCliEnv.ts +33 -5
- package/src/main/services/session-intelligence/LocalSessionScanner.ts +156 -71
- package/src/main/services/session-intelligence/SessionUsageParser.ts +103 -8
- package/src/main/services/session-intelligence/UsageTelemetryService.ts +11 -0
- package/src/main/services/session-intelligence/__tests__/teamSessionListMapper.test.ts +104 -0
- package/src/main/services/session-intelligence/teamSessionListMapper.ts +78 -0
- package/src/main/services/system-manager/AdminLoopInitializer.ts +95 -0
- package/src/main/services/system-manager/BuiltinWorkflowSeeder.ts +679 -74
- package/src/main/services/system-manager/SystemManagerConfigService.ts +19 -1
- package/src/main/services/system-manager/WorkflowPromptService.ts +58 -5
- package/src/main/services/system-manager/__tests__/AdminLoopInitializer.test.ts +129 -0
- package/src/main/services/system-manager/__tests__/SystemManagerConfigService.test.ts +60 -0
- package/src/main/services/teams-mvp/CollaborationBoardService.ts +2 -0
- package/src/main/services/teams-mvp/OpsRunbookContext.ts +60 -0
- package/src/main/services/teams-mvp/TaskDispatchService.test.ts +305 -0
- package/src/main/services/teams-mvp/TaskDispatchService.ts +250 -131
- package/src/main/services/teams-mvp/TeamProvisioningService.ts +12 -2
- package/src/main/services/teams-mvp/TeamWorkspaceService.test.ts +207 -0
- package/src/main/services/teams-mvp/TeamWorkspaceService.ts +104 -51
- package/src/main/services/teams-mvp/index.ts +6 -0
- package/src/main/utils/externalPlatformSessionRouting.ts +92 -0
- package/src/main/utils/toolApprovalRules.ts +151 -0
- package/src/renderer/App.tsx +24 -89
- package/src/renderer/api/httpClient.ts +115 -37
- package/src/renderer/api/providers.ts +5 -16
- package/src/renderer/components/chat/CommunityChatView.tsx +81 -0
- package/src/renderer/components/dashboard/DashboardView.tsx +130 -84
- package/src/renderer/components/extensions/ExtensionStoreView.tsx +39 -5
- package/src/renderer/components/extensions/ExtensionsSubTabTrigger.tsx +2 -1
- package/src/renderer/components/extensions/capability-packs/CapabilityPacksPanel.tsx +170 -0
- package/src/renderer/components/layout/PaneContent.tsx +10 -2
- package/src/renderer/components/layout/SortableTab.tsx +4 -0
- package/src/renderer/components/layout/TabBarActions.tsx +13 -16
- package/src/renderer/components/runtime/ProviderRuntimeSettingsDialog.tsx +4 -135
- package/src/renderer/components/schedules/SchedulesView.tsx +22 -14
- package/src/renderer/components/schedules/calendar/CalendarEventBlock.tsx +7 -6
- package/src/renderer/components/settings/SettingsTabs.tsx +24 -21
- package/src/renderer/components/settings/SettingsView.tsx +22 -13
- package/src/renderer/components/settings/components/SettingRow.tsx +13 -5
- package/src/renderer/components/settings/components/SettingsSectionCard.tsx +53 -0
- package/src/renderer/components/settings/components/SettingsSectionHeader.tsx +10 -6
- package/src/renderer/components/settings/components/SettingsSelect.tsx +12 -9
- package/src/renderer/components/settings/components/SettingsToggle.tsx +6 -5
- package/src/renderer/components/settings/components/index.ts +1 -0
- package/src/renderer/components/settings/sections/AdvancedSection.tsx +78 -59
- package/src/renderer/components/settings/sections/CliStatusSection.tsx +32 -44
- package/src/renderer/components/settings/sections/ConfigEditorDialog.tsx +1 -1
- package/src/renderer/components/settings/sections/GeneralSection.tsx +216 -186
- package/src/renderer/components/settings/sections/PlatformsSection.tsx +25 -17
- package/src/renderer/components/settings/sections/TaskBusSection.tsx +63 -22
- package/src/renderer/components/sidebar/SidebarSessions.tsx +120 -80
- package/src/renderer/components/sidebar/SidebarTaskItem.tsx +1 -1
- package/src/renderer/components/splash/splashScene.ts +6 -2
- package/src/renderer/components/system-manager/SystemManagerView.tsx +169 -255
- package/src/renderer/components/tasks/TasksView.tsx +63 -37
- package/src/renderer/components/team/CcSessionsSection.tsx +124 -89
- package/src/renderer/components/team/HarnessBrandLogos.tsx +318 -0
- package/src/renderer/components/team/HarnessSelect.tsx +25 -26
- package/src/renderer/components/team/TeamDetailView.tsx +137 -153
- package/src/renderer/components/team/TeamEmptyState.tsx +9 -37
- package/src/renderer/components/team/TeamListView.tsx +143 -30
- package/src/renderer/components/team/__tests__/CcSessionsSection.hasLocalFile.test.tsx +128 -0
- package/src/renderer/components/team/activity/ActivityItem.tsx +21 -9
- package/src/renderer/components/team/activity/ActivityTimeline.tsx +2 -2
- package/src/renderer/components/team/dialogs/AdvancedCliSection.tsx +1 -1
- package/src/renderer/components/team/dialogs/CreateTaskDialog.tsx +13 -10
- package/src/renderer/components/team/dialogs/CreateTeamDialog.tsx +156 -83
- package/src/renderer/components/team/dialogs/EditTeamDialog.tsx +9 -157
- package/src/renderer/components/team/dialogs/LaunchTeamDialog.tsx +19 -15
- package/src/renderer/components/team/dialogs/PlatformBindingDialog.tsx +48 -10
- package/src/renderer/components/team/dialogs/PlatformManualForm.tsx +11 -12
- package/src/renderer/components/team/dialogs/PlatformSetupQR.tsx +39 -37
- package/src/renderer/components/team/dialogs/RuntimeConfigDialog.tsx +434 -64
- package/src/renderer/components/team/dialogs/SendMessageDialog.tsx +12 -10
- package/src/renderer/components/team/dialogs/TaskDetailDialog.tsx +2 -2
- package/src/renderer/components/team/dialogs/__tests__/CreateTeamDialog.bindProject.test.tsx +399 -0
- package/src/renderer/components/team/dialogs/__tests__/CreateTeamDialog.chineseRepro.test.tsx +253 -0
- package/src/renderer/components/team/dialogs/platformAllowUtils.ts +91 -0
- package/src/renderer/components/team/dialogs/teammateRuntimeCompatibility.tsx +1 -1
- package/src/renderer/components/team/kanban/KanbanTaskCard.test.tsx +41 -0
- package/src/renderer/components/team/kanban/KanbanTaskCard.tsx +41 -86
- package/src/renderer/components/team/loop-console/LoopCommandComposer.tsx +310 -0
- package/src/renderer/components/team/loop-console/LoopConsolePanel.tsx +372 -0
- package/src/renderer/components/team/loop-console/loopSendIntent.test.ts +85 -0
- package/src/renderer/components/team/loop-console/loopSendIntent.ts +221 -0
- package/src/renderer/components/team/loop-console/useLeadSessionToolActivity.ts +74 -0
- package/src/renderer/components/team/loop-console/useLoopCommandSuggestions.ts +165 -0
- package/src/renderer/components/team/loop-console/useLoopConsoleController.ts +266 -0
- package/src/renderer/components/team/members/LeadModelRow.test.tsx +1 -1
- package/src/renderer/components/team/members/LeadModelRow.tsx +5 -3
- package/src/renderer/components/team/members/MemberDetailDialog.tsx +11 -0
- package/src/renderer/components/team/members/MemberDetailStats.tsx +13 -3
- package/src/renderer/components/team/members/MemberDraftRow.test.tsx +1 -1
- package/src/renderer/components/team/members/MemberDraftRow.tsx +1 -1
- package/src/renderer/components/team/members/MemberMessagesTab.tsx +2 -2
- package/src/renderer/components/team/members/MemberStatsTab.tsx +1 -1
- package/src/renderer/components/team/messages/MessageComposer.tsx +150 -44
- package/src/renderer/components/team/messages/MessagesFilterPopover.tsx +2 -2
- package/src/renderer/components/team/messages/MessagesPanel.tsx +34 -28
- package/src/renderer/components/team/schedule/CcCronScheduleDialog.tsx +6 -6
- package/src/renderer/components/team/taskLogs/ExactTaskLogCard.tsx +2 -2
- package/src/renderer/components/team/taskLogs/TaskLogStreamSection.tsx +1 -1
- package/src/renderer/components/terminal/TerminalPanel.tsx +2 -3
- package/src/renderer/components/ui/MentionableTextarea.tsx +5 -1
- package/src/renderer/constants/teamColors.ts +5 -5
- package/src/renderer/hooks/useExtensionsTabState.ts +1 -1
- package/src/renderer/hooks/useMentionDetection.ts +5 -1
- package/src/renderer/hooks/useProjectWorkflowCommands.ts +57 -0
- package/src/renderer/hooks/useTeamSuggestions.ts +2 -0
- package/src/renderer/index.css +19 -2
- package/src/renderer/main.tsx +7 -1
- package/src/renderer/store/index.ts +18 -1
- package/src/renderer/store/slices/extensionsSlice.ts +83 -0
- package/src/renderer/store/slices/tabSlice.ts +61 -0
- package/src/renderer/store/slices/teamSlice.ts +138 -9
- package/src/renderer/types/mention.ts +8 -0
- package/src/renderer/types/tabs.ts +3 -1
- package/src/renderer/utils/__tests__/bindProjectSlug.test.ts +69 -0
- package/src/renderer/utils/__tests__/groupTransformer.test.ts +148 -0
- package/src/renderer/utils/__tests__/initialRoute.test.ts +101 -0
- package/src/renderer/utils/__tests__/leadToolActivity.test.ts +124 -0
- package/src/renderer/utils/__tests__/mergeTeamMessages.test.ts +81 -0
- package/src/renderer/utils/__tests__/teamMessageFiltering.test.ts +213 -0
- package/src/renderer/utils/__tests__/teamMessageKey.test.ts +75 -0
- package/src/renderer/utils/__tests__/workflowCommandExecution.test.ts +173 -0
- package/src/renderer/utils/__tests__/workflowCommandSuggestions.test.ts +59 -0
- package/src/renderer/utils/bindProjectSlug.ts +57 -0
- package/src/renderer/utils/capabilityCommandExecution.ts +113 -0
- package/src/renderer/utils/initialRoute.ts +89 -0
- package/src/renderer/utils/leadToolActivity.ts +117 -0
- package/src/renderer/utils/loopShortcutSuggestions.ts +106 -0
- package/src/renderer/utils/mentionSuggestions.ts +1 -1
- package/src/renderer/utils/slashCommandRegistry.ts +231 -0
- package/src/renderer/utils/teamMentionDirective.ts +31 -0
- package/src/renderer/utils/workflowCommandExecution.ts +96 -0
- package/src/renderer/utils/workflowCommandSuggestions.ts +49 -0
- package/src/shared/types/api.ts +79 -4
- package/src/shared/types/ccConnect.ts +1 -0
- package/src/shared/types/extensions/api.ts +19 -0
- package/src/shared/types/extensions/capabilityPack.ts +118 -0
- package/src/shared/types/extensions/index.ts +29 -1
- package/src/shared/types/index.ts +6 -0
- package/src/shared/types/loopAssets.ts +54 -0
- package/src/shared/types/providers.ts +0 -16
- package/src/shared/types/systemManager.ts +26 -1
- package/src/shared/types/team.ts +41 -5
- package/src/shared/types/terminal.ts +2 -36
- package/src/shared/types/worker.test.ts +28 -0
- package/src/shared/types/worker.ts +3 -0
- package/src/shared/utils/__tests__/effortLevels.test.ts +88 -0
- package/src/shared/utils/__tests__/providerBackend.test.ts +88 -0
- package/src/shared/utils/__tests__/providerLaunchArgs.test.ts +220 -0
- package/src/shared/utils/claudeStreamJson.test.ts +187 -0
- package/src/shared/utils/claudeStreamJson.ts +153 -0
- package/src/shared/utils/providerLaunchArgs.ts +217 -0
- package/src/shared/utils/slashCommands.ts +10 -0
- package/src/types/node-pty.d.ts +8 -0
- package/dist-renderer/assets/channel-Ch7JrfUu.js +0 -1
- package/dist-renderer/assets/classDiagram-2ON5EDUG-z9I4AnFy.js +0 -1
- package/dist-renderer/assets/classDiagram-v2-WZHVMYZB-z9I4AnFy.js +0 -1
- package/dist-renderer/assets/clone-Dfi1Jx6l.js +0 -1
- package/dist-renderer/assets/index-iyjkpSus.css +0 -32
- package/dist-renderer/assets/stateDiagram-v2-4FDKWEC3-DTUIBfce.js +0 -1
- package/src/main/services/system-manager/SystemManagerPtyService.ts +0 -233
- package/src/renderer/components/common/TerminalPane.tsx +0 -213
- package/src/renderer/components/team/dialogs/useTeamEditForm.ts +0 -292
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { KNOWN_SLASH_COMMANDS, isSupportedSlashCommandName } from '@shared/utils/slashCommands';
|
|
2
|
+
|
|
3
|
+
import type { MentionSuggestion } from '@renderer/types/mention';
|
|
4
|
+
import type {
|
|
5
|
+
CapabilityCommand,
|
|
6
|
+
CapabilityScope,
|
|
7
|
+
LoadedCapabilityPack,
|
|
8
|
+
RegisteredSlashCommand,
|
|
9
|
+
SlashCommandResolveResult,
|
|
10
|
+
SlashCommandSource,
|
|
11
|
+
} from '@shared/types/extensions';
|
|
12
|
+
|
|
13
|
+
export const RESERVED_SLASH_COMMANDS = new Set([
|
|
14
|
+
...KNOWN_SLASH_COMMANDS.map((command) => command.name.toLowerCase()),
|
|
15
|
+
'help',
|
|
16
|
+
'settings',
|
|
17
|
+
'permissions',
|
|
18
|
+
'login',
|
|
19
|
+
'logout',
|
|
20
|
+
'mcp',
|
|
21
|
+
'agents',
|
|
22
|
+
'hooks',
|
|
23
|
+
'memory',
|
|
24
|
+
]);
|
|
25
|
+
|
|
26
|
+
interface SlashRegistryInput {
|
|
27
|
+
packs?: readonly LoadedCapabilityPack[];
|
|
28
|
+
scope?: CapabilityScope;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function normalizeAlias(alias: string): string {
|
|
32
|
+
return alias.trim().replace(/^\//, '').toLowerCase();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function normalizeNamespace(namespace: string): string {
|
|
36
|
+
return namespace.trim().replace(/^\//, '').toLowerCase();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function isRegistryToken(value: string): boolean {
|
|
40
|
+
return isSupportedSlashCommandName(value) && !value.includes(':');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function commandAppliesToScope(command: CapabilityCommand, scope?: CapabilityScope): boolean {
|
|
44
|
+
if (!scope) return true;
|
|
45
|
+
return command.scope.includes(scope);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function commandSupportsSlash(command: CapabilityCommand): boolean {
|
|
49
|
+
return command.surfaces.includes('slash');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface SlashCommandSuggestionOptions {
|
|
53
|
+
forceNamespacedAliases?: ReadonlySet<string>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function shouldUseNamespacedSlash(
|
|
57
|
+
command: RegisteredSlashCommand,
|
|
58
|
+
options: SlashCommandSuggestionOptions = {}
|
|
59
|
+
): boolean {
|
|
60
|
+
return (
|
|
61
|
+
RESERVED_SLASH_COMMANDS.has(command.alias) ||
|
|
62
|
+
options.forceNamespacedAliases?.has(command.alias) === true ||
|
|
63
|
+
Boolean(command.conflictsWith?.length)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function collectSlashSuggestionAliases(
|
|
68
|
+
suggestions: readonly MentionSuggestion[]
|
|
69
|
+
): Set<string> {
|
|
70
|
+
const aliases = new Set<string>();
|
|
71
|
+
for (const suggestion of suggestions) {
|
|
72
|
+
if (!suggestion.command) continue;
|
|
73
|
+
const commandName = suggestion.command.slice(1).split(/\s+/, 1)[0]?.toLowerCase();
|
|
74
|
+
if (commandName && !commandName.includes(':')) aliases.add(commandName);
|
|
75
|
+
}
|
|
76
|
+
return aliases;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function buildSlashCommandRegistry({
|
|
80
|
+
packs = [],
|
|
81
|
+
scope,
|
|
82
|
+
}: SlashRegistryInput): RegisteredSlashCommand[] {
|
|
83
|
+
const registered: RegisteredSlashCommand[] = [];
|
|
84
|
+
|
|
85
|
+
for (const pack of packs) {
|
|
86
|
+
if (!pack.enabled || pack.source === 'builtin') continue;
|
|
87
|
+
|
|
88
|
+
const packId = pack.manifest.id;
|
|
89
|
+
const namespace = normalizeNamespace(pack.manifest.namespace);
|
|
90
|
+
for (const command of pack.manifest.capabilities.commands ?? []) {
|
|
91
|
+
const alias = normalizeAlias(command.alias);
|
|
92
|
+
if (
|
|
93
|
+
!alias ||
|
|
94
|
+
!namespace ||
|
|
95
|
+
!isRegistryToken(alias) ||
|
|
96
|
+
!isRegistryToken(namespace) ||
|
|
97
|
+
!commandSupportsSlash(command) ||
|
|
98
|
+
!commandAppliesToScope(command, scope)
|
|
99
|
+
) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
registered.push({
|
|
104
|
+
canonicalId: `${packId}.${command.id}`,
|
|
105
|
+
alias,
|
|
106
|
+
namespace,
|
|
107
|
+
slash: `/${alias}`,
|
|
108
|
+
namespacedSlash: `/${namespace}:${alias}`,
|
|
109
|
+
source: 'pack',
|
|
110
|
+
packId,
|
|
111
|
+
command: {
|
|
112
|
+
...command,
|
|
113
|
+
alias,
|
|
114
|
+
execution: command.execution ?? {
|
|
115
|
+
type: scope === 'admin-loop' ? 'loop-session' : 'send-message',
|
|
116
|
+
reuse: true,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const byAlias = new Map<string, RegisteredSlashCommand[]>();
|
|
124
|
+
for (const command of registered) {
|
|
125
|
+
byAlias.set(command.alias, [...(byAlias.get(command.alias) ?? []), command]);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return registered
|
|
129
|
+
.map((command) => {
|
|
130
|
+
const aliasPeers = byAlias.get(command.alias) ?? [];
|
|
131
|
+
const conflictsWith = [
|
|
132
|
+
...aliasPeers
|
|
133
|
+
.filter((peer) => peer.canonicalId !== command.canonicalId)
|
|
134
|
+
.map((peer) => peer.canonicalId),
|
|
135
|
+
...(RESERVED_SLASH_COMMANDS.has(command.alias) ? [`official.${command.alias}`] : []),
|
|
136
|
+
];
|
|
137
|
+
return conflictsWith.length ? { ...command, conflictsWith } : command;
|
|
138
|
+
})
|
|
139
|
+
.sort(
|
|
140
|
+
(a, b) =>
|
|
141
|
+
(a.command.order ?? 999) - (b.command.order ?? 999) || a.alias.localeCompare(b.alias)
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function resolveSlashCommand(
|
|
146
|
+
registry: readonly RegisteredSlashCommand[],
|
|
147
|
+
input: string,
|
|
148
|
+
commandRef?: string
|
|
149
|
+
): SlashCommandResolveResult {
|
|
150
|
+
if (commandRef) {
|
|
151
|
+
const command = registry.find((entry) => entry.canonicalId === commandRef);
|
|
152
|
+
return command ? { status: 'resolved', command } : { status: 'not-found' };
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const normalized = input.trim().replace(/^\//, '').toLowerCase();
|
|
156
|
+
if (!normalized) return { status: 'not-found' };
|
|
157
|
+
|
|
158
|
+
if (normalized.includes(':')) {
|
|
159
|
+
const parts = normalized.split(':');
|
|
160
|
+
if (parts.length !== 2 || !isRegistryToken(parts[0]) || !isRegistryToken(parts[1])) {
|
|
161
|
+
return { status: 'not-found' };
|
|
162
|
+
}
|
|
163
|
+
const [namespace, alias] = parts;
|
|
164
|
+
const command = registry.find(
|
|
165
|
+
(entry) => entry.namespace === namespace && entry.alias === alias
|
|
166
|
+
);
|
|
167
|
+
return command ? { status: 'resolved', command } : { status: 'not-found' };
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const candidates = registry.filter((entry) => entry.alias === normalized);
|
|
171
|
+
if (candidates.length === 0) return { status: 'not-found' };
|
|
172
|
+
if (candidates.length > 1 || RESERVED_SLASH_COMMANDS.has(normalized)) {
|
|
173
|
+
return { status: 'conflict', candidates };
|
|
174
|
+
}
|
|
175
|
+
return { status: 'resolved', command: candidates[0] };
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function registeredSlashCommandToSuggestion(
|
|
179
|
+
registered: RegisteredSlashCommand,
|
|
180
|
+
options: SlashCommandSuggestionOptions = {}
|
|
181
|
+
): MentionSuggestion {
|
|
182
|
+
const command = shouldUseNamespacedSlash(registered, options)
|
|
183
|
+
? registered.namespacedSlash
|
|
184
|
+
: registered.slash;
|
|
185
|
+
const insertText = command.slice(1);
|
|
186
|
+
const conflictLabel = registered.conflictsWith?.length ? ' · use namespaced command' : '';
|
|
187
|
+
|
|
188
|
+
return {
|
|
189
|
+
id: `capability-command:${registered.canonicalId}`,
|
|
190
|
+
name: insertText,
|
|
191
|
+
type: 'command',
|
|
192
|
+
command,
|
|
193
|
+
commandRef: registered.canonicalId,
|
|
194
|
+
insertText,
|
|
195
|
+
description: registered.command.description ?? registered.command.title,
|
|
196
|
+
subtitle: `${registered.namespace} · ${registered.command.safety}${conflictLabel}`,
|
|
197
|
+
searchText: [
|
|
198
|
+
registered.command.title,
|
|
199
|
+
registered.command.description,
|
|
200
|
+
registered.alias,
|
|
201
|
+
registered.namespace,
|
|
202
|
+
registered.packId,
|
|
203
|
+
registered.command.safety,
|
|
204
|
+
]
|
|
205
|
+
.filter(Boolean)
|
|
206
|
+
.join(' '),
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export function buildCapabilityPackCommandSuggestions(
|
|
211
|
+
packs: readonly LoadedCapabilityPack[],
|
|
212
|
+
scope: CapabilityScope,
|
|
213
|
+
options: SlashCommandSuggestionOptions = {}
|
|
214
|
+
): MentionSuggestion[] {
|
|
215
|
+
return buildSlashCommandRegistry({ packs, scope }).map((registered) =>
|
|
216
|
+
registeredSlashCommandToSuggestion(registered, options)
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export function sourceLabel(source: SlashCommandSource): string {
|
|
221
|
+
switch (source) {
|
|
222
|
+
case 'builtin':
|
|
223
|
+
return 'Built-in';
|
|
224
|
+
case 'official':
|
|
225
|
+
return 'Official';
|
|
226
|
+
case 'project':
|
|
227
|
+
return 'Project';
|
|
228
|
+
case 'pack':
|
|
229
|
+
return 'Capability pack';
|
|
230
|
+
}
|
|
231
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses a leading "@team subject" directive from a message body.
|
|
3
|
+
*
|
|
4
|
+
* Accepts both the ASCII '@' (U+0040) and the full-width '@' (U+FF20) so a
|
|
5
|
+
* mention typed under a CJK IME still routes cross-team. Without this, a
|
|
6
|
+
* full-width '@' fails the dispatch regex, the message falls through to a
|
|
7
|
+
* local send, and the user's own team answers instead of the mentioned one.
|
|
8
|
+
*
|
|
9
|
+
* Only the trigger character is normalized here; case / slug resolution is left
|
|
10
|
+
* to each caller (MessageComposer vs loopSendIntent), which already differ.
|
|
11
|
+
*
|
|
12
|
+
* `\s` already covers the full-width space (U+3000), so no special separator
|
|
13
|
+
* handling is needed.
|
|
14
|
+
*/
|
|
15
|
+
const TEAM_MENTION_DIRECTIVE_RE = /^[@@]([^\s]+)\s+([\s\S]+)$/;
|
|
16
|
+
|
|
17
|
+
export interface TeamMentionDirective {
|
|
18
|
+
/** Token after the trigger, up to the first whitespace (team slug or display name). */
|
|
19
|
+
mentioned: string;
|
|
20
|
+
/** Everything after the separating whitespace, trimmed. */
|
|
21
|
+
subject: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function parseTeamMentionDirective(text: string): TeamMentionDirective | null {
|
|
25
|
+
const match = text.match(TEAM_MENTION_DIRECTIVE_RE);
|
|
26
|
+
if (!match) return null;
|
|
27
|
+
const mentioned = match[1];
|
|
28
|
+
const subject = match[2]?.trim();
|
|
29
|
+
if (!mentioned || !subject) return null;
|
|
30
|
+
return { mentioned, subject };
|
|
31
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { api } from '@renderer/api';
|
|
2
|
+
import { parseStandaloneSlashCommand } from '@shared/utils/slashCommands';
|
|
3
|
+
|
|
4
|
+
import type { MentionSuggestion } from '@renderer/types/mention';
|
|
5
|
+
import type { SlashCommandMeta } from '@shared/types/team';
|
|
6
|
+
import type { WorkflowPromptSummary } from '@shared/types/systemManager';
|
|
7
|
+
|
|
8
|
+
export interface ResolvedWorkflowCommand {
|
|
9
|
+
folder: string;
|
|
10
|
+
id: string;
|
|
11
|
+
command: `/${string}`;
|
|
12
|
+
args?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ExpandedWorkflowCommand {
|
|
16
|
+
text: string;
|
|
17
|
+
summary: string;
|
|
18
|
+
slashCommand: SlashCommandMeta;
|
|
19
|
+
prompt: WorkflowPromptSummary;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Append trailing user arguments to a prompt body. Mirrors the capability-pack
|
|
24
|
+
* expansion convention so workflow prompts and capability commands format args
|
|
25
|
+
* identically downstream.
|
|
26
|
+
*/
|
|
27
|
+
export function appendArgsToPrompt(prompt: string, args?: string): string {
|
|
28
|
+
const trimmedPrompt = prompt.trim();
|
|
29
|
+
const trimmedArgs = args?.trim();
|
|
30
|
+
if (!trimmedArgs) return trimmedPrompt;
|
|
31
|
+
return `${trimmedPrompt}\n\nUser arguments:\n${trimmedArgs}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Resolve a typed slash command against workflow-prompt suggestions.
|
|
36
|
+
*
|
|
37
|
+
* Workflow suggestions (built from `.claude/commands/*.md` via WorkflowPromptService)
|
|
38
|
+
* carry `workflowPromptId` + `workflowPromptFolder` but no `commandRef`, so they are
|
|
39
|
+
* invisible to the capability-pack resolver. This resolver finds the matching prompt
|
|
40
|
+
* so its full content can be loaded and injected — otherwise only the raw `/name`
|
|
41
|
+
* text is sent and the workflow never actually runs.
|
|
42
|
+
*/
|
|
43
|
+
export function resolveWorkflowCommandInput(
|
|
44
|
+
suggestions: readonly MentionSuggestion[],
|
|
45
|
+
text: string
|
|
46
|
+
): ResolvedWorkflowCommand | null {
|
|
47
|
+
const parsed = parseStandaloneSlashCommand(text);
|
|
48
|
+
if (!parsed) return null;
|
|
49
|
+
|
|
50
|
+
const match = suggestions.find(
|
|
51
|
+
(suggestion) =>
|
|
52
|
+
suggestion.workflowPromptId &&
|
|
53
|
+
suggestion.workflowPromptFolder &&
|
|
54
|
+
typeof suggestion.command === 'string' &&
|
|
55
|
+
suggestion.command.toLowerCase() === parsed.command.toLowerCase()
|
|
56
|
+
);
|
|
57
|
+
if (!match || !match.workflowPromptFolder || !match.workflowPromptId) return null;
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
folder: match.workflowPromptFolder,
|
|
61
|
+
id: match.workflowPromptId,
|
|
62
|
+
command: parsed.command,
|
|
63
|
+
args: parsed.args,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Load the full prompt content for a resolved workflow command and format it as
|
|
69
|
+
* an injectable message body. Parallel to `expandCapabilityCommand`.
|
|
70
|
+
*/
|
|
71
|
+
export async function expandWorkflowCommand(
|
|
72
|
+
resolved: ResolvedWorkflowCommand
|
|
73
|
+
): Promise<ExpandedWorkflowCommand> {
|
|
74
|
+
if (!api.systemManager) {
|
|
75
|
+
throw new Error('System manager API is unavailable');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const { prompt, content } = await api.systemManager.readWorkflowPrompt(
|
|
79
|
+
resolved.folder,
|
|
80
|
+
resolved.id
|
|
81
|
+
);
|
|
82
|
+
const commandName = prompt.commandName ?? resolved.command;
|
|
83
|
+
const slashCommand: SlashCommandMeta = {
|
|
84
|
+
name: commandName.replace(/^\/+/, ''),
|
|
85
|
+
command: commandName.startsWith('/') ? (commandName as `/${string}`) : `/${commandName}`,
|
|
86
|
+
args: resolved.args,
|
|
87
|
+
knownDescription: prompt.description ?? prompt.label,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
text: appendArgsToPrompt(content, resolved.args),
|
|
92
|
+
summary: prompt.label,
|
|
93
|
+
slashCommand,
|
|
94
|
+
prompt,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build command-list suggestions from workflow prompts (`.claude/commands/*.md`).
|
|
3
|
+
*
|
|
4
|
+
* Extracted from SystemManagerView so both the admin Loop console and each
|
|
5
|
+
* team's Loop console can surface workflow commands — the team console loads
|
|
6
|
+
* its own project's commands, so a digital worker's project-specific commands
|
|
7
|
+
* appear alongside the global ones.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { MentionSuggestion } from '@renderer/types/mention';
|
|
11
|
+
import type { WorkflowPromptSummary } from '@shared/types/systemManager';
|
|
12
|
+
|
|
13
|
+
function formatWorkflowCommand(prompt: WorkflowPromptSummary): string {
|
|
14
|
+
return prompt.commandName ?? `/${prompt.filename.replace(/\.[^.]+$/, '')}`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Convert a workflow prompt into a command suggestion carrying the
|
|
19
|
+
* `workflowPromptId` / `workflowPromptFolder` metadata that the submit path
|
|
20
|
+
* uses to inject the prompt's full body (instead of sending the raw `/name`).
|
|
21
|
+
*/
|
|
22
|
+
export function buildWorkflowCommandSuggestion(
|
|
23
|
+
prompt: WorkflowPromptSummary,
|
|
24
|
+
idPrefix = 'workflow'
|
|
25
|
+
): MentionSuggestion {
|
|
26
|
+
const command = formatWorkflowCommand(prompt) as `/${string}`;
|
|
27
|
+
const commandName = command.slice(1);
|
|
28
|
+
return {
|
|
29
|
+
id: `${idPrefix}:${prompt.id}`,
|
|
30
|
+
name: commandName,
|
|
31
|
+
type: 'command',
|
|
32
|
+
command,
|
|
33
|
+
insertText: commandName,
|
|
34
|
+
workflowPromptId: prompt.id,
|
|
35
|
+
workflowPromptFolder: prompt.folder,
|
|
36
|
+
description: prompt.description ?? `运行 ${prompt.label}`,
|
|
37
|
+
subtitle: prompt.safety ? `${prompt.label} · ${prompt.safety}` : prompt.label,
|
|
38
|
+
searchText: [
|
|
39
|
+
prompt.label,
|
|
40
|
+
prompt.description,
|
|
41
|
+
prompt.category,
|
|
42
|
+
prompt.safety,
|
|
43
|
+
prompt.filename,
|
|
44
|
+
command,
|
|
45
|
+
]
|
|
46
|
+
.filter(Boolean)
|
|
47
|
+
.join(' '),
|
|
48
|
+
};
|
|
49
|
+
}
|
package/src/shared/types/api.ts
CHANGED
|
@@ -10,7 +10,13 @@
|
|
|
10
10
|
import type { CliArgsValidationResult } from '../utils/cliArgsParser';
|
|
11
11
|
import type { CliInstallerAPI } from './cliInstaller';
|
|
12
12
|
import type { EditorAPI, EditorFileChangeEvent, ProjectAPI, WorkspaceListResponse } from './editor';
|
|
13
|
-
import type {
|
|
13
|
+
import type {
|
|
14
|
+
ApiKeysAPI,
|
|
15
|
+
CapabilityPacksAPI,
|
|
16
|
+
McpCatalogAPI,
|
|
17
|
+
PluginCatalogAPI,
|
|
18
|
+
SkillsCatalogAPI,
|
|
19
|
+
} from './extensions';
|
|
14
20
|
import type {
|
|
15
21
|
AppConfig,
|
|
16
22
|
DetectedError,
|
|
@@ -94,8 +100,10 @@ import type {
|
|
|
94
100
|
ToolApprovalSettings,
|
|
95
101
|
UpdateKanbanPatch,
|
|
96
102
|
} from './team';
|
|
103
|
+
import type { LoopAssetsSnapshot } from './loopAssets';
|
|
97
104
|
import type { SystemManagerAPI } from './systemManager';
|
|
98
105
|
import type { TerminalAPI } from './terminal';
|
|
106
|
+
import type { DiscoverableWorker } from './worker';
|
|
99
107
|
import type { WaterfallData } from './visualization';
|
|
100
108
|
import type { RecentProjectsElectronApi } from '@features/recent-projects/contracts';
|
|
101
109
|
import type {
|
|
@@ -501,6 +509,14 @@ export interface CcSession {
|
|
|
501
509
|
createdAt: string;
|
|
502
510
|
updatedAt: string;
|
|
503
511
|
lastMessage: { role: string; content: string; timestamp: string } | null;
|
|
512
|
+
/**
|
|
513
|
+
* Whether this list entry is backed by a local Claude JSONL file. cc-only
|
|
514
|
+
* sessions (e.g. a Feishu listening session with no local file yet) are
|
|
515
|
+
* `false` — expanding them must not attempt a local detail read, which 404s
|
|
516
|
+
* and surfaces a misleading "会话文件已不存在" (#20). Defaults to true when
|
|
517
|
+
* unset, so construction sites that predate the flag keep current behavior.
|
|
518
|
+
*/
|
|
519
|
+
hasLocalFile?: boolean;
|
|
504
520
|
}
|
|
505
521
|
|
|
506
522
|
export interface CcSessionMessage {
|
|
@@ -524,6 +540,18 @@ export interface CcSessionDetail {
|
|
|
524
540
|
history: CcSessionMessage[];
|
|
525
541
|
}
|
|
526
542
|
|
|
543
|
+
export interface LoopSessionRequest {
|
|
544
|
+
sessionName?: string;
|
|
545
|
+
message?: string;
|
|
546
|
+
reuse?: boolean;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
export interface LoopSessionResponse {
|
|
550
|
+
session: CcSession;
|
|
551
|
+
reused: boolean;
|
|
552
|
+
messageSent: boolean;
|
|
553
|
+
}
|
|
554
|
+
|
|
527
555
|
export type ConversationTelemetryExportFormat = 'csv' | 'json' | 'markdown' | 'plaintext';
|
|
528
556
|
|
|
529
557
|
export type ConversationTelemetryIncludeContent = 'none' | 'summary' | 'full';
|
|
@@ -577,7 +605,12 @@ export interface ConversationTelemetryRow {
|
|
|
577
605
|
endTime?: string;
|
|
578
606
|
active?: boolean;
|
|
579
607
|
live?: boolean;
|
|
580
|
-
matchStatus:
|
|
608
|
+
matchStatus:
|
|
609
|
+
| 'matched'
|
|
610
|
+
| 'missing-agent-session-id'
|
|
611
|
+
| 'jsonl-not-found'
|
|
612
|
+
| 'ambiguous'
|
|
613
|
+
| 'local-only';
|
|
581
614
|
};
|
|
582
615
|
identity: {
|
|
583
616
|
platform: string;
|
|
@@ -641,6 +674,11 @@ export interface TeamsAPI {
|
|
|
641
674
|
list: () => Promise<TeamSummary[]>;
|
|
642
675
|
ensureSystemManager: () => Promise<SystemManagerSummary>;
|
|
643
676
|
getData: (teamName: string) => Promise<TeamViewSnapshot>;
|
|
677
|
+
getLoopAssets: (teamName: string) => Promise<LoopAssetsSnapshot>;
|
|
678
|
+
createLoopSession: (
|
|
679
|
+
teamName: string,
|
|
680
|
+
request: LoopSessionRequest
|
|
681
|
+
) => Promise<LoopSessionResponse>;
|
|
644
682
|
getTaskChangePresence: (teamName: string) => Promise<Record<string, TaskChangePresenceState>>;
|
|
645
683
|
setChangePresenceTracking: (teamName: string, enabled: boolean) => Promise<void>;
|
|
646
684
|
setToolActivityTracking: (teamName: string, enabled: boolean) => Promise<void>;
|
|
@@ -840,6 +878,36 @@ export interface CrossTeamAPI {
|
|
|
840
878
|
getOutbox: (teamName: string) => Promise<CrossTeamMessage[]>;
|
|
841
879
|
}
|
|
842
880
|
|
|
881
|
+
// =============================================================================
|
|
882
|
+
// Digital Workers API
|
|
883
|
+
// =============================================================================
|
|
884
|
+
|
|
885
|
+
export interface WorkerListResponse {
|
|
886
|
+
workers: DiscoverableWorker[];
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
export interface WorkerInvokeRequest {
|
|
890
|
+
fromTeam?: string;
|
|
891
|
+
text: string;
|
|
892
|
+
summary?: string;
|
|
893
|
+
sessionName?: string;
|
|
894
|
+
reuse?: boolean;
|
|
895
|
+
sessionKey?: string;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
export interface WorkerInvokeResponse {
|
|
899
|
+
ok: boolean;
|
|
900
|
+
worker: DiscoverableWorker;
|
|
901
|
+
session: CcSession;
|
|
902
|
+
reused: boolean;
|
|
903
|
+
messageSent: boolean;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
export interface WorkersAPI {
|
|
907
|
+
list: () => Promise<WorkerListResponse>;
|
|
908
|
+
invoke: (workerId: string, request: WorkerInvokeRequest) => Promise<WorkerInvokeResponse>;
|
|
909
|
+
}
|
|
910
|
+
|
|
843
911
|
// =============================================================================
|
|
844
912
|
// Collaboration Board API
|
|
845
913
|
// =============================================================================
|
|
@@ -1199,11 +1267,15 @@ export interface ElectronAPI extends RecentProjectsElectronApi {
|
|
|
1199
1267
|
work_dir?: string;
|
|
1200
1268
|
agent_type?: string;
|
|
1201
1269
|
}
|
|
1202
|
-
) => Promise<{ message: string; restart_required: boolean }>;
|
|
1270
|
+
) => Promise<{ message: string; restart_required: boolean; restart_handled?: boolean }>;
|
|
1203
1271
|
};
|
|
1204
1272
|
|
|
1205
1273
|
// Cross-Team Communication API
|
|
1206
1274
|
crossTeam: CrossTeamAPI;
|
|
1275
|
+
|
|
1276
|
+
// Digital Workers API
|
|
1277
|
+
workers: WorkersAPI;
|
|
1278
|
+
|
|
1207
1279
|
collab: CollabBoardAPI;
|
|
1208
1280
|
|
|
1209
1281
|
// Review API
|
|
@@ -1215,7 +1287,7 @@ export interface ElectronAPI extends RecentProjectsElectronApi {
|
|
|
1215
1287
|
// System Manager / Control Console API
|
|
1216
1288
|
systemManager: SystemManagerAPI;
|
|
1217
1289
|
|
|
1218
|
-
//
|
|
1290
|
+
// System terminal API
|
|
1219
1291
|
terminal: TerminalAPI;
|
|
1220
1292
|
|
|
1221
1293
|
// Project file operations (editor-independent)
|
|
@@ -1241,6 +1313,9 @@ export interface ElectronAPI extends RecentProjectsElectronApi {
|
|
|
1241
1313
|
// Extension Store — Skills Catalog API (Electron-only, optional)
|
|
1242
1314
|
skills?: SkillsCatalogAPI;
|
|
1243
1315
|
|
|
1316
|
+
// Extension Store — Capability Packs API (Electron-only, optional)
|
|
1317
|
+
capabilityPacks?: CapabilityPacksAPI;
|
|
1318
|
+
|
|
1244
1319
|
// Extension Store — Credentials (project env, MCP credentials)
|
|
1245
1320
|
credentials?: {
|
|
1246
1321
|
getStatus: () => Promise<{ encryption: string; storagePath: string } | null>;
|
|
@@ -23,6 +23,14 @@ import type {
|
|
|
23
23
|
McpServerDiagnostic,
|
|
24
24
|
} from './mcp';
|
|
25
25
|
import type { EnrichedPlugin, PluginInstallRequest } from './plugin';
|
|
26
|
+
import type {
|
|
27
|
+
CapabilityCommandPromptRequest,
|
|
28
|
+
CapabilityCommandPromptResult,
|
|
29
|
+
CapabilityPackExportRequest,
|
|
30
|
+
CapabilityPackImportRequest,
|
|
31
|
+
CapabilityPackListResult,
|
|
32
|
+
CapabilityPackMutationResult,
|
|
33
|
+
} from './capabilityPack';
|
|
26
34
|
import type {
|
|
27
35
|
SkillCatalogItem,
|
|
28
36
|
SkillDeleteRequest,
|
|
@@ -88,6 +96,17 @@ export interface SkillsCatalogAPI {
|
|
|
88
96
|
onChanged: (callback: (event: SkillWatcherEvent) => void) => () => void;
|
|
89
97
|
}
|
|
90
98
|
|
|
99
|
+
// ── Capability Packs API ──────────────────────────────────────────────────
|
|
100
|
+
|
|
101
|
+
export interface CapabilityPacksAPI {
|
|
102
|
+
list: () => Promise<CapabilityPackListResult>;
|
|
103
|
+
importPack: (request: CapabilityPackImportRequest) => Promise<CapabilityPackMutationResult>;
|
|
104
|
+
exportPack: (request: CapabilityPackExportRequest) => Promise<CapabilityPackMutationResult>;
|
|
105
|
+
getCommandPrompt: (
|
|
106
|
+
request: CapabilityCommandPromptRequest
|
|
107
|
+
) => Promise<CapabilityCommandPromptResult>;
|
|
108
|
+
}
|
|
109
|
+
|
|
91
110
|
// ── API Keys API ──────────────────────────────────────────────────────────
|
|
92
111
|
|
|
93
112
|
export interface ApiKeysAPI {
|