@tencent-ai/agent-sdk 0.3.252 → 0.3.253

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/cli/CHANGELOG.md +22 -0
  2. package/cli/dist/codebuddy-headless.js +73 -58
  3. package/cli/dist/codebuddy-lite-wb.mjs +96 -81
  4. package/cli/dist/lazy/{427.68132a34.js → 427.74b982af.js} +4 -4
  5. package/cli/dist/lazy-headless/{834.391fb41e.js → 834.3b674e07.js} +9 -9
  6. package/cli/dist-server/3556.codebuddy.js +1 -1
  7. package/cli/dist-server/6037.codebuddy.js +1 -1
  8. package/cli/dist-server/6784.codebuddy.js +1 -1
  9. package/cli/dist-server/codebuddy.js +45 -30
  10. package/cli/dist-server/types/node/agent/openai-agents-types.d.ts +5 -5
  11. package/cli/dist-server/types/node/mcp/mcp-sdk-values.d.ts +1 -1
  12. package/cli/dist-server/types/node/model/model-provider.d.ts +3 -1
  13. package/cli/dist-server/types/node/tools/a2a-get-task-tool.d.ts +139 -34
  14. package/cli/dist-server/types/node/tools/a2a-poll-retry.d.ts +46 -0
  15. package/cli/package.json +1 -1
  16. package/cli/product.cloudhosted.json +2 -2
  17. package/cli/product.internal.json +2 -2
  18. package/cli/product.ioa.json +2 -2
  19. package/cli/product.json +4 -4
  20. package/cli/product.selfhosted.json +2 -2
  21. package/package.json +1 -1
  22. package/cli/dist-server/types/node/acp/acp-view-rewind-to.d.ts +0 -34
  23. package/cli/dist-server/types/node/acp/acp-web-ui-client.d.ts +0 -22
  24. package/cli/dist-server/types/node/acp/usage-by-category-calculator.d.ts +0 -45
  25. package/cli/dist-server/types/node/acp/usage-by-category-char-weight.d.ts +0 -9
  26. package/cli/dist-server/types/node/acp/usage-by-category-distribute.d.ts +0 -6
  27. package/cli/dist-server/types/node/acp/usage-by-category-tools-split.d.ts +0 -11
  28. package/cli/dist-server/types/node/agent-home/agent-home-envelope-body.d.ts +0 -54
  29. package/cli/dist-server/types/node/agent-home/agent-home-inbox-events.d.ts +0 -14
  30. package/cli/dist-server/types/node/agent-home/agent-home-room-contacts.d.ts +0 -30
  31. package/cli/dist-server/types/node/agent-team/permission-bridge-client.d.ts +0 -32
  32. package/cli/dist-server/types/node/agent-team/permission-bridge-protocol.d.ts +0 -47
  33. package/cli/dist-server/types/node/agent-view/handoff-policy.d.ts +0 -80
  34. package/cli/dist-server/types/node/agent-view/job-respawn-prefs.d.ts +0 -12
  35. package/cli/dist-server/types/node/agent-view/session-handoff.d.ts +0 -161
  36. package/cli/dist-server/types/node/ask/index.d.ts +0 -3
  37. package/cli/dist-server/types/node/bash-sandbox/bash-sandbox-manager.d.ts +0 -125
  38. package/cli/dist-server/types/node/bash-sandbox/legacy-sandbox-shell-service.d.ts +0 -33
  39. package/cli/dist-server/types/node/bash-sandbox/managed-security-policy.d.ts +0 -6
  40. package/cli/dist-server/types/node/bash-sandbox/workbuddy-directory-protection.d.ts +0 -12
  41. package/cli/dist-server/types/node/checkpoint/checkpoint-service.d.ts +0 -70
  42. package/cli/dist-server/types/node/checkpoint/file-changes-controller.d.ts +0 -29
  43. package/cli/dist-server/types/node/checkpoint/file-track-service.d.ts +0 -11
  44. package/cli/dist-server/types/node/checkpoint/file-version-manager.d.ts +0 -10
  45. package/cli/dist-server/types/node/checkpoint/file-version-store.d.ts +0 -9
  46. package/cli/dist-server/types/node/checkpoint/file-version-update-strategies.d.ts +0 -62
  47. package/cli/dist-server/types/node/command/add-dir-command-executor.d.ts +0 -11
  48. package/cli/dist-server/types/node/command/agents-command-executor.d.ts +0 -9
  49. package/cli/dist-server/types/node/command/auto-compact-command-executor.d.ts +0 -20
  50. package/cli/dist-server/types/node/command/background-command-executor.d.ts +0 -29
  51. package/cli/dist-server/types/node/command/btw-command-executor.d.ts +0 -19
  52. package/cli/dist-server/types/node/command/clear-command-executor.d.ts +0 -17
  53. package/cli/dist-server/types/node/command/config-command-executor.d.ts +0 -15
  54. package/cli/dist-server/types/node/command/context-command-executor.d.ts +0 -42
  55. package/cli/dist-server/types/node/command/copy-command-executor.d.ts +0 -10
  56. package/cli/dist-server/types/node/command/cost-command-executor.d.ts +0 -13
  57. package/cli/dist-server/types/node/command/debug-command-executor.d.ts +0 -15
  58. package/cli/dist-server/types/node/command/deep-research-command-executor.d.ts +0 -25
  59. package/cli/dist-server/types/node/command/doctor-command-executor.d.ts +0 -7
  60. package/cli/dist-server/types/node/command/effort-command-executor.d.ts +0 -46
  61. package/cli/dist-server/types/node/command/exit-command-executor.d.ts +0 -14
  62. package/cli/dist-server/types/node/command/export-command-executor.d.ts +0 -7
  63. package/cli/dist-server/types/node/command/feedback-command-executor.d.ts +0 -9
  64. package/cli/dist-server/types/node/command/fork-bg-command-executor.d.ts +0 -30
  65. package/cli/dist-server/types/node/command/fork-command-executor.d.ts +0 -28
  66. package/cli/dist-server/types/node/command/goal-command-executor.d.ts +0 -50
  67. package/cli/dist-server/types/node/command/handoff-message-adapter.d.ts +0 -9
  68. package/cli/dist-server/types/node/command/help-command-executor.d.ts +0 -9
  69. package/cli/dist-server/types/node/command/hooks-command-executor.d.ts +0 -9
  70. package/cli/dist-server/types/node/command/ide-command-executor.d.ts +0 -11
  71. package/cli/dist-server/types/node/command/mcp-command-executor.d.ts +0 -15
  72. package/cli/dist-server/types/node/command/memory-command-executor.d.ts +0 -17
  73. package/cli/dist-server/types/node/command/mode-command-executor.d.ts +0 -11
  74. package/cli/dist-server/types/node/command/model-command-executor.d.ts +0 -11
  75. package/cli/dist-server/types/node/command/model-image-to-image-command-executor.d.ts +0 -17
  76. package/cli/dist-server/types/node/command/model-image-to-video-command-executor.d.ts +0 -17
  77. package/cli/dist-server/types/node/command/model-lite-command-executor.d.ts +0 -17
  78. package/cli/dist-server/types/node/command/model-reasoning-command-executor.d.ts +0 -17
  79. package/cli/dist-server/types/node/command/model-text-to-image-command-executor.d.ts +0 -17
  80. package/cli/dist-server/types/node/command/model-text-to-video-command-executor.d.ts +0 -17
  81. package/cli/dist-server/types/node/command/multitask-command-executor.d.ts +0 -9
  82. package/cli/dist-server/types/node/command/permissions-command-executor.d.ts +0 -9
  83. package/cli/dist-server/types/node/command/plan-command-executor.d.ts +0 -11
  84. package/cli/dist-server/types/node/command/plugin-command-executor.d.ts +0 -25
  85. package/cli/dist-server/types/node/command/plugin-validate-command-executor.d.ts +0 -21
  86. package/cli/dist-server/types/node/command/release-notes-command-executor.d.ts +0 -18
  87. package/cli/dist-server/types/node/command/reload-plugins-command-executor.d.ts +0 -24
  88. package/cli/dist-server/types/node/command/remote-control-command-executor.d.ts +0 -44
  89. package/cli/dist-server/types/node/command/rename-command-executor.d.ts +0 -11
  90. package/cli/dist-server/types/node/command/reset-command-executor.d.ts +0 -9
  91. package/cli/dist-server/types/node/command/resume-command-executor.d.ts +0 -21
  92. package/cli/dist-server/types/node/command/rewind-command-executor.d.ts +0 -10
  93. package/cli/dist-server/types/node/command/sandbox-command-executor.d.ts +0 -20
  94. package/cli/dist-server/types/node/command/save-workflow-command-executor.d.ts +0 -43
  95. package/cli/dist-server/types/node/command/session-reset-notifier.d.ts +0 -23
  96. package/cli/dist-server/types/node/command/skills-command-executor.d.ts +0 -9
  97. package/cli/dist-server/types/node/command/stats-command-executor.d.ts +0 -11
  98. package/cli/dist-server/types/node/command/status-command-executor.d.ts +0 -11
  99. package/cli/dist-server/types/node/command/tasks-command-executor.d.ts +0 -9
  100. package/cli/dist-server/types/node/command/terminal-setup-command-executor.d.ts +0 -7
  101. package/cli/dist-server/types/node/command/theme-command-executor.d.ts +0 -7
  102. package/cli/dist-server/types/node/command/todos-command-executor.d.ts +0 -16
  103. package/cli/dist-server/types/node/command/upgrade-command-executor.d.ts +0 -13
  104. package/cli/dist-server/types/node/command/vim-command-executor.d.ts +0 -11
  105. package/cli/dist-server/types/node/command/workflows-command-executor.d.ts +0 -26
  106. package/cli/dist-server/types/node/feedback/feedback-protocol.d.ts +0 -32
  107. package/cli/dist-server/types/node/feedback/feedback-service.d.ts +0 -19
  108. package/cli/dist-server/types/node/feedback/index.d.ts +0 -2
  109. package/cli/dist-server/types/node/goal/goal-policy.d.ts +0 -55
  110. package/cli/dist-server/types/node/goal/goal-protocol.d.ts +0 -178
  111. package/cli/dist-server/types/node/goal/goal-service.d.ts +0 -201
  112. package/cli/dist-server/types/node/goal/goal-session-start-hook.d.ts +0 -24
  113. package/cli/dist-server/types/node/hooks/parse-frontmatter-hooks.d.ts +0 -42
  114. package/cli/dist-server/types/node/install/index.d.ts +0 -6
  115. package/cli/dist-server/types/node/install/install-controller.d.ts +0 -15
  116. package/cli/dist-server/types/node/install/install-env.d.ts +0 -12
  117. package/cli/dist-server/types/node/install/install-errors.d.ts +0 -46
  118. package/cli/dist-server/types/node/install/install-protocol.d.ts +0 -83
  119. package/cli/dist-server/types/node/install/install-service.d.ts +0 -36
  120. package/cli/dist-server/types/node/install/install-utils.d.ts +0 -7
  121. package/cli/dist-server/types/node/install/releases-service.d.ts +0 -18
  122. package/cli/dist-server/types/node/install/shell-setup.d.ts +0 -36
  123. package/cli/dist-server/types/node/mcp/mcp-cancellation.d.ts +0 -65
  124. package/cli/dist-server/types/node/mcp/mcp-controller.d.ts +0 -56
  125. package/cli/dist-server/types/node/mcp/mcp-model-id-header-helper.d.ts +0 -12
  126. package/cli/dist-server/types/node/mcp/mcp-oauth-callback-html.d.ts +0 -6
  127. package/cli/dist-server/types/node/mcp/mcp-oauth-controller.d.ts +0 -26
  128. package/cli/dist-server/types/node/mcp/mcp-output-storage.d.ts +0 -57
  129. package/cli/dist-server/types/node/mcp/mcp-server-override-impl.d.ts +0 -136
  130. package/cli/dist-server/types/node/mcp/mcp-server-override.d.ts +0 -29
  131. package/cli/dist-server/types/node/mcp/mcp-tool-result-sideband.d.ts +0 -26
  132. package/cli/dist-server/types/node/mcp/mcp-validate-middleware.d.ts +0 -25
  133. package/cli/dist-server/types/node/mcp/models/mcp-server.d.ts +0 -18
  134. package/cli/dist-server/types/node/mcp/node-websocket-transport.d.ts +0 -38
  135. package/cli/dist-server/types/node/mcp/official-mcp-egress-policy.d.ts +0 -17
  136. package/cli/dist-server/types/node/mcp/sdk-mcp-server.d.ts +0 -143
  137. package/cli/dist-server/types/node/mcp/sdk-mcp-transport.d.ts +0 -97
  138. package/cli/dist-server/types/node/message-queue/followup-queue.d.ts +0 -35
  139. package/cli/dist-server/types/node/message-queue/index.d.ts +0 -11
  140. package/cli/dist-server/types/node/plugins/concurrency.d.ts +0 -1
  141. package/cli/dist-server/types/node/plugins/dependency-resolver.d.ts +0 -43
  142. package/cli/dist-server/types/node/plugins/directory-plugin-cache-projection.d.ts +0 -2
  143. package/cli/dist-server/types/node/plugins/guards/index.d.ts +0 -2
  144. package/cli/dist-server/types/node/plugins/guards/weixinpay-integrity-guard.d.ts +0 -15
  145. package/cli/dist-server/types/node/plugins/installers/git-plugin-installer.d.ts +0 -42
  146. package/cli/dist-server/types/node/plugins/installers/git-subdir-plugin-installer.d.ts +0 -19
  147. package/cli/dist-server/types/node/plugins/installers/index.d.ts +0 -4
  148. package/cli/dist-server/types/node/plugins/installers/local-plugin-installer.d.ts +0 -40
  149. package/cli/dist-server/types/node/plugins/installers/npm-plugin-installer.d.ts +0 -23
  150. package/cli/dist-server/types/node/plugins/loaders/agent-loader.d.ts +0 -43
  151. package/cli/dist-server/types/node/plugins/loaders/command-loader.d.ts +0 -37
  152. package/cli/dist-server/types/node/plugins/loaders/hook-loader.d.ts +0 -55
  153. package/cli/dist-server/types/node/plugins/loaders/index.d.ts +0 -8
  154. package/cli/dist-server/types/node/plugins/loaders/lsp-loader.d.ts +0 -47
  155. package/cli/dist-server/types/node/plugins/loaders/mcp-loader.d.ts +0 -75
  156. package/cli/dist-server/types/node/plugins/loaders/output-style-loader.d.ts +0 -49
  157. package/cli/dist-server/types/node/plugins/loaders/plugin-loader-manager.d.ts +0 -49
  158. package/cli/dist-server/types/node/plugins/loaders/skill-loader.d.ts +0 -45
  159. package/cli/dist-server/types/node/plugins/marketplace-name-validator.d.ts +0 -50
  160. package/cli/dist-server/types/node/plugins/marketplace-path-safety.d.ts +0 -86
  161. package/cli/dist-server/types/node/plugins/marketplaces/base-marketplace.d.ts +0 -43
  162. package/cli/dist-server/types/node/plugins/marketplaces/builtin-marketplace-provider.d.ts +0 -22
  163. package/cli/dist-server/types/node/plugins/marketplaces/directory-marketplace.d.ts +0 -19
  164. package/cli/dist-server/types/node/plugins/marketplaces/git-availability-detector.d.ts +0 -62
  165. package/cli/dist-server/types/node/plugins/marketplaces/git-fallback-coordinator.d.ts +0 -42
  166. package/cli/dist-server/types/node/plugins/marketplaces/git-to-zip-url-converter.d.ts +0 -50
  167. package/cli/dist-server/types/node/plugins/marketplaces/github-marketplace.d.ts +0 -41
  168. package/cli/dist-server/types/node/plugins/marketplaces/http-marketplace.d.ts +0 -47
  169. package/cli/dist-server/types/node/plugins/marketplaces/index.d.ts +0 -13
  170. package/cli/dist-server/types/node/plugins/marketplaces/marketplace-config-manager.d.ts +0 -39
  171. package/cli/dist-server/types/node/plugins/marketplaces/marketplace-factory.d.ts +0 -11
  172. package/cli/dist-server/types/node/plugins/marketplaces/marketplace-storage.d.ts +0 -141
  173. package/cli/dist-server/types/node/plugins/marketplaces/marketplace-update-checker.d.ts +0 -38
  174. package/cli/dist-server/types/node/plugins/marketplaces/workspace-project-root.d.ts +0 -14
  175. package/cli/dist-server/types/node/plugins/marketplaces/zip-marketplace.d.ts +0 -134
  176. package/cli/dist-server/types/node/plugins/mcpb-handler.d.ts +0 -29
  177. package/cli/dist-server/types/node/plugins/plugin-controller.d.ts +0 -75
  178. package/cli/dist-server/types/node/plugins/plugin-error-collector.d.ts +0 -17
  179. package/cli/dist-server/types/node/plugins/plugin-install-stats-service.d.ts +0 -20
  180. package/cli/dist-server/types/node/plugins/plugin-manager.d.ts +0 -692
  181. package/cli/dist-server/types/node/plugins/plugin-policy-service.d.ts +0 -53
  182. package/cli/dist-server/types/node/plugins/plugin-validator.d.ts +0 -48
  183. package/cli/dist-server/types/node/plugins/zip-utils.d.ts +0 -93
  184. package/cli/dist-server/types/node/remote-control/clients/liveness-watchdog.d.ts +0 -56
  185. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-activity.d.ts +0 -23
  186. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-auth.d.ts +0 -64
  187. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-client-factory.d.ts +0 -47
  188. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-client.d.ts +0 -191
  189. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-inbound.d.ts +0 -7
  190. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-interaction.d.ts +0 -142
  191. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-live.d.ts +0 -78
  192. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-media.d.ts +0 -35
  193. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-qr-bind.d.ts +0 -49
  194. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-respond-queue.d.ts +0 -33
  195. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-types.d.ts +0 -207
  196. package/cli/dist-server/types/node/remote-control/remote-control-protocol.d.ts +0 -288
  197. package/cli/dist-server/types/node/remote-gateway/gateway-protocol.d.ts +0 -502
  198. package/cli/dist-server/types/node/remote-gateway/utils/qrcode-utils.d.ts +0 -16
  199. package/cli/dist-server/types/node/session/session-preview-utils.d.ts +0 -30
  200. package/cli/dist-server/types/node/settings/model-setting-utils.d.ts +0 -2
  201. package/cli/dist-server/types/node/tool-control/tool-control-policy.d.ts +0 -35
  202. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-critique-client.d.ts +0 -51
  203. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-strategy.d.ts +0 -19
  204. package/cli/dist-server/types/node/utils/add-dir-utils.d.ts +0 -20
  205. package/cli/dist-server/types/node/utils/compress-path.source.d.ts +0 -59
  206. package/cli/dist-server/types/node/vim/index.d.ts +0 -2
  207. package/cli/dist-server/types/node/vim/vim-manager.d.ts +0 -12
  208. package/cli/dist-server/types/node/vim/vim-protocol.d.ts +0 -24
