@hubspot/cli 8.0.11-experimental.1 → 8.0.12-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.
Files changed (115) hide show
  1. package/api/migrate.js +3 -3
  2. package/bin/cli.js +3 -0
  3. package/commands/account/link.d.ts +4 -0
  4. package/commands/account/link.js +88 -0
  5. package/commands/account/unlink.d.ts +4 -0
  6. package/commands/account/unlink.js +69 -0
  7. package/commands/account.js +4 -0
  8. package/commands/app/migrate.js +4 -4
  9. package/commands/getStarted.js +2 -2
  10. package/commands/project/add.js +3 -3
  11. package/commands/project/appInstallStatus.d.ts +4 -0
  12. package/commands/project/appInstallStatus.js +132 -0
  13. package/commands/project/create.js +18 -7
  14. package/commands/project/delete.js +2 -2
  15. package/commands/project/deploy.js +4 -3
  16. package/commands/project/dev/index.js +5 -4
  17. package/commands/project/info.js +2 -2
  18. package/commands/project/lint.js +2 -1
  19. package/commands/project/migrate.js +5 -5
  20. package/commands/project/profile/add.js +2 -2
  21. package/commands/project/profile/delete.js +2 -2
  22. package/commands/project/upload.d.ts +2 -0
  23. package/commands/project/upload.js +38 -6
  24. package/commands/project/validate.js +2 -2
  25. package/commands/project/watch.js +2 -2
  26. package/commands/project.js +8 -3
  27. package/commands/testAccount/create.js +4 -4
  28. package/lang/en.d.ts +95 -0
  29. package/lang/en.js +108 -8
  30. package/lib/app/migrate.js +8 -0
  31. package/lib/doctor/Doctor.js +2 -2
  32. package/lib/getStartedV2Actions.js +2 -2
  33. package/lib/link/accountTableUtils.d.ts +10 -0
  34. package/lib/link/accountTableUtils.js +39 -0
  35. package/lib/link/index.d.ts +14 -0
  36. package/lib/link/index.js +154 -0
  37. package/lib/link/linkUtils.d.ts +4 -0
  38. package/lib/link/linkUtils.js +24 -0
  39. package/lib/link/prompts.d.ts +7 -0
  40. package/lib/link/prompts.js +126 -0
  41. package/lib/link/renderLinkedAccountsTable.d.ts +2 -0
  42. package/lib/link/renderLinkedAccountsTable.js +14 -0
  43. package/lib/projects/ProjectLogsManager.js +6 -3
  44. package/lib/projects/create/index.js +2 -2
  45. package/lib/projects/create/legacy.js +2 -2
  46. package/lib/projects/create/v2.js +2 -2
  47. package/lib/projects/delete.js +2 -2
  48. package/lib/projects/deploy.d.ts +1 -1
  49. package/lib/projects/deploy.js +2 -2
  50. package/lib/projects/preview.d.ts +7 -0
  51. package/lib/projects/preview.js +71 -0
  52. package/lib/projects/uieLinting.d.ts +8 -3
  53. package/lib/projects/uieLinting.js +48 -27
  54. package/lib/projects/upload.d.ts +1 -0
  55. package/lib/projects/upload.js +8 -7
  56. package/lib/prompts/projectsLogsPrompt.js +3 -0
  57. package/lib/prompts/promptUtils.js +1 -0
  58. package/lib/theme/cmsDevServerProcess.js +1 -1
  59. package/mcp-server/Tool.d.ts +15 -0
  60. package/mcp-server/Tool.js +53 -0
  61. package/mcp-server/server.js +39 -3
  62. package/mcp-server/tools/cms/HsCreateFunctionTool.d.ts +4 -2
  63. package/mcp-server/tools/cms/HsCreateFunctionTool.js +8 -6
  64. package/mcp-server/tools/cms/HsCreateModuleTool.d.ts +4 -2
  65. package/mcp-server/tools/cms/HsCreateModuleTool.js +8 -6
  66. package/mcp-server/tools/cms/HsCreateTemplateTool.d.ts +4 -2
  67. package/mcp-server/tools/cms/HsCreateTemplateTool.js +8 -6
  68. package/mcp-server/tools/cms/HsFunctionLogsTool.d.ts +4 -2
  69. package/mcp-server/tools/cms/HsFunctionLogsTool.js +8 -6
  70. package/mcp-server/tools/cms/HsListFunctionsTool.d.ts +4 -2
  71. package/mcp-server/tools/cms/HsListFunctionsTool.js +8 -6
  72. package/mcp-server/tools/cms/HsListTool.d.ts +4 -2
  73. package/mcp-server/tools/cms/HsListTool.js +8 -6
  74. package/mcp-server/tools/index.d.ts +3 -2
  75. package/mcp-server/tools/index.js +22 -22
  76. package/mcp-server/tools/project/AddFeatureToProjectTool.d.ts +6 -4
  77. package/mcp-server/tools/project/AddFeatureToProjectTool.js +8 -6
  78. package/mcp-server/tools/project/CreateProjectTool.d.ts +6 -4
  79. package/mcp-server/tools/project/CreateProjectTool.js +9 -7
  80. package/mcp-server/tools/project/CreateTestAccountTool.d.ts +4 -2
  81. package/mcp-server/tools/project/CreateTestAccountTool.js +20 -8
  82. package/mcp-server/tools/project/DeployProjectTool.d.ts +4 -2
  83. package/mcp-server/tools/project/DeployProjectTool.js +4 -6
  84. package/mcp-server/tools/project/DocFetchTool.d.ts +4 -2
  85. package/mcp-server/tools/project/DocFetchTool.js +8 -6
  86. package/mcp-server/tools/project/DocsSearchTool.d.ts +9 -3
  87. package/mcp-server/tools/project/DocsSearchTool.js +32 -9
  88. package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.d.ts +4 -2
  89. package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.js +8 -6
  90. package/mcp-server/tools/project/GetApplicationInfoTool.d.ts +4 -2
  91. package/mcp-server/tools/project/GetApplicationInfoTool.js +8 -6
  92. package/mcp-server/tools/project/GetBuildLogsTool.d.ts +4 -2
  93. package/mcp-server/tools/project/GetBuildLogsTool.js +8 -6
  94. package/mcp-server/tools/project/GetBuildStatusTool.d.ts +4 -2
  95. package/mcp-server/tools/project/GetBuildStatusTool.js +8 -6
  96. package/mcp-server/tools/project/GetConfigValuesTool.d.ts +4 -2
  97. package/mcp-server/tools/project/GetConfigValuesTool.js +12 -7
  98. package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +4 -2
  99. package/mcp-server/tools/project/GuidedWalkthroughTool.js +4 -6
  100. package/mcp-server/tools/project/UploadProjectTools.d.ts +4 -2
  101. package/mcp-server/tools/project/UploadProjectTools.js +9 -7
  102. package/mcp-server/tools/project/ValidateProjectTool.d.ts +4 -2
  103. package/mcp-server/tools/project/ValidateProjectTool.js +8 -6
  104. package/mcp-server/tools/project/constants.d.ts +2 -2
  105. package/mcp-server/types.d.ts +0 -7
  106. package/mcp-server/types.js +1 -13
  107. package/mcp-server/utils/logger.d.ts +10 -0
  108. package/mcp-server/utils/logger.js +29 -0
  109. package/mcp-server/utils/toolUsageTracking.js +0 -2
  110. package/package.json +10 -10
  111. package/types/Link.d.ts +27 -0
  112. package/types/Link.js +1 -0
  113. package/types/Prompts.d.ts +1 -0
  114. package/lib/projects/platformVersion.d.ts +0 -9
  115. package/lib/projects/platformVersion.js +0 -39
