@hubspot/cli 7.5.11-experimental.0 → 7.6.0-beta.1

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 (352) hide show
  1. package/bin/cli.js +102 -95
  2. package/commands/account/auth.d.ts +5 -7
  3. package/commands/account/auth.js +74 -87
  4. package/commands/account/clean.d.ts +3 -7
  5. package/commands/account/clean.js +16 -9
  6. package/commands/account/createOverride.d.ts +3 -7
  7. package/commands/account/createOverride.js +23 -6
  8. package/commands/account/info.d.ts +3 -7
  9. package/commands/account/info.js +13 -5
  10. package/commands/account/list.d.ts +3 -7
  11. package/commands/account/list.js +15 -8
  12. package/commands/account/remove.d.ts +3 -7
  13. package/commands/account/remove.js +21 -9
  14. package/commands/account/removeOverride.d.ts +3 -7
  15. package/commands/account/removeOverride.js +23 -6
  16. package/commands/account/rename.d.ts +3 -7
  17. package/commands/account/rename.js +16 -9
  18. package/commands/account/use.d.ts +5 -9
  19. package/commands/account/use.js +14 -6
  20. package/commands/account.d.ts +3 -4
  21. package/commands/account.js +33 -58
  22. package/commands/app/migrate.d.ts +1 -2
  23. package/commands/app/migrate.js +7 -8
  24. package/commands/app/secret/add.d.ts +7 -0
  25. package/commands/app/secret/add.js +64 -0
  26. package/commands/app/secret/delete.d.ts +8 -0
  27. package/commands/app/secret/delete.js +87 -0
  28. package/commands/app/secret/list.d.ts +6 -0
  29. package/commands/app/secret/list.js +64 -0
  30. package/commands/app/secret/update.d.ts +7 -0
  31. package/commands/app/secret/update.js +77 -0
  32. package/commands/app/secret.d.ts +3 -0
  33. package/commands/app/secret.js +30 -0
  34. package/commands/app.d.ts +2 -5
  35. package/commands/app.js +10 -8
  36. package/commands/auth.d.ts +5 -7
  37. package/commands/auth.js +29 -28
  38. package/commands/cms/convertFields.d.ts +7 -1
  39. package/commands/cms/convertFields.js +57 -41
  40. package/commands/cms/getReactModule.d.ts +7 -1
  41. package/commands/cms/getReactModule.js +52 -34
  42. package/commands/cms/lighthouseScore.d.ts +8 -1
  43. package/commands/cms/lighthouseScore.js +129 -100
  44. package/commands/cms.d.ts +3 -1
  45. package/commands/cms.js +22 -15
  46. package/commands/completion.d.ts +3 -1
  47. package/commands/completion.js +23 -12
  48. package/commands/config/migrate.d.ts +3 -7
  49. package/commands/config/migrate.js +37 -46
  50. package/commands/config/set.d.ts +5 -6
  51. package/commands/config/set.js +38 -14
  52. package/commands/config.d.ts +3 -4
  53. package/commands/config.js +18 -44
  54. package/commands/create/api-sample.d.ts +3 -1
  55. package/commands/create/api-sample.js +34 -38
  56. package/commands/create/app.d.ts +3 -1
  57. package/commands/create/app.js +9 -7
  58. package/commands/create/function.d.ts +3 -1
  59. package/commands/create/function.js +11 -10
  60. package/commands/create/index.d.ts +5 -1
  61. package/commands/create/index.js +23 -11
  62. package/commands/create/module.d.ts +3 -1
  63. package/commands/create/module.js +14 -13
  64. package/commands/create/react-app.d.ts +3 -1
  65. package/commands/create/react-app.js +10 -7
  66. package/commands/create/template.d.ts +3 -1
  67. package/commands/create/template.js +14 -14
  68. package/commands/create/vue-app.d.ts +3 -1
  69. package/commands/create/vue-app.js +10 -7
  70. package/commands/create/webpack-serverless.d.ts +3 -1
  71. package/commands/create/webpack-serverless.js +10 -7
  72. package/commands/create/website-theme.d.ts +3 -1
  73. package/commands/create/website-theme.js +10 -9
  74. package/commands/create.d.ts +4 -24
  75. package/commands/create.js +62 -74
  76. package/commands/customObject/create.d.ts +4 -9
  77. package/commands/customObject/create.js +17 -10
  78. package/commands/customObject/schema/create.d.ts +4 -9
  79. package/commands/customObject/schema/create.js +18 -11
  80. package/commands/customObject/schema/delete.d.ts +4 -9
  81. package/commands/customObject/schema/delete.js +17 -10
  82. package/commands/customObject/schema/fetch-all.d.ts +4 -9
  83. package/commands/customObject/schema/fetch-all.js +17 -10
  84. package/commands/customObject/schema/fetch.d.ts +4 -9
  85. package/commands/customObject/schema/fetch.js +17 -10
  86. package/commands/customObject/schema/list.d.ts +4 -8
  87. package/commands/customObject/schema/list.js +17 -10
  88. package/commands/customObject/schema/update.d.ts +4 -9
  89. package/commands/customObject/schema/update.js +18 -11
  90. package/commands/customObject/schema.d.ts +3 -5
  91. package/commands/customObject/schema.js +27 -54
  92. package/commands/customObject.d.ts +3 -4
  93. package/commands/customObject.js +18 -45
  94. package/commands/doctor.d.ts +6 -8
  95. package/commands/doctor.js +30 -21
  96. package/commands/feedback.d.ts +4 -1
  97. package/commands/feedback.js +38 -47
  98. package/commands/fetch.d.ts +12 -1
  99. package/commands/fetch.js +49 -33
  100. package/commands/filemanager/fetch.d.ts +4 -9
  101. package/commands/filemanager/fetch.js +18 -11
  102. package/commands/filemanager/upload.d.ts +4 -9
  103. package/commands/filemanager/upload.js +17 -11
  104. package/commands/filemanager.d.ts +3 -4
  105. package/commands/filemanager.js +18 -41
  106. package/commands/function/deploy.d.ts +6 -1
  107. package/commands/function/deploy.js +70 -50
  108. package/commands/function/list.d.ts +6 -1
  109. package/commands/function/list.js +44 -32
  110. package/commands/function/server.d.ts +10 -1
  111. package/commands/function/server.js +49 -38
  112. package/commands/function.d.ts +5 -1
  113. package/commands/function.js +22 -10
  114. package/commands/getStarted.d.ts +9 -0
  115. package/commands/getStarted.js +227 -0
  116. package/commands/hubdb/clear.d.ts +4 -9
  117. package/commands/hubdb/clear.js +17 -10
  118. package/commands/hubdb/create.d.ts +4 -9
  119. package/commands/hubdb/create.js +17 -10
  120. package/commands/hubdb/delete.d.ts +4 -9
  121. package/commands/hubdb/delete.js +17 -10
  122. package/commands/hubdb/fetch.d.ts +4 -9
  123. package/commands/hubdb/fetch.js +17 -10
  124. package/commands/hubdb/list.d.ts +4 -0
  125. package/commands/hubdb/list.js +83 -0
  126. package/commands/hubdb.d.ts +3 -2
  127. package/commands/hubdb.js +23 -45
  128. package/commands/init.d.ts +3 -7
  129. package/commands/init.js +17 -8
  130. package/commands/lint.d.ts +6 -4
  131. package/commands/lint.js +42 -43
  132. package/commands/list.d.ts +3 -7
  133. package/commands/list.js +17 -11
  134. package/commands/logs.d.ts +10 -1
  135. package/commands/logs.js +53 -44
  136. package/commands/mcp/setup.d.ts +7 -0
  137. package/commands/mcp/setup.js +52 -0
  138. package/commands/mcp/start.d.ts +3 -0
  139. package/commands/mcp/start.js +77 -0
  140. package/commands/mcp.d.ts +3 -0
  141. package/commands/mcp.js +26 -0
  142. package/commands/module/marketplace-validate.d.ts +6 -1
  143. package/commands/module/marketplace-validate.js +39 -29
  144. package/commands/module.d.ts +3 -1
  145. package/commands/module.js +23 -10
  146. package/commands/mv.d.ts +3 -7
  147. package/commands/mv.js +17 -11
  148. package/commands/open.d.ts +3 -7
  149. package/commands/open.js +17 -11
  150. package/commands/project/add.d.ts +5 -2
  151. package/commands/project/add.js +43 -80
  152. package/commands/project/cloneApp.d.ts +1 -1
  153. package/commands/project/cloneApp.js +2 -2
  154. package/commands/project/create.d.ts +2 -8
  155. package/commands/project/create.js +84 -55
  156. package/commands/project/deploy.d.ts +2 -0
  157. package/commands/project/deploy.js +67 -13
  158. package/commands/project/dev/deprecatedFlow.d.ts +8 -2
  159. package/commands/project/dev/deprecatedFlow.js +9 -1
  160. package/commands/project/dev/index.d.ts +1 -4
  161. package/commands/project/dev/index.js +88 -31
  162. package/commands/project/dev/unifiedFlow.d.ts +11 -2
  163. package/commands/project/dev/unifiedFlow.js +81 -41
  164. package/commands/project/listBuilds.js +2 -5
  165. package/commands/project/migrate.d.ts +1 -0
  166. package/commands/project/profile/add.d.ts +7 -0
  167. package/commands/project/profile/add.js +209 -0
  168. package/commands/project/profile/delete.d.ts +6 -0
  169. package/commands/project/profile/delete.js +123 -0
  170. package/commands/project/profile.d.ts +3 -0
  171. package/commands/project/profile.js +25 -0
  172. package/commands/project/upload.d.ts +1 -0
  173. package/commands/project/upload.js +22 -8
  174. package/commands/project/validate.d.ts +6 -0
  175. package/commands/project/validate.js +82 -0
  176. package/commands/project.js +4 -2
  177. package/commands/remove.d.ts +3 -7
  178. package/commands/remove.js +22 -22
  179. package/commands/sandbox/create.d.ts +4 -9
  180. package/commands/sandbox/create.js +18 -11
  181. package/commands/sandbox/delete.d.ts +4 -9
  182. package/commands/sandbox/delete.js +18 -11
  183. package/commands/sandbox.d.ts +3 -4
  184. package/commands/sandbox.js +18 -43
  185. package/commands/secret/addSecret.d.ts +4 -9
  186. package/commands/secret/addSecret.js +17 -10
  187. package/commands/secret/deleteSecret.d.ts +4 -9
  188. package/commands/secret/deleteSecret.js +17 -10
  189. package/commands/secret/listSecret.d.ts +4 -9
  190. package/commands/secret/listSecret.js +17 -10
  191. package/commands/secret/updateSecret.d.ts +4 -9
  192. package/commands/secret/updateSecret.js +17 -10
  193. package/commands/secret.d.ts +3 -4
  194. package/commands/secret.js +23 -48
  195. package/commands/testAccount/create.d.ts +6 -0
  196. package/commands/testAccount/create.js +100 -0
  197. package/commands/testAccount/createConfig.d.ts +10 -0
  198. package/commands/testAccount/createConfig.js +98 -0
  199. package/commands/testAccount/delete.d.ts +6 -0
  200. package/commands/testAccount/delete.js +48 -0
  201. package/commands/testAccount.d.ts +3 -0
  202. package/commands/testAccount.js +28 -0
  203. package/commands/theme/generate-selectors.d.ts +3 -7
  204. package/commands/theme/generate-selectors.js +20 -15
  205. package/commands/theme/marketplace-validate.d.ts +4 -9
  206. package/commands/theme/marketplace-validate.js +22 -17
  207. package/commands/theme/preview.d.ts +4 -9
  208. package/commands/theme/preview.js +32 -26
  209. package/commands/theme.d.ts +3 -4
  210. package/commands/theme.js +22 -47
  211. package/commands/upload.d.ts +12 -1
  212. package/commands/upload.js +116 -134
  213. package/commands/watch.d.ts +14 -1
  214. package/commands/watch.js +74 -75
  215. package/lang/en.d.ts +1135 -660
  216. package/lang/en.js +935 -471
  217. package/lang/en.lyaml +30 -213
  218. package/lib/accountTypes.js +1 -2
  219. package/lib/app/migrate.d.ts +23 -0
  220. package/lib/app/migrate.js +29 -6
  221. package/lib/app/migrate_legacy.js +7 -7
  222. package/lib/app/urls.d.ts +16 -0
  223. package/lib/app/urls.js +16 -0
  224. package/lib/commonOpts.d.ts +1 -3
  225. package/lib/commonOpts.js +1 -1
  226. package/lib/configMigrate.d.ts +2 -2
  227. package/lib/configMigrate.js +34 -55
  228. package/lib/configOptions.d.ts +4 -0
  229. package/lib/configOptions.js +41 -46
  230. package/lib/constants.d.ts +29 -0
  231. package/lib/constants.js +30 -1
  232. package/lib/dependencyManagement.d.ts +0 -5
  233. package/lib/dependencyManagement.js +13 -39
  234. package/lib/doctor/Doctor.js +3 -2
  235. package/lib/errorHandlers/index.js +7 -0
  236. package/lib/filesystem.d.ts +1 -1
  237. package/lib/generateSelectors.js +3 -5
  238. package/lib/interpolation.d.ts +2 -3
  239. package/lib/lang.d.ts +2 -3
  240. package/lib/marketplaceValidate.d.ts +12 -2
  241. package/lib/marketplaceValidate.js +22 -29
  242. package/lib/mcp/setup.d.ts +21 -0
  243. package/lib/mcp/setup.js +218 -0
  244. package/lib/middleware/autoUpdateMiddleware.d.ts +1 -0
  245. package/lib/middleware/autoUpdateMiddleware.js +89 -0
  246. package/lib/middleware/configMiddleware.js +23 -0
  247. package/lib/middleware/fireAlarmMiddleware.d.ts +2 -2
  248. package/lib/middleware/fireAlarmMiddleware.js +5 -3
  249. package/lib/npm.d.ts +9 -0
  250. package/lib/npm.js +36 -0
  251. package/lib/projectProfiles.d.ts +7 -0
  252. package/lib/projectProfiles.js +83 -0
  253. package/lib/projects/add/legacyAddComponent.d.ts +5 -0
  254. package/lib/projects/add/legacyAddComponent.js +48 -0
  255. package/lib/projects/add/v3AddComponent.d.ts +8 -0
  256. package/lib/projects/add/v3AddComponent.js +85 -0
  257. package/lib/projects/buildAndDeploy.js +18 -3
  258. package/lib/projects/components.d.ts +2 -0
  259. package/lib/projects/components.js +82 -0
  260. package/lib/projects/create/index.d.ts +23 -0
  261. package/lib/projects/create/index.js +33 -0
  262. package/lib/projects/create/legacy.d.ts +6 -0
  263. package/lib/projects/{create.js → create/legacy.js} +20 -11
  264. package/lib/projects/create/v3.d.ts +27 -0
  265. package/lib/projects/create/v3.js +158 -0
  266. package/lib/projects/localDev/AppDevModeInterface.d.ts +30 -0
  267. package/lib/projects/localDev/AppDevModeInterface.js +215 -0
  268. package/lib/projects/localDev/DevServerManagerV2.d.ts +11 -22
  269. package/lib/projects/localDev/DevServerManagerV2.js +19 -15
  270. package/lib/projects/localDev/LocalDevLogger.d.ts +30 -0
  271. package/lib/projects/localDev/LocalDevLogger.js +159 -0
  272. package/lib/projects/localDev/LocalDevManager.js +12 -5
  273. package/lib/projects/localDev/LocalDevProcess.d.ts +34 -0
  274. package/lib/projects/localDev/LocalDevProcess.js +201 -0
  275. package/lib/projects/localDev/LocalDevState.d.ts +50 -0
  276. package/lib/projects/localDev/LocalDevState.js +119 -0
  277. package/lib/projects/localDev/LocalDevWatcher.d.ts +10 -0
  278. package/lib/projects/localDev/LocalDevWatcher.js +53 -0
  279. package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +20 -0
  280. package/lib/projects/localDev/LocalDevWebsocketServer.js +131 -0
  281. package/lib/projects/localDev/helpers.d.ts +3 -2
  282. package/lib/projects/localDev/helpers.js +32 -2
  283. package/lib/projects/upload.d.ts +5 -1
  284. package/lib/projects/upload.js +60 -20
  285. package/lib/projects/urls.d.ts +3 -0
  286. package/lib/projects/urls.js +17 -1
  287. package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
  288. package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +17 -0
  289. package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +96 -0
  290. package/lib/prompts/createProjectPrompt.d.ts +14 -5
  291. package/lib/prompts/createProjectPrompt.js +38 -13
  292. package/lib/prompts/createTemplatePrompt.d.ts +22 -4
  293. package/lib/prompts/installAppPrompt.d.ts +2 -0
  294. package/lib/prompts/installAppPrompt.js +45 -0
  295. package/lib/prompts/personalAccessKeyPrompt.js +35 -24
  296. package/lib/prompts/projectAddPrompt.d.ts +5 -1
  297. package/lib/prompts/projectAddPrompt.js +35 -7
  298. package/lib/prompts/projectDevTargetAccountPrompt.d.ts +6 -1
  299. package/lib/prompts/projectDevTargetAccountPrompt.js +6 -6
  300. package/lib/prompts/promptUtils.d.ts +4 -1
  301. package/lib/prompts/promptUtils.js +5 -1
  302. package/lib/prompts/selectAppPrompt.d.ts +2 -0
  303. package/lib/prompts/selectAppPrompt.js +40 -0
  304. package/lib/prompts/{selectPublicAppPrompt.d.ts → selectPublicAppForMigrationPrompt.d.ts} +1 -1
  305. package/lib/prompts/{selectPublicAppPrompt.js → selectPublicAppForMigrationPrompt.js} +8 -8
  306. package/lib/prompts/setAsDefaultAccountPrompt.js +10 -0
  307. package/lib/testUtils.d.ts +3 -3
  308. package/lib/testUtils.js +8 -9
  309. package/lib/ui/index.js +4 -1
  310. package/lib/upload.d.ts +1 -1
  311. package/lib/validation.js +4 -5
  312. package/lib/yargsUtils.d.ts +4 -0
  313. package/lib/yargsUtils.js +6 -0
  314. package/mcp-server/server.d.ts +1 -0
  315. package/mcp-server/server.js +18 -0
  316. package/mcp-server/tools/index.d.ts +2 -0
  317. package/mcp-server/tools/index.js +19 -0
  318. package/mcp-server/tools/project/AddFeatureToProject.d.ts +29 -0
  319. package/mcp-server/tools/project/AddFeatureToProject.js +85 -0
  320. package/mcp-server/tools/project/CreateProjectTool.d.ts +35 -0
  321. package/mcp-server/tools/project/CreateProjectTool.js +104 -0
  322. package/mcp-server/tools/project/DeployProject.d.ts +20 -0
  323. package/mcp-server/tools/project/DeployProject.js +50 -0
  324. package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +17 -0
  325. package/mcp-server/tools/project/GuidedWalkthroughTool.js +58 -0
  326. package/mcp-server/tools/project/UploadProjectTools.d.ts +17 -0
  327. package/mcp-server/tools/project/UploadProjectTools.js +35 -0
  328. package/mcp-server/tools/project/ValidateProjectTool.d.ts +17 -0
  329. package/mcp-server/tools/project/ValidateProjectTool.js +35 -0
  330. package/mcp-server/tools/project/constants.d.ts +3 -0
  331. package/mcp-server/tools/project/constants.js +13 -0
  332. package/mcp-server/types.d.ts +14 -0
  333. package/mcp-server/types.js +17 -0
  334. package/mcp-server/utils/command.d.ts +3 -0
  335. package/mcp-server/utils/command.js +16 -0
  336. package/mcp-server/utils/content.d.ts +3 -0
  337. package/mcp-server/utils/content.js +21 -0
  338. package/mcp-server/utils/project.d.ts +5 -0
  339. package/mcp-server/utils/project.js +17 -0
  340. package/package.json +24 -16
  341. package/types/Cms.d.ts +30 -0
  342. package/types/Cms.js +2 -0
  343. package/types/LocalDev.d.ts +35 -0
  344. package/types/LocalDev.js +2 -0
  345. package/types/Projects.d.ts +19 -2
  346. package/types/Prompts.d.ts +0 -7
  347. package/types/Yargs.d.ts +10 -1
  348. package/lib/projects/create.d.ts +0 -5
  349. package/lib/projects/localDev/LocalDevManagerV2.d.ts +0 -64
  350. package/lib/projects/localDev/LocalDevManagerV2.js +0 -345
  351. package/lib/prompts/installPublicAppPrompt.d.ts +0 -1
  352. package/lib/prompts/installPublicAppPrompt.js +0 -41
