@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.
- package/bin/cli.js +102 -95
- package/commands/account/auth.d.ts +5 -7
- package/commands/account/auth.js +74 -87
- package/commands/account/clean.d.ts +3 -7
- package/commands/account/clean.js +16 -9
- package/commands/account/createOverride.d.ts +3 -7
- package/commands/account/createOverride.js +23 -6
- package/commands/account/info.d.ts +3 -7
- package/commands/account/info.js +13 -5
- package/commands/account/list.d.ts +3 -7
- package/commands/account/list.js +15 -8
- package/commands/account/remove.d.ts +3 -7
- package/commands/account/remove.js +21 -9
- package/commands/account/removeOverride.d.ts +3 -7
- package/commands/account/removeOverride.js +23 -6
- package/commands/account/rename.d.ts +3 -7
- package/commands/account/rename.js +16 -9
- package/commands/account/use.d.ts +5 -9
- package/commands/account/use.js +14 -6
- package/commands/account.d.ts +3 -4
- package/commands/account.js +33 -58
- package/commands/app/migrate.d.ts +1 -2
- package/commands/app/migrate.js +7 -8
- package/commands/app/secret/add.d.ts +7 -0
- package/commands/app/secret/add.js +64 -0
- package/commands/app/secret/delete.d.ts +8 -0
- package/commands/app/secret/delete.js +87 -0
- package/commands/app/secret/list.d.ts +6 -0
- package/commands/app/secret/list.js +64 -0
- package/commands/app/secret/update.d.ts +7 -0
- package/commands/app/secret/update.js +77 -0
- package/commands/app/secret.d.ts +3 -0
- package/commands/app/secret.js +30 -0
- package/commands/app.d.ts +2 -5
- package/commands/app.js +10 -8
- package/commands/auth.d.ts +5 -7
- package/commands/auth.js +29 -28
- package/commands/cms/convertFields.d.ts +7 -1
- package/commands/cms/convertFields.js +57 -41
- package/commands/cms/getReactModule.d.ts +7 -1
- package/commands/cms/getReactModule.js +52 -34
- package/commands/cms/lighthouseScore.d.ts +8 -1
- package/commands/cms/lighthouseScore.js +129 -100
- package/commands/cms.d.ts +3 -1
- package/commands/cms.js +22 -15
- package/commands/completion.d.ts +3 -1
- package/commands/completion.js +23 -12
- package/commands/config/migrate.d.ts +3 -7
- package/commands/config/migrate.js +37 -46
- package/commands/config/set.d.ts +5 -6
- package/commands/config/set.js +38 -14
- package/commands/config.d.ts +3 -4
- package/commands/config.js +18 -44
- package/commands/create/api-sample.d.ts +3 -1
- package/commands/create/api-sample.js +34 -38
- package/commands/create/app.d.ts +3 -1
- package/commands/create/app.js +9 -7
- package/commands/create/function.d.ts +3 -1
- package/commands/create/function.js +11 -10
- package/commands/create/index.d.ts +5 -1
- package/commands/create/index.js +23 -11
- package/commands/create/module.d.ts +3 -1
- package/commands/create/module.js +14 -13
- package/commands/create/react-app.d.ts +3 -1
- package/commands/create/react-app.js +10 -7
- package/commands/create/template.d.ts +3 -1
- package/commands/create/template.js +14 -14
- package/commands/create/vue-app.d.ts +3 -1
- package/commands/create/vue-app.js +10 -7
- package/commands/create/webpack-serverless.d.ts +3 -1
- package/commands/create/webpack-serverless.js +10 -7
- package/commands/create/website-theme.d.ts +3 -1
- package/commands/create/website-theme.js +10 -9
- package/commands/create.d.ts +4 -24
- package/commands/create.js +62 -74
- package/commands/customObject/create.d.ts +4 -9
- package/commands/customObject/create.js +17 -10
- package/commands/customObject/schema/create.d.ts +4 -9
- package/commands/customObject/schema/create.js +18 -11
- package/commands/customObject/schema/delete.d.ts +4 -9
- package/commands/customObject/schema/delete.js +17 -10
- package/commands/customObject/schema/fetch-all.d.ts +4 -9
- package/commands/customObject/schema/fetch-all.js +17 -10
- package/commands/customObject/schema/fetch.d.ts +4 -9
- package/commands/customObject/schema/fetch.js +17 -10
- package/commands/customObject/schema/list.d.ts +4 -8
- package/commands/customObject/schema/list.js +17 -10
- package/commands/customObject/schema/update.d.ts +4 -9
- package/commands/customObject/schema/update.js +18 -11
- package/commands/customObject/schema.d.ts +3 -5
- package/commands/customObject/schema.js +27 -54
- package/commands/customObject.d.ts +3 -4
- package/commands/customObject.js +18 -45
- package/commands/doctor.d.ts +6 -8
- package/commands/doctor.js +30 -21
- package/commands/feedback.d.ts +4 -1
- package/commands/feedback.js +38 -47
- package/commands/fetch.d.ts +12 -1
- package/commands/fetch.js +49 -33
- package/commands/filemanager/fetch.d.ts +4 -9
- package/commands/filemanager/fetch.js +18 -11
- package/commands/filemanager/upload.d.ts +4 -9
- package/commands/filemanager/upload.js +17 -11
- package/commands/filemanager.d.ts +3 -4
- package/commands/filemanager.js +18 -41
- package/commands/function/deploy.d.ts +6 -1
- package/commands/function/deploy.js +70 -50
- package/commands/function/list.d.ts +6 -1
- package/commands/function/list.js +44 -32
- package/commands/function/server.d.ts +10 -1
- package/commands/function/server.js +49 -38
- package/commands/function.d.ts +5 -1
- package/commands/function.js +22 -10
- package/commands/getStarted.d.ts +9 -0
- package/commands/getStarted.js +227 -0
- package/commands/hubdb/clear.d.ts +4 -9
- package/commands/hubdb/clear.js +17 -10
- package/commands/hubdb/create.d.ts +4 -9
- package/commands/hubdb/create.js +17 -10
- package/commands/hubdb/delete.d.ts +4 -9
- package/commands/hubdb/delete.js +17 -10
- package/commands/hubdb/fetch.d.ts +4 -9
- package/commands/hubdb/fetch.js +17 -10
- package/commands/hubdb/list.d.ts +4 -0
- package/commands/hubdb/list.js +83 -0
- package/commands/hubdb.d.ts +3 -2
- package/commands/hubdb.js +23 -45
- package/commands/init.d.ts +3 -7
- package/commands/init.js +17 -8
- package/commands/lint.d.ts +6 -4
- package/commands/lint.js +42 -43
- package/commands/list.d.ts +3 -7
- package/commands/list.js +17 -11
- package/commands/logs.d.ts +10 -1
- package/commands/logs.js +53 -44
- package/commands/mcp/setup.d.ts +7 -0
- package/commands/mcp/setup.js +52 -0
- package/commands/mcp/start.d.ts +3 -0
- package/commands/mcp/start.js +77 -0
- package/commands/mcp.d.ts +3 -0
- package/commands/mcp.js +26 -0
- package/commands/module/marketplace-validate.d.ts +6 -1
- package/commands/module/marketplace-validate.js +39 -29
- package/commands/module.d.ts +3 -1
- package/commands/module.js +23 -10
- package/commands/mv.d.ts +3 -7
- package/commands/mv.js +17 -11
- package/commands/open.d.ts +3 -7
- package/commands/open.js +17 -11
- package/commands/project/add.d.ts +5 -2
- package/commands/project/add.js +43 -80
- package/commands/project/cloneApp.d.ts +1 -1
- package/commands/project/cloneApp.js +2 -2
- package/commands/project/create.d.ts +2 -8
- package/commands/project/create.js +84 -55
- package/commands/project/deploy.d.ts +2 -0
- package/commands/project/deploy.js +67 -13
- package/commands/project/dev/deprecatedFlow.d.ts +8 -2
- package/commands/project/dev/deprecatedFlow.js +9 -1
- package/commands/project/dev/index.d.ts +1 -4
- package/commands/project/dev/index.js +88 -31
- package/commands/project/dev/unifiedFlow.d.ts +11 -2
- package/commands/project/dev/unifiedFlow.js +81 -41
- package/commands/project/listBuilds.js +2 -5
- package/commands/project/migrate.d.ts +1 -0
- package/commands/project/profile/add.d.ts +7 -0
- package/commands/project/profile/add.js +209 -0
- package/commands/project/profile/delete.d.ts +6 -0
- package/commands/project/profile/delete.js +123 -0
- package/commands/project/profile.d.ts +3 -0
- package/commands/project/profile.js +25 -0
- package/commands/project/upload.d.ts +1 -0
- package/commands/project/upload.js +22 -8
- package/commands/project/validate.d.ts +6 -0
- package/commands/project/validate.js +82 -0
- package/commands/project.js +4 -2
- package/commands/remove.d.ts +3 -7
- package/commands/remove.js +22 -22
- package/commands/sandbox/create.d.ts +4 -9
- package/commands/sandbox/create.js +18 -11
- package/commands/sandbox/delete.d.ts +4 -9
- package/commands/sandbox/delete.js +18 -11
- package/commands/sandbox.d.ts +3 -4
- package/commands/sandbox.js +18 -43
- package/commands/secret/addSecret.d.ts +4 -9
- package/commands/secret/addSecret.js +17 -10
- package/commands/secret/deleteSecret.d.ts +4 -9
- package/commands/secret/deleteSecret.js +17 -10
- package/commands/secret/listSecret.d.ts +4 -9
- package/commands/secret/listSecret.js +17 -10
- package/commands/secret/updateSecret.d.ts +4 -9
- package/commands/secret/updateSecret.js +17 -10
- package/commands/secret.d.ts +3 -4
- package/commands/secret.js +23 -48
- package/commands/testAccount/create.d.ts +6 -0
- package/commands/testAccount/create.js +100 -0
- package/commands/testAccount/createConfig.d.ts +10 -0
- package/commands/testAccount/createConfig.js +98 -0
- package/commands/testAccount/delete.d.ts +6 -0
- package/commands/testAccount/delete.js +48 -0
- package/commands/testAccount.d.ts +3 -0
- package/commands/testAccount.js +28 -0
- package/commands/theme/generate-selectors.d.ts +3 -7
- package/commands/theme/generate-selectors.js +20 -15
- package/commands/theme/marketplace-validate.d.ts +4 -9
- package/commands/theme/marketplace-validate.js +22 -17
- package/commands/theme/preview.d.ts +4 -9
- package/commands/theme/preview.js +32 -26
- package/commands/theme.d.ts +3 -4
- package/commands/theme.js +22 -47
- package/commands/upload.d.ts +12 -1
- package/commands/upload.js +116 -134
- package/commands/watch.d.ts +14 -1
- package/commands/watch.js +74 -75
- package/lang/en.d.ts +1135 -660
- package/lang/en.js +935 -471
- package/lang/en.lyaml +30 -213
- package/lib/accountTypes.js +1 -2
- package/lib/app/migrate.d.ts +23 -0
- package/lib/app/migrate.js +29 -6
- package/lib/app/migrate_legacy.js +7 -7
- package/lib/app/urls.d.ts +16 -0
- package/lib/app/urls.js +16 -0
- package/lib/commonOpts.d.ts +1 -3
- package/lib/commonOpts.js +1 -1
- package/lib/configMigrate.d.ts +2 -2
- package/lib/configMigrate.js +34 -55
- package/lib/configOptions.d.ts +4 -0
- package/lib/configOptions.js +41 -46
- package/lib/constants.d.ts +29 -0
- package/lib/constants.js +30 -1
- package/lib/dependencyManagement.d.ts +0 -5
- package/lib/dependencyManagement.js +13 -39
- package/lib/doctor/Doctor.js +3 -2
- package/lib/errorHandlers/index.js +7 -0
- package/lib/filesystem.d.ts +1 -1
- package/lib/generateSelectors.js +3 -5
- package/lib/interpolation.d.ts +2 -3
- package/lib/lang.d.ts +2 -3
- package/lib/marketplaceValidate.d.ts +12 -2
- package/lib/marketplaceValidate.js +22 -29
- package/lib/mcp/setup.d.ts +21 -0
- package/lib/mcp/setup.js +218 -0
- package/lib/middleware/autoUpdateMiddleware.d.ts +1 -0
- package/lib/middleware/autoUpdateMiddleware.js +89 -0
- package/lib/middleware/configMiddleware.js +23 -0
- package/lib/middleware/fireAlarmMiddleware.d.ts +2 -2
- package/lib/middleware/fireAlarmMiddleware.js +5 -3
- package/lib/npm.d.ts +9 -0
- package/lib/npm.js +36 -0
- package/lib/projectProfiles.d.ts +7 -0
- package/lib/projectProfiles.js +83 -0
- package/lib/projects/add/legacyAddComponent.d.ts +5 -0
- package/lib/projects/add/legacyAddComponent.js +48 -0
- package/lib/projects/add/v3AddComponent.d.ts +8 -0
- package/lib/projects/add/v3AddComponent.js +85 -0
- package/lib/projects/buildAndDeploy.js +18 -3
- package/lib/projects/components.d.ts +2 -0
- package/lib/projects/components.js +82 -0
- package/lib/projects/create/index.d.ts +23 -0
- package/lib/projects/create/index.js +33 -0
- package/lib/projects/create/legacy.d.ts +6 -0
- package/lib/projects/{create.js → create/legacy.js} +20 -11
- package/lib/projects/create/v3.d.ts +27 -0
- package/lib/projects/create/v3.js +158 -0
- package/lib/projects/localDev/AppDevModeInterface.d.ts +30 -0
- package/lib/projects/localDev/AppDevModeInterface.js +215 -0
- package/lib/projects/localDev/DevServerManagerV2.d.ts +11 -22
- package/lib/projects/localDev/DevServerManagerV2.js +19 -15
- package/lib/projects/localDev/LocalDevLogger.d.ts +30 -0
- package/lib/projects/localDev/LocalDevLogger.js +159 -0
- package/lib/projects/localDev/LocalDevManager.js +12 -5
- package/lib/projects/localDev/LocalDevProcess.d.ts +34 -0
- package/lib/projects/localDev/LocalDevProcess.js +201 -0
- package/lib/projects/localDev/LocalDevState.d.ts +50 -0
- package/lib/projects/localDev/LocalDevState.js +119 -0
- package/lib/projects/localDev/LocalDevWatcher.d.ts +10 -0
- package/lib/projects/localDev/LocalDevWatcher.js +53 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +20 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.js +131 -0
- package/lib/projects/localDev/helpers.d.ts +3 -2
- package/lib/projects/localDev/helpers.js +32 -2
- package/lib/projects/upload.d.ts +5 -1
- package/lib/projects/upload.js +60 -20
- package/lib/projects/urls.d.ts +3 -0
- package/lib/projects/urls.js +17 -1
- package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +17 -0
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +96 -0
- package/lib/prompts/createProjectPrompt.d.ts +14 -5
- package/lib/prompts/createProjectPrompt.js +38 -13
- package/lib/prompts/createTemplatePrompt.d.ts +22 -4
- package/lib/prompts/installAppPrompt.d.ts +2 -0
- package/lib/prompts/installAppPrompt.js +45 -0
- package/lib/prompts/personalAccessKeyPrompt.js +35 -24
- package/lib/prompts/projectAddPrompt.d.ts +5 -1
- package/lib/prompts/projectAddPrompt.js +35 -7
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +6 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +6 -6
- package/lib/prompts/promptUtils.d.ts +4 -1
- package/lib/prompts/promptUtils.js +5 -1
- package/lib/prompts/selectAppPrompt.d.ts +2 -0
- package/lib/prompts/selectAppPrompt.js +40 -0
- package/lib/prompts/{selectPublicAppPrompt.d.ts → selectPublicAppForMigrationPrompt.d.ts} +1 -1
- package/lib/prompts/{selectPublicAppPrompt.js → selectPublicAppForMigrationPrompt.js} +8 -8
- package/lib/prompts/setAsDefaultAccountPrompt.js +10 -0
- package/lib/testUtils.d.ts +3 -3
- package/lib/testUtils.js +8 -9
- package/lib/ui/index.js +4 -1
- package/lib/upload.d.ts +1 -1
- package/lib/validation.js +4 -5
- package/lib/yargsUtils.d.ts +4 -0
- package/lib/yargsUtils.js +6 -0
- package/mcp-server/server.d.ts +1 -0
- package/mcp-server/server.js +18 -0
- package/mcp-server/tools/index.d.ts +2 -0
- package/mcp-server/tools/index.js +19 -0
- package/mcp-server/tools/project/AddFeatureToProject.d.ts +29 -0
- package/mcp-server/tools/project/AddFeatureToProject.js +85 -0
- package/mcp-server/tools/project/CreateProjectTool.d.ts +35 -0
- package/mcp-server/tools/project/CreateProjectTool.js +104 -0
- package/mcp-server/tools/project/DeployProject.d.ts +20 -0
- package/mcp-server/tools/project/DeployProject.js +50 -0
- package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +17 -0
- package/mcp-server/tools/project/GuidedWalkthroughTool.js +58 -0
- package/mcp-server/tools/project/UploadProjectTools.d.ts +17 -0
- package/mcp-server/tools/project/UploadProjectTools.js +35 -0
- package/mcp-server/tools/project/ValidateProjectTool.d.ts +17 -0
- package/mcp-server/tools/project/ValidateProjectTool.js +35 -0
- package/mcp-server/tools/project/constants.d.ts +3 -0
- package/mcp-server/tools/project/constants.js +13 -0
- package/mcp-server/types.d.ts +14 -0
- package/mcp-server/types.js +17 -0
- package/mcp-server/utils/command.d.ts +3 -0
- package/mcp-server/utils/command.js +16 -0
- package/mcp-server/utils/content.d.ts +3 -0
- package/mcp-server/utils/content.js +21 -0
- package/mcp-server/utils/project.d.ts +5 -0
- package/mcp-server/utils/project.js +17 -0
- package/package.json +24 -16
- package/types/Cms.d.ts +30 -0
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +35 -0
- package/types/LocalDev.js +2 -0
- package/types/Projects.d.ts +19 -2
- package/types/Prompts.d.ts +0 -7
- package/types/Yargs.d.ts +10 -1
- package/lib/projects/create.d.ts +0 -5
- package/lib/projects/localDev/LocalDevManagerV2.d.ts +0 -64
- package/lib/projects/localDev/LocalDevManagerV2.js +0 -345
- package/lib/prompts/installPublicAppPrompt.d.ts +0 -1
- 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,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,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,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,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
|
+
}
|