@gjermundgaraba/clankerbox-sdk 0.13.0 → 0.15.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.
|
@@ -94,6 +94,13 @@ declare const SshEndpoint: Schema.Struct<{
|
|
|
94
94
|
readonly port: Schema.Int;
|
|
95
95
|
}>;
|
|
96
96
|
type SshEndpoint = typeof SshEndpoint.Type;
|
|
97
|
+
/** Where a running machine's SSH is reached, and the guest user its runtime's logins are for. */
|
|
98
|
+
declare const SshLogin: Schema.Struct<{
|
|
99
|
+
readonly host: Schema.String;
|
|
100
|
+
readonly port: Schema.Int;
|
|
101
|
+
readonly user: Schema.String;
|
|
102
|
+
}>;
|
|
103
|
+
type SshLogin = typeof SshLogin.Type;
|
|
97
104
|
declare const Machine: Schema.Struct<{
|
|
98
105
|
readonly id: Schema.String;
|
|
99
106
|
readonly runtime: Schema.Literals<readonly ["smolvm", "tart", "boat"]>;
|
|
@@ -109,6 +116,11 @@ declare const Machine: Schema.Struct<{
|
|
|
109
116
|
* `unknown` when it couldn't be read.
|
|
110
117
|
*/
|
|
111
118
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
119
|
+
/**
|
|
120
|
+
* Whether its create, fork or restore has made it. One that isn't made, because that action
|
|
121
|
+
* still runs or failed, can only be read, stopped or deleted.
|
|
122
|
+
*/
|
|
123
|
+
readonly made: Schema.Boolean;
|
|
112
124
|
readonly action: Schema.Struct<{
|
|
113
125
|
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
114
126
|
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
@@ -117,11 +129,13 @@ declare const Machine: Schema.Struct<{
|
|
|
117
129
|
readonly message: Schema.String;
|
|
118
130
|
}>>;
|
|
119
131
|
}>;
|
|
132
|
+
/** Only on a running machine whose runtime gives it an endpoint. */
|
|
120
133
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
121
134
|
readonly host: Schema.String;
|
|
122
135
|
readonly port: Schema.Int;
|
|
136
|
+
readonly user: Schema.String;
|
|
123
137
|
}>>;
|
|
124
|
-
/** The guest's SSH host public key, as `<type> <base64
|
|
138
|
+
/** The guest's SSH host public key, as `<type> <base64>`, once preparation has recorded it. */
|
|
125
139
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
126
140
|
}>;
|
|
127
141
|
type Machine = typeof Machine.Type;
|
|
@@ -161,10 +175,29 @@ declare const Host: Schema.Struct<{
|
|
|
161
175
|
readonly bases: Schema.$Array<Schema.String>;
|
|
162
176
|
}>;
|
|
163
177
|
type Host = typeof Host.Type;
|
|
164
|
-
/**
|
|
178
|
+
/**
|
|
179
|
+
* One limit a host's `Capacity` refusals come from, and how much of it is in use, counted as
|
|
180
|
+
* the refusal counts it, so `used` needn't match the host's own machines. Read from the runtime,
|
|
181
|
+
* never stored.
|
|
182
|
+
*/
|
|
183
|
+
declare const Limit: Schema.Struct<{
|
|
184
|
+
readonly host: Schema.String;
|
|
185
|
+
/**
|
|
186
|
+
* `ramMib`: smolvm's RAM budget. `runningVms`: Tart's, Apple's two VMs per Mac.
|
|
187
|
+
* `activeSandboxes` and the `starts` of each rolling window: the boat account's.
|
|
188
|
+
*/
|
|
189
|
+
readonly resource: Schema.Literals<readonly ["ramMib", "runningVms", "activeSandboxes", "startsPerMinute", "startsPerHour", "startsPerDay"]>;
|
|
190
|
+
readonly limit: Schema.Int;
|
|
191
|
+
readonly used: Schema.Int;
|
|
192
|
+
}>;
|
|
193
|
+
type Limit = typeof Limit.Type;
|
|
194
|
+
/**
|
|
195
|
+
* A setup script and how long it may run, the host's default when it doesn't say. Nothing logs
|
|
196
|
+
* the script: it can carry secrets.
|
|
197
|
+
*/
|
|
165
198
|
declare const Setup: Schema.Struct<{
|
|
166
199
|
readonly script: Schema.String;
|
|
167
|
-
readonly timeoutSeconds: Schema.Int
|
|
200
|
+
readonly timeoutSeconds: Schema.optionalKey<Schema.Int>;
|
|
168
201
|
}>;
|
|
169
202
|
type Setup = typeof Setup.Type;
|
|
170
203
|
/**
|
|
@@ -179,7 +212,7 @@ declare const MachineSpec: Schema.Struct<{
|
|
|
179
212
|
diskGib: Schema.Int;
|
|
180
213
|
setup: Schema.optionalKey<Schema.Struct<{
|
|
181
214
|
readonly script: Schema.String;
|
|
182
|
-
readonly timeoutSeconds: Schema.Int
|
|
215
|
+
readonly timeoutSeconds: Schema.optionalKey<Schema.Int>;
|
|
183
216
|
}>>;
|
|
184
217
|
profile: Schema.optionalKey<Schema.String>;
|
|
185
218
|
}>;
|
|
@@ -195,7 +228,7 @@ declare const CreateRequest: Schema.Struct<{
|
|
|
195
228
|
readonly diskGib: Schema.Int;
|
|
196
229
|
readonly setup: Schema.optionalKey<Schema.Struct<{
|
|
197
230
|
readonly script: Schema.String;
|
|
198
|
-
readonly timeoutSeconds: Schema.Int
|
|
231
|
+
readonly timeoutSeconds: Schema.optionalKey<Schema.Int>;
|
|
199
232
|
}>>;
|
|
200
233
|
readonly profile: Schema.optionalKey<Schema.String>;
|
|
201
234
|
readonly id: Schema.String;
|
|
@@ -203,9 +236,8 @@ declare const CreateRequest: Schema.Struct<{
|
|
|
203
236
|
type CreateRequest = typeof CreateRequest.Type;
|
|
204
237
|
/**
|
|
205
238
|
* A profile file: a client-side file that fills in a create request. `setup.path` is a script
|
|
206
|
-
* file or a recipe directory, relative to the profile file
|
|
207
|
-
*
|
|
208
|
-
* instead of by base.
|
|
239
|
+
* file or a recipe directory, relative to the profile file; without a `timeoutSeconds` the host's
|
|
240
|
+
* default applies. `host` places the create on that host instead of by base.
|
|
209
241
|
*/
|
|
210
242
|
declare const Profile: Schema.Struct<{
|
|
211
243
|
readonly base: Schema.String;
|
|
@@ -214,7 +246,7 @@ declare const Profile: Schema.Struct<{
|
|
|
214
246
|
readonly diskGib: Schema.Int;
|
|
215
247
|
readonly setup: Schema.optionalKey<Schema.Struct<{
|
|
216
248
|
readonly path: Schema.String;
|
|
217
|
-
readonly timeoutSeconds: Schema.Int
|
|
249
|
+
readonly timeoutSeconds: Schema.optionalKey<Schema.Int>;
|
|
218
250
|
}>>;
|
|
219
251
|
readonly host: Schema.optionalKey<Schema.String>;
|
|
220
252
|
}>;
|
|
@@ -261,6 +293,8 @@ interface Interface {
|
|
|
261
293
|
readonly hosts: Effect.Effect<Gathered<Host>>;
|
|
262
294
|
readonly machines: Effect.Effect<Gathered<Machine>>;
|
|
263
295
|
readonly checkpoints: Effect.Effect<Gathered<Checkpoint>>;
|
|
296
|
+
/** Every host's limits; a host whose runtime couldn't be read is among the unreachable. */
|
|
297
|
+
readonly capacity: Effect.Effect<Gathered<Limit>>;
|
|
264
298
|
readonly machine: (id: string) => Effect.Effect<Machine, ClankerboxError>;
|
|
265
299
|
readonly checkpoint: (id: string) => Effect.Effect<Checkpoint, ClankerboxError>;
|
|
266
300
|
/**
|
|
@@ -286,4 +320,4 @@ declare class Client extends Client_base {}
|
|
|
286
320
|
*/
|
|
287
321
|
declare const make: (hosts: ReadonlyArray<HostEntry>, options?: Options) => Effect.Effect<Interface, Invalid, HttpClient.HttpClient>;
|
|
288
322
|
//#endregion
|
|
289
|
-
export {
|
|
323
|
+
export { Precondition as A, ConflictKind as C, Internal as D, HostErrorTag as E, hostErrors as M, Invalid as O, Conflict as S, HostError as T, SshLogin as _, ActionName as a, Capacity as b, CreateRequest as c, Machine as d, MachineSpec as f, SshEndpoint as g, Setup as h, client_d_exports as i, Unavailable as j, NotFound as k, Host as l, Runtime as m, HostEntry as n, ActionRecord as o, Profile as p, Options as r, Checkpoint as s, Client as t, Limit as u, release as v, ErrorTag as w, ClankerboxError as x, version as y };
|
|
@@ -129,7 +129,7 @@ const formatId = (host, name) => {
|
|
|
129
129
|
};
|
|
130
130
|
//#endregion
|
|
131
131
|
//#region package.json
|
|
132
|
-
var version$1 = "0.
|
|
132
|
+
var version$1 = "0.15.0";
|
|
133
133
|
//#endregion
|
|
134
134
|
//#region src/resources.ts
|
|
135
135
|
/** The resources a host reports: machines, checkpoints and the host itself. */
|
|
@@ -173,6 +173,11 @@ const SshEndpoint = Schema.Struct({
|
|
|
173
173
|
maximum: 65535
|
|
174
174
|
}))
|
|
175
175
|
});
|
|
176
|
+
/** Where a running machine's SSH is reached, and the guest user its runtime's logins are for. */
|
|
177
|
+
const SshLogin = Schema.Struct({
|
|
178
|
+
user: Schema.String,
|
|
179
|
+
...SshEndpoint.fields
|
|
180
|
+
});
|
|
176
181
|
const Machine = Schema.Struct({
|
|
177
182
|
id: Id,
|
|
178
183
|
runtime: Runtime,
|
|
@@ -193,9 +198,15 @@ const Machine = Schema.Struct({
|
|
|
193
198
|
"missing",
|
|
194
199
|
"unknown"
|
|
195
200
|
]),
|
|
201
|
+
/**
|
|
202
|
+
* Whether its create, fork or restore has made it. One that isn't made, because that action
|
|
203
|
+
* still runs or failed, can only be read, stopped or deleted.
|
|
204
|
+
*/
|
|
205
|
+
made: Schema.Boolean,
|
|
196
206
|
action: ActionRecord,
|
|
197
|
-
|
|
198
|
-
|
|
207
|
+
/** Only on a running machine whose runtime gives it an endpoint. */
|
|
208
|
+
ssh: Schema.optionalKey(SshLogin),
|
|
209
|
+
/** The guest's SSH host public key, as `<type> <base64>`, once preparation has recorded it. */
|
|
199
210
|
hostKey: Schema.optionalKey(Schema.String)
|
|
200
211
|
}).annotate({ identifier: "Machine" });
|
|
201
212
|
const Checkpoint = Schema.Struct({
|
|
@@ -225,10 +236,35 @@ const Host = Schema.Struct({
|
|
|
225
236
|
runtimeVersion: Schema.String,
|
|
226
237
|
bases: Schema.Array(Schema.String)
|
|
227
238
|
}).annotate({ identifier: "Host" });
|
|
228
|
-
/**
|
|
239
|
+
/**
|
|
240
|
+
* One limit a host's `Capacity` refusals come from, and how much of it is in use, counted as
|
|
241
|
+
* the refusal counts it, so `used` needn't match the host's own machines. Read from the runtime,
|
|
242
|
+
* never stored.
|
|
243
|
+
*/
|
|
244
|
+
const Limit = Schema.Struct({
|
|
245
|
+
host: HostId,
|
|
246
|
+
/**
|
|
247
|
+
* `ramMib`: smolvm's RAM budget. `runningVms`: Tart's, Apple's two VMs per Mac.
|
|
248
|
+
* `activeSandboxes` and the `starts` of each rolling window: the boat account's.
|
|
249
|
+
*/
|
|
250
|
+
resource: Schema.Literals([
|
|
251
|
+
"ramMib",
|
|
252
|
+
"runningVms",
|
|
253
|
+
"activeSandboxes",
|
|
254
|
+
"startsPerMinute",
|
|
255
|
+
"startsPerHour",
|
|
256
|
+
"startsPerDay"
|
|
257
|
+
]),
|
|
258
|
+
limit: Schema.Int,
|
|
259
|
+
used: Schema.Int
|
|
260
|
+
}).annotate({ identifier: "Limit" });
|
|
261
|
+
/**
|
|
262
|
+
* A setup script and how long it may run, the host's default when it doesn't say. Nothing logs
|
|
263
|
+
* the script: it can carry secrets.
|
|
264
|
+
*/
|
|
229
265
|
const Setup = Schema.Struct({
|
|
230
266
|
script: Schema.String,
|
|
231
|
-
timeoutSeconds: Size
|
|
267
|
+
timeoutSeconds: Schema.optionalKey(Size)
|
|
232
268
|
});
|
|
233
269
|
const specFields = {
|
|
234
270
|
base: Schema.String,
|
|
@@ -254,9 +290,8 @@ const CreateRequest = Schema.Struct({
|
|
|
254
290
|
});
|
|
255
291
|
/**
|
|
256
292
|
* A profile file: a client-side file that fills in a create request. `setup.path` is a script
|
|
257
|
-
* file or a recipe directory, relative to the profile file
|
|
258
|
-
*
|
|
259
|
-
* instead of by base.
|
|
293
|
+
* file or a recipe directory, relative to the profile file; without a `timeoutSeconds` the host's
|
|
294
|
+
* default applies. `host` places the create on that host instead of by base.
|
|
260
295
|
*/
|
|
261
296
|
const Profile = Schema.Struct({
|
|
262
297
|
base: specFields.base,
|
|
@@ -265,7 +300,7 @@ const Profile = Schema.Struct({
|
|
|
265
300
|
diskGib: specFields.diskGib,
|
|
266
301
|
setup: Schema.optionalKey(Schema.Struct({
|
|
267
302
|
path: Schema.String,
|
|
268
|
-
timeoutSeconds: Size
|
|
303
|
+
timeoutSeconds: Schema.optionalKey(Size)
|
|
269
304
|
})),
|
|
270
305
|
host: Schema.optionalKey(HostId)
|
|
271
306
|
});
|
|
@@ -383,6 +418,11 @@ const Http = ActionHttp.make([
|
|
|
383
418
|
...read,
|
|
384
419
|
description: "Read the host: its runtime, versions and bases.",
|
|
385
420
|
success: Host
|
|
421
|
+
}),
|
|
422
|
+
Action.make("getCapacity", {
|
|
423
|
+
...read,
|
|
424
|
+
description: "Read the host's limits and how much of each is in use. It fails when the runtime can't be read.",
|
|
425
|
+
success: Schema.Array(Limit)
|
|
386
426
|
})
|
|
387
427
|
], { prefix: "/api" });
|
|
388
428
|
//#endregion
|
|
@@ -559,6 +599,7 @@ const make = (hosts, options) => Effect.gen(function* () {
|
|
|
559
599
|
hosts: gather((route) => Effect.map(readHost(route), (host) => [host])),
|
|
560
600
|
machines: gather((route) => ask(route, actions.listMachines, "list machines", (api) => api.listMachines())),
|
|
561
601
|
checkpoints: gather((route) => ask(route, actions.listCheckpoints, "list checkpoints", (api) => api.listCheckpoints())),
|
|
602
|
+
capacity: gather((route) => ask(route, actions.getCapacity, "get capacity", (api) => api.getCapacity())),
|
|
562
603
|
machine: (id) => byId(id, actions.getMachine, `get ${id}`, (api) => api.getMachine({ id })),
|
|
563
604
|
checkpoint: (id) => byId(id, actions.getCheckpoint, `get ${id}`, (api) => api.getCheckpoint({ id })),
|
|
564
605
|
create,
|
|
@@ -581,4 +622,4 @@ const make = (hosts, options) => Effect.gen(function* () {
|
|
|
581
622
|
};
|
|
582
623
|
});
|
|
583
624
|
//#endregion
|
|
584
|
-
export {
|
|
625
|
+
export { ConflictKind as A, Id as C, parseName as D, parseId as E, NotFound as F, Precondition as I, Unavailable as L, HostErrorTag as M, Internal as N, Capacity as O, Invalid as P, hostErrors as R, HostId as S, formatId as T, Setup as _, readTimeout as a, release as b, ActionRecord as c, Host as d, Limit as f, Runtime as g, Profile as h, Http as i, ErrorTag as j, Conflict as k, Checkpoint as l, MachineSpec as m, client_exports as n, versionHeader as o, Machine as p, make as r, ActionName as s, Client as t, CreateRequest as u, SshEndpoint as v, Name as w, version as x, SshLogin as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as Precondition, C as ConflictKind, D as Internal, E as HostErrorTag, M as hostErrors, O as Invalid, S as Conflict, T as HostError, _ as SshLogin, a as ActionName, b as Capacity, c as CreateRequest, d as Machine, f as MachineSpec, g as SshEndpoint, h as Setup, i as client_d_exports, j as Unavailable, k as NotFound, l as Host, m as Runtime, o as ActionRecord, p as Profile, s as Checkpoint, u as Limit, v as release, w as ErrorTag, x as ClankerboxError, y as version } from "./client-SX6jTU1R.mjs";
|
|
2
2
|
import * as Action from "@gjermundgaraba/effect-actions/Action";
|
|
3
3
|
import * as ActionHttp from "@gjermundgaraba/effect-actions/ActionHttp";
|
|
4
4
|
import { Duration, Effect, FileSystem, Path, Schema } from "effect";
|
|
@@ -25,6 +25,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
25
25
|
readonly ramMib: Schema.Int;
|
|
26
26
|
readonly diskGib: Schema.Int;
|
|
27
27
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
28
|
+
readonly made: Schema.Boolean;
|
|
28
29
|
readonly action: Schema.Struct<{
|
|
29
30
|
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
30
31
|
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
@@ -36,6 +37,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
36
37
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
37
38
|
readonly host: Schema.String;
|
|
38
39
|
readonly port: Schema.Int;
|
|
40
|
+
readonly user: Schema.String;
|
|
39
41
|
}>>;
|
|
40
42
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
41
43
|
}>>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Precondition | typeof Capacity | typeof Internal)[], true, typeof Action.Anyone>, Action.Action<"getMachine", Schema.Struct<{
|
|
@@ -50,6 +52,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
50
52
|
readonly ramMib: Schema.Int;
|
|
51
53
|
readonly diskGib: Schema.Int;
|
|
52
54
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
55
|
+
readonly made: Schema.Boolean;
|
|
53
56
|
readonly action: Schema.Struct<{
|
|
54
57
|
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
55
58
|
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
@@ -61,6 +64,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
61
64
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
62
65
|
readonly host: Schema.String;
|
|
63
66
|
readonly port: Schema.Int;
|
|
67
|
+
readonly user: Schema.String;
|
|
64
68
|
}>>;
|
|
65
69
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
66
70
|
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Precondition | typeof Capacity | typeof Internal)[], true, typeof Action.Anyone>, Action.Action<"createMachine", Schema.Struct<{
|
|
@@ -70,7 +74,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
70
74
|
readonly diskGib: Schema.Int;
|
|
71
75
|
readonly setup: Schema.optionalKey<Schema.Struct<{
|
|
72
76
|
readonly script: Schema.String;
|
|
73
|
-
readonly timeoutSeconds: Schema.Int
|
|
77
|
+
readonly timeoutSeconds: Schema.optionalKey<Schema.Int>;
|
|
74
78
|
}>>;
|
|
75
79
|
readonly profile: Schema.optionalKey<Schema.String>;
|
|
76
80
|
readonly id: Schema.String;
|
|
@@ -84,6 +88,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
84
88
|
readonly ramMib: Schema.Int;
|
|
85
89
|
readonly diskGib: Schema.Int;
|
|
86
90
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
91
|
+
readonly made: Schema.Boolean;
|
|
87
92
|
readonly action: Schema.Struct<{
|
|
88
93
|
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
89
94
|
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
@@ -95,6 +100,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
95
100
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
96
101
|
readonly host: Schema.String;
|
|
97
102
|
readonly port: Schema.Int;
|
|
103
|
+
readonly user: Schema.String;
|
|
98
104
|
}>>;
|
|
99
105
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
100
106
|
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Precondition | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>, Action.Action<"startMachine", Schema.Struct<{
|
|
@@ -109,6 +115,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
109
115
|
readonly ramMib: Schema.Int;
|
|
110
116
|
readonly diskGib: Schema.Int;
|
|
111
117
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
118
|
+
readonly made: Schema.Boolean;
|
|
112
119
|
readonly action: Schema.Struct<{
|
|
113
120
|
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
114
121
|
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
@@ -120,6 +127,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
120
127
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
121
128
|
readonly host: Schema.String;
|
|
122
129
|
readonly port: Schema.Int;
|
|
130
|
+
readonly user: Schema.String;
|
|
123
131
|
}>>;
|
|
124
132
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
125
133
|
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Precondition | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>, Action.Action<"stopMachine", Schema.Struct<{
|
|
@@ -134,6 +142,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
134
142
|
readonly ramMib: Schema.Int;
|
|
135
143
|
readonly diskGib: Schema.Int;
|
|
136
144
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
145
|
+
readonly made: Schema.Boolean;
|
|
137
146
|
readonly action: Schema.Struct<{
|
|
138
147
|
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
139
148
|
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
@@ -145,6 +154,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
145
154
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
146
155
|
readonly host: Schema.String;
|
|
147
156
|
readonly port: Schema.Int;
|
|
157
|
+
readonly user: Schema.String;
|
|
148
158
|
}>>;
|
|
149
159
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
150
160
|
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Precondition | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>, Action.Action<"deleteMachine", Schema.Struct<{
|
|
@@ -162,6 +172,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
162
172
|
readonly ramMib: Schema.Int;
|
|
163
173
|
readonly diskGib: Schema.Int;
|
|
164
174
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
175
|
+
readonly made: Schema.Boolean;
|
|
165
176
|
readonly action: Schema.Struct<{
|
|
166
177
|
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
167
178
|
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
@@ -173,6 +184,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
173
184
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
174
185
|
readonly host: Schema.String;
|
|
175
186
|
readonly port: Schema.Int;
|
|
187
|
+
readonly user: Schema.String;
|
|
176
188
|
}>>;
|
|
177
189
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
178
190
|
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Precondition | typeof Capacity | typeof Internal)[], false, typeof Action.Anyone>, Action.Action<"restoreMachine", Schema.Struct<{
|
|
@@ -188,6 +200,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
188
200
|
readonly ramMib: Schema.Int;
|
|
189
201
|
readonly diskGib: Schema.Int;
|
|
190
202
|
readonly state: Schema.Literals<readonly ["running", "stopped", "missing", "unknown"]>;
|
|
203
|
+
readonly made: Schema.Boolean;
|
|
191
204
|
readonly action: Schema.Struct<{
|
|
192
205
|
readonly name: Schema.Literals<readonly ["create", "start", "stop", "delete", "fork", "restore", "capture"]>;
|
|
193
206
|
readonly status: Schema.Literals<readonly ["running", "failed", "done"]>;
|
|
@@ -199,6 +212,7 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
199
212
|
readonly ssh: Schema.optionalKey<Schema.Struct<{
|
|
200
213
|
readonly host: Schema.String;
|
|
201
214
|
readonly port: Schema.Int;
|
|
215
|
+
readonly user: Schema.String;
|
|
202
216
|
}>>;
|
|
203
217
|
readonly hostKey: Schema.optionalKey<Schema.String>;
|
|
204
218
|
}>, 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<{
|
|
@@ -268,7 +282,12 @@ export declare const Http: ActionHttp.Binding<readonly [Action.Action<"listMachi
|
|
|
268
282
|
readonly version: Schema.String;
|
|
269
283
|
readonly runtimeVersion: Schema.String;
|
|
270
284
|
readonly bases: Schema.$Array<Schema.String>;
|
|
271
|
-
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Precondition | typeof Capacity | typeof Internal)[], true, typeof Action.Anyone
|
|
285
|
+
}>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Precondition | typeof Capacity | typeof Internal)[], true, typeof Action.Anyone>, Action.Action<"getCapacity", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
286
|
+
readonly host: Schema.String;
|
|
287
|
+
readonly resource: Schema.Literals<readonly ["ramMib", "runningVms", "activeSandboxes", "startsPerMinute", "startsPerHour", "startsPerDay"]>;
|
|
288
|
+
readonly limit: Schema.Int;
|
|
289
|
+
readonly used: Schema.Int;
|
|
290
|
+
}>>, readonly (typeof Invalid | typeof NotFound | typeof Conflict | typeof Precondition | typeof Capacity | typeof Internal)[], true, typeof Action.Anyone>], [], undefined>;
|
|
272
291
|
//#endregion
|
|
273
292
|
//#region src/ids.d.ts
|
|
274
293
|
/** A host's part of every ID it holds. */
|
|
@@ -311,4 +330,4 @@ export declare const packRecipe: (directory: string) => Effect.Effect<string, In
|
|
|
311
330
|
/** Reads a setup: a script file's text, or a recipe directory packed into one script. */
|
|
312
331
|
export declare const readSetup: (path: string) => Effect.Effect<string, Invalid, FileSystem.FileSystem | ChildProcessSpawner.ChildProcessSpawner>;
|
|
313
332
|
//#endregion
|
|
314
|
-
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 };
|
|
333
|
+
export { ActionName, ActionRecord, Capacity, Checkpoint, ClankerboxError, client_d_exports as Client, Conflict, ConflictKind, CreateRequest, ErrorTag, Host, HostError, HostErrorTag, Internal, Invalid, Limit, Machine, MachineSpec, NotFound, Precondition, Profile, Runtime, Setup, SshEndpoint, SshLogin, Unavailable, hostErrors, release, version };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as ConflictKind, C as Id, D as parseName, E as parseId, F as NotFound, I as Precondition, L as Unavailable, M as HostErrorTag, N as Internal, O as Capacity, P as Invalid, R as hostErrors, S as HostId, T as formatId, _ as Setup, a as readTimeout, b as release, c as ActionRecord, d as Host, f as Limit, g as Runtime, h as Profile, i as Http, j as ErrorTag, k as Conflict, l as Checkpoint, m as MachineSpec, n as client_exports, o as versionHeader, p as Machine, s as ActionName, u as CreateRequest, v as SshEndpoint, w as Name, x as version, y as SshLogin } from "./client-VNMPU7ER.mjs";
|
|
2
2
|
import { Effect, FileSystem, Path, Predicate, Schema, Stream } from "effect";
|
|
3
3
|
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
4
4
|
//#region src/profile.ts
|
|
@@ -103,4 +103,4 @@ const readSetup = (path) => Effect.gen(function* () {
|
|
|
103
103
|
return yield* fs.readFileString(path);
|
|
104
104
|
}).pipe(Effect.catchTag("PlatformError", (error) => Effect.fail(new Invalid({ message: `couldn't read setup ${path}: ${error.message}` }))));
|
|
105
105
|
//#endregion
|
|
106
|
-
export { ActionName, ActionRecord, Capacity, Checkpoint, client_exports as Client, Conflict, ConflictKind, CreateRequest, ErrorTag, Host, HostErrorTag, HostId, Http, Id, Internal, Invalid, Machine, MachineSpec, Name, NotFound, Precondition, Profile, Runtime, Setup, SshEndpoint, Unavailable, formatId, hostErrors, loadProfile, packRecipe, parseId, parseName, readSetup, readTimeout, release, version, versionHeader };
|
|
106
|
+
export { ActionName, ActionRecord, Capacity, Checkpoint, client_exports as Client, Conflict, ConflictKind, CreateRequest, ErrorTag, Host, HostErrorTag, HostId, Http, Id, Internal, Invalid, Limit, Machine, MachineSpec, Name, NotFound, Precondition, Profile, Runtime, Setup, SshEndpoint, SshLogin, Unavailable, formatId, hostErrors, loadProfile, packRecipe, parseId, parseName, readSetup, readTimeout, release, version, versionHeader };
|
package/dist/node.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { O as Invalid, n as HostEntry, r as Options, t as Client } from "./client-SX6jTU1R.mjs";
|
|
2
2
|
import { Layer } from "effect";
|
|
3
3
|
//#region src/node.d.ts
|
|
4
4
|
/** Node's `http` module sets no timeout of its own: a mutation can run for hours. */
|
package/dist/node.mjs
CHANGED