@thinair/factory 0.1.170 → 0.1.175

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.
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { AUTHORED, authoredHead, head, type Authored, type Encoder, type LiveRows } from "./node";
2
+ import { AUTHORED, authoredHead, head, type Authored, type LiveRows } from "./node";
3
3
 
4
4
  /*
5
5
  * A pool names a provider and an optional narrowing, nothing else.
@@ -13,19 +13,11 @@ import { AUTHORED, authoredHead, head, type Authored, type Encoder, type LiveRow
13
13
  */
14
14
 
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
+ export const Provider = Schema.Literals(PROVIDERS);
23
17
  export type Provider = typeof Provider.Type;
24
- export type AuthoredProvider = (typeof PROVIDERS)[number];
25
- export type RetiredProvider = (typeof RETIRED_PROVIDERS)[number];
26
18
 
27
- /** Whether a pool names the owner's fleet: `fleet`, or a retired name that meant part of it. */
28
- export const isFleet = (provider: Provider) => provider === "fleet" || provider === "macs" || provider === "thinair-cloud";
19
+ /** Whether a pool names the owner's fleet. */
20
+ export const isFleet = (provider: Provider) => provider === "fleet";
29
21
 
30
22
  export const Os = Schema.Literals(["mac", "linux", "windows"]);
31
23
  export type Os = typeof Os.Type;
@@ -39,37 +31,21 @@ export type Narrowing = typeof Narrowing.Type;
39
31
  export const Node = Schema.TaggedStruct("Pool", { ...head, provider: Provider, ...Narrowing.fields });
40
32
  export type Node = typeof Node.Type;
41
33
 
42
- export interface AuthoredPool<P extends AuthoredProvider = AuthoredProvider> extends Authored<"Pool", string> {
34
+ export interface AuthoredPool<P extends Provider = Provider> extends Authored<"Pool", string> {
43
35
  readonly provider: P;
44
36
  readonly os: ReadonlyArray<Os>;
45
37
  readonly arch: ReadonlyArray<Arch>;
46
- /** The retired constructor that made it, when one did: it runs as the fleet, and the load says so. */
47
- readonly retired?: RetiredProvider;
48
38
  }
49
39
 
50
40
  type Narrow = Readonly<{ os?: ReadonlyArray<Os>; arch?: ReadonlyArray<Arch> }>;
51
41
 
52
- const made = <const P extends AuthoredProvider>(provider: P, narrow: Narrow | undefined): AuthoredPool<P> => ({
42
+ const made = <const P extends Provider>(provider: P, narrow: Narrow | undefined): AuthoredPool<P> => ({
53
43
  [AUTHORED]: authoredHead("Pool", provider, false),
54
44
  provider,
55
45
  os: narrow?.os ?? [],
56
46
  arch: narrow?.arch ?? [],
57
47
  });
58
48
 
59
- /**
60
- * A retired constructor, kept so code written before one fleet still loads and its passes still run: it makes the
61
- * fleet with the same narrowing, under its own name (`pool:macs`), so its node and every Ref to it stay as they were.
62
- */
63
- const retired = (name: RetiredProvider) => (narrow?: Narrow): AuthoredPool<"fleet"> => ({
64
- [AUTHORED]: authoredHead("Pool", name, false),
65
- provider: "fleet",
66
- os: narrow?.os ?? [],
67
- arch: narrow?.arch ?? [],
68
- retired: name,
69
- });
70
-
71
- const RETIRED_CALL: Readonly<Record<RetiredProvider, string>> = { macs: "pool.macs()", "thinair-cloud": "pool.thinairCloud()", namespace: "pool.namespace()" };
72
-
73
49
  /** The pools a factory can name. Each is named after its provider: `pool:fleet`. */
74
50
  export const pool = {
75
51
  /**
@@ -81,19 +57,9 @@ export const pool = {
81
57
  fleet: (narrow?: Narrow) => made("fleet", narrow),
82
58
  /** GitHub Actions runners, dispatched with the Agents App. */
83
59
  githubActions: (narrow?: Narrow) => made("github-actions", narrow),
84
- /** @deprecated The fleet: use `pool.fleet()`. It makes the fleet with this narrowing, and the load says so. */
85
- macs: retired("macs"),
86
- /** @deprecated The fleet, which Thinair Cloud joins once the owner names the factory's Cloud Organization: use `pool.fleet()`. */
87
- thinairCloud: retired("thinair-cloud"),
88
- /** @deprecated Never had a filling: use `pool.fleet()`. It makes the fleet with this narrowing, and the load says so. */
89
- namespace: retired("namespace"),
90
60
  };
91
61
 
92
- export const make = (authored: AuthoredPool, encoder: Encoder) => {
93
- if (authored.retired !== undefined)
94
- encoder.notice(`${RETIRED_CALL[authored.retired]} is pool.fleet() now: it runs as the fleet with the same narrowing. Rename it to pool.fleet().`);
95
- return { provider: authored.provider, os: [...authored.os], arch: [...authored.arch] };
96
- };
62
+ export const make = (authored: AuthoredPool) => ({ provider: authored.provider, os: [...authored.os], arch: [...authored.arch] });
97
63
 
98
64
  /** The machines placement can use now, from their own facts. */
99
65
  export const live = (node: Node, rows: LiveRows) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinair/factory",
3
- "version": "0.1.170",
3
+ "version": "0.1.175",
4
4
  "description": "The Thinair factory SDK: the language a factory's code is written in, and the loader that checks it.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",