@hubspot/cli 8.0.3-experimental.0 → 8.1.0-beta.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.
@@ -5,26 +5,9 @@ declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteProjectPath: z.ZodString;
6
6
  absoluteCurrentWorkingDirectory: z.ZodString;
7
7
  addApp: z.ZodBoolean;
8
- distribution: z.ZodOptional<z.ZodEnum<{
9
- marketplace: "marketplace";
10
- private: "private";
11
- }>>;
12
- auth: z.ZodOptional<z.ZodEnum<{
13
- oauth: "oauth";
14
- static: "static";
15
- }>>;
16
- features: z.ZodOptional<z.ZodArray<z.ZodEnum<{
17
- card: "card";
18
- settings: "settings";
19
- "app-event": "app-event";
20
- page: "page";
21
- "workflow-action-tool": "workflow-action-tool";
22
- webhooks: "webhooks";
23
- "workflow-action": "workflow-action";
24
- "app-function": "app-function";
25
- "app-object": "app-object";
26
- scim: "scim";
27
- }>>>;
8
+ distribution: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"marketplace">, z.ZodLiteral<"private">]>>;
9
+ auth: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"static">, z.ZodLiteral<"oauth">]>>;
10
+ features: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">, z.ZodLiteral<"workflow-action">, z.ZodLiteral<"workflow-action-tool">, z.ZodLiteral<"app-object">, z.ZodLiteral<"app-event">, z.ZodLiteral<"scim">, z.ZodLiteral<"page">]>>>;
28
11
  }, z.core.$strip>;
29
12
  export type AddFeatureInputSchema = z.infer<typeof inputSchemaZodObject>;
30
13
  export declare class AddFeatureToProjectTool extends Tool<AddFeatureInputSchema> {
@@ -15,13 +15,17 @@ const inputSchema = {
15
15
  .boolean()
16
16
  .describe('Should an app be added? If there is no app in the project, an app must be added to add a feature'),
17
17
  distribution: z
18
- .enum([APP_DISTRIBUTION_TYPES.MARKETPLACE, APP_DISTRIBUTION_TYPES.PRIVATE])
19
- .describe('If not specified by the user, DO NOT choose for them. This cannot be changed after a project is uploaded. Private is used if you do not wish to distribute your app on the HubSpot marketplace. ')
20
- .optional(),
18
+ .optional(z.union([
19
+ z.literal(APP_DISTRIBUTION_TYPES.MARKETPLACE),
20
+ z.literal(APP_DISTRIBUTION_TYPES.PRIVATE),
21
+ ]))
22
+ .describe('If not specified by the user, DO NOT choose for them. This cannot be changed after a project is uploaded. Private is used if you do not wish to distribute your app on the HubSpot marketplace. '),
21
23
  auth: z
22
- .enum([APP_AUTH_TYPES.STATIC, APP_AUTH_TYPES.OAUTH])
23
- .describe('If not specified by the user, DO NOT choose for them. This cannot be changed after a project is uploaded. Static uses a static non changing authentication token, and is only available for private distribution. ')
24
- .optional(),
24
+ .optional(z.union([
25
+ z.literal(APP_AUTH_TYPES.STATIC),
26
+ z.literal(APP_AUTH_TYPES.OAUTH),
27
+ ]))
28
+ .describe('If not specified by the user, DO NOT choose for them. This cannot be changed after a project is uploaded. Static uses a static non changing authentication token, and is only available for private distribution. '),
25
29
  features,
26
30
  };
27
31
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -5,30 +5,10 @@ declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteCurrentWorkingDirectory: z.ZodString;
6
6
  name: z.ZodOptional<z.ZodString>;
7
7
  destination: z.ZodString;
8
- projectBase: z.ZodEnum<{
9
- app: "app";
10
- empty: "empty";
11
- }>;
12
- distribution: z.ZodOptional<z.ZodEnum<{
13
- marketplace: "marketplace";
14
- private: "private";
15
- }>>;
16
- auth: z.ZodOptional<z.ZodEnum<{
17
- oauth: "oauth";
18
- static: "static";
19
- }>>;
20
- features: z.ZodOptional<z.ZodArray<z.ZodEnum<{
21
- card: "card";
22
- settings: "settings";
23
- "app-event": "app-event";
24
- page: "page";
25
- "workflow-action-tool": "workflow-action-tool";
26
- webhooks: "webhooks";
27
- "workflow-action": "workflow-action";
28
- "app-function": "app-function";
29
- "app-object": "app-object";
30
- scim: "scim";
31
- }>>>;
8
+ projectBase: z.ZodUnion<readonly [z.ZodLiteral<"empty">, z.ZodLiteral<"app">]>;
9
+ distribution: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"marketplace">, z.ZodLiteral<"private">]>>;
10
+ auth: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"static">, z.ZodLiteral<"oauth">]>>>;
11
+ features: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">, z.ZodLiteral<"workflow-action">, z.ZodLiteral<"workflow-action-tool">, z.ZodLiteral<"app-object">, z.ZodLiteral<"app-event">, z.ZodLiteral<"scim">, z.ZodLiteral<"page">]>>>;
32
12
  }, z.core.$strip>;
