@hubspot/cli 7.7.7-experimental.0 → 7.7.9-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.
@@ -1,5 +1,17 @@
1
- import { Tool } from '../../types';
1
+ import { TextContentResponse, Tool } from '../../types';
2
2
  import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
3
- export declare class UploadProjectTools extends Tool {
4
- static register(mcpServer: McpServer): RegisteredTool;
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
+ type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
12
+ export declare class UploadProjectTools extends Tool<InputSchemaType> {
13
+ constructor(mcpServer: McpServer);
14
+ handler({ absoluteProjectPath, }: InputSchemaType): Promise<TextContentResponse>;
15
+ register(): RegisteredTool;
5
16
  }
17
+ export {};
@@ -1,26 +1,39 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.UploadProjectTools = void 0;
4
7
  const types_1 = require("../../types");
5
8
  const project_1 = require("../../utils/project");
6
9
  const constants_1 = require("./constants");
10
+ const zod_1 = __importDefault(require("zod"));
11
+ const inputSchema = {
12
+ absoluteProjectPath: constants_1.absoluteProjectPath,
13
+ };
14
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
15
+ const inputSchemaZodObject = zod_1.default.object({
16
+ ...inputSchema,
17
+ });
7
18
  class UploadProjectTools extends types_1.Tool {
8
- static register(mcpServer) {
9
- return mcpServer.registerTool('upload-hubspot-project', {
19
+ constructor(mcpServer) {
20
+ super(mcpServer);
21
+ }
22
+ async handler({ absoluteProjectPath, }) {
23
+ 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
+ };
30
+ }
31
+ register() {
32
+ return this.mcpServer.registerTool('upload-hubspot-project', {
10
33
  title: 'Upload HubSpot Project',
11
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.',
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
- });
35
+ inputSchema,
36
+ }, this.handler);
24
37
  }
25
38
  }
26
39
  exports.UploadProjectTools = UploadProjectTools;
@@ -1,8 +1,14 @@
1
1
  import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- export declare class Tool {
3
- static register: (McpServer: McpServer) => RegisteredTool;
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>;
4
7
  }
5
- export type Content = {
8
+ export type TextContent = {
6
9
  type: 'text';
7
10
  text: string;
8
11
  };
12
+ export type TextContentResponse = {
13
+ content: TextContent[];
14
+ };
@@ -2,6 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Tool = void 0;
4
4
  class Tool {
5
- static register;
5
+ mcpServer;
6
+ constructor(mcpServer) {
7
+ this.mcpServer = mcpServer;
8
+ }
9
+ register() {
10
+ throw new Error('Must implement register');
11
+ }
12
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
13
+ handler(input) {
14
+ throw new Error('Must implement handler');
15
+ }
6
16
  }
7
17
  exports.Tool = Tool;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "7.7.7-experimental.0",
3
+ "version": "7.7.9-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",