@gjermundgaraba/clankerbox-sdk 0.16.0 → 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-DgDb-TR7.d.mts → client-8af586hb.d.mts} +292 -243
- package/dist/{client-CLemHDCl.mjs → client-CbMWwHdT.mjs} +226 -165
- package/dist/index.d.mts +22 -14
- package/dist/index.mjs +53 -45
- package/dist/node.d.mts +6 -2
- package/dist/node.mjs +3 -3
- package/package.json +5 -4
|
@@ -7,6 +7,7 @@ declare const Invalid_base: Schema.Class<Invalid, Schema.TaggedStruct<"Invalid",
|
|
|
7
7
|
readonly host: Schema.optionalKey<Schema.String>;
|
|
8
8
|
readonly action: Schema.optionalKey<Schema.String>;
|
|
9
9
|
readonly id: Schema.optionalKey<Schema.String>;
|
|
10
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
10
11
|
readonly message: Schema.String;
|
|
11
12
|
readonly file: Schema.optionalKey<Schema.String>;
|
|
12
13
|
}>, import("effect/Cause").YieldableError>;
|
|
@@ -14,56 +15,134 @@ declare const Invalid_base: Schema.Class<Invalid, Schema.TaggedStruct<"Invalid",
|
|
|
14
15
|
* The request is malformed, or the host list is one a client can't route by, or a config,
|
|
15
16
|
* profile or setup file couldn't be read or doesn't hold what it should: then `file` names it.
|
|
16
17
|
*/
|
|
17
|
-
declare class Invalid extends Invalid_base {
|
|
18
|
-
get retryable(): boolean;
|
|
19
|
-
}
|
|
18
|
+
declare class Invalid extends Invalid_base {}
|
|
20
19
|
declare const NotFound_base: Schema.Class<NotFound, Schema.TaggedStruct<"NotFound", {
|
|
21
20
|
readonly host: Schema.optionalKey<Schema.String>;
|
|
22
21
|
readonly action: Schema.optionalKey<Schema.String>;
|
|
23
22
|
readonly id: Schema.optionalKey<Schema.String>;
|
|
23
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
24
24
|
readonly message: Schema.String;
|
|
25
25
|
}>, import("effect/Cause").YieldableError>;
|
|
26
26
|
/** The machine or checkpoint doesn't exist. A `delete` that meets it is done. */
|
|
27
|
-
declare class NotFound extends NotFound_base {
|
|
28
|
-
get retryable(): boolean;
|
|
29
|
-
}
|
|
27
|
+
declare class NotFound extends NotFound_base {}
|
|
30
28
|
declare const ConflictKind: Schema.Literals<readonly ["exists", "busy"]>;
|
|
31
29
|
type ConflictKind = typeof ConflictKind.Type;
|
|
32
30
|
declare const Conflict_base: Schema.Class<Conflict, Schema.TaggedStruct<"Conflict", {
|
|
33
31
|
readonly host: Schema.optionalKey<Schema.String>;
|
|
34
32
|
readonly action: Schema.optionalKey<Schema.String>;
|
|
35
33
|
readonly id: Schema.optionalKey<Schema.String>;
|
|
34
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
36
35
|
readonly message: Schema.String;
|
|
37
36
|
readonly kind: Schema.Literals<readonly ["exists", "busy"]>;
|
|
38
37
|
}>, import("effect/Cause").YieldableError>;
|
|
39
38
|
/** The name is taken (`exists`), or another action holds the resource (`busy`). */
|
|
40
|
-
declare class Conflict extends Conflict_base {
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
declare const Precondition_base: Schema.Class<Precondition, Schema.TaggedStruct<"Precondition", {
|
|
39
|
+
declare class Conflict extends Conflict_base {}
|
|
40
|
+
declare const NotOffered_base: Schema.Class<NotOffered, Schema.TaggedStruct<"NotOffered", {
|
|
44
41
|
readonly host: Schema.optionalKey<Schema.String>;
|
|
45
42
|
readonly action: Schema.optionalKey<Schema.String>;
|
|
46
43
|
readonly id: Schema.optionalKey<Schema.String>;
|
|
44
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
47
45
|
readonly message: Schema.String;
|
|
46
|
+
readonly base: Schema.String;
|
|
48
47
|
}>, import("effect/Cause").YieldableError>;
|
|
49
|
-
/**
|
|
50
|
-
declare class
|
|
51
|
-
|
|
52
|
-
|
|
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 {}
|
|
53
132
|
declare const Capacity_base: Schema.Class<Capacity, Schema.TaggedStruct<"Capacity", {
|
|
54
133
|
readonly host: Schema.optionalKey<Schema.String>;
|
|
55
134
|
readonly action: Schema.optionalKey<Schema.String>;
|
|
56
135
|
readonly id: Schema.optionalKey<Schema.String>;
|
|
136
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
57
137
|
readonly message: Schema.String;
|
|
58
138
|
}>, import("effect/Cause").YieldableError>;
|
|
59
139
|
/** The host has no room now; room can free up, so a later call may succeed. */
|
|
60
|
-
declare class Capacity extends Capacity_base {
|
|
61
|
-
get retryable(): boolean;
|
|
62
|
-
}
|
|
140
|
+
declare class Capacity extends Capacity_base {}
|
|
63
141
|
declare const Unavailable_base: Schema.Class<Unavailable, Schema.TaggedStruct<"Unavailable", {
|
|
64
142
|
readonly host: Schema.optionalKey<Schema.String>;
|
|
65
143
|
readonly action: Schema.optionalKey<Schema.String>;
|
|
66
144
|
readonly id: Schema.optionalKey<Schema.String>;
|
|
145
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
67
146
|
readonly message: Schema.String;
|
|
68
147
|
readonly readOnly: Schema.Boolean;
|
|
69
148
|
}>, import("effect/Cause").YieldableError>;
|
|
@@ -71,25 +150,32 @@ declare const Unavailable_base: Schema.Class<Unavailable, Schema.TaggedStruct<"U
|
|
|
71
150
|
* No reply: only the client library makes it. A mutation's request may have reached the host
|
|
72
151
|
* and run, so it is retryable only when `readOnly`.
|
|
73
152
|
*/
|
|
74
|
-
declare class Unavailable extends Unavailable_base {
|
|
75
|
-
get retryable(): boolean;
|
|
76
|
-
}
|
|
153
|
+
declare class Unavailable extends Unavailable_base {}
|
|
77
154
|
declare const Internal_base: Schema.Class<Internal, Schema.TaggedStruct<"Internal", {
|
|
78
155
|
readonly host: Schema.optionalKey<Schema.String>;
|
|
79
156
|
readonly action: Schema.optionalKey<Schema.String>;
|
|
80
157
|
readonly id: Schema.optionalKey<Schema.String>;
|
|
158
|
+
readonly made: Schema.optionalKey<Schema.String>;
|
|
81
159
|
readonly message: Schema.String;
|
|
82
160
|
}>, import("effect/Cause").YieldableError>;
|
|
83
|
-
declare class Internal extends Internal_base {
|
|
84
|
-
get retryable(): boolean;
|
|
85
|
-
}
|
|
161
|
+
declare class Internal extends Internal_base {}
|
|
86
162
|
/** What a host may answer with; each action declares its own share. */
|
|
87
|
-
declare const hostErrors: readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof
|
|
88
|
-
|
|
89
|
-
|
|
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]>;
|
|
90
173
|
type ClankerboxError = typeof ClankerboxError.Type;
|
|
91
|
-
|
|
92
|
-
|
|
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;
|
|
93
179
|
//#endregion
|
|
94
180
|
//#region src/api.d.ts
|
|
95
181
|
/** A host bounds its own reads of runtime state under it, so a list answers in time. */
|
|
@@ -106,15 +192,12 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
106
192
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
107
193
|
readonly made: Schema.Boolean;
|
|
108
194
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
109
|
-
readonly name: Schema.Literals<readonly ["
|
|
195
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
110
196
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
111
197
|
}>, Schema.Struct<{
|
|
112
|
-
readonly name: Schema.Literals<readonly ["
|
|
198
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
113
199
|
readonly status: Schema.Literal<"failed">;
|
|
114
|
-
readonly error: Schema.
|
|
115
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
116
|
-
readonly message: Schema.String;
|
|
117
|
-
}>;
|
|
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]>;
|
|
118
201
|
}>]>;
|
|
119
202
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
120
203
|
readonly host: Schema.String;
|
|
@@ -136,15 +219,12 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
136
219
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
137
220
|
readonly made: Schema.Boolean;
|
|
138
221
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
139
|
-
readonly name: Schema.Literals<readonly ["
|
|
222
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
140
223
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
141
224
|
}>, Schema.Struct<{
|
|
142
|
-
readonly name: Schema.Literals<readonly ["
|
|
225
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
143
226
|
readonly status: Schema.Literal<"failed">;
|
|
144
|
-
readonly error: Schema.
|
|
145
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
146
|
-
readonly message: Schema.String;
|
|
147
|
-
}>;
|
|
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]>;
|
|
148
228
|
}>]>;
|
|
149
229
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
150
230
|
readonly host: Schema.String;
|
|
@@ -175,15 +255,12 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
175
255
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
176
256
|
readonly made: Schema.Boolean;
|
|
177
257
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
178
|
-
readonly name: Schema.Literals<readonly ["
|
|
258
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
179
259
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
180
260
|
}>, Schema.Struct<{
|
|
181
|
-
readonly name: Schema.Literals<readonly ["
|
|
261
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
182
262
|
readonly status: Schema.Literal<"failed">;
|
|
183
|
-
readonly error: Schema.
|
|
184
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
185
|
-
readonly message: Schema.String;
|
|
186
|
-
}>;
|
|
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]>;
|
|
187
264
|
}>]>;
|
|
188
265
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
189
266
|
readonly host: Schema.String;
|
|
@@ -191,7 +268,7 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
191
268
|
readonly user: Schema.String;
|
|
192
269
|
}>>;
|
|
193
270
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
194
|
-
}>, readonly (typeof Invalid | typeof
|
|
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<{
|
|
195
272
|
readonly id: Schema.String;
|
|
196
273
|
}>, Schema.Struct<{
|
|
197
274
|
readonly id: Schema.String;
|
|
@@ -205,15 +282,12 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
205
282
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
206
283
|
readonly made: Schema.Boolean;
|
|
207
284
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
208
|
-
readonly name: Schema.Literals<readonly ["
|
|
285
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
209
286
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
210
287
|
}>, Schema.Struct<{
|
|
211
|
-
readonly name: Schema.Literals<readonly ["
|
|
288
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
212
289
|
readonly status: Schema.Literal<"failed">;
|
|
213
|
-
readonly error: Schema.
|
|
214
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
215
|
-
readonly message: Schema.String;
|
|
216
|
-
}>;
|
|
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]>;
|
|
217
291
|
}>]>;
|
|
218
292
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
219
293
|
readonly host: Schema.String;
|
|
@@ -221,7 +295,7 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
221
295
|
readonly user: Schema.String;
|
|
222
296
|
}>>;
|
|
223
297
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
224
|
-
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof
|
|
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<{
|
|
225
299
|
readonly id: Schema.String;
|
|
226
300
|
}>, Schema.Struct<{
|
|
227
301
|
readonly id: Schema.String;
|
|
@@ -235,15 +309,12 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
235
309
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
236
310
|
readonly made: Schema.Boolean;
|
|
237
311
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
238
|
-
readonly name: Schema.Literals<readonly ["
|
|
312
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
239
313
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
240
314
|
}>, Schema.Struct<{
|
|
241
|
-
readonly name: Schema.Literals<readonly ["
|
|
315
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
242
316
|
readonly status: Schema.Literal<"failed">;
|
|
243
|
-
readonly error: Schema.
|
|
244
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
245
|
-
readonly message: Schema.String;
|
|
246
|
-
}>;
|
|
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]>;
|
|
247
318
|
}>]>;
|
|
248
319
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
249
320
|
readonly host: Schema.String;
|
|
@@ -251,9 +322,9 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
251
322
|
readonly user: Schema.String;
|
|
252
323
|
}>>;
|
|
253
324
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
254
|
-
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof
|
|
325
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Refused | typeof Internal)[], false, typeof Action.Anyone>, Action.Action<"deleteMachine", Schema.Struct<{
|
|
255
326
|
readonly id: Schema.String;
|
|
256
|
-
}>, Schema.Void, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof
|
|
327
|
+
}>, Schema.Void, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Refused | typeof Internal)[], false, typeof Action.Anyone>, Action.Action<"forkMachine", Schema.Struct<{
|
|
257
328
|
readonly machine: Schema.String;
|
|
258
329
|
readonly name: Schema.String;
|
|
259
330
|
}>, Schema.Struct<{
|
|
@@ -268,15 +339,12 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
268
339
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
269
340
|
readonly made: Schema.Boolean;
|
|
270
341
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
271
|
-
readonly name: Schema.Literals<readonly ["
|
|
342
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
272
343
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
273
344
|
}>, Schema.Struct<{
|
|
274
|
-
readonly name: Schema.Literals<readonly ["
|
|
345
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
275
346
|
readonly status: Schema.Literal<"failed">;
|
|
276
|
-
readonly error: Schema.
|
|
277
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
278
|
-
readonly message: Schema.String;
|
|
279
|
-
}>;
|
|
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]>;
|
|
280
348
|
}>]>;
|
|
281
349
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
282
350
|
readonly host: Schema.String;
|
|
@@ -284,7 +352,7 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
284
352
|
readonly user: Schema.String;
|
|
285
353
|
}>>;
|
|
286
354
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
287
|
-
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof
|
|
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<{
|
|
288
356
|
readonly checkpoint: Schema.String;
|
|
289
357
|
readonly name: Schema.String;
|
|
290
358
|
}>, Schema.Struct<{
|
|
@@ -299,15 +367,12 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
299
367
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
300
368
|
readonly made: Schema.Boolean;
|
|
301
369
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
302
|
-
readonly name: Schema.Literals<readonly ["
|
|
370
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
303
371
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
304
372
|
}>, Schema.Struct<{
|
|
305
|
-
readonly name: Schema.Literals<readonly ["
|
|
373
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
306
374
|
readonly status: Schema.Literal<"failed">;
|
|
307
|
-
readonly error: Schema.
|
|
308
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
309
|
-
readonly message: Schema.String;
|
|
310
|
-
}>;
|
|
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]>;
|
|
311
376
|
}>]>;
|
|
312
377
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
313
378
|
readonly host: Schema.String;
|
|
@@ -315,7 +380,7 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
315
380
|
readonly user: Schema.String;
|
|
316
381
|
}>>;
|
|
317
382
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
318
|
-
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof
|
|
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<{
|
|
319
384
|
readonly id: Schema.String;
|
|
320
385
|
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
321
386
|
readonly machine: Schema.String;
|
|
@@ -326,15 +391,12 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
326
391
|
readonly ramMib: Schema.Int;
|
|
327
392
|
readonly diskGib: Schema.Int;
|
|
328
393
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
329
|
-
readonly name: Schema.Literals<readonly ["
|
|
394
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
330
395
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
331
396
|
}>, Schema.Struct<{
|
|
332
|
-
readonly name: Schema.Literals<readonly ["
|
|
397
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
333
398
|
readonly status: Schema.Literal<"failed">;
|
|
334
|
-
readonly error: Schema.
|
|
335
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
336
|
-
readonly message: Schema.String;
|
|
337
|
-
}>;
|
|
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]>;
|
|
338
400
|
}>]>;
|
|
339
401
|
}>>, readonly (typeof Invalid | typeof Internal)[], true, typeof Action.Anyone>, Action.Action<"getCheckpoint", Schema.Struct<{
|
|
340
402
|
readonly id: Schema.String;
|
|
@@ -349,15 +411,12 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
349
411
|
readonly ramMib: Schema.Int;
|
|
350
412
|
readonly diskGib: Schema.Int;
|
|
351
413
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
352
|
-
readonly name: Schema.Literals<readonly ["
|
|
414
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
353
415
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
354
416
|
}>, Schema.Struct<{
|
|
355
|
-
readonly name: Schema.Literals<readonly ["
|
|
417
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
356
418
|
readonly status: Schema.Literal<"failed">;
|
|
357
|
-
readonly error: Schema.
|
|
358
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
359
|
-
readonly message: Schema.String;
|
|
360
|
-
}>;
|
|
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]>;
|
|
361
420
|
}>]>;
|
|
362
421
|
}>, readonly (typeof Invalid | typeof NotFound | typeof Internal)[], true, typeof Action.Anyone>, Action.Action<"captureCheckpoint", Schema.Struct<{
|
|
363
422
|
readonly machine: Schema.String;
|
|
@@ -373,31 +432,33 @@ declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachines", S
|
|
|
373
432
|
readonly ramMib: Schema.Int;
|
|
374
433
|
readonly diskGib: Schema.Int;
|
|
375
434
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
376
|
-
readonly name: Schema.Literals<readonly ["
|
|
435
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
377
436
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
378
437
|
}>, Schema.Struct<{
|
|
379
|
-
readonly name: Schema.Literals<readonly ["
|
|
438
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
380
439
|
readonly status: Schema.Literal<"failed">;
|
|
381
|
-
readonly error: Schema.
|
|
382
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
383
|
-
readonly message: Schema.String;
|
|
384
|
-
}>;
|
|
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]>;
|
|
385
441
|
}>]>;
|
|
386
|
-
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof
|
|
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<{
|
|
387
443
|
readonly id: Schema.String;
|
|
388
|
-
}>, Schema.Void, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof
|
|
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<{
|
|
389
445
|
readonly id: Schema.String;
|
|
390
446
|
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
391
447
|
readonly version: Schema.String;
|
|
392
448
|
readonly runtimeVersion: Schema.String;
|
|
393
449
|
readonly captureFrom: Schema.Literals<readonly ["running", "stopped"]>;
|
|
394
450
|
readonly bases: Schema.$Array<Schema.String>;
|
|
395
|
-
}>, readonly (typeof Invalid)[], true, typeof Action.Anyone>, Action.Action<"getCapacity", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
451
|
+
}>, readonly (typeof Invalid)[], true, typeof Action.Anyone>, Action.Action<"getCapacity", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
396
452
|
readonly host: Schema.String;
|
|
397
|
-
readonly resource: Schema.Literals<readonly ["ramMib", "runningVms", "activeSandboxes", "startsPerMinute", "startsPerHour", "startsPerDay"]>;
|
|
398
|
-
readonly limit: Schema.Int
|
|
453
|
+
readonly resource: Schema.Literals<readonly ["cpu", "ramMib", "runningVms", "activeSandboxes", "startsPerMinute", "startsPerHour", "startsPerDay"]>;
|
|
454
|
+
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
399
455
|
readonly used: Schema.Int;
|
|
400
|
-
}
|
|
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>;
|
|
401
462
|
declare const actionsByName: {
|
|
402
463
|
readonly captureCheckpoint: Action.Action<"captureCheckpoint", Schema.Struct<{
|
|
403
464
|
readonly machine: Schema.String;
|
|
@@ -413,17 +474,14 @@ declare const actionsByName: {
|
|
|
413
474
|
readonly ramMib: Schema.Int;
|
|
414
475
|
readonly diskGib: Schema.Int;
|
|
415
476
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
416
|
-
readonly name: Schema.Literals<readonly ["
|
|
477
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
417
478
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
418
479
|
}>, Schema.Struct<{
|
|
419
|
-
readonly name: Schema.Literals<readonly ["
|
|
480
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
420
481
|
readonly status: Schema.Literal<"failed">;
|
|
421
|
-
readonly error: Schema.
|
|
422
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
423
|
-
readonly message: Schema.String;
|
|
424
|
-
}>;
|
|
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]>;
|
|
425
483
|
}>]>;
|
|
426
|
-
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof
|
|
484
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof NotMade | typeof Missing | typeof WrongState | typeof Refused | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>;
|
|
427
485
|
readonly createMachine: Action.Action<"createMachine", Schema.Struct<{
|
|
428
486
|
readonly base: Schema.String;
|
|
429
487
|
readonly cpu: Schema.Int;
|
|
@@ -447,15 +505,12 @@ declare const actionsByName: {
|
|
|
447
505
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
448
506
|
readonly made: Schema.Boolean;
|
|
449
507
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
450
|
-
readonly name: Schema.Literals<readonly ["
|
|
508
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
451
509
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
452
510
|
}>, Schema.Struct<{
|
|
453
|
-
readonly name: Schema.Literals<readonly ["
|
|
511
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
454
512
|
readonly status: Schema.Literal<"failed">;
|
|
455
|
-
readonly error: Schema.
|
|
456
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
457
|
-
readonly message: Schema.String;
|
|
458
|
-
}>;
|
|
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]>;
|
|
459
514
|
}>]>;
|
|
460
515
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
461
516
|
readonly host: Schema.String;
|
|
@@ -463,13 +518,13 @@ declare const actionsByName: {
|
|
|
463
518
|
readonly user: Schema.String;
|
|
464
519
|
}>>;
|
|
465
520
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
466
|
-
}>, readonly (typeof Invalid | typeof
|
|
521
|
+
}>, readonly (typeof Invalid | typeof Conflict | typeof NotOffered | typeof Unsizable | typeof ScriptFailed | typeof Refused | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>;
|
|
467
522
|
readonly deleteCheckpoint: Action.Action<"deleteCheckpoint", Schema.Struct<{
|
|
468
523
|
readonly id: Schema.String;
|
|
469
|
-
}>, Schema.Void, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof
|
|
524
|
+
}>, Schema.Void, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Refused | typeof Internal)[], false, typeof Action.Anyone>;
|
|
470
525
|
readonly deleteMachine: Action.Action<"deleteMachine", Schema.Struct<{
|
|
471
526
|
readonly id: Schema.String;
|
|
472
|
-
}>, Schema.Void, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof
|
|
527
|
+
}>, Schema.Void, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Refused | typeof Internal)[], false, typeof Action.Anyone>;
|
|
473
528
|
readonly forkMachine: Action.Action<"forkMachine", Schema.Struct<{
|
|
474
529
|
readonly machine: Schema.String;
|
|
475
530
|
readonly name: Schema.String;
|
|
@@ -485,15 +540,12 @@ declare const actionsByName: {
|
|
|
485
540
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
486
541
|
readonly made: Schema.Boolean;
|
|
487
542
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
488
|
-
readonly name: Schema.Literals<readonly ["
|
|
543
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
489
544
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
490
545
|
}>, Schema.Struct<{
|
|
491
|
-
readonly name: Schema.Literals<readonly ["
|
|
546
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
492
547
|
readonly status: Schema.Literal<"failed">;
|
|
493
|
-
readonly error: Schema.
|
|
494
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
495
|
-
readonly message: Schema.String;
|
|
496
|
-
}>;
|
|
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]>;
|
|
497
549
|
}>]>;
|
|
498
550
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
499
551
|
readonly host: Schema.String;
|
|
@@ -501,13 +553,18 @@ declare const actionsByName: {
|
|
|
501
553
|
readonly user: Schema.String;
|
|
502
554
|
}>>;
|
|
503
555
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
504
|
-
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof
|
|
505
|
-
readonly getCapacity: Action.Action<"getCapacity", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
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<{
|
|
506
558
|
readonly host: Schema.String;
|
|
507
|
-
readonly resource: Schema.Literals<readonly ["ramMib", "runningVms", "activeSandboxes", "startsPerMinute", "startsPerHour", "startsPerDay"]>;
|
|
508
|
-
readonly limit: Schema.Int
|
|
559
|
+
readonly resource: Schema.Literals<readonly ["cpu", "ramMib", "runningVms", "activeSandboxes", "startsPerMinute", "startsPerHour", "startsPerDay"]>;
|
|
560
|
+
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
509
561
|
readonly used: Schema.Int;
|
|
510
|
-
}
|
|
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>;
|
|
511
568
|
readonly getCheckpoint: Action.Action<"getCheckpoint", Schema.Struct<{
|
|
512
569
|
readonly id: Schema.String;
|
|
513
570
|
}>, Schema.Struct<{
|
|
@@ -521,15 +578,12 @@ declare const actionsByName: {
|
|
|
521
578
|
readonly ramMib: Schema.Int;
|
|
522
579
|
readonly diskGib: Schema.Int;
|
|
523
580
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
524
|
-
readonly name: Schema.Literals<readonly ["
|
|
581
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
525
582
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
526
583
|
}>, Schema.Struct<{
|
|
527
|
-
readonly name: Schema.Literals<readonly ["
|
|
584
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
528
585
|
readonly status: Schema.Literal<"failed">;
|
|
529
|
-
readonly error: Schema.
|
|
530
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
531
|
-
readonly message: Schema.String;
|
|
532
|
-
}>;
|
|
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]>;
|
|
533
587
|
}>]>;
|
|
534
588
|
}>, readonly (typeof Invalid | typeof NotFound | typeof Internal)[], true, typeof Action.Anyone>;
|
|
535
589
|
readonly getHost: Action.Action<"getHost", Schema.$Record<Schema.String, Schema.Never>, Schema.Struct<{
|
|
@@ -554,15 +608,12 @@ declare const actionsByName: {
|
|
|
554
608
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
555
609
|
readonly made: Schema.Boolean;
|
|
556
610
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
557
|
-
readonly name: Schema.Literals<readonly ["
|
|
611
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
558
612
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
559
613
|
}>, Schema.Struct<{
|
|
560
|
-
readonly name: Schema.Literals<readonly ["
|
|
614
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
561
615
|
readonly status: Schema.Literal<"failed">;
|
|
562
|
-
readonly error: Schema.
|
|
563
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
564
|
-
readonly message: Schema.String;
|
|
565
|
-
}>;
|
|
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]>;
|
|
566
617
|
}>]>;
|
|
567
618
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
568
619
|
readonly host: Schema.String;
|
|
@@ -582,15 +633,12 @@ declare const actionsByName: {
|
|
|
582
633
|
readonly ramMib: Schema.Int;
|
|
583
634
|
readonly diskGib: Schema.Int;
|
|
584
635
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
585
|
-
readonly name: Schema.Literals<readonly ["
|
|
636
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
586
637
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
587
638
|
}>, Schema.Struct<{
|
|
588
|
-
readonly name: Schema.Literals<readonly ["
|
|
639
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
589
640
|
readonly status: Schema.Literal<"failed">;
|
|
590
|
-
readonly error: Schema.
|
|
591
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
592
|
-
readonly message: Schema.String;
|
|
593
|
-
}>;
|
|
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]>;
|
|
594
642
|
}>]>;
|
|
595
643
|
}>>, readonly (typeof Invalid | typeof Internal)[], true, typeof Action.Anyone>;
|
|
596
644
|
readonly listMachines: Action.Action<"listMachines", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
@@ -605,15 +653,12 @@ declare const actionsByName: {
|
|
|
605
653
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
606
654
|
readonly made: Schema.Boolean;
|
|
607
655
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
608
|
-
readonly name: Schema.Literals<readonly ["
|
|
656
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
609
657
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
610
658
|
}>, Schema.Struct<{
|
|
611
|
-
readonly name: Schema.Literals<readonly ["
|
|
659
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
612
660
|
readonly status: Schema.Literal<"failed">;
|
|
613
|
-
readonly error: Schema.
|
|
614
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
615
|
-
readonly message: Schema.String;
|
|
616
|
-
}>;
|
|
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]>;
|
|
617
662
|
}>]>;
|
|
618
663
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
619
664
|
readonly host: Schema.String;
|
|
@@ -637,15 +682,12 @@ declare const actionsByName: {
|
|
|
637
682
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
638
683
|
readonly made: Schema.Boolean;
|
|
639
684
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
640
|
-
readonly name: Schema.Literals<readonly ["
|
|
685
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
641
686
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
642
687
|
}>, Schema.Struct<{
|
|
643
|
-
readonly name: Schema.Literals<readonly ["
|
|
688
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
644
689
|
readonly status: Schema.Literal<"failed">;
|
|
645
|
-
readonly error: Schema.
|
|
646
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
647
|
-
readonly message: Schema.String;
|
|
648
|
-
}>;
|
|
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]>;
|
|
649
691
|
}>]>;
|
|
650
692
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
651
693
|
readonly host: Schema.String;
|
|
@@ -653,7 +695,7 @@ declare const actionsByName: {
|
|
|
653
695
|
readonly user: Schema.String;
|
|
654
696
|
}>>;
|
|
655
697
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
656
|
-
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof
|
|
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>;
|
|
657
699
|
readonly startMachine: Action.Action<"startMachine", Schema.Struct<{
|
|
658
700
|
readonly id: Schema.String;
|
|
659
701
|
}>, Schema.Struct<{
|
|
@@ -668,15 +710,12 @@ declare const actionsByName: {
|
|
|
668
710
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
669
711
|
readonly made: Schema.Boolean;
|
|
670
712
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
671
|
-
readonly name: Schema.Literals<readonly ["
|
|
713
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
672
714
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
673
715
|
}>, Schema.Struct<{
|
|
674
|
-
readonly name: Schema.Literals<readonly ["
|
|
716
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
675
717
|
readonly status: Schema.Literal<"failed">;
|
|
676
|
-
readonly error: Schema.
|
|
677
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
678
|
-
readonly message: Schema.String;
|
|
679
|
-
}>;
|
|
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]>;
|
|
680
719
|
}>]>;
|
|
681
720
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
682
721
|
readonly host: Schema.String;
|
|
@@ -684,7 +723,7 @@ declare const actionsByName: {
|
|
|
684
723
|
readonly user: Schema.String;
|
|
685
724
|
}>>;
|
|
686
725
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
687
|
-
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof
|
|
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>;
|
|
688
727
|
readonly stopMachine: Action.Action<"stopMachine", Schema.Struct<{
|
|
689
728
|
readonly id: Schema.String;
|
|
690
729
|
}>, Schema.Struct<{
|
|
@@ -699,15 +738,12 @@ declare const actionsByName: {
|
|
|
699
738
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
700
739
|
readonly made: Schema.Boolean;
|
|
701
740
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
702
|
-
readonly name: Schema.Literals<readonly ["
|
|
741
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
703
742
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
704
743
|
}>, Schema.Struct<{
|
|
705
|
-
readonly name: Schema.Literals<readonly ["
|
|
744
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
706
745
|
readonly status: Schema.Literal<"failed">;
|
|
707
|
-
readonly error: Schema.
|
|
708
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
709
|
-
readonly message: Schema.String;
|
|
710
|
-
}>;
|
|
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]>;
|
|
711
747
|
}>]>;
|
|
712
748
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
713
749
|
readonly host: Schema.String;
|
|
@@ -715,45 +751,29 @@ declare const actionsByName: {
|
|
|
715
751
|
readonly user: Schema.String;
|
|
716
752
|
}>>;
|
|
717
753
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
718
|
-
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof
|
|
754
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Refused | typeof Internal)[], false, typeof Action.Anyone>;
|
|
719
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"];
|
|
720
758
|
//#endregion
|
|
721
759
|
//#region src/resources.d.ts
|
|
722
760
|
declare const Runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
723
761
|
type Runtime = typeof Runtime.Type;
|
|
724
|
-
/** The mutations
|
|
725
|
-
declare const ActionName: Schema.Literals<readonly ["
|
|
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"]>;
|
|
726
764
|
type ActionName = typeof ActionName.Type;
|
|
727
765
|
declare const ActionStatus: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
728
766
|
type ActionStatus = typeof ActionStatus.Type;
|
|
729
767
|
/** A resource's last action; the next action replaces it. */
|
|
730
768
|
declare const ActionRecord: Schema.Union<readonly [Schema.Struct<{
|
|
731
|
-
readonly name: Schema.Literals<readonly ["
|
|
769
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
732
770
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
733
771
|
}>, Schema.Struct<{
|
|
734
|
-
readonly name: Schema.Literals<readonly ["
|
|
772
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
735
773
|
readonly status: Schema.Literal<"failed">;
|
|
736
|
-
readonly error: Schema.
|
|
737
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
738
|
-
readonly message: Schema.String;
|
|
739
|
-
}>;
|
|
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]>;
|
|
740
775
|
}>]>;
|
|
741
776
|
type ActionRecord = typeof ActionRecord.Type;
|
|
742
|
-
/** A checkpoint is only ever captured or deleted. */
|
|
743
|
-
declare const CheckpointActionName: Schema.Literals<readonly ["capture", "delete"]>;
|
|
744
|
-
type CheckpointActionName = typeof CheckpointActionName.Type;
|
|
745
|
-
declare const CheckpointActionRecord: Schema.Union<readonly [Schema.Struct<{
|
|
746
|
-
readonly name: Schema.Literals<readonly ["capture", "delete"]>;
|
|
747
|
-
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
748
|
-
}>, Schema.Struct<{
|
|
749
|
-
readonly name: Schema.Literals<readonly ["capture", "delete"]>;
|
|
750
|
-
readonly status: Schema.Literal<"failed">;
|
|
751
|
-
readonly error: Schema.Struct<{
|
|
752
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
753
|
-
readonly message: Schema.String;
|
|
754
|
-
}>;
|
|
755
|
-
}>]>;
|
|
756
|
-
type CheckpointActionRecord = typeof CheckpointActionRecord.Type;
|
|
757
777
|
declare const SshEndpoint: Schema.Struct<{
|
|
758
778
|
readonly host: Schema.String;
|
|
759
779
|
readonly port: Schema.Int;
|
|
@@ -765,6 +785,12 @@ declare const SshLogin: Schema.Struct<{
|
|
|
765
785
|
readonly user: Schema.String;
|
|
766
786
|
}>;
|
|
767
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
|
+
*/
|
|
768
794
|
declare const Machine: Schema.Struct<{
|
|
769
795
|
readonly id: Schema.String;
|
|
770
796
|
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
@@ -774,36 +800,31 @@ declare const Machine: Schema.Struct<{
|
|
|
774
800
|
readonly cpu: Schema.Int;
|
|
775
801
|
readonly ramMib: Schema.Int;
|
|
776
802
|
readonly diskGib: Schema.Int;
|
|
777
|
-
/** `missing`: the runtime doesn't have it; `unknown`: it couldn't be read. */
|
|
778
803
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
779
|
-
/** Until its create, fork or restore has made it, it can only be read, stopped or deleted. */
|
|
780
804
|
readonly made: Schema.Boolean;
|
|
781
805
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
782
|
-
readonly name: Schema.Literals<readonly ["
|
|
806
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
783
807
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
784
808
|
}>, Schema.Struct<{
|
|
785
|
-
readonly name: Schema.Literals<readonly ["
|
|
809
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
786
810
|
readonly status: Schema.Literal<"failed">;
|
|
787
|
-
readonly error: Schema.
|
|
788
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
789
|
-
readonly message: Schema.String;
|
|
790
|
-
}>;
|
|
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]>;
|
|
791
812
|
}>]>;
|
|
792
|
-
/** Only on a running machine whose runtime gives it an endpoint. */
|
|
793
813
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
794
814
|
readonly host: Schema.String;
|
|
795
815
|
readonly port: Schema.Int;
|
|
796
816
|
readonly user: Schema.String;
|
|
797
817
|
}>>;
|
|
798
|
-
/** `<type> <base64>`, once preparation has recorded it. */
|
|
799
818
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
800
819
|
}>;
|
|
801
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. */
|
|
802
824
|
declare const Checkpoint: Schema.Struct<{
|
|
803
825
|
readonly id: Schema.String;
|
|
804
826
|
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
805
827
|
readonly machine: Schema.String;
|
|
806
|
-
/** `ram` (RAM and disks) on smolvm, `disk` on Tart and boat. */
|
|
807
828
|
readonly kind: Schema.Literals<readonly ["ram", "disk"]>;
|
|
808
829
|
readonly base: Schema.String;
|
|
809
830
|
readonly profile: Schema.optionalKey<Schema.String>;
|
|
@@ -811,44 +832,54 @@ declare const Checkpoint: Schema.Struct<{
|
|
|
811
832
|
readonly ramMib: Schema.Int;
|
|
812
833
|
readonly diskGib: Schema.Int;
|
|
813
834
|
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
814
|
-
readonly name: Schema.Literals<readonly ["
|
|
835
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
815
836
|
readonly status: Schema.Literals<readonly ["running", "done"]>;
|
|
816
837
|
}>, Schema.Struct<{
|
|
817
|
-
readonly name: Schema.Literals<readonly ["
|
|
838
|
+
readonly name: Schema.Literals<readonly ["createMachine", "startMachine", "stopMachine", "deleteMachine", "forkMachine", "restoreMachine", "captureCheckpoint", "deleteCheckpoint"]>;
|
|
818
839
|
readonly status: Schema.Literal<"failed">;
|
|
819
|
-
readonly error: Schema.
|
|
820
|
-
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
821
|
-
readonly message: Schema.String;
|
|
822
|
-
}>;
|
|
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]>;
|
|
823
841
|
}>]>;
|
|
824
842
|
}>;
|
|
825
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
|
+
*/
|
|
826
850
|
declare const Host: Schema.Struct<{
|
|
827
851
|
readonly id: Schema.String;
|
|
828
852
|
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
829
853
|
readonly version: Schema.String;
|
|
830
|
-
/** For boat, its API version. */
|
|
831
854
|
readonly runtimeVersion: Schema.String;
|
|
832
|
-
/** The state a machine must be in to be captured: Tart's is `stopped`. */
|
|
833
855
|
readonly captureFrom: Schema.Literals<readonly ["running", "stopped"]>;
|
|
834
856
|
readonly bases: Schema.$Array<Schema.String>;
|
|
835
857
|
}>;
|
|
836
858
|
type Host = typeof Host.Type;
|
|
837
859
|
/**
|
|
838
|
-
*
|
|
839
|
-
* machines.
|
|
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.
|
|
840
867
|
*/
|
|
841
|
-
declare const
|
|
868
|
+
declare const Usage: Schema.Union<readonly [Schema.Struct<{
|
|
842
869
|
readonly host: Schema.String;
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
* `activeSandboxes` and the `starts` of each rolling window: the boat account's.
|
|
846
|
-
*/
|
|
847
|
-
readonly resource: Schema.Literals<readonly ["ramMib", "runningVms", "activeSandboxes", "startsPerMinute", "startsPerHour", "startsPerDay"]>;
|
|
848
|
-
readonly limit: Schema.Int;
|
|
870
|
+
readonly resource: Schema.Literals<readonly ["cpu", "ramMib", "runningVms", "activeSandboxes", "startsPerMinute", "startsPerHour", "startsPerDay"]>;
|
|
871
|
+
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
849
872
|
readonly used: Schema.Int;
|
|
850
|
-
}
|
|
851
|
-
|
|
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>;
|
|
852
883
|
/** Nothing logs the script: it can carry secrets. */
|
|
853
884
|
declare const Setup: Schema.Struct<{
|
|
854
885
|
readonly script: Schema.String;
|
|
@@ -883,7 +914,7 @@ declare const CreateRequest: Schema.Struct<{
|
|
|
883
914
|
}>;
|
|
884
915
|
type CreateRequest = typeof CreateRequest.Type;
|
|
885
916
|
declare namespace client_d_exports {
|
|
886
|
-
export { Client, CreateOptions, ErrorOf, Gathered, HostAction, HostEntry, Interface, Options, Unreachable, layer, make };
|
|
917
|
+
export { Calls, Client, CreateOptions, Deleted, ErrorOf, Gathered, HostAction, HostEntry, Interface, Options, Routed, Unreachable, layer, make };
|
|
887
918
|
}
|
|
888
919
|
/** `id` is the host part of every ID the host holds. */
|
|
889
920
|
declare const HostEntry: Schema.Struct<{
|
|
@@ -898,7 +929,9 @@ type HostAction = keyof Actions;
|
|
|
898
929
|
* What a call of `N` fails with: an error the action declares, which always includes `Invalid`,
|
|
899
930
|
* or no reply, or a reply the client couldn't use.
|
|
900
931
|
*/
|
|
901
|
-
type ErrorOf<N extends HostAction> =
|
|
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"];
|
|
902
935
|
interface Unreachable {
|
|
903
936
|
readonly host: string;
|
|
904
937
|
readonly error: ClankerboxError;
|
|
@@ -917,30 +950,46 @@ interface Options {
|
|
|
917
950
|
/** The wait for a read's reply, `readTimeout` by default; a fan-out bounds each host's own. */
|
|
918
951
|
readonly readTimeout?: Duration.Duration | undefined;
|
|
919
952
|
}
|
|
953
|
+
/** A delete of a resource that is already gone is `absent`: done either way. */
|
|
954
|
+
type Deleted = "deleted" | "absent";
|
|
920
955
|
interface CreateOptions {
|
|
921
956
|
/** The host to create on, instead of the first that offers the base. */
|
|
922
957
|
readonly host?: string | undefined;
|
|
923
958
|
}
|
|
924
|
-
|
|
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 {
|
|
925
976
|
readonly hosts: Effect.Effect<Gathered<Host>>;
|
|
926
977
|
readonly machines: Effect.Effect<Gathered<Machine>>;
|
|
927
978
|
readonly checkpoints: Effect.Effect<Gathered<Checkpoint>>;
|
|
928
979
|
/** A host whose runtime couldn't be read is among the unreachable. */
|
|
929
|
-
readonly capacity: Effect.Effect<Gathered<
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
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. */
|
|
934
988
|
readonly create: (name: string, spec: MachineSpec, options?: CreateOptions) => Effect.Effect<Machine, ErrorOf<"createMachine">>;
|
|
935
|
-
|
|
936
|
-
readonly
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
readonly fork: (machine: string, name: string) => Effect.Effect<Machine, ErrorOf<"forkMachine">>;
|
|
940
|
-
/** Creates a machine named `name` from a checkpoint, on the checkpoint's host. */
|
|
941
|
-
readonly restore: (checkpoint: string, name: string) => Effect.Effect<Machine, ErrorOf<"restoreMachine">>;
|
|
942
|
-
readonly capture: (machine: string, name: string) => Effect.Effect<Checkpoint, ErrorOf<"captureCheckpoint">>;
|
|
943
|
-
readonly deleteCheckpoint: (id: string) => Effect.Effect<void, ErrorOf<"deleteCheckpoint">>;
|
|
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>>;
|
|
944
993
|
}
|
|
945
994
|
declare const Client_base: Context.ServiceClass<Client, "@gjermundgaraba/clankerbox-sdk/Client", Interface>;
|
|
946
995
|
/**
|
|
@@ -955,4 +1004,4 @@ declare class Client extends Client_base {}
|
|
|
955
1004
|
declare const make: (hosts: ReadonlyArray<HostEntry>, options?: Options) => Effect.Effect<Interface, Invalid, HttpClient.HttpClient>;
|
|
956
1005
|
declare const layer: (hosts: ReadonlyArray<HostEntry>, options?: Options) => Layer.Layer<Client, Invalid, HttpClient.HttpClient>;
|
|
957
1006
|
//#endregion
|
|
958
|
-
export {
|
|
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 };
|