@gjermundgaraba/clankerbox-sdk 0.15.6 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client-8af586hb.d.mts +1007 -0
- package/dist/client-CbMWwHdT.mjs +708 -0
- package/dist/index.d.mts +91 -360
- package/dist/index.mjs +161 -140
- package/dist/node.d.mts +6 -2
- package/dist/node.mjs +5 -5
- package/package.json +6 -4
- package/dist/client-BkZhmYJx.mjs +0 -662
- package/dist/client-Cn1bj4It.d.mts +0 -328
|
@@ -0,0 +1,1007 @@
|
|
|
1
|
+
import * as Action from "@gjermundgaraba/effect-actions/Action";
|
|
2
|
+
import * as ActionHttp from "@gjermundgaraba/effect-actions/ActionHttp";
|
|
3
|
+
import { Context, Duration, Effect, Layer, Schema } from "effect";
|
|
4
|
+
import { HttpClient } from "effect/http";
|
|
5
|
+
//#region src/errors.d.ts
|
|
6
|
+
declare const Invalid_base: Schema.Class<Invalid, Schema.TaggedStruct<"Invalid", {
|
|
7
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
8
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
9
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
10
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
11
|
+
readonly message: Schema.String;
|
|
12
|
+
readonly file: Schema.optionalKey<Schema.String>;
|
|
13
|
+
}>, import("effect/Cause").YieldableError>;
|
|
14
|
+
/**
|
|
15
|
+
* The request is malformed, or the host list is one a client can't route by, or a config,
|
|
16
|
+
* profile or setup file couldn't be read or doesn't hold what it should: then `file` names it.
|
|
17
|
+
*/
|
|
18
|
+
declare class Invalid extends Invalid_base {}
|
|
19
|
+
declare const NotFound_base: Schema.Class<NotFound, Schema.TaggedStruct<"NotFound", {
|
|
20
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
21
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
22
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
23
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
24
|
+
readonly message: Schema.String;
|
|
25
|
+
}>, import("effect/Cause").YieldableError>;
|
|
26
|
+
/** The machine or checkpoint doesn't exist. A `delete` that meets it is done. */
|
|
27
|
+
declare class NotFound extends NotFound_base {}
|
|
28
|
+
declare const ConflictKind: Schema.Literals<readonly ["exists", "busy"]>;
|
|
29
|
+
type ConflictKind = typeof ConflictKind.Type;
|
|
30
|
+
declare const Conflict_base: Schema.Class<Conflict, Schema.TaggedStruct<"Conflict", {
|
|
31
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
32
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
33
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
34
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
35
|
+
readonly message: Schema.String;
|
|
36
|
+
readonly kind: Schema.Literals<readonly ["exists", "busy"]>;
|
|
37
|
+
}>, import("effect/Cause").YieldableError>;
|
|
38
|
+
/** The name is taken (`exists`), or another action holds the resource (`busy`). */
|
|
39
|
+
declare class Conflict extends Conflict_base {}
|
|
40
|
+
declare const NotOffered_base: Schema.Class<NotOffered, Schema.TaggedStruct<"NotOffered", {
|
|
41
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
42
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
43
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
44
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
45
|
+
readonly message: Schema.String;
|
|
46
|
+
readonly base: Schema.String;
|
|
47
|
+
}>, import("effect/Cause").YieldableError>;
|
|
48
|
+
/** No host offers `base`: the host a create names, or any in the client's list. */
|
|
49
|
+
declare class NotOffered extends NotOffered_base {}
|
|
50
|
+
declare const NotMade_base: Schema.Class<NotMade, Schema.TaggedStruct<"NotMade", {
|
|
51
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
52
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
53
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
54
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
55
|
+
readonly message: Schema.String;
|
|
56
|
+
readonly machine: Schema.String;
|
|
57
|
+
}>, import("effect/Cause").YieldableError>;
|
|
58
|
+
/** `machine`'s create, fork or restore failed before it was made: it can only be deleted. */
|
|
59
|
+
declare class NotMade extends NotMade_base {}
|
|
60
|
+
declare const Missing_base: Schema.Class<Missing, Schema.TaggedStruct<"Missing", {
|
|
61
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
62
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
63
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
64
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
65
|
+
readonly message: Schema.String;
|
|
66
|
+
readonly machine: Schema.String;
|
|
67
|
+
}>, import("effect/Cause").YieldableError>;
|
|
68
|
+
/** The runtime no longer has `machine`: it can only be deleted. */
|
|
69
|
+
declare class Missing extends Missing_base {}
|
|
70
|
+
declare const NotReady_base: Schema.Class<NotReady, Schema.TaggedStruct<"NotReady", {
|
|
71
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
72
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
73
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
74
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
75
|
+
readonly message: Schema.String;
|
|
76
|
+
readonly checkpoint: Schema.String;
|
|
77
|
+
}>, import("effect/Cause").YieldableError>;
|
|
78
|
+
/** `checkpoint`'s capture failed, so nothing restores from it: it can only be deleted. */
|
|
79
|
+
declare class NotReady extends NotReady_base {}
|
|
80
|
+
declare const PinMismatch_base: Schema.Class<PinMismatch, Schema.TaggedStruct<"PinMismatch", {
|
|
81
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
82
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
83
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
84
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
85
|
+
readonly message: Schema.String;
|
|
86
|
+
readonly checkpoint: Schema.String;
|
|
87
|
+
}>, import("effect/Cause").YieldableError>;
|
|
88
|
+
/** `checkpoint` holds RAM state saved under another runtime pin than the one the host runs. */
|
|
89
|
+
declare class PinMismatch extends PinMismatch_base {}
|
|
90
|
+
declare const WrongState_base: Schema.Class<WrongState, Schema.TaggedStruct<"WrongState", {
|
|
91
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
92
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
93
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
94
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
95
|
+
readonly message: Schema.String;
|
|
96
|
+
readonly machine: Schema.String;
|
|
97
|
+
readonly state: Schema.String;
|
|
98
|
+
}>, import("effect/Cause").YieldableError>;
|
|
99
|
+
/** `machine` is in `state`, which the action doesn't act from. */
|
|
100
|
+
declare class WrongState extends WrongState_base {}
|
|
101
|
+
declare const Unsizable_base: Schema.Class<Unsizable, Schema.TaggedStruct<"Unsizable", {
|
|
102
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
103
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
104
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
105
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
106
|
+
readonly message: Schema.String;
|
|
107
|
+
}>, import("effect/Cause").YieldableError>;
|
|
108
|
+
/** The runtime can't give the requested sizes, such as a disk below the base's. */
|
|
109
|
+
declare class Unsizable extends Unsizable_base {}
|
|
110
|
+
declare const ScriptFailed_base: Schema.Class<ScriptFailed, Schema.TaggedStruct<"ScriptFailed", {
|
|
111
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
112
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
113
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
114
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
115
|
+
readonly message: Schema.String;
|
|
116
|
+
readonly script: Schema.Literals<readonly ["setup", "preparation"]>;
|
|
117
|
+
}>, import("effect/Cause").YieldableError>;
|
|
118
|
+
/**
|
|
119
|
+
* A guest script exited non-zero or ran past its timeout; the message says which, with its
|
|
120
|
+
* output's tail. A failed `setup` leaves the machine unmade, a failed `preparation` made.
|
|
121
|
+
*/
|
|
122
|
+
declare class ScriptFailed extends ScriptFailed_base {}
|
|
123
|
+
declare const Refused_base: Schema.Class<Refused, Schema.TaggedStruct<"Refused", {
|
|
124
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
125
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
126
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
127
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
128
|
+
readonly message: Schema.String;
|
|
129
|
+
}>, import("effect/Cause").YieldableError>;
|
|
130
|
+
/** The provider under the runtime refused the call for good, such as for its plan or API key. */
|
|
131
|
+
declare class Refused extends Refused_base {}
|
|
132
|
+
declare const Capacity_base: Schema.Class<Capacity, Schema.TaggedStruct<"Capacity", {
|
|
133
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
134
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
135
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
136
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
137
|
+
readonly message: Schema.String;
|
|
138
|
+
}>, import("effect/Cause").YieldableError>;
|
|
139
|
+
/** The host has no room now; room can free up, so a later call may succeed. */
|
|
140
|
+
declare class Capacity extends Capacity_base {}
|
|
141
|
+
declare const Unavailable_base: Schema.Class<Unavailable, Schema.TaggedStruct<"Unavailable", {
|
|
142
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
143
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
144
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
145
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
146
|
+
readonly message: Schema.String;
|
|
147
|
+
readonly readOnly: Schema.Boolean;
|
|
148
|
+
}>, import("effect/Cause").YieldableError>;
|
|
149
|
+
/**
|
|
150
|
+
* No reply: only the client library makes it. A mutation's request may have reached the host
|
|
151
|
+
* and run, so it is retryable only when `readOnly`.
|
|
152
|
+
*/
|
|
153
|
+
declare class Unavailable extends Unavailable_base {}
|
|
154
|
+
declare const Internal_base: Schema.Class<Internal, Schema.TaggedStruct<"Internal", {
|
|
155
|
+
readonly host: Schema.optionalKey<Schema.String>;
|
|
156
|
+
readonly action: Schema.optionalKey<Schema.String>;
|
|
157
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
158
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
159
|
+
readonly message: Schema.String;
|
|
160
|
+
}>, import("effect/Cause").YieldableError>;
|
|
161
|
+
declare class Internal extends Internal_base {}
|
|
162
|
+
/** What a host may answer with; each action declares its own share. */
|
|
163
|
+
declare const hostErrors: readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal];
|
|
164
|
+
declare const HostError: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
165
|
+
type HostError = typeof HostError.Type;
|
|
166
|
+
/**
|
|
167
|
+
* Each carries, where known: `host` and `action`, which the client sets; `id`, the resource the
|
|
168
|
+
* error is about, which a host sets on `NotFound` and `Conflict` and the client sets to the call's
|
|
169
|
+
* subject otherwise; and `made`, the resource a create, fork, restore or capture makes, which a
|
|
170
|
+
* failure may leave behind.
|
|
171
|
+
*/
|
|
172
|
+
declare const ClankerboxError: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal, typeof Unavailable]>;
|
|
173
|
+
type ClankerboxError = typeof ClankerboxError.Type;
|
|
174
|
+
/**
|
|
175
|
+
* Whether the same call may succeed later: a busy resource or a full host may free up, and a read
|
|
176
|
+
* that got no reply may get one.
|
|
177
|
+
*/
|
|
178
|
+
declare const retryable: (error: ClankerboxError) => boolean;
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/api.d.ts
|
|
181
|
+
/** A host bounds its own reads of runtime state under it, so a list answers in time. */
|
|
182
|
+
declare const readTimeout: Duration.Duration;
|
|
183
|
+
declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
184
|
+
readonly id: Schema.String;
|
|
185
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
186
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
187
|
+
readonly base: Schema.String;
|
|
188
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
189
|
+
readonly cpu: Schema.Int;
|
|
190
|
+
readonly ramMib: Schema.Int;
|
|
191
|
+
readonly diskGib: Schema.Int;
|
|
192
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
193
|
+
readonly made: Schema.Boolean;
|
|
194
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
195
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
196
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
197
|
+
}>, Schema.Struct<{
|
|
198
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
199
|
+
readonly status: Schema.Literal<"failed">;
|
|
200
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
201
|
+
}>]>;
|
|
202
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
203
|
+
readonly host: Schema.String;
|
|
204
|
+
readonly port: Schema.Int;
|
|
205
|
+
readonly user: Schema.String;
|
|
206
|
+
}>>;
|
|
207
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
208
|
+
}>>, readonly (typeof Invalid | typeof Internal)[], true, typeof Action.Anyone>, Action.Action<"getMachine", Schema.Struct<{
|
|
209
|
+
readonly id: Schema.String;
|
|
210
|
+
}>, Schema.Struct<{
|
|
211
|
+
readonly id: Schema.String;
|
|
212
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
213
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
214
|
+
readonly base: Schema.String;
|
|
215
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
216
|
+
readonly cpu: Schema.Int;
|
|
217
|
+
readonly ramMib: Schema.Int;
|
|
218
|
+
readonly diskGib: Schema.Int;
|
|
219
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
220
|
+
readonly made: Schema.Boolean;
|
|
221
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
222
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
223
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
224
|
+
}>, Schema.Struct<{
|
|
225
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
226
|
+
readonly status: Schema.Literal<"failed">;
|
|
227
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
228
|
+
}>]>;
|
|
229
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
230
|
+
readonly host: Schema.String;
|
|
231
|
+
readonly port: Schema.Int;
|
|
232
|
+
readonly user: Schema.String;
|
|
233
|
+
}>>;
|
|
234
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
235
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Internal)[], true, typeof Action.Anyone>, Action.Action<"createMachine", Schema.Struct<{
|
|
236
|
+
readonly base: Schema.String;
|
|
237
|
+
readonly cpu: Schema.Int;
|
|
238
|
+
readonly ramMib: Schema.Int;
|
|
239
|
+
readonly diskGib: Schema.Int;
|
|
240
|
+
readonly setup: Schema.optionalKey<Schema.Struct<{
|
|
241
|
+
readonly script: Schema.String;
|
|
242
|
+
readonly timeoutSeconds: Schema.optionalKey<Schema.Int>;
|
|
243
|
+
}>>;
|
|
244
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
245
|
+
readonly id: Schema.String;
|
|
246
|
+
}>, Schema.Struct<{
|
|
247
|
+
readonly id: Schema.String;
|
|
248
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
249
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
250
|
+
readonly base: Schema.String;
|
|
251
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
252
|
+
readonly cpu: Schema.Int;
|
|
253
|
+
readonly ramMib: Schema.Int;
|
|
254
|
+
readonly diskGib: Schema.Int;
|
|
255
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
256
|
+
readonly made: Schema.Boolean;
|
|
257
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
258
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
259
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
260
|
+
}>, Schema.Struct<{
|
|
261
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
262
|
+
readonly status: Schema.Literal<"failed">;
|
|
263
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
264
|
+
}>]>;
|
|
265
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
266
|
+
readonly host: Schema.String;
|
|
267
|
+
readonly port: Schema.Int;
|
|
268
|
+
readonly user: Schema.String;
|
|
269
|
+
}>>;
|
|
270
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
271
|
+
}>, readonly (typeof Invalid | typeof Conflict | typeof NotOffered | typeof Unsizable | typeof ScriptFailed | typeof Refused | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>, Action.Action<"startMachine", Schema.Struct<{
|
|
272
|
+
readonly id: Schema.String;
|
|
273
|
+
}>, Schema.Struct<{
|
|
274
|
+
readonly id: Schema.String;
|
|
275
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
276
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
277
|
+
readonly base: Schema.String;
|
|
278
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
279
|
+
readonly cpu: Schema.Int;
|
|
280
|
+
readonly ramMib: Schema.Int;
|
|
281
|
+
readonly diskGib: Schema.Int;
|
|
282
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
283
|
+
readonly made: Schema.Boolean;
|
|
284
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
285
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
286
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
287
|
+
}>, Schema.Struct<{
|
|
288
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
289
|
+
readonly status: Schema.Literal<"failed">;
|
|
290
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
291
|
+
}>]>;
|
|
292
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
293
|
+
readonly host: Schema.String;
|
|
294
|
+
readonly port: Schema.Int;
|
|
295
|
+
readonly user: Schema.String;
|
|
296
|
+
}>>;
|
|
297
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
298
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof NotMade | typeof Missing | typeof WrongState | typeof ScriptFailed | typeof Refused | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>, Action.Action<"stopMachine", Schema.Struct<{
|
|
299
|
+
readonly id: Schema.String;
|
|
300
|
+
}>, Schema.Struct<{
|
|
301
|
+
readonly id: Schema.String;
|
|
302
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
303
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
304
|
+
readonly base: Schema.String;
|
|
305
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
306
|
+
readonly cpu: Schema.Int;
|
|
307
|
+
readonly ramMib: Schema.Int;
|
|
308
|
+
readonly diskGib: Schema.Int;
|
|
309
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
310
|
+
readonly made: Schema.Boolean;
|
|
311
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
312
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
313
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
314
|
+
}>, Schema.Struct<{
|
|
315
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
316
|
+
readonly status: Schema.Literal<"failed">;
|
|
317
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
318
|
+
}>]>;
|
|
319
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
320
|
+
readonly host: Schema.String;
|
|
321
|
+
readonly port: Schema.Int;
|
|
322
|
+
readonly user: Schema.String;
|
|
323
|
+
}>>;
|
|
324
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
325
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Refused | typeof Internal)[], false, typeof Action.Anyone>, Action.Action<"deleteMachine", Schema.Struct<{
|
|
326
|
+
readonly id: Schema.String;
|
|
327
|
+
}>, Schema.Void, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Refused | typeof Internal)[], false, typeof Action.Anyone>, Action.Action<"forkMachine", Schema.Struct<{
|
|
328
|
+
readonly machine: Schema.String;
|
|
329
|
+
readonly name: Schema.String;
|
|
330
|
+
}>, Schema.Struct<{
|
|
331
|
+
readonly id: Schema.String;
|
|
332
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
333
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
334
|
+
readonly base: Schema.String;
|
|
335
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
336
|
+
readonly cpu: Schema.Int;
|
|
337
|
+
readonly ramMib: Schema.Int;
|
|
338
|
+
readonly diskGib: Schema.Int;
|
|
339
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
340
|
+
readonly made: Schema.Boolean;
|
|
341
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
342
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
343
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
344
|
+
}>, Schema.Struct<{
|
|
345
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
346
|
+
readonly status: Schema.Literal<"failed">;
|
|
347
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
348
|
+
}>]>;
|
|
349
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
350
|
+
readonly host: Schema.String;
|
|
351
|
+
readonly port: Schema.Int;
|
|
352
|
+
readonly user: Schema.String;
|
|
353
|
+
}>>;
|
|
354
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
355
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof NotMade | typeof Missing | typeof WrongState | typeof Unsizable | typeof ScriptFailed | typeof Refused | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>, Action.Action<"restoreMachine", Schema.Struct<{
|
|
356
|
+
readonly checkpoint: Schema.String;
|
|
357
|
+
readonly name: Schema.String;
|
|
358
|
+
}>, Schema.Struct<{
|
|
359
|
+
readonly id: Schema.String;
|
|
360
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
361
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
362
|
+
readonly base: Schema.String;
|
|
363
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
364
|
+
readonly cpu: Schema.Int;
|
|
365
|
+
readonly ramMib: Schema.Int;
|
|
366
|
+
readonly diskGib: Schema.Int;
|
|
367
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
368
|
+
readonly made: Schema.Boolean;
|
|
369
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
370
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
371
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
372
|
+
}>, Schema.Struct<{
|
|
373
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
374
|
+
readonly status: Schema.Literal<"failed">;
|
|
375
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
376
|
+
}>]>;
|
|
377
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
378
|
+
readonly host: Schema.String;
|
|
379
|
+
readonly port: Schema.Int;
|
|
380
|
+
readonly user: Schema.String;
|
|
381
|
+
}>>;
|
|
382
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
383
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof NotReady | typeof PinMismatch | typeof Unsizable | typeof ScriptFailed | typeof Refused | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>, Action.Action<"listCheckpoints", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
384
|
+
readonly id: Schema.String;
|
|
385
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
386
|
+
readonly machine: Schema.String;
|
|
387
|
+
readonly kind: Schema.Literals<readonly ["ram", "disk"]>;
|
|
388
|
+
readonly base: Schema.String;
|
|
389
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
390
|
+
readonly cpu: Schema.Int;
|
|
391
|
+
readonly ramMib: Schema.Int;
|
|
392
|
+
readonly diskGib: Schema.Int;
|
|
393
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
394
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
395
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
396
|
+
}>, Schema.Struct<{
|
|
397
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
398
|
+
readonly status: Schema.Literal<"failed">;
|
|
399
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
400
|
+
}>]>;
|
|
401
|
+
}>>, readonly (typeof Invalid | typeof Internal)[], true, typeof Action.Anyone>, Action.Action<"getCheckpoint", Schema.Struct<{
|
|
402
|
+
readonly id: Schema.String;
|
|
403
|
+
}>, Schema.Struct<{
|
|
404
|
+
readonly id: Schema.String;
|
|
405
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
406
|
+
readonly machine: Schema.String;
|
|
407
|
+
readonly kind: Schema.Literals<readonly ["ram", "disk"]>;
|
|
408
|
+
readonly base: Schema.String;
|
|
409
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
410
|
+
readonly cpu: Schema.Int;
|
|
411
|
+
readonly ramMib: Schema.Int;
|
|
412
|
+
readonly diskGib: Schema.Int;
|
|
413
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
414
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
415
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
416
|
+
}>, Schema.Struct<{
|
|
417
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
418
|
+
readonly status: Schema.Literal<"failed">;
|
|
419
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
420
|
+
}>]>;
|
|
421
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Internal)[], true, typeof Action.Anyone>, Action.Action<"captureCheckpoint", Schema.Struct<{
|
|
422
|
+
readonly machine: Schema.String;
|
|
423
|
+
readonly name: Schema.String;
|
|
424
|
+
}>, Schema.Struct<{
|
|
425
|
+
readonly id: Schema.String;
|
|
426
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
427
|
+
readonly machine: Schema.String;
|
|
428
|
+
readonly kind: Schema.Literals<readonly ["ram", "disk"]>;
|
|
429
|
+
readonly base: Schema.String;
|
|
430
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
431
|
+
readonly cpu: Schema.Int;
|
|
432
|
+
readonly ramMib: Schema.Int;
|
|
433
|
+
readonly diskGib: Schema.Int;
|
|
434
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
435
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
436
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
437
|
+
}>, Schema.Struct<{
|
|
438
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
439
|
+
readonly status: Schema.Literal<"failed">;
|
|
440
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
441
|
+
}>]>;
|
|
442
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof NotMade | typeof Missing | typeof WrongState | typeof Refused | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>, Action.Action<"deleteCheckpoint", Schema.Struct<{
|
|
443
|
+
readonly id: Schema.String;
|
|
444
|
+
}>, Schema.Void, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Refused | typeof Internal)[], false, typeof Action.Anyone>, Action.Action<"getHost", Schema.$Record<Schema.String, Schema.Never>, Schema.Struct<{
|
|
445
|
+
readonly id: Schema.String;
|
|
446
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
447
|
+
readonly version: Schema.String;
|
|
448
|
+
readonly runtimeVersion: Schema.String;
|
|
449
|
+
readonly captureFrom: Schema.Literals<readonly ["running", "stopped"]>;
|
|
450
|
+
readonly bases: Schema.$Array<Schema.String>;
|
|
451
|
+
}>, readonly (typeof Invalid)[], true, typeof Action.Anyone>, Action.Action<"getCapacity", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
452
|
+
readonly host: Schema.String;
|
|
453
|
+
readonly resource: Schema.Literals<readonly ["cpu", "ramMib", "runningVms", "activeSandboxes", "startsPerMinute", "startsPerHour", "startsPerDay"]>;
|
|
454
|
+
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
455
|
+
readonly used: Schema.Int;
|
|
456
|
+
}>, Schema.Struct<{
|
|
457
|
+
readonly host: Schema.String;
|
|
458
|
+
readonly resource: Schema.Literals<readonly ["cpu", "ramMib", "runningVms", "activeSandboxes", "startsPerMinute", "startsPerHour", "startsPerDay"]>;
|
|
459
|
+
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
460
|
+
readonly unread: Schema.$Array<Schema.String>;
|
|
461
|
+
}>]>>, readonly (typeof Invalid | typeof Refused | typeof Internal)[], true, typeof Action.Anyone>], [], undefined>;
|
|
462
|
+
declare const actionsByName: {
|
|
463
|
+
readonly captureCheckpoint: Action.Action<"captureCheckpoint", Schema.Struct<{
|
|
464
|
+
readonly machine: Schema.String;
|
|
465
|
+
readonly name: Schema.String;
|
|
466
|
+
}>, Schema.Struct<{
|
|
467
|
+
readonly id: Schema.String;
|
|
468
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
469
|
+
readonly machine: Schema.String;
|
|
470
|
+
readonly kind: Schema.Literals<readonly ["ram", "disk"]>;
|
|
471
|
+
readonly base: Schema.String;
|
|
472
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
473
|
+
readonly cpu: Schema.Int;
|
|
474
|
+
readonly ramMib: Schema.Int;
|
|
475
|
+
readonly diskGib: Schema.Int;
|
|
476
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
477
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
478
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
479
|
+
}>, Schema.Struct<{
|
|
480
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
481
|
+
readonly status: Schema.Literal<"failed">;
|
|
482
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
483
|
+
}>]>;
|
|
484
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof NotMade | typeof Missing | typeof WrongState | typeof Refused | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>;
|
|
485
|
+
readonly createMachine: Action.Action<"createMachine", Schema.Struct<{
|
|
486
|
+
readonly base: Schema.String;
|
|
487
|
+
readonly cpu: Schema.Int;
|
|
488
|
+
readonly ramMib: Schema.Int;
|
|
489
|
+
readonly diskGib: Schema.Int;
|
|
490
|
+
readonly setup: Schema.optionalKey<Schema.Struct<{
|
|
491
|
+
readonly script: Schema.String;
|
|
492
|
+
readonly timeoutSeconds: Schema.optionalKey<Schema.Int>;
|
|
493
|
+
}>>;
|
|
494
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
495
|
+
readonly id: Schema.String;
|
|
496
|
+
}>, Schema.Struct<{
|
|
497
|
+
readonly id: Schema.String;
|
|
498
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
499
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
500
|
+
readonly base: Schema.String;
|
|
501
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
502
|
+
readonly cpu: Schema.Int;
|
|
503
|
+
readonly ramMib: Schema.Int;
|
|
504
|
+
readonly diskGib: Schema.Int;
|
|
505
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
506
|
+
readonly made: Schema.Boolean;
|
|
507
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
508
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
509
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
510
|
+
}>, Schema.Struct<{
|
|
511
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
512
|
+
readonly status: Schema.Literal<"failed">;
|
|
513
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
514
|
+
}>]>;
|
|
515
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
516
|
+
readonly host: Schema.String;
|
|
517
|
+
readonly port: Schema.Int;
|
|
518
|
+
readonly user: Schema.String;
|
|
519
|
+
}>>;
|
|
520
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
521
|
+
}>, readonly (typeof Invalid | typeof Conflict | typeof NotOffered | typeof Unsizable | typeof ScriptFailed | typeof Refused | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>;
|
|
522
|
+
readonly deleteCheckpoint: Action.Action<"deleteCheckpoint", Schema.Struct<{
|
|
523
|
+
readonly id: Schema.String;
|
|
524
|
+
}>, Schema.Void, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Refused | typeof Internal)[], false, typeof Action.Anyone>;
|
|
525
|
+
readonly deleteMachine: Action.Action<"deleteMachine", Schema.Struct<{
|
|
526
|
+
readonly id: Schema.String;
|
|
527
|
+
}>, Schema.Void, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Refused | typeof Internal)[], false, typeof Action.Anyone>;
|
|
528
|
+
readonly forkMachine: Action.Action<"forkMachine", Schema.Struct<{
|
|
529
|
+
readonly machine: Schema.String;
|
|
530
|
+
readonly name: Schema.String;
|
|
531
|
+
}>, Schema.Struct<{
|
|
532
|
+
readonly id: Schema.String;
|
|
533
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
534
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
535
|
+
readonly base: Schema.String;
|
|
536
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
537
|
+
readonly cpu: Schema.Int;
|
|
538
|
+
readonly ramMib: Schema.Int;
|
|
539
|
+
readonly diskGib: Schema.Int;
|
|
540
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
541
|
+
readonly made: Schema.Boolean;
|
|
542
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
543
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
544
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
545
|
+
}>, Schema.Struct<{
|
|
546
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
547
|
+
readonly status: Schema.Literal<"failed">;
|
|
548
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
549
|
+
}>]>;
|
|
550
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
551
|
+
readonly host: Schema.String;
|
|
552
|
+
readonly port: Schema.Int;
|
|
553
|
+
readonly user: Schema.String;
|
|
554
|
+
}>>;
|
|
555
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
556
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof NotMade | typeof Missing | typeof WrongState | typeof Unsizable | typeof ScriptFailed | typeof Refused | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>;
|
|
557
|
+
readonly getCapacity: Action.Action<"getCapacity", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
558
|
+
readonly host: Schema.String;
|
|
559
|
+
readonly resource: Schema.Literals<readonly ["cpu", "ramMib", "runningVms", "activeSandboxes", "startsPerMinute", "startsPerHour", "startsPerDay"]>;
|
|
560
|
+
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
561
|
+
readonly used: Schema.Int;
|
|
562
|
+
}>, Schema.Struct<{
|
|
563
|
+
readonly host: Schema.String;
|
|
564
|
+
readonly resource: Schema.Literals<readonly ["cpu", "ramMib", "runningVms", "activeSandboxes", "startsPerMinute", "startsPerHour", "startsPerDay"]>;
|
|
565
|
+
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
566
|
+
readonly unread: Schema.$Array<Schema.String>;
|
|
567
|
+
}>]>>, readonly (typeof Invalid | typeof Refused | typeof Internal)[], true, typeof Action.Anyone>;
|
|
568
|
+
readonly getCheckpoint: Action.Action<"getCheckpoint", Schema.Struct<{
|
|
569
|
+
readonly id: Schema.String;
|
|
570
|
+
}>, Schema.Struct<{
|
|
571
|
+
readonly id: Schema.String;
|
|
572
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
573
|
+
readonly machine: Schema.String;
|
|
574
|
+
readonly kind: Schema.Literals<readonly ["ram", "disk"]>;
|
|
575
|
+
readonly base: Schema.String;
|
|
576
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
577
|
+
readonly cpu: Schema.Int;
|
|
578
|
+
readonly ramMib: Schema.Int;
|
|
579
|
+
readonly diskGib: Schema.Int;
|
|
580
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
581
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
582
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
583
|
+
}>, Schema.Struct<{
|
|
584
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
585
|
+
readonly status: Schema.Literal<"failed">;
|
|
586
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
587
|
+
}>]>;
|
|
588
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Internal)[], true, typeof Action.Anyone>;
|
|
589
|
+
readonly getHost: Action.Action<"getHost", Schema.$Record<Schema.String, Schema.Never>, Schema.Struct<{
|
|
590
|
+
readonly id: Schema.String;
|
|
591
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
592
|
+
readonly version: Schema.String;
|
|
593
|
+
readonly runtimeVersion: Schema.String;
|
|
594
|
+
readonly captureFrom: Schema.Literals<readonly ["running", "stopped"]>;
|
|
595
|
+
readonly bases: Schema.$Array<Schema.String>;
|
|
596
|
+
}>, readonly (typeof Invalid)[], true, typeof Action.Anyone>;
|
|
597
|
+
readonly getMachine: Action.Action<"getMachine", Schema.Struct<{
|
|
598
|
+
readonly id: Schema.String;
|
|
599
|
+
}>, Schema.Struct<{
|
|
600
|
+
readonly id: Schema.String;
|
|
601
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
602
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
603
|
+
readonly base: Schema.String;
|
|
604
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
605
|
+
readonly cpu: Schema.Int;
|
|
606
|
+
readonly ramMib: Schema.Int;
|
|
607
|
+
readonly diskGib: Schema.Int;
|
|
608
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
609
|
+
readonly made: Schema.Boolean;
|
|
610
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
611
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
612
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
613
|
+
}>, Schema.Struct<{
|
|
614
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
615
|
+
readonly status: Schema.Literal<"failed">;
|
|
616
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
617
|
+
}>]>;
|
|
618
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
619
|
+
readonly host: Schema.String;
|
|
620
|
+
readonly port: Schema.Int;
|
|
621
|
+
readonly user: Schema.String;
|
|
622
|
+
}>>;
|
|
623
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
624
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Internal)[], true, typeof Action.Anyone>;
|
|
625
|
+
readonly listCheckpoints: Action.Action<"listCheckpoints", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
626
|
+
readonly id: Schema.String;
|
|
627
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
628
|
+
readonly machine: Schema.String;
|
|
629
|
+
readonly kind: Schema.Literals<readonly ["ram", "disk"]>;
|
|
630
|
+
readonly base: Schema.String;
|
|
631
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
632
|
+
readonly cpu: Schema.Int;
|
|
633
|
+
readonly ramMib: Schema.Int;
|
|
634
|
+
readonly diskGib: Schema.Int;
|
|
635
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
636
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
637
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
638
|
+
}>, Schema.Struct<{
|
|
639
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
640
|
+
readonly status: Schema.Literal<"failed">;
|
|
641
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
642
|
+
}>]>;
|
|
643
|
+
}>>, readonly (typeof Invalid | typeof Internal)[], true, typeof Action.Anyone>;
|
|
644
|
+
readonly listMachines: Action.Action<"listMachines", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
645
|
+
readonly id: Schema.String;
|
|
646
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
647
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
648
|
+
readonly base: Schema.String;
|
|
649
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
650
|
+
readonly cpu: Schema.Int;
|
|
651
|
+
readonly ramMib: Schema.Int;
|
|
652
|
+
readonly diskGib: Schema.Int;
|
|
653
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
654
|
+
readonly made: Schema.Boolean;
|
|
655
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
656
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
657
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
658
|
+
}>, Schema.Struct<{
|
|
659
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
660
|
+
readonly status: Schema.Literal<"failed">;
|
|
661
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
662
|
+
}>]>;
|
|
663
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
664
|
+
readonly host: Schema.String;
|
|
665
|
+
readonly port: Schema.Int;
|
|
666
|
+
readonly user: Schema.String;
|
|
667
|
+
}>>;
|
|
668
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
669
|
+
}>>, readonly (typeof Invalid | typeof Internal)[], true, typeof Action.Anyone>;
|
|
670
|
+
readonly restoreMachine: Action.Action<"restoreMachine", Schema.Struct<{
|
|
671
|
+
readonly checkpoint: Schema.String;
|
|
672
|
+
readonly name: Schema.String;
|
|
673
|
+
}>, Schema.Struct<{
|
|
674
|
+
readonly id: Schema.String;
|
|
675
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
676
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
677
|
+
readonly base: Schema.String;
|
|
678
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
679
|
+
readonly cpu: Schema.Int;
|
|
680
|
+
readonly ramMib: Schema.Int;
|
|
681
|
+
readonly diskGib: Schema.Int;
|
|
682
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
683
|
+
readonly made: Schema.Boolean;
|
|
684
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
685
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
686
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
687
|
+
}>, Schema.Struct<{
|
|
688
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
689
|
+
readonly status: Schema.Literal<"failed">;
|
|
690
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
691
|
+
}>]>;
|
|
692
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
693
|
+
readonly host: Schema.String;
|
|
694
|
+
readonly port: Schema.Int;
|
|
695
|
+
readonly user: Schema.String;
|
|
696
|
+
}>>;
|
|
697
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
698
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof NotReady | typeof PinMismatch | typeof Unsizable | typeof ScriptFailed | typeof Refused | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>;
|
|
699
|
+
readonly startMachine: Action.Action<"startMachine", Schema.Struct<{
|
|
700
|
+
readonly id: Schema.String;
|
|
701
|
+
}>, Schema.Struct<{
|
|
702
|
+
readonly id: Schema.String;
|
|
703
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
704
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
705
|
+
readonly base: Schema.String;
|
|
706
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
707
|
+
readonly cpu: Schema.Int;
|
|
708
|
+
readonly ramMib: Schema.Int;
|
|
709
|
+
readonly diskGib: Schema.Int;
|
|
710
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
711
|
+
readonly made: Schema.Boolean;
|
|
712
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
713
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
714
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
715
|
+
}>, Schema.Struct<{
|
|
716
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
717
|
+
readonly status: Schema.Literal<"failed">;
|
|
718
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
719
|
+
}>]>;
|
|
720
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
721
|
+
readonly host: Schema.String;
|
|
722
|
+
readonly port: Schema.Int;
|
|
723
|
+
readonly user: Schema.String;
|
|
724
|
+
}>>;
|
|
725
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
726
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof NotMade | typeof Missing | typeof WrongState | typeof ScriptFailed | typeof Refused | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>;
|
|
727
|
+
readonly stopMachine: Action.Action<"stopMachine", Schema.Struct<{
|
|
728
|
+
readonly id: Schema.String;
|
|
729
|
+
}>, Schema.Struct<{
|
|
730
|
+
readonly id: Schema.String;
|
|
731
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
732
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
733
|
+
readonly base: Schema.String;
|
|
734
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
735
|
+
readonly cpu: Schema.Int;
|
|
736
|
+
readonly ramMib: Schema.Int;
|
|
737
|
+
readonly diskGib: Schema.Int;
|
|
738
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
739
|
+
readonly made: Schema.Boolean;
|
|
740
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
741
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
742
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
743
|
+
}>, Schema.Struct<{
|
|
744
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
745
|
+
readonly status: Schema.Literal<"failed">;
|
|
746
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
747
|
+
}>]>;
|
|
748
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
749
|
+
readonly host: Schema.String;
|
|
750
|
+
readonly port: Schema.Int;
|
|
751
|
+
readonly user: Schema.String;
|
|
752
|
+
}>>;
|
|
753
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
754
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Refused | typeof Internal)[], false, typeof Action.Anyone>;
|
|
755
|
+
};
|
|
756
|
+
/** What a host may answer action `N` with: the errors the contract declares for it. */
|
|
757
|
+
type Declared<N extends keyof typeof actionsByName> = (typeof actionsByName)[N]["error"][number]["Type"];
|
|
758
|
+
//#endregion
|
|
759
|
+
//#region src/resources.d.ts
|
|
760
|
+
declare const Runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
761
|
+
type Runtime = typeof Runtime.Type;
|
|
762
|
+
/** The contract's mutations, which record themselves on a resource's `action`. */
|
|
763
|
+
declare const ActionName: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
764
|
+
type ActionName = typeof ActionName.Type;
|
|
765
|
+
declare const ActionStatus: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
766
|
+
type ActionStatus = typeof ActionStatus.Type;
|
|
767
|
+
/** A resource's last action; the next action replaces it. */
|
|
768
|
+
declare const ActionRecord: Schema.Union<readonly [Schema.Struct<{
|
|
769
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
770
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
771
|
+
}>, Schema.Struct<{
|
|
772
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
773
|
+
readonly status: Schema.Literal<"failed">;
|
|
774
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
775
|
+
}>]>;
|
|
776
|
+
type ActionRecord = typeof ActionRecord.Type;
|
|
777
|
+
declare const SshEndpoint: Schema.Struct<{
|
|
778
|
+
readonly host: Schema.String;
|
|
779
|
+
readonly port: Schema.Int;
|
|
780
|
+
}>;
|
|
781
|
+
type SshEndpoint = typeof SshEndpoint.Type;
|
|
782
|
+
declare const SshLogin: Schema.Struct<{
|
|
783
|
+
readonly host: Schema.String;
|
|
784
|
+
readonly port: Schema.Int;
|
|
785
|
+
readonly user: Schema.String;
|
|
786
|
+
}>;
|
|
787
|
+
type SshLogin = typeof SshLogin.Type;
|
|
788
|
+
/**
|
|
789
|
+
* `state` is `missing` when the runtime doesn't have the machine, and `unknown` when it couldn't
|
|
790
|
+
* be read. Until its create, fork or restore has `made` it, a machine can only be read, stopped or
|
|
791
|
+
* deleted. `ssh` is only on a running machine whose runtime gives it an endpoint, and `hostKey`,
|
|
792
|
+
* `<type> <base64>`, once preparation has recorded it.
|
|
793
|
+
*/
|
|
794
|
+
declare const Machine: Schema.Struct<{
|
|
795
|
+
readonly id: Schema.String;
|
|
796
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
797
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
798
|
+
readonly base: Schema.String;
|
|
799
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
800
|
+
readonly cpu: Schema.Int;
|
|
801
|
+
readonly ramMib: Schema.Int;
|
|
802
|
+
readonly diskGib: Schema.Int;
|
|
803
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
804
|
+
readonly made: Schema.Boolean;
|
|
805
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
806
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
807
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
808
|
+
}>, Schema.Struct<{
|
|
809
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
810
|
+
readonly status: Schema.Literal<"failed">;
|
|
811
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
812
|
+
}>]>;
|
|
813
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
814
|
+
readonly host: Schema.String;
|
|
815
|
+
readonly port: Schema.Int;
|
|
816
|
+
readonly user: Schema.String;
|
|
817
|
+
}>>;
|
|
818
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
819
|
+
}>;
|
|
820
|
+
type Machine = typeof Machine.Type;
|
|
821
|
+
/** The state as people read it: `running`, or `stopped (unmade)` for one never made. */
|
|
822
|
+
declare const stateLabel: ({ state, made }: Machine) => string;
|
|
823
|
+
/** `kind` is `ram` (RAM and disks) on smolvm, and `disk` on Tart and boat. */
|
|
824
|
+
declare const Checkpoint: Schema.Struct<{
|
|
825
|
+
readonly id: Schema.String;
|
|
826
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
827
|
+
readonly machine: Schema.String;
|
|
828
|
+
readonly kind: Schema.Literals<readonly ["ram", "disk"]>;
|
|
829
|
+
readonly base: Schema.String;
|
|
830
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
831
|
+
readonly cpu: Schema.Int;
|
|
832
|
+
readonly ramMib: Schema.Int;
|
|
833
|
+
readonly diskGib: Schema.Int;
|
|
834
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
835
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
836
|
+
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
837
|
+
}>, Schema.Struct<{
|
|
838
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
839
|
+
readonly status: Schema.Literal<"failed">;
|
|
840
|
+
readonly error: Schema.Union<readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof NotOffered, typeof NotMade, typeof Missing, typeof NotReady, typeof PinMismatch, typeof WrongState, typeof Unsizable, typeof ScriptFailed, typeof Refused, typeof Capacity, typeof Internal]>;
|
|
841
|
+
}>]>;
|
|
842
|
+
}>;
|
|
843
|
+
type Checkpoint = typeof Checkpoint.Type;
|
|
844
|
+
/** A checkpoint restores once its capture is done; it never changes after. */
|
|
845
|
+
declare const isReady: (checkpoint: Pick<Checkpoint, "action">) => boolean;
|
|
846
|
+
/**
|
|
847
|
+
* `runtimeVersion` is boat's API version on boat. `captureFrom` is the state a machine must be in
|
|
848
|
+
* to be captured: Tart's is `stopped`.
|
|
849
|
+
*/
|
|
850
|
+
declare const Host: Schema.Struct<{
|
|
851
|
+
readonly id: Schema.String;
|
|
852
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
853
|
+
readonly version: Schema.String;
|
|
854
|
+
readonly runtimeVersion: Schema.String;
|
|
855
|
+
readonly captureFrom: Schema.Literals<readonly ["running", "stopped"]>;
|
|
856
|
+
readonly bases: Schema.$Array<Schema.String>;
|
|
857
|
+
}>;
|
|
858
|
+
type Host = typeof Host.Type;
|
|
859
|
+
/**
|
|
860
|
+
* A resource of a host and how much of it is in use, counted as a refusal counts it, so it
|
|
861
|
+
* needn't match the host's own machines. When a machine the sum counts couldn't be read, the
|
|
862
|
+
* sum would be a guess, so the row names those machines instead.
|
|
863
|
+
*
|
|
864
|
+
* `cpu` and `ramMib` are what the host's running machines were given, `runningVms` Apple's two
|
|
865
|
+
* VMs per Mac, and `activeSandboxes` and the `starts` of each rolling window the boat account's.
|
|
866
|
+
* `limit` is there only where the host refuses an action that would pass it.
|
|
867
|
+
*/
|
|
868
|
+
declare const Usage: Schema.Union<readonly [Schema.Struct<{
|
|
869
|
+
readonly host: Schema.String;
|
|
870
|
+
readonly resource: Schema.Literals<readonly ["cpu", "ramMib", "runningVms", "activeSandboxes", "startsPerMinute", "startsPerHour", "startsPerDay"]>;
|
|
871
|
+
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
872
|
+
readonly used: Schema.Int;
|
|
873
|
+
}>, Schema.Struct<{
|
|
874
|
+
readonly host: Schema.String;
|
|
875
|
+
readonly resource: Schema.Literals<readonly ["cpu", "ramMib", "runningVms", "activeSandboxes", "startsPerMinute", "startsPerHour", "startsPerDay"]>;
|
|
876
|
+
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
877
|
+
readonly unread: Schema.$Array<Schema.String>;
|
|
878
|
+
}>]>;
|
|
879
|
+
type Usage = typeof Usage.Type;
|
|
880
|
+
type WithoutHost<Row> = Row extends unknown ? Omit<Row, "host"> : never;
|
|
881
|
+
/** A `Usage` row as a runtime reads it, before the host names itself on it. */
|
|
882
|
+
type Reading = WithoutHost<Usage>;
|
|
883
|
+
/** Nothing logs the script: it can carry secrets. */
|
|
884
|
+
declare const Setup: Schema.Struct<{
|
|
885
|
+
readonly script: Schema.String;
|
|
886
|
+
readonly timeoutSeconds: Schema.optionalKey<Schema.Int>;
|
|
887
|
+
}>;
|
|
888
|
+
type Setup = typeof Setup.Type;
|
|
889
|
+
/** A profile file fills these in; the host sees only the `profile` label. */
|
|
890
|
+
declare const MachineSpec: Schema.Struct<{
|
|
891
|
+
base: Schema.String;
|
|
892
|
+
cpu: Schema.Int;
|
|
893
|
+
ramMib: Schema.Int;
|
|
894
|
+
diskGib: Schema.Int;
|
|
895
|
+
setup: Schema.optionalKey<Schema.Struct<{
|
|
896
|
+
readonly script: Schema.String;
|
|
897
|
+
readonly timeoutSeconds: Schema.optionalKey<Schema.Int>;
|
|
898
|
+
}>>;
|
|
899
|
+
profile: Schema.optionalKey<Schema.String>;
|
|
900
|
+
}>;
|
|
901
|
+
type MachineSpec = typeof MachineSpec.Type;
|
|
902
|
+
/** The host checks that `id` names it, so a create never lands under another host's ID. */
|
|
903
|
+
declare const CreateRequest: Schema.Struct<{
|
|
904
|
+
readonly base: Schema.String;
|
|
905
|
+
readonly cpu: Schema.Int;
|
|
906
|
+
readonly ramMib: Schema.Int;
|
|
907
|
+
readonly diskGib: Schema.Int;
|
|
908
|
+
readonly setup: Schema.optionalKey<Schema.Struct<{
|
|
909
|
+
readonly script: Schema.String;
|
|
910
|
+
readonly timeoutSeconds: Schema.optionalKey<Schema.Int>;
|
|
911
|
+
}>>;
|
|
912
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
913
|
+
readonly id: Schema.String;
|
|
914
|
+
}>;
|
|
915
|
+
type CreateRequest = typeof CreateRequest.Type;
|
|
916
|
+
declare namespace client_d_exports {
|
|
917
|
+
export { Calls, Client, CreateOptions, Deleted, ErrorOf, Gathered, HostAction, HostEntry, Interface, Options, Routed, Unreachable, layer, make };
|
|
918
|
+
}
|
|
919
|
+
/** `id` is the host part of every ID the host holds. */
|
|
920
|
+
declare const HostEntry: Schema.Struct<{
|
|
921
|
+
readonly id: Schema.String;
|
|
922
|
+
readonly url: Schema.String;
|
|
923
|
+
}>;
|
|
924
|
+
type HostEntry = typeof HostEntry.Type;
|
|
925
|
+
type Actions = typeof actionsByName;
|
|
926
|
+
/** An action of the host API, by name. */
|
|
927
|
+
type HostAction = keyof Actions;
|
|
928
|
+
/**
|
|
929
|
+
* What a call of `N` fails with: an error the action declares, which always includes `Invalid`,
|
|
930
|
+
* or no reply, or a reply the client couldn't use.
|
|
931
|
+
*/
|
|
932
|
+
type ErrorOf<N extends HostAction> = Declared<N> | Unavailable | Internal;
|
|
933
|
+
type Success<N extends HostAction> = Actions[N]["success"]["Type"];
|
|
934
|
+
type Input<N extends HostAction> = Actions[N]["input"]["Type"];
|
|
935
|
+
interface Unreachable {
|
|
936
|
+
readonly host: string;
|
|
937
|
+
readonly error: ClankerboxError;
|
|
938
|
+
}
|
|
939
|
+
/** A fan-out's result: a host that fails is named, and fails nothing else. */
|
|
940
|
+
interface Gathered<A> {
|
|
941
|
+
readonly answers: ReadonlyArray<A>;
|
|
942
|
+
readonly unreachable: ReadonlyArray<Unreachable>;
|
|
943
|
+
}
|
|
944
|
+
interface Options {
|
|
945
|
+
/**
|
|
946
|
+
* The wait for a mutation's reply, unbounded by default, as a create's setup can take hours.
|
|
947
|
+
* It ends only the wait: a mutation that outlasts it fails like a lost reply.
|
|
948
|
+
*/
|
|
949
|
+
readonly timeout?: Duration.Duration | undefined;
|
|
950
|
+
/** The wait for a read's reply, `readTimeout` by default; a fan-out bounds each host's own. */
|
|
951
|
+
readonly readTimeout?: Duration.Duration | undefined;
|
|
952
|
+
}
|
|
953
|
+
/** A delete of a resource that is already gone is `absent`: done either way. */
|
|
954
|
+
type Deleted = "deleted" | "absent";
|
|
955
|
+
interface CreateOptions {
|
|
956
|
+
/** The host to create on, instead of the first that offers the base. */
|
|
957
|
+
readonly host?: string | undefined;
|
|
958
|
+
}
|
|
959
|
+
/** The resource an input names, whose host the call goes to. */
|
|
960
|
+
type Subject = {
|
|
961
|
+
readonly id: string;
|
|
962
|
+
} | {
|
|
963
|
+
readonly machine: string;
|
|
964
|
+
} | {
|
|
965
|
+
readonly checkpoint: string;
|
|
966
|
+
};
|
|
967
|
+
/** The actions on one resource, which the client sends to its host. */
|
|
968
|
+
type Routed = { readonly [N in HostAction]: Input<N> extends Subject ? N : never; }[HostAction];
|
|
969
|
+
/**
|
|
970
|
+
* One method per action on a resource, named and typed as in the contract, but for `create` and
|
|
971
|
+
* the deletes. A create, fork, restore or capture's errors carry `made`, the resource it makes, so
|
|
972
|
+
* a caller can find what a failure left behind.
|
|
973
|
+
*/
|
|
974
|
+
type Calls = { readonly [N in Exclude<Routed, "createMachine" | "deleteMachine" | "deleteCheckpoint">]: (input: Input<N>) => Effect.Effect<Success<N>, ErrorOf<N>>; };
|
|
975
|
+
interface Interface extends Calls {
|
|
976
|
+
readonly hosts: Effect.Effect<Gathered<Host>>;
|
|
977
|
+
readonly machines: Effect.Effect<Gathered<Machine>>;
|
|
978
|
+
readonly checkpoints: Effect.Effect<Gathered<Checkpoint>>;
|
|
979
|
+
/** A host whose runtime couldn't be read is among the unreachable. */
|
|
980
|
+
readonly capacity: Effect.Effect<Gathered<Usage>>;
|
|
981
|
+
/**
|
|
982
|
+
* The host a create of `base` goes to, read even when `options.host` names it: the first in
|
|
983
|
+
* list order that offers it. With none, it is `Unavailable` if a host gave no reply, and
|
|
984
|
+
* `NotOffered` otherwise.
|
|
985
|
+
*/
|
|
986
|
+
readonly place: (base: string, options?: CreateOptions) => Effect.Effect<Host, ErrorOf<"getHost"> | NotOffered>;
|
|
987
|
+
/** `createMachine` on `options.host`, or else on the first host that offers the base. */
|
|
988
|
+
readonly create: (name: string, spec: MachineSpec, options?: CreateOptions) => Effect.Effect<Machine, ErrorOf<"createMachine">>;
|
|
989
|
+
/** A delete of a resource that is already gone is `absent`: done either way. */
|
|
990
|
+
readonly deleteMachine: (input: Input<"deleteMachine">) => Effect.Effect<Deleted, Exclude<ErrorOf<"deleteMachine">, NotFound>>;
|
|
991
|
+
/** A delete of a checkpoint that is already gone is `absent`: done either way. */
|
|
992
|
+
readonly deleteCheckpoint: (input: Input<"deleteCheckpoint">) => Effect.Effect<Deleted, Exclude<ErrorOf<"deleteCheckpoint">, NotFound>>;
|
|
993
|
+
}
|
|
994
|
+
declare const Client_base: Context.ServiceClass<Client, "@gjermundgaraba/clankerbox-sdk/Client", Interface>;
|
|
995
|
+
/**
|
|
996
|
+
* Nothing retries: a mutation whose reply is lost or times out is `Unavailable`, and the caller
|
|
997
|
+
* reads the resource to see what happened.
|
|
998
|
+
*/
|
|
999
|
+
declare class Client extends Client_base {}
|
|
1000
|
+
/**
|
|
1001
|
+
* A client over `hosts`, in placement order. It sends nothing until called. An empty list, a
|
|
1002
|
+
* malformed entry or a host ID that appears twice is Invalid.
|
|
1003
|
+
*/
|
|
1004
|
+
declare const make: (hosts: ReadonlyArray<HostEntry>, options?: Options) => Effect.Effect<Interface, Invalid, HttpClient.HttpClient>;
|
|
1005
|
+
declare const layer: (hosts: ReadonlyArray<HostEntry>, options?: Options) => Layer.Layer<Client, Invalid, HttpClient.HttpClient>;
|
|
1006
|
+
//#endregion
|
|
1007
|
+
export { ConflictKind as A, Refused as B, Declared as C, Capacity as D, readTimeout as E, NotFound as F, hostErrors as G, Unavailable as H, NotMade as I, retryable as K, NotOffered as L, Internal as M, Invalid as N, ClankerboxError as O, Missing as P, NotReady as R, stateLabel as S, actionsByName as T, Unsizable as U, ScriptFailed as V, WrongState as W, Setup as _, Options as a, Usage as b, ActionRecord as c, CreateRequest as d, Host as f, Runtime as g, Reading as h, Interface as i, HostError as j, Conflict as k, ActionStatus as l, MachineSpec as m, CreateOptions as n, client_d_exports as o, Machine as p, HostEntry as r, ActionName as s, Client as t, Checkpoint as u, SshEndpoint as v, Http as w, isReady as x, SshLogin as y, PinMismatch as z };
|