@hubspot/cli 7.5.3 → 7.5.4-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/commands/project/upload.js +3 -3
- package/commands/project/validate.js +6 -5
- package/lang/en.d.ts +3 -4
- package/lang/en.js +4 -5
- package/lib/mcp/setup.d.ts +9 -0
- package/lib/mcp/setup.js +23 -21
- package/mcp-server/tools/index.js +2 -0
- package/mcp-server/tools/project/CreateProjectTool.d.ts +3 -3
- package/mcp-server/tools/project/CreateProjectTool.js +5 -1
- package/mcp-server/tools/project/DeployProject.js +1 -1
- package/mcp-server/tools/project/UploadProjectTools.js +1 -1
- package/mcp-server/tools/project/ValidateProjectTool.d.ts +17 -0
- package/mcp-server/tools/project/ValidateProjectTool.js +35 -0
- package/package.json +8 -7
|
@@ -23,11 +23,11 @@ const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
|
23
23
|
const command = 'upload';
|
|
24
24
|
const describe = (0, ui_1.uiBetaTag)((0, lang_1.i18n)(`commands.project.subcommands.upload.describe`), false);
|
|
25
25
|
async function handler(args) {
|
|
26
|
-
const { forceCreate, message, derivedAccountId,
|
|
26
|
+
const { forceCreate, message, derivedAccountId, skipValidation, profile } = args;
|
|
27
27
|
const { projectConfig, projectDir } = await (0, config_2.getProjectConfig)();
|
|
28
28
|
(0, config_2.validateProjectConfig)(projectConfig, projectDir);
|
|
29
|
-
let targetAccountId
|
|
30
|
-
if (
|
|
29
|
+
let targetAccountId;
|
|
30
|
+
if ((0, buildAndDeploy_1.useV3Api)(projectConfig.platformVersion)) {
|
|
31
31
|
targetAccountId = await (0, projectProfiles_1.loadAndValidateProfile)(projectConfig, projectDir, profile);
|
|
32
32
|
}
|
|
33
33
|
targetAccountId = targetAccountId || derivedAccountId;
|
|
@@ -18,17 +18,18 @@ const errorHandlers_1 = require("../../lib/errorHandlers");
|
|
|
18
18
|
const command = 'validate';
|
|
19
19
|
const describe = undefined;
|
|
20
20
|
async function handler(args) {
|
|
21
|
-
const { derivedAccountId,
|
|
21
|
+
const { derivedAccountId, profile } = args;
|
|
22
22
|
const { projectConfig, projectDir } = await (0, config_2.getProjectConfig)();
|
|
23
|
+
if (!projectConfig) {
|
|
24
|
+
logger_1.uiLogger.error(en_1.commands.project.validate.mustBeRanWithinAProject);
|
|
25
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
26
|
+
}
|
|
23
27
|
if (!(0, buildAndDeploy_1.useV3Api)(projectConfig?.platformVersion)) {
|
|
24
28
|
logger_1.uiLogger.error(en_1.commands.project.validate.badVersion);
|
|
25
29
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
26
30
|
}
|
|
27
31
|
(0, config_2.validateProjectConfig)(projectConfig, projectDir);
|
|
28
|
-
let targetAccountId =
|
|
29
|
-
if (!targetAccountId) {
|
|
30
|
-
targetAccountId = await (0, projectProfiles_1.loadAndValidateProfile)(projectConfig, projectDir, profile);
|
|
31
|
-
}
|
|
32
|
+
let targetAccountId = await (0, projectProfiles_1.loadAndValidateProfile)(projectConfig, projectDir, profile);
|
|
32
33
|
targetAccountId = targetAccountId || derivedAccountId;
|
|
33
34
|
const accountConfig = (0, config_1.getAccountConfig)(targetAccountId);
|
|
34
35
|
const accountType = accountConfig && accountConfig.accountType;
|
package/lang/en.d.ts
CHANGED
|
@@ -838,13 +838,11 @@ Global configuration replaces hubspot.config.yml, and you will be prompted to mi
|
|
|
838
838
|
readonly claudeCodeInstallFailed: "Claude Code CLI not working - skipping configuration";
|
|
839
839
|
readonly failedToConfigureClaudeDesktop: "Failed to configure Claude Desktop";
|
|
840
840
|
readonly configuringCursor: "Configuring Cursor...";
|
|
841
|
-
readonly noCursorMcpFile: (configFile: string) => string;
|
|
842
841
|
readonly failedToConfigureCursor: "Failed to configure Cursor";
|
|
843
842
|
readonly configuredCursor: "Configured Cursor";
|
|
844
843
|
readonly alreadyInstalled: "HubSpot CLI mcp server already installed, reinstalling";
|
|
845
|
-
readonly configuringWindsurf: "Configuring
|
|
846
|
-
readonly
|
|
847
|
-
readonly failedToConfigureWindsurf: "Failed to configure Cursor";
|
|
844
|
+
readonly configuringWindsurf: "Configuring Windsurf...";
|
|
845
|
+
readonly failedToConfigureWindsurf: "Failed to configure Windsurf";
|
|
848
846
|
readonly configuredWindsurf: "Configured Windsurf";
|
|
849
847
|
};
|
|
850
848
|
readonly prompts: {
|
|
@@ -1371,6 +1369,7 @@ ${string}`;
|
|
|
1371
1369
|
};
|
|
1372
1370
|
readonly validate: {
|
|
1373
1371
|
readonly describe: "Validate the project before uploading";
|
|
1372
|
+
readonly mustBeRanWithinAProject: "This command must be run from within a project directory.";
|
|
1374
1373
|
readonly badVersion: "This command is only available for projects 2025.2 and later.";
|
|
1375
1374
|
readonly examples: {
|
|
1376
1375
|
readonly default: "Validate the project before uploading";
|
package/lang/en.js
CHANGED
|
@@ -833,7 +833,7 @@ exports.commands = {
|
|
|
833
833
|
client: 'Target applications to configure',
|
|
834
834
|
docsSearch: 'Should the docs search mcp server be installed',
|
|
835
835
|
},
|
|
836
|
-
success: (derivedTargets) => `You can now use the HubSpot CLI
|
|
836
|
+
success: (derivedTargets) => `You can now use the HubSpot CLI MCP Server in ${derivedTargets.join(', ')}. ${chalk_1.default.bold('You may need to restart these tools to apply the changes')}.`,
|
|
837
837
|
errors: {
|
|
838
838
|
needsNode20: `This feature requires node >=20`,
|
|
839
839
|
},
|
|
@@ -847,13 +847,11 @@ exports.commands = {
|
|
|
847
847
|
claudeCodeInstallFailed: 'Claude Code CLI not working - skipping configuration',
|
|
848
848
|
failedToConfigureClaudeDesktop: 'Failed to configure Claude Desktop',
|
|
849
849
|
configuringCursor: 'Configuring Cursor...',
|
|
850
|
-
noCursorMcpFile: (configFile) => `No ${configFile} file found - skipping Cursor configuration`,
|
|
851
850
|
failedToConfigureCursor: 'Failed to configure Cursor',
|
|
852
851
|
configuredCursor: 'Configured Cursor',
|
|
853
852
|
alreadyInstalled: 'HubSpot CLI mcp server already installed, reinstalling',
|
|
854
|
-
configuringWindsurf: 'Configuring
|
|
855
|
-
|
|
856
|
-
failedToConfigureWindsurf: 'Failed to configure Cursor',
|
|
853
|
+
configuringWindsurf: 'Configuring Windsurf...',
|
|
854
|
+
failedToConfigureWindsurf: 'Failed to configure Windsurf',
|
|
857
855
|
configuredWindsurf: 'Configured Windsurf',
|
|
858
856
|
},
|
|
859
857
|
prompts: {
|
|
@@ -1369,6 +1367,7 @@ exports.commands = {
|
|
|
1369
1367
|
},
|
|
1370
1368
|
validate: {
|
|
1371
1369
|
describe: 'Validate the project before uploading',
|
|
1370
|
+
mustBeRanWithinAProject: 'This command must be run from within a project directory.',
|
|
1372
1371
|
badVersion: 'This command is only available for projects 2025.2 and later.',
|
|
1373
1372
|
examples: {
|
|
1374
1373
|
default: 'Validate the project before uploading',
|
package/lib/mcp/setup.d.ts
CHANGED
|
@@ -8,5 +8,14 @@ export declare const supportedTools: ({
|
|
|
8
8
|
name: "Windsurf";
|
|
9
9
|
value: string;
|
|
10
10
|
})[];
|
|
11
|
+
interface McpCommand {
|
|
12
|
+
command: string;
|
|
13
|
+
args: string[];
|
|
14
|
+
}
|
|
11
15
|
export declare function addMintlifyMcpServer(installTargets: string[]): Promise<void>;
|
|
16
|
+
export declare function setupMintlify(derivedTargets?: string[]): Promise<boolean>;
|
|
12
17
|
export declare function addMcpServerToConfig(targets: string[] | undefined): Promise<string[]>;
|
|
18
|
+
export declare function setupClaudeCode(mcpCommand?: McpCommand): Promise<boolean>;
|
|
19
|
+
export declare function setupCursor(mcpCommand?: McpCommand): boolean;
|
|
20
|
+
export declare function setupWindsurf(mcpCommand?: McpCommand): boolean;
|
|
21
|
+
export {};
|
package/lib/mcp/setup.js
CHANGED
|
@@ -5,17 +5,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.supportedTools = void 0;
|
|
7
7
|
exports.addMintlifyMcpServer = addMintlifyMcpServer;
|
|
8
|
+
exports.setupMintlify = setupMintlify;
|
|
8
9
|
exports.addMcpServerToConfig = addMcpServerToConfig;
|
|
10
|
+
exports.setupClaudeCode = setupClaudeCode;
|
|
11
|
+
exports.setupCursor = setupCursor;
|
|
12
|
+
exports.setupWindsurf = setupWindsurf;
|
|
9
13
|
const logger_1 = require("../ui/logger");
|
|
10
14
|
const en_1 = require("../../lang/en");
|
|
11
|
-
const child_process_1 = require("child_process");
|
|
12
15
|
const promptUtils_1 = require("../prompts/promptUtils");
|
|
13
16
|
const SpinniesManager_1 = __importDefault(require("../ui/SpinniesManager"));
|
|
14
17
|
const errorHandlers_1 = require("../errorHandlers");
|
|
15
|
-
const fs_1 = __importDefault(require("fs"));
|
|
16
18
|
const command_1 = require("../../mcp-server/utils/command");
|
|
19
|
+
const child_process_1 = require("child_process");
|
|
17
20
|
const path_1 = __importDefault(require("path"));
|
|
18
21
|
const os_1 = __importDefault(require("os"));
|
|
22
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
23
|
+
const fs_1 = require("fs");
|
|
19
24
|
const mcpServerName = 'hubspot-cli-mcp';
|
|
20
25
|
const claudeCode = 'claude';
|
|
21
26
|
const windsurf = 'windsurf';
|
|
@@ -26,12 +31,14 @@ exports.supportedTools = [
|
|
|
26
31
|
{ name: en_1.commands.mcp.setup.cursor, value: cursor },
|
|
27
32
|
{ name: en_1.commands.mcp.setup.windsurf, value: windsurf },
|
|
28
33
|
];
|
|
29
|
-
const
|
|
30
|
-
|
|
34
|
+
const defaultMcpCommand = {
|
|
35
|
+
command: 'hs',
|
|
36
|
+
args: ['mcp', 'start'],
|
|
37
|
+
};
|
|
31
38
|
async function addMintlifyMcpServer(installTargets) {
|
|
32
39
|
await runSetupFunction(() => setupMintlify(installTargets));
|
|
33
40
|
}
|
|
34
|
-
async function setupMintlify(derivedTargets) {
|
|
41
|
+
async function setupMintlify(derivedTargets = supportedMintlifyClients) {
|
|
35
42
|
logger_1.uiLogger.info(en_1.commands.mcp.setup.installingDocSearch);
|
|
36
43
|
logger_1.uiLogger.log('');
|
|
37
44
|
return new Promise(resolve => {
|
|
@@ -101,15 +108,12 @@ function setupMcpConfigFile(config) {
|
|
|
101
108
|
SpinniesManager_1.default.add('spinner', {
|
|
102
109
|
text: config.configuringMessage,
|
|
103
110
|
});
|
|
104
|
-
if (!fs_1.
|
|
105
|
-
|
|
106
|
-
text: config.configMissingMessage,
|
|
107
|
-
});
|
|
108
|
-
return false;
|
|
111
|
+
if (!(0, fs_1.existsSync)(config.configPath)) {
|
|
112
|
+
fs_extra_1.default.writeFileSync(config.configPath, JSON.stringify({}, null, 2));
|
|
109
113
|
}
|
|
110
114
|
let mcpConfig = {};
|
|
111
115
|
try {
|
|
112
|
-
const configContent =
|
|
116
|
+
const configContent = fs_extra_1.default.readFileSync(config.configPath, 'utf8');
|
|
113
117
|
mcpConfig = JSON.parse(configContent);
|
|
114
118
|
}
|
|
115
119
|
catch (error) {
|
|
@@ -125,11 +129,10 @@ function setupMcpConfigFile(config) {
|
|
|
125
129
|
}
|
|
126
130
|
// Add or update HubSpot CLI MCP server
|
|
127
131
|
mcpConfig.mcpServers[mcpServerName] = {
|
|
128
|
-
|
|
129
|
-
args: mcpCommandArgs,
|
|
132
|
+
...config.mcpCommand,
|
|
130
133
|
};
|
|
131
134
|
// Write the updated config
|
|
132
|
-
|
|
135
|
+
fs_extra_1.default.writeFileSync(config.configPath, JSON.stringify(mcpConfig, null, 2));
|
|
133
136
|
SpinniesManager_1.default.succeed('spinner', {
|
|
134
137
|
text: config.configuredMessage,
|
|
135
138
|
});
|
|
@@ -143,7 +146,7 @@ function setupMcpConfigFile(config) {
|
|
|
143
146
|
return false;
|
|
144
147
|
}
|
|
145
148
|
}
|
|
146
|
-
async function setupClaudeCode() {
|
|
149
|
+
async function setupClaudeCode(mcpCommand = defaultMcpCommand) {
|
|
147
150
|
try {
|
|
148
151
|
SpinniesManager_1.default.add('claudeCode', {
|
|
149
152
|
text: en_1.commands.mcp.setup.spinners.configuringClaudeCode,
|
|
@@ -154,8 +157,7 @@ async function setupClaudeCode() {
|
|
|
154
157
|
// Run claude mcp add command
|
|
155
158
|
const mcpConfig = JSON.stringify({
|
|
156
159
|
type: 'stdio',
|
|
157
|
-
|
|
158
|
-
args: mcpCommandArgs,
|
|
160
|
+
...mcpCommand,
|
|
159
161
|
});
|
|
160
162
|
const { stdout } = await (0, command_1.execAsync)('claude mcp list');
|
|
161
163
|
if (stdout.includes(mcpServerName)) {
|
|
@@ -194,23 +196,23 @@ async function setupClaudeCode() {
|
|
|
194
196
|
return false;
|
|
195
197
|
}
|
|
196
198
|
}
|
|
197
|
-
function setupCursor() {
|
|
199
|
+
function setupCursor(mcpCommand = defaultMcpCommand) {
|
|
198
200
|
const cursorConfigPath = path_1.default.join(os_1.default.homedir(), '.cursor', 'mcp.json');
|
|
199
201
|
return setupMcpConfigFile({
|
|
200
202
|
configPath: cursorConfigPath,
|
|
201
203
|
configuringMessage: en_1.commands.mcp.setup.spinners.configuringCursor,
|
|
202
204
|
configuredMessage: en_1.commands.mcp.setup.spinners.configuredCursor,
|
|
203
205
|
failedMessage: en_1.commands.mcp.setup.spinners.failedToConfigureCursor,
|
|
204
|
-
|
|
206
|
+
mcpCommand,
|
|
205
207
|
});
|
|
206
208
|
}
|
|
207
|
-
function setupWindsurf() {
|
|
209
|
+
function setupWindsurf(mcpCommand = defaultMcpCommand) {
|
|
208
210
|
const windsurfConfigPath = path_1.default.join(os_1.default.homedir(), '.codeium', 'windsurf', 'mcp_config.json');
|
|
209
211
|
return setupMcpConfigFile({
|
|
210
212
|
configPath: windsurfConfigPath,
|
|
211
213
|
configuringMessage: en_1.commands.mcp.setup.spinners.configuringWindsurf,
|
|
212
214
|
configuredMessage: en_1.commands.mcp.setup.spinners.configuredWindsurf,
|
|
213
215
|
failedMessage: en_1.commands.mcp.setup.spinners.failedToConfigureWindsurf,
|
|
214
|
-
|
|
216
|
+
mcpCommand,
|
|
215
217
|
});
|
|
216
218
|
}
|
|
@@ -6,6 +6,7 @@ const CreateProjectTool_1 = require("./project/CreateProjectTool");
|
|
|
6
6
|
const GuidedWalkthroughTool_1 = require("./project/GuidedWalkthroughTool");
|
|
7
7
|
const DeployProject_1 = require("./project/DeployProject");
|
|
8
8
|
const AddFeatureToProject_1 = require("./project/AddFeatureToProject");
|
|
9
|
+
const ValidateProjectTool_1 = require("./project/ValidateProjectTool");
|
|
9
10
|
function registerProjectTools(mcpServer) {
|
|
10
11
|
return [
|
|
11
12
|
new UploadProjectTools_1.UploadProjectTools(mcpServer).register(),
|
|
@@ -13,5 +14,6 @@ function registerProjectTools(mcpServer) {
|
|
|
13
14
|
new GuidedWalkthroughTool_1.GuidedWalkthroughTool(mcpServer).register(),
|
|
14
15
|
new DeployProject_1.DeployProject(mcpServer).register(),
|
|
15
16
|
new AddFeatureToProject_1.AddFeatureToProject(mcpServer).register(),
|
|
17
|
+
new ValidateProjectTool_1.ValidateProjectTool(mcpServer).register(),
|
|
16
18
|
];
|
|
17
19
|
}
|
|
@@ -3,26 +3,26 @@ import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
declare const inputSchemaZodObject: z.ZodObject<{
|
|
5
5
|
absoluteCurrentWorkingDirectory: z.ZodString;
|
|
6
|
-
name: z.ZodString
|
|
6
|
+
name: z.ZodOptional<z.ZodString>;
|
|
7
7
|
destination: z.ZodString;
|
|
8
8
|
projectBase: z.ZodUnion<[z.ZodLiteral<"empty">, z.ZodLiteral<"app">]>;
|
|
9
9
|
distribution: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"marketplace">, z.ZodLiteral<"private">]>>;
|
|
10
10
|
auth: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"static">, z.ZodLiteral<"oauth">]>>>;
|
|
11
11
|
features: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">]>, "many">>;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
name: string;
|
|
14
13
|
projectBase: "app" | "empty";
|
|
15
14
|
absoluteCurrentWorkingDirectory: string;
|
|
16
15
|
destination: string;
|
|
17
16
|
auth?: "oauth" | "static" | undefined;
|
|
17
|
+
name?: string | undefined;
|
|
18
18
|
distribution?: "marketplace" | "private" | undefined;
|
|
19
19
|
features?: ("card" | "settings" | "app-function" | "webhooks")[] | undefined;
|
|
20
20
|
}, {
|
|
21
|
-
name: string;
|
|
22
21
|
projectBase: "app" | "empty";
|
|
23
22
|
absoluteCurrentWorkingDirectory: string;
|
|
24
23
|
destination: string;
|
|
25
24
|
auth?: "oauth" | "static" | undefined;
|
|
25
|
+
name?: string | undefined;
|
|
26
26
|
distribution?: "marketplace" | "private" | undefined;
|
|
27
27
|
features?: ("card" | "settings" | "app-function" | "webhooks")[] | undefined;
|
|
28
28
|
}>;
|
|
@@ -13,7 +13,8 @@ const inputSchema = {
|
|
|
13
13
|
absoluteCurrentWorkingDirectory: constants_2.absoluteCurrentWorkingDirectory,
|
|
14
14
|
name: zod_1.z
|
|
15
15
|
.string()
|
|
16
|
-
.describe('The name of the project to be created. This name is how your project will appear in HubSpot.')
|
|
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(),
|
|
17
18
|
destination: zod_1.z
|
|
18
19
|
.string()
|
|
19
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.'),
|
|
@@ -56,6 +57,9 @@ class CreateProjectTool extends types_1.Tool {
|
|
|
56
57
|
if (name) {
|
|
57
58
|
command = (0, command_1.addFlag)(command, 'name', name);
|
|
58
59
|
}
|
|
60
|
+
else {
|
|
61
|
+
content.push((0, content_1.formatTextContent)(`Ask the user what they would like to name the project.`));
|
|
62
|
+
}
|
|
59
63
|
if (destination) {
|
|
60
64
|
command = (0, command_1.addFlag)(command, 'dest', destination);
|
|
61
65
|
}
|
|
@@ -42,7 +42,7 @@ class DeployProject extends types_1.Tool {
|
|
|
42
42
|
register() {
|
|
43
43
|
return this.mcpServer.registerTool('deploy-hubspot-project', {
|
|
44
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',
|
|
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
46
|
inputSchema,
|
|
47
47
|
}, this.handler);
|
|
48
48
|
}
|
|
@@ -27,7 +27,7 @@ class UploadProjectTools extends types_1.Tool {
|
|
|
27
27
|
register() {
|
|
28
28
|
return this.mcpServer.registerTool('upload-hubspot-project', {
|
|
29
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.',
|
|
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
31
|
inputSchema,
|
|
32
32
|
}, this.handler);
|
|
33
33
|
}
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.4-beta.1",
|
|
4
4
|
"description": "The official CLI for developing on HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "https://github.com/HubSpot/hubspot-cli",
|
|
@@ -66,22 +66,23 @@
|
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "ts-node ./scripts/build.ts",
|
|
69
|
+
"build-docker": "docker image build --tag hs-cli-image . && docker image prune -f",
|
|
70
|
+
"circular-deps": "yarn madge --circular .",
|
|
69
71
|
"debug-mcp": "yarn build && npx @modelcontextprotocol/inspector node dist/mcp-server/server.js",
|
|
72
|
+
"hs": "yarn build && node ./dist/bin/hs",
|
|
73
|
+
"hs-debug": "yarn build && NODE_DEBUG=http* node --inspect-brk ./dist/bin/hs",
|
|
70
74
|
"lint": "echo 'Linting is disabled for Blazar'",
|
|
71
75
|
"lint:local": "eslint . && prettier --list-different './**/*.{ts,js,json}'",
|
|
72
76
|
"list-all-commands": "yarn ts-node ./scripts/get-all-commands.ts",
|
|
73
77
|
"local-link": "yarn ts-node ./scripts/linking.ts",
|
|
78
|
+
"mcp-local": "yarn ts-node ./scripts/mcp-local.ts",
|
|
74
79
|
"prettier:write": "prettier --write './**/*.{ts,js,json}'",
|
|
80
|
+
"release": "yarn ts-node ./scripts/release.ts release",
|
|
75
81
|
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js",
|
|
76
82
|
"test-cli": "yarn build && yarn --cwd 'acceptance-tests' test-ci",
|
|
77
83
|
"test-cli-debug": "yarn build && yarn --cwd 'acceptance-tests' test-debug",
|
|
78
|
-
"test-cli-qa": "yarn build && yarn --cwd 'acceptance-tests' test-qa",
|
|
79
84
|
"test-cli-latest": "yarn build && yarn build-docker && docker container run -it --rm --name=hs-cli-container hs-cli-image yarn --cwd 'acceptance-tests' test-latest",
|
|
80
|
-
"
|
|
81
|
-
"circular-deps": "yarn madge --circular .",
|
|
82
|
-
"release": "yarn ts-node ./scripts/release.ts release",
|
|
83
|
-
"hs": "yarn build && node ./dist/bin/hs",
|
|
84
|
-
"hs-debug": "yarn build && NODE_DEBUG=http* node --inspect-brk ./dist/bin/hs",
|
|
85
|
+
"test-cli-qa": "yarn build && yarn --cwd 'acceptance-tests' test-qa",
|
|
85
86
|
"update-ldl": "yarn add --exact @hubspot/local-dev-lib@latest",
|
|
86
87
|
"view-unreleased-changes": "node ./scripts/unreleasedChanges.js"
|
|
87
88
|
},
|