@@ -1,10 +1,10 @@
1
- import { Tool } from '../../types.js';
1
+ import { Tool } from '../../Tool.js';
2
2
  import { z } from 'zod';
3
3
  import { formatTextContents } from '../../utils/content.js';
4
4
  import { absoluteCurrentWorkingDirectory } from './constants.js';
5
5
  import { getIntermediateRepresentationSchema } from '@hubspot/project-parsing-lib/schema';
6
6
  import { mapToInternalType } from '@hubspot/project-parsing-lib/transform';
7
- import { isV2Project } from '../../../lib/projects/platformVersion.js';
7
+ import { isLegacyProject } from '@hubspot/project-parsing-lib/projects';
8
8
  import { getConfigDefaultAccountIfExists } from '@hubspot/local-dev-lib/config';
9
9
  import { setupHubSpotConfig } from '../../utils/config.js';
10
10
  const inputSchema = {
@@ -22,13 +22,13 @@ const inputSchemaZodObject = z.object({
22
22
  });
23
23
  const toolName = 'get-feature-config-schema';
24
24
  export class GetConfigValuesTool extends Tool {
25
- constructor(mcpServer) {
26
- super(mcpServer);
25
+ constructor(mcpServer, logger) {
26
+ super(mcpServer, logger, toolName);
27
27
  }
28
28
  async handler({ platformVersion, featureType, absoluteCurrentWorkingDirectory, }) {
29
29
  setupHubSpotConfig(absoluteCurrentWorkingDirectory);
30
30
  try {
31
- if (!isV2Project(platformVersion)) {
31
+ if (isLegacyProject(platformVersion)) {
32
32
  return formatTextContents(`Can only be used on projects with a minimum platformVersion of 2025.2`);
33
33
  }
34
34
  const accountId = getConfigDefaultAccountIfExists()?.accountId;
@@ -46,7 +46,12 @@ export class GetConfigValuesTool extends Tool {
46
46
  return formatTextContents(JSON.stringify({ config: schema[internalComponentType] }));
47
47
  }
48
48
  }
49
- catch (error) { }
49
+ catch (error) {
50
+ this.logger.debug(toolName, {
51
+ message: 'Handler caught error',
52
+ error: error instanceof Error ? error.message : String(error),
53
+ });
54
+ }
50
55
  return formatTextContents(`Unable to locate JSON schema for type ${featureType}`);
51
56
  }
52
57
  register() {
@@ -60,6 +65,6 @@ export class GetConfigValuesTool extends Tool {
60
65
  readOnlyHint: true,
61
66
  openWorldHint: false,
62
67
  },
63
- }, this.handler);
68
+ }, input => this.wrappedHandler(input));
64
69
  }
