@gjermundgaraba/clankerbox-sdk 0.18.0 → 0.18.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.
@@ -498,7 +498,7 @@ const actionsByName = Action.byName(Http.actions);
498
498
  //#endregion
499
499
  //#region src/release.ts
500
500
  /** Also the version of the clankerbox binaries it ships with. */
501
- const version = "0.18.0";
501
+ const version = "0.18.1";
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
@@ -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, pinned to the target's host key through a known-hosts file that lasts as long
133
- * as the scope, which must outlast the ssh. Ports change on fork, restore, and every boat start,
134
- * so read the target anew for each ssh.
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-CbMWwHdT.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-JikMOSHo.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
- const knownHostsLine = (id, hostKey) => {
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 `${id} ${type} ${key}\n`;
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.id,
284
+ target.login.host,
286
285
  ...extra
287
286
  ];
288
287
  /**
289
- * ssh's arguments, pinned to the target's host key through a known-hosts file that lasts as long
290
- * as the scope, which must outlast the ssh. Ports change on fork, restore, and every boat start,
291
- * so read the target anew for each ssh.
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
@@ -1,4 +1,4 @@
1
- import { n as layer$1 } from "./client-CbMWwHdT.mjs";
1
+ import { n as layer$1 } from "./client-JikMOSHo.mjs";
2
2
  import { Layer } from "effect";
3
3
  import * as NodeHttpClient from "@effect/platform-node/NodeHttpClient";
4
4
  //#region src/node.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjermundgaraba/clankerbox-sdk",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "clankerbox's API contract and client library, for Effect",
5
5
  "license": "MIT",
6
6
  "repository": {