@oneshot-agent/mcp-server 0.39.1 → 0.41.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.
@@ -0,0 +1,351 @@
1
+ // Generated by bun scripts/generate-predict-client.ts from the shared PredictRequestSchema.
2
+ export const predictInputSchema = {
3
+ "type": "object",
4
+ "properties": {
5
+ "model": {
6
+ "type": "string",
7
+ "enum": [
8
+ "simulation",
9
+ "forecast"
10
+ ]
11
+ },
12
+ "time_limit_s": {
13
+ "type": "integer",
14
+ "minimum": 1,
15
+ "maximum": 120,
16
+ "default": 20
17
+ },
18
+ "simulation": {
19
+ "type": "object",
20
+ "properties": {
21
+ "runs": {
22
+ "type": "integer",
23
+ "minimum": 100,
24
+ "maximum": 100000,
25
+ "default": 10000
26
+ },
27
+ "seed": {
28
+ "type": "integer",
29
+ "minimum": 0,
30
+ "maximum": 4294967295
31
+ },
32
+ "percentiles": {
33
+ "type": "array",
34
+ "items": {
35
+ "type": "number",
36
+ "minimum": 0,
37
+ "maximum": 100
38
+ },
39
+ "minItems": 1,
40
+ "maxItems": 20,
41
+ "default": [
42
+ 5,
43
+ 10,
44
+ 25,
45
+ 50,
46
+ 75,
47
+ 90,
48
+ 95
49
+ ]
50
+ },
51
+ "variables": {
52
+ "type": "array",
53
+ "items": {
54
+ "type": "object",
55
+ "properties": {
56
+ "id": {
57
+ "type": "string",
58
+ "minLength": 1,
59
+ "maxLength": 64,
60
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
61
+ },
62
+ "distribution": {
63
+ "anyOf": [
64
+ {
65
+ "type": "object",
66
+ "properties": {
67
+ "kind": {
68
+ "type": "string",
69
+ "const": "fixed"
70
+ },
71
+ "value": {
72
+ "type": "number"
73
+ }
74
+ },
75
+ "required": [
76
+ "kind",
77
+ "value"
78
+ ],
79
+ "additionalProperties": false
80
+ },
81
+ {
82
+ "type": "object",
83
+ "properties": {
84
+ "kind": {
85
+ "type": "string",
86
+ "const": "uniform"
87
+ },
88
+ "min": {
89
+ "type": "number"
90
+ },
91
+ "max": {
92
+ "type": "number"
93
+ }
94
+ },
95
+ "required": [
96
+ "kind",
97
+ "min",
98
+ "max"
99
+ ],
100
+ "additionalProperties": false
101
+ },
102
+ {
103
+ "type": "object",
104
+ "properties": {
105
+ "kind": {
106
+ "type": "string",
107
+ "const": "normal"
108
+ },
109
+ "mean": {
110
+ "type": "number"
111
+ },
112
+ "sd": {
113
+ "type": "number",
114
+ "exclusiveMinimum": 0
115
+ }
116
+ },
117
+ "required": [
118
+ "kind",
119
+ "mean",
120
+ "sd"
121
+ ],
122
+ "additionalProperties": false
123
+ },
124
+ {
125
+ "type": "object",
126
+ "properties": {
127
+ "kind": {
128
+ "type": "string",
129
+ "const": "lognormal"
130
+ },
131
+ "log_mean": {
132
+ "type": "number"
133
+ },
134
+ "log_sd": {
135
+ "type": "number",
136
+ "exclusiveMinimum": 0
137
+ }
138
+ },
139
+ "required": [
140
+ "kind",
141
+ "log_mean",
142
+ "log_sd"
143
+ ],
144
+ "additionalProperties": false
145
+ },
146
+ {
147
+ "type": "object",
148
+ "properties": {
149
+ "kind": {
150
+ "type": "string",
151
+ "const": "triangular"
152
+ },
153
+ "min": {
154
+ "type": "number"
155
+ },
156
+ "mode": {
157
+ "type": "number"
158
+ },
159
+ "max": {
160
+ "type": "number"
161
+ }
162
+ },
163
+ "required": [
164
+ "kind",
165
+ "min",
166
+ "mode",
167
+ "max"
168
+ ],
169
+ "additionalProperties": false
170
+ },
171
+ {
172
+ "type": "object",
173
+ "properties": {
174
+ "kind": {
175
+ "type": "string",
176
+ "const": "bernoulli"
177
+ },
178
+ "p": {
179
+ "type": "number",
180
+ "minimum": 0,
181
+ "maximum": 1
182
+ }
183
+ },
184
+ "required": [
185
+ "kind",
186
+ "p"
187
+ ],
188
+ "additionalProperties": false
189
+ },
190
+ {
191
+ "type": "object",
192
+ "properties": {
193
+ "kind": {
194
+ "type": "string",
195
+ "const": "discrete"
196
+ },
197
+ "values": {
198
+ "type": "array",
199
+ "items": {
200
+ "type": "number"
201
+ },
202
+ "minItems": 1,
203
+ "maxItems": 100
204
+ },
205
+ "weights": {
206
+ "type": "array",
207
+ "items": {
208
+ "type": "number",
209
+ "minimum": 0
210
+ },
211
+ "minItems": 1,
212
+ "maxItems": 100
213
+ }
214
+ },
215
+ "required": [
216
+ "kind",
217
+ "values"
218
+ ],
219
+ "additionalProperties": false
220
+ }
221
+ ]
222
+ }
223
+ },
224
+ "required": [
225
+ "id",
226
+ "distribution"
227
+ ],
228
+ "additionalProperties": false
229
+ },
230
+ "minItems": 1,
231
+ "maxItems": 50
232
+ },
233
+ "outputs": {
234
+ "type": "array",
235
+ "items": {
236
+ "type": "object",
237
+ "properties": {
238
+ "id": {
239
+ "type": "string",
240
+ "minLength": 1,
241
+ "maxLength": 64,
242
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
243
+ },
244
+ "expression": {
245
+ "type": "string",
246
+ "minLength": 1,
247
+ "maxLength": 1000
248
+ }
249
+ },
250
+ "required": [
251
+ "id",
252
+ "expression"
253
+ ],
254
+ "additionalProperties": false
255
+ },
256
+ "minItems": 1,
257
+ "maxItems": 10
258
+ }
259
+ },
260
+ "required": [
261
+ "variables",
262
+ "outputs"
263
+ ],
264
+ "additionalProperties": false
265
+ },
266
+ "forecast": {
267
+ "type": "object",
268
+ "properties": {
269
+ "series": {
270
+ "type": "array",
271
+ "items": {
272
+ "type": "object",
273
+ "properties": {
274
+ "t": {
275
+ "anyOf": [
276
+ {
277
+ "type": "string",
278
+ "minLength": 1
279
+ },
280
+ {
281
+ "type": "integer",
282
+ "minimum": -9007199254740991,
283
+ "maximum": 9007199254740991
284
+ }
285
+ ]
286
+ },
287
+ "y": {
288
+ "type": "number"
289
+ }
290
+ },
291
+ "required": [
292
+ "t",
293
+ "y"
294
+ ],
295
+ "additionalProperties": false
296
+ },
297
+ "minItems": 8,
298
+ "maxItems": 10000
299
+ },
300
+ "horizon": {
301
+ "type": "integer",
302
+ "minimum": 1,
303
+ "maximum": 365
304
+ },
305
+ "frequency": {
306
+ "type": "string",
307
+ "enum": [
308
+ "hourly",
309
+ "daily",
310
+ "weekly",
311
+ "monthly",
312
+ "quarterly",
313
+ "yearly"
314
+ ]
315
+ },
316
+ "seasonal_period": {
317
+ "type": "integer",
318
+ "minimum": 2,
319
+ "maximum": 366
320
+ },
321
+ "interval_levels": {
322
+ "type": "array",
323
+ "items": {
324
+ "type": "integer",
325
+ "minimum": 50,
326
+ "maximum": 99
327
+ },
328
+ "minItems": 1,
329
+ "maxItems": 3,
330
+ "default": [
331
+ 80,
332
+ 95
333
+ ]
334
+ },
335
+ "floor": {
336
+ "type": "number"
337
+ }
338
+ },
339
+ "required": [
340
+ "series",
341
+ "horizon"
342
+ ],
343
+ "additionalProperties": false
344
+ }
345
+ },
346
+ "required": [
347
+ "model"
348
+ ],
349
+ "additionalProperties": false,
350
+ "$schema": "http://json-schema.org/draft-07/schema#"
351
+ };
@@ -0,0 +1,4 @@
1
+ import type { Tool } from '@modelcontextprotocol/sdk/types.js';
2
+ import type { OneShot } from '@oneshot-agent/sdk';
3
+ export declare const predictTool: Tool;
4
+ export declare function handlePredict(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").PredictPendingResult | import("@oneshot-agent/sdk").PredictSimulationResult | import("@oneshot-agent/sdk").PredictForecastResult>;
@@ -0,0 +1,9 @@
1
+ import { predictInputSchema } from './predict-schema.generated.js';
2
+ export const predictTool = {
3
+ name: 'oneshot_predict',
4
+ description: 'Predict outcomes with uncertainty and consistency checks. Supported models: simulation (named distributions and arithmetic outputs, returning means, medians and percentiles) and forecast (time series projected ahead with prediction intervals). Provide the matching model block.',
5
+ inputSchema: JSON.parse(JSON.stringify(predictInputSchema)),
6
+ };
7
+ export async function handlePredict(agent, args) {
8
+ return agent.predict(args);
9
+ }