65
70
  }
@@ -1,5 +1,7 @@
1
- import { TextContentResponse, Tool } from '../../types.js';
1
+ import { TextContentResponse } from '../../types.js';
2
+ import { Tool } from '../../Tool.js';
2
3
  import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
4
+ import { McpLogger } from '../../utils/logger.js';
3
5
  import { z } from 'zod';
4
6
  declare const inputSchemaZodObject: z.ZodObject<{
5
7
  absoluteCurrentWorkingDirectory: z.ZodString;
@@ -12,7 +14,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
12
14
  }, z.core.$strip>;
13
15
  type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
14
16
  export declare class GuidedWalkthroughTool extends Tool<InputSchemaType> {
15
- constructor(mcpServer: McpServer);
17
+ constructor(mcpServer: McpServer, logger: McpLogger);
16
18
  handler({ command, absoluteCurrentWorkingDirectory, }: InputSchemaType): Promise<TextContentResponse>;
17
19
  register(): RegisteredTool;
18
20
  }
@@ -1,8 +1,7 @@
1
- import { Tool } from '../../types.js';
1
+ import { Tool } from '../../Tool.js';
2
2
  import { z } from 'zod';
3
3
  import { execAsync } from '../../utils/command.js';
4
4
  import { formatTextContents } from '../../utils/content.js';
5
- import { trackToolUsage } from '../../utils/toolUsageTracking.js';
6
5
  import { absoluteCurrentWorkingDirectory } from './constants.js';
7
6
  import { setupHubSpotConfig } from '../../utils/config.js';
8
7
  const nextCommands = {
@@ -24,12 +23,11 @@ const inputSchemaZodObject = z.object({
24
23
  });
25
24
  const toolName = 'guided-walkthrough-cli';
26
25
  export class GuidedWalkthroughTool extends Tool {
27
- constructor(mcpServer) {
28
- super(mcpServer);
26
+ constructor(mcpServer, logger) {
27
+ super(mcpServer, logger, toolName);
29
28
  }
30
29
  async handler({ command, absoluteCurrentWorkingDirectory, }) {
31
30
  setupHubSpotConfig(absoluteCurrentWorkingDirectory);
32
- await trackToolUsage(toolName);
33
31
  if (command) {
34
32
  const { stdout } = await execAsync(`${command} --help`);
35
33
  return 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]}` : ''}`);
@@ -45,6 +43,6 @@ export class GuidedWalkthroughTool extends Tool {
45
43
  readOnlyHint: true,
46
44
  openWorldHint: false,
47
45
  },
48
- }, this.handler);
46
+ }, input => this.wrappedHandler(input));
49
47
  }
