@alchemy.run/archil 0.0.0 → 2.0.0-beta.86
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/LICENSE +201 -0
- package/README.md +57 -4
- package/lib/AWS/S3Disk.d.ts +68 -0
- package/lib/AWS/S3Disk.d.ts.map +1 -0
- package/lib/AWS/S3Disk.js +100 -0
- package/lib/AWS/S3Disk.js.map +1 -0
- package/lib/AWS/index.d.ts +2 -0
- package/lib/AWS/index.d.ts.map +1 -0
- package/lib/AWS/index.js +2 -0
- package/lib/AWS/index.js.map +1 -0
- package/lib/ApiToken.d.ts +63 -0
- package/lib/ApiToken.d.ts.map +1 -0
- package/lib/ApiToken.js +121 -0
- package/lib/ApiToken.js.map +1 -0
- package/lib/ArchilBindings.d.ts +65 -0
- package/lib/ArchilBindings.d.ts.map +1 -0
- package/lib/ArchilBindings.js +128 -0
- package/lib/ArchilBindings.js.map +1 -0
- package/lib/AuthProvider.d.ts +40 -0
- package/lib/AuthProvider.d.ts.map +1 -0
- package/lib/AuthProvider.js +87 -0
- package/lib/AuthProvider.js.map +1 -0
- package/lib/Bootstrap.d.ts +8 -0
- package/lib/Bootstrap.d.ts.map +1 -0
- package/lib/Bootstrap.js +27 -0
- package/lib/Bootstrap.js.map +1 -0
- package/lib/Branch.d.ts +101 -0
- package/lib/Branch.d.ts.map +1 -0
- package/lib/Branch.js +117 -0
- package/lib/Branch.js.map +1 -0
- package/lib/BranchDisk.d.ts +42 -0
- package/lib/BranchDisk.d.ts.map +1 -0
- package/lib/BranchDisk.js +14 -0
- package/lib/BranchDisk.js.map +1 -0
- package/lib/Checkpoint.d.ts +78 -0
- package/lib/Checkpoint.d.ts.map +1 -0
- package/lib/Checkpoint.js +95 -0
- package/lib/Checkpoint.js.map +1 -0
- package/lib/Clients.d.ts +369 -0
- package/lib/Clients.d.ts.map +1 -0
- package/lib/Clients.js +334 -0
- package/lib/Clients.js.map +1 -0
- package/lib/ConnectSandbox.d.ts +69 -0
- package/lib/ConnectSandbox.d.ts.map +1 -0
- package/lib/ConnectSandbox.js +21 -0
- package/lib/ConnectSandbox.js.map +1 -0
- package/lib/Contributions.d.ts +7 -0
- package/lib/Contributions.d.ts.map +1 -0
- package/lib/Contributions.js +6 -0
- package/lib/Contributions.js.map +1 -0
- package/lib/CreateDisk.d.ts +90 -0
- package/lib/CreateDisk.d.ts.map +1 -0
- package/lib/CreateDisk.js +47 -0
- package/lib/CreateDisk.js.map +1 -0
- package/lib/CreateImage.d.ts +42 -0
- package/lib/CreateImage.d.ts.map +1 -0
- package/lib/CreateImage.js +19 -0
- package/lib/CreateImage.js.map +1 -0
- package/lib/CreateSandbox.d.ts +104 -0
- package/lib/CreateSandbox.d.ts.map +1 -0
- package/lib/CreateSandbox.js +98 -0
- package/lib/CreateSandbox.js.map +1 -0
- package/lib/Credentials.d.ts +44 -0
- package/lib/Credentials.d.ts.map +1 -0
- package/lib/Credentials.js +57 -0
- package/lib/Credentials.js.map +1 -0
- package/lib/Disk.d.ts +283 -0
- package/lib/Disk.d.ts.map +1 -0
- package/lib/Disk.js +294 -0
- package/lib/Disk.js.map +1 -0
- package/lib/DiskObjectsHttp.d.ts +20 -0
- package/lib/DiskObjectsHttp.d.ts.map +1 -0
- package/lib/DiskObjectsHttp.js +51 -0
- package/lib/DiskObjectsHttp.js.map +1 -0
- package/lib/DiskUser.d.ts +189 -0
- package/lib/DiskUser.d.ts.map +1 -0
- package/lib/DiskUser.js +243 -0
- package/lib/DiskUser.js.map +1 -0
- package/lib/ExecDisk.d.ts +57 -0
- package/lib/ExecDisk.d.ts.map +1 -0
- package/lib/ExecDisk.js +3 -0
- package/lib/ExecDisk.js.map +1 -0
- package/lib/ExecDiskHttp.d.ts +5 -0
- package/lib/ExecDiskHttp.d.ts.map +1 -0
- package/lib/ExecDiskHttp.js +18 -0
- package/lib/ExecDiskHttp.js.map +1 -0
- package/lib/ExecDisks.d.ts +54 -0
- package/lib/ExecDisks.d.ts.map +1 -0
- package/lib/ExecDisks.js +37 -0
- package/lib/ExecDisks.js.map +1 -0
- package/lib/Image.d.ts +188 -0
- package/lib/Image.d.ts.map +1 -0
- package/lib/Image.js +191 -0
- package/lib/Image.js.map +1 -0
- package/lib/InferEnv.d.ts +26 -0
- package/lib/InferEnv.d.ts.map +1 -0
- package/lib/InferEnv.js +1 -0
- package/lib/InferEnv.js.map +1 -0
- package/lib/MountDisk.d.ts +190 -0
- package/lib/MountDisk.d.ts.map +1 -0
- package/lib/MountDisk.js +227 -0
- package/lib/MountDisk.js.map +1 -0
- package/lib/Providers.d.ts +25 -0
- package/lib/Providers.d.ts.map +1 -0
- package/lib/Providers.js +48 -0
- package/lib/Providers.js.map +1 -0
- package/lib/ReadDisk.d.ts +55 -0
- package/lib/ReadDisk.d.ts.map +1 -0
- package/lib/ReadDisk.js +3 -0
- package/lib/ReadDisk.js.map +1 -0
- package/lib/ReadWriteDisk.d.ts +26 -0
- package/lib/ReadWriteDisk.d.ts.map +1 -0
- package/lib/ReadWriteDisk.js +3 -0
- package/lib/ReadWriteDisk.js.map +1 -0
- package/lib/Sandbox.d.ts +507 -0
- package/lib/Sandbox.d.ts.map +1 -0
- package/lib/Sandbox.js +729 -0
- package/lib/Sandbox.js.map +1 -0
- package/lib/SandboxOptions.d.ts +185 -0
- package/lib/SandboxOptions.d.ts.map +1 -0
- package/lib/SandboxOptions.js +102 -0
- package/lib/SandboxOptions.js.map +1 -0
- package/lib/SandboxPortToken.d.ts +64 -0
- package/lib/SandboxPortToken.d.ts.map +1 -0
- package/lib/SandboxPortToken.js +77 -0
- package/lib/SandboxPortToken.js.map +1 -0
- package/lib/WriteDisk.d.ts +37 -0
- package/lib/WriteDisk.d.ts.map +1 -0
- package/lib/WriteDisk.js +3 -0
- package/lib/WriteDisk.js.map +1 -0
- package/lib/index.d.ts +29 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +28 -0
- package/lib/index.js.map +1 -0
- package/lib/internal/DeployerKey.d.ts +21 -0
- package/lib/internal/DeployerKey.d.ts.map +1 -0
- package/lib/internal/DeployerKey.js +34 -0
- package/lib/internal/DeployerKey.js.map +1 -0
- package/lib/internal/archil.d.ts +87 -0
- package/lib/internal/archil.d.ts.map +1 -0
- package/lib/internal/archil.js +154 -0
- package/lib/internal/archil.js.map +1 -0
- package/lib/internal/hosted.d.ts +90 -0
- package/lib/internal/hosted.d.ts.map +1 -0
- package/lib/internal/hosted.js +291 -0
- package/lib/internal/hosted.js.map +1 -0
- package/package.json +79 -3
- package/src/AWS/S3Disk.ts +125 -0
- package/src/AWS/index.ts +1 -0
- package/src/ApiToken.ts +168 -0
- package/src/ArchilBindings.ts +179 -0
- package/src/AuthProvider.ts +122 -0
- package/src/Bootstrap.ts +54 -0
- package/src/Branch.ts +199 -0
- package/src/BranchDisk.ts +57 -0
- package/src/Checkpoint.ts +145 -0
- package/src/Clients.ts +954 -0
- package/src/ConnectSandbox.ts +91 -0
- package/src/Contributions.ts +9 -0
- package/src/CreateDisk.ts +165 -0
- package/src/CreateImage.ts +73 -0
- package/src/CreateSandbox.ts +258 -0
- package/src/Credentials.ts +101 -0
- package/src/Disk.ts +468 -0
- package/src/DiskObjectsHttp.ts +64 -0
- package/src/DiskUser.ts +369 -0
- package/src/ExecDisk.ts +62 -0
- package/src/ExecDiskHttp.ts +25 -0
- package/src/ExecDisks.ts +100 -0
- package/src/Image.ts +316 -0
- package/src/InferEnv.ts +27 -0
- package/src/MountDisk.ts +466 -0
- package/src/Providers.ts +75 -0
- package/src/ReadDisk.ts +61 -0
- package/src/ReadWriteDisk.ts +31 -0
- package/src/Sandbox.ts +1064 -0
- package/src/SandboxOptions.ts +230 -0
- package/src/SandboxPortToken.ts +125 -0
- package/src/WriteDisk.ts +42 -0
- package/src/globals.d.ts +2 -0
- package/src/index.ts +59 -0
- package/src/internal/DeployerKey.ts +63 -0
- package/src/internal/archil.ts +273 -0
- package/src/internal/hosted.ts +402 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Credentials } from "@distilled.cloud/archil/Credentials";
|
|
2
|
+
import * as Provider from "alchemy/Provider";
|
|
3
|
+
import { Resource } from "alchemy/Resource";
|
|
4
|
+
import * as Redacted from "effect/Redacted";
|
|
5
|
+
import type { Providers } from "../Providers.ts";
|
|
6
|
+
export interface DeployerKeyAttributes {
|
|
7
|
+
/** The API key the stack deploys with. */
|
|
8
|
+
apiKey: Redacted.Redacted<string>;
|
|
9
|
+
/** Archil region the key acts in. */
|
|
10
|
+
region: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The deploying account's API key, recorded so bindings can hand it to
|
|
14
|
+
* their host. Archil only mints API keys from a console session (an API
|
|
15
|
+
* key gets a 401), and its keys can't be scoped, so a host gets the same
|
|
16
|
+
* key the stack deploys with. Rotating the deploy key updates every host.
|
|
17
|
+
*/
|
|
18
|
+
export type DeployerKey = Resource<"Archil.DeployerKey", {}, DeployerKeyAttributes, never, Providers>;
|
|
19
|
+
export declare const DeployerKey: import("alchemy").ResourceClass<DeployerKey>;
|
|
20
|
+
export declare const DeployerKeyProvider: () => import("effect/Layer").Layer<Provider.Provider<DeployerKey>, never, Credentials>;
|
|
21
|
+
//# sourceMappingURL=DeployerKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeployerKey.d.ts","sources":["../../src/internal/DeployerKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,qCAAqC,CAAC;AAClF,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IACpC,0CAA0C;IAC1C,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAClC,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAChC,oBAAoB,EACpB,EAAE,EACF,qBAAqB,EACrB,KAAK,EACL,SAAS,CACV,CAAC;AAEF,eAAO,MAAM,WAAW,8CAA8C,CAAC;AAOvE,eAAO,MAAM,mBAAmB,wFA2B7B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Credentials, DEFAULT_REGION } from "@distilled.cloud/archil/Credentials";
|
|
2
|
+
import * as Provider from "alchemy/Provider";
|
|
3
|
+
import { Resource } from "alchemy/Resource";
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import * as Redacted from "effect/Redacted";
|
|
6
|
+
export const DeployerKey = Resource("Archil.DeployerKey");
|
|
7
|
+
const current = Effect.gen(function* () {
|
|
8
|
+
const { apiKey, region } = yield* yield* Credentials;
|
|
9
|
+
return { apiKey, region: region ?? DEFAULT_REGION };
|
|
10
|
+
});
|
|
11
|
+
export const DeployerKeyProvider = () => Provider.effect(DeployerKey, Effect.gen(function* () {
|
|
12
|
+
return {
|
|
13
|
+
// Nothing lives in Archil: the key belongs to the deployer.
|
|
14
|
+
nuke: { skip: true },
|
|
15
|
+
diff: Effect.fn(function* ({ output }) {
|
|
16
|
+
if (output === undefined)
|
|
17
|
+
return undefined;
|
|
18
|
+
const next = yield* current;
|
|
19
|
+
if (Redacted.value(next.apiKey) !== Redacted.value(output.apiKey) ||
|
|
20
|
+
next.region !== output.region) {
|
|
21
|
+
return { action: "update" };
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}),
|
|
25
|
+
read: Effect.fn(function* ({ output }) {
|
|
26
|
+
return output;
|
|
27
|
+
}),
|
|
28
|
+
reconcile: Effect.fn(function* () {
|
|
29
|
+
return yield* current;
|
|
30
|
+
}),
|
|
31
|
+
delete: () => Effect.void,
|
|
32
|
+
};
|
|
33
|
+
}));
|
|
34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I,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAC7B,CAAC;gBACD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAW,CAAC;YACvC,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC;QACF,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE;YACnC,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;QACF,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC;YAC5B,OAAO,KAAK,CAAC,CAAC,OAAO,CAAC;QACxB,CAAC,CAAC;QACF,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI;KAC1B,CAAC;AACJ,CAAC,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Archil helpers: physical names, lookups by name, readiness waits.
|
|
3
|
+
* Archil has no tags or labels, so ownership is the engine-generated
|
|
4
|
+
* physical name (stack, stage, logical id and instance suffix).
|
|
5
|
+
*/
|
|
6
|
+
import * as archil from "@distilled.cloud/archil";
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import * as Stream from "effect/Stream";
|
|
9
|
+
/** Disk names: letters, digits, `-` and `_`, at most 100 characters. */
|
|
10
|
+
export declare const diskName: (id: string, name: string | undefined) => Effect.Effect<string, never, import("alchemy").ResourceContext | import("alchemy").Stack | import("alchemy").Stage>;
|
|
11
|
+
/** Lowercase letters, digits and single `-`, trimmed of leading/trailing `-`. */
|
|
12
|
+
export declare const toDnsLabel: (value: string) => string;
|
|
13
|
+
/** Sandbox names: lowercase letters, digits and `-`, at most 63 characters. */
|
|
14
|
+
export declare const sandboxName: (id: string, name: string | undefined) => Effect.Effect<string, never, import("alchemy").ResourceContext | import("alchemy").Stack | import("alchemy").Stage>;
|
|
15
|
+
/** API token names. */
|
|
16
|
+
export declare const tokenName: (id: string, name: string | undefined) => Effect.Effect<string, never, import("alchemy").ResourceContext | import("alchemy").Stack | import("alchemy").Stage>;
|
|
17
|
+
/**
|
|
18
|
+
* Whether a name was generated by Alchemy's physical-name scheme: it ends
|
|
19
|
+
* with a delimiter and a base32 instance suffix.
|
|
20
|
+
*/
|
|
21
|
+
export declare const isAlchemyName: (name: string | undefined) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether a name carries a run-time client's owner prefix,
|
|
24
|
+
* `alc-<id>-<hash of stack/stage/id>-` (see `runtimePrefix`). `list` (and so
|
|
25
|
+
* `pnpm nuke`) finds disks and sandboxes created at run time by it.
|
|
26
|
+
*/
|
|
27
|
+
export declare const isRuntimeObjectName: (name: string | undefined) => boolean;
|
|
28
|
+
declare const ArchilNotReady_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
29
|
+
readonly _tag: "Archil.NotReady";
|
|
30
|
+
} & Readonly<A>;
|
|
31
|
+
/** A resource didn't reach a usable state within its time budget. */
|
|
32
|
+
export declare class ArchilNotReady extends ArchilNotReady_base<{
|
|
33
|
+
readonly resource: string;
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly status: string;
|
|
36
|
+
readonly message: string;
|
|
37
|
+
}> {
|
|
38
|
+
}
|
|
39
|
+
declare const ArchilFailed_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
40
|
+
readonly _tag: "Archil.Failed";
|
|
41
|
+
} & Readonly<A>;
|
|
42
|
+
/** A resource reached a terminal failure state. */
|
|
43
|
+
export declare class ArchilFailed extends ArchilFailed_base<{
|
|
44
|
+
readonly resource: string;
|
|
45
|
+
readonly id: string;
|
|
46
|
+
readonly status: string;
|
|
47
|
+
readonly message: string;
|
|
48
|
+
}> {
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Poll `observe` every 2 s (at most ~90 s) until `check` returns a value;
|
|
52
|
+
* `check` returns `undefined` to keep waiting or fails on a terminal state.
|
|
53
|
+
*/
|
|
54
|
+
export declare const pollUntil: <A, B, E extends {
|
|
55
|
+
readonly _tag: string;
|
|
56
|
+
}, R>(observe: Effect.Effect<A, E, R>, check: (value: A) => Effect.Effect<B | undefined, ArchilFailed>, pending: (value: A) => ArchilNotReady) => Effect.Effect<B, E | ArchilFailed | ArchilNotReady, R>;
|
|
57
|
+
/** Every disk (or every disk with this exact name), following `nextCursor`. */
|
|
58
|
+
export declare const listAllDisks: (name?: string) => Stream.Stream<archil.DiskResponse, archil.ArchilOpError, archil.ArchilOpContext>;
|
|
59
|
+
/**
|
|
60
|
+
* Find a live disk by exact name. Archil keeps listing a deleted disk under
|
|
61
|
+
* its name for a while, so those are skipped.
|
|
62
|
+
*/
|
|
63
|
+
export declare const findDiskByName: (name: string) => Effect.Effect<archil.DiskResponse | undefined, archil.ArchilOpError, archil.ArchilOpContext>;
|
|
64
|
+
/** Get a disk by id; `undefined` when it doesn't exist. */
|
|
65
|
+
export declare const getDisk: (id: string) => Effect.Effect<archil.DiskResponse | undefined, archil.ArchilParseError | archil.BadGateway | import("@distilled.cloud/core/errors").BadRequest | archil.BadRequest | archil.ConfigError | import("@distilled.cloud/core/errors").Conflict | import("@distilled.cloud/core/errors").Forbidden | archil.GatewayTimeout | import("effect/http/HttpClientError").HttpClientError | archil.InternalServerError | import("@distilled.cloud/core/protocol-http").InvalidInput | archil.Locked | import("@distilled.cloud/core/sdk-error").SdkError | archil.ServiceUnavailable | archil.TooManyRequests | archil.Unauthorized | archil.UnknownArchilError | archil.UnprocessableEntity, archil.ArchilOpContext>;
|
|
66
|
+
/** Wait until a disk is `available`. */
|
|
67
|
+
export declare const waitForDisk: (id: string) => Effect.Effect<archil.DiskResponse, ArchilFailed | ArchilNotReady | archil.GetDiskError, archil.ArchilOpContext>;
|
|
68
|
+
/** Wait until a disk is gone after a delete. */
|
|
69
|
+
export declare const waitForDiskGone: (id: string) => Effect.Effect<void, ArchilFailed | ArchilNotReady | archil.ArchilParseError | archil.BadGateway | import("@distilled.cloud/core/errors").BadRequest | archil.BadRequest | archil.ConfigError | import("@distilled.cloud/core/errors").Conflict | import("@distilled.cloud/core/errors").Forbidden | archil.GatewayTimeout | import("effect/http/HttpClientError").HttpClientError | archil.InternalServerError | import("@distilled.cloud/core/protocol-http").InvalidInput | archil.Locked | import("@distilled.cloud/core/sdk-error").SdkError | archil.ServiceUnavailable | archil.TooManyRequests | archil.Unauthorized | archil.UnknownArchilError | archil.UnprocessableEntity, archil.ArchilOpContext>;
|
|
70
|
+
/** Every sandbox in the account (optionally only those mounting a disk). */
|
|
71
|
+
export declare const listSandboxes: (filesystem?: string | undefined) => Effect.Effect<archil.ApiResponseSandboxListDataSandboxesList, archil.ListSandboxesError, archil.ArchilOpContext>;
|
|
72
|
+
/** Find a sandbox by exact name. */
|
|
73
|
+
export declare const findSandboxByName: (name: string) => Effect.Effect<archil.Sandbox | undefined, archil.ListSandboxesError, archil.ArchilOpContext>;
|
|
74
|
+
/** Get a sandbox by id; `undefined` when it doesn't exist. */
|
|
75
|
+
export declare const getSandbox: (sid: string) => Effect.Effect<archil.Sandbox | undefined, archil.ArchilParseError | archil.BadGateway | import("@distilled.cloud/core/errors").BadRequest | archil.ConfigError | import("@distilled.cloud/core/errors").Conflict | import("@distilled.cloud/core/errors").Forbidden | archil.GatewayTimeout | import("effect/http/HttpClientError").HttpClientError | archil.InternalServerError | import("@distilled.cloud/core/protocol-http").InvalidInput | archil.Locked | import("@distilled.cloud/core/sdk-error").SdkError | archil.ServiceUnavailable | archil.TooManyRequests | archil.Unauthorized | archil.UnknownArchilError | archil.UnprocessableEntity, archil.ArchilOpContext>;
|
|
76
|
+
/** Wait until a sandbox leaves its transitional states. */
|
|
77
|
+
export declare const waitForSandbox: (sid: string) => Effect.Effect<archil.Sandbox, ArchilFailed | ArchilNotReady | archil.GetSandboxError, archil.ArchilOpContext>;
|
|
78
|
+
/** States a sandbox can be deleted from. */
|
|
79
|
+
export declare const deletableSandboxStates: Set<string>;
|
|
80
|
+
/** Wait until a stopping sandbox is stopped (or exited, or failed). */
|
|
81
|
+
export declare const waitForSandboxStopped: (sid: string) => Effect.Effect<void, ArchilFailed | ArchilNotReady | archil.ArchilParseError | archil.BadGateway | import("@distilled.cloud/core/errors").BadRequest | archil.ConfigError | import("@distilled.cloud/core/errors").Conflict | import("@distilled.cloud/core/errors").Forbidden | archil.GatewayTimeout | import("effect/http/HttpClientError").HttpClientError | archil.InternalServerError | import("@distilled.cloud/core/protocol-http").InvalidInput | archil.Locked | import("@distilled.cloud/core/sdk-error").SdkError | archil.ServiceUnavailable | archil.TooManyRequests | archil.Unauthorized | archil.UnknownArchilError | archil.UnprocessableEntity, archil.ArchilOpContext>;
|
|
82
|
+
/** Wait until a sandbox is gone after a delete. */
|
|
83
|
+
export declare const waitForSandboxGone: (sid: string) => Effect.Effect<void, ArchilFailed | ArchilNotReady | archil.ArchilParseError | archil.BadGateway | import("@distilled.cloud/core/errors").BadRequest | archil.ConfigError | import("@distilled.cloud/core/errors").Conflict | import("@distilled.cloud/core/errors").Forbidden | archil.GatewayTimeout | import("effect/http/HttpClientError").HttpClientError | archil.InternalServerError | import("@distilled.cloud/core/protocol-http").InvalidInput | archil.Locked | import("@distilled.cloud/core/sdk-error").SdkError | archil.ServiceUnavailable | archil.TooManyRequests | archil.Unauthorized | archil.UnknownArchilError | archil.UnprocessableEntity, archil.ArchilOpContext>;
|
|
84
|
+
/** Wait until an image build finishes. */
|
|
85
|
+
export declare const waitForImage: (imageId: string) => Effect.Effect<archil.Image, ArchilFailed | ArchilNotReady | archil.GetImageError, archil.ArchilOpContext>;
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=archil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archil.d.ts","sources":["../../src/internal/archil.ts"],"names":[],"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
/**
|
|
2
|
+
* Shared Archil helpers: physical names, lookups by name, readiness waits.
|
|
3
|
+
* Archil has no tags or labels, so ownership is the engine-generated
|
|
4
|
+
* physical name (stack, stage, logical id and instance suffix).
|
|
5
|
+
*/
|
|
6
|
+
import * as archil from "@distilled.cloud/archil";
|
|
7
|
+
import { createPhysicalName } from "alchemy/PhysicalName";
|
|
8
|
+
import * as Data from "effect/Data";
|
|
9
|
+
import * as Duration from "effect/Duration";
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import * as Option from "effect/Option";
|
|
12
|
+
import * as Schedule from "effect/Schedule";
|
|
13
|
+
import * as Stream from "effect/Stream";
|
|
14
|
+
/** Disk names: letters, digits, `-` and `_`, at most 100 characters. */
|
|
15
|
+
export const diskName = (id, name) => name ? Effect.succeed(name) : createPhysicalName({ id, maxLength: 100, delimiter: "-" });
|
|
16
|
+
/** Lowercase letters, digits and single `-`, trimmed of leading/trailing `-`. */
|
|
17
|
+
export const toDnsLabel = (value) => value
|
|
18
|
+
.toLowerCase()
|
|
19
|
+
.replace(/[^a-z0-9-]+/g, "-")
|
|
20
|
+
.replace(/-+/g, "-")
|
|
21
|
+
.replace(/^-|-$/g, "");
|
|
22
|
+
/** Sandbox names: lowercase letters, digits and `-`, at most 63 characters. */
|
|
23
|
+
export const sandboxName = (id, name) => name
|
|
24
|
+
? Effect.succeed(name)
|
|
25
|
+
: createPhysicalName({ id, maxLength: 63, delimiter: "-", lowercase: true }).pipe(Effect.map(toDnsLabel));
|
|
26
|
+
/** API token names. */
|
|
27
|
+
export const tokenName = (id, name) => name ? Effect.succeed(name) : createPhysicalName({ id, maxLength: 64, delimiter: "-" });
|
|
28
|
+
/**
|
|
29
|
+
* Whether a name was generated by Alchemy's physical-name scheme: it ends
|
|
30
|
+
* with a delimiter and a base32 instance suffix.
|
|
31
|
+
*/
|
|
32
|
+
export const isAlchemyName = (name) => name !== undefined && /[-_][a-z2-7]{16}$/i.test(name);
|
|
33
|
+
/**
|
|
34
|
+
* Whether a name carries a run-time client's owner prefix,
|
|
35
|
+
* `alc-<id>-<hash of stack/stage/id>-` (see `runtimePrefix`). `list` (and so
|
|
36
|
+
* `pnpm nuke`) finds disks and sandboxes created at run time by it.
|
|
37
|
+
*/
|
|
38
|
+
export const isRuntimeObjectName = (name) => name !== undefined && /^alc-[a-z0-9-]{1,14}-[0-9a-f]{8}-/.test(name);
|
|
39
|
+
/** A resource didn't reach a usable state within its time budget. */
|
|
40
|
+
export class ArchilNotReady extends Data.TaggedError("Archil.NotReady") {
|
|
41
|
+
}
|
|
42
|
+
/** A resource reached a terminal failure state. */
|
|
43
|
+
export class ArchilFailed extends Data.TaggedError("Archil.Failed") {
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Poll `observe` every 2 s (at most ~90 s) until `check` returns a value;
|
|
47
|
+
* `check` returns `undefined` to keep waiting or fails on a terminal state.
|
|
48
|
+
*/
|
|
49
|
+
export const pollUntil = (observe, check, pending) => observe.pipe(Effect.flatMap((value) => check(value).pipe(Effect.flatMap((done) => done === undefined ? Effect.fail(pending(value)) : Effect.succeed(done)))), Effect.retry({
|
|
50
|
+
while: (e) => e._tag === "Archil.NotReady",
|
|
51
|
+
schedule: Schedule.spaced(Duration.seconds(2)),
|
|
52
|
+
times: 45,
|
|
53
|
+
}));
|
|
54
|
+
/** Every disk (or every disk with this exact name), following `nextCursor`. */
|
|
55
|
+
export const listAllDisks = (name) => Stream.paginate(undefined, (cursor) => archil
|
|
56
|
+
.listDisks({ name, cursor, limit: 1000 })
|
|
57
|
+
.pipe(Effect.map(({ data, nextCursor }) => [data, Option.fromNullishOr(nextCursor)])));
|
|
58
|
+
/**
|
|
59
|
+
* Find a live disk by exact name. Archil keeps listing a deleted disk under
|
|
60
|
+
* its name for a while, so those are skipped.
|
|
61
|
+
*/
|
|
62
|
+
export const findDiskByName = Effect.fn(function* (name) {
|
|
63
|
+
return Option.getOrUndefined(yield* listAllDisks(name).pipe(Stream.filter((disk) => disk.name === name && disk.status !== "deleted"), Stream.runHead));
|
|
64
|
+
});
|
|
65
|
+
/** Get a disk by id; `undefined` when it doesn't exist. */
|
|
66
|
+
export const getDisk = (id) => archil.getDisk({ id }).pipe(Effect.map(({ data }) => (data.status === "deleted" ? undefined : data)), Effect.catchTag("NotFound", () => Effect.undefined));
|
|
67
|
+
/** Wait until a disk is `available`. */
|
|
68
|
+
export const waitForDisk = (id) => pollUntil(archil.getDisk({ id }).pipe(Effect.map(({ data }) => data)), (disk) => disk.status === "available"
|
|
69
|
+
? Effect.succeed(disk)
|
|
70
|
+
: disk.status === "failed"
|
|
71
|
+
? Effect.fail(new ArchilFailed({
|
|
72
|
+
resource: "Disk",
|
|
73
|
+
id,
|
|
74
|
+
status: disk.status,
|
|
75
|
+
message: `Disk ${disk.name} failed to provision`,
|
|
76
|
+
}))
|
|
77
|
+
: Effect.undefined, (disk) => new ArchilNotReady({
|
|
78
|
+
resource: "Disk",
|
|
79
|
+
id,
|
|
80
|
+
status: disk.status,
|
|
81
|
+
message: `Disk ${disk.name} is ${disk.status}`,
|
|
82
|
+
}));
|
|
83
|
+
/** Wait until a disk is gone after a delete. */
|
|
84
|
+
export const waitForDiskGone = (id) => pollUntil(getDisk(id), (disk) => (disk === undefined ? Effect.succeed(true) : Effect.undefined), (disk) => new ArchilNotReady({
|
|
85
|
+
resource: "Disk",
|
|
86
|
+
id,
|
|
87
|
+
status: disk?.status ?? "deleted",
|
|
88
|
+
message: `Disk ${disk?.name ?? id} is still ${disk?.status}`,
|
|
89
|
+
})).pipe(Effect.asVoid);
|
|
90
|
+
/** Every sandbox in the account (optionally only those mounting a disk). */
|
|
91
|
+
export const listSandboxes = Effect.fn(function* (filesystem) {
|
|
92
|
+
const { data } = yield* archil.listSandboxes({ filesystem });
|
|
93
|
+
return data.sandboxes ?? [];
|
|
94
|
+
});
|
|
95
|
+
/** Find a sandbox by exact name. */
|
|
96
|
+
export const findSandboxByName = Effect.fn(function* (name) {
|
|
97
|
+
return (yield* listSandboxes()).find((sandbox) => sandbox.name === name && sandbox.status !== "deleted");
|
|
98
|
+
});
|
|
99
|
+
/** Get a sandbox by id; `undefined` when it doesn't exist. */
|
|
100
|
+
export const getSandbox = (sid) => archil.getSandbox({ sid }).pipe(Effect.map(({ data }) => (data.status === "deleted" ? undefined : data)), Effect.catchTag("NotFound", () => Effect.undefined));
|
|
101
|
+
const settledSandboxStates = new Set(["running", "paused", "stopped", "exited"]);
|
|
102
|
+
/** Wait until a sandbox leaves its transitional states. */
|
|
103
|
+
export const waitForSandbox = (sid) => pollUntil(archil.getSandbox({ sid }).pipe(Effect.map(({ data }) => data)), (sandbox) => settledSandboxStates.has(sandbox.status)
|
|
104
|
+
? Effect.succeed(sandbox)
|
|
105
|
+
: sandbox.status === "failed"
|
|
106
|
+
? Effect.fail(new ArchilFailed({
|
|
107
|
+
resource: "Sandbox",
|
|
108
|
+
id: sid,
|
|
109
|
+
status: sandbox.status,
|
|
110
|
+
message: `Sandbox ${sandbox.name} failed${sandbox.exit_reason ? `: ${sandbox.exit_reason}` : ""}`,
|
|
111
|
+
}))
|
|
112
|
+
: Effect.undefined, (sandbox) => new ArchilNotReady({
|
|
113
|
+
resource: "Sandbox",
|
|
114
|
+
id: sid,
|
|
115
|
+
status: sandbox.status,
|
|
116
|
+
message: `Sandbox ${sandbox.name} is ${sandbox.status}`,
|
|
117
|
+
}));
|
|
118
|
+
/** States a sandbox can be deleted from. */
|
|
119
|
+
export const deletableSandboxStates = new Set(["stopped", "exited", "failed"]);
|
|
120
|
+
/** Wait until a stopping sandbox is stopped (or exited, or failed). */
|
|
121
|
+
export const waitForSandboxStopped = (sid) => pollUntil(getSandbox(sid), (sandbox) => sandbox === undefined || deletableSandboxStates.has(sandbox.status)
|
|
122
|
+
? Effect.succeed(true)
|
|
123
|
+
: Effect.undefined, (sandbox) => new ArchilNotReady({
|
|
124
|
+
resource: "Sandbox",
|
|
125
|
+
id: sid,
|
|
126
|
+
status: sandbox?.status ?? "deleted",
|
|
127
|
+
message: `Sandbox ${sandbox?.name ?? sid} is still ${sandbox?.status}`,
|
|
128
|
+
})).pipe(Effect.asVoid);
|
|
129
|
+
/** Wait until a sandbox is gone after a delete. */
|
|
130
|
+
export const waitForSandboxGone = (sid) => pollUntil(getSandbox(sid), (sandbox) => sandbox === undefined || sandbox.status === "deleting"
|
|
131
|
+
? Effect.succeed(true)
|
|
132
|
+
: Effect.undefined, (sandbox) => new ArchilNotReady({
|
|
133
|
+
resource: "Sandbox",
|
|
134
|
+
id: sid,
|
|
135
|
+
status: sandbox?.status ?? "deleted",
|
|
136
|
+
message: `Sandbox ${sandbox?.name ?? sid} is still ${sandbox?.status}`,
|
|
137
|
+
})).pipe(Effect.asVoid);
|
|
138
|
+
/** Wait until an image build finishes. */
|
|
139
|
+
export const waitForImage = (imageId) => pollUntil(archil.getImage({ image_id: imageId }).pipe(Effect.map(({ data }) => data)), (image) => image.status === "ready"
|
|
140
|
+
? Effect.succeed(image)
|
|
141
|
+
: image.status === "failed"
|
|
142
|
+
? Effect.fail(new ArchilFailed({
|
|
143
|
+
resource: "Image",
|
|
144
|
+
id: imageId,
|
|
145
|
+
status: `failed${image.failure_reason ? ` (${image.failure_reason})` : ""}`,
|
|
146
|
+
message: `Image ${image.source} failed to build${image.failure_reason ? `: ${image.failure_reason}` : ""}`,
|
|
147
|
+
}))
|
|
148
|
+
: Effect.undefined, (image) => new ArchilNotReady({
|
|
149
|
+
resource: "Image",
|
|
150
|
+
id: imageId,
|
|
151
|
+
status: image.status,
|
|
152
|
+
message: `Image ${image.source} is ${image.status}`,
|
|
153
|
+
}));
|
|
154
|
+
//# sourceMappingURL=archil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archil.js","sources":["../../src/internal/archil.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAA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an Archil sandbox service (`archil-sandbox services
|
|
4
|
+
* create`), which restarts when it crashes and starts whenever the sandbox
|
|
5
|
+
* boots.
|
|
6
|
+
*/
|
|
7
|
+
import * as archil from "@distilled.cloud/archil";
|
|
8
|
+
import * as Process from "@distilled.cloud/archil/Process";
|
|
9
|
+
import * as Bundle from "alchemy/Bundle/Bundle";
|
|
10
|
+
import { type PackageInstall } from "alchemy/Bundle/InstalledPackages";
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import * as FileSystem from "effect/FileSystem";
|
|
13
|
+
import * as Path from "effect/Path";
|
|
14
|
+
import type * as rolldown from "rolldown";
|
|
15
|
+
declare const ProgramDeployFailed_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
16
|
+
readonly _tag: "Archil.ProgramDeployFailed";
|
|
17
|
+
} & Readonly<A>;
|
|
18
|
+
/** A sandbox program failed to deploy or never started serving. */
|
|
19
|
+
export declare class ProgramDeployFailed extends ProgramDeployFailed_base<{
|
|
20
|
+
readonly program: string;
|
|
21
|
+
readonly message: string;
|
|
22
|
+
}> {
|
|
23
|
+
}
|
|
24
|
+
/** Bundler options for a program, plus packages installed instead of bundled. */
|
|
25
|
+
export interface ProgramBuildOptions extends Bundle.BundleConfig {
|
|
26
|
+
/**
|
|
27
|
+
* Packages to `npm install` next to the program instead of bundling them
|
|
28
|
+
* (native modules, or frameworks that load files at run time).
|
|
29
|
+
*/
|
|
30
|
+
readonly install?: PackageInstall;
|
|
31
|
+
}
|
|
32
|
+
/** A host directory (or file) uploaded with the program. */
|
|
33
|
+
export interface ProgramExtraFile {
|
|
34
|
+
readonly source: string;
|
|
35
|
+
/** Destination relative to the program's directory; `"."` is the root. */
|
|
36
|
+
readonly destination: string;
|
|
37
|
+
}
|
|
38
|
+
export interface HostedProgramProps {
|
|
39
|
+
readonly main: string;
|
|
40
|
+
readonly handler?: string;
|
|
41
|
+
readonly isExternal?: boolean;
|
|
42
|
+
readonly build?: ProgramBuildOptions;
|
|
43
|
+
readonly extraFiles?: ReadonlyArray<ProgramExtraFile>;
|
|
44
|
+
}
|
|
45
|
+
type ProgramFile = {
|
|
46
|
+
readonly path: string;
|
|
47
|
+
readonly content: Uint8Array;
|
|
48
|
+
};
|
|
49
|
+
export interface BundledProgram {
|
|
50
|
+
readonly files: ReadonlyArray<ProgramFile>;
|
|
51
|
+
readonly hash: string;
|
|
52
|
+
/** The entry `node` runs, relative to the program's directory. */
|
|
53
|
+
readonly entryRel: string;
|
|
54
|
+
/** Whether the program has a `package.json` to `npm install`. */
|
|
55
|
+
readonly install: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Pack `main` into the files of a Node program.
|
|
59
|
+
*
|
|
60
|
+
* - The Effect form bundles `main` behind the package bootstrap.
|
|
61
|
+
* - The async form bundles `main` behind a `node:http` server for its
|
|
62
|
+
* `fetch(request, env)`.
|
|
63
|
+
* - With `extraFiles`, `main` is already a complete Node program (a
|
|
64
|
+
* framework's server entry): it is uploaded as built, with its tree.
|
|
65
|
+
*/
|
|
66
|
+
export declare const bundleProgram: (props: HostedProgramProps, virtualEntryPlugin: (content: (importPath: string) => string) => rolldown.Plugin) => Effect.Effect<{
|
|
67
|
+
files: ProgramFile[];
|
|
68
|
+
hash: string;
|
|
69
|
+
entryRel: string;
|
|
70
|
+
install: boolean;
|
|
71
|
+
}, Bundle.BundleError | import("effect/PlatformError").PlatformError, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | FileSystem.FileSystem | Path.Path>;
|
|
72
|
+
/** Boot a sandbox that is paused or stopped, and wait until it runs. */
|
|
73
|
+
export declare const ensureRunning: (sid: string) => Effect.Effect<undefined, import("./archil.ts").ArchilFailed | import("./archil.ts").ArchilNotReady | archil.ArchilParseError | archil.BadGateway | import("@distilled.cloud/core/errors").BadRequest | archil.BadRequest | archil.ConfigError | import("@distilled.cloud/core/errors").Conflict | import("@distilled.cloud/core/errors").Forbidden | archil.GatewayTimeout | import("effect/http/HttpClientError").HttpClientError | archil.InternalServerError | import("@distilled.cloud/core/protocol-http").InvalidInput | archil.Locked | import("@distilled.cloud/core/errors").NotFound | archil.NotFound | ProgramDeployFailed | archil.SandboxMountsWhileActive | archil.SandboxPausing | archil.SandboxStopping | archil.SandboxTerminated | import("@distilled.cloud/core/sdk-error").SdkError | archil.ServiceUnavailable | archil.TooManyRequests | archil.Unauthorized | archil.UnknownArchilError | archil.UnprocessableEntity, archil.ArchilOpContext>;
|
|
74
|
+
/** The directory a program lives in. */
|
|
75
|
+
export declare const programDir: (name: string) => string;
|
|
76
|
+
/**
|
|
77
|
+
* Upload the program, (re)define its service, and wait until it answers on
|
|
78
|
+
* `port` inside the sandbox.
|
|
79
|
+
*/
|
|
80
|
+
export declare const deployProgram: (input: {
|
|
81
|
+
readonly sid: string;
|
|
82
|
+
readonly name: string;
|
|
83
|
+
readonly port: number;
|
|
84
|
+
readonly program: BundledProgram;
|
|
85
|
+
readonly env: Record<string, unknown>;
|
|
86
|
+
}) => Effect.Effect<undefined, import("./archil.ts").ArchilFailed | import("./archil.ts").ArchilNotReady | archil.BadRequest | Process.ProcessError | ProgramDeployFailed | archil.SandboxMountsWhileActive | archil.SandboxPausing | archil.SandboxStopping | archil.CreateSandboxConnectionError, archil.ArchilOpContext>;
|
|
87
|
+
/** Stop the program and remove its files. Removing a missing one succeeds. */
|
|
88
|
+
export declare const removeProgram: (sid: string, name: string) => Effect.Effect<void, import("./archil.ts").ArchilFailed | import("./archil.ts").ArchilNotReady | archil.BadRequest | Process.ProcessError | ProgramDeployFailed | archil.SandboxMountsWhileActive | archil.SandboxPausing | archil.SandboxStopping | archil.CreateSandboxConnectionError, archil.ArchilOpContext>;
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=hosted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted.d.ts","sources":["../../src/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