@roarkanalytics/sdk-mcp 2.19.1 → 2.23.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.
- package/README.md +1 -1
- package/auth.d.mts +6 -0
- package/auth.d.mts.map +1 -0
- package/auth.d.ts +6 -0
- package/auth.d.ts.map +1 -0
- package/{headers.mjs → auth.js} +18 -2
- package/auth.js.map +1 -0
- package/{headers.js → auth.mjs} +13 -6
- package/auth.mjs.map +1 -0
- package/code-tool.d.mts +4 -1
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts +4 -1
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +22 -10
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +20 -8
- package/code-tool.mjs.map +1 -1
- package/docs-search-tool.d.mts +9 -3
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts +9 -3
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +6 -2
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +6 -2
- package/docs-search-tool.mjs.map +1 -1
- package/http.d.mts +2 -2
- package/http.d.mts.map +1 -1
- package/http.d.ts +2 -2
- package/http.d.ts.map +1 -1
- package/http.js +11 -8
- package/http.js.map +1 -1
- package/http.mjs +11 -8
- package/http.mjs.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/methods.d.mts +10 -0
- package/methods.d.mts.map +1 -0
- package/methods.d.ts +10 -0
- package/methods.d.ts.map +1 -0
- package/methods.js +383 -0
- package/methods.js.map +1 -0
- package/methods.mjs +379 -0
- package/methods.mjs.map +1 -0
- package/options.d.mts +4 -0
- package/options.d.mts.map +1 -1
- package/options.d.ts +4 -0
- package/options.d.ts.map +1 -1
- package/options.js +25 -0
- package/options.js.map +1 -1
- package/options.mjs +25 -0
- package/options.mjs.map +1 -1
- package/package.json +134 -17
- package/server.d.mts +8 -9
- package/server.d.mts.map +1 -1
- package/server.d.ts +8 -9
- package/server.d.ts.map +1 -1
- package/server.js +62 -39
- package/server.js.map +1 -1
- package/server.mjs +61 -35
- package/server.mjs.map +1 -1
- package/src/{headers.ts → auth.ts} +16 -1
- package/src/code-tool.ts +37 -9
- package/src/docs-search-tool.ts +13 -4
- package/src/http.ts +19 -8
- package/src/index.ts +1 -1
- package/src/methods.ts +404 -0
- package/src/options.ts +34 -0
- package/src/server.ts +79 -45
- package/src/stdio.ts +4 -3
- package/src/types.ts +12 -4
- package/src/util.ts +25 -0
- package/stdio.d.mts +2 -1
- package/stdio.d.mts.map +1 -1
- package/stdio.d.ts +2 -1
- package/stdio.d.ts.map +1 -1
- package/stdio.js +3 -3
- package/stdio.js.map +1 -1
- package/stdio.mjs +3 -3
- package/stdio.mjs.map +1 -1
- package/types.d.mts +8 -1
- package/types.d.mts.map +1 -1
- package/types.d.ts +8 -1
- package/types.d.ts.map +1 -1
- package/types.js.map +1 -1
- package/types.mjs.map +1 -1
- package/util.d.mts +4 -0
- package/util.d.mts.map +1 -0
- package/util.d.ts +4 -0
- package/util.d.ts.map +1 -0
- package/util.js +30 -0
- package/util.js.map +1 -0
- package/util.mjs +24 -0
- package/util.mjs.map +1 -0
- package/headers.d.mts +0 -4
- package/headers.d.mts.map +0 -1
- package/headers.d.ts +0 -4
- package/headers.d.ts.map +0 -1
- package/headers.js.map +0 -1
- package/headers.mjs.map +0 -1
package/methods.mjs
ADDED
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
export const sdkMethods = [
|
|
3
|
+
{
|
|
4
|
+
clientCallName: 'client.health.get',
|
|
5
|
+
fullyQualifiedName: 'health.get',
|
|
6
|
+
httpMethod: 'get',
|
|
7
|
+
httpPath: '/health',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
clientCallName: 'client.evaluation.createEvaluator',
|
|
11
|
+
fullyQualifiedName: 'evaluation.createEvaluator',
|
|
12
|
+
httpMethod: 'post',
|
|
13
|
+
httpPath: '/v1/evaluation/evaluators',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
clientCallName: 'client.evaluation.createJob',
|
|
17
|
+
fullyQualifiedName: 'evaluation.createJob',
|
|
18
|
+
httpMethod: 'post',
|
|
19
|
+
httpPath: '/v1/evaluation/job',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
clientCallName: 'client.evaluation.getEvaluatorByID',
|
|
23
|
+
fullyQualifiedName: 'evaluation.getEvaluatorByID',
|
|
24
|
+
httpMethod: 'get',
|
|
25
|
+
httpPath: '/v1/evaluation/evaluators/{evaluatorId}',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
clientCallName: 'client.evaluation.getJob',
|
|
29
|
+
fullyQualifiedName: 'evaluation.getJob',
|
|
30
|
+
httpMethod: 'get',
|
|
31
|
+
httpPath: '/v1/evaluation/job/{jobId}',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
clientCallName: 'client.evaluation.listEvaluators',
|
|
35
|
+
fullyQualifiedName: 'evaluation.listEvaluators',
|
|
36
|
+
httpMethod: 'get',
|
|
37
|
+
httpPath: '/v1/evaluation/evaluators',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
clientCallName: 'client.evaluation.listJobRuns',
|
|
41
|
+
fullyQualifiedName: 'evaluation.listJobRuns',
|
|
42
|
+
httpMethod: 'get',
|
|
43
|
+
httpPath: '/v1/evaluation/job/{jobId}/runs',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
clientCallName: 'client.evaluation.updateEvaluator',
|
|
47
|
+
fullyQualifiedName: 'evaluation.updateEvaluator',
|
|
48
|
+
httpMethod: 'put',
|
|
49
|
+
httpPath: '/v1/evaluation/evaluators/{evaluatorId}',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
clientCallName: 'client.call.create',
|
|
53
|
+
fullyQualifiedName: 'call.create',
|
|
54
|
+
httpMethod: 'post',
|
|
55
|
+
httpPath: '/v1/call',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
clientCallName: 'client.call.list',
|
|
59
|
+
fullyQualifiedName: 'call.list',
|
|
60
|
+
httpMethod: 'get',
|
|
61
|
+
httpPath: '/v1/call',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
clientCallName: 'client.call.getByID',
|
|
65
|
+
fullyQualifiedName: 'call.getByID',
|
|
66
|
+
httpMethod: 'get',
|
|
67
|
+
httpPath: '/v1/call/{callId}',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
clientCallName: 'client.call.getTranscript',
|
|
71
|
+
fullyQualifiedName: 'call.getTranscript',
|
|
72
|
+
httpMethod: 'get',
|
|
73
|
+
httpPath: '/v1/call/{callId}/transcript',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
clientCallName: 'client.call.listEvaluationRuns',
|
|
77
|
+
fullyQualifiedName: 'call.listEvaluationRuns',
|
|
78
|
+
httpMethod: 'get',
|
|
79
|
+
httpPath: '/v1/call/{callId}/evaluation-run',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
clientCallName: 'client.call.listMetrics',
|
|
83
|
+
fullyQualifiedName: 'call.listMetrics',
|
|
84
|
+
httpMethod: 'get',
|
|
85
|
+
httpPath: '/v1/call/{callId}/metrics',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
clientCallName: 'client.call.listSentimentRuns',
|
|
89
|
+
fullyQualifiedName: 'call.listSentimentRuns',
|
|
90
|
+
httpMethod: 'get',
|
|
91
|
+
httpPath: '/v1/call/{callId}/sentiment-run',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
clientCallName: 'client.metric.listDefinitions',
|
|
95
|
+
fullyQualifiedName: 'metric.listDefinitions',
|
|
96
|
+
httpMethod: 'get',
|
|
97
|
+
httpPath: '/v1/metric/definitions',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
clientCallName: 'client.integrations.createRetellCall',
|
|
101
|
+
fullyQualifiedName: 'integrations.createRetellCall',
|
|
102
|
+
httpMethod: 'post',
|
|
103
|
+
httpPath: '/v1/retell/call',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
clientCallName: 'client.integrations.createVapiCall',
|
|
107
|
+
fullyQualifiedName: 'integrations.createVapiCall',
|
|
108
|
+
httpMethod: 'post',
|
|
109
|
+
httpPath: '/v1/vapi/call',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
clientCallName: 'client.simulationJob.getByID',
|
|
113
|
+
fullyQualifiedName: 'simulationJob.getByID',
|
|
114
|
+
httpMethod: 'get',
|
|
115
|
+
httpPath: '/v1/simulation/job/{jobId}',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
clientCallName: 'client.simulationJob.lookup',
|
|
119
|
+
fullyQualifiedName: 'simulationJob.lookup',
|
|
120
|
+
httpMethod: 'get',
|
|
121
|
+
httpPath: '/v1/simulation/job/lookup',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
clientCallName: 'client.simulationRunPlan.create',
|
|
125
|
+
fullyQualifiedName: 'simulationRunPlan.create',
|
|
126
|
+
httpMethod: 'post',
|
|
127
|
+
httpPath: '/v1/simulation/plan',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
clientCallName: 'client.simulationRunPlan.update',
|
|
131
|
+
fullyQualifiedName: 'simulationRunPlan.update',
|
|
132
|
+
httpMethod: 'put',
|
|
133
|
+
httpPath: '/v1/simulation/plan/{planId}',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
clientCallName: 'client.simulationRunPlan.list',
|
|
137
|
+
fullyQualifiedName: 'simulationRunPlan.list',
|
|
138
|
+
httpMethod: 'get',
|
|
139
|
+
httpPath: '/v1/simulation/plan',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
clientCallName: 'client.simulationRunPlan.delete',
|
|
143
|
+
fullyQualifiedName: 'simulationRunPlan.delete',
|
|
144
|
+
httpMethod: 'delete',
|
|
145
|
+
httpPath: '/v1/simulation/plan/{planId}',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
clientCallName: 'client.simulationRunPlan.getByID',
|
|
149
|
+
fullyQualifiedName: 'simulationRunPlan.getByID',
|
|
150
|
+
httpMethod: 'get',
|
|
151
|
+
httpPath: '/v1/simulation/plan/{planId}',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
clientCallName: 'client.simulationRunPlanJob.list',
|
|
155
|
+
fullyQualifiedName: 'simulationRunPlanJob.list',
|
|
156
|
+
httpMethod: 'get',
|
|
157
|
+
httpPath: '/v1/simulation/plan/jobs',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
clientCallName: 'client.simulationRunPlanJob.getByID',
|
|
161
|
+
fullyQualifiedName: 'simulationRunPlanJob.getByID',
|
|
162
|
+
httpMethod: 'get',
|
|
163
|
+
httpPath: '/v1/simulation/plan/job/{jobId}',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
clientCallName: 'client.simulationRunPlanJob.start',
|
|
167
|
+
fullyQualifiedName: 'simulationRunPlanJob.start',
|
|
168
|
+
httpMethod: 'post',
|
|
169
|
+
httpPath: '/v1/simulation/plan/{planId}/job',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
clientCallName: 'client.simulationScenario.create',
|
|
173
|
+
fullyQualifiedName: 'simulationScenario.create',
|
|
174
|
+
httpMethod: 'post',
|
|
175
|
+
httpPath: '/v1/simulation/scenario',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
clientCallName: 'client.simulationScenario.update',
|
|
179
|
+
fullyQualifiedName: 'simulationScenario.update',
|
|
180
|
+
httpMethod: 'put',
|
|
181
|
+
httpPath: '/v1/simulation/scenario/{scenarioId}',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
clientCallName: 'client.simulationScenario.list',
|
|
185
|
+
fullyQualifiedName: 'simulationScenario.list',
|
|
186
|
+
httpMethod: 'get',
|
|
187
|
+
httpPath: '/v1/simulation/scenario',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
clientCallName: 'client.simulationScenario.delete',
|
|
191
|
+
fullyQualifiedName: 'simulationScenario.delete',
|
|
192
|
+
httpMethod: 'delete',
|
|
193
|
+
httpPath: '/v1/simulation/scenario/{scenarioId}',
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
clientCallName: 'client.simulationScenario.getByID',
|
|
197
|
+
fullyQualifiedName: 'simulationScenario.getByID',
|
|
198
|
+
httpMethod: 'get',
|
|
199
|
+
httpPath: '/v1/simulation/scenario/{scenarioId}',
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
clientCallName: 'client.simulationPersona.create',
|
|
203
|
+
fullyQualifiedName: 'simulationPersona.create',
|
|
204
|
+
httpMethod: 'post',
|
|
205
|
+
httpPath: '/v1/persona',
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
clientCallName: 'client.simulationPersona.update',
|
|
209
|
+
fullyQualifiedName: 'simulationPersona.update',
|
|
210
|
+
httpMethod: 'put',
|
|
211
|
+
httpPath: '/v1/persona/{personaId}',
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
clientCallName: 'client.simulationPersona.list',
|
|
215
|
+
fullyQualifiedName: 'simulationPersona.list',
|
|
216
|
+
httpMethod: 'get',
|
|
217
|
+
httpPath: '/v1/persona',
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
clientCallName: 'client.simulationPersona.getByID',
|
|
221
|
+
fullyQualifiedName: 'simulationPersona.getByID',
|
|
222
|
+
httpMethod: 'get',
|
|
223
|
+
httpPath: '/v1/persona/{personaId}',
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
clientCallName: 'client.agent.create',
|
|
227
|
+
fullyQualifiedName: 'agent.create',
|
|
228
|
+
httpMethod: 'post',
|
|
229
|
+
httpPath: '/v1/agent',
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
clientCallName: 'client.agent.update',
|
|
233
|
+
fullyQualifiedName: 'agent.update',
|
|
234
|
+
httpMethod: 'put',
|
|
235
|
+
httpPath: '/v1/agent/{agentId}',
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
clientCallName: 'client.agent.list',
|
|
239
|
+
fullyQualifiedName: 'agent.list',
|
|
240
|
+
httpMethod: 'get',
|
|
241
|
+
httpPath: '/v1/agent',
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
clientCallName: 'client.agent.getByID',
|
|
245
|
+
fullyQualifiedName: 'agent.getByID',
|
|
246
|
+
httpMethod: 'get',
|
|
247
|
+
httpPath: '/v1/agent/{agentId}',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
clientCallName: 'client.agentEndpoint.create',
|
|
251
|
+
fullyQualifiedName: 'agentEndpoint.create',
|
|
252
|
+
httpMethod: 'post',
|
|
253
|
+
httpPath: '/v1/agent/endpoint',
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
clientCallName: 'client.agentEndpoint.update',
|
|
257
|
+
fullyQualifiedName: 'agentEndpoint.update',
|
|
258
|
+
httpMethod: 'put',
|
|
259
|
+
httpPath: '/v1/agent/endpoint/{endpointId}',
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
clientCallName: 'client.agentEndpoint.list',
|
|
263
|
+
fullyQualifiedName: 'agentEndpoint.list',
|
|
264
|
+
httpMethod: 'get',
|
|
265
|
+
httpPath: '/v1/agent/endpoint',
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
clientCallName: 'client.agentEndpoint.getByID',
|
|
269
|
+
fullyQualifiedName: 'agentEndpoint.getByID',
|
|
270
|
+
httpMethod: 'get',
|
|
271
|
+
httpPath: '/v1/agent/endpoint/{endpointId}',
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
clientCallName: 'client.httpRequestDefinition.create',
|
|
275
|
+
fullyQualifiedName: 'httpRequestDefinition.create',
|
|
276
|
+
httpMethod: 'post',
|
|
277
|
+
httpPath: '/v1/http-request-definition',
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
clientCallName: 'client.httpRequestDefinition.update',
|
|
281
|
+
fullyQualifiedName: 'httpRequestDefinition.update',
|
|
282
|
+
httpMethod: 'put',
|
|
283
|
+
httpPath: '/v1/http-request-definition/{definitionId}',
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
clientCallName: 'client.httpRequestDefinition.list',
|
|
287
|
+
fullyQualifiedName: 'httpRequestDefinition.list',
|
|
288
|
+
httpMethod: 'get',
|
|
289
|
+
httpPath: '/v1/http-request-definition',
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
clientCallName: 'client.httpRequestDefinition.getByID',
|
|
293
|
+
fullyQualifiedName: 'httpRequestDefinition.getByID',
|
|
294
|
+
httpMethod: 'get',
|
|
295
|
+
httpPath: '/v1/http-request-definition/{definitionId}',
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
clientCallName: 'client.webhook.create',
|
|
299
|
+
fullyQualifiedName: 'webhook.create',
|
|
300
|
+
httpMethod: 'post',
|
|
301
|
+
httpPath: '/v1/webhook',
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
clientCallName: 'client.webhook.list',
|
|
305
|
+
fullyQualifiedName: 'webhook.list',
|
|
306
|
+
httpMethod: 'get',
|
|
307
|
+
httpPath: '/v1/webhook',
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
clientCallName: 'client.webhook.delete',
|
|
311
|
+
fullyQualifiedName: 'webhook.delete',
|
|
312
|
+
httpMethod: 'delete',
|
|
313
|
+
httpPath: '/v1/webhook/{webhookId}',
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
clientCallName: 'client.webhook.getByID',
|
|
317
|
+
fullyQualifiedName: 'webhook.getByID',
|
|
318
|
+
httpMethod: 'get',
|
|
319
|
+
httpPath: '/v1/webhook/{webhookId}',
|
|
320
|
+
},
|
|
321
|
+
];
|
|
322
|
+
function allowedMethodsForCodeTool(options) {
|
|
323
|
+
if (!options) {
|
|
324
|
+
return undefined;
|
|
325
|
+
}
|
|
326
|
+
let allowedMethods;
|
|
327
|
+
if (options.codeAllowHttpGets || options.codeAllowedMethods) {
|
|
328
|
+
// Start with nothing allowed and then add into it from options
|
|
329
|
+
let allowedMethodsSet = new Set();
|
|
330
|
+
if (options.codeAllowHttpGets) {
|
|
331
|
+
// Add all methods that map to an HTTP GET
|
|
332
|
+
sdkMethods
|
|
333
|
+
.filter((method) => method.httpMethod === 'get')
|
|
334
|
+
.forEach((method) => allowedMethodsSet.add(method));
|
|
335
|
+
}
|
|
336
|
+
if (options.codeAllowedMethods) {
|
|
337
|
+
// Add all methods that match any of the allowed regexps
|
|
338
|
+
const allowedRegexps = options.codeAllowedMethods.map((pattern) => {
|
|
339
|
+
try {
|
|
340
|
+
return new RegExp(pattern);
|
|
341
|
+
}
|
|
342
|
+
catch (e) {
|
|
343
|
+
throw new Error(`Invalid regex pattern for allowed method: "${pattern}": ${e instanceof Error ? e.message : e}`);
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
sdkMethods
|
|
347
|
+
.filter((method) => allowedRegexps.some((regexp) => regexp.test(method.fullyQualifiedName)))
|
|
348
|
+
.forEach((method) => allowedMethodsSet.add(method));
|
|
349
|
+
}
|
|
350
|
+
allowedMethods = Array.from(allowedMethodsSet);
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
// Start with everything allowed
|
|
354
|
+
allowedMethods = [...sdkMethods];
|
|
355
|
+
}
|
|
356
|
+
if (options.codeBlockedMethods) {
|
|
357
|
+
// Filter down based on blocked regexps
|
|
358
|
+
const blockedRegexps = options.codeBlockedMethods.map((pattern) => {
|
|
359
|
+
try {
|
|
360
|
+
return new RegExp(pattern);
|
|
361
|
+
}
|
|
362
|
+
catch (e) {
|
|
363
|
+
throw new Error(`Invalid regex pattern for blocked method: "${pattern}": ${e instanceof Error ? e.message : e}`);
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
allowedMethods = allowedMethods.filter((method) => !blockedRegexps.some((regexp) => regexp.test(method.fullyQualifiedName)));
|
|
367
|
+
}
|
|
368
|
+
return allowedMethods;
|
|
369
|
+
}
|
|
370
|
+
export function blockedMethodsForCodeTool(options) {
|
|
371
|
+
const allowedMethods = allowedMethodsForCodeTool(options);
|
|
372
|
+
if (!allowedMethods) {
|
|
373
|
+
return undefined;
|
|
374
|
+
}
|
|
375
|
+
const allowedSet = new Set(allowedMethods.map((method) => method.fullyQualifiedName));
|
|
376
|
+
// Return any methods that are not explicitly allowed
|
|
377
|
+
return sdkMethods.filter((method) => !allowedSet.has(method.fullyQualifiedName));
|
|
378
|
+
}
|
|
379
|
+
//# sourceMappingURL=methods.mjs.map
|
package/methods.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.mjs","sourceRoot":"","sources":["src/methods.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAWtF,MAAM,CAAC,MAAM,UAAU,GAAgB;IACrC;QACE,cAAc,EAAE,mBAAmB;QACnC,kBAAkB,EAAE,YAAY;QAChC,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,SAAS;KACpB;IACD;QACE,cAAc,EAAE,mCAAmC;QACnD,kBAAkB,EAAE,4BAA4B;QAChD,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,2BAA2B;KACtC;IACD;QACE,cAAc,EAAE,6BAA6B;QAC7C,kBAAkB,EAAE,sBAAsB;QAC1C,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,oBAAoB;KAC/B;IACD;QACE,cAAc,EAAE,oCAAoC;QACpD,kBAAkB,EAAE,6BAA6B;QACjD,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,yCAAyC;KACpD;IACD;QACE,cAAc,EAAE,0BAA0B;QAC1C,kBAAkB,EAAE,mBAAmB;QACvC,U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,CACb,8CAA8C,OAAO,MAAM,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAChG,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,cAAc,GAAG,cAAc,CAAC,MAAM,CACpC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CACrF,CAAC;IACJ,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,OAA+B;IACvE,MAAM,cAAc,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAC1D,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAEtF,qDAAqD;IACrD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACnF,CAAC"}
|
package/options.d.mts
CHANGED
|
@@ -6,6 +6,10 @@ export type CLIOptions = McpOptions & {
|
|
|
6
6
|
};
|
|
7
7
|
export type McpOptions = {
|
|
8
8
|
includeDocsTools?: boolean | undefined;
|
|
9
|
+
stainlessApiKey?: string | undefined;
|
|
10
|
+
codeAllowHttpGets?: boolean | undefined;
|
|
11
|
+
codeAllowedMethods?: string[] | undefined;
|
|
12
|
+
codeBlockedMethods?: string[] | undefined;
|
|
9
13
|
};
|
|
10
14
|
export declare function parseCLIOptions(): CLIOptions;
|
|
11
15
|
export declare function parseQueryOptions(defaultOptions: McpOptions, query: unknown): McpOptions;
|
package/options.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.mts","sourceRoot":"","sources":["src/options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"options.d.mts","sourceRoot":"","sources":["src/options.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACxC,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC1C,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CAC3C,CAAC;AAEF,wBAAgB,eAAe,IAAI,UAAU,CA4E5C;AAiBD,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,CAYxF"}
|
package/options.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ export type CLIOptions = McpOptions & {
|
|
|
6
6
|
};
|
|
7
7
|
export type McpOptions = {
|
|
8
8
|
includeDocsTools?: boolean | undefined;
|
|
9
|
+
stainlessApiKey?: string | undefined;
|
|
10
|
+
codeAllowHttpGets?: boolean | undefined;
|
|
11
|
+
codeAllowedMethods?: string[] | undefined;
|
|
12
|
+
codeBlockedMethods?: string[] | undefined;
|
|
9
13
|
};
|
|
10
14
|
export declare function parseCLIOptions(): CLIOptions;
|
|
11
15
|
export declare function parseQueryOptions(defaultOptions: McpOptions, query: unknown): McpOptions;
|
package/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["src/options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["src/options.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACxC,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC1C,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CAC3C,CAAC;AAEF,wBAAgB,eAAe,IAAI,UAAU,CA4E5C;AAiBD,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,CAYxF"}
|
package/options.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
3
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
5
|
};
|
|
@@ -9,8 +10,23 @@ const qs_1 = __importDefault(require("qs"));
|
|
|
9
10
|
const yargs_1 = __importDefault(require("yargs"));
|
|
10
11
|
const helpers_1 = require("yargs/helpers");
|
|
11
12
|
const zod_1 = __importDefault(require("zod"));
|
|
13
|
+
const util_1 = require("./util.js");
|
|
12
14
|
function parseCLIOptions() {
|
|
13
15
|
const opts = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
16
|
+
.option('code-allow-http-gets', {
|
|
17
|
+
type: 'boolean',
|
|
18
|
+
description: 'Allow all code tool methods that map to HTTP GET operations. If all code-allow-* flags are unset, then everything is allowed.',
|
|
19
|
+
})
|
|
20
|
+
.option('code-allowed-methods', {
|
|
21
|
+
type: 'string',
|
|
22
|
+
array: true,
|
|
23
|
+
description: 'Methods to explicitly allow for code tool. Evaluated as regular expressions against method fully qualified names. If all code-allow-* flags are unset, then everything is allowed.',
|
|
24
|
+
})
|
|
25
|
+
.option('code-blocked-methods', {
|
|
26
|
+
type: 'string',
|
|
27
|
+
array: true,
|
|
28
|
+
description: '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.',
|
|
29
|
+
})
|
|
14
30
|
.option('debug', { type: 'boolean', description: 'Enable debug logging' })
|
|
15
31
|
.option('no-tools', {
|
|
16
32
|
type: 'string',
|
|
@@ -24,6 +40,11 @@ function parseCLIOptions() {
|
|
|
24
40
|
description: 'Port to serve on if using http transport',
|
|
25
41
|
})
|
|
26
42
|
.option('socket', { type: 'string', description: 'Unix socket to serve on if using http transport' })
|
|
43
|
+
.option('stainless-api-key', {
|
|
44
|
+
type: 'string',
|
|
45
|
+
default: (0, util_1.readEnv)('STAINLESS_API_KEY'),
|
|
46
|
+
description: 'API key for Stainless. Used to authenticate requests to Stainless-hosted tools endpoints.',
|
|
47
|
+
})
|
|
27
48
|
.option('tools', {
|
|
28
49
|
type: 'string',
|
|
29
50
|
array: true,
|
|
@@ -48,6 +69,10 @@ function parseCLIOptions() {
|
|
|
48
69
|
return {
|
|
49
70
|
...(includeDocsTools !== undefined && { includeDocsTools }),
|
|
50
71
|
debug: !!argv.debug,
|
|
72
|
+
stainlessApiKey: argv.stainlessApiKey,
|
|
73
|
+
codeAllowHttpGets: argv.codeAllowHttpGets,
|
|
74
|
+
codeAllowedMethods: argv.codeAllowedMethods,
|
|
75
|
+
codeBlockedMethods: argv.codeBlockedMethods,
|
|
51
76
|
transport,
|
|
52
77
|
port: argv.port,
|
|
53
78
|
socket: argv.socket,
|
package/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["src/options.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["src/options.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;AAuBtF,0CA4EC;AAiBD,8CAYC;AA9HD,4CAAoB;AACpB,kDAA0B;AAC1B,2CAAwC;AACxC,8CAAoB;AACpB,oCAAiC;AAiBjC,SAAgB,eAAe;IAC7B,MAAM,IAAI,GAAG,IAAA,eAAK,EAAC,IAAA,iBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SACtC,MAAM,CAAC,sBAAsB,EAAE;QAC9B,IAAI,EAAE,SAAS;QACf,WAAW,EACT,+HAA+H;KAClI,CAAC;SACD,MAAM,CAAC,sBAAsB,EAAE;QAC9B,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,IAAI;QACX,WAAW,EACT,oLAAoL;KACvL,CAAC;SACD,MAAM,CAAC,sBAAsB,EAAE;QAC9B,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,IAAI;QACX,WAAW,EACT,oLAAoL;KACvL,CAAC;SACD,MAAM,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;SACzE,MAAM,CAAC,UAAU,EAAE;QAClB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;QACzB,WAAW,EAAE,6BAA6B;KAC3C,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACd,IAAI,EAAE,QA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ACxE,MAAM,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAErD,IAAI,SAAS,GACX,YAAY,CAAC,QAAQ,IAAI,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK;QACxE,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;YAC7C,CAAC,CAAC,cAAc,CAAC,gBAAgB,CAAC;IAEpC,OAAO;QACL,GAAG,CAAC,SAAS,KAAK,SAAS,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,CAAC;KAChE,CAAC;AACJ,CAAC"}
|
package/options.mjs
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
1
2
|
import qs from 'qs';
|
|
2
3
|
import yargs from 'yargs';
|
|
3
4
|
import { hideBin } from 'yargs/helpers';
|
|
4
5
|
import z from 'zod';
|
|
6
|
+
import { readEnv } from "./util.mjs";
|
|
5
7
|
export function parseCLIOptions() {
|
|
6
8
|
const opts = yargs(hideBin(process.argv))
|
|
9
|
+
.option('code-allow-http-gets', {
|
|
10
|
+
type: 'boolean',
|
|
11
|
+
description: 'Allow all code tool methods that map to HTTP GET operations. If all code-allow-* flags are unset, then everything is allowed.',
|
|
12
|
+
})
|
|
13
|
+
.option('code-allowed-methods', {
|
|
14
|
+
type: 'string',
|
|
15
|
+
array: true,
|
|
16
|
+
description: 'Methods to explicitly allow for code tool. Evaluated as regular expressions against method fully qualified names. If all code-allow-* flags are unset, then everything is allowed.',
|
|
17
|
+
})
|
|
18
|
+
.option('code-blocked-methods', {
|
|
19
|
+
type: 'string',
|
|
20
|
+
array: true,
|
|
21
|
+
description: '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.',
|
|
22
|
+
})
|
|
7
23
|
.option('debug', { type: 'boolean', description: 'Enable debug logging' })
|
|
8
24
|
.option('no-tools', {
|
|
9
25
|
type: 'string',
|
|
@@ -17,6 +33,11 @@ export function parseCLIOptions() {
|
|
|
17
33
|
description: 'Port to serve on if using http transport',
|
|
18
34
|
})
|
|
19
35
|
.option('socket', { type: 'string', description: 'Unix socket to serve on if using http transport' })
|
|
36
|
+
.option('stainless-api-key', {
|
|
37
|
+
type: 'string',
|
|
38
|
+
default: readEnv('STAINLESS_API_KEY'),
|
|
39
|
+
description: 'API key for Stainless. Used to authenticate requests to Stainless-hosted tools endpoints.',
|
|
40
|
+
})
|
|
20
41
|
.option('tools', {
|
|
21
42
|
type: 'string',
|
|
22
43
|
array: true,
|
|
@@ -41,6 +62,10 @@ export function parseCLIOptions() {
|
|
|
41
62
|
return {
|
|
42
63
|
...(includeDocsTools !== undefined && { includeDocsTools }),
|
|
43
64
|
debug: !!argv.debug,
|
|
65
|
+
stainlessApiKey: argv.stainlessApiKey,
|
|
66
|
+
codeAllowHttpGets: argv.codeAllowHttpGets,
|
|
67
|
+
codeAllowedMethods: argv.codeAllowedMethods,
|
|
68
|
+
codeBlockedMethods: argv.codeBlockedMethods,
|
|
44
69
|
transport,
|
|
45
70
|
port: argv.port,
|
|
46
71
|
socket: argv.socket,
|
package/options.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.mjs","sourceRoot":"","sources":["src/options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"options.mjs","sourceRoot":"","sources":["src/options.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,MAAM,IAAI;OACZ,KAAK,MAAM,OAAO;OAClB,EAAE,OAAO,EAAE,MAAM,eAAe;OAChC,CAAC,MAAM,KAAK;OACZ,EAAE,OAAO,EAAE;AAiBlB,MAAM,UAAU,eAAe;IAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC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