50
48
  }
@@ -1,6 +1,8 @@
1
1
  import z from 'zod';
2
2
  import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
3
- import { TextContentResponse, Tool } from '../../types.js';
3
+ import { McpLogger } from '../../utils/logger.js';
4
+ import { TextContentResponse } from '../../types.js';
5
+ import { Tool } from '../../Tool.js';
4
6
  declare const inputSchemaZodObject: z.ZodObject<{
5
7
  absoluteProjectPath: z.ZodString;
6
8
  absoluteCurrentWorkingDirectory: z.ZodString;
@@ -9,7 +11,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
9
11
  }, z.z.core.$strip>;
10
12
  type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
11
13
  export declare class UploadProjectTools extends Tool<InputSchemaType> {
12
- constructor(mcpServer: McpServer);
14
+ constructor(mcpServer: McpServer, logger: McpLogger);
13
15
  handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, profile, uploadMessage, }: InputSchemaType): Promise<TextContentResponse>;
14
16
  register(): RegisteredTool;
15
17
  }
@@ -2,11 +2,10 @@ import path from 'path';
2
2
  import z from 'zod';
3
3
  import { getAllHsProfiles } from '@hubspot/project-parsing-lib/profiles';
4
4
  import { getProjectConfig } from '../../../lib/projects/config.js';
5
- import { Tool } from '../../types.js';
5
+ import { Tool } from '../../Tool.js';
6
6
  import { runCommandInDir } from '../../utils/command.js';
7
7
  import { absoluteCurrentWorkingDirectory, absoluteProjectPath, } from './constants.js';
8
8
  import { formatTextContent, formatTextContents } from '../../utils/content.js';
9
- import { trackToolUsage } from '../../utils/toolUsageTracking.js';
10
9
  import { addFlag } from '../../utils/command.js';
11
10
  import { setupHubSpotConfig } from '../../utils/config.js';
12
11
  const inputSchema = {
@@ -17,7 +16,7 @@ const inputSchema = {
17
16
  .describe('A 1 sentence message that concisely describes the changes that are being uploaded.'),
18
17
  profile: z
19
18
  .optional(z.string())
20
- .describe('CRITICAL: If the user has not explicitly specified a profile name, you MUST ask them which profile to use. NEVER automatically choose a profile based on files you see in the directory (e.g., seeing "hsprofile.prod.json" does NOT mean you should use "prod"). The profile to be used for the upload. All projects configured to use profiles must specify a profile when uploading. Profile files have the following format: "hsprofile.<profile>.json".'),
19
+ .describe('The profile to use for the upload. Only required for projects configured with profiles. If the project uses profiles and the user has not specified one, ask them rather than inferring from filenames in the directory. NEVER automatically choose a profile based on files you see. Profile files have the format: "hsprofile.<profile>.json".'),
21
20
  };
22
21
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
23
22
  const inputSchemaZodObject = z.object({
@@ -25,12 +24,11 @@ const inputSchemaZodObject = z.object({
25
24
  });
26
25
  const toolName = 'upload-project';
27
26
  export class UploadProjectTools extends Tool {
28
- constructor(mcpServer) {
29
- super(mcpServer);
27
+ constructor(mcpServer, logger) {
28
+ super(mcpServer, logger, toolName);
30
29
  }
31
30
  async handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, profile, uploadMessage, }) {
32
31
  setupHubSpotConfig(absoluteCurrentWorkingDirectory);
33
- await trackToolUsage(toolName);
34
32
  let command = addFlag('hs project upload', 'force-create', true);
35
33
  const content = [];
36
34
  if (uploadMessage) {
@@ -49,6 +47,10 @@ export class UploadProjectTools extends Tool {
49
47
  }
50
48
  }
51
49
  catch (e) {
50
+ this.logger.debug(toolName, {
51
+ message: 'Handler caught error checking for profiles',
52
+ error: e instanceof Error ? e.message : String(e),
53
+ });
52
54
  // If any of these checks fail, the safest thing to do is to assume there are no profiles.
53
55
  hasProfiles = false;
54
56
  }
@@ -78,6 +80,6 @@ export class UploadProjectTools extends Tool {
78
80
  idempotentHint: true,
79
81
  openWorldHint: true,
80
82
  },
81
- }, this.handler);
83
+ }, input => this.wrappedHandler(input));
82
84
  }
