@gjermundgaraba/clankerbox-sdk 0.4.1 → 0.12.1
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-BVzrg2pq.d.mts +289 -0
- package/dist/client-CbgD_J1o.mjs +583 -0
- package/dist/index.d.mts +573 -0
- package/dist/index.mjs +106 -0
- package/dist/node.d.mts +6 -0
- package/dist/node.mjs +12 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/package.json +33 -44
- package/README.md +0 -100
- package/dist/gen/clankerbox/v1/host_pb.d.ts +0 -432
- package/dist/gen/clankerbox/v1/host_pb.js +0 -99
- package/dist/gen/clankerbox/v1/machine_pb.d.ts +0 -494
- package/dist/gen/clankerbox/v1/machine_pb.js +0 -113
- package/dist/gen/clankerbox/v1/profile_pb.d.ts +0 -600
- package/dist/gen/clankerbox/v1/profile_pb.js +0 -156
- package/dist/gen/clankerbox/v1/resources_pb.d.ts +0 -595
- package/dist/gen/clankerbox/v1/resources_pb.js +0 -283
- package/dist/gen/clankerbox/v1/session_pb.d.ts +0 -876
- package/dist/gen/clankerbox/v1/session_pb.js +0 -219
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -5
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,573 @@
|
|
|
1
|
+
import { A as hostErrors, C as HostError, D as NotFound, E as Invalid, O as Precondition, S as ErrorTag, T as Internal, _ as version, a as ActionName, b as Conflict, c as CreateRequest, d as MachineSpec, f as Profile, g as release, h as SshEndpoint, i as client_d_exports, k as Unavailable, l as Host, m as Setup, o as ActionRecord, p as Runtime, s as Checkpoint, u as Machine, v as Capacity, w as HostErrorTag, x as ConflictKind, y as ClankerboxError } from "./client-BVzrg2pq.mjs";
|
|
2
|
+
import * as Action from "@gjermundgaraba/effect-actions/Action";
|
|
3
|
+
import * as ActionGroup from "@gjermundgaraba/effect-actions/ActionGroup";
|
|
4
|
+
import * as ActionHttp from "@gjermundgaraba/effect-actions/ActionHttp";
|
|
5
|
+
import { Duration, Effect, FileSystem, Path, Schema } from "effect";
|
|
6
|
+
import { ChildProcessSpawner } from "effect/process";
|
|
7
|
+
//#region src/api.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* How long a client waits for a read's reply from one host, unless it sets its own. A host
|
|
10
|
+
* bounds its own reads of runtime state under it, so a list answers in time.
|
|
11
|
+
*/
|
|
12
|
+
export declare const readTimeout: Duration.Duration;
|
|
13
|
+
/**
|
|
14
|
+
* The header every client request carries the SDK's `version` in. A host refuses a request
|
|
15
|
+
* whose release (major.minor) differs from its own, or that carries none, before it runs
|
|
16
|
+
* anything.
|
|
17
|
+
*/
|
|
18
|
+
export declare const versionHeader = "clankerbox-version";
|
|
19
|
+
export declare const MachineGroup: ActionGroup.Group<"machine", readonly [Action.Action<"list", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
20
|
+
readonly id: Schema.String;
|
|
21
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
22
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
23
|
+
readonly base: Schema.String;
|
|
24
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
25
|
+
readonly cpu: Schema.Int;
|
|
26
|
+
readonly ramMib: Schema.Int;
|
|
27
|
+
readonly diskGib: Schema.Int;
|
|
28
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
29
|
+
readonly action: Schema.Struct<{
|
|
30
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
31
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
32
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
33
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
34
|
+
readonly message: Schema.String;
|
|
35
|
+
}>>;
|
|
36
|
+
}>;
|
|
37
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
38
|
+
readonly host: Schema.String;
|
|
39
|
+
readonly port: Schema.Int;
|
|
40
|
+
}>>;
|
|
41
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
42
|
+
}>>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "read", undefined>, Action.Action<"get", Schema.Struct<{
|
|
43
|
+
readonly id: Schema.String;
|
|
44
|
+
}>, Schema.Struct<{
|
|
45
|
+
readonly id: Schema.String;
|
|
46
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
47
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
48
|
+
readonly base: Schema.String;
|
|
49
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
50
|
+
readonly cpu: Schema.Int;
|
|
51
|
+
readonly ramMib: Schema.Int;
|
|
52
|
+
readonly diskGib: Schema.Int;
|
|
53
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
54
|
+
readonly action: Schema.Struct<{
|
|
55
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
56
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
57
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
58
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
59
|
+
readonly message: Schema.String;
|
|
60
|
+
}>>;
|
|
61
|
+
}>;
|
|
62
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
63
|
+
readonly host: Schema.String;
|
|
64
|
+
readonly port: Schema.Int;
|
|
65
|
+
}>>;
|
|
66
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
67
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "read", undefined>, Action.Action<"create", Schema.Struct<{
|
|
68
|
+
readonly base: Schema.String;
|
|
69
|
+
readonly cpu: Schema.Int;
|
|
70
|
+
readonly ramMib: Schema.Int;
|
|
71
|
+
readonly diskGib: Schema.Int;
|
|
72
|
+
readonly setup: Schema.optionalKey<Schema.Struct<{
|
|
73
|
+
readonly script: Schema.String;
|
|
74
|
+
readonly timeoutSeconds: Schema.Int;
|
|
75
|
+
}>>;
|
|
76
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
77
|
+
readonly id: Schema.String;
|
|
78
|
+
}>, Schema.Struct<{
|
|
79
|
+
readonly id: Schema.String;
|
|
80
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
81
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
82
|
+
readonly base: Schema.String;
|
|
83
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
84
|
+
readonly cpu: Schema.Int;
|
|
85
|
+
readonly ramMib: Schema.Int;
|
|
86
|
+
readonly diskGib: Schema.Int;
|
|
87
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
88
|
+
readonly action: Schema.Struct<{
|
|
89
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
90
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
91
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
92
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
93
|
+
readonly message: Schema.String;
|
|
94
|
+
}>>;
|
|
95
|
+
}>;
|
|
96
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
97
|
+
readonly host: Schema.String;
|
|
98
|
+
readonly port: Schema.Int;
|
|
99
|
+
}>>;
|
|
100
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
101
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>, Action.Action<"start", Schema.Struct<{
|
|
102
|
+
readonly id: Schema.String;
|
|
103
|
+
}>, Schema.Struct<{
|
|
104
|
+
readonly id: Schema.String;
|
|
105
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
106
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
107
|
+
readonly base: Schema.String;
|
|
108
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
109
|
+
readonly cpu: Schema.Int;
|
|
110
|
+
readonly ramMib: Schema.Int;
|
|
111
|
+
readonly diskGib: Schema.Int;
|
|
112
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
113
|
+
readonly action: Schema.Struct<{
|
|
114
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
115
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
116
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
117
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
118
|
+
readonly message: Schema.String;
|
|
119
|
+
}>>;
|
|
120
|
+
}>;
|
|
121
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
122
|
+
readonly host: Schema.String;
|
|
123
|
+
readonly port: Schema.Int;
|
|
124
|
+
}>>;
|
|
125
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
126
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>, Action.Action<"stop", Schema.Struct<{
|
|
127
|
+
readonly id: Schema.String;
|
|
128
|
+
}>, Schema.Struct<{
|
|
129
|
+
readonly id: Schema.String;
|
|
130
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
131
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
132
|
+
readonly base: Schema.String;
|
|
133
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
134
|
+
readonly cpu: Schema.Int;
|
|
135
|
+
readonly ramMib: Schema.Int;
|
|
136
|
+
readonly diskGib: Schema.Int;
|
|
137
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
138
|
+
readonly action: Schema.Struct<{
|
|
139
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
140
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
141
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
142
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
143
|
+
readonly message: Schema.String;
|
|
144
|
+
}>>;
|
|
145
|
+
}>;
|
|
146
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
147
|
+
readonly host: Schema.String;
|
|
148
|
+
readonly port: Schema.Int;
|
|
149
|
+
}>>;
|
|
150
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
151
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>, Action.Action<"delete", Schema.Struct<{
|
|
152
|
+
readonly id: Schema.String;
|
|
153
|
+
}>, Schema.Void, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>, Action.Action<"fork", Schema.Struct<{
|
|
154
|
+
readonly machine: Schema.String;
|
|
155
|
+
readonly name: Schema.String;
|
|
156
|
+
}>, Schema.Struct<{
|
|
157
|
+
readonly id: Schema.String;
|
|
158
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
159
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
160
|
+
readonly base: Schema.String;
|
|
161
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
162
|
+
readonly cpu: Schema.Int;
|
|
163
|
+
readonly ramMib: Schema.Int;
|
|
164
|
+
readonly diskGib: Schema.Int;
|
|
165
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
166
|
+
readonly action: Schema.Struct<{
|
|
167
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
168
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
169
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
170
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
171
|
+
readonly message: Schema.String;
|
|
172
|
+
}>>;
|
|
173
|
+
}>;
|
|
174
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
175
|
+
readonly host: Schema.String;
|
|
176
|
+
readonly port: Schema.Int;
|
|
177
|
+
}>>;
|
|
178
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
179
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>, Action.Action<"restore", Schema.Struct<{
|
|
180
|
+
readonly checkpoint: Schema.String;
|
|
181
|
+
readonly name: Schema.String;
|
|
182
|
+
}>, Schema.Struct<{
|
|
183
|
+
readonly id: Schema.String;
|
|
184
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
185
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
186
|
+
readonly base: Schema.String;
|
|
187
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
188
|
+
readonly cpu: Schema.Int;
|
|
189
|
+
readonly ramMib: Schema.Int;
|
|
190
|
+
readonly diskGib: Schema.Int;
|
|
191
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
192
|
+
readonly action: Schema.Struct<{
|
|
193
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
194
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
195
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
196
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
197
|
+
readonly message: Schema.String;
|
|
198
|
+
}>>;
|
|
199
|
+
}>;
|
|
200
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
201
|
+
readonly host: Schema.String;
|
|
202
|
+
readonly port: Schema.Int;
|
|
203
|
+
}>>;
|
|
204
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
205
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>], typeof Invalid | typeof Internal>;
|
|
206
|
+
export declare const CheckpointGroup: ActionGroup.Group<"checkpoint", readonly [Action.Action<"list", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
207
|
+
readonly id: Schema.String;
|
|
208
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
209
|
+
readonly machine: Schema.String;
|
|
210
|
+
readonly kind: Schema.Literals<readonly ["ram", "disk"]>;
|
|
211
|
+
readonly base: Schema.String;
|
|
212
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
213
|
+
readonly cpu: Schema.Int;
|
|
214
|
+
readonly ramMib: Schema.Int;
|
|
215
|
+
readonly diskGib: Schema.Int;
|
|
216
|
+
readonly action: Schema.Struct<{
|
|
217
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
218
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
219
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
220
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
221
|
+
readonly message: Schema.String;
|
|
222
|
+
}>>;
|
|
223
|
+
}>;
|
|
224
|
+
}>>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "read", undefined>, Action.Action<"get", Schema.Struct<{
|
|
225
|
+
readonly id: Schema.String;
|
|
226
|
+
}>, Schema.Struct<{
|
|
227
|
+
readonly id: Schema.String;
|
|
228
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
229
|
+
readonly machine: Schema.String;
|
|
230
|
+
readonly kind: Schema.Literals<readonly ["ram", "disk"]>;
|
|
231
|
+
readonly base: Schema.String;
|
|
232
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
233
|
+
readonly cpu: Schema.Int;
|
|
234
|
+
readonly ramMib: Schema.Int;
|
|
235
|
+
readonly diskGib: Schema.Int;
|
|
236
|
+
readonly action: Schema.Struct<{
|
|
237
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
238
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
239
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
240
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
241
|
+
readonly message: Schema.String;
|
|
242
|
+
}>>;
|
|
243
|
+
}>;
|
|
244
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "read", undefined>, Action.Action<"capture", Schema.Struct<{
|
|
245
|
+
readonly machine: Schema.String;
|
|
246
|
+
readonly name: Schema.String;
|
|
247
|
+
}>, Schema.Struct<{
|
|
248
|
+
readonly id: Schema.String;
|
|
249
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
250
|
+
readonly machine: Schema.String;
|
|
251
|
+
readonly kind: Schema.Literals<readonly ["ram", "disk"]>;
|
|
252
|
+
readonly base: Schema.String;
|
|
253
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
254
|
+
readonly cpu: Schema.Int;
|
|
255
|
+
readonly ramMib: Schema.Int;
|
|
256
|
+
readonly diskGib: Schema.Int;
|
|
257
|
+
readonly action: Schema.Struct<{
|
|
258
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
259
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
260
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
261
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
262
|
+
readonly message: Schema.String;
|
|
263
|
+
}>>;
|
|
264
|
+
}>;
|
|
265
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>, Action.Action<"delete", Schema.Struct<{
|
|
266
|
+
readonly id: Schema.String;
|
|
267
|
+
}>, Schema.Void, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>], typeof Invalid | typeof Internal>;
|
|
268
|
+
export declare const HostGroup: ActionGroup.Group<"host", readonly [Action.Action<"get", Schema.$Record<Schema.String, Schema.Never>, Schema.Struct<{
|
|
269
|
+
readonly id: Schema.String;
|
|
270
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
271
|
+
readonly version: Schema.String;
|
|
272
|
+
readonly runtimeVersion: Schema.String;
|
|
273
|
+
readonly bases: Schema.$Array<Schema.String>;
|
|
274
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "read", undefined>], typeof Invalid | typeof Internal>;
|
|
275
|
+
export declare const Http: ActionHttp.Http<readonly [ActionGroup.Group<"machine", readonly [Action.Action<"list", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
276
|
+
readonly id: Schema.String;
|
|
277
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
278
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
279
|
+
readonly base: Schema.String;
|
|
280
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
281
|
+
readonly cpu: Schema.Int;
|
|
282
|
+
readonly ramMib: Schema.Int;
|
|
283
|
+
readonly diskGib: Schema.Int;
|
|
284
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
285
|
+
readonly action: Schema.Struct<{
|
|
286
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
287
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
288
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
289
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
290
|
+
readonly message: Schema.String;
|
|
291
|
+
}>>;
|
|
292
|
+
}>;
|
|
293
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
294
|
+
readonly host: Schema.String;
|
|
295
|
+
readonly port: Schema.Int;
|
|
296
|
+
}>>;
|
|
297
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
298
|
+
}>>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "read", undefined>, Action.Action<"get", Schema.Struct<{
|
|
299
|
+
readonly id: Schema.String;
|
|
300
|
+
}>, Schema.Struct<{
|
|
301
|
+
readonly id: Schema.String;
|
|
302
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
303
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
304
|
+
readonly base: Schema.String;
|
|
305
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
306
|
+
readonly cpu: Schema.Int;
|
|
307
|
+
readonly ramMib: Schema.Int;
|
|
308
|
+
readonly diskGib: Schema.Int;
|
|
309
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
310
|
+
readonly action: Schema.Struct<{
|
|
311
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
312
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
313
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
314
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
315
|
+
readonly message: Schema.String;
|
|
316
|
+
}>>;
|
|
317
|
+
}>;
|
|
318
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
319
|
+
readonly host: Schema.String;
|
|
320
|
+
readonly port: Schema.Int;
|
|
321
|
+
}>>;
|
|
322
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
323
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "read", undefined>, Action.Action<"create", Schema.Struct<{
|
|
324
|
+
readonly base: Schema.String;
|
|
325
|
+
readonly cpu: Schema.Int;
|
|
326
|
+
readonly ramMib: Schema.Int;
|
|
327
|
+
readonly diskGib: Schema.Int;
|
|
328
|
+
readonly setup: Schema.optionalKey<Schema.Struct<{
|
|
329
|
+
readonly script: Schema.String;
|
|
330
|
+
readonly timeoutSeconds: Schema.Int;
|
|
331
|
+
}>>;
|
|
332
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
333
|
+
readonly id: Schema.String;
|
|
334
|
+
}>, Schema.Struct<{
|
|
335
|
+
readonly id: Schema.String;
|
|
336
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
337
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
338
|
+
readonly base: Schema.String;
|
|
339
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
340
|
+
readonly cpu: Schema.Int;
|
|
341
|
+
readonly ramMib: Schema.Int;
|
|
342
|
+
readonly diskGib: Schema.Int;
|
|
343
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
344
|
+
readonly action: Schema.Struct<{
|
|
345
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
346
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
347
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
348
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
349
|
+
readonly message: Schema.String;
|
|
350
|
+
}>>;
|
|
351
|
+
}>;
|
|
352
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
353
|
+
readonly host: Schema.String;
|
|
354
|
+
readonly port: Schema.Int;
|
|
355
|
+
}>>;
|
|
356
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
357
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>, Action.Action<"start", Schema.Struct<{
|
|
358
|
+
readonly id: Schema.String;
|
|
359
|
+
}>, Schema.Struct<{
|
|
360
|
+
readonly id: Schema.String;
|
|
361
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
362
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
363
|
+
readonly base: Schema.String;
|
|
364
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
365
|
+
readonly cpu: Schema.Int;
|
|
366
|
+
readonly ramMib: Schema.Int;
|
|
367
|
+
readonly diskGib: Schema.Int;
|
|
368
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
369
|
+
readonly action: Schema.Struct<{
|
|
370
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
371
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
372
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
373
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
374
|
+
readonly message: Schema.String;
|
|
375
|
+
}>>;
|
|
376
|
+
}>;
|
|
377
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
378
|
+
readonly host: Schema.String;
|
|
379
|
+
readonly port: Schema.Int;
|
|
380
|
+
}>>;
|
|
381
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
382
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>, Action.Action<"stop", Schema.Struct<{
|
|
383
|
+
readonly id: Schema.String;
|
|
384
|
+
}>, Schema.Struct<{
|
|
385
|
+
readonly id: Schema.String;
|
|
386
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
387
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
388
|
+
readonly base: Schema.String;
|
|
389
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
390
|
+
readonly cpu: Schema.Int;
|
|
391
|
+
readonly ramMib: Schema.Int;
|
|
392
|
+
readonly diskGib: Schema.Int;
|
|
393
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
394
|
+
readonly action: Schema.Struct<{
|
|
395
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
396
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
397
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
398
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
399
|
+
readonly message: Schema.String;
|
|
400
|
+
}>>;
|
|
401
|
+
}>;
|
|
402
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
403
|
+
readonly host: Schema.String;
|
|
404
|
+
readonly port: Schema.Int;
|
|
405
|
+
}>>;
|
|
406
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
407
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>, Action.Action<"delete", Schema.Struct<{
|
|
408
|
+
readonly id: Schema.String;
|
|
409
|
+
}>, Schema.Void, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>, Action.Action<"fork", Schema.Struct<{
|
|
410
|
+
readonly machine: Schema.String;
|
|
411
|
+
readonly name: Schema.String;
|
|
412
|
+
}>, Schema.Struct<{
|
|
413
|
+
readonly id: Schema.String;
|
|
414
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
415
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
416
|
+
readonly base: Schema.String;
|
|
417
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
418
|
+
readonly cpu: Schema.Int;
|
|
419
|
+
readonly ramMib: Schema.Int;
|
|
420
|
+
readonly diskGib: Schema.Int;
|
|
421
|
+
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
422
|
+
readonly action: Schema.Struct<{
|
|
423
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
424
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
425
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
426
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
427
|
+
readonly message: Schema.String;
|
|
428
|
+
}>>;
|
|
429
|
+
}>;
|
|
430
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
431
|
+
readonly host: Schema.String;
|
|
432
|
+
readonly port: Schema.Int;
|
|
433
|
+
}>>;
|
|
434
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
435
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>, Action.Action<"restore", Schema.Struct<{
|
|
436
|
+
readonly checkpoint: Schema.String;
|
|
437
|
+
readonly name: 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 action: Schema.Struct<{
|
|
449
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
450
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
451
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
452
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
453
|
+
readonly message: Schema.String;
|
|
454
|
+
}>>;
|
|
455
|
+
}>;
|
|
456
|
+
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
457
|
+
readonly host: Schema.String;
|
|
458
|
+
readonly port: Schema.Int;
|
|
459
|
+
}>>;
|
|
460
|
+
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
461
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>], typeof Invalid | typeof Internal>, ActionGroup.Group<"checkpoint", readonly [Action.Action<"list", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
462
|
+
readonly id: Schema.String;
|
|
463
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
464
|
+
readonly machine: Schema.String;
|
|
465
|
+
readonly kind: Schema.Literals<readonly ["ram", "disk"]>;
|
|
466
|
+
readonly base: Schema.String;
|
|
467
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
468
|
+
readonly cpu: Schema.Int;
|
|
469
|
+
readonly ramMib: Schema.Int;
|
|
470
|
+
readonly diskGib: Schema.Int;
|
|
471
|
+
readonly action: Schema.Struct<{
|
|
472
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
473
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
474
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
475
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
476
|
+
readonly message: Schema.String;
|
|
477
|
+
}>>;
|
|
478
|
+
}>;
|
|
479
|
+
}>>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "read", undefined>, Action.Action<"get", Schema.Struct<{
|
|
480
|
+
readonly id: Schema.String;
|
|
481
|
+
}>, Schema.Struct<{
|
|
482
|
+
readonly id: Schema.String;
|
|
483
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
484
|
+
readonly machine: Schema.String;
|
|
485
|
+
readonly kind: Schema.Literals<readonly ["ram", "disk"]>;
|
|
486
|
+
readonly base: Schema.String;
|
|
487
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
488
|
+
readonly cpu: Schema.Int;
|
|
489
|
+
readonly ramMib: Schema.Int;
|
|
490
|
+
readonly diskGib: Schema.Int;
|
|
491
|
+
readonly action: Schema.Struct<{
|
|
492
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
493
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
494
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
495
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
496
|
+
readonly message: Schema.String;
|
|
497
|
+
}>>;
|
|
498
|
+
}>;
|
|
499
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "read", undefined>, Action.Action<"capture", Schema.Struct<{
|
|
500
|
+
readonly machine: Schema.String;
|
|
501
|
+
readonly name: Schema.String;
|
|
502
|
+
}>, Schema.Struct<{
|
|
503
|
+
readonly id: Schema.String;
|
|
504
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
505
|
+
readonly machine: Schema.String;
|
|
506
|
+
readonly kind: Schema.Literals<readonly ["ram", "disk"]>;
|
|
507
|
+
readonly base: Schema.String;
|
|
508
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
509
|
+
readonly cpu: Schema.Int;
|
|
510
|
+
readonly ramMib: Schema.Int;
|
|
511
|
+
readonly diskGib: Schema.Int;
|
|
512
|
+
readonly action: Schema.Struct<{
|
|
513
|
+
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
514
|
+
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
515
|
+
readonly error: Schema.optionalKey<Schema.Struct<{
|
|
516
|
+
readonly tag: Schema.Literals<("Capacity" | "Conflict" | "Internal" | "Invalid" | "NotFound" | "Precondition")[]>;
|
|
517
|
+
readonly message: Schema.String;
|
|
518
|
+
}>>;
|
|
519
|
+
}>;
|
|
520
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>, Action.Action<"delete", Schema.Struct<{
|
|
521
|
+
readonly id: Schema.String;
|
|
522
|
+
}>, Schema.Void, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "write", undefined>], typeof Invalid | typeof Internal>, ActionGroup.Group<"host", readonly [Action.Action<"get", Schema.$Record<Schema.String, Schema.Never>, Schema.Struct<{
|
|
523
|
+
readonly id: Schema.String;
|
|
524
|
+
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
525
|
+
readonly version: Schema.String;
|
|
526
|
+
readonly runtimeVersion: Schema.String;
|
|
527
|
+
readonly bases: Schema.$Array<Schema.String>;
|
|
528
|
+
}>, readonly [typeof Invalid, typeof NotFound, typeof Conflict, typeof Precondition, typeof Capacity, typeof Internal], "read", undefined>], typeof Invalid | typeof Internal>], []>;
|
|
529
|
+
//#endregion
|
|
530
|
+
//#region src/ids.d.ts
|
|
531
|
+
/** A host's part of every ID it holds. */
|
|
532
|
+
export declare const HostId: Schema.String;
|
|
533
|
+
/** A machine's or checkpoint's name, unique per host and per resource type. */
|
|
534
|
+
export declare const Name: Schema.String;
|
|
535
|
+
/** The parts of an ID: the host that holds the resource and the resource's name there. */
|
|
536
|
+
export interface IdParts {
|
|
537
|
+
readonly host: string;
|
|
538
|
+
readonly name: string;
|
|
539
|
+
}
|
|
540
|
+
/** A full `<host>_<name>` ID. */
|
|
541
|
+
export declare const Id: Schema.String;
|
|
542
|
+
/** Whether `create`'s target is a full ID rather than a bare name: a name has no `_`. */
|
|
543
|
+
export declare const isId: (target: string) => boolean;
|
|
544
|
+
/** Splits an ID at its `_` into host and name. */
|
|
545
|
+
export declare const parseId: (id: string) => Effect.Effect<IdParts, Invalid>;
|
|
546
|
+
/** Checks a name on its own, before it is joined to a host. */
|
|
547
|
+
export declare const parseName: (name: string) => Effect.Effect<string, Invalid>;
|
|
548
|
+
/** Joins a host ID and a name into the resource's ID, checking both parts and the whole. */
|
|
549
|
+
export declare const formatId: (host: string, name: string) => Effect.Effect<string, Invalid>;
|
|
550
|
+
//#endregion
|
|
551
|
+
//#region src/profile.d.ts
|
|
552
|
+
/** A profile file as read: its fields, with `setup.path` resolved, and its name as `label`. */
|
|
553
|
+
export interface LoadedProfile extends Profile {
|
|
554
|
+
readonly label: string;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Reads the profile file at `file`. Its name, the file name without `.json`, is the machine's
|
|
558
|
+
* `profile` label, and its `setup.path` is resolved against the file's directory. The setup
|
|
559
|
+
* itself is read by whoever sends it, with `readSetup`.
|
|
560
|
+
*/
|
|
561
|
+
export declare const loadProfile: (file: string) => Effect.Effect<LoadedProfile, Invalid, FileSystem.FileSystem | Path.Path>;
|
|
562
|
+
//#endregion
|
|
563
|
+
//#region src/setup.d.ts
|
|
564
|
+
/**
|
|
565
|
+
* Packs a recipe directory into one self-extracting script: a base64 tar that unpacks into a
|
|
566
|
+
* temporary directory, then runs `setup.sh` from there. `COPYFILE_DISABLE=1` and
|
|
567
|
+
* `--no-xattrs` keep macOS `tar` from adding `._*` files and provenance headers.
|
|
568
|
+
*/
|
|
569
|
+
export declare const packRecipe: (directory: string) => Effect.Effect<string, Invalid, FileSystem.FileSystem | ChildProcessSpawner.ChildProcessSpawner>;
|
|
570
|
+
/** Reads a setup: a script file's text, or a recipe directory packed into one script. */
|
|
571
|
+
export declare const readSetup: (path: string) => Effect.Effect<string, Invalid, FileSystem.FileSystem | ChildProcessSpawner.ChildProcessSpawner>;
|
|
572
|
+
//#endregion
|
|
573
|
+
export { ActionName, ActionRecord, Capacity, Checkpoint, ClankerboxError, client_d_exports as Client, Conflict, ConflictKind, CreateRequest, ErrorTag, Host, HostError, HostErrorTag, Internal, Invalid, Machine, MachineSpec, NotFound, Precondition, Profile, Runtime, Setup, SshEndpoint, Unavailable, hostErrors, release, version };
|