@qtsurfer/api-client 0.19.0 → 0.21.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.
@@ -119,12 +119,34 @@ export type Account = {
119
119
  * Your current subscription tier.
120
120
  */
121
121
  tier: string;
122
+ /**
123
+ * Maximum number of strategy executions (and sweeps) you can have running at the same time
124
+ * through the API. Starting one past this number is answered with `429`, whose message
125
+ * carries the same number. The value already includes any API allowance your plan has.
126
+ *
127
+ */
128
+ maxExecute: number;
129
+ /**
130
+ * Maximum length, in days, of the time range of a backtest on one of your own datasets.
131
+ */
132
+ maxRangeDays: number;
133
+ /**
134
+ * Largest full grid, in parameter combinations, a sweep may run with the `grid` sampler.
135
+ * A grid with more combinations is refused with `400`; the `random` and `lhs` samplers run
136
+ * only their `samples` and are not held to it.
137
+ *
138
+ */
139
+ maxSweepCartesian: number;
140
+ /**
141
+ * Maximum length, in hours, of the time range of one dataset import from an exchange.
142
+ */
143
+ maxImportRangeHours: number;
122
144
  /**
123
145
  * Maximum number of active datasets your tier allows.
124
146
  */
125
147
  maxDatasets: number;
126
148
  /**
127
- * Maximum size, in bytes, of a single dataset version.
149
+ * Maximum size, in bytes, of a single dataset version as stored, that is the `bytes` of its ready version. For a CSV upload that is the converted file, not the file you upload, so estimate from the number of rows. The Datasets guide has the details.
128
150
  */
129
151
  maxDatasetBytes: number;
130
152
  /**
@@ -512,6 +534,11 @@ export type SweepAxis =
512
534
  };
513
535
 
514
536
  export type SweepSpecRequest = {
537
+ /**
538
+ * `grid` runs every combination of the axes and is held to your plan's
539
+ * `maxSweepCartesian` (`GET /account`); `random` and `lhs` run `samples` combinations and are not.
540
+ *
541
+ */
515
542
  sampler?: "grid" | "random" | "lhs";
516
543
  /**
517
544
  * Reproducibility seed. If omitted, the server generates one with Java's
@@ -1208,6 +1235,12 @@ export type StrategySummary = {
1208
1235
  *
1209
1236
  */
1210
1237
  requiredSources?: Array<string>;
1238
+ /**
1239
+ * When you deleted this strategy. Only ever present in `GET /strategies?includeDeleted=true`,
1240
+ * and only on strategies you have deleted.
1241
+ *
1242
+ */
1243
+ deletedAt?: string;
1211
1244
  };
1212
1245
 
1213
1246
  /**
@@ -1321,6 +1354,12 @@ export type Dataset = {
1321
1354
  *
1322
1355
  */
1323
1356
  currentVersionId?: string;
1357
+ /**
1358
+ * When you deleted this dataset. Only ever present in `GET /datasets?includeDeleted=true`,
1359
+ * and only on datasets you have deleted.
1360
+ *
1361
+ */
1362
+ deletedAt?: string;
1324
1363
  /**
1325
1364
  * When `currentVersionId` last changed. Absent until it has a value.
1326
1365
  */
@@ -1775,13 +1814,23 @@ export type StartLiveRequest = {
1775
1814
  [key: string]: unknown;
1776
1815
  };
1777
1816
  /**
1778
- * A `public` run appears in `GET /live/public` and its signal channel accepts subscriptions from anyone, not only you.
1817
+ * A `public` run appears in `GET /live/public` and its signal channel accepts subscriptions from anyone, not only you — from the moment it is promoted to `live`. While it is a `sandbox` trial, `public` is only what you asked for, and only you can read it.
1779
1818
  */
1780
1819
  visibility?: "private" | "public";
