@stigg/typescript-mcp 0.1.0-alpha.9 → 0.1.0-beta.1
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.
- package/code-tool-paths.cjs +8 -0
- package/code-tool-paths.cjs.map +1 -0
- package/code-tool-paths.d.cts +2 -0
- package/code-tool-paths.d.cts.map +1 -0
- package/code-tool-types.d.mts.map +1 -1
- package/code-tool-types.d.ts.map +1 -1
- package/code-tool-worker.d.mts +5 -0
- package/code-tool-worker.d.mts.map +1 -0
- package/code-tool-worker.d.ts +5 -0
- package/code-tool-worker.d.ts.map +1 -0
- package/code-tool-worker.js +357 -0
- package/code-tool-worker.js.map +1 -0
- package/code-tool-worker.mjs +319 -0
- package/code-tool-worker.mjs.map +1 -0
- package/code-tool.d.mts +8 -2
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts +8 -2
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +266 -37
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +233 -37
- package/code-tool.mjs.map +1 -1
- package/docs-search-tool.d.mts +3 -1
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts +3 -1
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +53 -4
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +52 -4
- package/docs-search-tool.mjs.map +1 -1
- package/http.d.mts +2 -4
- package/http.d.mts.map +1 -1
- package/http.d.ts +2 -4
- package/http.d.ts.map +1 -1
- package/http.js +123 -40
- package/http.js.map +1 -1
- package/http.mjs +123 -40
- package/http.mjs.map +1 -1
- package/index.js +13 -12
- package/index.js.map +1 -1
- package/index.mjs +13 -12
- package/index.mjs.map +1 -1
- package/instructions.d.mts +5 -0
- package/instructions.d.mts.map +1 -0
- package/instructions.d.ts +5 -0
- package/instructions.d.ts.map +1 -0
- package/instructions.js +61 -0
- package/instructions.js.map +1 -0
- package/instructions.mjs +55 -0
- package/instructions.mjs.map +1 -0
- package/local-docs-search.d.mts +28 -0
- package/local-docs-search.d.mts.map +1 -0
- package/local-docs-search.d.ts +28 -0
- package/local-docs-search.d.ts.map +1 -0
- package/local-docs-search.js +4774 -0
- package/local-docs-search.js.map +1 -0
- package/local-docs-search.mjs +4734 -0
- package/local-docs-search.mjs.map +1 -0
- package/logger.d.mts +7 -0
- package/logger.d.mts.map +1 -0
- package/logger.d.ts +7 -0
- package/logger.d.ts.map +1 -0
- package/logger.js +29 -0
- package/logger.js.map +1 -0
- package/logger.mjs +22 -0
- package/logger.mjs.map +1 -0
- package/methods.d.mts.map +1 -1
- package/methods.d.ts.map +1 -1
- package/methods.js +235 -43
- package/methods.js.map +1 -1
- package/methods.mjs +235 -43
- package/methods.mjs.map +1 -1
- package/options.d.mts +7 -0
- package/options.d.mts.map +1 -1
- package/options.d.ts +7 -0
- package/options.d.ts.map +1 -1
- package/options.js +42 -0
- package/options.js.map +1 -1
- package/options.mjs +42 -0
- package/options.mjs.map +1 -1
- package/package.json +58 -7
- package/server.d.mts +10 -1
- package/server.d.mts.map +1 -1
- package/server.d.ts +10 -1
- package/server.d.ts.map +1 -1
- package/server.js +72 -47
- package/server.js.map +1 -1
- package/server.mjs +72 -47
- package/server.mjs.map +1 -1
- package/src/code-tool-paths.cts +5 -0
- package/src/code-tool-types.ts +1 -0
- package/src/code-tool-worker.ts +370 -0
- package/src/code-tool.ts +302 -47
- package/src/docs-search-tool.ts +81 -11
- package/src/http.ts +131 -42
- package/src/index.ts +15 -13
- package/src/instructions.ts +83 -0
- package/src/local-docs-search.ts +5667 -0
- package/src/logger.ts +28 -0
- package/src/methods.ts +235 -43
- package/src/options.ts +56 -0
- package/src/server.ts +85 -58
- package/src/stdio.ts +6 -2
- package/src/types.ts +3 -0
- package/src/util.ts +2 -2
- package/stdio.d.mts.map +1 -1
- package/stdio.d.ts.map +1 -1
- package/stdio.js +6 -2
- package/stdio.js.map +1 -1
- package/stdio.mjs +6 -2
- package/stdio.mjs.map +1 -1
- package/types.d.mts +6 -0
- package/types.d.mts.map +1 -1
- package/types.d.ts +6 -0
- package/types.d.ts.map +1 -1
- package/types.js.map +1 -1
- package/types.mjs.map +1 -1
- package/util.js +2 -2
- package/util.js.map +1 -1
- package/util.mjs +2 -2
- package/util.mjs.map +1 -1
package/src/logger.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { pino, type Level, type Logger } from 'pino';
|
|
4
|
+
import pretty from 'pino-pretty';
|
|
5
|
+
|
|
6
|
+
let _logger: Logger | undefined;
|
|
7
|
+
|
|
8
|
+
export function configureLogger({ level, pretty: usePretty }: { level: Level; pretty: boolean }): void {
|
|
9
|
+
_logger = pino(
|
|
10
|
+
{
|
|
11
|
+
level,
|
|
12
|
+
timestamp: pino.stdTimeFunctions.isoTime,
|
|
13
|
+
formatters: {
|
|
14
|
+
level(label) {
|
|
15
|
+
return { level: label };
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
usePretty ? pretty({ colorize: true, levelFirst: true, destination: 2 }) : process.stderr,
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function getLogger(): Logger {
|
|
24
|
+
if (!_logger) {
|
|
25
|
+
throw new Error('Logger has not been configured. Call configureLogger() before using the logger.');
|
|
26
|
+
}
|
|
27
|
+
return _logger;
|
|
28
|
+
}
|
package/src/methods.ts
CHANGED
|
@@ -34,6 +34,12 @@ export const sdkMethods: SdkMethod[] = [
|
|
|
34
34
|
httpMethod: 'post',
|
|
35
35
|
httpPath: '/api/v1/customers/{id}/archive',
|
|
36
36
|
},
|
|
37
|
+
{
|
|
38
|
+
clientCallName: 'client.v1.customers.checkEntitlement',
|
|
39
|
+
fullyQualifiedName: 'v1.customers.checkEntitlement',
|
|
40
|
+
httpMethod: 'get',
|
|
41
|
+
httpPath: '/api/v1/customers/{id}/entitlements/check',
|
|
42
|
+
},
|
|
37
43
|
{
|
|
38
44
|
clientCallName: 'client.v1.customers.import',
|
|
39
45
|
fullyQualifiedName: 'v1.customers.import',
|
|
@@ -52,6 +58,12 @@ export const sdkMethods: SdkMethod[] = [
|
|
|
52
58
|
httpMethod: 'post',
|
|
53
59
|
httpPath: '/api/v1/customers',
|
|
54
60
|
},
|
|
61
|
+
{
|
|
62
|
+
clientCallName: 'client.v1.customers.retrieveEntitlements',
|
|
63
|
+
fullyQualifiedName: 'v1.customers.retrieveEntitlements',
|
|
64
|
+
httpMethod: 'get',
|
|
65
|
+
httpPath: '/api/v1/customers/{id}/entitlements',
|
|
66
|
+
},
|
|
55
67
|
{
|
|
56
68
|
clientCallName: 'client.v1.customers.unarchive',
|
|
57
69
|
fullyQualifiedName: 'v1.customers.unarchive',
|
|
@@ -88,6 +100,36 @@ export const sdkMethods: SdkMethod[] = [
|
|
|
88
100
|
httpMethod: 'delete',
|
|
89
101
|
httpPath: '/api/v1/customers/{id}/promotional-entitlements/{featureId}',
|
|
90
102
|
},
|
|
103
|
+
{
|
|
104
|
+
clientCallName: 'client.v1.customers.integrations.retrieve',
|
|
105
|
+
fullyQualifiedName: 'v1.customers.integrations.retrieve',
|
|
106
|
+
httpMethod: 'get',
|
|
107
|
+
httpPath: '/api/v1/customers/{id}/integrations/{integrationId}',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
clientCallName: 'client.v1.customers.integrations.update',
|
|
111
|
+
fullyQualifiedName: 'v1.customers.integrations.update',
|
|
112
|
+
httpMethod: 'patch',
|
|
113
|
+
httpPath: '/api/v1/customers/{id}/integrations/{integrationId}',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
clientCallName: 'client.v1.customers.integrations.list',
|
|
117
|
+
fullyQualifiedName: 'v1.customers.integrations.list',
|
|
118
|
+
httpMethod: 'get',
|
|
119
|
+
httpPath: '/api/v1/customers/{id}/integrations',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
clientCallName: 'client.v1.customers.integrations.link',
|
|
123
|
+
fullyQualifiedName: 'v1.customers.integrations.link',
|
|
124
|
+
httpMethod: 'post',
|
|
125
|
+
httpPath: '/api/v1/customers/{id}/integrations',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
clientCallName: 'client.v1.customers.integrations.unlink',
|
|
129
|
+
fullyQualifiedName: 'v1.customers.integrations.unlink',
|
|
130
|
+
httpMethod: 'delete',
|
|
131
|
+
httpPath: '/api/v1/customers/{id}/integrations/{integrationId}',
|
|
132
|
+
},
|
|
91
133
|
{
|
|
92
134
|
clientCallName: 'client.v1.subscriptions.retrieve',
|
|
93
135
|
fullyQualifiedName: 'v1.subscriptions.retrieve',
|
|
@@ -215,107 +257,257 @@ export const sdkMethods: SdkMethod[] = [
|
|
|
215
257
|
httpPath: '/api/v1/events',
|
|
216
258
|
},
|
|
217
259
|
{
|
|
218
|
-
clientCallName: 'client.v1.events.
|
|
219
|
-
fullyQualifiedName: 'v1.events.
|
|
260
|
+
clientCallName: 'client.v1.events.credits.getAutoRecharge',
|
|
261
|
+
fullyQualifiedName: 'v1.events.credits.getAutoRecharge',
|
|
262
|
+
httpMethod: 'get',
|
|
263
|
+
httpPath: '/api/v1/credits/auto-recharge',
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
clientCallName: 'client.v1.events.credits.getUsage',
|
|
267
|
+
fullyQualifiedName: 'v1.events.credits.getUsage',
|
|
268
|
+
httpMethod: 'get',
|
|
269
|
+
httpPath: '/api/v1/credits/usage',
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
clientCallName: 'client.v1.events.credits.listLedger',
|
|
273
|
+
fullyQualifiedName: 'v1.events.credits.listLedger',
|
|
274
|
+
httpMethod: 'get',
|
|
275
|
+
httpPath: '/api/v1/credits/ledger',
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
clientCallName: 'client.v1.events.credits.grants.create',
|
|
279
|
+
fullyQualifiedName: 'v1.events.credits.grants.create',
|
|
280
|
+
httpMethod: 'post',
|
|
281
|
+
httpPath: '/api/v1/credits/grants',
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
clientCallName: 'client.v1.events.credits.grants.list',
|
|
285
|
+
fullyQualifiedName: 'v1.events.credits.grants.list',
|
|
286
|
+
httpMethod: 'get',
|
|
287
|
+
httpPath: '/api/v1/credits/grants',
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
clientCallName: 'client.v1.events.credits.grants.void',
|
|
291
|
+
fullyQualifiedName: 'v1.events.credits.grants.void',
|
|
292
|
+
httpMethod: 'post',
|
|
293
|
+
httpPath: '/api/v1/credits/grants/{id}/void',
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
clientCallName: 'client.v1.events.credits.customCurrencies.create',
|
|
297
|
+
fullyQualifiedName: 'v1.events.credits.customCurrencies.create',
|
|
298
|
+
httpMethod: 'post',
|
|
299
|
+
httpPath: '/api/v1/credits/custom-currencies',
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
clientCallName: 'client.v1.events.credits.customCurrencies.update',
|
|
303
|
+
fullyQualifiedName: 'v1.events.credits.customCurrencies.update',
|
|
304
|
+
httpMethod: 'patch',
|
|
305
|
+
httpPath: '/api/v1/credits/custom-currencies/{currencyId}',
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
clientCallName: 'client.v1.events.credits.customCurrencies.list',
|
|
309
|
+
fullyQualifiedName: 'v1.events.credits.customCurrencies.list',
|
|
310
|
+
httpMethod: 'get',
|
|
311
|
+
httpPath: '/api/v1/credits/custom-currencies',
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
clientCallName: 'client.v1.events.credits.customCurrencies.archive',
|
|
315
|
+
fullyQualifiedName: 'v1.events.credits.customCurrencies.archive',
|
|
316
|
+
httpMethod: 'post',
|
|
317
|
+
httpPath: '/api/v1/credits/custom-currencies/{currencyId}/archive',
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
clientCallName: 'client.v1.events.credits.customCurrencies.listAssociatedEntities',
|
|
321
|
+
fullyQualifiedName: 'v1.events.credits.customCurrencies.listAssociatedEntities',
|
|
322
|
+
httpMethod: 'get',
|
|
323
|
+
httpPath: '/api/v1/credits/custom-currencies/{currencyId}/associated-entities',
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
clientCallName: 'client.v1.events.credits.customCurrencies.unarchive',
|
|
327
|
+
fullyQualifiedName: 'v1.events.credits.customCurrencies.unarchive',
|
|
328
|
+
httpMethod: 'post',
|
|
329
|
+
httpPath: '/api/v1/credits/custom-currencies/{currencyId}/unarchive',
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
clientCallName: 'client.v1.features.archiveFeature',
|
|
333
|
+
fullyQualifiedName: 'v1.features.archiveFeature',
|
|
220
334
|
httpMethod: 'post',
|
|
221
335
|
httpPath: '/api/v1/features/{id}/archive',
|
|
222
336
|
},
|
|
223
337
|
{
|
|
224
|
-
clientCallName: 'client.v1.
|
|
225
|
-
fullyQualifiedName: 'v1.
|
|
338
|
+
clientCallName: 'client.v1.features.createFeature',
|
|
339
|
+
fullyQualifiedName: 'v1.features.createFeature',
|
|
226
340
|
httpMethod: 'post',
|
|
227
341
|
httpPath: '/api/v1/features',
|
|
228
342
|
},
|
|
229
343
|
{
|
|
230
|
-
clientCallName: 'client.v1.
|
|
231
|
-
fullyQualifiedName: 'v1.
|
|
344
|
+
clientCallName: 'client.v1.features.listFeatures',
|
|
345
|
+
fullyQualifiedName: 'v1.features.listFeatures',
|
|
232
346
|
httpMethod: 'get',
|
|
233
347
|
httpPath: '/api/v1/features',
|
|
234
348
|
},
|
|
235
349
|
{
|
|
236
|
-
clientCallName: 'client.v1.
|
|
237
|
-
fullyQualifiedName: 'v1.
|
|
350
|
+
clientCallName: 'client.v1.features.retrieveFeature',
|
|
351
|
+
fullyQualifiedName: 'v1.features.retrieveFeature',
|
|
238
352
|
httpMethod: 'get',
|
|
239
353
|
httpPath: '/api/v1/features/{id}',
|
|
240
354
|
},
|
|
241
355
|
{
|
|
242
|
-
clientCallName: 'client.v1.
|
|
243
|
-
fullyQualifiedName: 'v1.
|
|
356
|
+
clientCallName: 'client.v1.features.unarchiveFeature',
|
|
357
|
+
fullyQualifiedName: 'v1.features.unarchiveFeature',
|
|
244
358
|
httpMethod: 'post',
|
|
245
359
|
httpPath: '/api/v1/features/{id}/unarchive',
|
|
246
360
|
},
|
|
247
361
|
{
|
|
248
|
-
clientCallName: 'client.v1.
|
|
249
|
-
fullyQualifiedName: 'v1.
|
|
362
|
+
clientCallName: 'client.v1.features.updateFeature',
|
|
363
|
+
fullyQualifiedName: 'v1.features.updateFeature',
|
|
250
364
|
httpMethod: 'patch',
|
|
251
365
|
httpPath: '/api/v1/features/{id}',
|
|
252
366
|
},
|
|
253
367
|
{
|
|
254
|
-
clientCallName: 'client.v1.
|
|
255
|
-
fullyQualifiedName: 'v1.
|
|
368
|
+
clientCallName: 'client.v1.addons.create',
|
|
369
|
+
fullyQualifiedName: 'v1.addons.create',
|
|
256
370
|
httpMethod: 'post',
|
|
257
|
-
httpPath: '/api/v1/addons
|
|
371
|
+
httpPath: '/api/v1/addons',
|
|
258
372
|
},
|
|
259
373
|
{
|
|
260
|
-
clientCallName: 'client.v1.
|
|
261
|
-
fullyQualifiedName: 'v1.
|
|
262
|
-
httpMethod: '
|
|
263
|
-
httpPath: '/api/v1/addons',
|
|
374
|
+
clientCallName: 'client.v1.addons.retrieve',
|
|
375
|
+
fullyQualifiedName: 'v1.addons.retrieve',
|
|
376
|
+
httpMethod: 'get',
|
|
377
|
+
httpPath: '/api/v1/addons/{id}',
|
|
264
378
|
},
|
|
265
379
|
{
|
|
266
|
-
clientCallName: 'client.v1.
|
|
267
|
-
fullyQualifiedName: 'v1.
|
|
380
|
+
clientCallName: 'client.v1.addons.update',
|
|
381
|
+
fullyQualifiedName: 'v1.addons.update',
|
|
382
|
+
httpMethod: 'patch',
|
|
383
|
+
httpPath: '/api/v1/addons/{id}',
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
clientCallName: 'client.v1.addons.list',
|
|
387
|
+
fullyQualifiedName: 'v1.addons.list',
|
|
268
388
|
httpMethod: 'get',
|
|
269
389
|
httpPath: '/api/v1/addons',
|
|
270
390
|
},
|
|
271
391
|
{
|
|
272
|
-
clientCallName: 'client.v1.
|
|
273
|
-
fullyQualifiedName: 'v1.
|
|
392
|
+
clientCallName: 'client.v1.addons.archive',
|
|
393
|
+
fullyQualifiedName: 'v1.addons.archive',
|
|
394
|
+
httpMethod: 'post',
|
|
395
|
+
httpPath: '/api/v1/addons/{id}/archive',
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
clientCallName: 'client.v1.addons.createDraft',
|
|
399
|
+
fullyQualifiedName: 'v1.addons.createDraft',
|
|
400
|
+
httpMethod: 'post',
|
|
401
|
+
httpPath: '/api/v1/addons/{id}/draft',
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
clientCallName: 'client.v1.addons.publish',
|
|
405
|
+
fullyQualifiedName: 'v1.addons.publish',
|
|
274
406
|
httpMethod: 'post',
|
|
275
407
|
httpPath: '/api/v1/addons/{id}/publish',
|
|
276
408
|
},
|
|
277
409
|
{
|
|
278
|
-
clientCallName: 'client.v1.
|
|
279
|
-
fullyQualifiedName: 'v1.
|
|
280
|
-
httpMethod: '
|
|
281
|
-
httpPath: '/api/v1/addons/{id}',
|
|
410
|
+
clientCallName: 'client.v1.addons.removeDraft',
|
|
411
|
+
fullyQualifiedName: 'v1.addons.removeDraft',
|
|
412
|
+
httpMethod: 'delete',
|
|
413
|
+
httpPath: '/api/v1/addons/{id}/draft',
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
clientCallName: 'client.v1.addons.entitlements.create',
|
|
417
|
+
fullyQualifiedName: 'v1.addons.entitlements.create',
|
|
418
|
+
httpMethod: 'post',
|
|
419
|
+
httpPath: '/api/v1/addons/{addonId}/entitlements',
|
|
282
420
|
},
|
|
283
421
|
{
|
|
284
|
-
clientCallName: 'client.v1.
|
|
285
|
-
fullyQualifiedName: 'v1.
|
|
422
|
+
clientCallName: 'client.v1.addons.entitlements.update',
|
|
423
|
+
fullyQualifiedName: 'v1.addons.entitlements.update',
|
|
286
424
|
httpMethod: 'patch',
|
|
287
|
-
httpPath: '/api/v1/addons/{id}',
|
|
425
|
+
httpPath: '/api/v1/addons/{addonId}/entitlements/{id}',
|
|
288
426
|
},
|
|
289
427
|
{
|
|
290
|
-
clientCallName: 'client.v1.
|
|
291
|
-
fullyQualifiedName: 'v1.
|
|
292
|
-
httpMethod: '
|
|
293
|
-
httpPath: '/api/v1/addons/{
|
|
428
|
+
clientCallName: 'client.v1.addons.entitlements.list',
|
|
429
|
+
fullyQualifiedName: 'v1.addons.entitlements.list',
|
|
430
|
+
httpMethod: 'get',
|
|
431
|
+
httpPath: '/api/v1/addons/{addonId}/entitlements',
|
|
294
432
|
},
|
|
295
433
|
{
|
|
296
|
-
clientCallName: 'client.v1.
|
|
297
|
-
fullyQualifiedName: 'v1.
|
|
434
|
+
clientCallName: 'client.v1.addons.entitlements.delete',
|
|
435
|
+
fullyQualifiedName: 'v1.addons.entitlements.delete',
|
|
298
436
|
httpMethod: 'delete',
|
|
299
|
-
httpPath: '/api/v1/addons/{id}
|
|
437
|
+
httpPath: '/api/v1/addons/{addonId}/entitlements/{id}',
|
|
300
438
|
},
|
|
301
439
|
{
|
|
302
|
-
clientCallName: 'client.v1.
|
|
303
|
-
fullyQualifiedName: 'v1.
|
|
440
|
+
clientCallName: 'client.v1.plans.create',
|
|
441
|
+
fullyQualifiedName: 'v1.plans.create',
|
|
304
442
|
httpMethod: 'post',
|
|
305
443
|
httpPath: '/api/v1/plans',
|
|
306
444
|
},
|
|
307
445
|
{
|
|
308
|
-
clientCallName: 'client.v1.
|
|
309
|
-
fullyQualifiedName: 'v1.
|
|
446
|
+
clientCallName: 'client.v1.plans.retrieve',
|
|
447
|
+
fullyQualifiedName: 'v1.plans.retrieve',
|
|
310
448
|
httpMethod: 'get',
|
|
311
449
|
httpPath: '/api/v1/plans/{id}',
|
|
312
450
|
},
|
|
313
451
|
{
|
|
314
|
-
clientCallName: 'client.v1.
|
|
315
|
-
fullyQualifiedName: 'v1.
|
|
452
|
+
clientCallName: 'client.v1.plans.update',
|
|
453
|
+
fullyQualifiedName: 'v1.plans.update',
|
|
454
|
+
httpMethod: 'patch',
|
|
455
|
+
httpPath: '/api/v1/plans/{id}',
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
clientCallName: 'client.v1.plans.list',
|
|
459
|
+
fullyQualifiedName: 'v1.plans.list',
|
|
316
460
|
httpMethod: 'get',
|
|
317
461
|
httpPath: '/api/v1/plans',
|
|
318
462
|
},
|
|
463
|
+
{
|
|
464
|
+
clientCallName: 'client.v1.plans.archive',
|
|
465
|
+
fullyQualifiedName: 'v1.plans.archive',
|
|
466
|
+
httpMethod: 'post',
|
|
467
|
+
httpPath: '/api/v1/plans/{id}/archive',
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
clientCallName: 'client.v1.plans.createDraft',
|
|
471
|
+
fullyQualifiedName: 'v1.plans.createDraft',
|
|
472
|
+
httpMethod: 'post',
|
|
473
|
+
httpPath: '/api/v1/plans/{id}/draft',
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
clientCallName: 'client.v1.plans.publish',
|
|
477
|
+
fullyQualifiedName: 'v1.plans.publish',
|
|
478
|
+
httpMethod: 'post',
|
|
479
|
+
httpPath: '/api/v1/plans/{id}/publish',
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
clientCallName: 'client.v1.plans.removeDraft',
|
|
483
|
+
fullyQualifiedName: 'v1.plans.removeDraft',
|
|
484
|
+
httpMethod: 'delete',
|
|
485
|
+
httpPath: '/api/v1/plans/{id}/draft',
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
clientCallName: 'client.v1.plans.entitlements.create',
|
|
489
|
+
fullyQualifiedName: 'v1.plans.entitlements.create',
|
|
490
|
+
httpMethod: 'post',
|
|
491
|
+
httpPath: '/api/v1/plans/{planId}/entitlements',
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
clientCallName: 'client.v1.plans.entitlements.update',
|
|
495
|
+
fullyQualifiedName: 'v1.plans.entitlements.update',
|
|
496
|
+
httpMethod: 'patch',
|
|
497
|
+
httpPath: '/api/v1/plans/{planId}/entitlements/{id}',
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
clientCallName: 'client.v1.plans.entitlements.list',
|
|
501
|
+
fullyQualifiedName: 'v1.plans.entitlements.list',
|
|
502
|
+
httpMethod: 'get',
|
|
503
|
+
httpPath: '/api/v1/plans/{planId}/entitlements',
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
clientCallName: 'client.v1.plans.entitlements.delete',
|
|
507
|
+
fullyQualifiedName: 'v1.plans.entitlements.delete',
|
|
508
|
+
httpMethod: 'delete',
|
|
509
|
+
httpPath: '/api/v1/plans/{planId}/entitlements/{id}',
|
|
510
|
+
},
|
|
319
511
|
{
|
|
320
512
|
clientCallName: 'client.v1.usage.history',
|
|
321
513
|
fullyQualifiedName: 'v1.usage.history',
|
package/src/options.ts
CHANGED
|
@@ -8,19 +8,27 @@ import { readEnv } from './util';
|
|
|
8
8
|
|
|
9
9
|
export type CLIOptions = McpOptions & {
|
|
10
10
|
debug: boolean;
|
|
11
|
+
logFormat: 'json' | 'pretty';
|
|
11
12
|
transport: 'stdio' | 'http';
|
|
12
13
|
port: number | undefined;
|
|
13
14
|
socket: string | undefined;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
export type McpOptions = {
|
|
18
|
+
includeCodeTool?: boolean | undefined;
|
|
17
19
|
includeDocsTools?: boolean | undefined;
|
|
18
20
|
stainlessApiKey?: string | undefined;
|
|
21
|
+
docsSearchMode?: 'stainless-api' | 'local' | undefined;
|
|
22
|
+
docsDir?: string | undefined;
|
|
19
23
|
codeAllowHttpGets?: boolean | undefined;
|
|
20
24
|
codeAllowedMethods?: string[] | undefined;
|
|
21
25
|
codeBlockedMethods?: string[] | undefined;
|
|
26
|
+
codeExecutionMode: McpCodeExecutionMode;
|
|
27
|
+
customInstructionsPath?: string | undefined;
|
|
22
28
|
};
|
|
23
29
|
|
|
30
|
+
export type McpCodeExecutionMode = 'stainless-sandbox' | 'local';
|
|
31
|
+
|
|
24
32
|
export function parseCLIOptions(): CLIOptions {
|
|
25
33
|
const opts = yargs(hideBin(process.argv))
|
|
26
34
|
.option('code-allow-http-gets', {
|
|
@@ -40,7 +48,35 @@ export function parseCLIOptions(): CLIOptions {
|
|
|
40
48
|
description:
|
|
41
49
|
'Methods to explicitly block for code tool. Evaluated as regular expressions against method fully qualified names. If all code-allow-* flags are unset, then everything is allowed.',
|
|
42
50
|
})
|
|
51
|
+
.option('code-execution-mode', {
|
|
52
|
+
type: 'string',
|
|
53
|
+
choices: ['stainless-sandbox', 'local'],
|
|
54
|
+
default: 'stainless-sandbox',
|
|
55
|
+
description:
|
|
56
|
+
"Where to run code execution in code tool; 'stainless-sandbox' will execute code in Stainless-hosted sandboxes whereas 'local' will execute code locally on the MCP server machine.",
|
|
57
|
+
})
|
|
58
|
+
.option('custom-instructions-path', {
|
|
59
|
+
type: 'string',
|
|
60
|
+
description: 'Path to custom instructions for the MCP server',
|
|
61
|
+
})
|
|
43
62
|
.option('debug', { type: 'boolean', description: 'Enable debug logging' })
|
|
63
|
+
.option('docs-dir', {
|
|
64
|
+
type: 'string',
|
|
65
|
+
description:
|
|
66
|
+
'Path to a directory of local documentation files (markdown/JSON) to include in local docs search.',
|
|
67
|
+
})
|
|
68
|
+
.option('docs-search-mode', {
|
|
69
|
+
type: 'string',
|
|
70
|
+
choices: ['stainless-api', 'local'],
|
|
71
|
+
default: 'stainless-api',
|
|
72
|
+
description:
|
|
73
|
+
"Where to search documentation; 'stainless-api' uses the Stainless-hosted search API whereas 'local' uses an in-memory search index built from embedded SDK method data and optional local docs files.",
|
|
74
|
+
})
|
|
75
|
+
.option('log-format', {
|
|
76
|
+
type: 'string',
|
|
77
|
+
choices: ['json', 'pretty'],
|
|
78
|
+
description: 'Format for log output; defaults to json unless tty is detected',
|
|
79
|
+
})
|
|
44
80
|
.option('no-tools', {
|
|
45
81
|
type: 'string',
|
|
46
82
|
array: true,
|
|
@@ -82,18 +118,29 @@ export function parseCLIOptions(): CLIOptions {
|
|
|
82
118
|
: argv.tools?.includes(toolType) ? true
|
|
83
119
|
: undefined;
|
|
84
120
|
|
|
121
|
+
const includeCodeTool = shouldIncludeToolType('code');
|
|
85
122
|
const includeDocsTools = shouldIncludeToolType('docs');
|
|
86
123
|
|
|
87
124
|
const transport = argv.transport as 'stdio' | 'http';
|
|
125
|
+
const logFormat =
|
|
126
|
+
argv.logFormat ? (argv.logFormat as 'json' | 'pretty')
|
|
127
|
+
: process.stderr.isTTY ? 'pretty'
|
|
128
|
+
: 'json';
|
|
88
129
|
|
|
89
130
|
return {
|
|
131
|
+
...(includeCodeTool !== undefined && { includeCodeTool }),
|
|
90
132
|
...(includeDocsTools !== undefined && { includeDocsTools }),
|
|
91
133
|
debug: !!argv.debug,
|
|
92
134
|
stainlessApiKey: argv.stainlessApiKey,
|
|
135
|
+
docsSearchMode: argv.docsSearchMode as 'stainless-api' | 'local' | undefined,
|
|
136
|
+
docsDir: argv.docsDir,
|
|
93
137
|
codeAllowHttpGets: argv.codeAllowHttpGets,
|
|
94
138
|
codeAllowedMethods: argv.codeAllowedMethods,
|
|
95
139
|
codeBlockedMethods: argv.codeBlockedMethods,
|
|
140
|
+
codeExecutionMode: argv.codeExecutionMode as McpCodeExecutionMode,
|
|
141
|
+
customInstructionsPath: argv.customInstructionsPath,
|
|
96
142
|
transport,
|
|
143
|
+
logFormat,
|
|
97
144
|
port: argv.port,
|
|
98
145
|
socket: argv.socket,
|
|
99
146
|
};
|
|
@@ -118,12 +165,21 @@ export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): M
|
|
|
118
165
|
const queryObject = typeof query === 'string' ? qs.parse(query) : query;
|
|
119
166
|
const queryOptions = QueryOptions.parse(queryObject);
|
|
120
167
|
|
|
168
|
+
let codeTool: boolean | undefined =
|
|
169
|
+
queryOptions.no_tools && queryOptions.no_tools?.includes('code') ? false
|
|
170
|
+
: queryOptions.tools?.includes('code') ? true
|
|
171
|
+
: defaultOptions.includeCodeTool;
|
|
172
|
+
|
|
121
173
|
let docsTools: boolean | undefined =
|
|
122
174
|
queryOptions.no_tools && queryOptions.no_tools?.includes('docs') ? false
|
|
123
175
|
: queryOptions.tools?.includes('docs') ? true
|
|
124
176
|
: defaultOptions.includeDocsTools;
|
|
125
177
|
|
|
126
178
|
return {
|
|
179
|
+
...(codeTool !== undefined && { includeCodeTool: codeTool }),
|
|
127
180
|
...(docsTools !== undefined && { includeDocsTools: docsTools }),
|
|
181
|
+
codeExecutionMode: defaultOptions.codeExecutionMode,
|
|
182
|
+
docsSearchMode: defaultOptions.docsSearchMode,
|
|
183
|
+
docsDir: defaultOptions.docsDir,
|
|
128
184
|
};
|
|
129
185
|
}
|