@@ -1,37 +0,0 @@
1
- import { Logger } from '@celljs/core';
2
- import { Command } from '@genie/product';
3
- import { PluginEnvironmentContext } from '../plugin-environment';
4
- import { PluginErrorCollector, PluginExtensionType } from '../plugin-protocol';
5
- /**
6
- * Command 扩展加载器
7
- * 从扩展目录的 commands 子目录中加载 slash command 配置
8
- * 支持配置路径和默认扫描的合并
9
- */
10
- export declare class CommandExtensionLoader {
11
- readonly type = PluginExtensionType.Command;
12
- protected readonly logger: Logger;
13
- protected readonly errorCollector: PluginErrorCollector;
14
- protected init(): void;
15
- /**
16
- * 加载 commands
17
- * 如果提供了 commandPaths 配置,则加载指定路径;否则默认扫描 commands 目录
18
- * 两种方式的结果会被合并,并通过路径去重避免重复加载
19
- * @param extensionDir 扩展目录路径
20
- * @param source 来源
21
- * @param commandPaths 可选的 command 路径配置数组,相对于 extensionDir
22
- * @returns Command 数组
23
- */
24
- load(extensionDir: string, source: string, commandPaths?: string[], pluginEnvironment?: PluginEnvironmentContext): Promise<Command[]>;
25
- /**
26
- * 从指定的 command 路径加载
27
- * @param extensionDir 扩展目录路径
28
- * @param source 来源
29
- * @param commandPaths command 路径配置数组
30
- * @param loadedPaths 已加载的路径集合,用于去重
31
- * @returns Command 数组
32
- */
33
- private loadFromPaths;
34
- private pathExists;
35
- private scanCommandsDirectory;
36
- private parseCommandFile;
37
- }
@@ -1,55 +0,0 @@
1
- import { Logger } from '@celljs/core';
2
- import { HookConfig } from '../../hooks/hook-protocol';
3
- import { PluginEnvironmentContext } from '../plugin-environment';
4
- import { PluginOptionsStorage } from '../plugin-options-storage';
5
- import { PluginExtensionType, PluginHooksConfig } from '../plugin-protocol';
6
- /**
7
- * Hook 扩展加载器
8
- * 从扩展目录中加载 hooks 配置
9
- * 支持配置路径和默认扫描的合并
10
- */
11
- export declare class HookExtensionLoader {
12
- readonly type = PluginExtensionType.Hook;
13
- protected readonly logger: Logger;
14
- protected readonly pluginOptionsStorage?: PluginOptionsStorage;
15
- protected init(): void;
16
- /**
17
- * 加载 hooks 配置
18
- * 如果提供了 hooksConfig 配置,则加载指定配置;否则默认扫描 hooks.json 文件
19
- * 两种方式的结果会被合并
20
- * @param extensionDir 扩展目录路径
21
- * @param source 来源
22
- * @param hooksConfig 可选的 hooks 配置,可以是文件路径或直接的配置对象
23
- * @returns Hook 配置对象,键为事件名,值为 HookConfig 数组
24
- */
25
- load(extensionDir: string, source: string, hooksConfig?: PluginHooksConfig, pluginEnvironment?: PluginEnvironmentContext): Promise<Record<string, HookConfig[]>>;
26
- /**
27
- * 从配置加载 hooks
28
- * @param extensionDir 扩展目录路径
29
- * @param source 来源
30
- * @param hooksConfig hooks 配置,可以是文件路径或直接的配置对象
31
- * @returns Hook 配置对象
32
- */
33
- private loadFromConfig;
34
- private mergeHooks;
35
- private pathExists;
36
- /**
37
- * 从文件加载 hooks
38
- * @param filePath 文件路径
39
- * @param source 来源
40
- * @returns Hook 配置对象
41
- */
42
- private loadFromFile;
43
- /**
44
- * 验证 hooks 配置格式是否正确
45
- * @param config 配置对象
46
- * @returns 是否为有效的 hooks 配置
47
- */
48
- private isValidHooksConfig;
49
- /**
50
- * 验证单个 HookConfig 是否有效
51
- * @param config HookConfig 对象
52
- * @returns 是否为有效的 HookConfig
53
- */
54
- private isValidHookConfig;
55
- }
@@ -1,8 +0,0 @@
1
- export * from './agent-loader';
2
- export * from './command-loader';
3
- export * from './skill-loader';
4
- export * from './hook-loader';
5
- export * from './mcp-loader';
6
- export * from './lsp-loader';
7
- export * from './output-style-loader';
8
- export * from './plugin-loader-manager';
@@ -1,47 +0,0 @@
1
- import { Logger } from '@celljs/core';
2
- import { PluginEnvironmentContext } from '../plugin-environment';
3
- import { PluginOptionsStorage } from '../plugin-options-storage';
4
- import { LspServerConfig, PluginExtensionType } from '../plugin-protocol';
5
- /**
6
- * LSP 服务器加载器
7
- * 从扩展目录中加载 LSP 服务器配置
8
- * 支持配置路径和默认扫描的合并
9
- */
10
- export declare class LSPExtensionLoader {
11
- readonly type = PluginExtensionType.LSP;
12
- protected readonly logger: Logger;
13
- protected readonly pluginOptionsStorage?: PluginOptionsStorage;
14
- protected init(): void;
15
- /**
16
- * 加载 LSP 服务器配置
17
- * 如果提供了 lspConfig 配置,则加载指定配置;否则默认扫描 .lsp.json
18
- * 如果 plugin.json 中配置了 lspServers,优先使用该配置,忽略 .lsp.json
19
- * @param extensionDir 扩展目录路径
20
- * @param extensionName 扩展名称(用于标记)
21
- * @param lspConfig 可选的 LSP 配置,可以是文件路径或直接的配置对象
22
- * @returns LSP 服务器配置对象
23
- */
24
- load(extensionDir: string, extensionName: string, lspConfig?: string | Record<string, LspServerConfig>, pluginEnvironment?: PluginEnvironmentContext): Promise<Record<string, LspServerConfig>>;
25
- /**
26
- * 从配置加载 LSP 服务器
27
- * @param extensionDir 扩展目录路径
28
- * @param extensionName 扩展名称
29
- * @param lspConfig LSP 配置,可以是文件路径或直接的配置对象
30
- * @returns LSP 服务器配置对象
31
- */
32
- private loadFromConfig;
33
- /**
34
- * 从 .lsp.json 配置文件加载 LSP 服务器
35
- */
36
- private loadFromConfigFile;
37
- private pathExists;
38
- /**
39
- * 解析 LSP 服务器配置文件
40
- */
41
- private parseServerConfigFile;
42
- private enrichWithPluginEnvironment;
43
- /**
44
- * 验证 LSP 配置
45
- */
46
- private validateConfigs;
47
- }
@@ -1,75 +0,0 @@
1
- import { Logger } from '@celljs/core';
2
- import { McpConfig } from '../../mcp';
3
- import { PluginEnvironmentContext } from '../plugin-environment';
4
- import { PluginOptionsStorage } from '../plugin-options-storage';
5
- import { McpBundleEntry, PluginErrorCollector, PluginExtensionType } from '../plugin-protocol';
6
- /**
7
- * MCP 服务器加载器
8
- * 从扩展目录中加载 MCP 服务器配置
9
- * 支持配置路径和默认扫描的合并
10
- */
11
- export declare class MCPExtensionLoader {
12
- readonly type = PluginExtensionType.MCP;
13
- protected readonly logger: Logger;
14
- protected readonly errorCollector: PluginErrorCollector;
15
- protected readonly pluginOptionsStorage?: PluginOptionsStorage;
16
- protected init(): void;
17
- /**
18
- * 加载 MCP 服务器配置
19
- * 如果提供了 mcpConfig 配置,则加载指定配置;否则默认扫描 mcp.json 和 mcp 目录
20
- * 两种方式的结果会被合并
21
- * @param extensionDir 扩展目录路径
22
- * @param extensionName 扩展名称(用于标记)
23
- * @param mcpConfig 可选的 MCP 配置,可以是文件路径或直接的配置对象
24
- * @param mcpBundles 可选的 MCP Bundle 列表
25
- * @returns MCP 服务器配置对象
26
- */
27
- load(extensionDir: string, extensionName: string, mcpConfig?: string | Record<string, McpConfig>, mcpBundles?: McpBundleEntry[], pluginEnvironment?: PluginEnvironmentContext): Promise<Record<string, McpConfig>>;
28
- /**
29
- * 从配置加载 MCP 服务器
30
- * @param extensionDir 扩展目录路径
31
- * @param extensionName 扩展名称
32
- * @param mcpConfig MCP 配置,可以是文件路径或直接的配置对象
33
- * @returns MCP 服务器配置对象
34
- */
35
- private loadFromConfig;
36
- /**
37
- * 从 mcp.json 配置文件加载 MCP 服务器
38
- */
39
- private loadFromConfigFile;
40
- /**
41
- * 从 mcp 目录扫描加载 MCP 服务器配置
42
- */
43
- private loadFromDirectory;
44
- private pathExists;
45
- /**
46
- * Parse MCP server config file.
47
- *
48
- * Supports JSONC format with:
49
- * - Single-line comments (//)
50
- * - Multi-line comments (/* *\/)
51
- * - Trailing commas
52
- *
53
- * @param filePath - Path to the config file
54
- * @returns MCP server configurations
55
- */
56
- private parseServerConfigFile;
57
- private enrichWithPluginEnvironment;
58
- /**
59
- * 当 MCP 配置未显式声明 `type` 时,按现有字段推断出完整类型。
60
- * 推断规则与 mcp-config-manager.normalizePartialData 保持一致:
61
- * - `command` → stdio
62
- * - `ideName` → ws-ide
63
- * - `url` → http
64
- * 若已有合法 `type`(stdio/sse/http/remote/ws-ide/sse-ide),原样返回。
65
- * 若既无 `type` 也无法推断,返回 `null` 表示应跳过。
66
- */
67
- private inferTypeIfMissing;
68
- /**
69
- * 推断是否为扁平的 MCP server 配置格式
70
- * 当没有 mcpServers 字段时,检查每个顶层 entry 的 value 是否包含 command 或 url 字段
71
- * @param config 解析后的配置对象
72
- * @returns 如果是扁平格式则返回配置对象,否则返回空对象
73
- */
74
- private inferFlatFormat;
75
- }
@@ -1,49 +0,0 @@
1
- import { Logger } from '@celljs/core';
2
- import { PluginErrorCollector, PluginExtensionType, PluginOutputStyleEntry } from '../plugin-protocol';
3
- /**
4
- * Output Style 扩展加载器
5
- * 从扩展目录的 output-styles 子目录中加载 output style 配置
6
- * 支持配置路径和默认扫描的合并
7
- */
8
- export declare class OutputStyleExtensionLoader {
9
- readonly type = PluginExtensionType.OutputStyle;
10
- protected readonly logger: Logger;
11
- protected readonly errorCollector: PluginErrorCollector;
12
- protected init(): void;
13
- /**
14
- * 加载 output styles
15
- * 如果提供了 outputStylePaths 配置,则加载指定路径;否则默认扫描 output-styles 目录
16
- * 两种方式的结果会被合并,去重并命名空间化
17
- * @param extensionDir 扩展目录路径
18
- * @param extensionName 扩展名称(用于命名空间化)
19
- * @param outputStylePaths 可选的 output style 路径配置数组,相对于 extensionDir
20
- * @returns PluginOutputStyleEntry 数组
21
- */
22
- load(extensionDir: string, extensionName: string, outputStylePaths?: string[]): Promise<PluginOutputStyleEntry[]>;
23
- /**
24
- * 从指定的 output style 路径加载
25
- * @param extensionDir 扩展目录路径
26
- * @param extensionName 扩展名称(用于命名空间化)
27
- * @param outputStylePaths output style 路径配置数组
28
- * @param loadedPaths 已加载的路径集合,用于去重
29
- * @returns PluginOutputStyleEntry 数组
30
- */
31
- private loadFromPaths;
32
- private pathExists;
33
- /**
34
- * 扫描 output-styles 目录并加载所有 Markdown 文件
35
- * @param baseDir 基础目录路径
36
- * @param extensionName 扩展名称(用于命名空间化)
37
- * @param loadedPaths 已加载的路径集合
38
- * @returns PluginOutputStyleEntry 数组
39
- */
40
- private scanOutputStylesDirectory;
41
- /**
42
- * 解析单个 output style 文件
43
- * @param filePath 文件路径
44
- * @param extensionName 扩展名称(用于命名空间化)
45
- * @param styleName 可选的样式名称(来自目录或文件名)
46
- * @returns PluginOutputStyleEntry | undefined
47
- */
48
- private parseOutputStyleFile;
49
- }
@@ -1,49 +0,0 @@
1
- import { Logger } from '@celljs/core';
2
- import { PluginOptionsStorage } from '../plugin-options-storage';
3
- import { PluginComponents, PluginErrorCollector, PluginInfo } from '../plugin-protocol';
4
- import { AgentExtensionLoader } from './agent-loader';
5
- import { CommandExtensionLoader } from './command-loader';
6
- import { HookExtensionLoader } from './hook-loader';
7
- import { LSPExtensionLoader } from './lsp-loader';
8
- import { MCPExtensionLoader } from './mcp-loader';
9
- import { OutputStyleExtensionLoader } from './output-style-loader';
10
- import { SkillExtensionLoader } from './skill-loader';
11
- /**
12
- * 插件加载器管理器
13
- * 统一协调各类型扩展加载器,根据pluginInfo对象的配置智能加载扩展
14
- * 内部智能合并配置加载和文件扫描的结果
15
- */
16
- export declare class PluginLoaderManager {
17
- protected readonly logger: Logger;
18
- protected readonly errorCollector: PluginErrorCollector;
19
- protected readonly agentLoader: AgentExtensionLoader;
20
- protected readonly commandLoader: CommandExtensionLoader;
21
- protected readonly skillLoader: SkillExtensionLoader;
22
- protected readonly hookLoader: HookExtensionLoader;
23
- protected readonly mcpLoader: MCPExtensionLoader;
24
- protected readonly lspLoader: LSPExtensionLoader;
25
- protected readonly outputStyleLoader: OutputStyleExtensionLoader;
26
- protected readonly pluginOptionsStorage?: PluginOptionsStorage;
27
- protected init(): void;
28
- /**
29
- * 归一化路径配置:仅保留字符串路径,过滤掉非字符串项。
30
- *
31
- * 背景:plugin-manager 的 enrichPluginInfo 出于 REST 展示目的,会把
32
- * `{ name, description }` 对象写入同一个 PluginInfo 的 skills/commands 字段
33
- * (契约本应为路径字符串)。这些展示元数据并非可加载的路径,若直接透传给
34
- * 各 loader 的 `join(extensionDir, path)` 会抛 ERR_INVALID_ARG_TYPE,进而被
35
- * 上层 catch 静默吞掉,最终降级为「0 个技能/命令」。这里在消费边界做归一化,
36
- * 把非字符串项剔除;当过滤后为空时返回 undefined,使 loader 回退到默认目录扫描。
37
- */
38
- private normalizePathConfig;
39
- /**
40
- * 从插件信息加载所有组件
41
- * 根据pluginInfo对象中的配置字段决定加载哪些扩展
42
- * 各加载器内部会智能合并配置和文件扫描的结果
43
- *
44
- * @param pluginInfo 插件信息对象,包含name、description及agents/commands/skills/hooks/mcpServers等配置
45
- * @param pluginPath 插件安装路径
46
- * @returns PluginComponents 包含所有加载的扩展组件
47
- */
48
- loadPluginComponents(pluginInfo: PluginInfo, pluginPath: string): Promise<PluginComponents>;
49
- }
@@ -1,45 +0,0 @@
1
- import { Logger } from '@celljs/core';
2
- import { Skill } from '@genie/product';
3
- import { PluginEnvironmentContext } from '../plugin-environment';
4
- import { PluginErrorCollector, PluginExtensionType } from '../plugin-protocol';
5
- /**
6
- * Skill 扩展加载器
7
- * 从扩展目录的 skills 子目录中加载 skill 配置
8
- * 支持配置路径和默认扫描的合并
9
- */
10
- export declare class SkillExtensionLoader {
11
- readonly type = PluginExtensionType.Skill;
12
- protected readonly logger: Logger;
13
- protected readonly errorCollector: PluginErrorCollector;
14
- protected init(): void;
15
- /**
16
- * 加载 skills
17
- * 如果提供了 skillPaths 配置,则加载指定路径;否则默认扫描 skills 目录
18
- * 两种方式的结果会被合并
19
- * @param extensionDir 扩展目录路径
20
- * @param extensionName 扩展名称(用于标记)
21
- * @param skillPaths 可选的 skill 路径配置数组,相对于 extensionDir
22
- * @returns Skill 数组
23
- */
24
- load(extensionDir: string, extensionName: string, skillPaths?: string[], pluginEnvironment?: PluginEnvironmentContext): Promise<Skill[]>;
25
- /**
26
- * 从指定的 skill 路径加载
27
- * @param extensionDir 扩展目录路径
28
- * @param extensionName 扩展名称
29
- * @param skillPaths skill 路径配置数组
30
- * @param loadedPaths 已加载的路径集合,用于去重
31
- * @returns Skill 数组
32
- */
33
- private loadFromPaths;
34
- private pathExists;
35
- unload(extensionName: string): Promise<void>;
36
- /**
37
- * Maximum recursion depth for scanning nested skill directories.
38
- */
39
- private static readonly MAX_SCAN_DEPTH;
40
- private scanSkillsDirectory;
41
- private getSkillLoadConcurrency;
42
- private isDirectoryEntry;
43
- private isFileEntry;
44
- private parseSkillFile;
45
- }
@@ -1,50 +0,0 @@
1
- /**
2
- * 官方市场名称保护 - 四层防御
3
- *
4
- * 防止第三方冒充官方市场:
5
- * 1. 白名单 - 官方保留名称
6
- * 2. 黑名单模式 - 正则模式匹配冒充名称
7
- * 3. 同形攻击防护 - 检测 Unicode 非 ASCII 字符
8
- * 4. 源验证 - 官方名称必须来自可信源
9
- *
10
- * 参考: Claude Code schemas.ts:1-157
11
- */
12
- /**
13
- * 官方保留市场名称
14
- * 仅官方市场允许使用这些名称,第三方注册会被拒绝
15
- */
16
- export declare const ALLOWED_OFFICIAL_MARKETPLACE_NAMES: Set<string>;
17
- /**
18
- * 检测冒充官方名称的正则模式
19
- *
20
- * 匹配以下变体:
21
- * - "official" + "codebuddy/anthropic/claude" (如 "official-codebuddy-plugins")
22
- * - "codebuddy/anthropic/claude" + "official" (如 "claude-official")
23
- * - "codebuddy/anthropic/claude" 开头 + 官方后缀 (如 "anthropic-marketplace-new")
24
- */
25
- export declare const BLOCKED_OFFICIAL_NAME_PATTERN: RegExp;
26
- /**
27
- * 检查市场名称是否冒充官方名称
28
- *
29
- * @param name 市场名称
30
- * @returns true 表示被阻止(冒充),false 表示允许
31
- */
32
- export declare function isBlockedOfficialName(name: string): boolean;
33
- /**
34
- * 验证官方名称的来源是否可信
35
- * 官方保留名称只能从可信的 GitHub 组织或官方 CDN 路径注册
36
- *
37
- * @param name 市场名称
38
- * @param source 市场源地址 (GitHub URL、org/repo 格式、或官方 CDN URL)
39
- * @returns true 表示来源可信,false 表示不可信
40
- */
41
- export declare function validateOfficialNameSource(name: string, source?: string): boolean;
42
- /**
43
- * 检查是否为官方市场名称(用于自动更新默认值等)
44
- */
45
- export declare function isOfficialMarketplace(name: string): boolean;
46
- /**
47
- * 检查市场是否默认启用自动更新
48
- * 官方市场默认启用(除了明确排除的),第三方默认不启用
49
- */
50
- export declare function isMarketplaceAutoUpdateDefault(marketplaceName: string, autoUpdate?: boolean): boolean;
@@ -1,86 +0,0 @@
1
- import { MarketplaceInfo, MarketplaceType } from './plugin-protocol';
2
- export declare function getMarketplacesRoot(homePluginsDir?: string): string;
3
- /**
4
- * Require a single non-empty path segment. Unicode/spaces are allowed; unsafe
5
- * input is rejected rather than sanitized. Prefer {@link resolveMarketplaceInstallDir}
6
- * when you also need the directory; call this alone only to validate a name
7
- * without resolving a path (e.g. adopting an in-memory display name).
8
- */
9
- export declare function assertSafePathSegment(value: unknown, label?: string): void;
10
- /**
11
- * Plugin names used in `join(marketplaceRoot, 'plugins', name)` must be a
12
- * single safe identifier (same rule as Local/Git installers).
13
- */
14
- export declare function assertSafePluginName(name: unknown): void;
15
- /**
16
- * Resolve `segments` under `baseDir` and reject any path that escapes the root
17
- * (Zip Slip / `../` / absolute segments). By default the result must be a
18
- * strict child of `baseDir` (the root itself is not a valid install target).
19
- *
20
- * Pass `{ allowRoot: true }` for local plugin sources like `"."` / `"./"` where
21
- * the marketplace root is also the plugin root.
22
- */
23
- export declare function resolveContainedPath(baseDir: string, ...segments: string[]): string;
24
- /** Same as {@link resolveContainedPath}, but `"."` / `"./"` may resolve to `baseDir`. */
25
- export declare function resolveContainedPathAllowingRoot(baseDir: string, ...segments: string[]): string;
26
- /** Resolve `marketplaces/<name>` after a single segment check. Do not pre-assert. */
27
- export declare function resolveMarketplaceInstallDir(marketplacesRoot: string, name: unknown): string;
28
- /**
29
- * Persisted `installLocation` for non-directory marketplaces must stay inside
30
- * `plugins/marketplaces`. Poisoned config must fail closed — never delete or
31
- * update paths outside the root.
32
- */
33
- export declare function assertInstallLocationInsideMarketplacesRoot(installLocation: string, marketplacesRoot?: string): void;
34
- export declare function isInstallLocationInsideMarketplacesRoot(installLocation: string, marketplacesRoot?: string): boolean;
35
- /**
36
- * Resolve existing paths (or the nearest existing ancestor) via realpath and
37
- * ensure the final target stays inside the marketplaces root. Blocks
38
- * symlink/junction escapes that string containment alone would miss.
39
- *
40
- * Fail-closed: only ENOENT walks to a parent (first install / missing dest).
41
- * EACCES, ELOOP, and other realpath failures refuse the operation.
42
- */
43
- export declare function assertRealInstallLocationInsideMarketplacesRoot(installLocation: string, marketplacesRoot?: string): Promise<void>;
44
- export declare function isDirectoryMarketplaceType(type: MarketplaceType | string | undefined): boolean;
45
- export declare function isGeneratedMarketplaceSourceStagingName(name: string): boolean;
46
- /** Resolve the one durable source directory for a managed marketplace. */
47
- export declare function resolveStableMarketplaceInstallLocation(marketplace: Pick<MarketplaceInfo, 'name' | 'storageName'>, homePluginsDir?: string): string;
48
- /**
49
- * Detect the layout accidentally persisted by older clients after they used a
50
- * transaction-local `source-*` directory as the final marketplace directory.
51
- */
52
- export declare function isLegacyMarketplaceSourceStagingLocation(marketplace: Pick<MarketplaceInfo, 'type' | 'source' | 'installLocation'>, homePluginsDir?: string): boolean;
53
- /**
54
- * Check whether a persisted remote marketplace points at a complete local
55
- * source snapshot.
56
- *
57
- * Directory marketplaces are declarations of a host-owned live directory,
58
- * not copied source snapshots. Keep their registry entry even while that
59
- * directory is temporarily unavailable so already-materialized plugin caches
60
- * remain usable. Remote marketplaces, however, must have a readable catalog and every
61
- * catalog-local plugin directory before reconcile may call them installed.
62
- */
63
- export declare function isMarketplaceMaterialized(info: Pick<MarketplaceInfo, 'type' | 'source' | 'installLocation'>, marketplacesRoot?: string): Promise<boolean>;
64
- /**
65
- * Non-directory marketplaces may only persist install paths under marketplaces root.
66
- * Uses realpath so a junction/symlink that only *looks* contained is still rejected (#71947).
67
- */
68
- export declare function isLoadableInstallLocation(info: {
69
- type?: MarketplaceType | string;
70
- source?: {
71
- source?: string;
72
- };
73
- installLocation?: string;
74
- }, marketplacesRoot: string): Promise<boolean>;
75
- /**
76
- * Refuse to persist a non-directory marketplace whose installLocation escapes the
77
- * marketplaces root — including via symlink/junction (#71947).
78
- */
79
- export declare function assertSavableInstallLocation(marketplace: {
80
- name: string;
81
- type?: MarketplaceType | string;
82
- source?: {
83
- source?: string;
84
- };
85
- installLocation?: string;
86
- }, marketplacesRoot?: string): Promise<void>;
@@ -1,43 +0,0 @@
1
- import { Marketplace, MarketplaceInfo, MarketplaceManifest, MarketplaceSource, MarketplaceType, PluginInfo, ProgressCallback } from '../plugin-protocol';
2
- /**
3
- * 市场实体类
4
- */
5
- export declare class BaseMarketplace implements Marketplace {
6
- name: string;
7
- storageName: string;
8
- manifestName?: string;
9
- type: MarketplaceType;
10
- source: MarketplaceSource;
11
- installLocation: string;
12
- description?: string;
13
- lastUpdated?: string;
14
- isBuiltIn?: boolean;
15
- autoUpdate?: boolean;
16
- manifest?: MarketplaceManifest;
17
- constructor();
18
- init(marketplaceInfo: MarketplaceInfo): void;
19
- loadManifest(): Promise<void>;
20
- install(onProgress?: ProgressCallback): Promise<void>;
21
- update(onProgress?: ProgressCallback): Promise<boolean>;
22
- /**
23
- * 列出市场中的所有插件
24
- * 仅返回marketplace.json中定义的插件元数据,不执行安装
25
- * 实际安装由PluginManager通过PluginInstaller完成
26
- */
27
- listPlugins(): Promise<PluginInfo[]>;
28
- /**
29
- * 获取指定插件信息
30
- * @param pluginName 插件名称
31
- * @returns 插件信息,如果不存在则抛出异常
32
- */
33
- getPlugin(pluginName: string): Promise<PluginInfo | undefined>;
34
- /**
35
- * 转换为JSON对象
36
- *
37
- * 注意:必须包含 `storageName`,否则 marketplace 信息一旦经过 toJSON()
38
- *(例如对外 API 响应、跨进程消息、缓存持久化)就会丢失稳定 ID。
39
- * `name` 在 loadManifest() 后会被 manifest.name 覆盖,是不稳定字段,
40
- * 不能作为外部唯一标识使用。
41
- */
42
- toJSON(): MarketplaceInfo;
43
- }
@@ -1,22 +0,0 @@
1
- import { Logger } from '@genie/telemetry';
2
- import { BuiltInMarketplaceProvider, MarketplaceConfigEntry, MarketplaceSource } from '../plugin-protocol';
3
- export declare class BuiltInMarketplaceProviderImpl implements BuiltInMarketplaceProvider {
4
- protected readonly logger: Logger;
5
- /** 缓存内置市场名称集合 */
6
- private builtInNamesCache?;
7
- protected init(): void;
8
- /**
9
- * 获取所有内置市场配置
10
- * 将对象结构转换为带名称的数组结构
11
- */
12
- getBuiltInMarketplaces(): Promise<MarketplaceConfigEntry[]>;
13
- /**
14
- * 检查指定市场是否为内置市场
15
- */
16
- isBuiltInMarketplace(name: string): Promise<boolean>;
17
- getVersionUrl(name: string): Promise<string | undefined>;
18
- /**
19
- * 将市场配置转换为 MarketplaceSource
20
- */
21
- toMarketplaceSource(config: MarketplaceConfigEntry): MarketplaceSource;
22
- }
@@ -1,19 +0,0 @@
1
- import { PluginInfo, ProgressCallback } from '../plugin-protocol';
2
- import { BaseMarketplace } from './base-marketplace';
3
- /**
4
- * 目录类型的市场实现类
5
- */
6
- export declare class DirectoryMarketplace extends BaseMarketplace {
7
- private pluginListCache?;
8
- private pluginListLoading?;
9
- private pluginListGeneration;
10
- clearPluginListCache(): void;
11
- install(onProgress?: ProgressCallback): Promise<void>;
12
- /**
13
- * 列出市场中的所有插件
14
- */
15
- listPlugins(): Promise<PluginInfo[]>;
16
- private loadPluginList;
17
- private findPluginManifestPath;
18
- private clonePlugins;
19
- }
@@ -1,62 +0,0 @@
1
- import { Logger } from '@genie/telemetry';
2
- /**
3
- * Probes whether the local `git` executable is invokable.
4
- *
5
- * The result is cached for the lifetime of the process; concurrent callers
6
- * share a single probe promise. Callers that want a fresh answer (for
7
- * example after an in-app "install git" action) can call
8
- * {@link invalidateCache}.
9
- *
10
- * The probe is guarded by a short timeout. On slow machines this trades a
11
- * tiny chance of a false negative for a hard upper bound on how long
12
- * marketplace installation waits before deciding to fall back to Zip.
13
- *
14
- * On macOS the probe first checks — WITHOUT executing git — whether the
15
- * resolved `git` is merely the Apple Command Line Tools shim while the tools
16
- * are absent. In that case it reports git as unavailable instead of running
17
- * the shim, which would otherwise trigger the "install developer tools"
18
- * dialog. `xcode-select -p` is used for the tools-presence check; unlike
19
- * `git`/`xcode-select --install`, it never triggers the GUI prompt.
20
- */
21
- export declare class GitAvailabilityDetector {
22
- protected readonly logger: Logger;
23
- /**
24
- * Upper bound on the `git --version` probe. 5s is generous for a
25
- * process-start benchmark yet short enough that users do not perceive
26
- * a stall when git is absent but reported by shims that hang.
27
- */
28
- private static readonly DETECTION_TIMEOUT_MS;
29
- private probePromise;
30
- /** Returns true when `git --version` exits successfully within the timeout. */
31
- isAvailable(): Promise<boolean>;
32
- /** Clears the cached probe result so the next {@link isAvailable} call re-probes. */
33
- invalidateCache(): void;
34
- private probe;
35
- /**
36
- * macOS-only: decide whether executing `git` is safe (i.e. will not trigger
37
- * the Command Line Tools install dialog).
38
- *
39
- * - No `git` anywhere on PATH → not safe (nothing to run anyway).
40
- * - `git` resolves to a real binary (Homebrew/MacPorts/…, i.e. anything
41
- * other than {@link MACOS_GIT_STUB_PATH}) → safe.
42
- * - `git` resolves to the Apple shim → safe only when the Command Line
43
- * Tools / Xcode developer directory is actually configured.
44
- */
45
- private isMacGitSafeToExecute;
46
- /**
47
- * Resolve the `git` executable the same way the OS would when spawning it:
48
- * the first executable named `git` across `PATH`. Pure filesystem lookup —
49
- * it never executes anything, so it cannot trigger the macOS prompt.
50
- *
51
- * Returns the absolute candidate path, or undefined when none is found.
52
- */
53
- private resolveGitOnPath;
54
- /**
55
- * Whether the macOS Command Line Tools (or Xcode) developer directory is
56
- * configured. Uses `xcode-select -p`, which prints the active developer
57
- * directory or exits non-zero when the tools are absent — and crucially
58
- * does NOT trigger the install dialog (only `xcode-select --install` or
59
- * running a shim binary does).
60
- */
61
- private isCommandLineToolsInstalled;
62
- }