@hubspot/cli 7.9.0-experimental.0 → 7.9.1-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 (196) hide show
  1. package/bin/cli.js +5 -4
  2. package/commands/__tests__/getStarted.test.js +10 -0
  3. package/commands/account/__tests__/rename.test.js +42 -0
  4. package/commands/account/auth.js +10 -14
  5. package/commands/account/clean.js +11 -19
  6. package/commands/account/createOverride.js +15 -11
  7. package/commands/account/info.js +8 -5
  8. package/commands/account/list.js +13 -18
  9. package/commands/account/remove.js +23 -22
  10. package/commands/account/removeOverride.js +6 -6
  11. package/commands/account/rename.d.ts +1 -1
  12. package/commands/account/rename.js +6 -3
  13. package/commands/account/use.js +19 -8
  14. package/commands/app/__tests__/migrate.test.js +8 -4
  15. package/commands/app/migrate.js +2 -2
  16. package/commands/auth.js +18 -14
  17. package/commands/config/migrate.js +5 -5
  18. package/commands/config/set.js +1 -2
  19. package/commands/customObject/createSchema.js +2 -3
  20. package/commands/customObject/updateSchema.js +2 -3
  21. package/commands/getStarted.js +10 -5
  22. package/commands/hubdb/__tests__/list.test.js +1 -0
  23. package/commands/hubdb/list.js +2 -2
  24. package/commands/hubdb.d.ts +1 -1
  25. package/commands/init.js +36 -32
  26. package/commands/project/__tests__/deploy.test.js +10 -5
  27. package/commands/project/__tests__/devUnifiedFlow.test.js +6 -4
  28. package/commands/project/__tests__/logs.test.js +4 -0
  29. package/commands/project/__tests__/validate.test.js +2 -2
  30. package/commands/project/cloneApp.js +2 -2
  31. package/commands/project/deploy.js +2 -2
  32. package/commands/project/dev/deprecatedFlow.js +4 -5
  33. package/commands/project/dev/index.js +14 -4
  34. package/commands/project/dev/unifiedFlow.js +4 -5
  35. package/commands/project/listBuilds.js +7 -1
  36. package/commands/project/logs.js +2 -3
  37. package/commands/project/profile/add.js +6 -7
  38. package/commands/project/profile/delete.js +2 -2
  39. package/commands/project/upload.js +9 -3
  40. package/commands/project/validate.js +9 -3
  41. package/commands/project/watch.js +7 -2
  42. package/commands/sandbox/__tests__/create.test.js +14 -5
  43. package/commands/sandbox/create.js +4 -5
  44. package/commands/sandbox/delete.js +23 -20
  45. package/commands/testAccount/__tests__/create.test.js +68 -0
  46. package/commands/testAccount/create.d.ts +8 -0
  47. package/commands/testAccount/create.js +134 -44
  48. package/commands/testAccount/delete.js +9 -8
  49. package/commands/testAccount/importData.d.ts +1 -1
  50. package/lang/en.d.ts +3204 -3205
  51. package/lang/en.js +33 -9
  52. package/lib/__tests__/buildAccount.test.js +22 -30
  53. package/lib/__tests__/commonOpts.test.js +9 -13
  54. package/lib/__tests__/developerTestAccounts.test.js +29 -17
  55. package/lib/__tests__/importData.test.js +20 -10
  56. package/lib/__tests__/oauth.test.js +19 -8
  57. package/lib/__tests__/sandboxSync.test.js +33 -11
  58. package/lib/__tests__/sandboxes.test.js +30 -19
  59. package/lib/__tests__/usageTracking.test.js +10 -10
  60. package/lib/__tests__/validation.test.js +32 -32
  61. package/lib/accountTypes.d.ts +9 -9
  62. package/lib/accountTypes.js +2 -4
  63. package/lib/app/__tests__/migrate.test.js +15 -0
  64. package/lib/app/__tests__/migrate_legacy.test.js +9 -0
  65. package/lib/app/migrate_legacy.d.ts +2 -2
  66. package/lib/buildAccount.d.ts +4 -4
  67. package/lib/buildAccount.js +7 -14
  68. package/lib/commonOpts.js +3 -3
  69. package/lib/configMigrate.d.ts +2 -2
  70. package/lib/configMigrate.js +42 -18
  71. package/lib/configOptions.js +3 -2
  72. package/lib/constants.d.ts +1 -0
  73. package/lib/constants.js +6 -0
  74. package/lib/developerTestAccounts.d.ts +3 -3
  75. package/lib/developerTestAccounts.js +4 -7
  76. package/lib/doctor/DiagnosticInfoBuilder.d.ts +1 -1
  77. package/lib/doctor/DiagnosticInfoBuilder.js +9 -6
  78. package/lib/doctor/Doctor.js +4 -3
  79. package/lib/doctor/__tests__/Diagnosis.test.js +4 -3
  80. package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.js +17 -9
  81. package/lib/doctor/__tests__/Doctor.test.js +14 -0
  82. package/lib/importData.js +8 -7
  83. package/lib/links.js +5 -5
  84. package/lib/mcp/__tests__/setup.test.js +127 -0
  85. package/lib/mcp/setup.d.ts +4 -12
  86. package/lib/mcp/setup.js +34 -1
  87. package/lib/middleware/__test__/commandTargetingUtils.test.js +3 -3
  88. package/lib/middleware/__test__/configMiddleware.test.js +23 -22
  89. package/lib/middleware/__test__/gitMiddleware.test.js +9 -7
  90. package/lib/middleware/autoUpdateMiddleware.d.ts +3 -1
  91. package/lib/middleware/autoUpdateMiddleware.js +10 -2
  92. package/lib/middleware/commandTargetingUtils.js +2 -2
  93. package/lib/middleware/configMiddleware.d.ts +6 -1
  94. package/lib/middleware/configMiddleware.js +36 -15
  95. package/lib/middleware/gitMiddleware.js +8 -4
  96. package/lib/oauth.d.ts +2 -2
  97. package/lib/oauth.js +8 -10
  98. package/lib/projects/__tests__/AppDevModeInterface.test.js +17 -6
  99. package/lib/projects/__tests__/DevServerManager.test.js +1 -0
  100. package/lib/projects/__tests__/LocalDevProcess.test.js +1 -0
  101. package/lib/projects/__tests__/components.test.js +148 -24
  102. package/lib/projects/__tests__/deploy.test.js +1 -0
  103. package/lib/projects/__tests__/projects.test.js +13 -42
  104. package/lib/projects/components.js +76 -20
  105. package/lib/projects/config.js +5 -9
  106. package/lib/projects/create/__tests__/v2.test.js +11 -0
  107. package/lib/projects/localDev/AppDevModeInterface.js +2 -2
  108. package/lib/projects/localDev/DevServerManager_DEPRECATED.js +2 -2
  109. package/lib/projects/localDev/LocalDevLogger.js +4 -4
  110. package/lib/projects/localDev/LocalDevManager_DEPRECATED.js +3 -3
  111. package/lib/projects/localDev/helpers/account.d.ts +10 -10
  112. package/lib/projects/localDev/helpers/account.js +6 -11
  113. package/lib/projects/urls.js +5 -6
  114. package/lib/prompts/__tests__/createDeveloperTestAccountConfigPrompt.test.d.ts +1 -0
  115. package/lib/prompts/__tests__/createDeveloperTestAccountConfigPrompt.test.js +153 -0
  116. package/lib/prompts/__tests__/downloadProjectPrompt.test.js +7 -5
  117. package/lib/prompts/accountNamePrompt.js +3 -3
  118. package/lib/prompts/accountsPrompt.d.ts +1 -1
  119. package/lib/prompts/accountsPrompt.js +6 -7
  120. package/lib/prompts/confirmImportDataPrompt.js +2 -2
  121. package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +5 -0
  122. package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +76 -66
  123. package/lib/prompts/downloadProjectPrompt.d.ts +1 -0
  124. package/lib/prompts/downloadProjectPrompt.js +5 -2
  125. package/lib/prompts/importDataTestAccountSelectPrompt.js +4 -5
  126. package/lib/prompts/personalAccessKeyPrompt.js +2 -2
  127. package/lib/prompts/projectDevTargetAccountPrompt.d.ts +3 -3
  128. package/lib/prompts/projectDevTargetAccountPrompt.js +5 -7
  129. package/lib/prompts/sandboxesPrompt.js +7 -8
  130. package/lib/prompts/setAsDefaultAccountPrompt.js +7 -6
  131. package/lib/sandboxSync.d.ts +2 -2
  132. package/lib/sandboxSync.js +3 -9
  133. package/lib/sandboxes.d.ts +4 -4
  134. package/lib/sandboxes.js +6 -11
  135. package/lib/serverlessLogs.js +2 -2
  136. package/lib/theme/__tests__/migrate.test.js +15 -0
  137. package/lib/ui/index.js +6 -3
  138. package/lib/usageTracking.js +15 -8
  139. package/lib/validation.js +13 -11
  140. package/mcp-server/tools/cms/HsCreateFunctionTool.js +8 -2
  141. package/mcp-server/tools/cms/HsCreateModuleTool.d.ts +4 -4
  142. package/mcp-server/tools/cms/HsCreateModuleTool.js +8 -2
  143. package/mcp-server/tools/cms/HsCreateTemplateTool.js +8 -2
  144. package/mcp-server/tools/cms/HsFunctionLogsTool.d.ts +4 -4
  145. package/mcp-server/tools/cms/HsFunctionLogsTool.js +6 -2
  146. package/mcp-server/tools/cms/HsListFunctionsTool.js +5 -1
  147. package/mcp-server/tools/cms/HsListTool.js +5 -1
  148. package/mcp-server/tools/cms/__tests__/HsCreateFunctionTool.test.js +1 -0
  149. package/mcp-server/tools/index.js +4 -0
  150. package/mcp-server/tools/project/AddFeatureToProjectTool.d.ts +1 -1
  151. package/mcp-server/tools/project/AddFeatureToProjectTool.js +9 -3
  152. package/mcp-server/tools/project/CreateProjectTool.js +8 -2
  153. package/mcp-server/tools/project/CreateTestAccountTool.d.ts +41 -0
  154. package/mcp-server/tools/project/CreateTestAccountTool.js +150 -0
  155. package/mcp-server/tools/project/DeployProjectTool.d.ts +1 -1
  156. package/mcp-server/tools/project/DeployProjectTool.js +8 -2
  157. package/mcp-server/tools/project/DocFetchTool.d.ts +1 -1
  158. package/mcp-server/tools/project/DocFetchTool.js +9 -5
  159. package/mcp-server/tools/project/DocsSearchTool.d.ts +1 -1
  160. package/mcp-server/tools/project/DocsSearchTool.js +12 -8
  161. package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.d.ts +1 -1
  162. package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.js +11 -7
  163. package/mcp-server/tools/project/GetApplicationInfoTool.d.ts +1 -1
  164. package/mcp-server/tools/project/GetApplicationInfoTool.js +11 -7
  165. package/mcp-server/tools/project/GetBuildStatusTool.d.ts +26 -0
  166. package/mcp-server/tools/project/GetBuildStatusTool.js +164 -0
  167. package/mcp-server/tools/project/GetConfigValuesTool.d.ts +1 -1
  168. package/mcp-server/tools/project/GetConfigValuesTool.js +11 -7
  169. package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +1 -1
  170. package/mcp-server/tools/project/GuidedWalkthroughTool.js +7 -3
  171. package/mcp-server/tools/project/UploadProjectTools.d.ts +9 -3
  172. package/mcp-server/tools/project/UploadProjectTools.js +51 -5
  173. package/mcp-server/tools/project/ValidateProjectTool.d.ts +1 -1
  174. package/mcp-server/tools/project/ValidateProjectTool.js +7 -3
  175. package/mcp-server/tools/project/__tests__/CreateTestAccountTool.test.d.ts +1 -0
  176. package/mcp-server/tools/project/__tests__/CreateTestAccountTool.test.js +454 -0
  177. package/mcp-server/tools/project/__tests__/DocFetchTool.test.js +5 -1
  178. package/mcp-server/tools/project/__tests__/DocsSearchTool.test.js +25 -13
  179. package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.js +7 -5
  180. package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.js +7 -5
  181. package/mcp-server/tools/project/__tests__/GetBuildStatusTool.test.d.ts +1 -0
  182. package/mcp-server/tools/project/__tests__/GetBuildStatusTool.test.js +240 -0
  183. package/mcp-server/tools/project/__tests__/GetConfigValuesTool.test.js +8 -6
  184. package/mcp-server/tools/project/__tests__/UploadProjectTools.test.js +56 -4
  185. package/mcp-server/utils/__tests__/content.test.js +21 -20
  186. package/mcp-server/utils/__tests__/feedbackTracking.test.js +33 -28
  187. package/mcp-server/utils/content.d.ts +1 -1
  188. package/mcp-server/utils/content.js +2 -2
  189. package/mcp-server/utils/feedbackTracking.d.ts +1 -1
  190. package/mcp-server/utils/feedbackTracking.js +3 -3
  191. package/mcp-server/utils/toolUsageTracking.js +4 -3
  192. package/package.json +8 -7
  193. package/mcp-server/utils/__tests__/cliConfig.test.js +0 -110
  194. package/mcp-server/utils/cliConfig.d.ts +0 -1
  195. package/mcp-server/utils/cliConfig.js +0 -12
  196. /package/{mcp-server/utils/__tests__/cliConfig.test.d.ts → lib/mcp/__tests__/setup.test.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { GetApiUsagePatternsByAppIdTool } from '../GetApiUsagePatternsByAppIdTool.js';
2
2
  import { z } from 'zod';
3
- import { getAccountId } from '@hubspot/local-dev-lib/config';
3
+ import { getConfigDefaultAccountIfExists } from '@hubspot/local-dev-lib/config';
4
4
  import { http } from '@hubspot/local-dev-lib/http';
5
5
  import { isHubSpotHttpError } from '@hubspot/local-dev-lib/errors/index';
6
6
  import { mcpFeedbackRequest } from '../../../utils/feedbackTracking.js';
@@ -11,7 +11,7 @@ vi.mock('@hubspot/local-dev-lib/errors/index');
11
11
  vi.mock('@hubspot/local-dev-lib/config');
12
12
  vi.mock('../../../utils/feedbackTracking');
13
13
  const mockMcpFeedbackRequest = mcpFeedbackRequest;
14
- const mockGetAccountId = getAccountId;
14
+ const mockGetConfigDefaultAccountIfExists = getConfigDefaultAccountIfExists;
15
15
  const mockHttp = http;
16
16
  const mockIsHubSpotHttpError = isHubSpotHttpError;
17
17
  describe('mcp-server/tools/project/GetApiUsagePatternsByAppIdTool', () => {
@@ -89,7 +89,9 @@ describe('mcp-server/tools/project/GetApiUsagePatternsByAppIdTool', () => {
89
89
  endDate: '2025-12-31',
90
90
  };
91
91
  beforeEach(() => {
92
- mockGetAccountId.mockReturnValue(123456789);
92
+ mockGetConfigDefaultAccountIfExists.mockReturnValue({
93
+ accountId: 123456789,
94
+ });
93
95
  mockIsHubSpotHttpError.mockReturnValue(false);
94
96
  });
95
97
  it('should return API usage patterns successfully', async () => {
@@ -118,7 +120,7 @@ describe('mcp-server/tools/project/GetApiUsagePatternsByAppIdTool', () => {
118
120
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
119
121
  mockHttp.get.mockResolvedValue(mockResponse);
120
122
  const result = await tool.handler(input);
121
- expect(mockGetAccountId).toHaveBeenCalledWith();
123
+ expect(mockGetConfigDefaultAccountIfExists).toHaveBeenCalledWith();
122
124
  expect(mockHttp.get).toHaveBeenCalledWith(123456789, {
123
125
  url: 'app/feature/utilization/public/v3/insights/app/12345/usage-patterns',
124
126
  params: {
@@ -136,7 +138,7 @@ describe('mcp-server/tools/project/GetApiUsagePatternsByAppIdTool', () => {
136
138
  });
137
139
  });
138
140
  it('should return error when account ID cannot be determined', async () => {
139
- mockGetAccountId.mockReturnValue(null);
141
+ mockGetConfigDefaultAccountIfExists.mockReturnValue(undefined);
140
142
  const result = await tool.handler(input);
141
143
  expect(result).toEqual({
142
144
  content: [
@@ -1,5 +1,5 @@
1
1
  import { GetApplicationInfoTool } from '../GetApplicationInfoTool.js';
2
- import { getAccountId } from '@hubspot/local-dev-lib/config';
2
+ import { getConfigDefaultAccountIfExists } from '@hubspot/local-dev-lib/config';
3
3
  import { http } from '@hubspot/local-dev-lib/http';
4
4
  import { isHubSpotHttpError } from '@hubspot/local-dev-lib/errors/index';
5
5
  import { mcpFeedbackRequest } from '../../../utils/feedbackTracking.js';
@@ -10,7 +10,7 @@ vi.mock('@hubspot/local-dev-lib/errors/index');
10
10
  vi.mock('@hubspot/local-dev-lib/config');
11
11
  vi.mock('../../../utils/feedbackTracking');
12
12
  const mockMcpFeedbackRequest = mcpFeedbackRequest;
13
- const mockGetAccountId = getAccountId;
13
+ const mockGetConfigDefaultAccountIfExists = getConfigDefaultAccountIfExists;
14
14
  const mockHttp = http;
15
15
  const mockIsHubSpotHttpError = isHubSpotHttpError;
16
16
  describe('mcp-server/tools/project/GetApplicationInfoTool', () => {
@@ -42,7 +42,9 @@ describe('mcp-server/tools/project/GetApplicationInfoTool', () => {
42
42
  describe('handler', () => {
43
43
  const input = { absoluteCurrentWorkingDirectory: '/test/dir' };
44
44
  beforeEach(() => {
45
- mockGetAccountId.mockReturnValue(123456789);
45
+ mockGetConfigDefaultAccountIfExists.mockReturnValue({
46
+ accountId: 123456789,
47
+ });
46
48
  mockIsHubSpotHttpError.mockReturnValue(false);
47
49
  });
48
50
  it('should return application information successfully', async () => {
@@ -67,7 +69,7 @@ describe('mcp-server/tools/project/GetApplicationInfoTool', () => {
67
69
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
70
  mockHttp.get.mockResolvedValue(mockResponse);
69
71
  const result = await tool.handler(input);
70
- expect(mockGetAccountId).toHaveBeenCalledWith();
72
+ expect(mockGetConfigDefaultAccountIfExists).toHaveBeenCalledWith();
71
73
  expect(mockHttp.get).toHaveBeenCalledWith(123456789, {
72
74
  url: 'app/feature/utilization/public/v3/insights/apps',
73
75
  });
@@ -81,7 +83,7 @@ describe('mcp-server/tools/project/GetApplicationInfoTool', () => {
81
83
  });
82
84
  });
83
85
  it('should return error when account ID cannot be determined', async () => {
84
- mockGetAccountId.mockReturnValue(null);
86
+ mockGetConfigDefaultAccountIfExists.mockReturnValue(undefined);
85
87
  const result = await tool.handler(input);
86
88
  expect(result).toEqual({
87
89
  content: [
@@ -0,0 +1,240 @@
1
+ import { GetBuildStatusTool } from '../GetBuildStatusTool.js';
2
+ import { fetchProjectBuilds, getBuildStatus, } from '@hubspot/local-dev-lib/api/projects';
3
+ import { isHubSpotHttpError } from '@hubspot/local-dev-lib/errors/index';
4
+ import { getProjectConfig, validateProjectConfig, } from '../../../../lib/projects/config.js';
5
+ import { mcpFeedbackRequest } from '../../../utils/feedbackTracking.js';
6
+ import { getConfigDefaultAccountIfExists } from '@hubspot/local-dev-lib/config';
7
+ vi.mock('@modelcontextprotocol/sdk/server/mcp.js');
8
+ vi.mock('../../../utils/toolUsageTracking');
9
+ vi.mock('@hubspot/local-dev-lib/api/projects');
10
+ vi.mock('@hubspot/local-dev-lib/errors/index');
11
+ vi.mock('../../../../lib/projects/config.js');
12
+ vi.mock('../../../utils/feedbackTracking');
13
+ vi.mock('@hubspot/local-dev-lib/config');
14
+ const mockMcpFeedbackRequest = mcpFeedbackRequest;
15
+ const mockFetchProjectBuilds = fetchProjectBuilds;
16
+ const mockGetBuildStatus = getBuildStatus;
17
+ const mockIsHubSpotHttpError = isHubSpotHttpError;
18
+ const mockGetProjectConfig = getProjectConfig;
19
+ const mockValidateProjectConfig = validateProjectConfig;
20
+ const mockGetConfigDefaultAccountIfExists = getConfigDefaultAccountIfExists;
21
+ const TEST_ACCOUNT_ID = 123456789;
22
+ const TEST_PROJECT_NAME = 'test-project';
23
+ const TEST_PROJECT_PATH = '/test/project';
24
+ const TEST_WORKING_DIR = '/test';
25
+ const TEST_PLATFORM_VERSION = '2025.2';
26
+ function createMockBuild(overrides = {}) {
27
+ return {
28
+ buildId: 10,
29
+ status: 'FAILURE',
30
+ createdAt: '2025-11-18T21:50:50.632Z',
31
+ enqueuedAt: null,
32
+ finishedAt: '2025-11-20T22:32:07.008Z',
33
+ startedAt: '2025-11-18T21:50:50.632Z',
34
+ subbuildStatuses: [
35
+ {
36
+ buildName: 'my-card',
37
+ buildType: 'CARD',
38
+ status: 'FAILURE',
39
+ errorMessage: 'There were errors building this component:\n - The preview image file /app/cards/assets/preview.png was not found. Make sure the file exists in /app/cards and try again.',
40
+ },
41
+ {
42
+ buildName: 'my-app',
43
+ buildType: 'APPLICATION',
44
+ status: 'SUCCESS',
45
+ errorMessage: '',
46
+ },
47
+ ],
48
+ buildErrorMessage: 'The source code for this project is too large. HubSpot projects have a maximum size limit of 50.0 MB.',
49
+ platformVersion: TEST_PLATFORM_VERSION,
50
+ deployable: true,
51
+ deployableState: 'DEPLOYABLE',
52
+ ...overrides,
53
+ };
54
+ }
55
+ function createMockProjectConfig(overrides = {}) {
56
+ return {
57
+ name: TEST_PROJECT_NAME,
58
+ srcDir: 'src',
59
+ platformVersion: TEST_PLATFORM_VERSION,
60
+ ...overrides,
61
+ };
62
+ }
63
+ function createBuildListResponse(builds) {
64
+ return {
65
+ data: {
66
+ results: builds,
67
+ paging: undefined,
68
+ },
69
+ };
70
+ }
71
+ function createBuildDetailsResponse(build) {
72
+ return {
73
+ data: build,
74
+ };
75
+ }
76
+ function expectTextContent(result, ...expectedStrings) {
77
+ expectedStrings.forEach(str => {
78
+ expect(result.content[1].text).toContain(str);
79
+ });
80
+ }
81
+ describe('mcp-server/tools/project/GetBuildStatusTool', () => {
82
+ let mockMcpServer;
83
+ let tool;
84
+ let mockRegisteredTool;
85
+ beforeEach(() => {
86
+ vi.clearAllMocks();
87
+ // @ts-expect-error Not mocking the whole thing
88
+ mockMcpServer = {
89
+ registerTool: vi.fn(),
90
+ };
91
+ mockRegisteredTool = {};
92
+ mockMcpServer.registerTool.mockReturnValue(mockRegisteredTool);
93
+ mockMcpFeedbackRequest.mockResolvedValue('');
94
+ tool = new GetBuildStatusTool(mockMcpServer);
95
+ // Default mock implementations
96
+ mockIsHubSpotHttpError.mockReturnValue(false);
97
+ mockGetProjectConfig.mockResolvedValue({
98
+ projectConfig: createMockProjectConfig(),
99
+ projectDir: TEST_PROJECT_PATH,
100
+ });
101
+ mockValidateProjectConfig.mockImplementation(() => { });
102
+ mockGetConfigDefaultAccountIfExists.mockReturnValue({
103
+ accountId: TEST_ACCOUNT_ID,
104
+ });
105
+ });
106
+ describe('register', () => {
107
+ it('should register tool with correct parameters', () => {
108
+ const result = tool.register();
109
+ expect(mockMcpServer.registerTool).toHaveBeenCalledWith('get-build-status', expect.objectContaining({
110
+ title: 'Get HubSpot Projects Build Status and Errors',
111
+ description: expect.stringContaining('Retrieves build status and error messages for HubSpot projects'),
112
+ inputSchema: expect.any(Object),
113
+ }), expect.any(Function));
114
+ expect(result).toBe(mockRegisteredTool);
115
+ });
116
+ });
117
+ describe('handler', () => {
118
+ const baseInput = {
119
+ absoluteProjectPath: TEST_PROJECT_PATH,
120
+ absoluteCurrentWorkingDirectory: TEST_WORKING_DIR,
121
+ buildId: undefined,
122
+ limit: 5,
123
+ };
124
+ describe('error handling', () => {
125
+ it('should return error when account ID cannot be determined', async () => {
126
+ mockGetConfigDefaultAccountIfExists.mockReturnValue(undefined);
127
+ const result = await tool.handler(baseInput);
128
+ expect(result).toEqual({
129
+ content: [
130
+ {
131
+ type: 'text',
132
+ text: TEST_WORKING_DIR,
133
+ },
134
+ {
135
+ type: 'text',
136
+ text: 'No account ID found. Please run `hs account auth` to configure an account, or set a default account with `hs account use <account>`',
137
+ },
138
+ ],
139
+ });
140
+ expect(mockFetchProjectBuilds).not.toHaveBeenCalled();
141
+ });
142
+ it('should return error when specific build for provided buildId is not found', async () => {
143
+ const error = new Error('Build not found');
144
+ // @ts-expect-error Adding status property
145
+ error.status = 404;
146
+ mockIsHubSpotHttpError.mockReturnValue(true);
147
+ mockGetBuildStatus.mockRejectedValue(error);
148
+ const result = await tool.handler({ ...baseInput, buildId: 999 });
149
+ expectTextContent(result, 'Build not found');
150
+ });
151
+ it('should handle HubSpot HTTP errors', async () => {
152
+ const error = new Error('API Error');
153
+ mockIsHubSpotHttpError.mockReturnValue(true);
154
+ mockFetchProjectBuilds.mockRejectedValue(error);
155
+ const result = await tool.handler(baseInput);
156
+ expectTextContent(result, 'API Error');
157
+ });
158
+ it('should handle generic errors', async () => {
159
+ const error = new Error('Generic error');
160
+ mockIsHubSpotHttpError.mockReturnValue(false);
161
+ mockFetchProjectBuilds.mockRejectedValue(error);
162
+ const result = await tool.handler(baseInput);
163
+ expectTextContent(result, 'Generic error');
164
+ });
165
+ });
166
+ describe('list view (no buildId)', () => {
167
+ it('should return recent builds when no buildId is provided', async () => {
168
+ const mockBuild = createMockBuild();
169
+ mockFetchProjectBuilds.mockResolvedValue(
170
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
171
+ createBuildListResponse([mockBuild]));
172
+ const result = await tool.handler(baseInput);
173
+ expect(mockGetProjectConfig).toHaveBeenCalledWith(TEST_PROJECT_PATH);
174
+ expect(mockFetchProjectBuilds).toHaveBeenCalledWith(TEST_ACCOUNT_ID, TEST_PROJECT_NAME, { limit: 5 });
175
+ expectTextContent(result, `Recent builds for '${TEST_PROJECT_NAME}':`, 'Build #10 - FAILURE', 'The source code for this project is too large');
176
+ });
177
+ it('should return error when no builds exist', async () => {
178
+ mockFetchProjectBuilds.mockResolvedValue(
179
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
180
+ createBuildListResponse([]));
181
+ const result = await tool.handler(baseInput);
182
+ expectTextContent(result, `No builds found for project '${TEST_PROJECT_NAME}'`);
183
+ });
184
+ it('should handle successful builds', async () => {
185
+ const successBuild = createMockBuild({
186
+ buildId: 11,
187
+ status: 'SUCCESS',
188
+ buildErrorMessage: undefined,
189
+ subbuildStatuses: [
190
+ {
191
+ buildName: 'my-app',
192
+ buildType: 'APPLICATION',
193
+ status: 'SUCCESS',
194
+ errorMessage: '',
195
+ },
196
+ ],
197
+ });
198
+ mockFetchProjectBuilds.mockResolvedValue(
199
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
200
+ createBuildListResponse([successBuild]));
201
+ const result = await tool.handler(baseInput);
202
+ expectTextContent(result, 'Build #11 - SUCCESS ✓');
203
+ expect(result.content[1].text).not.toContain('Error:');
204
+ });
205
+ it('should display all subbuilds (success and failure)', async () => {
206
+ const buildWithSubbuilds = createMockBuild({
207
+ subbuildStatuses: [
208
+ {
209
+ buildName: 'my-webhooks',
210
+ buildType: 'WEBHOOKS',
211
+ status: 'SUCCESS',
212
+ },
213
+ {
214
+ buildName: 'my-app',
215
+ buildType: 'APPLICATION',
216
+ status: 'FAILURE',
217
+ errorMessage: 'Duplicate UID',
218
+ },
219
+ ],
220
+ });
221
+ mockFetchProjectBuilds.mockResolvedValue(
222
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
223
+ createBuildListResponse([buildWithSubbuilds]));
224
+ const result = await tool.handler(baseInput);
225
+ expectTextContent(result, 'Subbuilds:', '✓ my-webhooks (WEBHOOKS): SUCCESS', '⚠️ my-app (APPLICATION): FAILURE', 'Error: Duplicate UID');
226
+ });
227
+ });
228
+ describe('detail view (with buildId)', () => {
229
+ it('should return specific build details when buildId is provided', async () => {
230
+ const mockBuild = createMockBuild();
231
+ mockGetBuildStatus.mockResolvedValue(
232
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
233
+ createBuildDetailsResponse(mockBuild));
234
+ const result = await tool.handler({ ...baseInput, buildId: 10 });
235
+ expect(mockGetBuildStatus).toHaveBeenCalledWith(TEST_ACCOUNT_ID, TEST_PROJECT_NAME, 10);
236
+ expectTextContent(result, 'Build #10 Details', 'Status: FAILURE', `Platform Version: ${TEST_PLATFORM_VERSION}`, 'Build Error:');
237
+ });
238
+ });
239
+ });
240
+ });
@@ -1,16 +1,16 @@
1
1
  import { GetConfigValuesTool } from '../GetConfigValuesTool.js';
2
2
  import { getIntermediateRepresentationSchema, mapToInternalType, } from '@hubspot/project-parsing-lib';
3
- import { getAccountIdFromCliConfig } from '../../../utils/cliConfig.js';
3
+ import { getConfigDefaultAccountIfExists } from '@hubspot/local-dev-lib/config';
4
4
  import { mcpFeedbackRequest } from '../../../utils/feedbackTracking.js';
5
5
  vi.mock('@modelcontextprotocol/sdk/server/mcp.js');
6
6
  vi.mock('@hubspot/project-parsing-lib');
7
- vi.mock('../../../utils/cliConfig.js');
7
+ vi.mock('@hubspot/local-dev-lib/config');
8
8
  vi.mock('../../../utils/toolUsageTracking');
9
9
  vi.mock('../../../utils/feedbackTracking');
10
10
  const mockMcpFeedbackRequest = mcpFeedbackRequest;
11
11
  const mockGetIntermediateRepresentationSchema = getIntermediateRepresentationSchema;
12
12
  const mockMapToInternalType = mapToInternalType;
13
- const mockGetAccountIdFromCliConfig = getAccountIdFromCliConfig;
13
+ const mockGetConfigDefaultAccountIfExists = getConfigDefaultAccountIfExists;
14
14
  describe('mcp-server/tools/project/GetConfigValuesTool', () => {
15
15
  let mockMcpServer;
16
16
  let tool;
@@ -51,7 +51,9 @@ describe('mcp-server/tools/project/GetConfigValuesTool', () => {
51
51
  absoluteCurrentWorkingDirectory: '/foo',
52
52
  };
53
53
  beforeEach(() => {
54
- mockGetAccountIdFromCliConfig.mockReturnValue(123456789);
54
+ mockGetConfigDefaultAccountIfExists.mockReturnValue({
55
+ accountId: 123456789,
56
+ });
55
57
  });
56
58
  it('should return config schema when component type exists', async () => {
57
59
  const mockSchema = {
@@ -66,7 +68,7 @@ describe('mcp-server/tools/project/GetConfigValuesTool', () => {
66
68
  mockGetIntermediateRepresentationSchema.mockResolvedValue(mockSchema);
67
69
  mockMapToInternalType.mockReturnValue('internal-card-type');
68
70
  const result = await tool.handler(input);
69
- expect(mockGetAccountIdFromCliConfig).toHaveBeenCalledWith('/foo');
71
+ expect(mockGetConfigDefaultAccountIfExists).toHaveBeenCalled();
70
72
  expect(mockGetIntermediateRepresentationSchema).toHaveBeenCalledWith({
71
73
  platformVersion: '2025.2',
72
74
  projectSourceDir: '',
@@ -139,7 +141,7 @@ describe('mcp-server/tools/project/GetConfigValuesTool', () => {
139
141
  });
140
142
  });
141
143
  it('should handle null account id', async () => {
142
- mockGetAccountIdFromCliConfig.mockReturnValue(null);
144
+ mockGetConfigDefaultAccountIfExists.mockReturnValue(undefined);
143
145
  const result = await tool.handler(input);
144
146
  expect(result).toEqual({
145
147
  content: [
@@ -1,12 +1,18 @@
1
1
  import { UploadProjectTools } from '../UploadProjectTools.js';
2
+ import { getAllHsProfiles } from '@hubspot/project-parsing-lib';
3
+ import { getProjectConfig } from '../../../../lib/projects/config.js';
2
4
  import { runCommandInDir } from '../../../utils/project.js';
3
5
  import { mcpFeedbackRequest } from '../../../utils/feedbackTracking.js';
4
6
  vi.mock('@modelcontextprotocol/sdk/server/mcp.js');
7
+ vi.mock('@hubspot/project-parsing-lib');
8
+ vi.mock('../../../../lib/projects/config.js');
5
9
  vi.mock('../../../utils/project');
6
10
  vi.mock('../../../utils/toolUsageTracking');
7
11
  vi.mock('../../../utils/feedbackTracking');
8
12
  const mockMcpFeedbackRequest = mcpFeedbackRequest;
9
13
  const mockRunCommandInDir = runCommandInDir;
14
+ const mockGetProjectConfig = getProjectConfig;
15
+ const mockGetAllHsProfiles = getAllHsProfiles;
10
16
  describe('mcp-server/tools/project/UploadProjectTools', () => {
11
17
  let mockMcpServer;
12
18
  let tool;
@@ -20,6 +26,15 @@ describe('mcp-server/tools/project/UploadProjectTools', () => {
20
26
  mockRegisteredTool = {};
21
27
  mockMcpServer.registerTool.mockReturnValue(mockRegisteredTool);
22
28
  mockMcpFeedbackRequest.mockResolvedValue('');
29
+ mockGetProjectConfig.mockResolvedValue({
30
+ projectConfig: {
31
+ srcDir: 'src',
32
+ name: 'test-project',
33
+ platformVersion: '2025.2',
34
+ },
35
+ projectDir: '/test/project',
36
+ });
37
+ mockGetAllHsProfiles.mockResolvedValue([]);
23
38
  tool = new UploadProjectTools(mockMcpServer);
24
39
  });
25
40
  describe('register', () => {
@@ -37,6 +52,7 @@ describe('mcp-server/tools/project/UploadProjectTools', () => {
37
52
  const input = {
38
53
  absoluteCurrentWorkingDirectory: '/test/dir',
39
54
  absoluteProjectPath: '/test/project',
55
+ uploadMessage: 'Test upload message',
40
56
  };
41
57
  it('should upload project successfully', async () => {
42
58
  mockRunCommandInDir.mockResolvedValue({
@@ -44,7 +60,9 @@ describe('mcp-server/tools/project/UploadProjectTools', () => {
44
60
  stderr: '',
45
61
  });
46
62
  const result = await tool.handler(input);
47
- expect(mockRunCommandInDir).toHaveBeenCalledWith('/test/project', 'hs project upload --force-create');
63
+ expect(mockRunCommandInDir).toHaveBeenCalledWith('/test/project', expect.stringContaining('hs project upload'));
64
+ expect(mockRunCommandInDir).toHaveBeenCalledWith('/test/project', expect.stringContaining('--force-create'));
65
+ expect(mockRunCommandInDir).toHaveBeenCalledWith('/test/project', expect.stringContaining('--message "Test upload message"'));
48
66
  expect(result).toEqual({
49
67
  content: [
50
68
  { type: 'text', text: 'Project uploaded successfully' },
@@ -68,13 +86,44 @@ describe('mcp-server/tools/project/UploadProjectTools', () => {
68
86
  mockRunCommandInDir.mockRejectedValue(error);
69
87
  await expect(tool.handler(input)).rejects.toThrow('Upload failed');
70
88
  });
71
- it('should use force-create flag', async () => {
89
+ it('should use force-create and message flags', async () => {
72
90
  mockRunCommandInDir.mockResolvedValue({
73
91
  stdout: 'Project created and uploaded',
74
92
  stderr: '',
75
93
  });
76
94
  await tool.handler(input);
77
- expect(mockRunCommandInDir).toHaveBeenCalledWith('/test/project', 'hs project upload --force-create');
95
+ expect(mockRunCommandInDir).toHaveBeenCalledWith('/test/project', expect.stringContaining('hs project upload'));
96
+ expect(mockRunCommandInDir).toHaveBeenCalledWith('/test/project', expect.stringContaining('--force-create'));
97
+ expect(mockRunCommandInDir).toHaveBeenCalledWith('/test/project', expect.stringContaining('--message "Test upload message"'));
98
+ });
99
+ it('should use profiles', async () => {
100
+ mockRunCommandInDir.mockResolvedValue({
101
+ stdout: 'Project created and uploaded',
102
+ stderr: '',
103
+ });
104
+ await tool.handler({
105
+ ...input,
106
+ profile: 'dev',
107
+ });
108
+ expect(mockRunCommandInDir).toHaveBeenCalledWith('/test/project', expect.stringContaining('hs project upload'));
109
+ expect(mockRunCommandInDir).toHaveBeenCalledWith('/test/project', expect.stringContaining('--force-create'));
110
+ expect(mockRunCommandInDir).toHaveBeenCalledWith('/test/project', expect.stringContaining('--message "Test upload message"'));
111
+ expect(mockRunCommandInDir).toHaveBeenCalledWith('/test/project', expect.stringContaining('--profile "dev"'));
112
+ });
113
+ it('should prompt for profile if not specified and the project requires them', async () => {
114
+ mockGetAllHsProfiles.mockResolvedValue(['prod', 'dev']);
115
+ mockRunCommandInDir.mockResolvedValue({
116
+ stdout: 'Project created and uploaded',
117
+ stderr: '',
118
+ });
119
+ const result = await tool.handler(input);
120
+ expect(mockRunCommandInDir).not.toHaveBeenCalled();
121
+ expect(result.content).toEqual([
122
+ {
123
+ type: 'text',
124
+ text: 'Ask the user which profile they would like to use for the upload.',
125
+ },
126
+ ]);
78
127
  });
79
128
  it('should handle empty stdout and stderr', async () => {
80
129
  mockRunCommandInDir.mockResolvedValue({
@@ -95,9 +144,12 @@ describe('mcp-server/tools/project/UploadProjectTools', () => {
95
144
  const differentInput = {
96
145
  absoluteCurrentWorkingDirectory: '/test/dir',
97
146
  absoluteProjectPath: '/different/path/to/project',
147
+ uploadMessage: 'Different test upload message',
98
148
  };
99
149
  await tool.handler(differentInput);
100
- expect(mockRunCommandInDir).toHaveBeenCalledWith('/different/path/to/project', 'hs project upload --force-create');
150
+ expect(mockRunCommandInDir).toHaveBeenCalledWith('/different/path/to/project', expect.stringContaining('hs project upload'));
151
+ expect(mockRunCommandInDir).toHaveBeenCalledWith('/different/path/to/project', expect.stringContaining('--force-create'));
152
+ expect(mockRunCommandInDir).toHaveBeenCalledWith('/different/path/to/project', expect.stringContaining('--message "Different test upload message"'));
101
153
  });
102
154
  it('should handle very long output', async () => {
103
155
  const longOutput = 'A'.repeat(10000);
@@ -3,7 +3,6 @@ import { mcpFeedbackRequest } from '../feedbackTracking.js';
3
3
  vi.mock('../feedbackTracking');
4
4
  const mockMcpFeedbackRequest = mcpFeedbackRequest;
5
5
  describe('mcp-server/utils/content', () => {
6
- const mockWorkingDirectory = '/test/working/directory';
7
6
  beforeEach(() => {
8
7
  vi.clearAllMocks();
9
8
  });
@@ -34,8 +33,8 @@ describe('mcp-server/utils/content', () => {
34
33
  describe('formatTextContents', () => {
35
34
  it('should format single output without feedback', async () => {
36
35
  mockMcpFeedbackRequest.mockResolvedValue('');
37
- const result = await formatTextContents(mockWorkingDirectory, 'Test output');
38
- expect(mockMcpFeedbackRequest).toHaveBeenCalledWith(mockWorkingDirectory);
36
+ const result = await formatTextContents('Test output');
37
+ expect(mockMcpFeedbackRequest).toHaveBeenCalled();
39
38
  expect(result).toEqual({
40
39
  content: [
41
40
  {
@@ -47,7 +46,7 @@ describe('mcp-server/utils/content', () => {
47
46
  });
48
47
  it('should format multiple outputs without feedback', async () => {
49
48
  mockMcpFeedbackRequest.mockResolvedValue('');
50
- const result = await formatTextContents(mockWorkingDirectory, 'First output', 'Second output', 'Third output');
49
+ const result = await formatTextContents('First output', 'Second output', 'Third output');
51
50
  expect(result).toEqual({
52
51
  content: [
53
52
  { type: 'text', text: 'First output' },
@@ -59,8 +58,8 @@ describe('mcp-server/utils/content', () => {
59
58
  it('should append feedback message when feedback is returned', async () => {
60
59
  const feedbackMessage = 'Please share your feedback!';
61
60
  mockMcpFeedbackRequest.mockResolvedValue(feedbackMessage);
62
- const result = await formatTextContents(mockWorkingDirectory, 'Command output');
63
- expect(mockMcpFeedbackRequest).toHaveBeenCalledWith(mockWorkingDirectory);
61
+ const result = await formatTextContents('Command output');
62
+ expect(mockMcpFeedbackRequest).toHaveBeenCalled();
64
63
  expect(result).toEqual({
65
64
  content: [
66
65
  { type: 'text', text: 'Command output' },
@@ -71,7 +70,7 @@ describe('mcp-server/utils/content', () => {
71
70
  it('should append feedback to multiple outputs', async () => {
72
71
  const feedbackMessage = 'Feedback request message';
73
72
  mockMcpFeedbackRequest.mockResolvedValue(feedbackMessage);
74
- const result = await formatTextContents(mockWorkingDirectory, 'First output', 'Second output');
73
+ const result = await formatTextContents('First output', 'Second output');
75
74
  expect(result).toEqual({
76
75
  content: [
77
76
  { type: 'text', text: 'First output' },
@@ -82,7 +81,7 @@ describe('mcp-server/utils/content', () => {
82
81
  });
83
82
  it('should filter out undefined outputs', async () => {
84
83
  mockMcpFeedbackRequest.mockResolvedValue('');
85
- const result = await formatTextContents(mockWorkingDirectory, 'First output', undefined, 'Third output', undefined);
84
+ const result = await formatTextContents('First output', undefined, 'Third output', undefined);
86
85
  expect(result).toEqual({
87
86
  content: [
88
87
  { type: 'text', text: 'First output' },
@@ -92,7 +91,7 @@ describe('mcp-server/utils/content', () => {
92
91
  });
93
92
  it('should not call mcpFeedbackRequest when no outputs provided', async () => {
94
93
  mockMcpFeedbackRequest.mockResolvedValue('Feedback message');
95
- const result = await formatTextContents(mockWorkingDirectory);
94
+ const result = await formatTextContents();
96
95
  expect(mockMcpFeedbackRequest).not.toHaveBeenCalled();
97
96
  expect(result).toEqual({
98
97
  content: [],
@@ -100,24 +99,24 @@ describe('mcp-server/utils/content', () => {
100
99
  });
101
100
  it('should call mcpFeedbackRequest but not add feedback when all outputs are undefined and feedback is empty', async () => {
102
101
  mockMcpFeedbackRequest.mockResolvedValue('');
103
- const result = await formatTextContents(mockWorkingDirectory, undefined, undefined);
102
+ const result = await formatTextContents(undefined, undefined);
104
103
  // mcpFeedbackRequest is still called because outputs.length > 0, but content is empty
105
- expect(mockMcpFeedbackRequest).toHaveBeenCalledWith(mockWorkingDirectory);
104
+ expect(mockMcpFeedbackRequest).toHaveBeenCalled();
106
105
  expect(result).toEqual({
107
106
  content: [],
108
107
  });
109
108
  });
110
109
  it('should handle empty string outputs and still request feedback', async () => {
111
110
  mockMcpFeedbackRequest.mockResolvedValue('');
112
- const result = await formatTextContents(mockWorkingDirectory, '');
113
- expect(mockMcpFeedbackRequest).toHaveBeenCalledWith(mockWorkingDirectory);
111
+ const result = await formatTextContents('');
112
+ expect(mockMcpFeedbackRequest).toHaveBeenCalled();
114
113
  expect(result).toEqual({
115
114
  content: [{ type: 'text', text: '' }],
116
115
  });
117
116
  });
118
117
  it('should not add feedback when empty string is returned from mcpFeedbackRequest', async () => {
119
118
  mockMcpFeedbackRequest.mockResolvedValue('');
120
- const result = await formatTextContents(mockWorkingDirectory, 'Output 1', 'Output 2');
119
+ const result = await formatTextContents('Output 1', 'Output 2');
121
120
  // Should not have a third content item with empty feedback
122
121
  expect(result.content).toHaveLength(2);
123
122
  expect(result).toEqual({
@@ -137,7 +136,7 @@ describe('mcp-server/utils/content', () => {
137
136
 
138
137
  Say: "📝 **Before we continue, would you mind sharing feedback on your experience with the HubSpot Developer MCP?** Your input helps us improve: [Share feedback here](https://app.hubspot.com/l/product-updates/in-beta?rollout=239890)"`;
139
138
  mockMcpFeedbackRequest.mockResolvedValue(realisticFeedback);
140
- const result = await formatTextContents(mockWorkingDirectory, 'Project created successfully');
139
+ const result = await formatTextContents('Project created successfully');
141
140
  expect(result.content).toHaveLength(2);
142
141
  expect(result.content[0]).toEqual({
143
142
  type: 'text',
@@ -149,16 +148,18 @@ describe('mcp-server/utils/content', () => {
149
148
  });
150
149
  expect(result.content[1].text).toContain('FEEDBACK REQUEST');
151
150
  });
152
- it('should correctly use absoluteCurrentWorkingDirectory parameter', async () => {
153
- const customDirectory = '/custom/working/directory';
151
+ it('should not require absoluteCurrentWorkingDirectory parameter', async () => {
154
152
  mockMcpFeedbackRequest.mockResolvedValue('');
155
- await formatTextContents(customDirectory, 'Test output');
156
- expect(mockMcpFeedbackRequest).toHaveBeenCalledWith(customDirectory);
153
+ const result = await formatTextContents('Test output');
154
+ expect(mockMcpFeedbackRequest).toHaveBeenCalled();
155
+ expect(result).toEqual({
156
+ content: [{ type: 'text', text: 'Test output' }],
157
+ });
157
158
  });
158
159
  it('should await mcpFeedbackRequest and handle async properly', async () => {
159
160
  const feedbackPromise = Promise.resolve('Async feedback message');
160
161
  mockMcpFeedbackRequest.mockReturnValue(feedbackPromise);
161
- const result = await formatTextContents(mockWorkingDirectory, 'Output');
162
+ const result = await formatTextContents('Output');
162
163
  expect(result.content).toHaveLength(2);
163
164
  expect(result.content[1].text).toBe('Async feedback message');
164
165
  });