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