33
13
  export type CreateProjectInputSchema = z.infer<typeof inputSchemaZodObject>;
34
14
  export declare class CreateProjectTool extends Tool<CreateProjectInputSchema> {
@@ -18,14 +18,19 @@ const inputSchema = {
18
18
  .string()
19
19
  .describe('DO NOT use the current directory unless the user has explicitly stated to do so. Relative path to the directory the project will be created in.'),
20
20
  projectBase: z
21
- .enum([EMPTY_PROJECT, PROJECT_WITH_APP])
21
+ .union([z.literal(EMPTY_PROJECT), z.literal(PROJECT_WITH_APP)])
22
22
  .describe('Empty will create an empty project, and app will create a project with an app inside of it.'),
23
23
  distribution: z
24
- .enum([APP_DISTRIBUTION_TYPES.MARKETPLACE, APP_DISTRIBUTION_TYPES.PRIVATE])
25
- .describe('If not specified by the user, DO NOT choose for them. This cannot be changed after a project is uploaded. Private is used if you do not wish to distribute your app on the HubSpot marketplace. ')
26
- .optional(),
24
+ .optional(z.union([
25
+ z.literal(APP_DISTRIBUTION_TYPES.MARKETPLACE),
26
+ z.literal(APP_DISTRIBUTION_TYPES.PRIVATE),
27
+ ]))
28
+ .describe('If not specified by the user, DO NOT choose for them. This cannot be changed after a project is uploaded. Private is used if you do not wish to distribute your app on the HubSpot marketplace. '),
27
29
  auth: z
28
- .enum([APP_AUTH_TYPES.STATIC, APP_AUTH_TYPES.OAUTH])
30
+ .optional(z.union([
31
+ z.literal(APP_AUTH_TYPES.STATIC),
32
+ z.literal(APP_AUTH_TYPES.OAUTH),
33
+ ]))
29
34
  .describe('If not specified by the user, DO NOT choose for them. This cannot be changed after a project is uploaded. Static uses a static non changing authentication token, and is only available for private distribution. ')
30
35
  .optional(),
31
36
  features,
@@ -12,15 +12,18 @@ const inputSchema = {
12
12
  absoluteCurrentWorkingDirectory,
13
13
  appId: z
14
14
  .string()
15
- .describe('The numeric app ID as a string (e.g., "3003909"). Must contain only digits. Use get-apps-info to find available app IDs.'),
15
+ .regex(/^\d+$/, 'App ID must be a numeric string')
16
+ .describe('The numeric app ID as a string (e.g., "3003909"). Use get-apps-info to find available app IDs.'),
16
17
  startDate: z
17
18
  .string()
18
- .describe('Start date for the usage patterns query in YYYY-MM-DD format (e.g., 2025-01-01).')
19
- .optional(),
19
+ .regex(/^\d{4}-\d{2}-\d{2}$/, 'Start date must be in YYYY-MM-DD format')
20
+ .optional()
21
+ .describe('Start date for the usage patterns query in ISO 8601 format (e.g., 2025-01-01).'),
20
22
  endDate: z
21
23
  .string()
22
- .describe('End date for the usage patterns query in YYYY-MM-DD format (e.g., 2025-12-31).')
23
- .optional(),
24
+ .regex(/^\d{4}-\d{2}-\d{2}$/, 'End date must be in YYYY-MM-DD format')
25
+ .optional()
26
+ .describe('End date for the usage patterns query in ISO 8601 format (e.g., 2025-12-31).'),
24
27
  };
25
28
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
26
29
  const inputSchemaZodObject = z.object({ ...inputSchema });
@@ -5,12 +5,12 @@ declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteProjectPath: z.ZodString;
6
6
  absoluteCurrentWorkingDirectory: z.ZodString;
7
7
  buildId: z.ZodNumber;
8
- logLevel: z.ZodOptional<z.ZodEnum<{
8
+ logLevel: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
9
9
  ERROR: "ERROR";
10
10
  WARN: "WARN";
11
11
  INFO: "INFO";
12
12
  ALL: "ALL";
13
- }>>;
13
+ }>>>;
14
14
  }, z.core.$strip>;
