@hubspot/cli 8.5.0 → 8.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 +4 -3
- package/commands/account/clean.js +2 -0
- package/commands/account/createOverride.js +3 -0
- package/commands/account/info.js +34 -16
- package/commands/account/link.d.ts +4 -0
- package/commands/account/link.js +89 -0
- package/commands/account/list.js +29 -71
- package/commands/account/remove.js +2 -0
- package/commands/account/removeOverride.js +3 -0
- package/commands/account/unlink.d.ts +4 -0
- package/commands/account/unlink.js +70 -0
- package/commands/account/use.js +71 -1
- package/commands/account.js +4 -0
- package/commands/project/appInstallStatus.d.ts +4 -0
- package/commands/project/appInstallStatus.js +132 -0
- package/commands/project/create.js +8 -0
- package/commands/project/dev/deprecatedFlow.js +20 -2
- package/commands/project/dev/index.js +6 -0
- package/commands/project/dev/unifiedFlow.js +36 -10
- package/commands/project/lint.js +20 -2
- package/commands/project.js +2 -0
- package/lang/en.d.ts +103 -0
- package/lang/en.js +117 -8
- package/lib/app/migrate.js +2 -1
- package/lib/constants.d.ts +1 -0
- package/lib/constants.js +3 -0
- package/lib/doctor/Doctor.js +5 -5
- package/lib/link/accountTableUtils.d.ts +10 -0
- package/lib/link/accountTableUtils.js +39 -0
- package/lib/link/index.d.ts +18 -0
- package/lib/link/index.js +185 -0
- package/lib/link/linkUtils.d.ts +5 -0
- package/lib/link/linkUtils.js +49 -0
- package/lib/link/prompts.d.ts +7 -0
- package/lib/link/prompts.js +126 -0
- package/lib/link/renderLinkedAccountsTable.d.ts +2 -0
- package/lib/link/renderLinkedAccountsTable.js +14 -0
- package/lib/link/warnIfLinkedDirectory.d.ts +1 -0
- package/lib/link/warnIfLinkedDirectory.js +9 -0
- package/lib/projects/localDev/DevServerManager_DEPRECATED.d.ts +2 -1
- package/lib/projects/localDev/DevServerManager_DEPRECATED.js +2 -2
- package/lib/projects/localDev/LocalDevManager_DEPRECATED.d.ts +2 -0
- package/lib/projects/localDev/LocalDevManager_DEPRECATED.js +3 -0
- package/lib/projects/uieLinting.d.ts +17 -3
- package/lib/projects/uieLinting.js +93 -28
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +1 -0
- package/lib/prompts/projectDevTargetAccountPrompt.js +10 -0
- package/lib/prompts/promptUtils.js +1 -0
- package/lib/ui/accountTable.d.ts +8 -0
- package/lib/ui/accountTable.js +67 -0
- package/lib/yargs/parseYargsOrExit.d.ts +4 -0
- package/lib/yargs/parseYargsOrExit.js +25 -0
- package/mcp-server/server.js +39 -1
- package/mcp-server/tools/index.js +2 -0
- package/mcp-server/tools/project/AddFeatureToProjectTool.js +1 -1
- package/mcp-server/tools/project/CreateTestAccountTool.js +1 -1
- package/mcp-server/tools/project/DeployProjectTool.js +1 -1
- package/mcp-server/tools/project/FindProjectsTool.d.ts +15 -0
- package/mcp-server/tools/project/FindProjectsTool.js +60 -0
- package/mcp-server/tools/project/GetBuildLogsTool.js +1 -1
- package/mcp-server/tools/project/GetBuildStatusTool.js +1 -1
- package/mcp-server/tools/project/UploadProjectTools.js +1 -1
- package/mcp-server/tools/project/ValidateProjectTool.js +1 -1
- package/package.json +2 -2
- package/types/Link.d.ts +32 -0
- package/types/Link.js +5 -0
- package/types/PackageJson.d.ts +1 -0
- package/types/Prompts.d.ts +1 -0
- package/types/Yargs.d.ts +1 -0
|
@@ -43,7 +43,7 @@ export class DeployProjectTool extends Tool {
|
|
|
43
43
|
register() {
|
|
44
44
|
return this.mcpServer.registerTool(toolName, {
|
|
45
45
|
title: 'Deploy a build of HubSpot Project',
|
|
46
|
-
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
|
+
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. If you do not know the project path, use the find-projects tool first to locate HubSpot projects in the workspace.',
|
|
47
47
|
inputSchema,
|
|
48
48
|
annotations: {
|
|
49
49
|
readOnlyHint: false,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TextContentResponse } from '../../types.js';
|
|
2
|
+
import { Tool } from '../../Tool.js';
|
|
3
|
+
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
|
+
import { McpLogger } from '../../utils/logger.js';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
declare const inputSchemaZodObject: z.ZodObject<{
|
|
7
|
+
absoluteDirectory: z.ZodString;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type FindProjectsInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
10
|
+
export declare class FindProjectsTool extends Tool<FindProjectsInputSchema> {
|
|
11
|
+
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
12
|
+
handler({ absoluteDirectory, }: FindProjectsInputSchema): Promise<TextContentResponse>;
|
|
13
|
+
register(): RegisteredTool;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Tool } from '../../Tool.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { formatTextContents } from '../../utils/content.js';
|
|
4
|
+
import { walk } from '@hubspot/local-dev-lib/fs';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { PROJECT_CONFIG_FILE } from '../../../lib/constants.js';
|
|
7
|
+
const TOOL_NAME = 'find-projects';
|
|
8
|
+
const IGNORE_DIRS = ['node_modules', '.git', '.vite'];
|
|
9
|
+
const inputSchema = {
|
|
10
|
+
absoluteDirectory: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe('The absolute path to the directory to search for HubSpot projects in.'),
|
|
13
|
+
};
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
|
+
const inputSchemaZodObject = z.object({ ...inputSchema });
|
|
16
|
+
export class FindProjectsTool extends Tool {
|
|
17
|
+
constructor(mcpServer, logger) {
|
|
18
|
+
super(mcpServer, logger, TOOL_NAME);
|
|
19
|
+
}
|
|
20
|
+
async handler({ absoluteDirectory, }) {
|
|
21
|
+
try {
|
|
22
|
+
const allFiles = await walk(absoluteDirectory, IGNORE_DIRS);
|
|
23
|
+
const projectFiles = allFiles.filter(file => path.basename(file) === PROJECT_CONFIG_FILE);
|
|
24
|
+
if (projectFiles.length === 0) {
|
|
25
|
+
return formatTextContents(`No ${PROJECT_CONFIG_FILE} files found under ${absoluteDirectory}.`);
|
|
26
|
+
}
|
|
27
|
+
const projectDirs = projectFiles.map(file => path.dirname(file));
|
|
28
|
+
const output = [
|
|
29
|
+
`Found ${projectFiles.length} project(s):`,
|
|
30
|
+
'',
|
|
31
|
+
...projectDirs.map(dir => ` ${dir}`),
|
|
32
|
+
].join('\n');
|
|
33
|
+
return formatTextContents(output);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
this.logger.debug(TOOL_NAME, {
|
|
37
|
+
message: 'Handler caught error',
|
|
38
|
+
error: error instanceof Error ? error.message : String(error),
|
|
39
|
+
});
|
|
40
|
+
const cause = error instanceof Error ? error.cause : undefined;
|
|
41
|
+
const causeMessage = cause instanceof Error ? `: ${cause.message}` : '';
|
|
42
|
+
const errorMessage = error instanceof Error
|
|
43
|
+
? error.message || `FileSystemError${causeMessage}`
|
|
44
|
+
: String(error);
|
|
45
|
+
return formatTextContents(`Error searching for projects: ${errorMessage}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
register() {
|
|
49
|
+
return this.mcpServer.registerTool(TOOL_NAME, {
|
|
50
|
+
title: 'Find HubSpot Projects',
|
|
51
|
+
description: 'Use this tool to locate HubSpot projects. Traverses child directories of the given directory to find hsproject.json files, returning the paths of all discovered HubSpot projects.',
|
|
52
|
+
inputSchema,
|
|
53
|
+
annotations: {
|
|
54
|
+
readOnlyHint: true,
|
|
55
|
+
openWorldHint: false,
|
|
56
|
+
idempotentHint: true,
|
|
57
|
+
},
|
|
58
|
+
}, input => this.wrappedHandler(input));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -114,7 +114,7 @@ export class GetBuildLogsTool extends Tool {
|
|
|
114
114
|
register() {
|
|
115
115
|
return this.mcpServer.registerTool(TOOL_NAME, {
|
|
116
116
|
title: 'Get HubSpot Project Build Logs',
|
|
117
|
-
description: 'Retrieves build logs for a specific HubSpot project build. Use this to debug build failures by viewing the full build pipeline output. This tool is for more comprehensive troubleshootings or addressing build WARNINGs, build errors should be troubleshooted with get-build-status tool first. Logs can be filtered by level (ERROR, WARN, INFO, or ALL). Use `hs project list-builds` first to identify the build ID and error messages.',
|
|
117
|
+
description: 'Retrieves build logs for a specific HubSpot project build. Use this to debug build failures by viewing the full build pipeline output. This tool is for more comprehensive troubleshootings or addressing build WARNINGs, build errors should be troubleshooted with get-build-status tool first. Logs can be filtered by level (ERROR, WARN, INFO, or ALL). Use `hs project list-builds` first to identify the build ID and error messages. If you do not know the project path, use the find-projects tool first to locate HubSpot projects in the workspace.',
|
|
118
118
|
inputSchema,
|
|
119
119
|
annotations: {
|
|
120
120
|
readOnlyHint: true,
|
|
@@ -155,7 +155,7 @@ export class GetBuildStatusTool extends Tool {
|
|
|
155
155
|
register() {
|
|
156
156
|
return this.mcpServer.registerTool(TOOL_NAME, {
|
|
157
157
|
title: 'Get HubSpot Projects Build Status and Errors',
|
|
158
|
-
description: 'Retrieves build status and error messages for HubSpot projects. When buildId is omitted, shows recent builds with their status(default 3) - use this to find the latest builds when troubleshooting. When buildId is provided, shows detailed error information for that specific build. Displays buildErrorMessage and subbuild failures to help diagnose build issues.',
|
|
158
|
+
description: 'Retrieves build status and error messages for HubSpot projects. When buildId is omitted, shows recent builds with their status(default 3) - use this to find the latest builds when troubleshooting. When buildId is provided, shows detailed error information for that specific build. Displays buildErrorMessage and subbuild failures to help diagnose build issues. If you do not know the project path, use the find-projects tool first to locate HubSpot projects in the workspace.',
|
|
159
159
|
inputSchema,
|
|
160
160
|
annotations: {
|
|
161
161
|
readOnlyHint: true,
|
|
@@ -72,7 +72,7 @@ export class UploadProjectTools extends Tool {
|
|
|
72
72
|
register() {
|
|
73
73
|
return this.mcpServer.registerTool(toolName, {
|
|
74
74
|
title: 'Upload HubSpot Project',
|
|
75
|
-
description: 'DO NOT run this tool unless the user specifies they would like to upload the project, it is potentially destructive. 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. IMPORTANT: Uploading a project does NOT automatically make cards live or visible to users. Cards must be manually added to a view in HubSpot after upload to become visible.',
|
|
75
|
+
description: 'DO NOT run this tool unless the user specifies they would like to upload the project, it is potentially destructive. 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. IMPORTANT: Uploading a project does NOT automatically make cards live or visible to users. Cards must be manually added to a view in HubSpot after upload to become visible. If you do not know the project path, use the find-projects tool first to locate HubSpot projects in the workspace.',
|
|
76
76
|
inputSchema,
|
|
77
77
|
annotations: {
|
|
78
78
|
readOnlyHint: false,
|
|
@@ -33,7 +33,7 @@ export class ValidateProjectTool extends Tool {
|
|
|
33
33
|
register() {
|
|
34
34
|
return this.mcpServer.registerTool(toolName, {
|
|
35
35
|
title: 'Validate HubSpot Project',
|
|
36
|
-
description: 'Validates the HubSpot project and its configuration files. This tool does not need to be ran before uploading the project',
|
|
36
|
+
description: 'Validates the HubSpot project and its configuration files. This tool does not need to be ran before uploading the project. If you do not know the project path, use the find-projects tool first to locate HubSpot projects in the workspace.',
|
|
37
37
|
inputSchema,
|
|
38
38
|
annotations: {
|
|
39
39
|
readOnlyHint: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.0-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",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"!**/__tests__/**"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@hubspot/local-dev-lib": "5.
|
|
13
|
+
"@hubspot/local-dev-lib": "5.6.0",
|
|
14
14
|
"@hubspot/project-parsing-lib": "0.16.0",
|
|
15
15
|
"@hubspot/serverless-dev-runtime": "7.0.7",
|
|
16
16
|
"@hubspot/ui-extensions-dev-server": "2.0.5",
|
package/types/Link.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { HubSpotConfigAccount } from '@hubspot/local-dev-lib/types/Accounts';
|
|
2
|
+
import { HsSettingsFile } from '@hubspot/local-dev-lib/types/HsSettings';
|
|
3
|
+
import { CommonArgs, ConfigArgs } from './Yargs.js';
|
|
4
|
+
import { ArgumentsCamelCase } from 'yargs';
|
|
5
|
+
export type LinkArgs = CommonArgs & ConfigArgs;
|
|
6
|
+
export type LinkContext = {
|
|
7
|
+
globalAccountsList: HubSpotConfigAccount[];
|
|
8
|
+
globalDefaultAccount: HubSpotConfigAccount | undefined;
|
|
9
|
+
accountOverrideId: number | null;
|
|
10
|
+
preselectedAccountId?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const ACTION_RESULT_STATUS: {
|
|
13
|
+
readonly SUCCESS: "success";
|
|
14
|
+
readonly ERROR: "error";
|
|
15
|
+
readonly NOOP: "noop";
|
|
16
|
+
};
|
|
17
|
+
export type ActionResult = {
|
|
18
|
+
status: typeof ACTION_RESULT_STATUS.SUCCESS;
|
|
19
|
+
settings: HsSettingsFile;
|
|
20
|
+
} | {
|
|
21
|
+
status: typeof ACTION_RESULT_STATUS.ERROR;
|
|
22
|
+
reason: string;
|
|
23
|
+
} | {
|
|
24
|
+
status: typeof ACTION_RESULT_STATUS.NOOP;
|
|
25
|
+
};
|
|
26
|
+
export type ActionHandlerParams = {
|
|
27
|
+
state: HsSettingsFile;
|
|
28
|
+
context: LinkContext;
|
|
29
|
+
args: ArgumentsCamelCase<LinkArgs>;
|
|
30
|
+
};
|
|
31
|
+
export type ActionHandler = (params: ActionHandlerParams) => Promise<ActionResult>;
|
|
32
|
+
export type ActionName = 'link' | 'unlink' | 'authenticate' | 'cancel';
|
package/types/Link.js
ADDED
package/types/PackageJson.d.ts
CHANGED
package/types/Prompts.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export type GenericPromptResponse = {
|
|
|
5
5
|
type PromptType = 'confirm' | 'list' | 'checkbox' | 'input' | 'password' | 'number' | 'rawlist';
|
|
6
6
|
export type PromptChoices<T = any> = Array<string | {
|
|
7
7
|
name: string;
|
|
8
|
+
short?: string;
|
|
8
9
|
value?: T;
|
|
9
10
|
disabled?: string | boolean;
|
|
10
11
|
checked?: boolean;
|
package/types/Yargs.d.ts
CHANGED