Skip to content

Commit dc63afb

Browse files
feat(api): api update
1 parent a9436b7 commit dc63afb

File tree

4 files changed

+64
-22
lines changed

4 files changed

+64
-22
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-2a67e842b87576472f1969d75642637db0f0f42fc805a61ab3b880e544941595.yml
3-
openapi_spec_hash: 7cf70aa93bf241c1d1460f48182e9819
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/benchify%2Fbenchify-bc04cfa7474038d34bb40a706e3c5f05f3a57fbc2668912f9b7885050c82f5c9.yml
3+
openapi_spec_hash: c87647579ee434390bb0aba78cfb7bc1
44
config_hash: 935baad1727a1116efdc14e9ce6e4405

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,30 @@ export const tool: Tool = {
4545
required: ['contents', 'path'],
4646
},
4747
},
48+
fix_types: {
49+
type: 'array',
50+
title: 'Fix Types',
51+
description: 'Configuration for which fix types to apply',
52+
items: {
53+
type: 'string',
54+
title: 'FixTypeName',
55+
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+
],
66+
},
67+
},
4868
fixes: {
4969
type: 'object',
5070
title: 'FixConfigObject',
51-
description: 'Configuration object for specifying which fixes to apply',
71+
description: 'DEPRECATED: legacy boolean flags for which fixes to apply.',
5272
properties: {
5373
css: {
5474
type: 'boolean',

src/resources/fixer.ts

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ export namespace DiagnosticResponse {
4747
* Enhanced diagnostic model for external API
4848
*/
4949
export interface FileToDiagnostic {
50-
/**
51-
* Category of diagnostic
52-
*/
53-
category: 'typescript';
54-
5550
/**
5651
* File where diagnostic occurs
5752
*/
@@ -67,6 +62,18 @@ export namespace DiagnosticResponse {
6762
*/
6863
message: string;
6964

65+
/**
66+
* Type of the diagnostic
67+
*/
68+
type:
69+
| 'type_error'
70+
| 'string_literal'
71+
| 'import_export'
72+
| 'implicit_any'
73+
| 'implicit_any_array'
74+
| 'invalid_jsx'
75+
| 'unclassified';
76+
7077
/**
7178
* Code given by the diagnostic generator
7279
*/
@@ -238,7 +245,21 @@ export interface FixerRunParams {
238245
files: Array<FixerRunParams.File>;
239246

240247
/**
241-
* Configuration object for specifying which fixes to apply
248+
* Configuration for which fix types to apply
249+
*/
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+
>;
260+
261+
/**
262+
* @deprecated DEPRECATED: legacy boolean flags for which fixes to apply.
242263
*/
243264
fixes?: FixerRunParams.Fixes | null;
244265

@@ -275,38 +296,38 @@ export namespace FixerRunParams {
275296
}
276297

277298
/**
278-
* Configuration object for specifying which fixes to apply
299+
* @deprecated DEPRECATED: legacy boolean flags for which fixes to apply.
279300
*/
280301
export interface Fixes {
281302
/**
282-
* Whether to fix CSS issues
303+
* @deprecated Whether to fix CSS issues
283304
*/
284-
css?: boolean;
305+
css?: boolean | null;
285306

286307
/**
287-
* Whether to fix import issues
308+
* @deprecated Whether to fix import issues
288309
*/
289-
imports?: boolean;
310+
imports?: boolean | null;
290311

291312
/**
292-
* Whether to fix React issues
313+
* @deprecated Whether to fix React issues
293314
*/
294-
react?: boolean;
315+
react?: boolean | null;
295316

296317
/**
297-
* Whether to fix string literal issues
318+
* @deprecated Whether to fix string literal issues
298319
*/
299-
stringLiterals?: boolean;
320+
stringLiterals?: boolean | null;
300321

301322
/**
302-
* Whether to fix Tailwind issues
323+
* @deprecated Whether to fix Tailwind issues
303324
*/
304-
tailwind?: boolean;
325+
tailwind?: boolean | null;
305326

306327
/**
307-
* Whether to fix TypeScript suggestions
328+
* @deprecated Whether to fix TypeScript suggestions
308329
*/
309-
tsSuggestions?: boolean;
330+
tsSuggestions?: boolean | null;
310331
}
311332

312333
/**

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+
fix_types: ['import_export'],
2728
fixes: {
2829
css: true,
2930
imports: true,

0 commit comments

Comments
 (0)