15
15
  export type GetBuildLogsInputSchema = z.infer<typeof inputSchemaZodObject>;
16
16
  export declare class GetBuildLogsTool extends Tool<GetBuildLogsInputSchema> {
@@ -18,8 +18,9 @@ const inputSchema = {
18
18
  .describe('Build ID to fetch logs for. Use get-build-status to find recent build IDs.'),
19
19
  logLevel: z
20
20
  .enum(['ERROR', 'WARN', 'INFO', 'ALL'])
21
- .describe('Filter logs by level. ERROR: Show only errors, WARN: Show only warnings, INFO: Show only info, ALL: Show all logs. Defaults to ALL if not specified.')
22
- .optional(),
21
+ .optional()
22
+ .default('ALL')
23
+ .describe('Filter logs by level. ERROR: Show only errors, WARN: Show only warnings, INFO: Show only info, ALL: Show all logs.'),
23
24
  };
24
25
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
25
26
  const inputSchemaZodObject = z.object({ ...inputSchema });
@@ -84,7 +85,7 @@ export class GetBuildLogsTool extends Tool {
84
85
  if (allLogs.length === 0) {
85
86
  return formatTextContents(absoluteCurrentWorkingDirectory, `No logs found for build #${buildId} in project '${projectName}'.`);
86
87
  }
87
- const filteredLogs = filterLogsByLevel(allLogs, logLevel || 'ALL');
88
+ const filteredLogs = filterLogsByLevel(allLogs, logLevel);
88
89
  let output;
89
90
  if (filteredLogs.length === 0) {
90
91
  // No logs match filter, show all logs instead
@@ -5,7 +5,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteProjectPath: z.ZodString;
6
6
  absoluteCurrentWorkingDirectory: z.ZodString;
7
7
  buildId: z.ZodOptional<z.ZodNumber>;
8
- limit: z.ZodOptional<z.ZodNumber>;
8
+ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
9
9
  }, z.core.$strip>;
10
10
  export type GetBuildStatusInputSchema = z.infer<typeof inputSchemaZodObject>;
11
11
  export declare class GetBuildStatusTool extends Tool<GetBuildStatusInputSchema> {
@@ -19,8 +19,9 @@ const inputSchema = {
19
19
  .describe('Optional: Specific build ID to inspect. If omitted, shows recent builds to help identify the latest build.'),
20
20
  limit: z
21
21
  .number()
22
- .describe('Number of recent builds to fetch when buildId is not specified. Defaults to 3 if not specified.')
23
- .optional(),
22
+ .optional()
23
+ .default(3)
24
+ .describe('Number of recent builds to fetch when buildId is not specified.'),
24
25
  };
25
26
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
26
27
  const inputSchemaZodObject = z.object({ ...inputSchema });
@@ -126,7 +127,7 @@ export class GetBuildStatusTool extends Tool {
126
127
  }
127
128
  else {
128
129
  const response = await fetchProjectBuilds(accountId, projectName, {
129
- limit: limit || 3,
130
+ limit,
130
131
  });
131
132
  const { results } = response.data;
132
133
  if (!results || results.length === 0) {
@@ -3,12 +3,7 @@ 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
- command: z.ZodOptional<z.ZodEnum<{
7
- "hs auth": "hs auth";
8
- "hs project create": "hs project create";
9
- "hs project upload": "hs project upload";
10
- "hs init": "hs init";
11
- }>>;
6
+ command: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"hs init">, z.ZodLiteral<"hs auth">, z.ZodLiteral<"hs project create">, z.ZodLiteral<"hs project upload">]>>;
12
7
  }, z.core.$strip>;
13
8
  type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
14
9
  export declare class GuidedWalkthroughTool extends Tool<InputSchemaType> {
@@ -14,7 +14,12 @@ const nextCommands = {
14
14
  const inputSchema = {
15
15
  absoluteCurrentWorkingDirectory,
16
16
  command: z
17
- .enum(['hs init', 'hs auth', 'hs project create', 'hs project upload'])
17
+ .union([
18
+ z.literal('hs init'),
19
+ z.literal('hs auth'),
20
+ z.literal('hs project create'),
21
+ z.literal('hs project upload'),
22
+ ])
18
23
  .describe('The command to learn more about. Start with `hs init`')
19
24
  .optional(),
20
25
  };
@@ -1,17 +1,6 @@
1
1
  import z from 'zod';
2
2
  export declare const absoluteProjectPath: z.ZodString;
3
3
  export declare const absoluteCurrentWorkingDirectory: z.ZodString;
4
- export declare const features: z.ZodOptional<z.ZodArray<z.ZodEnum<{
5
- card: "card";
6
- settings: "settings";
7
- "app-event": "app-event";
8
- page: "page";
9
- "workflow-action-tool": "workflow-action-tool";
10
- webhooks: "webhooks";
11
- "workflow-action": "workflow-action";
12
- "app-function": "app-function";
13
- "app-object": "app-object";
14
- scim: "scim";
15
- }>>>;
4
+ export declare const features: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">, z.ZodLiteral<"workflow-action">, z.ZodLiteral<"workflow-action-tool">, z.ZodLiteral<"app-object">, z.ZodLiteral<"app-event">, z.ZodLiteral<"scim">, z.ZodLiteral<"page">]>>>;
16
5
  export declare const docsSearchQuery: z.ZodString;
17
6
  export declare const docUrl: z.ZodString;
@@ -6,19 +6,23 @@ export const absoluteCurrentWorkingDirectory = z
6
6
  .string()
7
7
  .describe('The absolute path to the current working directory.');
8
8
  export const features = z
9
- .array(z.enum([
10
- 'card',
11
- 'settings',
12
- 'app-function',
13
- 'webhooks',
14
- 'workflow-action',
15
- 'workflow-action-tool',
16
- 'app-object',
17
- 'app-event',
18
- 'scim',
19
- 'page',
9
+ .array(z.union([
10
+ z.literal('card'),
11
+ z.literal('settings'),
12
+ z
13
+ .literal('app-function')
14
+ .describe('Also known as a public serverless function'),
15
+ z.literal('webhooks'),
16
+ z
17
+ .literal('workflow-action')
18
+ .describe('Also known as a custom workflow action.'),
19
+ z.literal('workflow-action-tool').describe('Also known as agent tools.'),
20
+ z.literal('app-object'),
21
+ z.literal('app-event'),
22
+ z.literal('scim'),
23
+ z.literal('page'),
20
24
  ]))
21
- .describe('The features to include in the project, multiple options can be selected. "app-function" is also known as a public serverless function. "workflow-action" is also known as a custom workflow action. "workflow-action-tool" is also known as agent tools.')
25
+ .describe('The features to include in the project, multiple options can be selected')
22
26
  .optional();
23
27
  export const docsSearchQuery = z
24
28
  .string()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "8.0.3-experimental.0",
3
+ "version": "8.1.0-beta.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",