@gjermundgaraba/clankerbox-sdk 0.18.0 → 0.18.2
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-CbMWwHdT.mjs → client-VX9csS7I.mjs} +2 -2
- package/dist/index.d.mts +7 -4
- package/dist/index.mjs +10 -10
- package/dist/node.mjs +1 -1
- package/package.json +1 -1
|
@@ -497,8 +497,8 @@ const Http = ActionHttp.make([
|
|
|
497
497
|
const actionsByName = Action.byName(Http.actions);
|
|
498
498
|
//#endregion
|
|
499
499
|
//#region src/release.ts
|
|
500
|
-
/** Also the version of the clankerbox
|
|
501
|
-
const version = "0.18.
|
|
500
|
+
/** Also the version of the clankerbox CLI released with it. */
|
|
501
|
+
const version = "0.18.2";
|
|
502
502
|
/** major.minor: releases that share it speak the same API. */
|
|
503
503
|
const release = (of) => of.split(".").slice(0, 2).join(".");
|
|
504
504
|
/** A host refuses a request whose `release` differs from its own, or that has none. */
|
package/dist/index.d.mts
CHANGED
|
@@ -56,7 +56,7 @@ declare const build: (client: Interface, spec: MachineSpec & {
|
|
|
56
56
|
}, options?: CreateOptions$1) => Effect.Effect<Built, ClankerboxError>;
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/release.d.ts
|
|
59
|
-
/** Also the version of the clankerbox
|
|
59
|
+
/** Also the version of the clankerbox CLI released with it. */
|
|
60
60
|
export declare const version: string;
|
|
61
61
|
/** major.minor: releases that share it speak the same API. */
|
|
62
62
|
export declare const release: (of: string) => string;
|
|
@@ -128,10 +128,13 @@ export interface SshTarget {
|
|
|
128
128
|
* either is `WrongState`, naming what it lacks and why.
|
|
129
129
|
*/
|
|
130
130
|
export declare const sshTarget: (machine: Machine) => Effect.Effect<SshTarget, WrongState>;
|
|
131
|
+
/** A known_hosts line pinning `name` to a host key on record, `<type> <base64>`. */
|
|
132
|
+
export declare const knownHostsLine: (name: string, hostKey: string) => string;
|
|
131
133
|
/**
|
|
132
|
-
* ssh's arguments
|
|
133
|
-
* as the scope, which must outlast the ssh.
|
|
134
|
-
* so
|
|
134
|
+
* ssh's arguments to the target's address, pinned to its host key through a known-hosts file that
|
|
135
|
+
* lasts as long as the scope, which must outlast the ssh. The destination is the address, not the
|
|
136
|
+
* ID, so no ssh_config block for the ID applies. Ports change on fork, restore, and every boat
|
|
137
|
+
* start, so read the target anew for each ssh.
|
|
135
138
|
*/
|
|
136
139
|
export declare const pinnedSsh: (target: SshTarget, user: string, extra: ReadonlyArray<string>) => Effect.Effect<Array<string>, PlatformError.PlatformError, FileSystem.FileSystem | Path.Path | Scope.Scope>;
|
|
137
140
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import { A as parseId, B as NotFound, C as Usage, D as Id, E as HostId, F as ConflictKind, G as Refused, H as NotOffered, I as HostError, J as Unsizable, K as ScriptFailed, L as Internal, M as Capacity, N as ClankerboxError, O as Name, P as Conflict, R as Invalid, S as SshLogin, T as stateLabel, U as NotReady, V as NotMade, W as PinMismatch, X as hostErrors, Y as WrongState, Z as retryable, _ as Machine, a as release, b as Setup, c as Http, d as ActionName, f as ActionRecord, g as Host, h as CreateRequest, i as describeIssues, j as parseName, k as formatId, l as actionsByName, m as Checkpoint, o as version, p as ActionStatus, q as Unavailable, r as describeFileError, s as versionHeader, t as client_exports, u as readTimeout, v as MachineSpec, w as isReady, x as SshEndpoint, y as Runtime, z as Missing } from "./client-
|
|
2
|
+
import { A as parseId, B as NotFound, C as Usage, D as Id, E as HostId, F as ConflictKind, G as Refused, H as NotOffered, I as HostError, J as Unsizable, K as ScriptFailed, L as Internal, M as Capacity, N as ClankerboxError, O as Name, P as Conflict, R as Invalid, S as SshLogin, T as stateLabel, U as NotReady, V as NotMade, W as PinMismatch, X as hostErrors, Y as WrongState, Z as retryable, _ as Machine, a as release, b as Setup, c as Http, d as ActionName, f as ActionRecord, g as Host, h as CreateRequest, i as describeIssues, j as parseName, k as formatId, l as actionsByName, m as Checkpoint, o as version, p as ActionStatus, q as Unavailable, r as describeFileError, s as versionHeader, t as client_exports, u as readTimeout, v as MachineSpec, w as isReady, x as SshEndpoint, y as Runtime, z as Missing } from "./client-VX9csS7I.mjs";
|
|
3
3
|
import { Effect, FileSystem, Option, Path, Predicate, Record, Schema } from "effect";
|
|
4
4
|
import { Base64, Hex } from "effect/encoding";
|
|
5
5
|
//#region src/prebuild.ts
|
|
@@ -263,16 +263,15 @@ const sshTarget = (machine) => {
|
|
|
263
263
|
state
|
|
264
264
|
}));
|
|
265
265
|
};
|
|
266
|
-
|
|
266
|
+
/** A known_hosts line pinning `name` to a host key on record, `<type> <base64>`. */
|
|
267
|
+
const knownHostsLine = (name, hostKey) => {
|
|
267
268
|
const [type = "", key = ""] = hostKey.trim().split(/\s+/u);
|
|
268
|
-
return `${
|
|
269
|
+
return `${name} ${type} ${key}\n`;
|
|
269
270
|
};
|
|
270
271
|
const sshArguments = (target, user, knownHosts, extra) => [
|
|
271
272
|
"-l",
|
|
272
273
|
user,
|
|
273
274
|
"-o",
|
|
274
|
-
`HostName=${target.login.host}`,
|
|
275
|
-
"-o",
|
|
276
275
|
`Port=${target.login.port}`,
|
|
277
276
|
"-o",
|
|
278
277
|
`HostKeyAlias=${target.id}`,
|
|
@@ -282,13 +281,14 @@ const sshArguments = (target, user, knownHosts, extra) => [
|
|
|
282
281
|
"GlobalKnownHostsFile=/dev/null",
|
|
283
282
|
"-o",
|
|
284
283
|
"StrictHostKeyChecking=yes",
|
|
285
|
-
target.
|
|
284
|
+
target.login.host,
|
|
286
285
|
...extra
|
|
287
286
|
];
|
|
288
287
|
/**
|
|
289
|
-
* ssh's arguments
|
|
290
|
-
* as the scope, which must outlast the ssh.
|
|
291
|
-
* so
|
|
288
|
+
* ssh's arguments to the target's address, pinned to its host key through a known-hosts file that
|
|
289
|
+
* lasts as long as the scope, which must outlast the ssh. The destination is the address, not the
|
|
290
|
+
* ID, so no ssh_config block for the ID applies. Ports change on fork, restore, and every boat
|
|
291
|
+
* start, so read the target anew for each ssh.
|
|
292
292
|
*/
|
|
293
293
|
const pinnedSsh = (target, user, extra) => Effect.gen(function* () {
|
|
294
294
|
const fs = yield* FileSystem.FileSystem;
|
|
@@ -306,4 +306,4 @@ const formatMib = (mib) => mib >= 1024 && mib % 512 === 0 ? `${mib / mibPerGib}G
|
|
|
306
306
|
/** As a size flag takes it: `60G`. */
|
|
307
307
|
const formatGib = (gib) => `${gib}G`;
|
|
308
308
|
//#endregion
|
|
309
|
-
export { ActionName, ActionRecord, ActionStatus, Capacity, Checkpoint, ClankerboxError, client_exports as Client, Conflict, ConflictKind, CreateRequest, Host, HostError, HostId, Http, Id, Internal, Invalid, Machine, MachineSpec, Missing, Name, NotFound, NotMade, NotOffered, NotReady, PinMismatch, prebuild_exports as Prebuild, Profile, Refused, Runtime, ScriptFailed, Setup, SshEndpoint, SshLogin, Unavailable, Unsizable, Usage, WrongState, actionsByName, describeFileError, describeIssues, formatGib, formatId, formatMib, hostErrors, isReady, loadProfile, mibPerGib, packRecipe, parseId, parseName, pinnedSsh, readSetup, readTimeout, release, retryable, specRequest, sshTarget, stateLabel, version, versionHeader };
|
|
309
|
+
export { ActionName, ActionRecord, ActionStatus, Capacity, Checkpoint, ClankerboxError, client_exports as Client, Conflict, ConflictKind, CreateRequest, Host, HostError, HostId, Http, Id, Internal, Invalid, Machine, MachineSpec, Missing, Name, NotFound, NotMade, NotOffered, NotReady, PinMismatch, prebuild_exports as Prebuild, Profile, Refused, Runtime, ScriptFailed, Setup, SshEndpoint, SshLogin, Unavailable, Unsizable, Usage, WrongState, actionsByName, describeFileError, describeIssues, formatGib, formatId, formatMib, hostErrors, isReady, knownHostsLine, loadProfile, mibPerGib, packRecipe, parseId, parseName, pinnedSsh, readSetup, readTimeout, release, retryable, specRequest, sshTarget, stateLabel, version, versionHeader };
|
package/dist/node.mjs
CHANGED