accessor.ts 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import type { IGenUiService } from "./gen-ui/contract.js";
  2. import { IOffPeakTaskService } from "./session/offPeakTask.js";
  3. import type { IHighspeedCardService } from "./highspeed/highspeedCard.js";
  4. import type { IPluginUiBridgeService } from "./plugin-ui-bridge/contract.js";
  5. import type { IPluginUiSamplingService } from "./plugin-ui-bridge/samplingContract.js";
  6. import type { IPluginUiAppToolsService } from "./plugin-ui-bridge/appToolsContract.js";
  7. import type { IFileService } from "./file/file.js";
  8. import type { IMediaPreviewService } from "./media-preview/mediaPreview.js";
  9. import type { ICloudContentService } from "#src/cloud-content/cloudContent.js";
  10. import type { IMarketingTouchService } from "#src/marketing-touch/marketingTouch.js";
  11. import type { IGitService } from "./git/git.js";
  12. import type { IGitCheckpointService } from "./git/gitCheckpoint.js";
  13. import type { ISystemService } from "./system/system.js";
  14. import type { ITerminalService } from "./terminal/terminal.js";
  15. import type { ISettingService } from "./setting/setting.js";
  16. import type { ICredentialService } from "./credential/credential.js";
  17. import type { IBroadcastService } from "./broadcast/broadcast.js";
  18. import type { IZCodeTaskService } from "./session/zcodeTaskService.js";
  19. import type { IZCodeAgentService } from "./zcode-agent/zcodeAgent.js";
  20. import type { IZCodeSessionService } from "./zcode-session/zcodeSession.js";
  21. import type { ICuaPermissionService } from "./cua-permission-broker/cuaPermissionService.js";
  22. import type { IBotsService } from "./bots/bots.js";
  23. import type { IFileWatcherService } from "./fileWatcher/fileWatcher.js";
  24. import type { IOAuthService } from "./oauth/oauth.js";
  25. import type {
  26. IModelSelectionService,
  27. IProviderSettingsService,
  28. } from "./model-provider/providerFacadeServices.js";
  29. import type { IUsageStatsService } from "./usage-stats/usageStats.js";
  30. import type { ICodingPlanSubscriptionService } from "./coding-plan-subscription/codingPlanSubscription.js";
  31. import type { IClientConfigService } from "./client-config/clientConfig.js";
  32. import type { IClientScenesService } from "./client-scenes/clientScenes.js";
  33. import type { ISkillsService } from "./skills/skills.js";
  34. import type { ISkillSyncService } from "./skill-sync/skillSync.js";
  35. import type { IMcpSyncService } from "./mcp-sync/mcpSync.js";
  36. import type { IPluginSyncService } from "./plugin-sync/pluginSync.js";
  37. import type { IPluginsService } from "./plugins/plugins.js";
  38. import type { IPluginManagementService } from "./plugins/pluginManagement.js";
  39. import type { ISubagentsService } from "./subagents/subagents.js";
  40. import type { ICommandsService } from "./commands/commands.js";
  41. import type { IHooksService } from "./hooks/hooks.js";
  42. import type { IMemoryService } from "./memory/memory.js";
  43. import type { IOutputStyleService } from "./output-style/outputStyle.js";
  44. import type { ISettingsSyncService } from "./settings-sync/settingsSync.js";
  45. import type { IFeedbackService } from "./feedback/feedback.js";
  46. import type { IPromptAttachmentTransferService } from "./prompt-attachment-transfer/promptAttachmentTransfer.js";
  47. import type { IWindowControllerService } from "./window-controller/windowController.js";
  48. import type { IOnboardingRecordService } from "./onboarding/onboardingRecord.js";
  49. import type { IConversationShareService } from "./conversation-share/conversationShare.js";
  50. /** UI 层消费的统一服务接口 */
  51. export interface IServiceAccessor {
  52. readonly fileService: IFileService;
  53. readonly mediaPreviewService?: IMediaPreviewService;
  54. readonly cloudContentService?: ICloudContentService;
  55. readonly marketingTouchService?: IMarketingTouchService;
  56. readonly gitService: IGitService;
  57. readonly gitCheckpointService: IGitCheckpointService;
  58. readonly systemService: ISystemService;
  59. readonly terminalService: ITerminalService;
  60. readonly settingService: ISettingService;
  61. /** Onboarding 完成记录(本地持久化);旧测试 double / 不支持的 host 可不提供。 */
  62. readonly onboardingRecordService?: IOnboardingRecordService;
  63. readonly credentialService: ICredentialService;
  64. readonly broadcastService: IBroadcastService;
  65. readonly zcodeTaskService: IZCodeTaskService;
  66. /** 窗口 Host 聚合面;旧 server wire 或测试 double 可暂不提供。 */
  67. readonly windowControllerService?: IWindowControllerService;
  68. readonly zcodeAgentService: IZCodeAgentService;
  69. readonly zcodeSessionService: IZCodeSessionService;
  70. // CUA 是 opt-in 内测特性:local macOS host 提供,远端 等 host 没有。可选避免连锁必填。
  71. readonly cuaPermissionService?: ICuaPermissionService;
  72. readonly conversationShareService: IConversationShareService;
  73. readonly botsService: IBotsService;
  74. readonly fileWatcherService: IFileWatcherService;
  75. readonly oauthService: IOAuthService;
  76. /** 当前 Environment 的 Provider 配置与设置视图。 */
  77. readonly providerSettingsService: IProviderSettingsService;
  78. /** 当前 Environment Registry 发布的唯一模型选择 View。 */
  79. readonly modelSelectionService: IModelSelectionService;
  80. readonly usageStatsService: IUsageStatsService;
  81. readonly codingPlanSubscriptionService: ICodingPlanSubscriptionService;
  82. readonly clientConfigService: IClientConfigService;
  83. readonly clientScenesService: IClientScenesService;
  84. /** 闲时任务管理(独立服务面)。 */
  85. readonly offPeakTaskService: IOffPeakTaskService;
  86. readonly highspeedCardService: IHighspeedCardService;
  87. readonly skillsService: ISkillsService;
  88. readonly skillSyncService: ISkillSyncService;
  89. readonly mcpSyncService: IMcpSyncService;
  90. /** 插件 UI 桥;web 或旧 host 可不提供,UI 据此回退普通 MCP 卡片。 */
  91. readonly genUiService?: IGenUiService;
  92. readonly pluginUiBridgeService?: IPluginUiBridgeService;
  93. /** 页面 sampling;只有桌面本地任务开放。 */
  94. readonly pluginUiSamplingService?: IPluginUiSamplingService;
  95. /** App-Provided Tools;只有桌面本地 agent 时存在。 */
  96. readonly pluginUiAppToolsService?: IPluginUiAppToolsService;
  97. readonly pluginSyncService: IPluginSyncService;
  98. readonly pluginsService: IPluginsService;
  99. /** 设置页插件管理(UI 不再直触 zcodeAgentService 的 plugins/* 面) */
  100. readonly pluginManagementService: IPluginManagementService;
  101. readonly subagentsService: ISubagentsService;
  102. readonly commandsService: ICommandsService;
  103. readonly hooksService: IHooksService;
  104. readonly memoryService: IMemoryService;
  105. readonly outputStyleService: IOutputStyleService;
  106. readonly settingsSyncService: ISettingsSyncService;
  107. readonly feedbackService: IFeedbackService;
  108. readonly promptAttachmentTransferService: IPromptAttachmentTransferService;
  109. }