@homeflare/alchemy 0.20.0 → 0.22.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/README.md +27 -0
- package/dist/caddy/access-forward-auth.d.ts +56 -0
- package/dist/caddy/access-forward-auth.d.ts.map +1 -0
- package/dist/caddy/index.d.ts +6 -0
- package/dist/caddy/index.d.ts.map +1 -1
- package/dist/caddy/index.js +169 -75
- package/dist/caddy/index.js.map +10 -7
- package/dist/cloudflare/mcp-server-api.d.ts +135 -0
- package/dist/cloudflare/mcp-server-api.d.ts.map +1 -0
- package/dist/cloudflare/mcp-server-form.d.ts +116 -0
- package/dist/cloudflare/mcp-server-form.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/launchd/file-converge.d.ts +70 -0
- package/dist/launchd/file-converge.d.ts.map +1 -0
- package/dist/launchd/file-identity.d.ts +32 -0
- package/dist/launchd/file-identity.d.ts.map +1 -0
- package/dist/launchd/host-file-form.d.ts +2 -0
- package/dist/launchd/host-file-form.d.ts.map +1 -1
- package/dist/launchd/host-file-lifecycle.d.ts +11 -24
- package/dist/launchd/host-file-lifecycle.d.ts.map +1 -1
- package/dist/launchd/host-file.d.ts.map +1 -1
- package/dist/launchd/index.d.ts +2 -0
- package/dist/launchd/index.d.ts.map +1 -1
- package/dist/launchd/index.js +225 -120
- package/dist/launchd/index.js.map +13 -10
- package/dist/launchd/local-runner.d.ts.map +1 -1
- package/dist/launchd/port-claims.d.ts +31 -0
- package/dist/launchd/port-claims.d.ts.map +1 -0
- package/dist/launchd/runner.d.ts +17 -2
- package/dist/launchd/runner.d.ts.map +1 -1
- package/dist/launchd/sudo-runner.d.ts +11 -0
- package/dist/launchd/sudo-runner.d.ts.map +1 -1
- package/dist/linux/index.js.map +3 -3
- package/dist/linux/sudo-listing.d.ts +47 -0
- package/dist/linux/sudo-listing.d.ts.map +1 -0
- package/dist/proxmox/credential-literals.d.ts +1 -1
- package/dist/proxmox/credential-literals.d.ts.map +1 -1
- package/dist/proxmox/generated/pbs/nodes-node.d.ts +1 -1
- package/dist/proxmox/generated/pbs/nodes-node.d.ts.map +1 -1
- package/dist/proxmox/generated/pbs.d.ts +7 -0
- package/dist/proxmox/generated/pbs.d.ts.map +1 -1
- package/dist/proxmox/generated/pve.d.ts +7 -0
- package/dist/proxmox/generated/pve.d.ts.map +1 -1
- package/dist/proxmox/index.d.ts +1 -1
- package/dist/proxmox/index.d.ts.map +1 -1
- package/dist/proxmox/index.js +2 -2
- package/dist/proxmox/index.js.map +9 -9
- package/dist/proxmox/pbs-notification-target-form.d.ts +1 -1
- package/dist/proxmox/pbs-notification-target-form.d.ts.map +1 -1
- package/dist/proxmox/pbs-notification-target.d.ts +1 -1
- package/dist/proxmox/pbs-notification-target.d.ts.map +1 -1
- package/dist/release/archive.d.ts +11 -0
- package/dist/release/archive.d.ts.map +1 -0
- package/dist/release/binary-claim.d.ts +53 -0
- package/dist/release/binary-claim.d.ts.map +1 -0
- package/dist/release/binary-diff.d.ts +38 -0
- package/dist/release/binary-diff.d.ts.map +1 -0
- package/dist/release/binary-form.d.ts +118 -0
- package/dist/release/binary-form.d.ts.map +1 -0
- package/dist/release/binary-lifecycle.d.ts +55 -0
- package/dist/release/binary-lifecycle.d.ts.map +1 -0
- package/dist/release/binary-read.d.ts +11 -0
- package/dist/release/binary-read.d.ts.map +1 -0
- package/dist/release/binary.d.ts +68 -0
- package/dist/release/binary.d.ts.map +1 -0
- package/dist/release/catalog.d.ts +113 -0
- package/dist/release/catalog.d.ts.map +1 -0
- package/dist/release/checksums.d.ts +22 -0
- package/dist/release/checksums.d.ts.map +1 -0
- package/dist/release/declared-pins.d.ts +4 -0
- package/dist/release/declared-pins.d.ts.map +1 -0
- package/dist/release/download.d.ts +44 -0
- package/dist/release/download.d.ts.map +1 -0
- package/dist/release/fake-deploy.d.ts +48 -0
- package/dist/release/fake-deploy.d.ts.map +1 -0
- package/dist/release/fake-engine.d.ts +8 -0
- package/dist/release/fake-engine.d.ts.map +1 -0
- package/dist/release/fake-install.d.ts +39 -0
- package/dist/release/fake-install.d.ts.map +1 -0
- package/dist/release/fake-provider.d.ts +58 -0
- package/dist/release/fake-provider.d.ts.map +1 -0
- package/dist/release/fake-release.d.ts +95 -0
- package/dist/release/fake-release.d.ts.map +1 -0
- package/dist/release/index.d.ts +25 -0
- package/dist/release/index.d.ts.map +1 -0
- package/dist/release/index.js +1425 -0
- package/dist/release/index.js.map +36 -0
- package/dist/release/openbao.d.ts +35 -0
- package/dist/release/openbao.d.ts.map +1 -0
- package/dist/release/providers.d.ts +19 -0
- package/dist/release/providers.d.ts.map +1 -0
- package/dist/release/refused.d.ts +39 -0
- package/dist/release/refused.d.ts.map +1 -0
- package/dist/release/tar.d.ts +14 -0
- package/dist/release/tar.d.ts.map +1 -0
- package/dist/release/victoria.d.ts +36 -0
- package/dist/release/victoria.d.ts.map +1 -0
- package/dist/{proxmox → secrets}/write-only.d.ts.map +1 -1
- package/docs/launchd-ports.md +109 -0
- package/docs/launchd.md +5 -0
- package/docs/release-binary-catalogs.md +138 -0
- package/docs/release-binary-measured.md +163 -0
- package/docs/release-binary-openbao.md +151 -0
- package/docs/release-binary-refusals.md +57 -0
- package/docs/release-binary-upstream.md +163 -0
- package/docs/release-binary.md +165 -0
- package/package.json +5 -1
- package/src/caddy/access-forward-auth.test.ts +63 -0
- package/src/caddy/access-forward-auth.ts +120 -0
- package/src/caddy/index.ts +10 -0
- package/src/caddy/providers.test.ts +4 -0
- package/src/cloudflare/mcp-server-api.ts +294 -0
- package/src/cloudflare/mcp-server-form.ts +219 -0
- package/src/index.ts +1 -0
- package/src/launchd/file-converge.ts +233 -0
- package/src/launchd/file-identity.ts +69 -0
- package/src/launchd/host-file-alias.test.ts +65 -0
- package/src/launchd/host-file-form.ts +2 -1
- package/src/launchd/host-file-lifecycle.ts +25 -144
- package/src/launchd/host-file.ts +8 -2
- package/src/launchd/index.ts +2 -0
- package/src/launchd/local-runner.test.ts +12 -1
- package/src/launchd/local-runner.ts +2 -0
- package/src/launchd/port-claims.test.ts +124 -0
- package/src/launchd/port-claims.ts +102 -0
- package/src/launchd/providers.test.ts +3 -0
- package/src/launchd/runner.ts +17 -2
- package/src/launchd/sudo-runner.ts +11 -0
- package/src/linux/sudo-listing.ts +122 -0
- package/src/proxmox/credential-literals.ts +1 -1
- package/src/proxmox/generated/pbs/nodes-node.ts +1 -1
- package/src/proxmox/generated/pbs.ts +7 -0
- package/src/proxmox/generated/pve.ts +7 -0
- package/src/proxmox/index.ts +1 -1
- package/src/proxmox/pbs-notification-target-form.ts +1 -1
- package/src/proxmox/pbs-notification-target-lifecycle.ts +1 -1
- package/src/proxmox/pbs-notification-target-wire.ts +1 -1
- package/src/proxmox/pbs-notification-target.ts +1 -1
- package/src/release/adopt-parity.test.ts +106 -0
- package/src/release/apply-pins.test.ts +128 -0
- package/src/release/archive.ts +94 -0
- package/src/release/binary-alias.test.ts +109 -0
- package/src/release/binary-claim.ts +80 -0
- package/src/release/binary-claims.test.ts +47 -0
- package/src/release/binary-diff.ts +73 -0
- package/src/release/binary-form.ts +229 -0
- package/src/release/binary-lifecycle.test.ts +90 -0
- package/src/release/binary-lifecycle.ts +202 -0
- package/src/release/binary-read.ts +55 -0
- package/src/release/binary-refusals.test.ts +192 -0
- package/src/release/binary-sudo.test.ts +93 -0
- package/src/release/binary.ts +181 -0
- package/src/release/catalog.test.ts +167 -0
- package/src/release/catalog.ts +238 -0
- package/src/release/checksums.test.ts +35 -0
- package/src/release/checksums.ts +43 -0
- package/src/release/declared-pins.ts +39 -0
- package/src/release/download.test.ts +138 -0
- package/src/release/download.ts +110 -0
- package/src/release/error-channel.test.ts +69 -0
- package/src/release/fake-deploy.ts +87 -0
- package/src/release/fake-engine.ts +50 -0
- package/src/release/fake-install.ts +59 -0
- package/src/release/fake-provider.ts +68 -0
- package/src/release/fake-release.ts +185 -0
- package/src/release/fixtures/openbao/checksums.txt +83 -0
- package/src/release/fixtures/openbao/checksums.txt.gpgsig +0 -0
- package/src/release/fixtures/openbao/darwin-assets.txt +12 -0
- package/src/release/fixtures/openbao/openbao-gpg-pub-20240618.asc +109 -0
- package/src/release/fixtures/victoria/darwin-arm64-assets.txt +22 -0
- package/src/release/fixtures/victoria/victoria-logs-darwin-arm64-v1.52.0_checksums.txt +2 -0
- package/src/release/fixtures/victoria/victoria-metrics-darwin-arm64-v1.151.0_checksums.txt +2 -0
- package/src/release/fixtures/victoria/victoria-traces-darwin-arm64-v0.10.0_checksums.txt +2 -0
- package/src/release/fixtures/victoria/vmutils-darwin-arm64-v1.151.0_checksums.txt +8 -0
- package/src/release/index.ts +44 -0
- package/src/release/openbao.test.ts +120 -0
- package/src/release/openbao.ts +86 -0
- package/src/release/plan.test.ts +189 -0
- package/src/release/provider-refusals.test.ts +48 -0
- package/src/release/providers.test.ts +175 -0
- package/src/release/providers.ts +24 -0
- package/src/release/recovery-read.test.ts +44 -0
- package/src/release/refused.ts +40 -0
- package/src/release/tar.test.ts +142 -0
- package/src/release/tar.ts +195 -0
- package/src/release/victoria.test.ts +108 -0
- package/src/release/victoria.ts +154 -0
- package/src/{proxmox → secrets}/write-only.ts +6 -0
- /package/dist/{proxmox → secrets}/write-only.d.ts +0 -0
- /package/src/{proxmox → secrets}/write-only.test.ts +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One pinned release archive over Effect's `HttpClient`: status first, then the body read against
|
|
3
|
+
* the pinned size, into memory.
|
|
4
|
+
*
|
|
5
|
+
* ★ `HttpClient`, THE HOUSE TRANSPORT (openbao/bao-http.ts, decided 2026-09-14) and Alchemy's own:
|
|
6
|
+
* a typed error channel, interruption, and a client a test swaps for a fake. releaseProviders()
|
|
7
|
+
* provides `FetchHttpClient.layer` itself, so a host stack that has no HTTP layer yet (the Mac
|
|
8
|
+
* stack's has none) cannot forget it. ⚠️ fetch follows GitHub's 302 to its asset CDN (measured
|
|
9
|
+
* 2026-09-22 with HEAD: a signed, expiring URL), so the status judged here is the CDN's.
|
|
10
|
+
* ★ THE PINNED SIZE BOUNDS MEMORY. A body that runs past it is cut off at that byte, so a
|
|
11
|
+
* misbehaving server or a swapped asset cannot stream an unbounded file into the deploy.
|
|
12
|
+
* ★ NO API CALL. The browser-download URL needs no token and spends no API rate limit; the pins
|
|
13
|
+
* say everything the release API would.
|
|
14
|
+
* ⚠️ IN MEMORY: vmutils is 123.6 MB. Nothing is staged on disk, so no failure leaves a file behind.
|
|
15
|
+
*/
|
|
16
|
+
import type * as Duration from 'effect/Duration';
|
|
17
|
+
import * as Effect from 'effect/Effect';
|
|
18
|
+
import * as HttpClient from 'effect/unstable/http/HttpClient';
|
|
19
|
+
import { DownloadFailed } from './refused.ts';
|
|
20
|
+
/** The provider's view of a transport: an archive's bytes by URL, never longer than `size`. */
|
|
21
|
+
export type FetchArchive = (url: string, size: number) => Promise<Uint8Array>;
|
|
22
|
+
/** How patient a download is. ★ Parameters so a test never waits for real. */
|
|
23
|
+
export type DownloadPolicy = {
|
|
24
|
+
/** @default '10 minutes' — 123.6 MB on a slow link, and still a bounded wait. */
|
|
25
|
+
readonly timeout?: Duration.Input;
|
|
26
|
+
/** Retries after the first attempt, transport failures and 5xx only. @default 2 */
|
|
27
|
+
readonly retries?: number;
|
|
28
|
+
/** @default '2 seconds' */
|
|
29
|
+
readonly spacing?: Duration.Input;
|
|
30
|
+
};
|
|
31
|
+
/** The archive's bytes, exactly `size` of them, or DownloadFailed. */
|
|
32
|
+
export declare const downloadPinned: (url: string, size: number, policy?: DownloadPolicy) => Effect.Effect<Uint8Array, DownloadFailed, HttpClient.HttpClient>;
|
|
33
|
+
/** A FetchArchive over one HttpClient. ⚠️ Rejects with the DownloadFailed itself. */
|
|
34
|
+
export declare const httpFetchArchive: (client: HttpClient.HttpClient, policy?: DownloadPolicy) => FetchArchive;
|
|
35
|
+
/**
|
|
36
|
+
* ★ ONE DOWNLOAD PER ARCHIVE AT A TIME, NOT ONE PER BINARY. vmagent and vmalert are two resources
|
|
37
|
+
* in one 123.6 MB archive, and Alchemy reconciles independent resources concurrently (its fan-out
|
|
38
|
+
* is unbounded, Apply.ts), so two requests for one URL share the download already in flight.
|
|
39
|
+
* The entry goes when it settles: a later request downloads again rather than pinning 123 MB in
|
|
40
|
+
* memory for the rest of the deploy.
|
|
41
|
+
* ⚠️ The buffer is shared, so nothing downstream may write into it (archive.ts only reads).
|
|
42
|
+
*/
|
|
43
|
+
export declare const sharingInFlight: (fetch: FetchArchive) => FetchArchive;
|
|
44
|
+
//# sourceMappingURL=download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/release/download.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,+FAA+F;AAC/F,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;AAE9E,8EAA8E;AAC9E,MAAM,MAAM,cAAc,GAAG;IAC3B,iFAAiF;IACjF,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;IAClC,mFAAmF;IACnF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,2BAA2B;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;CACnC,CAAC;AAgCF,sEAAsE;AACtE,eAAO,MAAM,cAAc,QACpB,MAAM,QACL,MAAM,WACJ,cAAc,KACrB,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,cAAc,EAAE,UAAU,CAAC,UAAU,CAW/D,CAAC;AAEJ,qFAAqF;AACrF,eAAO,MAAM,gBAAgB,WAClB,UAAU,CAAC,UAAU,WAAU,cAAc,KAAQ,YAI3D,CAAC;AAEN;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,UAAW,YAAY,KAAG,YAUrD,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { type HostRunner } from '../launchd/runner.ts';
|
|
3
|
+
import { HostDirectory } from '../linux/directory.ts';
|
|
4
|
+
import type { ReleaseBinaryProps } from './binary-form.ts';
|
|
5
|
+
import { ReleaseBinary } from './binary.ts';
|
|
6
|
+
export declare const ROOT = "/opt/example/bin";
|
|
7
|
+
export declare const DIR = "/opt/example/bin/vmutils-1.151.0";
|
|
8
|
+
export declare const PATH = "/opt/example/bin/vmutils-1.151.0/vmalert";
|
|
9
|
+
export declare const THEIRS: Uint8Array<ArrayBufferLike>;
|
|
10
|
+
/** One fake host (with DIR already there when `dirExists`), one fake server, one stack. */
|
|
11
|
+
export declare const deployHarness: (dirExists: boolean) => {
|
|
12
|
+
dirOnly: Effect.Effect<HostDirectory, never, import("alchemy").Provider<HostDirectory>>;
|
|
13
|
+
events: string[];
|
|
14
|
+
fake: {
|
|
15
|
+
calls: string[][];
|
|
16
|
+
dirs: Map<string, number>;
|
|
17
|
+
expectUnit: (path: string) => void;
|
|
18
|
+
files: Map<string, {
|
|
19
|
+
bytes: Uint8Array;
|
|
20
|
+
mode: number;
|
|
21
|
+
uid: number;
|
|
22
|
+
gid: number;
|
|
23
|
+
kind: import("./index.ts").FileStat['kind'];
|
|
24
|
+
}>;
|
|
25
|
+
modes: Map<string, {
|
|
26
|
+
mode: number;
|
|
27
|
+
uid: number;
|
|
28
|
+
gid: number;
|
|
29
|
+
}>;
|
|
30
|
+
placeUnit: (path: string, text: string, state?: Partial<import("../linux/fake-systemd.ts").UnitState>) => void;
|
|
31
|
+
runner: HostRunner;
|
|
32
|
+
units: Map<string, import("../linux/fake-systemd.ts").UnitState>;
|
|
33
|
+
};
|
|
34
|
+
literal: Effect.Effect<ReleaseBinary, never, import("alchemy").Provider<ReleaseBinary>>;
|
|
35
|
+
place: (bytes: Uint8Array, mode?: number, kind?: 'file' | 'symlink') => Map<string, {
|
|
36
|
+
bytes: Uint8Array;
|
|
37
|
+
mode: number;
|
|
38
|
+
uid: number;
|
|
39
|
+
gid: number;
|
|
40
|
+
kind: import("./index.ts").FileStat['kind'];
|
|
41
|
+
}>;
|
|
42
|
+
server: {
|
|
43
|
+
serving: boolean;
|
|
44
|
+
};
|
|
45
|
+
stack: import("../openbao/fake-stack.ts").FakeStack;
|
|
46
|
+
wired: (id?: string, dirMode?: number, formerId?: string, more?: Partial<ReleaseBinaryProps>) => Effect.Effect<void, never, import("alchemy").Provider<HostDirectory> | import("alchemy").Provider<ReleaseBinary>>;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=fake-deploy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-deploy.d.ts","sourceRoot":"","sources":["../../src/release/fake-deploy.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAyB,MAAM,uBAAuB,CAAC;AAG7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAA6B,MAAM,aAAa,CAAC;AAIvE,eAAO,MAAM,IAAI,qBAAqB,CAAC;AACvC,eAAO,MAAM,GAAG,qCAA4B,CAAC;AAC7C,eAAO,MAAM,IAAI,6CAAmB,CAAC;AACrC,eAAO,MAAM,MAAM,6BAAiD,CAAC;AAErE,2FAA2F;AAC3F,eAAO,MAAM,aAAa,cAAe,OAAO;;;;;;;;;;;;;;;;;;;;;;;;mBAsCxB,UAAU,wBAAsB,MAAM,GAAG,SAAS;;;;;;;;;;;sDAQ3D,MAAM,SACX,OAAO,CAAC,kBAAkB,CAAC;CAWpC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** vmalert's bytes as text, to compare with what a test reads off the disk. */
|
|
2
|
+
export declare const VMALERT_TEXT: string;
|
|
3
|
+
/** One stack over localRunner; `deploy` takes logical id → directory; `gets` counts downloads. */
|
|
4
|
+
export declare const realEngine: () => {
|
|
5
|
+
deploy: (binaries: Readonly<Record<string, string>>) => Promise<Readonly<Record<string, string>>>;
|
|
6
|
+
gets: string[];
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=fake-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-engine.d.ts","sourceRoot":"","sources":["../../src/release/fake-engine.ts"],"names":[],"mappings":"AAmBA,+EAA+E;AAC/E,eAAO,MAAM,YAAY,QAA2C,CAAC;AAErE,kGAAkG;AAClG,eAAO,MAAM,UAAU;uBAiBK,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;;CAS3D,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ReleaseBinaryProps } from './binary-form.ts';
|
|
2
|
+
import { releaseHost } from './fake-release.ts';
|
|
3
|
+
export declare const PATH = "/opt/example/bin/vmutils-1.151.0/vmalert";
|
|
4
|
+
export declare const writes: (fake: ReturnType<typeof releaseHost>) => string[][];
|
|
5
|
+
/** A host, a synthetic release served at the real URLs (plus an enterprise decoy), and a runner. */
|
|
6
|
+
export declare const setup: (entries?: readonly import("./fake-release.ts").TarEntry[]) => {
|
|
7
|
+
fake: {
|
|
8
|
+
acls: Map<string, string[]>;
|
|
9
|
+
calls: string[][];
|
|
10
|
+
disabled: Set<string>;
|
|
11
|
+
dirs: Map<string, number>;
|
|
12
|
+
files: Map<string, {
|
|
13
|
+
bytes: Uint8Array;
|
|
14
|
+
mode: number;
|
|
15
|
+
uid: number;
|
|
16
|
+
gid: number;
|
|
17
|
+
kind: import("./index.ts").FileStat['kind'];
|
|
18
|
+
}>;
|
|
19
|
+
loaded: Map<string, number | undefined>;
|
|
20
|
+
runner: import("./index.ts").HostRunner;
|
|
21
|
+
state: {
|
|
22
|
+
lingerPrints: number;
|
|
23
|
+
nextPid: number;
|
|
24
|
+
bootstrapFailure: import("./index.ts").ExecResult | undefined;
|
|
25
|
+
bootoutFailure: import("./index.ts").ExecResult | undefined;
|
|
26
|
+
bootoutKeepsJob: boolean;
|
|
27
|
+
loggedOut: Set<number>;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
install: (declared?: ReleaseBinaryProps, options?: {}) => Promise<import("./binary-form.ts").ReleaseBinaryAttributes>;
|
|
31
|
+
props: (more?: Partial<ReleaseBinaryProps>) => ReleaseBinaryProps;
|
|
32
|
+
transport: {
|
|
33
|
+
fetch: import("./download.ts").FetchArchive;
|
|
34
|
+
requests: string[];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/** Run a refusal; return it, having checked the host is exactly as it was and nothing was written. */
|
|
38
|
+
export declare const refused: (s: ReturnType<typeof setup>, run: () => Promise<unknown>) => Promise<Error>;
|
|
39
|
+
//# sourceMappingURL=fake-install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-install.d.ts","sourceRoot":"","sources":["../../src/release/fake-install.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAUL,WAAW,EAIZ,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,IAAI,6CAA2B,CAAC;AAC7C,eAAO,MAAM,MAAM,SAAU,UAAU,CAAC,OAAO,WAAW,CAAC,eACf,CAAC;AAE7C,oGAAoG;AACpG,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;mBASK,OAAO,CAAC,kBAAkB,CAAC;;;;;CAIjD,CAAC;AAEF,sGAAsG;AACtG,eAAO,MAAM,OAAO,MAAa,UAAU,CAAC,OAAO,KAAK,CAAC,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,mBAWrF,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One Release.Binary provider over one fake host and one fake HTTP server, for the handler tests
|
|
3
|
+
* beside it: `requests` counts every URL asked, `notes` every `session.note`.
|
|
4
|
+
*
|
|
5
|
+
* ⛔ TEST-ONLY, like fake-release.ts: no provider imports it and it is not on the barrel.
|
|
6
|
+
*/
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import { ReleaseBinary } from './binary.ts';
|
|
9
|
+
export declare const ids: {
|
|
10
|
+
fqn: string;
|
|
11
|
+
id: string;
|
|
12
|
+
instanceId: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const call: {
|
|
15
|
+
bindings: never;
|
|
16
|
+
newBindings: never;
|
|
17
|
+
oldBindings: never;
|
|
18
|
+
};
|
|
19
|
+
export declare const PATH = "/opt/example/bin/vmutils-1.151.0/vmalert";
|
|
20
|
+
export type Service = Effect.Success<typeof ReleaseBinary.Provider>;
|
|
21
|
+
/** One provider over one fake host and one fake HTTP server; `requests` counts every URL asked. */
|
|
22
|
+
export declare const harness: () => {
|
|
23
|
+
VMALERT: import("./binary-form.ts").ReleaseBinaryProps;
|
|
24
|
+
fake: {
|
|
25
|
+
acls: Map<string, string[]>;
|
|
26
|
+
calls: string[][];
|
|
27
|
+
disabled: Set<string>;
|
|
28
|
+
dirs: Map<string, number>;
|
|
29
|
+
files: Map<string, {
|
|
30
|
+
bytes: Uint8Array;
|
|
31
|
+
mode: number;
|
|
32
|
+
uid: number;
|
|
33
|
+
gid: number;
|
|
34
|
+
kind: import("./index.ts").FileStat['kind'];
|
|
35
|
+
}>;
|
|
36
|
+
loaded: Map<string, number | undefined>;
|
|
37
|
+
runner: import("./index.ts").HostRunner;
|
|
38
|
+
state: {
|
|
39
|
+
lingerPrints: number;
|
|
40
|
+
nextPid: number;
|
|
41
|
+
bootstrapFailure: import("./index.ts").ExecResult | undefined;
|
|
42
|
+
bootoutFailure: import("./index.ts").ExecResult | undefined;
|
|
43
|
+
bootoutKeepsJob: boolean;
|
|
44
|
+
loggedOut: Set<number>;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
notes: string[];
|
|
48
|
+
reconcile: (p: Service, news: object, output?: unknown, olds?: object) => Effect.Effect<import("./binary-form.ts").ReleaseBinaryAttributes, any, never>;
|
|
49
|
+
release: {
|
|
50
|
+
catalog: import("./catalog.ts").ReleaseCatalog;
|
|
51
|
+
traces: Uint8Array<ArrayBufferLike>;
|
|
52
|
+
vmutils: Uint8Array<ArrayBufferLike>;
|
|
53
|
+
};
|
|
54
|
+
requests: string[];
|
|
55
|
+
run: <A>(use: (p: Service) => Effect.Effect<A, unknown>) => Promise<A>;
|
|
56
|
+
};
|
|
57
|
+
export declare const must: <F>(fn: F | undefined) => F;
|
|
58
|
+
//# sourceMappingURL=fake-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-provider.d.ts","sourceRoot":"","sources":["../../src/release/fake-provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,EAAE,aAAa,EAA6B,MAAM,aAAa,CAAC;AASvE,eAAO,MAAM,GAAG;IAAK,GAAG;IAAmB,EAAE;IAAa,UAAU;CAAS,CAAC;AAC9E,eAAO,MAAM,IAAI;IAAK,QAAQ,EAAQ,KAAK;IAAE,WAAW,EAAQ,KAAK;IAAE,WAAW,EAAQ,KAAK;CAAE,CAAC;AAClG,eAAO,MAAM,IAAI,6CAA2B,CAAC;AAE7C,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;AAEpE,mGAAmG;AACnG,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;mBAyBI,OAAO,QAAQ,MAAM,WAAW,OAAO,SAAS,MAAM;;;;;;;UAN/D,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC;CAgB/D,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,CAAC,MAAM,CAAC,GAAG,SAAS,KAAG,CAG3C,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Synthetic release archives for the tests beside it: a tar writer, gzip, a catalog pinned to what
|
|
3
|
+
* they build, a counting transport, and a host with the versioned directories in place.
|
|
4
|
+
*
|
|
5
|
+
* ⛔ TEST-ONLY. No provider imports this file, it is not on the barrel, and nothing here reaches a
|
|
6
|
+
* network or a real filesystem. The catalog is synthetic because a test cannot build bytes that
|
|
7
|
+
* hash to the vendor's pins; victoria.test.ts holds the REAL data set to the vendor's own files.
|
|
8
|
+
* ★ THE ASSET NAMES AND URLS ARE THE REAL ONES, so a test that serves the `-enterprise` sibling
|
|
9
|
+
* next to the plain archive proves the provider asks for exactly one of them.
|
|
10
|
+
*/
|
|
11
|
+
import { fakeRunner } from '../launchd/fake-runner.ts';
|
|
12
|
+
import { type ReleaseBinaryProps } from './binary-form.ts';
|
|
13
|
+
import { type PinnedArchive, type ReleaseCatalog } from './catalog.ts';
|
|
14
|
+
import type { FetchArchive } from './download.ts';
|
|
15
|
+
export type TarEntry = {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly bytes?: Uint8Array;
|
|
18
|
+
/** The typeflag: '0' regular (default), '1' hard link, '2' symlink, '5' directory, 'L', 'x', … */
|
|
19
|
+
readonly type?: string;
|
|
20
|
+
readonly format?: 'gnu' | 'posix';
|
|
21
|
+
readonly prefix?: string;
|
|
22
|
+
/** Size field written as GNU base-256. */
|
|
23
|
+
readonly base256?: boolean;
|
|
24
|
+
readonly corruptChecksum?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare const tarHeader: (entry: TarEntry) => Uint8Array;
|
|
27
|
+
/** A tar: each header, its data padded to 512, then the two zero blocks. */
|
|
28
|
+
export declare const tarOf: (entries: readonly TarEntry[], end?: number) => Uint8Array;
|
|
29
|
+
export declare const gzip: (bytes: Uint8Array) => Uint8Array;
|
|
30
|
+
export declare const bytesOf: (text: string) => Uint8Array;
|
|
31
|
+
/** Stand-ins for the vendor binaries: distinct bytes, so each digest is distinct. */
|
|
32
|
+
export declare const BINARY: {
|
|
33
|
+
vmagent: Uint8Array<ArrayBufferLike>;
|
|
34
|
+
vmalert: Uint8Array<ArrayBufferLike>;
|
|
35
|
+
vmauth: Uint8Array<ArrayBufferLike>;
|
|
36
|
+
'victoria-traces': Uint8Array<ArrayBufferLike>;
|
|
37
|
+
};
|
|
38
|
+
export declare const VMUTILS: PinnedArchive;
|
|
39
|
+
export declare const TRACES: PinnedArchive;
|
|
40
|
+
export declare const urlOf: (archive: PinnedArchive) => string;
|
|
41
|
+
export declare const VMUTILS_URL: string;
|
|
42
|
+
export declare const TRACES_URL: string;
|
|
43
|
+
export declare const ENTERPRISE_URL: string;
|
|
44
|
+
export declare const VMUTILS_ENTRIES: readonly TarEntry[];
|
|
45
|
+
/** Pin an archive the way victoria.ts pins a vendor one, from the bytes themselves. */
|
|
46
|
+
export declare const pinned: (real: PinnedArchive, archive: Uint8Array, members: Readonly<Record<string, Uint8Array>>) => PinnedArchive;
|
|
47
|
+
/** The real data set with vmutils 1.151.0 and victoria-traces 0.10.0 re-pinned to synthetic bytes. */
|
|
48
|
+
export declare const syntheticRelease: (vmutilsEntries?: readonly TarEntry[]) => {
|
|
49
|
+
catalog: ReleaseCatalog;
|
|
50
|
+
traces: Uint8Array<ArrayBufferLike>;
|
|
51
|
+
vmutils: Uint8Array<ArrayBufferLike>;
|
|
52
|
+
};
|
|
53
|
+
/** A transport over a URL → bytes table that records every request, in order. */
|
|
54
|
+
export declare const fakeTransport: (served: Readonly<Record<string, Uint8Array>>) => {
|
|
55
|
+
fetch: FetchArchive;
|
|
56
|
+
requests: string[];
|
|
57
|
+
};
|
|
58
|
+
export declare const ROOT = "/opt/example/bin";
|
|
59
|
+
export declare const VMUTILS_DIR = "/opt/example/bin/vmutils-1.151.0";
|
|
60
|
+
export declare const TRACES_DIR = "/opt/example/bin/victoria-traces-0.10.0";
|
|
61
|
+
/** A host deploying as root, with the two versioned directories already declared. */
|
|
62
|
+
export declare const releaseHost: () => {
|
|
63
|
+
acls: Map<string, string[]>;
|
|
64
|
+
calls: string[][];
|
|
65
|
+
disabled: Set<string>;
|
|
66
|
+
dirs: Map<string, number>;
|
|
67
|
+
files: Map<string, {
|
|
68
|
+
bytes: Uint8Array;
|
|
69
|
+
mode: number;
|
|
70
|
+
uid: number;
|
|
71
|
+
gid: number;
|
|
72
|
+
kind: import("./index.ts").FileStat['kind'];
|
|
73
|
+
}>;
|
|
74
|
+
loaded: Map<string, number | undefined>;
|
|
75
|
+
runner: import("./index.ts").HostRunner;
|
|
76
|
+
state: {
|
|
77
|
+
lingerPrints: number;
|
|
78
|
+
nextPid: number;
|
|
79
|
+
bootstrapFailure: import("./index.ts").ExecResult | undefined;
|
|
80
|
+
bootoutFailure: import("./index.ts").ExecResult | undefined;
|
|
81
|
+
bootoutKeepsJob: boolean;
|
|
82
|
+
loggedOut: Set<number>;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export declare const VMALERT_REQUEST: {
|
|
86
|
+
readonly binary: 'vmalert';
|
|
87
|
+
readonly package: 'vmutils';
|
|
88
|
+
readonly platform: 'darwin-arm64';
|
|
89
|
+
readonly version: '1.151.0';
|
|
90
|
+
};
|
|
91
|
+
/** vmalert's props out of `catalog` (the synthetic one, normally), in its versioned directory. */
|
|
92
|
+
export declare const vmalertProps: (catalog: ReleaseCatalog, more?: Partial<ReleaseBinaryProps>) => ReleaseBinaryProps;
|
|
93
|
+
/** Every path on the fake host, sorted — equal before and after means nothing was left behind. */
|
|
94
|
+
export declare const pathsOn: (fake: ReturnType<typeof fakeRunner>) => string[];
|
|
95
|
+
//# sourceMappingURL=fake-release.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-release.d.ts","sourceRoot":"","sources":["../../src/release/fake-release.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,KAAK,kBAAkB,EAAc,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAiB,MAAM,cAAc,CAAC;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,kGAAkG;IAClG,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACpC,CAAC;AAMF,eAAO,MAAM,SAAS,UAAW,QAAQ,KAAG,UAiB3C,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,KAAK,YAAa,SAAS,QAAQ,EAAE,mBAAe,UAiBhE,CAAC;AAEF,eAAO,MAAM,IAAI,UAAW,UAAU,KAAG,UAAyC,CAAC;AAEnF,eAAO,MAAM,OAAO,SAAU,MAAM,KAAG,UAA4C,CAAC;AAEpF,qFAAqF;AACrF,eAAO,MAAM,MAAM;IACjB,OAAO;IACP,OAAO;IACP,MAAM;IACN,iBAAiB;CAClB,CAAC;AAOF,eAAO,MAAM,OAAO,eAA+D,CAAC;AACpF,eAAO,MAAM,MAAM,eAAyE,CAAC;AAC7F,eAAO,MAAM,KAAK,YAAa,aAAa,KAAG,MACO,CAAC;AACvD,eAAO,MAAM,WAAW,QAAiB,CAAC;AAC1C,eAAO,MAAM,UAAU,QAAgB,CAAC;AACxC,eAAO,MAAM,cAAc,QAAuD,CAAC;AAEnF,eAAO,MAAM,eAAe,EAAE,SAAS,QAAQ,EAI9C,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,MAAM,SACX,aAAa,WACV,UAAU,WACV,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,KAC5C,aAKD,CAAC;AAEH,sGAAsG;AACtG,eAAO,MAAM,gBAAgB,oBAAoB,SAAS,QAAQ,EAAE;;;;CAyBnE,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,aAAa,WAAY,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;;;CAUzE,CAAC;AAEF,eAAO,MAAM,IAAI,qBAAqB,CAAC;AACvC,eAAO,MAAM,WAAW,qCAA4B,CAAC;AACrD,eAAO,MAAM,UAAU,4CAAmC,CAAC;AAE3D,qFAAqF;AACrF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;CACyD,CAAC;AAElF,eAAO,MAAM,eAAe;aAC1B,MAAM,EAAE,SAAS;aACjB,OAAO,EAAE,SAAS;aAClB,QAAQ,EAAE,cAAc;aACxB,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,kGAAkG;AAClG,eAAO,MAAM,YAAY,YACd,cAAc,SACjB,OAAO,CAAC,kBAAkB,CAAC,KAChC,kBAID,CAAC;AAEH,kGAAkG;AAClG,eAAO,MAAM,OAAO,SAAU,UAAU,CAAC,OAAO,UAAU,CAAC,KAAG,MAAM,EACrC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release binaries for Alchemy — one binary out of a pinned release archive, installed onto a host
|
|
3
|
+
* and verified against digests the stack pins in code, plus the vendor data sets those pins come
|
|
4
|
+
* from (VictoriaMetrics' is the first).
|
|
5
|
+
*
|
|
6
|
+
* ⛔ THIS BARREL IS THE PUBLIC API, AND IT IS DELIBERATELY SMALLER THAN THE DIRECTORY. The tar
|
|
7
|
+
* reader, the downloader, the checksum parser, the lifecycle and the test seams are internals; an
|
|
8
|
+
* `export *` would publish them as API and make the next refactor a breaking change.
|
|
9
|
+
* ⛔ IT INSTALLS; IT NEVER STARTS. Run the binary with `LaunchdJob` (the launchd subpath) or a
|
|
10
|
+
* systemd unit, putting `ReleaseBinary`'s `path` in its argv. See docs/release-binary.md.
|
|
11
|
+
* ★ THE SEAM IS SHARED, NOT COPIED. `HostRunner` is re-exported so a stack types its runner without
|
|
12
|
+
* importing from another subpath.
|
|
13
|
+
*/
|
|
14
|
+
export type { PinnedDownload, ReleaseArchive, ReleaseBinaryAttributes, ReleaseBinaryProps, } from './binary-form.ts';
|
|
15
|
+
export { releaseBinaryPath, releaseUrl } from './binary-form.ts';
|
|
16
|
+
export { ReleaseBinary, ReleaseBinaryProvider } from './binary.ts';
|
|
17
|
+
export type { CatalogPackage, CatalogRequest, ChecksumSignature, ComputedDigest, IdentifiedBinary, PinnedArchive, PinnedBinary, ReleaseCatalog, } from './catalog.ts';
|
|
18
|
+
export { catalogBinary, catalogDirectory, catalogProblems, identifyBinary } from './catalog.ts';
|
|
19
|
+
export { OPENBAO_RELEASES } from './openbao.ts';
|
|
20
|
+
export { releaseProviders } from './providers.ts';
|
|
21
|
+
export { ArchiveRefused, BinaryRefused, ChecksumMismatch, DownloadFailed } from './refused.ts';
|
|
22
|
+
export { VICTORIA_RELEASES } from './victoria.ts';
|
|
23
|
+
export type { ExecResult, FileStat, HostRunner, HostUser, WriteOptions, } from '../launchd/runner.ts';
|
|
24
|
+
export { HostRunnerService, hostRunnerLayer } from '../launchd/runner.ts';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/release/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,YAAY,EACV,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACnE,YAAY,EACV,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,YAAY,EACV,UAAU,EACV,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|