Skip to content

Commit 38868ee

Browse files
feat(api): api update
1 parent bf8be45 commit 38868ee

File tree

4 files changed

+18
-45
lines changed

4 files changed

+18
-45
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/benchify%2Fbenchify-bc04cfa7474038d34bb40a706e3c5f05f3a57fbc2668912f9b7885050c82f5c9.yml
3-
openapi_spec_hash: c87647579ee434390bb0aba78cfb7bc1
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/benchify%2Fbenchify-882428dc42061ac58fad8814f920a7afec0a8fb54bb744e8e709b27156b8afb3.yml
3+
openapi_spec_hash: 4778a24a07fa3aafa7a9befb36579c19
44
config_hash: 935baad1727a1116efdc14e9ce6e4405

packages/mcp-server/src/tools/fixer/run-fixer.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
1818
export const tool: Tool = {
1919
name: 'run_fixer',
2020
description:
21-
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nHandle fixer requests to process and fix TypeScript files.\n\n# Response Schema\n```json\n{\n type: 'object',\n title: 'WrappedFixerResponse',\n description: 'Wrapped response model for benchify-api compatibility',\n properties: {\n data: {\n type: 'object',\n title: 'FixerResponse',\n description: 'The actual response data',\n properties: {\n files_processed: {\n type: 'integer',\n title: 'Files Processed',\n description: 'Number of files processed'\n },\n status: {\n type: 'object',\n title: 'FixerStatus',\n description: 'Final per-file status after fixing',\n properties: {\n file_to_status: {\n type: 'object',\n title: 'File To Status',\n description: 'Fix status of each file sent.',\n additionalProperties: true\n }\n }\n },\n fixed_files: {\n type: 'object',\n title: 'Fixed Files',\n description: 'Information about fixed files',\n additionalProperties: true\n },\n suggested_changes: {\n anyOf: [ {\n type: 'object',\n title: 'DiffFormat',\n properties: {\n diff: {\n type: 'string',\n title: 'Diff',\n description: 'Git diff of changes made'\n }\n }\n },\n {\n type: 'object',\n title: 'ChangedFilesFormat',\n properties: {\n changed_files: {\n type: 'array',\n title: 'Changed Files',\n description: 'List of changed files with their new contents',\n items: {\n $ref: '#/$defs/file_change'\n }\n }\n }\n },\n {\n type: 'object',\n title: 'AllFilesFormat',\n properties: {\n all_files: {\n type: 'array',\n title: 'All Files',\n description: 'List of all files with their current contents',\n items: {\n $ref: '#/$defs/file_change'\n }\n }\n }\n }\n ],\n title: 'Suggested Changes',\n description: 'Changes made by the fixer in the requested format'\n }\n },\n required: [ 'files_processed',\n 'status'\n ]\n },\n error: {\n type: 'object',\n title: 'ResponseError',\n description: 'The error from the API query',\n properties: {\n code: {\n type: 'string',\n title: 'Code',\n description: 'The error code'\n },\n message: {\n type: 'string',\n title: 'Message',\n description: 'The error message'\n },\n details: {\n type: 'string',\n title: 'Details',\n description: 'Details about what caused the error, if available'\n },\n suggestions: {\n type: 'array',\n title: 'Suggestions',\n description: 'Potential suggestions about how to fix the error, if applicable',\n items: {\n type: 'string'\n }\n }\n },\n required: [ 'code',\n 'message'\n ]\n },\n meta: {\n $ref: '#/$defs/response_meta'\n }\n },\n required: [ 'data'\n ],\n $defs: {\n file_change: {\n type: 'object',\n title: 'FileChange',\n description: 'Model for a single file change',\n properties: {\n contents: {\n type: 'string',\n title: 'Contents',\n description: 'Contents of the file'\n },\n path: {\n type: 'string',\n title: 'Path',\n description: 'Path of the file'\n }\n },\n required: [ 'contents',\n 'path'\n ]\n },\n response_meta: {\n type: 'object',\n title: 'ResponseMeta',\n description: 'Meta information for API responses',\n properties: {\n external_id: {\n type: 'string',\n title: 'External Id',\n description: 'Customer tracking identifier'\n },\n trace_id: {\n type: 'string',\n title: 'Trace Id',\n description: 'Unique trace identifier for the request'\n }\n }\n }\n }\n}\n```",
21+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nHandle fixer requests to process and fix TypeScript files.\n\n# Response Schema\n```json\n{\n type: 'object',\n title: 'WrappedFixerResponse',\n description: 'Wrapped response model for benchify-api compatibility',\n properties: {\n data: {\n type: 'object',\n title: 'FixerResponse',\n description: 'The actual response data',\n properties: {\n status: {\n type: 'object',\n title: 'FixerStatus',\n description: 'Final per-file status after fixing',\n properties: {\n file_to_status: {\n type: 'object',\n title: 'File To Status',\n description: 'Fix status of each file sent.',\n additionalProperties: true\n }\n }\n },\n bundled_files: {\n type: 'array',\n title: 'Bundled Files',\n description: 'Bundled files',\n items: {\n $ref: '#/$defs/file_change'\n }\n },\n suggested_changes: {\n anyOf: [ {\n type: 'object',\n title: 'DiffFormat',\n properties: {\n diff: {\n type: 'string',\n title: 'Diff',\n description: 'Git diff of changes made'\n }\n }\n },\n {\n type: 'object',\n title: 'ChangedFilesFormat',\n properties: {\n changed_files: {\n type: 'array',\n title: 'Changed Files',\n description: 'List of changed files with their new contents',\n items: {\n $ref: '#/$defs/file_change'\n }\n }\n }\n },\n {\n type: 'object',\n title: 'AllFilesFormat',\n properties: {\n all_files: {\n type: 'array',\n title: 'All Files',\n description: 'List of all files with their current contents',\n items: {\n $ref: '#/$defs/file_change'\n }\n }\n }\n }\n ],\n title: 'Suggested Changes',\n description: 'Changes made by the fixer in the requested format'\n }\n },\n required: [ 'status'\n ]\n },\n error: {\n type: 'object',\n title: 'ResponseError',\n description: 'The error from the API query',\n properties: {\n code: {\n type: 'string',\n title: 'Code',\n description: 'The error code'\n },\n message: {\n type: 'string',\n title: 'Message',\n description: 'The error message'\n },\n details: {\n type: 'string',\n title: 'Details',\n description: 'Details about what caused the error, if available'\n },\n suggestions: {\n type: 'array',\n title: 'Suggestions',\n description: 'Potential suggestions about how to fix the error, if applicable',\n items: {\n type: 'string'\n }\n }\n },\n required: [ 'code',\n 'message'\n ]\n },\n meta: {\n $ref: '#/$defs/response_meta'\n }\n },\n required: [ 'data'\n ],\n $defs: {\n file_change: {\n type: 'object',\n title: 'FileChange',\n description: 'Model for a single file change',\n properties: {\n contents: {\n type: 'string',\n title: 'Contents',\n description: 'Contents of the file'\n },\n path: {\n type: 'string',\n title: 'Path',\n description: 'Path of the file'\n }\n },\n required: [ 'contents',\n 'path'\n ]\n },\n response_meta: {\n type: 'object',\n title: 'ResponseMeta',\n description: 'Meta information for API responses',\n properties: {\n external_id: {\n type: 'string',\n title: 'External Id',\n description: 'Customer tracking identifier'\n },\n trace_id: {\n type: 'string',\n title: 'Trace Id',\n description: 'Unique trace identifier for the request'\n }\n }\n }\n }\n}\n```",
2222
inputSchema: {
2323
type: 'object',
2424
properties: {
@@ -45,6 +45,11 @@ export const tool: Tool = {
4545
required: ['contents', 'path'],
4646
},
4747
},
48+
bundle: {
49+
type: 'boolean',
50+
title: 'Bundle',
51+
description: 'Whether to bundle the project (experimental)',
52+
},
4853
fix_types: {
4954
type: 'array',
5055
title: 'Fix Types',
@@ -53,16 +58,7 @@ export const tool: Tool = {
5358
type: 'string',
5459
title: 'FixTypeName',
5560
description: 'Enumeration of available fix types',
56-
enum: [
57-
'import_export',
58-
'string_literals',
59-
'ts_suggestions',
60-
'css',
61-
'tailwind',
62-
'react',
63-
'ai_fallback',
64-
'types',
65-
],
61+
enum: ['import_export', 'string_literals', 'css', 'tailwind', 'ai_fallback', 'types'],
6662
},
6763
},
6864
fixes: {

src/resources/fixer.ts

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@ export interface DiagnosticResponse {
3030
* Diagnostics grouped by file
3131
*/
3232
file_to_diagnostics?: { [key: string]: Array<DiagnosticResponse.FileToDiagnostic> };
33-
34-
/**
35-
* Human-readable summary of issues
36-
*/
37-
summary?: string;
38-
39-
/**
40-
* Total number of diagnostics
41-
*/
42-
total_count?: number;
4333
}
4434

4535
export namespace DiagnosticResponse {
@@ -83,11 +73,6 @@ export namespace DiagnosticResponse {
8373
* Surrounding code context
8474
*/
8575
context?: string | null;
86-
87-
/**
88-
* Diagnostic category
89-
*/
90-
severity?: 'error' | 'warning';
9176
}
9277

9378
export namespace FileToDiagnostic {
@@ -158,20 +143,15 @@ export namespace FixerRunResponse {
158143
* The actual response data
159144
*/
160145
export interface Data {
161-
/**
162-
* Number of files processed
163-
*/
164-
files_processed: number;
165-
166146
/**
167147
* Final per-file status after fixing
168148
*/
169149
status: Data.Status;
170150

171151
/**
172-
* Information about fixed files
152+
* Bundled files
173153
*/
174-
fixed_files?: { [key: string]: unknown } | null;
154+
bundled_files?: Array<FixerAPI.FileChange> | null;
175155

176156
/**
177157
* Changes made by the fixer in the requested format
@@ -244,19 +224,15 @@ export interface FixerRunParams {
244224
*/
245225
files: Array<FixerRunParams.File>;
246226

227+
/**
228+
* Whether to bundle the project (experimental)
229+
*/
230+
bundle?: boolean;
231+
247232
/**
248233
* Configuration for which fix types to apply
249234
*/
250-
fix_types?: Array<
251-
| 'import_export'
252-
| 'string_literals'
253-
| 'ts_suggestions'
254-
| 'css'
255-
| 'tailwind'
256-
| 'react'
257-
| 'ai_fallback'
258-
| 'types'
259-
>;
235+
fix_types?: Array<'import_export' | 'string_literals' | 'css' | 'tailwind' | 'ai_fallback' | 'types'>;
260236

261237
/**
262238
* @deprecated DEPRECATED: legacy boolean flags for which fixes to apply.

tests/api-resources/fixer.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ describe('resource fixer', () => {
2424
test.skip('run: required and optional params', async () => {
2525
const response = await client.fixer.run({
2626
files: [{ contents: 'contents', path: 'x' }],
27+
bundle: true,
2728
fix_types: ['import_export'],
2829
fixes: {
2930
css: true,

0 commit comments

Comments
 (0)