@@ -0,0 +1,29 @@
1
+ import { TextContentResponse, Tool } from '../../types';
2
+ import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { z } from 'zod';
4
+ declare const inputSchemaZodObject: z.ZodObject<{
5
+ absoluteProjectPath: z.ZodString;
6
+ addApp: z.ZodBoolean;
7
+ distribution: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"marketplace">, z.ZodLiteral<"private">]>>;
8
+ auth: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"static">, z.ZodLiteral<"oauth">]>>;
9
+ features: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">]>, "many">>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ absoluteProjectPath: string;
12
+ addApp: boolean;
13
+ auth?: "oauth" | "static" | undefined;
14
+ distribution?: "marketplace" | "private" | undefined;
15
+ features?: ("card" | "settings" | "app-function" | "webhooks")[] | undefined;
16
+ }, {
17
+ absoluteProjectPath: string;
18
+ addApp: boolean;
19
+ auth?: "oauth" | "static" | undefined;
20
+ distribution?: "marketplace" | "private" | undefined;
21
+ features?: ("card" | "settings" | "app-function" | "webhooks")[] | undefined;
22
+ }>;
23
+ export type AddFeatureInputSchema = z.infer<typeof inputSchemaZodObject>;
24
+ export declare class AddFeatureToProject extends Tool<AddFeatureInputSchema> {
25
+ constructor(mcpServer: McpServer);
26
+ handler({ absoluteProjectPath, distribution, auth, features, addApp, }: AddFeatureInputSchema): Promise<TextContentResponse>;
27
+ register(): RegisteredTool;
28
+ }
29
+ export {};
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddFeatureToProject = void 0;
4
+ const types_1 = require("../../types");
5
+ const zod_1 = require("zod");
6
+ const constants_1 = require("../../../lib/constants");
7
+ const command_1 = require("../../utils/command");
8
+ const constants_2 = require("./constants");
9
+ const project_1 = require("../../utils/project");
10
+ const content_1 = require("../../utils/content");
11
+ const inputSchema = {
12
+ absoluteProjectPath: constants_2.absoluteProjectPath,
13
+ addApp: zod_1.z
14
+ .boolean()
15
+ .describe('Should an app be added? If there is no app in the project, an app must be added to add a feature'),
16
+ distribution: zod_1.z
17
+ .optional(zod_1.z.union([
18
+ zod_1.z.literal(constants_1.APP_DISTRIBUTION_TYPES.MARKETPLACE),
19
+ zod_1.z.literal(constants_1.APP_DISTRIBUTION_TYPES.PRIVATE),
20
+ ]))
21
+ .describe('Private is used if you do not wish to distribute your application on the HubSpot marketplace. If not specified by the user, do not choose for them. This cannot be changed after a project is uploaded.'),
22
+ auth: zod_1.z
23
+ .optional(zod_1.z.union([
24
+ zod_1.z.literal(constants_1.APP_AUTH_TYPES.STATIC),
25
+ zod_1.z.literal(constants_1.APP_AUTH_TYPES.OAUTH),
26
+ ]))
27
+ .describe('Static uses a static non changing authentication token, and is only available for private distribution. If not specified by the user, do not choose for them. This cannot be changed after a project is uploaded.'),
28
+ features: zod_1.z
29
+ .array(zod_1.z
30
+ .union([
31
+ zod_1.z.literal('card'),
32
+ zod_1.z.literal('settings'),
33
+ zod_1.z.literal('app-function'),
34
+ zod_1.z.literal('webhooks'),
35
+ ])
36
+ .describe('The features to include in the project, multiple options can be selected'))
37
+ .optional(),
38
+ };
39
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
40
+ const inputSchemaZodObject = zod_1.z.object({
41
+ ...inputSchema,
42
+ });
43
+ class AddFeatureToProject extends types_1.Tool {
44
+ constructor(mcpServer) {
45
+ super(mcpServer);
46
+ }
47
+ async handler({ absoluteProjectPath, distribution, auth, features, addApp, }) {
48
+ try {
49
+ let command = `hs project add`;
50
+ const content = [];
51
+ if (distribution) {
52
+ command = (0, command_1.addFlag)(command, 'distribution', distribution);
53
+ }
54
+ else if (addApp) {
55
+ content.push((0, content_1.formatTextContent)(`Ask the user how they would you like to distribute the application. Options are ${constants_1.APP_DISTRIBUTION_TYPES.MARKETPLACE} and ${constants_1.APP_DISTRIBUTION_TYPES.PRIVATE}`));
56
+ }
57
+ if (auth) {
58
+ command = (0, command_1.addFlag)(command, 'auth', auth);
59
+ }
60
+ else if (addApp) {
61
+ content.push((0, content_1.formatTextContent)(`Ask the user which auth type they would like to use. Options are ${constants_1.APP_AUTH_TYPES.STATIC} and ${constants_1.APP_AUTH_TYPES.OAUTH}`));
62
+ }
63
+ if (content.length > 0) {
64
+ return {
65
+ content,
66
+ };
67
+ }
68
+ // If features isn't provided, pass an empty array to bypass the prompt
69
+ command = (0, command_1.addFlag)(command, 'features', features || []);
70
+ const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteProjectPath, command);
71
+ return (0, content_1.formatTextContents)(stdout, stderr);
72
+ }
73
+ catch (error) {
74
+ return (0, content_1.formatTextContents)(error instanceof Error ? error.message : `${error}`);
75
+ }
76
+ }
77
+ register() {
78
+ return this.mcpServer.registerTool('add-feature-to-hubspot-project', {
79
+ title: 'Add feature to HubSpot Project',
80
+ description: 'Adds a feature to an existing HubSpot project',
81
+ inputSchema,
82
+ }, this.handler);
83
+ }
84
+ }
85
+ exports.AddFeatureToProject = AddFeatureToProject;
@@ -0,0 +1,35 @@
1
+ import { TextContentResponse, Tool } from '../../types';
2
+ import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { z } from 'zod';
4
+ declare const inputSchemaZodObject: z.ZodObject<{
5
+ absoluteCurrentWorkingDirectory: z.ZodString;
6
+ name: z.ZodOptional<z.ZodString>;
7
+ destination: z.ZodString;
8
+ projectBase: z.ZodUnion<[z.ZodLiteral<"empty">, z.ZodLiteral<"app">]>;
9
+ distribution: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"marketplace">, z.ZodLiteral<"private">]>>;
10
+ auth: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"static">, z.ZodLiteral<"oauth">]>>>;
11
+ features: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">]>, "many">>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ projectBase: "app" | "empty";
14
+ absoluteCurrentWorkingDirectory: string;
15
+ destination: string;
16
+ auth?: "oauth" | "static" | undefined;
17
+ name?: string | undefined;
18
+ distribution?: "marketplace" | "private" | undefined;
19
+ features?: ("card" | "settings" | "app-function" | "webhooks")[] | undefined;
20
+ }, {
21
+ projectBase: "app" | "empty";
22
+ absoluteCurrentWorkingDirectory: string;
23
+ destination: string;
24
+ auth?: "oauth" | "static" | undefined;
25
+ name?: string | undefined;
26
+ distribution?: "marketplace" | "private" | undefined;
27
+ features?: ("card" | "settings" | "app-function" | "webhooks")[] | undefined;
28
+ }>;
29
+ export type CreateProjectInputSchema = z.infer<typeof inputSchemaZodObject>;
30
+ export declare class CreateProjectTool extends Tool<CreateProjectInputSchema> {
31
+ constructor(mcpServer: McpServer);
32
+ handler({ name, destination, projectBase, distribution, auth, features, absoluteCurrentWorkingDirectory, }: CreateProjectInputSchema): Promise<TextContentResponse>;
33
+ register(): RegisteredTool;
34
+ }
35
+ export {};
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateProjectTool = void 0;
4
+ const types_1 = require("../../types");
5
+ const zod_1 = require("zod");
6
+ const constants_1 = require("../../../lib/constants");
7
+ const command_1 = require("../../utils/command");
8
+ const v3_1 = require("../../../lib/projects/create/v3");
9
+ const constants_2 = require("./constants");
10
+ const project_1 = require("../../utils/project");
11
+ const content_1 = require("../../utils/content");
12
+ const inputSchema = {
13
+ absoluteCurrentWorkingDirectory: constants_2.absoluteCurrentWorkingDirectory,
14
+ name: zod_1.z
15
+ .string()
16
+ .describe('The name of the project to be created. This name is how your project will appear in HubSpot. If not specified by the user, do not choose for them. Changing this is potentially destructive.')
17
+ .optional(),
18
+ destination: zod_1.z
19
+ .string()
20
+ .describe('Relative path to the directory the project will be created in. DO NOT use the current directory unless the user has explicitly stated to do so.'),
21
+ projectBase: zod_1.z
22
+ .union([zod_1.z.literal(v3_1.EMPTY_PROJECT), zod_1.z.literal(v3_1.PROJECT_WITH_APP)])
23
+ .describe('Empty will create an empty project, and app will create a project with an app inside of it.'),
24
+ distribution: zod_1.z
25
+ .optional(zod_1.z.union([
26
+ zod_1.z.literal(constants_1.APP_DISTRIBUTION_TYPES.MARKETPLACE),
27
+ zod_1.z.literal(constants_1.APP_DISTRIBUTION_TYPES.PRIVATE),
28
+ ]))
29
+ .describe('Private is used if you do not wish to distribute your application on the HubSpot marketplace. If not specified by the user, do not choose for them. This cannot be changed after a project is uploaded.'),
30
+ auth: zod_1.z
31
+ .optional(zod_1.z.union([
32
+ zod_1.z.literal(constants_1.APP_AUTH_TYPES.STATIC),
33
+ zod_1.z.literal(constants_1.APP_AUTH_TYPES.OAUTH),
34
+ ]))
35
+ .describe('Static uses a static non changing authentication token, and is only available for private distribution. If not specified by the user, do not choose for them. This cannot be changed after a project is uploaded.')
36
+ .optional(),
37
+ features: zod_1.z
38
+ .array(zod_1.z
39
+ .union([
40
+ zod_1.z.literal('card'),
41
+ zod_1.z.literal('settings'),
42
+ zod_1.z.literal('app-function'),
43
+ zod_1.z.literal('webhooks'),
44
+ ])
45
+ .describe('The features to include in the project, multiple options can be selected'))
46
+ .optional(),
47
+ };
48
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
49
+ const inputSchemaZodObject = zod_1.z.object({ ...inputSchema });
50
+ class CreateProjectTool extends types_1.Tool {
51
+ constructor(mcpServer) {
52
+ super(mcpServer);
53
+ }
54
+ async handler({ name, destination, projectBase, distribution, auth, features, absoluteCurrentWorkingDirectory, }) {
55
+ let command = (0, command_1.addFlag)('hs project create', 'platform-version', '2025.2');
56
+ const content = [];
57
+ if (name) {
58
+ command = (0, command_1.addFlag)(command, 'name', name);
59
+ }
60
+ else {
61
+ content.push((0, content_1.formatTextContent)(`Ask the user what they would like to name the project.`));
62
+ }
63
+ if (destination) {
64
+ command = (0, command_1.addFlag)(command, 'dest', destination);
65
+ }
66
+ if (projectBase) {
67
+ command = (0, command_1.addFlag)(command, 'project-base', projectBase);
68
+ }
69
+ if (distribution) {
70
+ command = (0, command_1.addFlag)(command, 'distribution', distribution);
71
+ }
72
+ else if (projectBase === v3_1.PROJECT_WITH_APP) {
73
+ content.push((0, content_1.formatTextContent)(`Ask the user how they would you like to distribute the application? Options are ${constants_1.APP_DISTRIBUTION_TYPES.MARKETPLACE} and ${constants_1.APP_DISTRIBUTION_TYPES.PRIVATE}`));
74
+ }
75
+ if (auth) {
76
+ command = (0, command_1.addFlag)(command, 'auth', auth);
77
+ }
78
+ else if (projectBase === v3_1.PROJECT_WITH_APP) {
79
+ content.push((0, content_1.formatTextContent)(`Ask the user which auth type they would like to use? Options are ${constants_1.APP_AUTH_TYPES.STATIC} and ${constants_1.APP_AUTH_TYPES.OAUTH}`));
80
+ }
81
+ if (content.length > 0) {
82
+ return {
83
+ content,
84
+ };
85
+ }
86
+ // Always pass features, even if it is an empty array to bypass the prompts
87
+ command = (0, command_1.addFlag)(command, 'features', features || []);
88
+ try {
89
+ const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteCurrentWorkingDirectory, command);
90
+ return (0, content_1.formatTextContents)(stdout, stderr);
91
+ }
92
+ catch (error) {
93
+ return (0, content_1.formatTextContents)(error instanceof Error ? error.message : `${error}`);
94
+ }
95
+ }
96
+ register() {
97
+ return this.mcpServer.registerTool('create-hubspot-project', {
98
+ title: 'Create HubSpot Project',
99
+ description: 'Creates a HubSpot project with the provided name and outputs it in the provided destination',
100
+ inputSchema,
101
+ }, this.handler);
102
+ }
103
+ }
104
+ exports.CreateProjectTool = CreateProjectTool;
@@ -0,0 +1,20 @@
1
+ import { TextContentResponse, Tool } from '../../types';
2
+ import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { z } from 'zod';
4
+ declare const inputSchemaZodObject: z.ZodObject<{
5
+ absoluteProjectPath: z.ZodString;
6
+ buildNumber: z.ZodOptional<z.ZodNumber>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ absoluteProjectPath: string;
9
+ buildNumber?: number | undefined;
10
+ }, {
11
+ absoluteProjectPath: string;
12
+ buildNumber?: number | undefined;
13
+ }>;
14
+ type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
15
+ export declare class DeployProject extends Tool<InputSchemaType> {
16
+ constructor(mcpServer: McpServer);
17
+ handler({ absoluteProjectPath, buildNumber, }: InputSchemaType): Promise<TextContentResponse>;
18
+ register(): RegisteredTool;
19
+ }
20
+ export {};
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeployProject = void 0;
4
+ const types_1 = require("../../types");
5
+ const zod_1 = require("zod");
6
+ const command_1 = require("../../utils/command");
7
+ const constants_1 = require("./constants");
8
+ const project_1 = require("../../utils/project");
9
+ const content_1 = require("../../utils/content");
10
+ const inputSchema = {
11
+ absoluteProjectPath: constants_1.absoluteProjectPath,
12
+ buildNumber: zod_1.z
13
+ .optional(zod_1.z.number())
14
+ .describe('The build number to be deployed. This can be found in the project details page using `hs project open`. If no build number is specified, the most recent build is deployed'),
15
+ };
16
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
17
+ const inputSchemaZodObject = zod_1.z.object({
18
+ ...inputSchema,
19
+ });
20
+ class DeployProject extends types_1.Tool {
21
+ constructor(mcpServer) {
22
+ super(mcpServer);
23
+ }
24
+ async handler({ absoluteProjectPath, buildNumber, }) {
25
+ let command = `hs project deploy`;
26
+ const content = [];
27
+ if (!buildNumber) {
28
+ const { stdout } = await (0, project_1.runCommandInDir)(absoluteProjectPath, `hs project list-builds --limit 100`);
29
+ content.push((0, content_1.formatTextContent)(`Ask the user which build number they would like to deploy? Build information: ${stdout}`));
30
+ }
31
+ else {
32
+ command = (0, command_1.addFlag)(command, 'build', buildNumber);
33
+ }
34
+ if (content.length) {
35
+ return {
36
+ content,
37
+ };
38
+ }
39
+ const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteProjectPath, command);
40
+ return (0, content_1.formatTextContents)(stdout, stderr);
41
+ }
42
+ register() {
43
+ return this.mcpServer.registerTool('deploy-hubspot-project', {
44
+ title: 'Deploy a build of HubSpot Project',
45
+ description: 'Takes a build number and a project name and deploys that build of the project. DO NOT run this tool unless the user specifies they would like to deploy the project.',
46
+ inputSchema,
47
+ }, this.handler);
48
+ }
49
+ }
50
+ exports.DeployProject = DeployProject;
@@ -0,0 +1,17 @@
1
+ import { TextContentResponse, Tool } from '../../types';
2
+ import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { z } from 'zod';
4
+ declare const inputSchemaZodObject: z.ZodObject<{
5
+ command: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"hs init">, z.ZodLiteral<"hs auth">, z.ZodLiteral<"hs project create">, z.ZodLiteral<"hs project upload">]>>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ command?: "hs auth" | "hs project upload" | "hs project create" | "hs init" | undefined;
8
+ }, {
9
+ command?: "hs auth" | "hs project upload" | "hs project create" | "hs init" | undefined;
10
+ }>;
11
+ type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
12
+ export declare class GuidedWalkthroughTool extends Tool<InputSchemaType> {
13
+ constructor(mcpServer: McpServer);
14
+ handler({ command }: InputSchemaType): Promise<TextContentResponse>;
15
+ register(): RegisteredTool;
16
+ }
17
+ export {};
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GuidedWalkthroughTool = void 0;
4
+ const types_1 = require("../../types");
5
+ const zod_1 = require("zod");
6
+ const command_1 = require("../../utils/command");
7
+ const content_1 = require("../../utils/content");
8
+ const nextCommands = {
9
+ 'hs init': 'hs auth',
10
+ 'hs auth': 'hs project create',
11
+ 'hs project create': 'hs project upload',
12
+ 'hs project upload': 'hs project dev',
13
+ };
14
+ const inputSchema = {
15
+ command: zod_1.z
16
+ .union([
17
+ zod_1.z.literal('hs init'),
18
+ zod_1.z.literal('hs auth'),
19
+ zod_1.z.literal('hs project create'),
20
+ zod_1.z.literal('hs project upload'),
21
+ ])
22
+ .describe('The command to learn more about. Start with `hs init`')
23
+ .optional(),
24
+ };
25
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
26
+ const inputSchemaZodObject = zod_1.z.object({
27
+ ...inputSchema,
28
+ });
29
+ class GuidedWalkthroughTool extends types_1.Tool {
30
+ constructor(mcpServer) {
31
+ super(mcpServer);
32
+ }
33
+ async handler({ command }) {
34
+ if (command) {
35
+ const { stdout } = await (0, command_1.execAsync)(`${command} --help`);
36
+ return (0, content_1.formatTextContents)(`Display this help output for the user amd wait for them to acknowledge: ${stdout}. ${nextCommands[command] ? `Once they are ready, A good command to look at next is ${nextCommands[command]}` : ''}`);
37
+ }
38
+ return (0, content_1.formatTextContents)('Is there another command you would like to learn more about?');
39
+ }
40
+ register() {
41
+ return this.mcpServer.registerTool('guided-walkthrough-hubspot-cli', {
42
+ title: 'Guided walkthrough of the CLI',
43
+ description: 'Give the user a guided walkthrough of the HubSpot CLI.',
44
+ inputSchema: {
45
+ command: zod_1.z
46
+ .union([
47
+ zod_1.z.literal('hs init'),
48
+ zod_1.z.literal('hs auth'),
49
+ zod_1.z.literal('hs project create'),
50
+ zod_1.z.literal('hs project upload'),
51
+ ])
52
+ .describe('The command to learn more about. Start with `hs init`')
53
+ .optional(),
54
+ },
55
+ }, this.handler);
56
+ }
57
+ }
58
+ exports.GuidedWalkthroughTool = GuidedWalkthroughTool;
@@ -0,0 +1,17 @@
1
+ import { TextContentResponse, Tool } from '../../types';
2
+ import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import z from 'zod';
4
+ declare const inputSchemaZodObject: z.ZodObject<{
5
+ absoluteProjectPath: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ absoluteProjectPath: string;
8
+ }, {
9
+ absoluteProjectPath: string;
10
+ }>;
11
+ type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
12
+ export declare class UploadProjectTools extends Tool<InputSchemaType> {
13
+ constructor(mcpServer: McpServer);
14
+ handler({ absoluteProjectPath, }: InputSchemaType): Promise<TextContentResponse>;
15
+ register(): RegisteredTool;
16
+ }
17
+ export {};
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.UploadProjectTools = void 0;
7
+ const types_1 = require("../../types");
8
+ const project_1 = require("../../utils/project");
9
+ const constants_1 = require("./constants");
10
+ const zod_1 = __importDefault(require("zod"));
11
+ const content_1 = require("../../utils/content");
12
+ const inputSchema = {
13
+ absoluteProjectPath: constants_1.absoluteProjectPath,
14
+ };
15
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
16
+ const inputSchemaZodObject = zod_1.default.object({
17
+ ...inputSchema,
18
+ });
19
+ class UploadProjectTools extends types_1.Tool {
20
+ constructor(mcpServer) {
21
+ super(mcpServer);
22
+ }
23
+ async handler({ absoluteProjectPath, }) {
24
+ const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteProjectPath, `hs project upload --force-create`);
25
+ return (0, content_1.formatTextContents)(stdout, stderr);
26
+ }
27
+ register() {
28
+ return this.mcpServer.registerTool('upload-hubspot-project', {
29
+ title: 'Upload HubSpot Project',
30
+ description: 'Uploads the HubSpot project in current working directory. If the project does not exist, it will be created. MUST be ran from within the project directory. DO NOT run this tool unless the user specifies they would like to upload the project, it is potentially destructive',
31
+ inputSchema,
32
+ }, this.handler);
33
+ }
34
+ }
35
+ exports.UploadProjectTools = UploadProjectTools;
@@ -0,0 +1,17 @@
1
+ import { TextContentResponse, Tool } from '../../types';
2
+ import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { z } from 'zod';
4
+ declare const inputSchemaZodObject: z.ZodObject<{
5
+ absoluteProjectPath: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ absoluteProjectPath: string;
8
+ }, {
9
+ absoluteProjectPath: string;
10
+ }>;
11
+ export type CreateProjectInputSchema = z.infer<typeof inputSchemaZodObject>;
12
+ export declare class ValidateProjectTool extends Tool<CreateProjectInputSchema> {
13
+ constructor(mcpServer: McpServer);
14
+ handler({ absoluteProjectPath, }: CreateProjectInputSchema): Promise<TextContentResponse>;
15
+ register(): RegisteredTool;
16
+ }
17
+ export {};
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValidateProjectTool = void 0;
4
+ const types_1 = require("../../types");
5
+ const zod_1 = require("zod");
6
+ const constants_1 = require("./constants");
7
+ const project_1 = require("../../utils/project");
8
+ const content_1 = require("../../utils/content");
9
+ const inputSchema = {
10
+ absoluteProjectPath: constants_1.absoluteProjectPath,
11
+ };
12
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
13
+ const inputSchemaZodObject = zod_1.z.object({ ...inputSchema });
14
+ class ValidateProjectTool extends types_1.Tool {
15
+ constructor(mcpServer) {
16
+ super(mcpServer);
17
+ }
18
+ async handler({ absoluteProjectPath, }) {
19
+ try {
20
+ const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteProjectPath, 'hs project validate');
21
+ return (0, content_1.formatTextContents)(stdout, stderr);
22
+ }
23
+ catch (error) {
24
+ return (0, content_1.formatTextContents)(error instanceof Error ? error.message : `${error}`);
25
+ }
26
+ }
27
+ register() {
28
+ return this.mcpServer.registerTool('validate-hubspot-project', {
29
+ title: 'Validate HubSpot Project',
30
+ description: 'Validates the HubSpot project and its configuration files. This tool does not need to be ran before uploading the project',
31
+ inputSchema,
32
+ }, this.handler);
33
+ }
34
+ }
35
+ exports.ValidateProjectTool = ValidateProjectTool;
@@ -0,0 +1,3 @@
1
+ import z from 'zod';
2
+ export declare const absoluteProjectPath: z.ZodString;
3
+ export declare const absoluteCurrentWorkingDirectory: z.ZodString;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.absoluteCurrentWorkingDirectory = exports.absoluteProjectPath = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ exports.absoluteProjectPath = zod_1.default
9
+ .string()
10
+ .describe('The absolute path to the project directory.');
11
+ exports.absoluteCurrentWorkingDirectory = zod_1.default
12
+ .string()
13
+ .describe('The absolute path to the current working directory.');
@@ -0,0 +1,14 @@
1
+ import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare class Tool<InputSchema, ResponseType = TextContentResponse> {
3
+ protected mcpServer: McpServer;
4
+ constructor(mcpServer: McpServer);
5
+ register(): RegisteredTool;
6
+ handler(input: InputSchema): ResponseType | Promise<ResponseType>;
7
+ }
8
+ export type TextContent = {
9
+ type: 'text';
10
+ text: string;
11
+ };
12
+ export type TextContentResponse = {
13
+ content: TextContent[];
14
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Tool = void 0;
4
+ class Tool {
5
+ mcpServer;
6
+ constructor(mcpServer) {
7
+ this.mcpServer = mcpServer;
8
+ }
9
+ register() {
10
+ throw new Error('Must implement register');
11
+ }
12
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
13
+ handler(input) {
14
+ throw new Error('Must implement handler');
15
+ }
16
+ }
17
+ exports.Tool = Tool;
@@ -0,0 +1,3 @@
1
+ import { exec } from 'child_process';
2
+ export declare const execAsync: typeof exec.__promisify__;
3
+ export declare function addFlag(command: string, flagName: string, value: string | number | boolean | string[]): string;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.execAsync = void 0;
7
+ exports.addFlag = addFlag;
8
+ const util_1 = __importDefault(require("util"));
9
+ const child_process_1 = require("child_process");
10
+ exports.execAsync = util_1.default.promisify(child_process_1.exec);
11
+ function addFlag(command, flagName, value) {
12
+ if (Array.isArray(value)) {
13
+ return `${command} --${flagName} ${value.map(item => `"${item}"`).join(' ')}`;
14
+ }
15
+ return `${command} --${flagName} "${value}"`;
16
+ }
@@ -0,0 +1,3 @@
1
+ import { TextContent, TextContentResponse } from '../types';
2
+ export declare function formatTextContents(...outputs: (string | undefined)[]): TextContentResponse;
3
+ export declare function formatTextContent(text: string): TextContent;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatTextContents = formatTextContents;
4
+ exports.formatTextContent = formatTextContent;
5
+ function formatTextContents(...outputs) {
6
+ const content = [];
7
+ outputs.forEach(output => {
8
+ if (output !== undefined) {
9
+ content.push(formatTextContent(output));
10
+ }
11
+ });
12
+ return {
13
+ content,
14
+ };
15
+ }
16
+ function formatTextContent(text) {
17
+ return {
18
+ type: 'text',
19
+ text,
20
+ };
21
+ }
@@ -0,0 +1,5 @@
1
+ export interface CommandResults {
2
+ stderr: string;
3
+ stdout: string;
4
+ }
5
+ export declare function runCommandInDir(directory: string, command: string): Promise<CommandResults>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.runCommandInDir = runCommandInDir;
7
+ const command_1 = require("./command");
8
+ const path_1 = __importDefault(require("path"));
9
+ const fs_1 = __importDefault(require("fs"));
10
+ async function runCommandInDir(directory, command) {
11
+ if (!fs_1.default.existsSync(directory)) {
12
+ fs_1.default.mkdirSync(directory);
13
+ }
14
+ return (0, command_1.execAsync)(command, {
15
+ cwd: path_1.default.resolve(directory),
16
+ });
17
+ }