1781
1820
  /**
1782
- * Request that this run's signals be relayed over its WebSocket channel once it reaches the `live` stage — see the "Live execution" guide. Has no effect while the run is still in the `sandbox` stage, regardless of this value.
1821
+ * Request that this run's signals be relayed over its WebSocket channel, from its first signal — in the `sandbox` stage too, where only you can subscribe to it. See the "Live execution" guide.
1783
1822
  */
1784
1823
  relay?: boolean;
1824
+ /**
1825
+ * Ask for a **stream URL**: a secret address that a simple client, or a service that passes your signals
1826
+ * on to others, can open as a plain WebSocket to receive this run's signals as they are produced, one JSON
1827
+ * text frame per signal, with none of the live-execution protocol around it. The URL comes back as
1828
+ * `streamUrl` in the response to this call. Available from the `sandbox` stage on, on the plans that may
1829
+ * broadcast; any other plan gets `429`. It can be asked for **only when the run is started** (not added
1830
+ * later), and it also turns `relay` on. See the "Live execution" guide, "A plain WebSocket stream of a run".
1831
+ *
1832
+ */
1833
+ stream?: boolean;
1785
1834
  name?: string;
1786
1835
  description?: string;
1787
1836
  paper?: LivePaperConfig;
@@ -1842,6 +1891,19 @@ export type UpdateLiveParamsRequest = {
1842
1891
  };
1843
1892
  };
1844
1893
 
1894
+ export type SendLiveCommandRequest = {
1895
+ /**
1896
+ * The command's text — non-blank.
1897
+ */
1898
+ command: string;
1899
+ /**
1900
+ * An optional map of your own choosing, alongside command. Absent means none; when given, it must be a JSON object, and `command` and `properties` are the only keys the body may carry. Each entry lands as a top-level entry on the strategy's `CommandRequest` — no key is off limits, since the command's own text is kept separately.
1901
+ */
1902
+ properties?: {
1903
+ [key: string]: unknown;
1904
+ };
1905
+ };
1906
+
1845
1907
  /**
1846
1908
  * A live run's full state, as returned by starting, reading, or stopping it through its strategy.
1847
1909
  */
