@hubspot/cli 7.7.15-experimental.0 → 7.7.16-experimental.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 (71) hide show
  1. package/bin/cli.js +4 -0
  2. package/bin/hs +1 -1
  3. package/commands/getStarted.d.ts +9 -0
  4. package/commands/getStarted.js +227 -0
  5. package/commands/init.js +6 -1
  6. package/commands/mcp/setup.d.ts +4 -10
  7. package/commands/mcp/setup.js +28 -220
  8. package/commands/mcp/start.d.ts +3 -9
  9. package/commands/mcp/start.js +18 -15
  10. package/commands/mcp.js +2 -1
  11. package/commands/project/deploy.d.ts +1 -0
  12. package/commands/project/deploy.js +29 -3
  13. package/commands/project/upload.d.ts +2 -2
  14. package/commands/project/upload.js +18 -23
  15. package/commands/project/validate.d.ts +6 -0
  16. package/commands/project/validate.js +82 -0
  17. package/commands/project.js +2 -0
  18. package/commands/testAccount/create.d.ts +6 -0
  19. package/commands/testAccount/create.js +110 -0
  20. package/commands/testAccount/createConfig.d.ts +10 -0
  21. package/commands/testAccount/createConfig.js +98 -0
  22. package/commands/testAccount/delete.d.ts +6 -0
  23. package/commands/testAccount/delete.js +48 -0
  24. package/commands/testAccount.d.ts +3 -0
  25. package/commands/testAccount.js +28 -0
  26. package/lang/en.d.ts +144 -29
  27. package/lang/en.js +144 -32
  28. package/lang/en.lyaml +9 -14
  29. package/lib/app/migrate.js +15 -3
  30. package/lib/commonOpts.d.ts +2 -0
  31. package/lib/commonOpts.js +21 -9
  32. package/lib/constants.d.ts +5 -0
  33. package/lib/constants.js +6 -1
  34. package/lib/doctor/Doctor.js +1 -1
  35. package/lib/errorHandlers/index.js +7 -0
  36. package/lib/mcp/setup.d.ts +21 -0
  37. package/lib/mcp/setup.js +218 -0
  38. package/lib/projectProfiles.d.ts +1 -0
  39. package/lib/projectProfiles.js +18 -0
  40. package/lib/projects/buildAndDeploy.js +1 -1
  41. package/lib/projects/localDev/AppDevModeInterface.d.ts +3 -0
  42. package/lib/projects/localDev/AppDevModeInterface.js +45 -16
  43. package/lib/projects/localDev/LocalDevManager.js +1 -1
  44. package/lib/projects/upload.d.ts +3 -0
  45. package/lib/projects/upload.js +56 -22
  46. package/lib/projects/urls.d.ts +2 -0
  47. package/lib/projects/urls.js +10 -0
  48. package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +17 -0
  49. package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +96 -0
  50. package/lib/prompts/installAppPrompt.d.ts +2 -1
  51. package/lib/prompts/installAppPrompt.js +12 -2
  52. package/lib/prompts/promptUtils.d.ts +1 -0
  53. package/lib/prompts/promptUtils.js +2 -0
  54. package/lib/ui/logger.d.ts +1 -0
  55. package/lib/ui/logger.js +1 -0
  56. package/lib/yargsUtils.d.ts +1 -0
  57. package/lib/yargsUtils.js +3 -0
  58. package/mcp-server/tools/index.js +2 -0
  59. package/mcp-server/tools/project/AddFeatureToProject.js +6 -29
  60. package/mcp-server/tools/project/CreateProjectTool.d.ts +3 -3
  61. package/mcp-server/tools/project/CreateProjectTool.js +12 -31
  62. package/mcp-server/tools/project/DeployProject.js +4 -11
  63. package/mcp-server/tools/project/GuidedWalkthroughTool.js +3 -16
  64. package/mcp-server/tools/project/UploadProjectTools.js +3 -7
  65. package/mcp-server/tools/project/ValidateProjectTool.d.ts +17 -0
  66. package/mcp-server/tools/project/ValidateProjectTool.js +35 -0
  67. package/mcp-server/utils/content.d.ts +3 -0
  68. package/mcp-server/utils/content.js +21 -0
  69. package/package.json +10 -9
  70. package/types/LocalDev.d.ts +1 -0
  71. package/types/Yargs.d.ts +4 -0
@@ -8,6 +8,7 @@ const types_1 = require("../../types");
8
8
  const project_1 = require("../../utils/project");
9
9
  const constants_1 = require("./constants");
10
10
  const zod_1 = __importDefault(require("zod"));
11
+ const content_1 = require("../../utils/content");
11
12
  const inputSchema = {
12
13
  absoluteProjectPath: constants_1.absoluteProjectPath,
13
14
  };
@@ -21,17 +22,12 @@ class UploadProjectTools extends types_1.Tool {
21
22
  }
22
23
  async handler({ absoluteProjectPath, }) {
23
24
  const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteProjectPath, `hs project upload --force-create`);
24
- return {
25
- content: [
26
- { type: 'text', text: stdout },
27
- { type: 'text', text: stderr },
28
- ],
29
- };
25
+ return (0, content_1.formatTextContents)(stdout, stderr);
30
26
  }
31
27
  register() {
32
28
  return this.mcpServer.registerTool('upload-hubspot-project', {
33
29
  title: 'Upload HubSpot Project',
34
- 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',
35
31
  inputSchema,
36
32
  }, this.handler);
37
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;
@@ -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
+ }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "7.7.15-experimental.0",
3
+ "version": "7.7.16-experimental.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",
7
7
  "dependencies": {
8
- "@hubspot/local-dev-lib": "3.7.1",
9
- "@hubspot/project-parsing-lib": "0.3.0",
8
+ "@hubspot/local-dev-lib": "3.10.0-beta.0",
9
+ "@hubspot/project-parsing-lib": "0.3.2",
10
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",
@@ -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
- "build-docker": "docker image build --tag hs-cli-image . && docker image prune -f",
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
  },
@@ -30,5 +30,6 @@ export type AppLocalDevData = {
30
30
  clientId: string;
31
31
  name: string;
32
32
  installationState: ValueOf<typeof APP_INSTALLATION_STATES>;
33
+ scopeGroupIds: number[];
33
34
  };
34
35
  export type LocalDevServerMessage = ValueOf<typeof LOCAL_DEV_SERVER_MESSAGE_TYPES>;
package/types/Yargs.d.ts CHANGED
@@ -24,6 +24,10 @@ export type OverwriteArgs = Options & {
24
24
  export type StringArgType = Options & {
25
25
  type: 'string';
26
26
  };
27
+ export type JSONOutputArgs = Options & {
28
+ json?: boolean;
29
+ formatOutputAsJson?: boolean;
30
+ };
27
31
  export type ProjectDevArgs = CommonArgs & ConfigArgs & EnvironmentArgs & {
28
32
  profile?: string;
29
33
  testingAccount?: string | number;