83
85
  }
@@ -1,5 +1,7 @@
1
- import { TextContentResponse, Tool } from '../../types.js';
1
+ import { TextContentResponse } from '../../types.js';
2
+ import { Tool } from '../../Tool.js';
2
3
  import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
4
+ import { McpLogger } from '../../utils/logger.js';
3
5
  import { z } from 'zod';
4
6
  declare const inputSchemaZodObject: z.ZodObject<{
5
7
  absoluteProjectPath: z.ZodString;
@@ -7,7 +9,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
7
9
  }, z.core.$strip>;
8
10
  export type CreateProjectInputSchema = z.infer<typeof inputSchemaZodObject>;
9
11
  export declare class ValidateProjectTool extends Tool<CreateProjectInputSchema> {
10
- constructor(mcpServer: McpServer);
12
+ constructor(mcpServer: McpServer, logger: McpLogger);
11
13
  handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, }: CreateProjectInputSchema): Promise<TextContentResponse>;
12
14
  register(): RegisteredTool;
13
15
  }
@@ -1,9 +1,8 @@
1
- import { Tool } from '../../types.js';
1
+ import { Tool } from '../../Tool.js';
2
2
  import { z } from 'zod';
3
3
  import { absoluteCurrentWorkingDirectory, absoluteProjectPath, } from './constants.js';
4
4
  import { runCommandInDir } from '../../utils/command.js';
5
5
  import { formatTextContents } from '../../utils/content.js';
6
- import { trackToolUsage } from '../../utils/toolUsageTracking.js';
7
6
  import { setupHubSpotConfig } from '../../utils/config.js';
8
7
  import { getErrorMessage } from '../../../lib/errorHandlers/index.js';
9
8
  const inputSchema = {
@@ -14,17 +13,20 @@ const inputSchema = {
14
13
  const inputSchemaZodObject = z.object({ ...inputSchema });
15
14
  const toolName = 'validate-project';
16
15
  export class ValidateProjectTool extends Tool {
17
- constructor(mcpServer) {
18
- super(mcpServer);
16
+ constructor(mcpServer, logger) {
17
+ super(mcpServer, logger, toolName);
19
18
  }
20
19
  async handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, }) {
21
20
  setupHubSpotConfig(absoluteCurrentWorkingDirectory);
22
- await trackToolUsage(toolName);
23
21
  try {
24
22
  const { stdout, stderr } = await runCommandInDir(absoluteProjectPath, 'hs project validate');
25
23
  return formatTextContents(stdout, stderr);
26
24
  }
27
25
  catch (error) {
26
+ this.logger.debug(toolName, {
27
+ message: 'Handler caught error',
28
+ error: error instanceof Error ? error.message : String(error),
29
+ });
28
30
  return formatTextContents(getErrorMessage(error));
29
31
  }
30
32
  }
@@ -37,6 +39,6 @@ export class ValidateProjectTool extends Tool {
37
39
  readOnlyHint: true,
38
40
  openWorldHint: false,
39
41
  },
40
- }, this.handler);
42
+ }, input => this.wrappedHandler(input));
41
43
  }
42
44
  }
@@ -8,11 +8,11 @@ export declare const features: z.ZodOptional<z.ZodArray<z.ZodEnum<{
8
8
  "workflow-action-tool": "workflow-action-tool";
9
9
  page: "page";
10
10
  webhooks: "webhooks";
11
- "workflow-action": "workflow-action";
12
11
  "app-function": "app-function";
13
- "app-function-endpoint": "app-function-endpoint";
14
12
  "app-object": "app-object";
15
13
  scim: "scim";
14
+ "workflow-action": "workflow-action";
15
+ "app-function-endpoint": "app-function-endpoint";
16
16
  }>>>;
17
17
  export declare const docsSearchQuery: z.ZodString;
18
18
  export declare const docUrl: z.ZodString;
