@hubspot/cli 7.7.3-experimental.0 → 7.7.5-experimental.0
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 +2 -0
- package/commands/account/auth.d.ts +2 -0
- package/commands/account/auth.js +15 -7
- package/commands/auth.d.ts +2 -0
- package/commands/auth.js +17 -8
- package/commands/hubdb/list.d.ts +4 -0
- package/commands/hubdb/list.js +83 -0
- package/commands/hubdb.js +2 -0
- package/commands/mcp/setup.d.ts +13 -0
- package/commands/mcp/setup.js +248 -0
- package/commands/mcp/start.d.ts +10 -0
- package/commands/mcp/start.js +66 -0
- package/commands/mcp.d.ts +10 -0
- package/commands/mcp.js +20 -0
- package/commands/project/listBuilds.js +2 -5
- package/lang/en.d.ts +26 -4
- package/lang/en.js +28 -4
- package/lib/prompts/personalAccessKeyPrompt.js +35 -24
- package/lib/prompts/projectAddPrompt.js +1 -1
- package/lib/prompts/promptUtils.d.ts +2 -1
- package/lib/prompts/promptUtils.js +2 -1
- 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 +17 -0
- package/mcp-server/tools/project/AddFeatureToProject.d.ts +6 -0
- package/mcp-server/tools/project/AddFeatureToProject.js +100 -0
- package/mcp-server/tools/project/CreateProjectTool.d.ts +6 -0
- package/mcp-server/tools/project/CreateProjectTool.js +119 -0
- package/mcp-server/tools/project/DeployProject.d.ts +6 -0
- package/mcp-server/tools/project/DeployProject.js +50 -0
- package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +6 -0
- package/mcp-server/tools/project/GuidedWalkthroughTool.js +54 -0
- package/mcp-server/tools/project/UploadProjectTools.d.ts +5 -0
- package/mcp-server/tools/project/UploadProjectTools.js +26 -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 +8 -0
- package/mcp-server/types.js +7 -0
- package/mcp-server/utils/command.d.ts +3 -0
- package/mcp-server/utils/command.js +16 -0
- package/mcp-server/utils/project.d.ts +5 -0
- package/mcp-server/utils/project.js +17 -0
- package/package.json +4 -2
|
@@ -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
|
+
class DeployProject extends types_1.Tool {
|
|
10
|
+
static mcpServer;
|
|
11
|
+
static register(mcpServer) {
|
|
12
|
+
this.mcpServer = mcpServer;
|
|
13
|
+
return this.mcpServer.registerTool('deploy-hubspot-project', {
|
|
14
|
+
title: 'Deploy a build of HubSpot Project',
|
|
15
|
+
description: 'Takes a build number and a project name and deploys that build of the project',
|
|
16
|
+
inputSchema: {
|
|
17
|
+
absoluteProjectPath: constants_1.absoluteProjectPath,
|
|
18
|
+
buildNumber: zod_1.z
|
|
19
|
+
.optional(zod_1.z.number())
|
|
20
|
+
.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'),
|
|
21
|
+
},
|
|
22
|
+
}, async ({ absoluteProjectPath, buildNumber }) => {
|
|
23
|
+
let command = `hs project deploy`;
|
|
24
|
+
const content = [];
|
|
25
|
+
if (!buildNumber) {
|
|
26
|
+
const { stdout } = await (0, project_1.runCommandInDir)(absoluteProjectPath, `hs project list-builds --limit 100`);
|
|
27
|
+
content.push({
|
|
28
|
+
type: 'text',
|
|
29
|
+
text: `Ask the user which build number they would like to deploy? Build information: ${stdout}`,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
command = (0, command_1.addFlag)(command, 'build', buildNumber);
|
|
34
|
+
}
|
|
35
|
+
if (content.length) {
|
|
36
|
+
return {
|
|
37
|
+
content,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteProjectPath, command);
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{ type: 'text', text: stdout },
|
|
44
|
+
{ type: 'text', text: stderr },
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.DeployProject = DeployProject;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Tool } from '../../types';
|
|
2
|
+
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
export declare class GuidedWalkthroughTool extends Tool {
|
|
4
|
+
private static mcpServer;
|
|
5
|
+
static register(mcpServer: McpServer): RegisteredTool;
|
|
6
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 nextCommands = {
|
|
8
|
+
'hs init': 'hs auth',
|
|
9
|
+
'hs auth': 'hs project create',
|
|
10
|
+
'hs project create': 'hs project upload',
|
|
11
|
+
'hs project upload': 'hs project dev',
|
|
12
|
+
};
|
|
13
|
+
class GuidedWalkthroughTool extends types_1.Tool {
|
|
14
|
+
static mcpServer;
|
|
15
|
+
static register(mcpServer) {
|
|
16
|
+
this.mcpServer = mcpServer;
|
|
17
|
+
return this.mcpServer.registerTool('guided-walkthrough-hubspot-cli', {
|
|
18
|
+
title: 'Guided walkthrough of the CLI',
|
|
19
|
+
description: 'Give the user a guided walkthrough of the HubSpot CLI.',
|
|
20
|
+
inputSchema: {
|
|
21
|
+
command: zod_1.z
|
|
22
|
+
.union([
|
|
23
|
+
zod_1.z.literal('hs init'),
|
|
24
|
+
zod_1.z.literal('hs auth'),
|
|
25
|
+
zod_1.z.literal('hs project create'),
|
|
26
|
+
zod_1.z.literal('hs project upload'),
|
|
27
|
+
])
|
|
28
|
+
.describe('The command to learn more about. Start with `hs init`')
|
|
29
|
+
.optional(),
|
|
30
|
+
},
|
|
31
|
+
}, async ({ command }) => {
|
|
32
|
+
if (command) {
|
|
33
|
+
const { stdout } = await (0, command_1.execAsync)(`${command} --help`);
|
|
34
|
+
return {
|
|
35
|
+
content: [
|
|
36
|
+
{
|
|
37
|
+
type: 'text',
|
|
38
|
+
text: `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]}` : ''}`,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
content: [
|
|
45
|
+
{
|
|
46
|
+
type: 'text',
|
|
47
|
+
text: 'Is there another command you would like to learn more about?',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.GuidedWalkthroughTool = GuidedWalkthroughTool;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UploadProjectTools = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
5
|
+
const project_1 = require("../../utils/project");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
class UploadProjectTools extends types_1.Tool {
|
|
8
|
+
static register(mcpServer) {
|
|
9
|
+
return mcpServer.registerTool('upload-hubspot-project', {
|
|
10
|
+
title: 'Upload HubSpot Project',
|
|
11
|
+
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.',
|
|
12
|
+
inputSchema: {
|
|
13
|
+
absoluteProjectPath: constants_1.absoluteProjectPath,
|
|
14
|
+
},
|
|
15
|
+
}, async ({ absoluteProjectPath }) => {
|
|
16
|
+
const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteProjectPath, `hs project upload --force-create`);
|
|
17
|
+
return {
|
|
18
|
+
content: [
|
|
19
|
+
{ type: 'text', text: stdout },
|
|
20
|
+
{ type: 'text', text: stderr },
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.UploadProjectTools = UploadProjectTools;
|
|
@@ -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,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,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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "7.7.
|
|
3
|
+
"version": "7.7.5-experimental.0",
|
|
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",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@hubspot/local-dev-lib": "3.7.1",
|
|
9
9
|
"@hubspot/project-parsing-lib": "0.3.0",
|
|
10
|
-
"@hubspot/serverless-dev-runtime": "7.0.
|
|
10
|
+
"@hubspot/serverless-dev-runtime": "7.0.6",
|
|
11
11
|
"@hubspot/theme-preview-dev-server": "0.0.10",
|
|
12
12
|
"@hubspot/ui-extensions-dev-server": "0.9.2",
|
|
13
|
+
"@modelcontextprotocol/sdk": "1.13.3",
|
|
13
14
|
"archiver": "7.0.1",
|
|
14
15
|
"boxen": "8.0.1",
|
|
15
16
|
"chalk": "4.1.2",
|
|
@@ -65,6 +66,7 @@
|
|
|
65
66
|
},
|
|
66
67
|
"scripts": {
|
|
67
68
|
"build": "ts-node ./scripts/build.ts",
|
|
69
|
+
"debug-mcp": "yarn build && npx @modelcontextprotocol/inspector node dist/mcp-server/server.js",
|
|
68
70
|
"lint": "echo 'Linting is disabled for Blazar'",
|
|
69
71
|
"lint:local": "eslint . && prettier --list-different './**/*.{ts,js,json}'",
|
|
70
72
|
"list-all-commands": "yarn ts-node ./scripts/get-all-commands.ts",
|