@@ -1855,11 +1917,11 @@ export type LiveRun = {
1855
1917
  description?: string;
1856
1918
  visibility: "private" | "public";
1857
1919
  /**
1858
- * A new run always starts `SANDBOX` — a trial run compared against a second execution for agreement — and moves to `LIVE` once it passes.
1920
+ * A new run always starts `SANDBOX`, a 24-hour trial in which it is compared against a second execution and checked for resource use and stability. A run that passes moves to `LIVE` automatically when the 24 hours are up.
1859
1921
  */
1860
1922
  stage: "SANDBOX" | "LIVE";
1861
1923
  /**
1862
- * `STARTING` until first observed running; otherwise the runner's own reported state (e.g. `RUNNING`).
1924
+ * The run's health right now: `STARTING` (no runner has reported on it yet), `RUNNING`, `LAGGING` (behind the market data, usually while catching up; clears by itself), `HUNG` (stuck inside one strategy call for longer than allowed; clears when it returns), `DEGRADED` (its independent executions produced different signals), `FAILED` (refused, could not start or failed while running; `reason` says why) or `STOPPED`. `LAGGING`, `HUNG` and `DEGRADED` come and go on a running run. The set may grow: read an unknown value as a running run with something to look at. See the Live execution guide.
1863
1925
  */
1864
1926
  state: string;
1865
1927
  /**
@@ -1867,7 +1929,17 @@ export type LiveRun = {
1867
1929
  */
1868
1930
  desired: "RUNNING" | "STOPPED";
1869
1931
  /**
1870
- * Present only when the run stopped because it exceeded its resource allowance.
1932
+ * Why the run stopped or failed, when there is something to say; absent otherwise. It is never a
1933
+ * stack trace or an internal message. Either `resource: ...` (the platform stopped the run for
1934
+ * exceeding its resource allowance; the text says which limit) or one of a fixed set of sentences for
1935
+ * a `FAILED` run: the strategy cannot consume the source type the run was started with, the run's
1936
+ * definition was refused, the run could not start after several attempts, the strategy failed while
1937
+ * processing data, the run lost its data feed, or the generic `The run failed.`. The set may grow:
1938
+ * read an unrecognised sentence as a failure and do not parse it. A `FAILED` run usually stays
1939
+ * `desired: RUNNING` until you stop it, and counts as active (`409` on a new start, and toward your
1940
+ * live-run limit) until then; one that can never run because its strategy cannot consume its source
1941
+ * type is stopped by the platform itself (`desired: STOPPED`), so it holds no place.
1942
+ *
1871
1943
  */
1872
1944
  reason?: string;
1873
1945
  sources: Array<LiveSource>;
@@ -1879,7 +1951,7 @@ export type LiveRun = {
1879
1951
  */
1880
1952
  paramsVersion: number;
1881
1953
  /**
1882
- * Whether this run's signals are being relayed over the WebSocket channel described in the "Live execution" guide, right now. This is the effective value — `false` on a `sandbox` run regardless of what was requested at start; matches the requested value once `stage` reaches `live`.
1954
+ * Whether this run's signals are relayed over the WebSocket channel described in the "Live execution" guide. It is the value requested at start, in either stage.
1883
1955
  */
1884
1956
  relay: boolean;
1885
1957
  /**
@@ -1887,7 +1959,7 @@ export type LiveRun = {
1887
1959
  */
1888
1960
  startedAtMs: number;
1889
1961
  /**
1890
- * The sandbox trial's promotion verdict, once one exists. Shape is not yet stabilized as public API — treat as opaque diagnostics.
1962
+ * The sandbox trial's promotion verdict. Absent for the whole 24-hour trial and present once it ends, so an absent `gate` means the trial has not finished. `passed` is the verdict; the rest is diagnostic detail whose shape is not yet stabilized as public API: treat it as opaque.
1891
1963
  */
1892
1964
  gate?: {
1893
1965
  [key: string]: unknown;
@@ -1896,6 +1968,102 @@ export type LiveRun = {
1896
1968
  * The run's paper trading configuration as accepted at start, normalised. Absent when the run has no paper trading.
1897
1969
  */
1898
1970
  paper?: LivePaperConfig;
1971
+ /**
1972
+ * The run's latest counters. Returned by the two reads, `GET /strategy/{strategyId}/live` and
1973
+ * `GET /live/{runId}`; never by starting or stopping a run. Absent until the first snapshot exists
1974
+ * (a run that has just started), and absent is not zero.
1975
+ *
1976
+ */
1977
+ stats?: LiveRunStats;
1978
+ };
1979
+
1980
+ /**
1981
+ * What a run has been doing, as of its last snapshot. The platform refreshes it about once a minute
1982
+ * while the run is being executed, so `opsPerSecond` is an average over that interval, not an
1983
+ * instantaneous rate.
1984
+ *
1985
+ */
1986
+ export type LiveRunStats = {
1987
+ /**
1988
+ * Updates of instruments the run has accepted since it started executing. It can start again from zero if the run is restarted.
1989
+ */
1990
+ processed: number;
1991
+ /**
1992
+ * Updates accepted per second over the last refresh interval. `0` when none arrived.
1993
+ */
1994
+ opsPerSecond: number;
1995
+ /**
1996
+ * How many distinct instruments the run has received an update for.
1997
+ */
1998
+ instrumentsSeen: number;
1999
+ /**
2000
+ * Epoch milliseconds when these counters were last written.
2001
+ */
2002
+ asOfMs: number;
2003
+ /**
2004
+ * Epoch milliseconds of the last snapshot in which `processed` had grown. Absent until the run has
2005
+ * processed anything. A run fed by a source that updates rarely (a funding rate, for example) can
2006
+ * stay flat for hours: that is how such a run behaves, not a fault.
2007
+ *
2008
+ */
2009
+ progressedAtMs?: number;
2010
+ /**
2011
+ * `true` when the run is meant to be running (`desired` is `RUNNING`) and its counters have not
2012
+ * been refreshed for several refresh intervals: the platform has stopped updating them, which is
2013
+ * worth checking against `state`. `false` otherwise. A run whose `processed` is flat is not stale;
2014
+ * `progressedAtMs` is how to tell it apart.
2015
+ *
2016
+ */
2017
+ stale: boolean;
2018
+ };
2019
+
2020
+ /**
2021
+ * A run as returned by `GET /live/{runId}`, the full state of `LiveRun` plus when it last changed.
2022
+ */
2023
+ export type LiveRunDetail = LiveRun & {
2024
+ /**
2025
+ * Epoch milliseconds of the run's last change, from any cause. It only moves forward, so of two reads of the same run the one with the larger value is the newer.
2026
+ */
2027
+ updatedAtMs: number;
2028
+ };
2029
+
2030
+ /**
2031
+ * A run as `LiveRun` describes it, plus its `streamUrl` when it has one. It is what **starting a run** and
2032
+ * `GET /strategy/{strategyId}/live` return: your own run, read with your own credentials. Stopping a run
2033
+ * and `GET /live/{runId}` return `LiveRun`, which never carries the URL.
2034
+ *
2035
+ */
2036
+ export type LiveRunWithStream = LiveRun & {
2037
+ /**
2038
+ * The run's secret stream URL (`wss://…`). **Treat it like a password**: anyone who holds it can read
2039
+ * this run's signals, from the sandbox stage on. Present only when the run was started with
2040
+ * `stream: true`, is wanted running, has not had its stream revoked, and your plan still lets you
2041
+ * broadcast; absent otherwise (a plan that lets you broadcast again gets the same URL back). Rotate
2042
+ * it with `POST /live/{runId}/stream` if it leaks, revoke it with `DELETE /live/{runId}/stream`.
2043
+ *
2044
+ */
2045
+ streamUrl?: string;
2046
+ };
2047
+
2048
+ /**
2049
+ * A run's new stream URL, as returned by `POST /live/{runId}/stream`.
2050
+ */
2051
+ export type LiveStreamUrl = {
2052
+ /**
2053
+ * The run's new secret stream URL. The previous one has stopped working.
2054
+ */
2055
+ streamUrl: string;
2056
+ };
2057
+
2058
+ /**
2059
+ * What `DELETE /live/{runId}/stream` returns.
2060
+ */
2061
+ export type LiveStreamRevoked = {
2062
+ runId: string;
2063
+ /**
2064
+ * Always `true`.
2065
+ */
2066
+ revoked: boolean;
1899
2067
  };
1900
2068
 
1901
2069
  /**
@@ -1924,17 +2092,31 @@ export type LiveRunSummary = {
1924
2092
  description?: string;
1925
2093
  visibility: "private" | "public";
1926
2094
  /**
1927
- * A new run always starts `SANDBOX` — a trial run compared against a second execution for agreement — and moves to `LIVE` once it passes.
2095
+ * A new run always starts `SANDBOX`, a 24-hour trial in which it is compared against a second execution and checked for resource use and stability. A run that passes moves to `LIVE` automatically when the 24 hours are up.
1928
2096
  */
1929
2097
  stage: "SANDBOX" | "LIVE";
1930
2098
  /**
1931
- * `STARTING` until first observed running; otherwise the runner's own reported state (e.g. `RUNNING`).
2099
+ * The run's health right now: `STARTING` (no runner has reported on it yet), `RUNNING`, `LAGGING` (behind the market data, usually while catching up; clears by itself), `HUNG` (stuck inside one strategy call for longer than allowed; clears when it returns), `DEGRADED` (its independent executions produced different signals), `FAILED` (refused, could not start or failed while running; `reason` says why) or `STOPPED`. `LAGGING`, `HUNG` and `DEGRADED` come and go on a running run. The set may grow: read an unknown value as a running run with something to look at. See the Live execution guide.
1932
2100
  */
1933
2101
  state: string;
1934
2102
  /**
1935
2103
  * What you last asked for. `state` can lag this briefly after `DELETE`.
1936
2104
  */
1937
2105
  desired: "RUNNING" | "STOPPED";
2106
+ /**
2107
+ * Why the run stopped or failed, when there is something to say; absent otherwise. It is never a
2108
+ * stack trace or an internal message. Either `resource: ...` (the platform stopped the run for
2109
+ * exceeding its resource allowance; the text says which limit) or one of a fixed set of sentences for
2110
+ * a `FAILED` run: the strategy cannot consume the source type the run was started with, the run's
2111
+ * definition was refused, the run could not start after several attempts, the strategy failed while
2112
+ * processing data, the run lost its data feed, or the generic `The run failed.`. The set may grow:
2113
+ * read an unrecognised sentence as a failure and do not parse it. A `FAILED` run usually stays
2114
+ * `desired: RUNNING` until you stop it, and counts as active (`409` on a new start, and toward your
2115
+ * live-run limit) until then; one that can never run because its strategy cannot consume its source
2116
+ * type is stopped by the platform itself (`desired: STOPPED`), so it holds no place.
2117
+ *
2118
+ */
2119
+ reason?: string;
1938
2120
  sources: Array<LiveSource>;
1939
2121
  /**
1940
2122
  * Epoch milliseconds this run was started.
@@ -2140,7 +2322,7 @@ export type LiveSignal = {
2140
2322
  instrument: LiveSignalInstrument | null;
2141
2323
  order?: LiveSignalOrder;
2142
2324
  /**
2143
- * The signal's own free-form payload.
2325
+ * The signal's own free-form payload, what the strategy put there with `signal.set(...)`. Whoever may read the run may read it, so on a `public` run it is public. A signal whose `data` is over 8 KiB (8,192 bytes of its JSON) is not pushed on the WebSocket channel, and `GET /live/{runId}/signals` returns it whole.
2144
2326
  */
2145
2327
  data?: {
2146
2328
  [key: string]: unknown;
@@ -2192,6 +2374,18 @@ export type LiveParamsUpdateResult = {
2192
2374
  effectiveAtMs: number;
2193
2375
  };
2194
2376
 
2377
+ export type LiveCommandResult = {
2378
+ runId: string;
2379
+ /**
2380
+ * This command's own id, generated fresh for this call. A retried request is a second, distinct command — this endpoint takes no idempotency key.
2381
+ */
2382
+ commandId: string;
2383
+ /**
2384
+ * Epoch milliseconds — the market position every execution applies this command at.
2385
+ */
2386
+ effectiveAtMs: number;
2387
+ };
2388
+
2195
2389
  export type AuthenticateData = {
2196
2390
  body?: never;
2197
2391
  path?: never;
@@ -2473,7 +2667,14 @@ export type DownloadKlinesResponse =
2473
2667
  export type ListStrategiesData = {
2474
2668
  body?: never;
2475
2669
  path?: never;
2476
- query?: never;
2670
+ query?: {
2671
+ /**
2672
+ * `true` also lists the strategies you have deleted, each with its `deletedAt`. Any other
2673
+ * value, or leaving it out, lists only the ones you have not deleted.
2674
+ *
2675
+ */
2676
+ includeDeleted?: boolean;
2677
+ };
2477
2678
  url: "/strategies";
2478
2679
  };
2479
2680
 
@@ -2508,6 +2709,10 @@ export type CompileStrategyErrors = {
2508
2709
  *
2509
2710
  */
2510
2711
  400: ResponseError;
2712
+ /**
2713
+ * The source is larger than 32 KiB (32768 bytes). Every endpoint that reads a request body caps it, and the message names the cap; see the Strategy guide.
2714
+ */
2715
+ 413: ResponseError;
2511
2716
  /**
2512
2717
  * Too many compilations in flight. Retry later.
2513
2718
  */
@@ -2807,7 +3012,9 @@ export type ExecuteSweepData = {
2807
3012
  export type ExecuteSweepErrors = {
2808
3013
  /**
2809
3014
  * Invalid sweep specification, a `type` that cannot be swept yet (`funding`), or the
2810
- * expanded grid exceeds the server limit.
3015
+ * expanded grid exceeds the server limit. A full `grid` with more combinations than your
3016
+ * plan allows (`maxSweepCartesian` in `GET /account`) is refused with a message that asks
3017
+ * for the `random` or `lhs` sampler.
2811
3018
  *
2812
3019
  */
2813
3020
  400: ResponseError;
@@ -3202,7 +3409,14 @@ export type GetBacktestResultResponse =
3202
3409
  export type ListDatasetsData = {
3203
3410
  body?: never;
3204
3411
  path?: never;
3205
- query?: never;
3412
+ query?: {
3413
+ /**
3414
+ * `true` also lists the datasets you have deleted, each with its `deletedAt`. Any other
3415
+ * value, or leaving it out, lists only the ones you have not deleted.
3416
+ *
3417
+ */
3418
+ includeDeleted?: boolean;
3419
+ };
3206
3420
  url: "/datasets";
3207
3421
  };
3208
3422
 
@@ -3388,7 +3602,7 @@ export type FinalizeDatasetUploadErrors = {
3388
3602
  */
3389
3603
  409: ResponseError;
3390
3604
  /**
3391
- * The uploaded file exceeds your tier's size limit for a dataset.
3605
+ * The uploaded file is many times your tier's size limit for a dataset. The limit itself applies to the stored size, which is known only after conversion, so an upload that passes here can still end `failed` when ingest finishes.
3392
3606
  */
3393
3607
  413: ResponseError;
3394
3608
  /**
@@ -3590,9 +3804,9 @@ export type GetLiveError = GetLiveErrors[keyof GetLiveErrors];
3590
3804
 
3591
3805
  export type GetLiveResponses = {
3592
3806
  /**
3593
- * The run's current state
3807
+ * The run's current state, with its `streamUrl` when it has one
3594
3808
  */
3595
- 200: LiveRun;
3809
+ 200: LiveRunWithStream;
3596
3810
  };
3597
3811
 
3598
3812
  export type GetLiveResponse = GetLiveResponses[keyof GetLiveResponses];
@@ -3611,7 +3825,7 @@ export type StartLiveData = {
3611
3825
 
3612
3826
  export type StartLiveErrors = {
3613
3827
  /**
3614
- * Malformed `sources` (not exactly one entry, missing field, unsupported `type`), an invalid `visibility`, an invalid `paper` block (an unknown field, a wrong type or an out-of-range value), or no `paper` block for a strategy that listens to its own execution events.
3828
+ * Malformed `sources` (not exactly one entry, missing field, unsupported `type`), a `type` the strategy cannot consume (a ticker strategy with a `kline` source, or the reverse; the message names both), an invalid `visibility`, an invalid `paper` block (an unknown field, a wrong type or an out-of-range value), or no `paper` block for a strategy that listens to its own execution events. A `relay` or `stream` that is not `true` or `false`, or a `stream` where streams are not available yet.
3615
3829
  */
3616
3830
  400: ResponseError;
3617
3831
  /**
@@ -3623,9 +3837,10 @@ export type StartLiveErrors = {
3623
3837
  */
3624
3838
  409: ResponseError;
3625
3839
  /**
3626
- * Your plan does not include live runs, would exceed your concurrent-run or
3627
- * instrument-count limit, or the platform is at capacity right now. Carries a
3628
- * `Retry-After` header.
3840
+ * One of two kinds. **Your plan** does not include live runs, would exceed your concurrent-run or
3841
+ * instrument-count limit, or does not let you ask for a `stream`: the message names your plan, and
3842
+ * retrying will not help until something changes, so there is no `Retry-After`. Or **the platform is at
3843
+ * capacity** right now: a `Retry-After` header says when to try again.
3629
3844
  *
3630
3845
  */
3631
3846
  429: ResponseError;
@@ -3635,9 +3850,9 @@ export type StartLiveError = StartLiveErrors[keyof StartLiveErrors];
3635
3850
 
3636
3851
  export type StartLiveResponses = {
3637
3852
  /**
3638
- * Started — the run's own state, in the sandbox stage
3853
+ * Started — the run's own state, in the sandbox stage, with its `streamUrl` when you asked for a stream
3639
3854
  */
3640
- 201: LiveRun;
3855
+ 201: LiveRunWithStream;
3641
3856
  };
3642
3857
 
3643
3858
  export type StartLiveResponse = StartLiveResponses[keyof StartLiveResponses];
@@ -3712,6 +3927,36 @@ export type ListPublicLiveResponses = {
3712
3927
  export type ListPublicLiveResponse =
3713
3928
  ListPublicLiveResponses[keyof ListPublicLiveResponses];
3714
3929
 
3930
+ export type GetLiveRunData = {
3931
+ body?: never;
3932
+ path: {
3933
+ /**
3934
+ * The `runId` from `POST`/`GET`/`DELETE` `.../live`, from `GET /live` or from `GET /live/public`
3935
+ */
3936
+ runId: string;
3937
+ };
3938
+ query?: never;
3939
+ url: "/live/{runId}";
3940
+ };
3941
+
3942
+ export type GetLiveRunErrors = {
3943
+ /**
3944
+ * No such run, or you do not own it — the two look identical on purpose.
3945
+ */
3946
+ 404: ResponseError;
3947
+ };
3948
+
3949
+ export type GetLiveRunError = GetLiveRunErrors[keyof GetLiveRunErrors];
3950
+
3951
+ export type GetLiveRunResponses = {
3952
+ /**
3953
+ * The run
3954
+ */
3955
+ 200: LiveRunDetail;
3956
+ };
3957
+
3958
+ export type GetLiveRunResponse = GetLiveRunResponses[keyof GetLiveRunResponses];
3959
+
3715
3960
  export type UpdateLiveData = {
3716
3961
  body?: UpdateLiveRequest;
3717
3962
  path: {
@@ -3765,7 +4010,7 @@ export type UpdateLiveParamsErrors = {
3765
4010
  */
3766
4011
  404: ResponseError;
3767
4012
  /**
3768
- * This run's compilation has no declared properties on record — recompile the strategy to enable runtime parameter updates.
4013
+ * This run's compiled strategy has no record of the parameters it declares. Register the strategy again with `POST /strategy` and start a new run, since a run keeps the compiled version it started with.
3769
4014
  */
3770
4015
  409: ResponseError;
3771
4016
  };
@@ -3783,6 +4028,127 @@ export type UpdateLiveParamsResponses = {
3783
4028
  export type UpdateLiveParamsResponse =
3784
4029
  UpdateLiveParamsResponses[keyof UpdateLiveParamsResponses];
3785
4030
 
4031
+ export type SendLiveCommandData = {
4032
+ body: SendLiveCommandRequest;
4033
+ path: {
4034
+ runId: string;
4035
+ };
4036
+ query?: never;
4037
+ url: "/live/{runId}/commands";
4038
+ };
4039
+
4040
+ export type SendLiveCommandErrors = {
4041
+ /**
4042
+ * `command` missing, not a string, blank; `properties` given but not an object; or the body carries any key other than `command` and `properties`.
4043
+ */
4044
+ 400: ResponseError;
4045
+ /**
4046
+ * No such run, or you do not own it.
4047
+ */
4048
+ 404: ResponseError;
4049
+ /**
4050
+ * One of three reasons, each its own message: the run is not running, so there is nothing to tell;
4051
+ * this run's compiled strategy has no record of whether it handles commands — register the strategy
4052
+ * again with `POST /strategy` and start a new run, since a run keeps the compiled version it started
4053
+ * with; or the strategy does not implement `CommandRequestHandler` at all.
4054
+ *
4055
+ */
4056
+ 409: ResponseError;
4057
+ /**
4058
+ * The request body is larger than 2 KiB (2048 bytes). Every endpoint that reads a request body caps it, and the message names the cap.
4059
+ */
4060
+ 413: ResponseError;
4061
+ /**
4062
+ * The command could not be delivered right now, and it was not sent — unlike a parameter update, a command has no fallback path. Try again.
4063
+ */
4064
+ 503: ResponseError;
4065
+ };
4066
+
4067
+ export type SendLiveCommandError =
4068
+ SendLiveCommandErrors[keyof SendLiveCommandErrors];
4069
+
4070
+ export type SendLiveCommandResponses = {
4071
+ /**
4072
+ * Accepted — on its way to every execution behind the run.
4073
+ */
4074
+ 202: LiveCommandResult;
4075
+ };
4076
+
4077
+ export type SendLiveCommandResponse =
4078
+ SendLiveCommandResponses[keyof SendLiveCommandResponses];
4079
+
4080
+ export type RevokeLiveStreamData = {
4081
+ body?: never;
4082
+ path: {
4083
+ runId: string;
4084
+ };
4085
+ query?: never;
4086
+ url: "/live/{runId}/stream";
4087
+ };
4088
+
4089
+ export type RevokeLiveStreamErrors = {
4090
+ /**
4091
+ * No such run, or you do not own it.
4092
+ */
4093
+ 404: ResponseError;
4094
+ /**
4095
+ * The run was started without a stream, so there is nothing to revoke.
4096
+ */
4097
+ 409: ResponseError;
4098
+ };
4099
+
4100
+ export type RevokeLiveStreamError =
4101
+ RevokeLiveStreamErrors[keyof RevokeLiveStreamErrors];
4102
+
4103
+ export type RevokeLiveStreamResponses = {
4104
+ /**
4105
+ * Revoked (or already revoked).
4106
+ */
4107
+ 200: LiveStreamRevoked;
4108
+ };
4109
+
4110
+ export type RevokeLiveStreamResponse =
4111
+ RevokeLiveStreamResponses[keyof RevokeLiveStreamResponses];
4112
+
4113
+ export type RotateLiveStreamData = {
4114
+ body?: never;
4115
+ path: {
4116
+ runId: string;
4117
+ };
4118
+ query?: never;
4119
+ url: "/live/{runId}/stream";
4120
+ };
4121
+
4122
+ export type RotateLiveStreamErrors = {
4123
+ /**
4124
+ * No such run, or you do not own it.
4125
+ */
4126
+ 404: ResponseError;
4127
+ /**
4128
+ * One of three reasons, each its own message: the run was started without a stream; its stream was
4129
+ * revoked (a revoked stream cannot be restored: start the run again with a stream); or the run is stopped.
4130
+ *
4131
+ */
4132
+ 409: ResponseError;
4133
+ /**
4134
+ * Your plan does not let you broadcast a run's signals. The message names your plan; retrying will not help until it changes, so there is no `Retry-After`.
4135
+ */
4136
+ 429: ResponseError;
4137
+ };
4138
+
4139
+ export type RotateLiveStreamError =
4140
+ RotateLiveStreamErrors[keyof RotateLiveStreamErrors];
4141
+
4142
+ export type RotateLiveStreamResponses = {
4143
+ /**
4144
+ * The new URL.
4145
+ */
4146
+ 200: LiveStreamUrl;
4147
+ };
4148
+
4149
+ export type RotateLiveStreamResponse =
4150
+ RotateLiveStreamResponses[keyof RotateLiveStreamResponses];
4151
+
3786
4152
  export type GetLiveRunSignalsData = {
3787
4153
  body?: never;
3788
4154
  path: {