@@ -1,10 +1,3 @@
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
1
  export type TextContent = {
9
2
  type: 'text';
10
3
  text: string;
@@ -1,13 +1 @@
1
- export class Tool {
2
- mcpServer;
3
- constructor(mcpServer) {
4
- this.mcpServer = mcpServer;
5
- }
6
- register() {
7
- throw new Error('Must implement register');
8
- }
9
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
- handler(input) {
11
- throw new Error('Must implement handler');
12
- }
13
- }
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare class McpLogger {
3
+ private mcpServer;
4
+ constructor(mcpServer: McpServer);
5
+ private log;
6
+ debug(logger: string, data: unknown): void;
7
+ info(logger: string, data: unknown): void;
8
+ warn(logger: string, data: unknown): void;
9
+ error(logger: string, data: unknown): void;
10
+ }
@@ -0,0 +1,29 @@
1
+ export class McpLogger {
2
+ mcpServer;
3
+ constructor(mcpServer) {
4
+ this.mcpServer = mcpServer;
5
+ }
6
+ log(level, logger, data) {
7
+ try {
8
+ this.mcpServer.sendLoggingMessage({ level, logger, data });
9
+ }
10
+ catch (error) {
11
+ // sendLoggingMessage can throw if no transport is connected or the
12
+ // client doesn't support logging. Write to stderr so failures surface
13
+ // somewhere without corrupting the stdio JSON-RPC stream.
14
+ process.stderr.write(`[McpLogger] Failed to send log message: ${error}\n`);
15
+ }
16
+ }
17
+ debug(logger, data) {
18
+ this.log('debug', logger, data);
19
+ }
20
+ info(logger, data) {
21
+ this.log('info', logger, data);
22
+ }
23
+ warn(logger, data) {
24
+ this.log('warning', logger, data);
25
+ }
26
+ error(logger, data) {
27
+ this.log('error', logger, data);
28
+ }
29
+ }
@@ -1,7 +1,6 @@
1
1
  import { trackUsage } from '@hubspot/local-dev-lib/trackUsage';
2
2
  import { EventClass, getNodeVersionData, getPlatform, } from '../../lib/usageTracking.js';
3
3
  import { getConfig, getConfigDefaultAccountIfExists, } from '@hubspot/local-dev-lib/config';
4
- import { uiLogger } from '../../lib/ui/logger.js';
5
4
  export async function trackToolUsage(toolName, meta) {
6
5
  const config = getConfig();
7
6
  if (config?.allowUsageTracking === false) {
@@ -17,7 +16,6 @@ export async function trackToolUsage(toolName, meta) {
17
16
  };
18
17
  const accountId = getConfigDefaultAccountIfExists()?.accountId || undefined;
19
18
  try {
20
- uiLogger.info('Tracking tool usage');
21
19
  await trackUsage('cli-interaction', EventClass.INTERACTION, usageTrackingEvent, accountId);
22
20
  }
23
21
  catch (error) { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "8.0.11-experimental.1",
3
+ "version": "8.0.12-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",
@@ -10,25 +10,25 @@
10
10
  "!**/__tests__/**"
11
11
  ],
12
12
  "dependencies": {
13
- "@hubspot/local-dev-lib": "5.3.3",
14
- "@hubspot/project-parsing-lib": "0.14.1-beta.0",
13
+ "@hubspot/local-dev-lib": "0.7.9-experimental.0",
14
+ "@hubspot/project-parsing-lib": "0.16.0",
15
15
  "@hubspot/serverless-dev-runtime": "7.0.7",
16
- "@hubspot/ui-extensions-dev-server": "2.0.4",
16
+ "@hubspot/ui-extensions-dev-server": "2.0.5",
17
17
  "@inquirer/prompts": "7.1.0",
18
- "@modelcontextprotocol/sdk": "1.25.0",
18
+ "@modelcontextprotocol/sdk": "1.29.0",
19
19
  "archiver": "7.0.1",
20
20
  "chalk": "5.4.1",
21
21
  "chokidar": "3.6.0",
22
22
  "cli-cursor": "3.1.0",
23
23
  "cli-progress": "3.12.0",
24
- "express": "4.21.2",
24
+ "express": "4.22.1",
25
25
  "findup-sync": "4.0.0",
26
26
  "fs-extra": "8.1.0",
27
27
  "ink": "6.6.0",
28
28
  "ink-spinner": "5.0.0",
29
29
  "ink-text-input": "6.0.0",
30
- "js-yaml": "4.1.0",
31
- "minimatch": "10.0.1",
30
+ "js-yaml": "4.1.1",
31
+ "minimatch": "10.2.5",
32
32
  "moment": "2.30.1",
33
33
  "open": "7.4.2",
34
34
  "p-queue": "8.1.0",
@@ -59,7 +59,7 @@
59
59
  "@typescript-eslint/eslint-plugin": "^8.30.1",
60
60
  "@typescript-eslint/parser": "^8.11.0",
61
61
  "@vitest/coverage-v8": "^2.1.9",
62
- "axios": "1.14.0",
62
+ "axios": "1.15.2",
63
63
  "eslint": "^8.56.0",
64
64
  "eslint-plugin-import": "^2.31.0",
65
65
  "husky": "^4.3.8",
@@ -77,7 +77,7 @@
77
77
  "build": "tsx ./scripts/build.ts",
78
78
  "build-docker": "docker image build --tag hs-cli-image . && docker image prune -f",
79
79
  "circular-deps": "yarn madge --circular .",
80
- "debug-mcp": "yarn build && npx @modelcontextprotocol/inspector node dist/mcp-server/server.js",
80
+ "debug-mcp": "yarn build && npx --yes @modelcontextprotocol/inspector node dist/mcp-server/server.js",
81
81
  "hs": "yarn build && node ./dist/bin/hs",
82
82
  "hs-debug": "yarn build && NODE_DEBUG=http* node --inspect-brk ./dist/bin/hs",
83
83
  "hs-proxy": "yarn build && HTTPS_PROXY=http://localhost:8181 NODE_TLS_REJECT_UNAUTHORIZED=0 node ./dist/bin/hs",
@@ -0,0 +1,27 @@
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 type ActionResult = {
13
+ status: 'success';
14
+ settings: HsSettingsFile;
15
+ } | {
16
+ status: 'error';
17
+ reason: string;
18
+ } | {
19
+ status: 'noop';
20
+ };
21
+ export type ActionHandlerParams = {
22
+ state: HsSettingsFile;
23
+ context: LinkContext;
24
+ args: ArgumentsCamelCase<LinkArgs>;
25
+ };
26
+ export type ActionHandler = (params: ActionHandlerParams) => Promise<ActionResult>;
27
+ export type ActionName = 'link' | 'unlink' | 'authenticate' | 'cancel';
package/types/Link.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -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;
@@ -1,9 +0,0 @@
1
- /**
2
- * Used to surface warnings when users attempt to interact with new platform versions
3
- * that were released after this version of the CLI was released.
4
- *
5
- * We are unable to reliably support versions of projects that are newer than any given CLI release
6
- * */
7
- export declare const LATEST_SUPPORTED_PLATFORM_VERSION = "2026.03";
8
- export declare function isV2Project(platformVersion?: string | null): boolean;
9
- export declare function isUnsupportedPlatformVersion(platformVersion?: string | null): boolean;
@@ -1,39 +0,0 @@
1
- /**
2
- * Used to surface warnings when users attempt to interact with new platform versions
3
- * that were released after this version of the CLI was released.
4
- *
5
- * We are unable to reliably support versions of projects that are newer than any given CLI release
6
- * */
7
- export const LATEST_SUPPORTED_PLATFORM_VERSION = '2026.03';
8
- function parsePlatformVersion(platformVersion) {
9
- const [year, minor] = platformVersion.split(/[.-]/);
10
- return {
11
- year: Number(year),
12
- minor: Number(minor),
13
- };
14
- }
15
- export function isV2Project(platformVersion) {
16
- if (!platformVersion || typeof platformVersion !== 'string') {
17
- return false;
18
- }
19
- if (platformVersion.toLowerCase() === 'unstable') {
20
- return true;
21
- }
22
- const { year, minor } = parsePlatformVersion(platformVersion);
23
- return (year === 2025 && minor >= 2) || year > 2025;
24
- }
25
- export function isUnsupportedPlatformVersion(platformVersion) {
26
- if (!platformVersion || typeof platformVersion !== 'string') {
27
- return false;
28
- }
29
- if (platformVersion.toLowerCase() === 'unstable') {
30
- return false;
31
- }
32
- const { year, minor } = parsePlatformVersion(platformVersion);
33
- if (isNaN(year) || isNaN(minor)) {
34
- return false;
35
- }
36
- const { year: latestSupportedYear, minor: latestSupportedMinor } = parsePlatformVersion(LATEST_SUPPORTED_PLATFORM_VERSION);
37
- return (year > latestSupportedYear ||
38
- (year === latestSupportedYear && minor > latestSupportedMinor));
39
- }