@thinair/factory 0.1.149 → 0.1.155
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/cli/template.ts
CHANGED
|
@@ -20,7 +20,7 @@ export default defineFactory({
|
|
|
20
20
|
repositories: [hole("Repository", "main")],
|
|
21
21
|
rules: [hole("Rule", "intake")],
|
|
22
22
|
stages: [hole("Stage", "change")],
|
|
23
|
-
fleet: [hole("Pool", "
|
|
23
|
+
fleet: [hole("Pool", "fleet")],
|
|
24
24
|
agents: [hole("Agent", "coder")],
|
|
25
25
|
});
|
|
26
26
|
`;
|
|
@@ -2,9 +2,9 @@ import { Schema } from "effect";
|
|
|
2
2
|
import { AUTHORED, authoredHead, head, NodeTag, type HoleFor, type LiveRows } from "./node";
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
* A Hole: a part still to build. `hole("Pool", "
|
|
5
|
+
* A Hole: a part still to build. `hole("Pool", "fleet")` plans a pool where
|
|
6
6
|
* one will go; the floor draws it dashed amber, "to build". It keeps the id
|
|
7
|
-
* of the node it stands for (`pool:
|
|
7
|
+
* of the node it stands for (`pool:fleet`), so filling it is one change in
|
|
8
8
|
* place and every Ref to it still holds. The engine skips holes, and types
|
|
9
9
|
* already stop compose from wanting one.
|
|
10
10
|
*/
|
|
@@ -3,17 +3,28 @@ import { AUTHORED, authoredHead, head, type Authored, type LiveRows } from "./no
|
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
* A pool names a provider and an optional narrowing, nothing else.
|
|
6
|
-
* `pool.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
6
|
+
* `pool.fleet()` means the computers that lend to the factory's owner: a
|
|
7
|
+
* job that needs macOS runs as a host command on one of the owner's Macs, a
|
|
8
|
+
* Linux job in a sealed VM on any of them, and in Thinair Cloud too once the
|
|
9
|
+
* owner names the factory's Cloud Organization. Room, os, arch, VMs,
|
|
10
|
+
* identities and reserve come only from each computer's facts, so two
|
|
11
|
+
* factories never give placement two truths about one computer. The plane
|
|
12
|
+
* gives pools their meaning: its executors.
|
|
12
13
|
*/
|
|
13
14
|
|
|
14
|
-
export const PROVIDERS = ["
|
|
15
|
-
|
|
15
|
+
export const PROVIDERS = ["fleet", "github-actions"] as const;
|
|
16
|
+
/**
|
|
17
|
+
* Providers a program stored before one `fleet` took their place may still name (`pool:macs`, `pool:thinair-cloud`,
|
|
18
|
+
* `pool:namespace`): read so a running factory's program stays readable until its next live load, never authored.
|
|
19
|
+
* Placement reads `macs` and `thinair-cloud` as `fleet`; `namespace` never had a filling.
|
|
20
|
+
*/
|
|
21
|
+
export const RETIRED_PROVIDERS = ["macs", "thinair-cloud", "namespace"] as const;
|
|
22
|
+
export const Provider = Schema.Literals([...PROVIDERS, ...RETIRED_PROVIDERS]);
|
|
16
23
|
export type Provider = typeof Provider.Type;
|
|
24
|
+
export type AuthoredProvider = (typeof PROVIDERS)[number];
|
|
25
|
+
|
|
26
|
+
/** Whether a pool names the owner's fleet: `fleet`, or a retired name that meant part of it. */
|
|
27
|
+
export const isFleet = (provider: Provider) => provider === "fleet" || provider === "macs" || provider === "thinair-cloud";
|
|
17
28
|
|
|
18
29
|
export const Os = Schema.Literals(["mac", "linux", "windows"]);
|
|
19
30
|
export type Os = typeof Os.Type;
|
|
@@ -27,7 +38,7 @@ export type Narrowing = typeof Narrowing.Type;
|
|
|
27
38
|
export const Node = Schema.TaggedStruct("Pool", { ...head, provider: Provider, ...Narrowing.fields });
|
|
28
39
|
export type Node = typeof Node.Type;
|
|
29
40
|
|
|
30
|
-
export interface AuthoredPool<P extends
|
|
41
|
+
export interface AuthoredPool<P extends AuthoredProvider = AuthoredProvider> extends Authored<"Pool", P> {
|
|
31
42
|
readonly provider: P;
|
|
32
43
|
readonly os: ReadonlyArray<Os>;
|
|
33
44
|
readonly arch: ReadonlyArray<Arch>;
|
|
@@ -35,30 +46,22 @@ export interface AuthoredPool<P extends Provider = Provider> extends Authored<"P
|
|
|
35
46
|
|
|
36
47
|
type Narrow = Readonly<{ os?: ReadonlyArray<Os>; arch?: ReadonlyArray<Arch> }>;
|
|
37
48
|
|
|
38
|
-
const made = <const P extends
|
|
49
|
+
const made = <const P extends AuthoredProvider>(provider: P, narrow: Narrow | undefined): AuthoredPool<P> => ({
|
|
39
50
|
[AUTHORED]: authoredHead("Pool", provider, false),
|
|
40
51
|
provider,
|
|
41
52
|
os: narrow?.os ?? [],
|
|
42
53
|
arch: narrow?.arch ?? [],
|
|
43
54
|
});
|
|
44
55
|
|
|
45
|
-
/** The pools a factory can name. Each is named after its provider: `pool:
|
|
56
|
+
/** The pools a factory can name. Each is named after its provider: `pool:fleet`. */
|
|
46
57
|
export const pool = {
|
|
47
|
-
/** Every Mac that granted this factory `work`. */
|
|
48
|
-
macs: (narrow?: Narrow) => made("macs", narrow),
|
|
49
58
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
59
|
+
* The computers that lend to the factory's owner. A job whose `needs.os` is `["linux"]` runs in a sealed Linux VM; any
|
|
60
|
+
* other job runs as a host command on one of the owner's Macs. `os` narrows the kinds of computer (`mac`, `linux`,
|
|
61
|
+
* `windows`), `arch` the CPU families a job's VM runs on (`x64` runs natively on Thinair Cloud's x86_64 hosts). Thinair
|
|
62
|
+
* Cloud lends too once the owner names the factory's Cloud Organization (`factory.cloud.set`), billed to it.
|
|
52
63
|
*/
|
|
53
64
|
fleet: (narrow?: Narrow) => made("fleet", narrow),
|
|
54
|
-
/**
|
|
55
|
-
* Sealed Linux VMs in Thinair Cloud, in the Organization the factory's owner names (`factory.cloud.set`; Thinair's
|
|
56
|
-
* own factories name Thinair Computer Inc) and billed to it. Cloud's placer picks the host; `arch` narrows the CPU
|
|
57
|
-
* family (`x64` runs natively on Cloud's x86_64 hosts).
|
|
58
|
-
*/
|
|
59
|
-
thinairCloud: (narrow?: Narrow) => made("thinair-cloud", narrow),
|
|
60
|
-
/** Namespace instances, with the Profile's key. */
|
|
61
|
-
namespace: (narrow?: Narrow) => made("namespace", narrow),
|
|
62
65
|
/** GitHub Actions runners, dispatched with the Agents App. */
|
|
63
66
|
githubActions: (narrow?: Narrow) => made("github-actions", narrow),
|
|
64
67
|
};
|
package/package.json
CHANGED