@simmit/sdk 0.1.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,2143 @@
1
+ /**
2
+ * A `Promise<T>` with raw-response access — the generic answer to response
3
+ * headers the return types can't see (`X-Idempotent-Replay`, `X-Active-Jobs`,
4
+ * `X-RateLimit-*`).
5
+ *
6
+ * const { data, response } = await client.jobs.create(params).withResponse()
7
+ * response.headers.get('x-idempotent-replay')
8
+ */
9
+ declare class APIPromise<T> extends Promise<T> {
10
+ #private;
11
+ static get [Symbol.species](): PromiseConstructor;
12
+ constructor(parsed: Promise<{
13
+ data: T;
14
+ response: Response;
15
+ }>);
16
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
17
+ withResponse(): Promise<{
18
+ data: T;
19
+ response: Response;
20
+ }>;
21
+ asResponse(): Promise<Response>;
22
+ }
23
+
24
+ interface RequestSpec {
25
+ method: 'GET' | 'POST';
26
+ path: string;
27
+ body?: unknown;
28
+ /** POST job creation: auto-generate an idempotency-key when none supplied. */
29
+ idempotent?: boolean;
30
+ }
31
+
32
+ /**
33
+ * This file was auto-generated by openapi-typescript.
34
+ * Do not make direct changes to the file.
35
+ */
36
+
37
+ interface paths {
38
+ "/v1/simc/jobs": {
39
+ parameters: {
40
+ query?: never;
41
+ header?: never;
42
+ path?: never;
43
+ cookie?: never;
44
+ };
45
+ /**
46
+ * List your recent SimC jobs
47
+ * @description Returns your recent SimC jobs, newest first. Older jobs fall outside the retention window and are not returned.
48
+ */
49
+ get: {
50
+ parameters: {
51
+ query?: {
52
+ /** @description Maximum number of jobs to return. Defaults to 25, max 100. */
53
+ limit?: number;
54
+ /** @description Opaque pagination cursor from a previous list response (`page.nextCursor`). */
55
+ cursor?: string;
56
+ };
57
+ header?: never;
58
+ path?: never;
59
+ cookie?: never;
60
+ };
61
+ requestBody?: never;
62
+ responses: {
63
+ /** @description Your recent SimC jobs, newest first. */
64
+ 200: {
65
+ headers: {
66
+ /** @description Your in-flight job count at the time of this response. */
67
+ "X-Active-Jobs": string;
68
+ /** @description Your account ceiling for in-flight jobs. */
69
+ "X-Max-Active-Jobs": string;
70
+ [name: string]: unknown;
71
+ };
72
+ content: {
73
+ "application/json": {
74
+ jobs: {
75
+ id: string;
76
+ /** @enum {string} */
77
+ status: "pending" | "queued" | "starting" | "running" | "completed" | "failed" | "cancelled" | "timed_out";
78
+ /** Format: date-time */
79
+ createdAt: string | null;
80
+ /** Format: date-time */
81
+ completedAt: string | null;
82
+ /** @enum {string|null} */
83
+ errorCode: "execution_interrupted" | "execution_timeout" | "execution_failed" | "build_unavailable" | "simulation_error" | "queue_timeout" | "input_invalid" | "insufficient_credits" | "user_cancelled" | "internal" | null;
84
+ /** @description Opaque metadata echoed back exactly as submitted. Not used for scheduling or sim execution. */
85
+ metadata: {
86
+ [key: string]: unknown;
87
+ } | null;
88
+ /** @description Build identifier. Use `GET /v1/simc/builds/{id}` for the full build record. */
89
+ buildId: string | null;
90
+ links: components["schemas"]["JobLinks"];
91
+ }[];
92
+ page: {
93
+ limit: number;
94
+ hasMore: boolean;
95
+ nextCursor: string | null;
96
+ /**
97
+ * Format: date-time
98
+ * @description Earliest timestamp included in this response. Jobs before this time are not returned.
99
+ */
100
+ since: string;
101
+ };
102
+ };
103
+ };
104
+ };
105
+ /** @description Invalid cursor or query parameter. */
106
+ 400: {
107
+ headers: {
108
+ [name: string]: unknown;
109
+ };
110
+ content: {
111
+ "application/json": {
112
+ error: string;
113
+ code: string;
114
+ meta: {
115
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
116
+ [key: string]: string | number | boolean | null;
117
+ }[] | null;
118
+ } | null;
119
+ };
120
+ };
121
+ };
122
+ /** @description Your API token is missing, invalid, or not authorized for this request. See `code` for the specific reason. */
123
+ 401: {
124
+ headers: {
125
+ [name: string]: unknown;
126
+ };
127
+ content: {
128
+ "application/json": {
129
+ error: string;
130
+ /** @enum {string} */
131
+ code: "missing_token" | "invalid_token" | "revoked_token" | "expired_token";
132
+ meta: {
133
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
134
+ [key: string]: string | number | boolean | null;
135
+ }[] | null;
136
+ } | null;
137
+ };
138
+ };
139
+ };
140
+ };
141
+ };
142
+ put?: never;
143
+ /**
144
+ * Submit a new SimC sim
145
+ * @description Submits a new SimC sim to the queue. Returns immediately with a job ID; the sim runs asynchronously. Use the ID to poll status, fetch the final result, and download any artifacts.
146
+ *
147
+ * Credits are reserved against your balance at submission based on the job's maximum possible cost (`maxRuntimeSeconds` × vCPU) and reconciled against actual usage on completion. See "Credits → Reservation" in the documentation for details.
148
+ */
149
+ post: {
150
+ parameters: {
151
+ query?: never;
152
+ header?: {
153
+ /** @description Optional client-supplied key (≤255 printable-ASCII chars) for safe retries. Reusing the same key with the same payload returns the original job; reusing with a different payload returns 409. */
154
+ "idempotency-key"?: string;
155
+ };
156
+ path?: never;
157
+ cookie?: never;
158
+ };
159
+ requestBody?: {
160
+ content: {
161
+ "application/json": {
162
+ build: {
163
+ /**
164
+ * @description SimC build channel to run.
165
+ * @enum {string}
166
+ */
167
+ channel: "nightly" | "weekly" | "latest";
168
+ /**
169
+ * @description Optional SimC git branch to override the channel's default.
170
+ * @enum {string}
171
+ */
172
+ gitBranch?: "midnight";
173
+ };
174
+ profile: {
175
+ /** @description SimC profile text to execute (the content you would normally paste into a local simc run). Maximum 2 MB (UTF-8 encoded). */
176
+ text: string;
177
+ };
178
+ /**
179
+ * @description Execution options for this job. Multistage execution is skipped if your input contains unsupported patterns or directives.
180
+ * @example {
181
+ * "multiStage": true,
182
+ * "maxRuntimeSeconds": 5400
183
+ * }
184
+ */
185
+ runtime?: {
186
+ /** @description Opt-in to multistage execution with automatic culling between stages. When false or omitted, the sim runs in a single pass. */
187
+ multiStage?: boolean;
188
+ /** @description Maximum runtime for this job in seconds. Defaults to 300 seconds when omitted. Jobs that exceed this runtime time out mid-run and are billed for what ran. Determines credit reservation. The ceiling applied is returned in the response as `runtime.ceiling.runtimeSeconds`. View the maximum at `GET /v1/simc/usage` under `limits.maxRuntimeSeconds`. */
189
+ maxRuntimeSeconds?: number;
190
+ /** @description Maximum time this job may wait in the queue before being auto-cancelled, in seconds. Defaults to 1800 seconds when omitted. The ceiling applied is returned in the response as `runtime.ceiling.queueSeconds`. */
191
+ maxQueueSeconds?: number;
192
+ };
193
+ /**
194
+ * @description Queue priority for this job. Allowed values: `standard`, `high`. Higher priority runs first; same-priority jobs run in submission order.
195
+ * @default standard
196
+ * @enum {string}
197
+ */
198
+ priority?: "background" | "standard" | "high";
199
+ /**
200
+ * @description Opaque metadata echoed back unchanged for your own correlation or labels (for example `profileSource`, `characterRef`). Not used for scheduling or sim execution.
201
+ * @example {
202
+ * "requestId": "req_12345",
203
+ * "profileSource": "addon-export",
204
+ * "characterRef": "us-illidan-niike"
205
+ * }
206
+ */
207
+ metadata?: {
208
+ [key: string]: string;
209
+ };
210
+ /** @description Optional per-job credentials. These values are used only for this job and are never persisted. */
211
+ credentials?: {
212
+ /** @description Battle.net API client ID. Must be provided together with `bnetClientSecret`. Used only for this job to allow SimC armory/guild imports; never persisted with your job data. */
213
+ bnetClientId?: string;
214
+ /** @description Battle.net API client secret. Must be provided together with `bnetClientId`. Used only for this job to allow SimC armory/guild imports; never persisted with your job data. */
215
+ bnetClientSecret?: string;
216
+ };
217
+ /** @description Optional webhook subscription settings for this job. Delivery URL and signing secret come from your webhook configuration. */
218
+ webhook?: {
219
+ /**
220
+ * @description Webhook event types to subscribe to for this job.
221
+ * @example [
222
+ * "job.terminal"
223
+ * ]
224
+ */
225
+ events: "job.terminal"[];
226
+ };
227
+ /**
228
+ * @description Controls which output formats are produced. Omit for the default (JSON v2 only, no HTML). Logs and input artifacts are always produced regardless. For multistage runs, HTML is generated only for the final stage.
229
+ * @example {
230
+ * "html": true,
231
+ * "json": {
232
+ * "version": "2"
233
+ * }
234
+ * }
235
+ */
236
+ artifacts?: {
237
+ /** @description Whether to generate an HTML report. Defaults to `false`. */
238
+ html?: boolean;
239
+ /** @description JSON report options. A JSON report is always generated; use this to select the schema version. */
240
+ json?: {
241
+ /**
242
+ * @description JSON report schema version. `2` = stable v2.0.0, `3` = v3.0.0-alpha1 (experimental). Defaults to `2`.
243
+ * @enum {string}
244
+ */
245
+ version?: "2" | "3";
246
+ };
247
+ };
248
+ };
249
+ };
250
+ };
251
+ responses: {
252
+ /** @description Sim accepted and queued. The returned job ID is your handle for polling, fetching the result, and downloading artifacts. */
253
+ 200: {
254
+ headers: {
255
+ /** @description Your in-flight job count at the time of this response. */
256
+ "X-Active-Jobs": string;
257
+ /** @description Your account ceiling for in-flight jobs. */
258
+ "X-Max-Active-Jobs": string;
259
+ /** @description Your account ceiling for job submissions per minute. */
260
+ "X-RateLimit-Limit": string;
261
+ /** @description Submissions you can still make in the current minute. */
262
+ "X-RateLimit-Remaining": string;
263
+ /** @description Unix epoch seconds when your remaining submissions refill. */
264
+ "X-RateLimit-Reset": string;
265
+ /** @description Present and equal to `true` only when the response is a replay of an earlier submission with the same `idempotency-key`. Absent on fresh submissions, including the first request that consumed the key. */
266
+ "X-Idempotent-Replay"?: "true";
267
+ [name: string]: unknown;
268
+ };
269
+ content: {
270
+ "application/json": {
271
+ success: boolean;
272
+ id: string;
273
+ runtime: {
274
+ ceiling: {
275
+ /** @description The runtime ceiling that applied to this run, in seconds. View the maximum at `GET /v1/simc/usage` under `limits.maxRuntimeSeconds`. */
276
+ runtimeSeconds: number | null;
277
+ /** @description The queue timeout ceiling that applied to this run, in seconds. Jobs that wait in the queue longer than this are auto-cancelled with `errorCode` `queue_timeout`. View the maximum at `GET /v1/simc/usage` under `limits.maxQueueSeconds`. */
278
+ queueSeconds: number | null;
279
+ };
280
+ };
281
+ links: components["schemas"]["JobLinks"];
282
+ /** @description Warnings about your input. Omitted when there are none. Covers `iterations=` values above the platform safety cap and `target_error=` values below the platform safety floor. The job still runs at the clamped or floored value. */
283
+ warnings?: {
284
+ /**
285
+ * @description Machine-readable warning category. `iterations_clamped` for `iterations=` values above the platform safety cap; `target_error_floored` for `target_error=` values below the platform safety floor.
286
+ * @enum {string}
287
+ */
288
+ kind: "iterations_clamped" | "target_error_floored";
289
+ /** @description 1-indexed line number in your input. */
290
+ line: number;
291
+ /** @description The value as written in your input. */
292
+ requested: number;
293
+ /** @description The clamped or floored value the sim runs with. */
294
+ applied: number;
295
+ /** @description Human-readable explanation paired with `kind`. */
296
+ message: string;
297
+ }[];
298
+ };
299
+ };
300
+ };
301
+ /** @description Your request was missing required input or failed validation. See `message` for the specific issue. */
302
+ 400: {
303
+ headers: {
304
+ [name: string]: unknown;
305
+ };
306
+ content: {
307
+ "application/json": {
308
+ error: string;
309
+ code: string;
310
+ meta: {
311
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
312
+ [key: string]: string | number | boolean | null;
313
+ }[] | null;
314
+ } | null;
315
+ };
316
+ };
317
+ };
318
+ /** @description Your API token is missing, invalid, or not authorized for this request. See `code` for the specific reason. */
319
+ 401: {
320
+ headers: {
321
+ [name: string]: unknown;
322
+ };
323
+ content: {
324
+ "application/json": {
325
+ error: string;
326
+ /** @enum {string} */
327
+ code: "missing_token" | "invalid_token" | "revoked_token" | "expired_token";
328
+ meta: {
329
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
330
+ [key: string]: string | number | boolean | null;
331
+ }[] | null;
332
+ } | null;
333
+ };
334
+ };
335
+ };
336
+ /** @description The request was rejected because your account has insufficient credits or is inactive. See `code` and `meta` for details. For credit shortfalls, `meta.maxAffordableRuntimeSeconds` indicates the largest job your current balance can cover. */
337
+ 402: {
338
+ headers: {
339
+ [name: string]: unknown;
340
+ };
341
+ content: {
342
+ "application/json": {
343
+ error: string;
344
+ code: string;
345
+ meta: {
346
+ reason: string;
347
+ ceilingRuntimeSeconds?: number;
348
+ maxAffordableRuntimeSeconds?: number;
349
+ /**
350
+ * Format: uri
351
+ * @description Link to the relevant credits/billing docs for this rejection.
352
+ */
353
+ docsUrl?: string;
354
+ } | null;
355
+ };
356
+ };
357
+ };
358
+ /** @description The supplied `idempotency-key` was previously used with a different request payload. `meta.originalJobId` is the id of the job that originally consumed the key. */
359
+ 409: {
360
+ headers: {
361
+ [name: string]: unknown;
362
+ };
363
+ content: {
364
+ "application/json": {
365
+ error: string;
366
+ /** @enum {string} */
367
+ code: "idempotency_key_reuse";
368
+ meta: {
369
+ /** @enum {string} */
370
+ reason: "idempotency_key_reuse";
371
+ /** @description ID of the job that originally consumed this idempotency key. */
372
+ originalJobId: string;
373
+ /** Format: uri */
374
+ docsUrl?: string;
375
+ };
376
+ };
377
+ };
378
+ };
379
+ /** @description Your request body exceeds the 3 MB maximum. A profile over 2 MB returns code `profile_too_large` instead. */
380
+ 413: {
381
+ headers: {
382
+ [name: string]: unknown;
383
+ };
384
+ content: {
385
+ "application/json": {
386
+ error: string;
387
+ code: string;
388
+ meta: {
389
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
390
+ [key: string]: string | number | boolean | null;
391
+ }[] | null;
392
+ } | null;
393
+ };
394
+ };
395
+ };
396
+ /** @description Your SimC profile contains directives Simmit does not allow. `meta.message` explains the rejection and `meta.docsUrl` links to the SimC directives reference. */
397
+ 422: {
398
+ headers: {
399
+ [name: string]: unknown;
400
+ };
401
+ content: {
402
+ "application/json": {
403
+ error: string;
404
+ /** @enum {string} */
405
+ code: "input_sanitized_rejected";
406
+ meta: {
407
+ /** @enum {string} */
408
+ reason: "input_sanitized_rejected";
409
+ /** @description Human-readable explanation of why the input was rejected. */
410
+ message: string;
411
+ /**
412
+ * Format: uri
413
+ * @description Link to the SimC directives reference.
414
+ */
415
+ docsUrl: string;
416
+ /** @description A sample of rejected lines. The full count may exceed the sample — see `blockedCount` and `blockedTruncated`. */
417
+ blocked: {
418
+ line: number;
419
+ text: string;
420
+ }[];
421
+ /** @description Total number of rejected lines. */
422
+ blockedCount: number;
423
+ /** @description `true` when more lines were rejected than included in `blocked`. */
424
+ blockedTruncated: boolean;
425
+ };
426
+ };
427
+ };
428
+ };
429
+ /** @description Your account has exceeded its request rate or in-flight job limit. See `code` and `meta` for the specific cause. `Retry-After` carries the next-attempt time. */
430
+ 429: {
431
+ headers: {
432
+ /** @description Seconds to wait before retrying. */
433
+ "Retry-After": string;
434
+ /** @description Your in-flight job count at the time of this response. */
435
+ "X-Active-Jobs"?: string;
436
+ /** @description Your account ceiling for in-flight jobs. */
437
+ "X-Max-Active-Jobs"?: string;
438
+ /** @description Your account ceiling for job submissions per minute. */
439
+ "X-RateLimit-Limit"?: string;
440
+ /** @description Submissions you can still make in the current minute. */
441
+ "X-RateLimit-Remaining"?: string;
442
+ /** @description Unix epoch seconds when your remaining submissions refill. */
443
+ "X-RateLimit-Reset"?: string;
444
+ [name: string]: unknown;
445
+ };
446
+ content: {
447
+ "application/json": {
448
+ error: string;
449
+ /** @enum {string} */
450
+ code: "rate_limit_exceeded";
451
+ meta: {
452
+ /** @enum {string} */
453
+ scope: "developer";
454
+ };
455
+ } | {
456
+ error: string;
457
+ /** @enum {string} */
458
+ code: "max_active_jobs_exceeded";
459
+ meta: {
460
+ /** @enum {string} */
461
+ reason: "max_active_jobs_exceeded";
462
+ /** @description Maximum number of jobs your account can have in flight. */
463
+ maxActiveJobs: number;
464
+ /** @description Jobs your account had in flight when this request was rejected. */
465
+ activeJobs: number;
466
+ };
467
+ };
468
+ };
469
+ };
470
+ /** @description Your sim was not accepted right now. `code` indicates the cause: `queue_unavailable` when the queue is full or paused, `queue_health_unknown` when queue health cannot be confirmed, `secret_store_unavailable` when per-job credentials supplied with the request could not be stored, or `api_maintenance` during planned maintenance. `Retry-After` carries the next-attempt time. */
471
+ 503: {
472
+ headers: {
473
+ /** @description Seconds to wait before retrying. */
474
+ "Retry-After": string;
475
+ [name: string]: unknown;
476
+ };
477
+ content: {
478
+ "application/json": {
479
+ error: string;
480
+ /** @enum {string} */
481
+ code: "queue_unavailable";
482
+ meta: {
483
+ /** @enum {string} */
484
+ reason: "queue_unavailable";
485
+ /** @description Reason the queue is currently rejecting submissions. */
486
+ queueHealth: string;
487
+ };
488
+ } | {
489
+ error: string;
490
+ /** @enum {string} */
491
+ code: "queue_health_unknown";
492
+ meta: {
493
+ /** @enum {string} */
494
+ reason: "queue_health_unknown";
495
+ laneId: string;
496
+ };
497
+ } | {
498
+ error: string;
499
+ /** @enum {string} */
500
+ code: "secret_store_unavailable";
501
+ meta: {
502
+ /** @enum {string} */
503
+ reason: "secret_store_unavailable";
504
+ };
505
+ } | {
506
+ error: string;
507
+ /** @enum {string} */
508
+ code: "api_maintenance";
509
+ meta: {
510
+ /** @description Seconds to wait before retrying. */
511
+ retryAfterSeconds: number;
512
+ };
513
+ };
514
+ };
515
+ };
516
+ };
517
+ };
518
+ delete?: never;
519
+ options?: never;
520
+ head?: never;
521
+ patch?: never;
522
+ trace?: never;
523
+ };
524
+ "/v1/simc/builds": {
525
+ parameters: {
526
+ query?: never;
527
+ header?: never;
528
+ path?: never;
529
+ cookie?: never;
530
+ };
531
+ /** List available SimC builds */
532
+ get: {
533
+ parameters: {
534
+ query?: never;
535
+ header?: never;
536
+ path?: never;
537
+ cookie?: never;
538
+ };
539
+ requestBody?: never;
540
+ responses: {
541
+ /** @description Available SimC builds, grouped by channel. */
542
+ 200: {
543
+ headers: {
544
+ [name: string]: unknown;
545
+ };
546
+ content: {
547
+ "application/json": {
548
+ /** Format: date-time */
549
+ generatedAt: string;
550
+ builds: {
551
+ /** @enum {string} */
552
+ channel: "nightly" | "weekly" | "latest";
553
+ /** @description Git branch this build was produced from. */
554
+ gitBranch: string;
555
+ /** @description Source repository for this SimC build. */
556
+ repo: string;
557
+ /** @description Git commit hash of the SimC source used for this build. */
558
+ commit: string;
559
+ /**
560
+ * Format: uuid
561
+ * @description Unique identifier for this build.
562
+ */
563
+ id: string;
564
+ /**
565
+ * Format: date-time
566
+ * @description When this build was created.
567
+ */
568
+ createdAt: string;
569
+ /** @description Upstream CI status for this commit, with per-check details. Null when CI data is unavailable. */
570
+ ci: {
571
+ /**
572
+ * @description Computed from gate checks: pass = all gated checks green, partial = gate checks green but other failures exist, fail = gate checks failed (fallback build), unknown = CI data unavailable.
573
+ * @enum {string}
574
+ */
575
+ status: "pass" | "partial" | "fail" | "unknown";
576
+ checks: {
577
+ total: number;
578
+ passed: number;
579
+ failed: number;
580
+ };
581
+ /** @description Names of check runs with non-success conclusions (failure, cancelled, timed_out, action_required). Full GitHub job names as-is. */
582
+ failures: string[];
583
+ /** @description Glob patterns describing which checks were used as the build gate. */
584
+ gatedOn: string[];
585
+ /**
586
+ * Format: date-time
587
+ * @description When CI state was fetched from GitHub.
588
+ */
589
+ retrievedAt: string;
590
+ } | null;
591
+ /** @description Bundled profiles available for this build. See https://dashboard.simmit.com/docs/api/bundled-profiles for more. */
592
+ profiles: {
593
+ /** @description Profile filenames this build accepts in submitted profile text (e.g. `MID1_Mage_Arcane.simc`). Each file is verified at build time to parse and sim cleanly for one iteration. Reference one in your profile text on its own line or as `input=<filename>`. Sorted lexicographically. */
594
+ manifest: string[];
595
+ } | null;
596
+ }[];
597
+ };
598
+ };
599
+ };
600
+ /** @description Your API token is missing, invalid, or not authorized for this request. See `code` for the specific reason. */
601
+ 401: {
602
+ headers: {
603
+ [name: string]: unknown;
604
+ };
605
+ content: {
606
+ "application/json": {
607
+ error: string;
608
+ /** @enum {string} */
609
+ code: "missing_token" | "invalid_token" | "revoked_token" | "expired_token";
610
+ meta: {
611
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
612
+ [key: string]: string | number | boolean | null;
613
+ }[] | null;
614
+ } | null;
615
+ };
616
+ };
617
+ };
618
+ };
619
+ };
620
+ put?: never;
621
+ post?: never;
622
+ delete?: never;
623
+ options?: never;
624
+ head?: never;
625
+ patch?: never;
626
+ trace?: never;
627
+ };
628
+ "/v1/simc/builds/{id}": {
629
+ parameters: {
630
+ query?: never;
631
+ header?: never;
632
+ path?: never;
633
+ cookie?: never;
634
+ };
635
+ /**
636
+ * Get a SimC build
637
+ * @description Returns a SimC build by ID, including older builds no longer current on any channel. `GET /v1/simc/builds` lists only the current build per channel. Returns `404` once the build has been removed from retention.
638
+ */
639
+ get: {
640
+ parameters: {
641
+ query?: never;
642
+ header?: never;
643
+ path: {
644
+ /** @description Build ID, as returned in `build.id` on any job response. */
645
+ id: string;
646
+ };
647
+ cookie?: never;
648
+ };
649
+ requestBody?: never;
650
+ responses: {
651
+ /** @description Full SimC build details. */
652
+ 200: {
653
+ headers: {
654
+ [name: string]: unknown;
655
+ };
656
+ content: {
657
+ "application/json": {
658
+ /** @description Git branch this build was produced from. */
659
+ gitBranch: string;
660
+ /** @description Source repository for this SimC build. */
661
+ repo: string;
662
+ /** @description Git commit hash of the SimC source used for this build. */
663
+ commit: string;
664
+ /**
665
+ * Format: uuid
666
+ * @description Unique identifier for this build.
667
+ */
668
+ id: string;
669
+ /**
670
+ * Format: date-time
671
+ * @description When this build was created.
672
+ */
673
+ createdAt: string;
674
+ /** @description Upstream CI status for this commit, with per-check details. Null when CI data is unavailable. */
675
+ ci: {
676
+ /**
677
+ * @description Computed from gate checks: pass = all gated checks green, partial = gate checks green but other failures exist, fail = gate checks failed (fallback build), unknown = CI data unavailable.
678
+ * @enum {string}
679
+ */
680
+ status: "pass" | "partial" | "fail" | "unknown";
681
+ checks: {
682
+ total: number;
683
+ passed: number;
684
+ failed: number;
685
+ };
686
+ /** @description Names of check runs with non-success conclusions (failure, cancelled, timed_out, action_required). Full GitHub job names as-is. */
687
+ failures: string[];
688
+ /** @description Glob patterns describing which checks were used as the build gate. */
689
+ gatedOn: string[];
690
+ /**
691
+ * Format: date-time
692
+ * @description When CI state was fetched from GitHub.
693
+ */
694
+ retrievedAt: string;
695
+ } | null;
696
+ /** @description Bundled profiles available for this build. See https://dashboard.simmit.com/docs/api/bundled-profiles for more. */
697
+ profiles: {
698
+ /** @description Profile filenames this build accepts in submitted profile text (e.g. `MID1_Mage_Arcane.simc`). Each file is verified at build time to parse and sim cleanly for one iteration. Reference one in your profile text on its own line or as `input=<filename>`. Sorted lexicographically. */
699
+ manifest: string[];
700
+ } | null;
701
+ };
702
+ };
703
+ };
704
+ /** @description Invalid build ID format (must be a UUID). */
705
+ 400: {
706
+ headers: {
707
+ [name: string]: unknown;
708
+ };
709
+ content: {
710
+ "application/json": {
711
+ error: string;
712
+ code: string;
713
+ meta: {
714
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
715
+ [key: string]: string | number | boolean | null;
716
+ }[] | null;
717
+ } | null;
718
+ };
719
+ };
720
+ };
721
+ /** @description Your API token is missing, invalid, or not authorized for this request. See `code` for the specific reason. */
722
+ 401: {
723
+ headers: {
724
+ [name: string]: unknown;
725
+ };
726
+ content: {
727
+ "application/json": {
728
+ error: string;
729
+ /** @enum {string} */
730
+ code: "missing_token" | "invalid_token" | "revoked_token" | "expired_token";
731
+ meta: {
732
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
733
+ [key: string]: string | number | boolean | null;
734
+ }[] | null;
735
+ } | null;
736
+ };
737
+ };
738
+ };
739
+ /** @description Build not found */
740
+ 404: {
741
+ headers: {
742
+ [name: string]: unknown;
743
+ };
744
+ content: {
745
+ "application/json": {
746
+ error: string;
747
+ code: string;
748
+ meta: {
749
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
750
+ [key: string]: string | number | boolean | null;
751
+ }[] | null;
752
+ } | null;
753
+ };
754
+ };
755
+ };
756
+ };
757
+ };
758
+ put?: never;
759
+ post?: never;
760
+ delete?: never;
761
+ options?: never;
762
+ head?: never;
763
+ patch?: never;
764
+ trace?: never;
765
+ };
766
+ "/v1/simc/jobs/{id}": {
767
+ parameters: {
768
+ query?: never;
769
+ header?: never;
770
+ path?: never;
771
+ cookie?: never;
772
+ };
773
+ /**
774
+ * Get a SimC job record
775
+ * @description Returns the full record for a SimC job, including timestamps, runtime details, metadata, and build info. For lightweight polling while a sim runs, use `GET /v1/simc/jobs/{id}/status` instead.
776
+ */
777
+ get: {
778
+ parameters: {
779
+ query?: never;
780
+ header?: never;
781
+ path: {
782
+ id: string;
783
+ };
784
+ cookie?: never;
785
+ };
786
+ requestBody?: never;
787
+ responses: {
788
+ /** @description Full SimC job record. */
789
+ 200: {
790
+ headers: {
791
+ /** @description Your in-flight job count at the time of this response. */
792
+ "X-Active-Jobs": string;
793
+ /** @description Your account ceiling for in-flight jobs. */
794
+ "X-Max-Active-Jobs": string;
795
+ [name: string]: unknown;
796
+ };
797
+ content: {
798
+ "application/json": {
799
+ id: string;
800
+ /** @enum {string} */
801
+ status: "pending" | "queued" | "starting" | "running" | "completed" | "failed" | "cancelled" | "timed_out";
802
+ /**
803
+ * @description Effective priority the job is running at.
804
+ * @enum {string}
805
+ */
806
+ priority: "background" | "standard" | "high";
807
+ /** Format: date-time */
808
+ createdAt: string | null;
809
+ /**
810
+ * Format: date-time
811
+ * @description When this job began executing. Null when the job has not yet started.
812
+ */
813
+ startedAt: string | null;
814
+ /** Format: date-time */
815
+ completedAt: string | null;
816
+ /**
817
+ * Format: date-time
818
+ * @description When a cancel was requested. Null when no cancel has been requested.
819
+ */
820
+ cancelRequestedAt: string | null;
821
+ /** @enum {string|null} */
822
+ errorCode: "execution_interrupted" | "execution_timeout" | "execution_failed" | "build_unavailable" | "simulation_error" | "queue_timeout" | "input_invalid" | "insufficient_credits" | "user_cancelled" | "internal" | null;
823
+ /** @description Human-readable explanation for the terminal status, paired with `errorCode`. */
824
+ statusReason: string | null;
825
+ /** @description SimC process exit code. */
826
+ simcExitCode: string | null;
827
+ /** @description Number of days artifacts are retained after `completedAt`. After this window, artifact endpoints return `410`. */
828
+ retentionDays: number | null;
829
+ /** @description Opaque metadata echoed back exactly as submitted (for example `profileSource`, `characterRef`). Not used for scheduling or sim execution. */
830
+ metadata: {
831
+ [key: string]: unknown;
832
+ } | null;
833
+ runtime: {
834
+ /** @description SimC process wall-clock time in milliseconds. Excludes setup and teardown time. Null if the job has not completed or the sim did not start. */
835
+ simDurationMs: number | null;
836
+ /** @description Total wall-clock time from job start to completion (milliseconds). Includes sim execution, artifact generation, and post-processing. Null when the job has not yet run. */
837
+ totalDurationMs: number | null;
838
+ /** @description Credits charged for this job, including any priority fee. `0` for terminal jobs with no billable work. Null until the job reaches a terminal state. */
839
+ creditsConsumed: number | null;
840
+ /** @description Priority surcharge included in `creditsConsumed`. `0` for jobs submitted at `standard` or `background`; otherwise the `high`-priority fee in effect at submission time. View the current fee from `GET /v1/simc/usage` under `limits.priorityFeeCredits.high`. */
841
+ priorityFeeCredits: number;
842
+ /** @description vCPUs used for this job. Null before execution. */
843
+ vcpus: number | null;
844
+ ceiling: {
845
+ /** @description The runtime ceiling that applied to this run, in seconds. View the maximum at `GET /v1/simc/usage` under `limits.maxRuntimeSeconds`. */
846
+ runtimeSeconds: number | null;
847
+ /** @description The queue timeout ceiling that applied to this run, in seconds. Jobs that wait in the queue longer than this are auto-cancelled with `errorCode` `queue_timeout`. View the maximum at `GET /v1/simc/usage` under `limits.maxQueueSeconds`. */
848
+ queueSeconds: number | null;
849
+ };
850
+ };
851
+ /** @description True if this job was retried automatically because of a platform error. The response reflects the latest retry attempt. */
852
+ retried: boolean;
853
+ build: {
854
+ /**
855
+ * Format: uuid
856
+ * @description Build ID. `GET /v1/simc/builds/{id}` returns the full build record.
857
+ */
858
+ id: string;
859
+ /** @enum {string} */
860
+ channel: "nightly" | "weekly" | "latest";
861
+ /** @description Git commit hash of the SimC source used for this build. */
862
+ commit: string;
863
+ /** @description Compact upstream CI summary (status and failure count) for this commit. The full per-check breakdown is on `GET /v1/simc/builds/{id}`. Null when CI data is unavailable. */
864
+ ci: {
865
+ /**
866
+ * @description Computed CI status for the build commit. See GET /v1/simc/builds for full check details.
867
+ * @enum {string}
868
+ */
869
+ status: "pass" | "partial" | "fail" | "unknown";
870
+ /** @description Number of CI checks with non-success conclusions (failure, cancelled, timed_out, action_required). See GET /v1/simc/builds for check names. */
871
+ failed: number;
872
+ } | null;
873
+ } | null;
874
+ links: components["schemas"]["JobLinks"];
875
+ };
876
+ };
877
+ };
878
+ /** @description Your API token is missing, invalid, or not authorized for this request. See `code` for the specific reason. */
879
+ 401: {
880
+ headers: {
881
+ [name: string]: unknown;
882
+ };
883
+ content: {
884
+ "application/json": {
885
+ error: string;
886
+ /** @enum {string} */
887
+ code: "missing_token" | "invalid_token" | "revoked_token" | "expired_token";
888
+ meta: {
889
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
890
+ [key: string]: string | number | boolean | null;
891
+ }[] | null;
892
+ } | null;
893
+ };
894
+ };
895
+ };
896
+ /** @description Job not found */
897
+ 404: {
898
+ headers: {
899
+ [name: string]: unknown;
900
+ };
901
+ content: {
902
+ "application/json": {
903
+ error: string;
904
+ code: string;
905
+ meta: {
906
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
907
+ [key: string]: string | number | boolean | null;
908
+ }[] | null;
909
+ } | null;
910
+ };
911
+ };
912
+ };
913
+ };
914
+ };
915
+ put?: never;
916
+ post?: never;
917
+ delete?: never;
918
+ options?: never;
919
+ head?: never;
920
+ patch?: never;
921
+ trace?: never;
922
+ };
923
+ "/v1/simc/jobs/{id}/result": {
924
+ parameters: {
925
+ query?: never;
926
+ header?: never;
927
+ path?: never;
928
+ cookie?: never;
929
+ };
930
+ /**
931
+ * Get a SimC job result
932
+ * @description Returns the full result payload for a finished SimC job — summary metrics, runtime info, and artifact references. Available once the job reaches a terminal status (`completed`, `failed`, `cancelled`, or `timed_out`).
933
+ */
934
+ get: {
935
+ parameters: {
936
+ query?: never;
937
+ header?: never;
938
+ path: {
939
+ id: string;
940
+ };
941
+ cookie?: never;
942
+ };
943
+ requestBody?: never;
944
+ responses: {
945
+ /** @description Full result payload for a finished job — summary metrics, runtime info, and artifact references. */
946
+ 200: {
947
+ headers: {
948
+ [name: string]: unknown;
949
+ };
950
+ content: {
951
+ "application/json": {
952
+ id: string;
953
+ /** @enum {string} */
954
+ status: "completed" | "failed" | "cancelled" | "timed_out";
955
+ /**
956
+ * @description Effective priority the job is running at.
957
+ * @enum {string}
958
+ */
959
+ priority: "background" | "standard" | "high";
960
+ /** Format: date-time */
961
+ createdAt: string | null;
962
+ /**
963
+ * Format: date-time
964
+ * @description When this job began executing. Null when the job has not yet started.
965
+ */
966
+ startedAt: string | null;
967
+ /** Format: date-time */
968
+ completedAt: string | null;
969
+ /**
970
+ * Format: date-time
971
+ * @description When a cancel was requested. Null when no cancel has been requested.
972
+ */
973
+ cancelRequestedAt: string | null;
974
+ /** @enum {string|null} */
975
+ errorCode: "execution_interrupted" | "execution_timeout" | "execution_failed" | "build_unavailable" | "simulation_error" | "queue_timeout" | "input_invalid" | "insufficient_credits" | "user_cancelled" | "internal" | null;
976
+ /** @description Human-readable explanation for the terminal status, paired with `errorCode`. */
977
+ statusReason: string | null;
978
+ /** @description SimC process exit code. */
979
+ simcExitCode: string | null;
980
+ /** @description Number of days artifacts are retained after `completedAt`. After this window, artifact endpoints return `410`. */
981
+ retentionDays: number | null;
982
+ /** @description Opaque metadata echoed back exactly as submitted (for example `profileSource`, `characterRef`). Not used for scheduling or sim execution. */
983
+ metadata: {
984
+ [key: string]: unknown;
985
+ } | null;
986
+ runtime: {
987
+ /** @description SimC process wall-clock time in milliseconds. Excludes setup and teardown time. Null if the job has not completed or the sim did not start. */
988
+ simDurationMs: number | null;
989
+ /** @description Total wall-clock time from job start to completion (milliseconds). Includes sim execution, artifact generation, and post-processing. Null when the job has not yet run. */
990
+ totalDurationMs: number | null;
991
+ /** @description Credits charged for this job, including any priority fee. `0` for terminal jobs with no billable work. Null until the job reaches a terminal state. */
992
+ creditsConsumed: number | null;
993
+ /** @description Priority surcharge included in `creditsConsumed`. `0` for jobs submitted at `standard` or `background`; otherwise the `high`-priority fee in effect at submission time. View the current fee from `GET /v1/simc/usage` under `limits.priorityFeeCredits.high`. */
994
+ priorityFeeCredits: number;
995
+ /** @description vCPUs used for this job. Null before execution. */
996
+ vcpus: number | null;
997
+ ceiling: {
998
+ /** @description The runtime ceiling that applied to this run, in seconds. View the maximum at `GET /v1/simc/usage` under `limits.maxRuntimeSeconds`. */
999
+ runtimeSeconds: number | null;
1000
+ /** @description The queue timeout ceiling that applied to this run, in seconds. Jobs that wait in the queue longer than this are auto-cancelled with `errorCode` `queue_timeout`. View the maximum at `GET /v1/simc/usage` under `limits.maxQueueSeconds`. */
1001
+ queueSeconds: number | null;
1002
+ };
1003
+ };
1004
+ /** @description True if this job was retried automatically because of a platform error. The response reflects the latest retry attempt. */
1005
+ retried: boolean;
1006
+ build: {
1007
+ /**
1008
+ * Format: uuid
1009
+ * @description Build ID. `GET /v1/simc/builds/{id}` returns the full build record.
1010
+ */
1011
+ id: string;
1012
+ /** @enum {string} */
1013
+ channel: "nightly" | "weekly" | "latest";
1014
+ /** @description Git commit hash of the SimC source used for this build. */
1015
+ commit: string;
1016
+ /** @description Compact upstream CI summary (status and failure count) for this commit. The full per-check breakdown is on `GET /v1/simc/builds/{id}`. Null when CI data is unavailable. */
1017
+ ci: {
1018
+ /**
1019
+ * @description Computed CI status for the build commit. See GET /v1/simc/builds for full check details.
1020
+ * @enum {string}
1021
+ */
1022
+ status: "pass" | "partial" | "fail" | "unknown";
1023
+ /** @description Number of CI checks with non-success conclusions (failure, cancelled, timed_out, action_required). See GET /v1/simc/builds for check names. */
1024
+ failed: number;
1025
+ } | null;
1026
+ } | null;
1027
+ links: components["schemas"]["JobLinks"];
1028
+ result: {
1029
+ summary: {
1030
+ /**
1031
+ * @description Primary metric used for ranking.
1032
+ * @enum {string}
1033
+ */
1034
+ metric: "dps";
1035
+ /** @description Result for the headline actor (selected by SimC's `profileset_main_actor_index` directive, default `0`). When profileset results are available, this object also carries a `profilesets` block (`{ count, results }`) for the sweep over this actor; the block is omitted when no results are available (the input declared no profilesets, or none were produced). For multi-player sims using `copy=` or `set=`, per-player results for the remaining actors are in the JSON artifact — that multi-player case is separate from the profileset sweep. */
1036
+ mainActor: {
1037
+ /** @description Actor name as defined in your profile. */
1038
+ name: string;
1039
+ /** @description Mean DPS across all iterations. */
1040
+ mean: number;
1041
+ /** @description The ± DPS error on `mean` — the half-width of its 95% confidence interval, equal to `mean_stddev` × 1.96. This is the same error SimC reports. */
1042
+ mean_error: number;
1043
+ /** @description Standard error of the mean DPS (the standard deviation of the mean estimate). */
1044
+ mean_stddev: number;
1045
+ /** @description Profileset sweep results scoped to this actor (mirrors SimC's `sim.profilesets` block shape). Omitted when no profileset results are available — either the input declared no profilesets, or none were produced. */
1046
+ profilesets?: {
1047
+ /** @description Total number of profilesets in the sim result. When this exceeds the length of `results`, the array was truncated to the top 200 entries by DPS. The full set is available in the JSON artifact. */
1048
+ count: number;
1049
+ /** @description Profileset sweep entries, ranked by DPS (highest first). Truncated to the top 200 entries — see `count` and the JSON artifact for the full set. */
1050
+ results: {
1051
+ /** @description Profileset name as defined in your input. */
1052
+ name: string;
1053
+ /** @description Mean DPS across all iterations. */
1054
+ mean: number;
1055
+ /** @description The ± DPS error on `mean` — the half-width of its 95% confidence interval, equal to `mean_stddev` × 1.96. This is the same error SimC reports. */
1056
+ mean_error: number;
1057
+ /** @description Standard error of the mean DPS (the standard deviation of the mean estimate). */
1058
+ mean_stddev: number;
1059
+ /** @description For multistage runs, the highest stage this profileset reached — it was culled after this stage, or it survived to the final stage. Earlier stages run at a coarser `target_error`, so a result from an earlier stage carries a larger `mean_error` than a final-stage result. `1` for single-pass runs. */
1060
+ stage: number;
1061
+ }[];
1062
+ };
1063
+ } | null;
1064
+ /** @description Multistage execution metadata. */
1065
+ multiStage: {
1066
+ /** @description Whether multistage execution ran. */
1067
+ enabled: boolean;
1068
+ /**
1069
+ * @description Why multistage execution did or did not run.
1070
+ * @enum {string}
1071
+ */
1072
+ reason: "disabled_by_option" | "unsupported_stage_sensitive_directive" | "unsupported_copy_set_only" | "unsupported_mixed_profileset_copy_set" | "no_variants_in_input" | "unsupported_multi_actor" | "no_profileset_candidates" | "below_min_candidates" | "eligible_profileset_only";
1073
+ /** @description Per-stage funnel for multistage execution, in execution order. Empty for single-pass runs. */
1074
+ stages: {
1075
+ /** @description Stage number (1-indexed). */
1076
+ stage: number;
1077
+ /** @description Human-readable stage name (`initial`, `intermediate`, `final`). */
1078
+ label: string;
1079
+ /** @description Number of profilesets executed in this stage. */
1080
+ profilesets: number;
1081
+ /** @description Number of profilesets eliminated at the end of this stage based on ranking. These do not advance to the next stage. The last executed stage always reports `0` (no culling occurs after the last stage). */
1082
+ culled: number;
1083
+ }[];
1084
+ };
1085
+ } | null;
1086
+ artifacts: {
1087
+ id: string;
1088
+ /**
1089
+ * Format: uri
1090
+ * @description Stable public URL for downloading this artifact. Valid for the full retention window of the job.
1091
+ */
1092
+ url: string;
1093
+ /** @description Type of artifact (for example `html_report`, `json_report`, `stdout_log`). */
1094
+ kind: string;
1095
+ /** @description MIME type of the artifact content. */
1096
+ mimeType: string;
1097
+ /** @description Stage number for multistage execution artifacts (1-indexed). Null for single-run jobs or artifacts not associated with a specific multistage stage. */
1098
+ stage: number | null;
1099
+ }[];
1100
+ };
1101
+ };
1102
+ };
1103
+ };
1104
+ /** @description Your API token is missing, invalid, or not authorized for this request. See `code` for the specific reason. */
1105
+ 401: {
1106
+ headers: {
1107
+ [name: string]: unknown;
1108
+ };
1109
+ content: {
1110
+ "application/json": {
1111
+ error: string;
1112
+ /** @enum {string} */
1113
+ code: "missing_token" | "invalid_token" | "revoked_token" | "expired_token";
1114
+ meta: {
1115
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
1116
+ [key: string]: string | number | boolean | null;
1117
+ }[] | null;
1118
+ } | null;
1119
+ };
1120
+ };
1121
+ };
1122
+ /** @description Job not found */
1123
+ 404: {
1124
+ headers: {
1125
+ [name: string]: unknown;
1126
+ };
1127
+ content: {
1128
+ "application/json": {
1129
+ error: string;
1130
+ code: string;
1131
+ meta: {
1132
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
1133
+ [key: string]: string | number | boolean | null;
1134
+ }[] | null;
1135
+ } | null;
1136
+ };
1137
+ };
1138
+ };
1139
+ /** @description Result not ready. The job has not reached a terminal status yet. */
1140
+ 409: {
1141
+ headers: {
1142
+ [name: string]: unknown;
1143
+ };
1144
+ content: {
1145
+ "application/json": {
1146
+ error: string;
1147
+ /** @enum {string} */
1148
+ code: "result_not_ready";
1149
+ meta: {
1150
+ /** @enum {string} */
1151
+ status: "pending" | "queued" | "starting" | "running";
1152
+ };
1153
+ };
1154
+ };
1155
+ };
1156
+ /** @description Result unavailable. The job is terminal but no result payload was produced. */
1157
+ 422: {
1158
+ headers: {
1159
+ [name: string]: unknown;
1160
+ };
1161
+ content: {
1162
+ "application/json": {
1163
+ error: string;
1164
+ /** @enum {string} */
1165
+ code: "result_unavailable";
1166
+ meta: {
1167
+ /** @enum {string} */
1168
+ status: "completed" | "failed" | "cancelled" | "timed_out";
1169
+ };
1170
+ };
1171
+ };
1172
+ };
1173
+ };
1174
+ };
1175
+ put?: never;
1176
+ post?: never;
1177
+ delete?: never;
1178
+ options?: never;
1179
+ head?: never;
1180
+ patch?: never;
1181
+ trace?: never;
1182
+ };
1183
+ "/v1/simc/jobs/{id}/status": {
1184
+ parameters: {
1185
+ query?: never;
1186
+ header?: never;
1187
+ path?: never;
1188
+ cookie?: never;
1189
+ };
1190
+ /**
1191
+ * Poll a SimC job status
1192
+ * @description Returns the current status, queue position, and progress for a SimC job. Designed for polling while a sim runs. Use `include` to add optional fields like `logEntries`.
1193
+ */
1194
+ get: {
1195
+ parameters: {
1196
+ query?: {
1197
+ /** @description Comma-separated list of optional fields to include. Supported: `logEntries` (structured log entries from stdout and stderr for running jobs). */
1198
+ include?: string;
1199
+ };
1200
+ header?: never;
1201
+ path: {
1202
+ id: string;
1203
+ };
1204
+ cookie?: never;
1205
+ };
1206
+ requestBody?: never;
1207
+ responses: {
1208
+ /** @description Current status, queue position, and progress for the job. */
1209
+ 200: {
1210
+ headers: {
1211
+ /** @description Your in-flight job count at the time of this response. */
1212
+ "X-Active-Jobs": string;
1213
+ /** @description Your account ceiling for in-flight jobs. */
1214
+ "X-Max-Active-Jobs": string;
1215
+ [name: string]: unknown;
1216
+ };
1217
+ content: {
1218
+ "application/json": {
1219
+ /**
1220
+ * @description Current job status. Terminal values: completed, failed, cancelled, timed_out.
1221
+ * @enum {string}
1222
+ */
1223
+ status: "pending" | "queued" | "starting" | "running" | "completed" | "failed" | "cancelled" | "timed_out";
1224
+ /**
1225
+ * @description Machine-readable error code for the terminal state. Null when the job is not terminal or completed successfully.
1226
+ * @enum {string|null}
1227
+ */
1228
+ errorCode: "execution_interrupted" | "execution_timeout" | "execution_failed" | "build_unavailable" | "simulation_error" | "queue_timeout" | "input_invalid" | "insufficient_credits" | "user_cancelled" | "internal" | null;
1229
+ /** @description Human-readable explanation paired with `errorCode`. Null when the job is not terminal or no additional detail is available. */
1230
+ statusReason: string | null;
1231
+ /** @description SimC process exit code. Null when the job is not terminal. */
1232
+ simcExitCode: string | null;
1233
+ queue: {
1234
+ /** @description Estimated seconds until this job begins running. Updated on each poll; not a guarantee. Null when no estimate is available. */
1235
+ estimatedStartSeconds: number | null;
1236
+ /**
1237
+ * Format: date-time
1238
+ * @description When this estimate was last computed.
1239
+ */
1240
+ estimatedStartUpdatedAt: string | null;
1241
+ } | null;
1242
+ progress: {
1243
+ /** @description Estimated completion percentage (0–100). Null when not yet running. */
1244
+ percent: number | null;
1245
+ /** @description Stage progress detail while the job is running. Null before the job starts running and once it reaches a terminal state. Single-pass jobs report `{ current: 1, total: 1, label: "initial" }` with `percent` populated while running. */
1246
+ stage: {
1247
+ /** @description Current stage (1-indexed). */
1248
+ current: number;
1249
+ /** @description Total number of stages in this run. */
1250
+ total: number;
1251
+ /** @description Human-readable name of the current stage (for example "initial", "intermediate", "final"). */
1252
+ label: string;
1253
+ /** @description Estimated completion percentage (0–100) within the current stage. */
1254
+ percent: number;
1255
+ } | null;
1256
+ };
1257
+ /** @description Recent log lines from SimC stdout and stderr while the job is running. Each entry is tagged with its stream (`source`) and capture time (`ts`). Full logs are available as downloadable artifacts once the job completes. Null when not running or not requested via `include=logEntries`. */
1258
+ logEntries: {
1259
+ /**
1260
+ * @description Which stream the line came from. `stderr` lines are diagnostic output — SimC warnings, errors, and notes. `stdout` lines are sim output, progress markers, and results.
1261
+ * @enum {string}
1262
+ */
1263
+ source: "stdout" | "stderr";
1264
+ /** @description The log line text. */
1265
+ message: string;
1266
+ /** @description Epoch milliseconds (UTC) when this line was captured. */
1267
+ ts: number;
1268
+ }[] | null;
1269
+ /**
1270
+ * Format: date-time
1271
+ * @description When this job began executing. Null when the job has not yet started.
1272
+ */
1273
+ startedAt: string | null;
1274
+ /** Format: date-time */
1275
+ updatedAt: string | null;
1276
+ /** @description True if this job was retried automatically because of a platform error. The response reflects the latest retry attempt. */
1277
+ retried: boolean;
1278
+ };
1279
+ };
1280
+ };
1281
+ /** @description Your API token is missing, invalid, or not authorized for this request. See `code` for the specific reason. */
1282
+ 401: {
1283
+ headers: {
1284
+ [name: string]: unknown;
1285
+ };
1286
+ content: {
1287
+ "application/json": {
1288
+ error: string;
1289
+ /** @enum {string} */
1290
+ code: "missing_token" | "invalid_token" | "revoked_token" | "expired_token";
1291
+ meta: {
1292
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
1293
+ [key: string]: string | number | boolean | null;
1294
+ }[] | null;
1295
+ } | null;
1296
+ };
1297
+ };
1298
+ };
1299
+ /** @description Job not found */
1300
+ 404: {
1301
+ headers: {
1302
+ [name: string]: unknown;
1303
+ };
1304
+ content: {
1305
+ "application/json": {
1306
+ error: string;
1307
+ code: string;
1308
+ meta: {
1309
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
1310
+ [key: string]: string | number | boolean | null;
1311
+ }[] | null;
1312
+ } | null;
1313
+ };
1314
+ };
1315
+ };
1316
+ };
1317
+ };
1318
+ put?: never;
1319
+ post?: never;
1320
+ delete?: never;
1321
+ options?: never;
1322
+ head?: never;
1323
+ patch?: never;
1324
+ trace?: never;
1325
+ };
1326
+ "/v1/simc/artifacts/{id}/url": {
1327
+ parameters: {
1328
+ query?: never;
1329
+ header?: never;
1330
+ path?: never;
1331
+ cookie?: never;
1332
+ };
1333
+ /**
1334
+ * Get a SimC artifact URL
1335
+ * @description Returns a stable public URL for a SimC job artifact (HTML report, JSON report, raw log, etc.), valid for the artifact's full retention window. Use this when you need to control the final fetch URL yourself — for example, browser flows that need explicit cross-origin handling.
1336
+ */
1337
+ get: {
1338
+ parameters: {
1339
+ query?: never;
1340
+ header?: never;
1341
+ path: {
1342
+ id: string;
1343
+ };
1344
+ cookie?: never;
1345
+ };
1346
+ requestBody?: never;
1347
+ responses: {
1348
+ /** @description A stable public URL for downloading the artifact. Valid for the artifact's full retention window. */
1349
+ 200: {
1350
+ headers: {
1351
+ [name: string]: unknown;
1352
+ };
1353
+ content: {
1354
+ "application/json": {
1355
+ /** Format: uri */
1356
+ url: string;
1357
+ };
1358
+ };
1359
+ };
1360
+ /** @description Your API token is missing, invalid, or not authorized for this request. See `code` for the specific reason. */
1361
+ 401: {
1362
+ headers: {
1363
+ [name: string]: unknown;
1364
+ };
1365
+ content: {
1366
+ "application/json": {
1367
+ error: string;
1368
+ /** @enum {string} */
1369
+ code: "missing_token" | "invalid_token" | "revoked_token" | "expired_token";
1370
+ meta: {
1371
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
1372
+ [key: string]: string | number | boolean | null;
1373
+ }[] | null;
1374
+ } | null;
1375
+ };
1376
+ };
1377
+ };
1378
+ /** @description Artifact not found */
1379
+ 404: {
1380
+ headers: {
1381
+ [name: string]: unknown;
1382
+ };
1383
+ content: {
1384
+ "application/json": {
1385
+ error: string;
1386
+ code: string;
1387
+ meta: {
1388
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
1389
+ [key: string]: string | number | boolean | null;
1390
+ }[] | null;
1391
+ } | null;
1392
+ };
1393
+ };
1394
+ };
1395
+ /** @description The artifact has expired and is no longer available. */
1396
+ 410: {
1397
+ headers: {
1398
+ [name: string]: unknown;
1399
+ };
1400
+ content: {
1401
+ "application/json": {
1402
+ error: string;
1403
+ code: string;
1404
+ meta: {
1405
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
1406
+ [key: string]: string | number | boolean | null;
1407
+ }[] | null;
1408
+ } | null;
1409
+ };
1410
+ };
1411
+ };
1412
+ };
1413
+ };
1414
+ put?: never;
1415
+ post?: never;
1416
+ delete?: never;
1417
+ options?: never;
1418
+ head?: never;
1419
+ patch?: never;
1420
+ trace?: never;
1421
+ };
1422
+ "/v1/simc/jobs/{id}/cancel": {
1423
+ parameters: {
1424
+ query?: never;
1425
+ header?: never;
1426
+ path?: never;
1427
+ cookie?: never;
1428
+ };
1429
+ get?: never;
1430
+ put?: never;
1431
+ /**
1432
+ * Cancel a SimC job
1433
+ * @description Cancels one of your SimC jobs. Jobs that have not started running end immediately. Jobs already in flight are signaled to stop; poll `GET /v1/simc/jobs/{id}/status` to observe the transition to `cancelled`. Repeat calls return the same response.
1434
+ */
1435
+ post: {
1436
+ parameters: {
1437
+ query?: never;
1438
+ header?: never;
1439
+ path: {
1440
+ id: string;
1441
+ };
1442
+ cookie?: never;
1443
+ };
1444
+ requestBody?: never;
1445
+ responses: {
1446
+ /** @description Cancel accepted. `status` is `cancelled` when the job ended before running, or `cancel_requested` when the job was already running and has been signaled to stop. */
1447
+ 200: {
1448
+ headers: {
1449
+ [name: string]: unknown;
1450
+ };
1451
+ content: {
1452
+ "application/json": {
1453
+ /** @enum {boolean} */
1454
+ success: true;
1455
+ id: string;
1456
+ /**
1457
+ * @description The job ended before it started running and is fully cancelled.
1458
+ * @enum {string}
1459
+ */
1460
+ status: "cancelled";
1461
+ } | {
1462
+ /** @enum {boolean} */
1463
+ success: true;
1464
+ id: string;
1465
+ /**
1466
+ * @description The job was already running and has been signaled to stop. Poll `GET /v1/simc/jobs/{id}` to observe the transition to `cancelled`.
1467
+ * @enum {string}
1468
+ */
1469
+ status: "cancel_requested";
1470
+ /**
1471
+ * Format: date-time
1472
+ * @description When the cancel was requested.
1473
+ */
1474
+ cancelRequestedAt: string;
1475
+ };
1476
+ };
1477
+ };
1478
+ /** @description Your API token is missing, invalid, or not authorized for this request. See `code` for the specific reason. */
1479
+ 401: {
1480
+ headers: {
1481
+ [name: string]: unknown;
1482
+ };
1483
+ content: {
1484
+ "application/json": {
1485
+ error: string;
1486
+ /** @enum {string} */
1487
+ code: "missing_token" | "invalid_token" | "revoked_token" | "expired_token";
1488
+ meta: {
1489
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
1490
+ [key: string]: string | number | boolean | null;
1491
+ }[] | null;
1492
+ } | null;
1493
+ };
1494
+ };
1495
+ };
1496
+ /** @description Job not found */
1497
+ 404: {
1498
+ headers: {
1499
+ [name: string]: unknown;
1500
+ };
1501
+ content: {
1502
+ "application/json": {
1503
+ error: string;
1504
+ code: string;
1505
+ meta: {
1506
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
1507
+ [key: string]: string | number | boolean | null;
1508
+ }[] | null;
1509
+ } | null;
1510
+ };
1511
+ };
1512
+ };
1513
+ /** @description Job has already reached a terminal status. */
1514
+ 409: {
1515
+ headers: {
1516
+ [name: string]: unknown;
1517
+ };
1518
+ content: {
1519
+ "application/json": {
1520
+ error: string;
1521
+ /** @enum {string} */
1522
+ code: "job_not_cancellable";
1523
+ meta: {
1524
+ id: string;
1525
+ /** @enum {string} */
1526
+ status: "pending" | "queued" | "starting" | "running" | "completed" | "failed" | "cancelled" | "timed_out";
1527
+ };
1528
+ };
1529
+ };
1530
+ };
1531
+ };
1532
+ };
1533
+ delete?: never;
1534
+ options?: never;
1535
+ head?: never;
1536
+ patch?: never;
1537
+ trace?: never;
1538
+ };
1539
+ "/v1/simc/usage": {
1540
+ parameters: {
1541
+ query?: never;
1542
+ header?: never;
1543
+ path?: never;
1544
+ cookie?: never;
1545
+ };
1546
+ /**
1547
+ * Get your usage summary
1548
+ * @description Returns your usage for the current period along with a live snapshot of queued and in-flight jobs. For your credit balance, see `GET /v1/simc/credits`.
1549
+ */
1550
+ get: {
1551
+ parameters: {
1552
+ query?: never;
1553
+ header?: never;
1554
+ path?: never;
1555
+ cookie?: never;
1556
+ };
1557
+ requestBody?: never;
1558
+ responses: {
1559
+ /** @description Your usage summary, including both period-based metrics and live snapshot counters. */
1560
+ 200: {
1561
+ headers: {
1562
+ /** @description Your in-flight job count at the time of this response. */
1563
+ "X-Active-Jobs": string;
1564
+ /** @description Your account ceiling for in-flight jobs. */
1565
+ "X-Max-Active-Jobs": string;
1566
+ [name: string]: unknown;
1567
+ };
1568
+ content: {
1569
+ "application/json": {
1570
+ period: {
1571
+ /**
1572
+ * Format: date-time
1573
+ * @description UTC start of the usage period.
1574
+ */
1575
+ start: string | null;
1576
+ /**
1577
+ * Format: date-time
1578
+ * @description UTC end of the usage period.
1579
+ */
1580
+ end: string | null;
1581
+ /** @description Completed sims in the current period. */
1582
+ simsRun: number;
1583
+ /** @description Average runtime in seconds for completed sims in the current period. */
1584
+ avgRuntimeSeconds: number | null;
1585
+ /** @description API read requests consumed in the current period. */
1586
+ readsUsed: number | null;
1587
+ /** @description Maximum read requests allowed in the current period. Null means no cap. */
1588
+ readsLimit: number | null;
1589
+ /**
1590
+ * Format: date-time
1591
+ * @description When the current reads cap resets.
1592
+ */
1593
+ readsCapResetAt: string | null;
1594
+ };
1595
+ snapshot: {
1596
+ /** @description Number of jobs currently in flight. The ceiling is `limits.maxActiveJobs`. */
1597
+ activeJobs: number | null;
1598
+ /** @description Number of jobs currently queued. */
1599
+ queuedJobs: number | null;
1600
+ /** @description Number of jobs currently running or starting. */
1601
+ runningJobs: number | null;
1602
+ };
1603
+ limits: {
1604
+ /** @description Maximum jobs your account can have in flight. */
1605
+ maxActiveJobs: number | null;
1606
+ /** @description Maximum wall-clock runtime per job in seconds. */
1607
+ maxRuntimeSeconds: number | null;
1608
+ /** @description Default runtime per job in seconds. */
1609
+ defaultRuntimeSeconds: number | null;
1610
+ /** @description Maximum time in seconds a job may wait in the queue before being cancelled. */
1611
+ maxQueueSeconds: number | null;
1612
+ /** @description Default queue wait per job in seconds. */
1613
+ defaultQueueSeconds: number | null;
1614
+ /** @description Number of vCPUs allocated to each job. */
1615
+ vcpuPerJob: number;
1616
+ /** @description Maximum simc variants (profilesets, copies, sets) allowed per job. Null means no cap. */
1617
+ maxSimcVariants: number | null;
1618
+ /** @description Per-job priority surcharge in credits, by priority. Added to the base compute cost for jobs submitted at `high`. */
1619
+ priorityFeeCredits: {
1620
+ high?: number;
1621
+ };
1622
+ };
1623
+ };
1624
+ };
1625
+ };
1626
+ /** @description Your API token is missing, invalid, or not authorized for this request. See `code` for the specific reason. */
1627
+ 401: {
1628
+ headers: {
1629
+ [name: string]: unknown;
1630
+ };
1631
+ content: {
1632
+ "application/json": {
1633
+ error: string;
1634
+ /** @enum {string} */
1635
+ code: "missing_token" | "invalid_token" | "revoked_token" | "expired_token";
1636
+ meta: {
1637
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
1638
+ [key: string]: string | number | boolean | null;
1639
+ }[] | null;
1640
+ } | null;
1641
+ };
1642
+ };
1643
+ };
1644
+ };
1645
+ };
1646
+ put?: never;
1647
+ post?: never;
1648
+ delete?: never;
1649
+ options?: never;
1650
+ head?: never;
1651
+ patch?: never;
1652
+ trace?: never;
1653
+ };
1654
+ "/v1/simc/credits": {
1655
+ parameters: {
1656
+ query?: never;
1657
+ header?: never;
1658
+ path?: never;
1659
+ cookie?: never;
1660
+ };
1661
+ /**
1662
+ * Get your credit balance and active grants
1663
+ * @description Returns your credit balance, split between purchased credits and any active grants. Total available credits equal `purchased + sum(grants[].remaining)`. `reserved` reports credits currently held against in-flight jobs and is already excluded from both `purchased` and `grants[].remaining`.
1664
+ *
1665
+ * Consumption order: grants are spent before purchased credits, with the earliest-expiring grant spent first. Grants without an expiry are spent last.
1666
+ *
1667
+ * For transaction history and lifetime totals, see the dashboard.
1668
+ */
1669
+ get: {
1670
+ parameters: {
1671
+ query?: never;
1672
+ header?: never;
1673
+ path?: never;
1674
+ cookie?: never;
1675
+ };
1676
+ requestBody?: never;
1677
+ responses: {
1678
+ /** @description Your credit balance and active grants. */
1679
+ 200: {
1680
+ headers: {
1681
+ [name: string]: unknown;
1682
+ };
1683
+ content: {
1684
+ "application/json": {
1685
+ /** @description Total purchased credit balance. Purchased credits do not expire. */
1686
+ purchased: number;
1687
+ /** @description Credits currently held against your in-flight jobs. Refunded on settlement (any unused amount returns to `purchased` and `grants[].remaining`). Excluded from `purchased` and `grants[].remaining`. */
1688
+ reserved: number;
1689
+ /** @description Your active grants, ordered by expiry (soonest first; grants without expiry last). Empty when no grants are active. */
1690
+ grants: {
1691
+ id: string;
1692
+ /**
1693
+ * @description The reason this grant was issued.
1694
+ * @enum {string}
1695
+ */
1696
+ reason: "grant_sandbox_allowance" | "grant_developer_allowance" | "grant_beta" | "grant_promo" | "grant_onboarding" | "grant_sandbox_restricted_onboarding" | "grant_personal_allowance";
1697
+ /** @description Credits currently available in this grant. Excludes any credits already committed to in-flight jobs. */
1698
+ remaining: number;
1699
+ /** @description Credits originally issued in this grant. */
1700
+ original: number;
1701
+ /**
1702
+ * Format: date-time
1703
+ * @description When this grant expires. `null` means the grant has no expiry. After expiry, any remaining credits in the grant are forfeited and the grant no longer appears in this response.
1704
+ */
1705
+ expiresAt: string | null;
1706
+ }[];
1707
+ };
1708
+ };
1709
+ };
1710
+ /** @description Your API token is missing, invalid, or not authorized for this request. See `code` for the specific reason. */
1711
+ 401: {
1712
+ headers: {
1713
+ [name: string]: unknown;
1714
+ };
1715
+ content: {
1716
+ "application/json": {
1717
+ error: string;
1718
+ /** @enum {string} */
1719
+ code: "missing_token" | "invalid_token" | "revoked_token" | "expired_token";
1720
+ meta: {
1721
+ [key: string]: (string | number | boolean) | (string | number | boolean)[] | {
1722
+ [key: string]: string | number | boolean | null;
1723
+ }[] | null;
1724
+ } | null;
1725
+ };
1726
+ };
1727
+ };
1728
+ };
1729
+ };
1730
+ put?: never;
1731
+ post?: never;
1732
+ delete?: never;
1733
+ options?: never;
1734
+ head?: never;
1735
+ patch?: never;
1736
+ trace?: never;
1737
+ };
1738
+ }
1739
+ interface components {
1740
+ schemas: {
1741
+ JobLinks: {
1742
+ /**
1743
+ * Format: uri
1744
+ * @description URL to a hosted page for this job. Shows a state-aware page (queued, running, failed) while the job is pre-terminal and the full HTML summary once it completes. The page does not auto-refresh today; reload to see the latest state. Returns `404` after retention expires.
1745
+ */
1746
+ share: string;
1747
+ /**
1748
+ * Format: uri
1749
+ * @description URL to the manifest JSON for the latest attempt. Only present once the job reaches a terminal status. Returns `404` after retention expires. May change between responses if the job is retried.
1750
+ */
1751
+ manifest?: string;
1752
+ };
1753
+ };
1754
+ responses: never;
1755
+ parameters: never;
1756
+ requestBodies: never;
1757
+ headers: never;
1758
+ pathItems: never;
1759
+ }
1760
+
1761
+ /** 200-response JSON body of an operation. */
1762
+ type Ok<T> = T extends {
1763
+ responses: {
1764
+ 200: {
1765
+ content: {
1766
+ 'application/json': infer B;
1767
+ };
1768
+ };
1769
+ };
1770
+ } ? B : never;
1771
+ type JobCreateParams = NonNullable<paths['/v1/simc/jobs']['post']['requestBody']>['content']['application/json'];
1772
+ type JobCreateResponse = Ok<paths['/v1/simc/jobs']['post']>;
1773
+ type Job = Ok<paths['/v1/simc/jobs/{id}']['get']>;
1774
+ type JobStatus = Job['status'];
1775
+ type JobErrorCode = NonNullable<Job['errorCode']>;
1776
+ type CompletedJob = Job & {
1777
+ status: 'completed';
1778
+ };
1779
+ type JobResult = Ok<paths['/v1/simc/jobs/{id}/result']['get']>;
1780
+ type ArtifactUrl = Ok<paths['/v1/simc/artifacts/{id}/url']['get']>;
1781
+ type JobStatusResponse = Ok<paths['/v1/simc/jobs/{id}/status']['get']>;
1782
+ type JobCancelResponse = Ok<paths['/v1/simc/jobs/{id}/cancel']['post']>;
1783
+ type CreditBalance = Ok<paths['/v1/simc/credits']['get']>;
1784
+ type CreditGrant = CreditBalance['grants'][number];
1785
+
1786
+ /** The `artifacts` resource. */
1787
+ declare class Artifacts {
1788
+ #private;
1789
+ constructor(client: Simmit);
1790
+ /**
1791
+ * Fetch a stable public download URL for an artifact, valid for the
1792
+ * artifact's full retention window — the same URL `jobs.getResult` returns,
1793
+ * fetched on demand (e.g. browser flows that control the final fetch). The
1794
+ * artifact is gone (410) once its retention window passes.
1795
+ */
1796
+ getUrl(artifactId: string, options?: RequestOptions): APIPromise<ArtifactUrl>;
1797
+ }
1798
+
1799
+ /** The `credits` resource. */
1800
+ declare class Credits {
1801
+ #private;
1802
+ constructor(client: Simmit);
1803
+ /** Fetch the account's current credit balance and per-grant breakdown. */
1804
+ get(options?: RequestOptions): APIPromise<CreditBalance>;
1805
+ }
1806
+
1807
+ interface JobWaitOptions extends RequestOptions {
1808
+ /** Initial delay between status polls, ms. Grows ×1.5 per poll to a 10s cap; values under 100 are raised to it. Default 1_000. */
1809
+ pollIntervalMs?: number;
1810
+ /** Overall wait deadline, ms. Default derived from the job's applied ceilings. */
1811
+ waitTimeoutMs?: number;
1812
+ /** Fired once with the raw create response (job id, ceilings, input warnings) before polling. */
1813
+ onCreated?: (response: JobCreateResponse) => void;
1814
+ /** Fired after every successful status poll (progress, stage, queue estimate). */
1815
+ onPoll?: (status: JobStatusResponse) => void;
1816
+ }
1817
+ /**
1818
+ * The `jobs` resource. Each single-request method is a thin wrapper over
1819
+ * `client._request` with the path/method/types pinned to the spec;
1820
+ * `createAndWait` orchestrates several of them.
1821
+ */
1822
+ declare class Jobs {
1823
+ #private;
1824
+ constructor(client: Simmit);
1825
+ /**
1826
+ * Submit a new SimC sim. Returns immediately with the job handle; the sim
1827
+ * runs asynchronously. `idempotent: true` makes the request layer attach an
1828
+ * auto-generated idempotency key so the POST is safe to retry; pass
1829
+ * `options.idempotencyKey` to supply your own.
1830
+ */
1831
+ create(params: JobCreateParams, options?: RequestOptions): APIPromise<JobCreateResponse>;
1832
+ /** Fetch the full record for a job. */
1833
+ get(jobId: string, options?: RequestOptions): APIPromise<Job>;
1834
+ /**
1835
+ * Fetch the live status of a job in any state — `status`, `errorCode`,
1836
+ * `progress`, and `queue` estimate. Unlike `getResult`, it never throws for a
1837
+ * non-terminal job, so it is the supported way to drive a custom poll loop.
1838
+ */
1839
+ getStatus(jobId: string, options?: RequestOptions): APIPromise<JobStatusResponse>;
1840
+ /**
1841
+ * Fetch the result summary of a terminal job. Throws `ResultNotReadyError`
1842
+ * (409) while the job is still running — poll `/status` or use
1843
+ * `createAndWait` rather than `/result` for a job in flight.
1844
+ */
1845
+ getResult(jobId: string, options?: RequestOptions): APIPromise<JobResult>;
1846
+ /**
1847
+ * Submit a job and resolve once it reaches a terminal state. Polls
1848
+ * `GET /v1/simc/jobs/{id}/status` (first after `pollIntervalMs`, then ×1.5 to
1849
+ * a 10s cap), then fetches the full record. Resolves with the `CompletedJob`
1850
+ * on success; throws `JobFailedError` / `JobCancelledError` /
1851
+ * `JobTimedOutError` for the other terminal states, or `JobWaitTimeoutError`
1852
+ * if the deadline passes first — the job keeps running and is **not**
1853
+ * cancelled (call `cancel(jobId)` to stop the spend). `signal` aborts the wait
1854
+ * with `APIUserAbortError`, also without cancelling.
1855
+ */
1856
+ createAndWait(params: JobCreateParams, options?: JobWaitOptions): Promise<CompletedJob>;
1857
+ /**
1858
+ * Request cancellation. Returns `status: 'cancelled'` when the job ended
1859
+ * before it ran, or `status: 'cancel_requested'` when an in-flight job was
1860
+ * signaled to stop. Repeat calls are naturally idempotent, so no key is sent.
1861
+ */
1862
+ cancel(jobId: string, options?: RequestOptions): APIPromise<JobCancelResponse>;
1863
+ }
1864
+
1865
+ interface ClientOptions {
1866
+ /** Defaults to process.env['SIMMIT_SECRET_KEY'] — exactly one env fallback. Construction
1867
+ * throws SimmitError('Missing secret key. Pass secretKey or set SIMMIT_SECRET_KEY.').
1868
+ * "Secret key" is the credential noun end to end (dashboard → docs → env var → option →
1869
+ * error): it spends credits and must never ship client-side. */
1870
+ secretKey?: string | null;
1871
+ /** Defaults to process.env['SIMMIT_BASE_URL'] ?? 'https://api.simmit.com'. */
1872
+ baseURL?: string | null;
1873
+ /** Per-attempt timeout in ms. Default 60_000. (Retries can extend total wall time.) */
1874
+ timeout?: number;
1875
+ /** Max retries after the first attempt for retryable failures. Default 2. */
1876
+ maxRetries?: number;
1877
+ /** Headers sent with every request. Merged under per-request headers. */
1878
+ defaultHeaders?: Record<string, string | null | undefined>;
1879
+ /** Custom fetch (testing, proxies). Defaults to globalThis.fetch. */
1880
+ fetch?: typeof globalThis.fetch;
1881
+ /** Extra RequestInit fields passed to every fetch call (e.g. undici dispatcher). */
1882
+ fetchOptions?: RequestInit;
1883
+ }
1884
+ interface RequestOptions {
1885
+ /** Per-attempt timeout in ms. Overrides ClientOptions.timeout. */
1886
+ timeout?: number;
1887
+ /** Abort the call (including retries and waiting). Throws APIUserAbortError. Never retried. */
1888
+ signal?: AbortSignal;
1889
+ /** Overrides ClientOptions.maxRetries for this call. */
1890
+ maxRetries?: number;
1891
+ /** Merged over defaultHeaders; a null value deletes the header. */
1892
+ headers?: Record<string, string | null | undefined>;
1893
+ /** jobs.create / jobs.createAndWait only: replaces the auto-generated idempotency-key. */
1894
+ idempotencyKey?: string;
1895
+ }
1896
+ declare class Simmit {
1897
+ #private;
1898
+ readonly jobs: Jobs;
1899
+ readonly credits: Credits;
1900
+ readonly artifacts: Artifacts;
1901
+ readonly baseURL: string;
1902
+ constructor(options?: ClientOptions);
1903
+ /** @internal Resource classes route through here; not public surface. */
1904
+ _request<T>(spec: RequestSpec, options?: RequestOptions): APIPromise<T>;
1905
+ }
1906
+
1907
+ declare class SimmitError extends Error {
1908
+ }
1909
+ /**
1910
+ * Value shapes the API's generic error `meta` bag can carry
1911
+ * (400/401/404/410/413 responses): JSON scalars, scalar arrays, or arrays of
1912
+ * flat objects.
1913
+ */
1914
+ type MetaValue = string | number | boolean | null | Array<string | number | boolean> | Array<Record<string, string | number | boolean | null>>;
1915
+ type GenericMeta = Record<string, MetaValue>;
1916
+ declare class APIError<TStatus extends number | undefined = number | undefined, TCode extends string | undefined = string | undefined, TMeta = GenericMeta | null> extends SimmitError {
1917
+ /** HTTP status of the response that caused the error. */
1918
+ readonly status: TStatus;
1919
+ /** HTTP headers of the response that caused the error. */
1920
+ readonly headers: Headers | undefined;
1921
+ /** Machine-readable `code` from the error envelope. */
1922
+ readonly code: TCode;
1923
+ /** Typed `meta` from the error envelope. */
1924
+ readonly meta: TMeta;
1925
+ /** Raw parsed JSON error body — escape hatch for unmapped fields. */
1926
+ readonly error: object | undefined;
1927
+ constructor(status: TStatus, body: object | undefined, message: string | undefined, headers: Headers | undefined);
1928
+ private static makeMessage;
1929
+ /**
1930
+ * Maps a response to the most specific error class: status selects the base
1931
+ * class; an enumerated `code` with structured `meta` selects the subclass;
1932
+ * anything unrecognized falls back to the status class so new server codes
1933
+ * degrade gracefully without breaking `instanceof` handling.
1934
+ */
1935
+ static generate(status: number | undefined, body: object | undefined, message: string | undefined, headers: Headers | undefined): APIError<number | undefined, string | undefined, GenericMeta | null | undefined>;
1936
+ }
1937
+ declare class BadRequestError extends APIError<400, string> {
1938
+ }
1939
+ type AuthenticationErrorCode = 'missing_token' | 'invalid_token' | 'revoked_token' | 'expired_token';
1940
+ declare class AuthenticationError extends APIError<401, AuthenticationErrorCode> {
1941
+ }
1942
+ declare class BillingError extends APIError<402, string> {
1943
+ }
1944
+ type InsufficientCreditsMeta = {
1945
+ reason: string;
1946
+ ceilingRuntimeSeconds?: number;
1947
+ /** Largest maxRuntimeSeconds the current balance can cover. */
1948
+ maxAffordableRuntimeSeconds?: number;
1949
+ docsUrl?: string;
1950
+ };
1951
+ declare class InsufficientCreditsError extends BillingError {
1952
+ readonly code: 'insufficient_credits';
1953
+ readonly meta: InsufficientCreditsMeta | null;
1954
+ }
1955
+ type InsufficientCreditsLiabilityMeta = {
1956
+ reason: string;
1957
+ /** The high-priority fee in effect — top up, or resubmit at priority 'standard'. */
1958
+ priorityFeeCredits: number;
1959
+ docsUrl?: string;
1960
+ };
1961
+ declare class InsufficientCreditsLiabilityError extends BillingError {
1962
+ readonly code: 'insufficient_credits_liability';
1963
+ readonly meta: InsufficientCreditsLiabilityMeta | null;
1964
+ }
1965
+ declare class NotFoundError extends APIError<404, string> {
1966
+ }
1967
+ declare class ConflictError extends APIError<409, string> {
1968
+ }
1969
+ declare class IdempotencyKeyReuseError extends ConflictError {
1970
+ readonly code: 'idempotency_key_reuse';
1971
+ readonly meta: {
1972
+ reason: 'idempotency_key_reuse';
1973
+ /** ID of the job that originally consumed this idempotency key. */
1974
+ originalJobId: string;
1975
+ docsUrl?: string;
1976
+ };
1977
+ }
1978
+ declare class ResultNotReadyError extends ConflictError {
1979
+ readonly code: 'result_not_ready';
1980
+ readonly meta: {
1981
+ status: 'pending' | 'queued' | 'starting' | 'running';
1982
+ };
1983
+ }
1984
+ declare class JobNotCancellableError extends ConflictError {
1985
+ readonly code: 'job_not_cancellable';
1986
+ readonly meta: {
1987
+ id: string;
1988
+ status: JobStatus;
1989
+ };
1990
+ }
1991
+ declare class RequestTooLargeError extends APIError<413, string> {
1992
+ }
1993
+ declare class UnprocessableEntityError extends APIError<422, string> {
1994
+ }
1995
+ declare class InvalidProfileError extends UnprocessableEntityError {
1996
+ readonly code: 'input_sanitized_rejected';
1997
+ readonly meta: {
1998
+ reason: 'input_sanitized_rejected';
1999
+ message: string;
2000
+ docsUrl: string;
2001
+ /** Sample of rejected lines; see blockedCount/blockedTruncated for the full set. */
2002
+ blocked: Array<{
2003
+ line: number;
2004
+ text: string;
2005
+ }>;
2006
+ blockedCount: number;
2007
+ blockedTruncated: boolean;
2008
+ };
2009
+ }
2010
+ declare class ResultUnavailableError extends UnprocessableEntityError {
2011
+ readonly code: 'result_unavailable';
2012
+ readonly meta: {
2013
+ status: 'completed' | 'failed' | 'cancelled' | 'timed_out';
2014
+ };
2015
+ }
2016
+ type RateLimitErrorCode = 'rate_limit_exceeded' | 'max_active_jobs_exceeded';
2017
+ declare class RateLimitError extends APIError<429, RateLimitErrorCode> {
2018
+ readonly meta: {
2019
+ scope: 'developer';
2020
+ } | {
2021
+ reason: 'max_active_jobs_exceeded';
2022
+ maxActiveJobs: number;
2023
+ activeJobs: number;
2024
+ } | null;
2025
+ }
2026
+ declare class MaxActiveJobsError extends RateLimitError {
2027
+ readonly code: 'max_active_jobs_exceeded';
2028
+ readonly meta: {
2029
+ reason: 'max_active_jobs_exceeded';
2030
+ /** Maximum number of jobs the account can have in flight. */
2031
+ maxActiveJobs: number;
2032
+ /** Jobs in flight when this request was rejected. */
2033
+ activeJobs: number;
2034
+ };
2035
+ }
2036
+ declare class InternalServerError extends APIError<number, string> {
2037
+ }
2038
+ /**
2039
+ * 503 carries four enumerated codes with distinct meta — a discriminated
2040
+ * union, narrowed via `.body`. `api_maintenance` gets no special retry
2041
+ * behavior: standard policy applies, and the typed
2042
+ * `meta.retryAfterSeconds` is surfaced so callers can schedule their own
2043
+ * resubmission.
2044
+ */
2045
+ type ServiceUnavailableBody = {
2046
+ code: 'queue_unavailable';
2047
+ meta: {
2048
+ reason: 'queue_unavailable';
2049
+ queueHealth: string;
2050
+ };
2051
+ } | {
2052
+ code: 'queue_health_unknown';
2053
+ meta: {
2054
+ reason: 'queue_health_unknown';
2055
+ laneId: string;
2056
+ };
2057
+ } | {
2058
+ code: 'secret_store_unavailable';
2059
+ meta: {
2060
+ reason: 'secret_store_unavailable';
2061
+ };
2062
+ } | {
2063
+ code: 'api_maintenance';
2064
+ meta: {
2065
+ retryAfterSeconds: number;
2066
+ };
2067
+ };
2068
+ declare class ServiceUnavailableError extends InternalServerError {
2069
+ readonly status: 503;
2070
+ /** The discriminated 503 envelope: `if (e.body.code === 'api_maintenance') e.body.meta.retryAfterSeconds`. */
2071
+ get body(): ServiceUnavailableBody;
2072
+ }
2073
+ declare class APIConnectionError extends APIError<undefined, undefined, undefined> {
2074
+ constructor({ message, cause }?: {
2075
+ message?: string | undefined;
2076
+ cause?: Error | undefined;
2077
+ });
2078
+ }
2079
+ declare class APIConnectionTimeoutError extends APIConnectionError {
2080
+ constructor({ message }?: {
2081
+ message?: string;
2082
+ });
2083
+ }
2084
+ declare class APIUserAbortError extends APIError<undefined, undefined, undefined> {
2085
+ constructor({ message }?: {
2086
+ message?: string;
2087
+ });
2088
+ }
2089
+ /** Catch-all for a job that reached a terminal state other than `completed`. */
2090
+ declare abstract class JobUnsuccessfulError extends SimmitError {
2091
+ readonly job: Job;
2092
+ constructor(job: Job, message?: string);
2093
+ }
2094
+ declare class JobFailedError extends JobUnsuccessfulError {
2095
+ }
2096
+ /** Includes queue_timeout auto-cancellation, not just user cancels. */
2097
+ declare class JobCancelledError extends JobUnsuccessfulError {
2098
+ }
2099
+ /** The job hit its runtime ceiling server-side and is billed for what ran. */
2100
+ declare class JobTimedOutError extends JobUnsuccessfulError {
2101
+ }
2102
+ /**
2103
+ * The SDK gave up polling — the job itself is still running and billing.
2104
+ * Keep tracking via `jobs.get(jobId)` or stop the spend with `jobs.cancel(jobId)`.
2105
+ */
2106
+ declare class JobWaitTimeoutError extends SimmitError {
2107
+ readonly jobId: string;
2108
+ readonly lastStatus: JobStatus;
2109
+ constructor(args: {
2110
+ jobId: string;
2111
+ lastStatus: JobStatus;
2112
+ message?: string;
2113
+ });
2114
+ }
2115
+ declare class WebhookVerificationError extends SimmitError {
2116
+ }
2117
+
2118
+ /** The one hand-written wire type: the webhook payload has no OpenAPI schema. */
2119
+ interface WebhookEvent {
2120
+ kind: 'job.terminal';
2121
+ version: 'v1';
2122
+ timestamp: string;
2123
+ payload: {
2124
+ id: string;
2125
+ statusReason: string | null;
2126
+ status: Extract<JobStatus, 'completed' | 'failed' | 'cancelled' | 'timed_out'>;
2127
+ };
2128
+ }
2129
+ /**
2130
+ * Verifies an `X-Simmit-Signature` header — `t=<unix>,v1=<hex>`, an HMAC-SHA256
2131
+ * (timing-safe) over `${t}.${rawBody}` within a 300s default tolerance — and
2132
+ * returns the parsed event. Throws `WebhookVerificationError` on a bad
2133
+ * signature, malformed header, or stale timestamp.
2134
+ *
2135
+ * Pass `rawBody` exactly as received: re-serializing changes the bytes and
2136
+ * breaks verification. `secret` is the webhook signing secret (dashboard →
2137
+ * Clients & Keys → Webhook), not your API key.
2138
+ */
2139
+ declare function unwrapWebhook(rawBody: string, signatureHeader: string, secret: string, options?: {
2140
+ toleranceSeconds?: number;
2141
+ }): Promise<WebhookEvent>;
2142
+
2143
+ export { APIConnectionError, APIConnectionTimeoutError, APIError, APIPromise, APIUserAbortError, type ArtifactUrl, Artifacts, AuthenticationError, type AuthenticationErrorCode, BadRequestError, BillingError, type ClientOptions, type CompletedJob, ConflictError, type CreditBalance, type CreditGrant, Credits, type GenericMeta, IdempotencyKeyReuseError, InsufficientCreditsError, InsufficientCreditsLiabilityError, type InsufficientCreditsLiabilityMeta, type InsufficientCreditsMeta, InternalServerError, InvalidProfileError, type Job, type JobCancelResponse, JobCancelledError, type JobCreateParams, type JobCreateResponse, type JobErrorCode, JobFailedError, JobNotCancellableError, type JobResult, type JobStatus, type JobStatusResponse, JobTimedOutError, JobUnsuccessfulError, type JobWaitOptions, JobWaitTimeoutError, Jobs, MaxActiveJobsError, type MetaValue, NotFoundError, RateLimitError, type RateLimitErrorCode, type RequestOptions, RequestTooLargeError, ResultNotReadyError, ResultUnavailableError, type ServiceUnavailableBody, ServiceUnavailableError, Simmit, SimmitError, UnprocessableEntityError, type WebhookEvent, WebhookVerificationError, Simmit as default, unwrapWebhook };