@catamorphic/work-server 0.1.0-alpha.39 → 0.1.0-alpha.41
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/NOTICE.txt +7 -0
- package/README.md +9 -9
- package/dist/admission/routes.d.ts +1 -1
- package/dist/admission/routes.d.ts.map +1 -1
- package/dist/agent-capabilities.d.ts.map +1 -1
- package/dist/agents.d.ts +5 -6
- package/dist/agents.d.ts.map +1 -1
- package/dist/auth/fastify-auth.d.ts.map +1 -1
- package/dist/auth/work-auth-types.d.ts +2 -0
- package/dist/auth/work-auth-types.d.ts.map +1 -1
- package/dist/auth/work-auth.d.ts.map +1 -1
- package/dist/chunk-kcck20aw.js +676 -0
- package/dist/chunk-kcck20aw.js.map +11 -0
- package/dist/cluster.d.ts +8 -7
- package/dist/cluster.d.ts.map +1 -1
- package/dist/config.d.ts +5 -15
- package/dist/config.d.ts.map +1 -1
- package/dist/execution-config.d.ts +22 -0
- package/dist/execution-config.d.ts.map +1 -1
- package/dist/fake-agent.d.ts +1 -0
- package/dist/fake-agent.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2730 -2851
- package/dist/index.js.map +28 -28
- package/dist/machines/contract-kit.d.ts +91 -0
- package/dist/machines/contract-kit.d.ts.map +1 -0
- package/dist/machines/contract.d.ts +383 -0
- package/dist/machines/contract.d.ts.map +1 -0
- package/dist/machines/sequencer.d.ts +267 -0
- package/dist/machines/sequencer.d.ts.map +1 -0
- package/dist/machines/simulation.d.ts +124 -0
- package/dist/machines/simulation.d.ts.map +1 -0
- package/dist/machines/work-machines.d.ts +61 -0
- package/dist/machines/work-machines.d.ts.map +1 -0
- package/dist/server.d.ts +15 -11
- package/dist/server.d.ts.map +1 -1
- package/dist/setup/machines.d.ts +9 -17
- package/dist/setup/machines.d.ts.map +1 -1
- package/dist/shares/share-routes.d.ts +1 -1
- package/dist/shares/share-routes.d.ts.map +1 -1
- package/dist/testing.d.ts +8 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +1013 -0
- package/dist/testing.js.map +11 -0
- package/dist/workers/disk-care.d.ts +41 -0
- package/dist/workers/disk-care.d.ts.map +1 -0
- package/dist/workers/harness-sign-ins.d.ts +146 -0
- package/dist/workers/harness-sign-ins.d.ts.map +1 -0
- package/dist/workers/machine-store.d.ts +196 -0
- package/dist/workers/machine-store.d.ts.map +1 -0
- package/dist/workers/member-machine-routes.d.ts +5 -3
- package/dist/workers/member-machine-routes.d.ts.map +1 -1
- package/dist/workers/member-machines.d.ts +47 -28
- package/dist/workers/member-machines.d.ts.map +1 -1
- package/dist/workers/placement.d.ts +23 -40
- package/dist/workers/placement.d.ts.map +1 -1
- package/dist/workers/sign-ins.d.ts +44 -17
- package/dist/workers/sign-ins.d.ts.map +1 -1
- package/dist/workers/worker-protocol.d.ts +5 -2
- package/dist/workers/worker-protocol.d.ts.map +1 -1
- package/dist/workers/worker-registry.d.ts +174 -223
- package/dist/workers/worker-registry.d.ts.map +1 -1
- package/dist/workers/worker-routes.d.ts.map +1 -1
- package/dist/workers/worker-runtime.d.ts.map +1 -1
- package/package.json +31 -21
- package/src/admission/routes.ts +5 -2
- package/src/agent-capabilities.ts +22 -8
- package/src/agents.ts +52 -23
- package/src/auth/fastify-auth.ts +149 -17
- package/src/auth/work-auth-types.ts +2 -0
- package/src/auth/work-auth.ts +27 -0
- package/src/cluster.ts +115 -42
- package/src/config.ts +15 -41
- package/src/execution-config.ts +40 -0
- package/src/fake-agent.ts +21 -4
- package/src/index.ts +26 -12
- package/src/machines/contract-kit.ts +648 -0
- package/src/machines/contract.ts +522 -0
- package/src/machines/sequencer.ts +1010 -0
- package/src/machines/simulation.ts +833 -0
- package/src/machines/work-machines.ts +231 -0
- package/src/server.ts +235 -150
- package/src/setup/machines.ts +128 -121
- package/src/shares/share-routes.ts +17 -1
- package/src/testing.ts +22 -0
- package/src/workers/disk-care.ts +121 -0
- package/src/workers/fake-claude-cli.ts +95 -0
- package/src/workers/fake-codex-cli.ts +11 -4
- package/src/workers/harness-sign-ins.ts +580 -0
- package/src/workers/machine-store.ts +1065 -0
- package/src/workers/member-machine-routes.ts +92 -20
- package/src/workers/member-machines.ts +163 -99
- package/src/workers/placement.ts +59 -70
- package/src/workers/sign-ins.ts +109 -52
- package/src/workers/worker-protocol.ts +5 -2
- package/src/workers/worker-registry.ts +894 -754
- package/src/workers/worker-routes.ts +4 -1
- package/src/workers/worker-runtime.ts +55 -23
- package/dist/test-support.d.ts +0 -133
- package/dist/test-support.d.ts.map +0 -1
- package/dist/workers/codex-sign-ins.d.ts +0 -107
- package/dist/workers/codex-sign-ins.d.ts.map +0 -1
- package/dist/workers/install-script.d.ts +0 -71
- package/dist/workers/install-script.d.ts.map +0 -1
- package/dist/workers/machine-classes.d.ts +0 -115
- package/dist/workers/machine-classes.d.ts.map +0 -1
- package/dist/workers/machine-rules.d.ts +0 -402
- package/dist/workers/machine-rules.d.ts.map +0 -1
- package/src/test-support.ts +0 -404
- package/src/workers/codex-sign-ins.ts +0 -360
- package/src/workers/install-script.ts +0 -394
- package/src/workers/machine-classes.ts +0 -152
- package/src/workers/machine-rules.ts +0 -1954
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { MachinesHook, PersonFacts, WaitingWork } from "./contract.js";
|
|
2
|
+
import { type SimulatedWorkOptions } from "./simulation.js";
|
|
3
|
+
/** A check failed. Its message says what happened and what to change. */
|
|
4
|
+
export declare class MachinesContractError extends Error {
|
|
5
|
+
readonly check: string;
|
|
6
|
+
constructor(check: string, message: string);
|
|
7
|
+
}
|
|
8
|
+
/** The provisioner half of a hook: the calls that touch the host's cloud. */
|
|
9
|
+
export type MachineProvisioner = Pick<MachinesHook, "create" | "destroy" | "stop" | "start" | "describe">;
|
|
10
|
+
/** A hook from a plan and a provisioner, as hosts compose them. */
|
|
11
|
+
export declare function machinesHook(args: {
|
|
12
|
+
plan: MachinesHook["plan"];
|
|
13
|
+
provisioner: MachineProvisioner;
|
|
14
|
+
onEvent?: MachinesHook["onEvent"];
|
|
15
|
+
}): MachinesHook;
|
|
16
|
+
/** One machine in a {@link MemoryCloud}. */
|
|
17
|
+
export interface MemoryCloudMachine {
|
|
18
|
+
ref: string;
|
|
19
|
+
name: string;
|
|
20
|
+
idempotencyKey: string;
|
|
21
|
+
state: "running" | "stopped" | "gone";
|
|
22
|
+
options: Readonly<Record<string, unknown>>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* An in-memory cloud for tests of a plan: a provisioner that keeps its
|
|
26
|
+
* machines in a list, honors idempotency keys, stops, starts and
|
|
27
|
+
* describes. `kill` ends a machine as a cloud would (a Spot reclaim, a
|
|
28
|
+
* terminated instance).
|
|
29
|
+
*/
|
|
30
|
+
export declare class MemoryCloud {
|
|
31
|
+
readonly machines: MemoryCloudMachine[];
|
|
32
|
+
/** Answers `create` gives instead of making a machine, in order. */
|
|
33
|
+
readonly refusals: string[];
|
|
34
|
+
private count;
|
|
35
|
+
/** Machines that still exist. */
|
|
36
|
+
alive(): MemoryCloudMachine[];
|
|
37
|
+
kill(ref: string): void;
|
|
38
|
+
provisioner(options?: {
|
|
39
|
+
stoppable?: boolean;
|
|
40
|
+
}): MachineProvisioner;
|
|
41
|
+
}
|
|
42
|
+
/** What a provisioner check knows about the cloud behind it, when a test can say. */
|
|
43
|
+
export interface PlatformProbe {
|
|
44
|
+
/** How many machines exist on the platform right now (running or stopped). */
|
|
45
|
+
count(): Promise<number> | number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Check a provisioner's verbs directly, as Work calls them: `create` twice
|
|
49
|
+
* with one key makes one machine, `stop` and `start` (when it has them)
|
|
50
|
+
* may be repeated, `destroy` may be repeated and removes a machine whose
|
|
51
|
+
* create answer was lost. Pass `platform` when the test can count the
|
|
52
|
+
* machines behind it, and `between` to let a fake cloud's time pass
|
|
53
|
+
* between repeats.
|
|
54
|
+
*/
|
|
55
|
+
export declare function checkMachineProvisioner(args: {
|
|
56
|
+
provisioner: MachineProvisioner;
|
|
57
|
+
/** The options a plan would give these machines. */
|
|
58
|
+
options?: Readonly<Record<string, unknown>>;
|
|
59
|
+
labels?: Readonly<Record<string, string>>;
|
|
60
|
+
platform?: PlatformProbe;
|
|
61
|
+
/** Runs between repeats of a verb: move a fake cloud's clock here. */
|
|
62
|
+
between?: () => Promise<void> | void;
|
|
63
|
+
/** The name the check's machine gets. */
|
|
64
|
+
name?: string;
|
|
65
|
+
}): Promise<void>;
|
|
66
|
+
/** Facts a plan is checked with. */
|
|
67
|
+
export interface ContractFacts {
|
|
68
|
+
people?: readonly PersonFacts[];
|
|
69
|
+
/** Work that waits when the check starts. */
|
|
70
|
+
work?: ReadonlyArray<Partial<Omit<WaitingWork, "id">> & {
|
|
71
|
+
project: string;
|
|
72
|
+
}>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Check a whole hook against a simulated Work. Give it facts under which
|
|
76
|
+
* the plan wants at least one machine (people, waiting work). Throws a
|
|
77
|
+
* {@link MachinesContractError} that reads as an instruction.
|
|
78
|
+
*/
|
|
79
|
+
export declare function checkMachinesHook(args: {
|
|
80
|
+
hook: MachinesHook;
|
|
81
|
+
facts?: ContractFacts;
|
|
82
|
+
/** Runs whenever the simulated clock moves: move a fake cloud's clock too. */
|
|
83
|
+
onAdvance?: (now: string) => Promise<void> | void;
|
|
84
|
+
/** End a machine on the platform as a cloud would, so its loss is real. */
|
|
85
|
+
kill?: (machine: {
|
|
86
|
+
name: string;
|
|
87
|
+
ref: string | null;
|
|
88
|
+
}) => Promise<void> | void;
|
|
89
|
+
simulation?: Omit<SimulatedWorkOptions, "hook" | "people">;
|
|
90
|
+
}): Promise<void>;
|
|
91
|
+
//# sourceMappingURL=contract-kit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-kit.d.ts","sourceRoot":"","sources":["../../src/machines/contract-kit.ts"],"names":[],"mappings":"AACA,OAA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f,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;KACpB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC;CAC5D,GAAG,OAAO,CAAC,IAAI,CAAC,CAyKhB"}
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Who may place work on a machine: one user (their account id), one
|
|
4
|
+
* project's own work (project chats and automations), or one chat of a
|
|
5
|
+
* project by its chat key.
|
|
6
|
+
*/
|
|
7
|
+
export type MachinePrincipal = {
|
|
8
|
+
user: string;
|
|
9
|
+
} | {
|
|
10
|
+
project: string;
|
|
11
|
+
} | {
|
|
12
|
+
project: string;
|
|
13
|
+
key: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const MachinePrincipalSchema: z.ZodType<MachinePrincipal, MachinePrincipal>;
|
|
16
|
+
/** Labels the Work server sets on every node itself (ADR 0167). */
|
|
17
|
+
export declare const RESERVED_LABELS: readonly ["node", "plane"];
|
|
18
|
+
export declare const MachineLabelsSchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
19
|
+
/** A machine's name: it becomes a worker name, a host name and a cloud tag. */
|
|
20
|
+
export declare const MachineNameSchema: z.ZodString;
|
|
21
|
+
/** Minutes a machine that was serving may go unseen before it is lost. */
|
|
22
|
+
export declare const DEFAULT_LOST_AFTER_MINUTES = 5;
|
|
23
|
+
/** One machine the host wants to exist. */
|
|
24
|
+
export interface DesiredMachine {
|
|
25
|
+
/** Stable name chosen by the host; Work matches machines by it. */
|
|
26
|
+
name: string;
|
|
27
|
+
/**
|
|
28
|
+
* Who may place work here: users, projects, chat keys. Omitted: anyone
|
|
29
|
+
* whose role and Environment allow it. An empty list: nobody (a spare).
|
|
30
|
+
*/
|
|
31
|
+
for?: readonly MachinePrincipal[];
|
|
32
|
+
/** Labels an Environment's `pool` selects on. */
|
|
33
|
+
labels?: Readonly<Record<string, string>>;
|
|
34
|
+
/** Default "running". "stopped" keeps the disk. */
|
|
35
|
+
state?: "running" | "stopped";
|
|
36
|
+
/**
|
|
37
|
+
* Opaque to Work; handed to the hook's verbs. Not applied to an existing
|
|
38
|
+
* machine: a new shape is a new name.
|
|
39
|
+
*/
|
|
40
|
+
options?: Readonly<Record<string, unknown>>;
|
|
41
|
+
/** The people it serves trust each other, so process isolation is enough. */
|
|
42
|
+
trusted?: boolean;
|
|
43
|
+
/** Minutes unreachable before Work calls it lost; the server's default is 5. */
|
|
44
|
+
lostAfterMinutes?: number;
|
|
45
|
+
/** Shown beside the machine, so a person can see why it exists or was stopped. */
|
|
46
|
+
reason?: string;
|
|
47
|
+
}
|
|
48
|
+
export declare const DesiredMachineSchema: z.ZodObject<{
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
for: z.ZodOptional<z.ZodArray<z.ZodType<MachinePrincipal, MachinePrincipal, z.core.$ZodTypeInternals<MachinePrincipal, MachinePrincipal>>>>;
|
|
51
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
52
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
53
|
+
running: "running";
|
|
54
|
+
stopped: "stopped";
|
|
55
|
+
}>>;
|
|
56
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
57
|
+
trusted: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
+
lostAfterMinutes: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
/** What a plan may return: at most this many machines, each name once. */
|
|
62
|
+
export declare const MAX_PLANNED_MACHINES = 1000;
|
|
63
|
+
export declare const MachinePlanSchema: z.ZodArray<z.ZodObject<{
|
|
64
|
+
name: z.ZodString;
|
|
65
|
+
for: z.ZodOptional<z.ZodArray<z.ZodType<MachinePrincipal, MachinePrincipal, z.core.$ZodTypeInternals<MachinePrincipal, MachinePrincipal>>>>;
|
|
66
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
67
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
68
|
+
running: "running";
|
|
69
|
+
stopped: "stopped";
|
|
70
|
+
}>>;
|
|
71
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
72
|
+
trusted: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
lostAfterMinutes: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$strict>>;
|
|
76
|
+
/**
|
|
77
|
+
* Where a machine stands:
|
|
78
|
+
*
|
|
79
|
+
* - `starting`: Work is making it (its create may not have answered yet),
|
|
80
|
+
* or it has not connected for the first time.
|
|
81
|
+
* - `serving`: connected and taking work.
|
|
82
|
+
* - `draining`: the plan no longer names it; it takes no new work and is
|
|
83
|
+
* destroyed once it holds none.
|
|
84
|
+
* - `stopping`, `stopped`, `resuming`: its disk is kept; it offers no
|
|
85
|
+
* capacity until it serves again.
|
|
86
|
+
* - `unreachable`: it was serving and has not called since its lease lapsed.
|
|
87
|
+
* - `lost`: unreachable for its limit; its work is retired.
|
|
88
|
+
* - `disabled`: an operator disabled it; its work waits and it is never lost.
|
|
89
|
+
* - `destroying`: Work is asking the hook to destroy it.
|
|
90
|
+
*/
|
|
91
|
+
export type MachineState = "starting" | "serving" | "draining" | "stopping" | "stopped" | "resuming" | "unreachable" | "lost" | "disabled" | "destroying";
|
|
92
|
+
/** One machine Work knows, as the plan reads it. */
|
|
93
|
+
export interface MachineFacts {
|
|
94
|
+
name: string;
|
|
95
|
+
/** The platform's id from `create`; null until it answered, or for a machine enrolled by hand. */
|
|
96
|
+
ref: string | null;
|
|
97
|
+
/** Made through this hook. False: an operator enrolled it by hand, and Work never creates, stops or destroys it. */
|
|
98
|
+
managed: boolean;
|
|
99
|
+
state: MachineState;
|
|
100
|
+
/** Since when it is in `state` (ISO 8601). */
|
|
101
|
+
since: string;
|
|
102
|
+
labels: Readonly<Record<string, string>>;
|
|
103
|
+
/** Who may place work here; null for anyone. */
|
|
104
|
+
for: readonly MachinePrincipal[] | null;
|
|
105
|
+
trusted: boolean;
|
|
106
|
+
/** The options it was created with. */
|
|
107
|
+
options: Readonly<Record<string, unknown>>;
|
|
108
|
+
reason: string | null;
|
|
109
|
+
/** Live workspaces on it, and whose they are. */
|
|
110
|
+
holding: {
|
|
111
|
+
workspaces: number;
|
|
112
|
+
for: readonly MachinePrincipal[];
|
|
113
|
+
};
|
|
114
|
+
/** Since when it has held no workspace while serving; null while it holds one or is not serving. */
|
|
115
|
+
idleSince: string | null;
|
|
116
|
+
/** When its worker last called; null before its first call. */
|
|
117
|
+
lastSeenAt: string | null;
|
|
118
|
+
/** What it offers, from its worker's own report; null before it first connected. */
|
|
119
|
+
capacity: {
|
|
120
|
+
workspaces: number;
|
|
121
|
+
cpuMillis?: number;
|
|
122
|
+
memoryMb?: number;
|
|
123
|
+
} | null;
|
|
124
|
+
/** What its workspaces reserve now. */
|
|
125
|
+
usage: {
|
|
126
|
+
workspaces: number;
|
|
127
|
+
cpuMillis: number;
|
|
128
|
+
memoryMb: number;
|
|
129
|
+
storageMb: number;
|
|
130
|
+
} | null;
|
|
131
|
+
/** Its latest disk report; `low` once it is under its floor and takes no new work. */
|
|
132
|
+
disk: {
|
|
133
|
+
totalBytes: number;
|
|
134
|
+
freeBytes: number;
|
|
135
|
+
floorBytes: number;
|
|
136
|
+
low: boolean;
|
|
137
|
+
} | null;
|
|
138
|
+
/** How it isolates agents; null before it first connected. */
|
|
139
|
+
isolation: "process" | "sandbox" | null;
|
|
140
|
+
/** Users signed in to a harness on it. */
|
|
141
|
+
signedIn: readonly string[];
|
|
142
|
+
/** Why Work cannot do what the plan asks yet (it holds live work, the hook has no `stop`). */
|
|
143
|
+
notice: string | null;
|
|
144
|
+
/** The latest failure of a verb for it, cleared when that verb next succeeds. */
|
|
145
|
+
lastError: {
|
|
146
|
+
verb: MachineVerb;
|
|
147
|
+
message: string;
|
|
148
|
+
at: string;
|
|
149
|
+
} | null;
|
|
150
|
+
}
|
|
151
|
+
export type MachineVerb = "create" | "destroy" | "stop" | "start" | "describe";
|
|
152
|
+
/** Work that has no machine yet. */
|
|
153
|
+
export interface WaitingWork {
|
|
154
|
+
/** The chat's or run's id. */
|
|
155
|
+
id: string;
|
|
156
|
+
/** A chat, a workflow run, or a cache fill. */
|
|
157
|
+
kind: "chat" | "run" | "fill";
|
|
158
|
+
project: string;
|
|
159
|
+
/** The member whose work it is; null for the project's own. */
|
|
160
|
+
user: string | null;
|
|
161
|
+
/** The chat key of a project's own chat, if it has one. */
|
|
162
|
+
key: string | null;
|
|
163
|
+
environment: string;
|
|
164
|
+
/** The Environment's pool: labels a machine must carry. */
|
|
165
|
+
pool: Readonly<Record<string, string>>;
|
|
166
|
+
requirements: {
|
|
167
|
+
resources: {
|
|
168
|
+
cpuMillis?: number;
|
|
169
|
+
memoryMb?: number;
|
|
170
|
+
storageMb?: number;
|
|
171
|
+
gpu?: boolean;
|
|
172
|
+
};
|
|
173
|
+
capabilities: readonly string[];
|
|
174
|
+
isolation?: "none" | "process" | "sandbox";
|
|
175
|
+
};
|
|
176
|
+
/** No machine open to it had room (`capacity`), or none was online (`unavailable`). */
|
|
177
|
+
reason: "capacity" | "unavailable";
|
|
178
|
+
/** ISO 8601. */
|
|
179
|
+
waitingSince: string;
|
|
180
|
+
}
|
|
181
|
+
/** One account of the server, so "everyone with role X" needs no directory. */
|
|
182
|
+
export interface PersonFacts {
|
|
183
|
+
/** The account id: what `{ user }` names. */
|
|
184
|
+
id: string;
|
|
185
|
+
email: string | null;
|
|
186
|
+
name: string | null;
|
|
187
|
+
/** False once the account is disabled. */
|
|
188
|
+
active: boolean;
|
|
189
|
+
administrator: boolean;
|
|
190
|
+
/** Role names by project id. */
|
|
191
|
+
roles: Readonly<Record<string, readonly string[]>>;
|
|
192
|
+
}
|
|
193
|
+
/** What `plan` is given. */
|
|
194
|
+
export interface MachinePlanFacts {
|
|
195
|
+
/** ISO 8601, by the server's database clock. */
|
|
196
|
+
now: string;
|
|
197
|
+
/** Work that has no machine yet. */
|
|
198
|
+
work: readonly WaitingWork[];
|
|
199
|
+
/** Every machine Work knows, managed by this hook or enrolled by hand. */
|
|
200
|
+
machines: readonly MachineFacts[];
|
|
201
|
+
/** The server's accounts with their project roles. */
|
|
202
|
+
people: readonly PersonFacts[];
|
|
203
|
+
}
|
|
204
|
+
/** The machine a verb acts on. */
|
|
205
|
+
export interface MachineTarget {
|
|
206
|
+
name: string;
|
|
207
|
+
/** The ref `create` answered; null when it never did. */
|
|
208
|
+
ref: string | null;
|
|
209
|
+
/**
|
|
210
|
+
* The idempotency key its `create` was given, which finds a machine whose
|
|
211
|
+
* create answer was lost. Null for none.
|
|
212
|
+
*/
|
|
213
|
+
idempotencyKey: string | null;
|
|
214
|
+
/** The options it was created with. */
|
|
215
|
+
options: Readonly<Record<string, unknown>>;
|
|
216
|
+
labels: Readonly<Record<string, string>>;
|
|
217
|
+
}
|
|
218
|
+
export interface MachineCreateRequest {
|
|
219
|
+
name: string;
|
|
220
|
+
options: Readonly<Record<string, unknown>>;
|
|
221
|
+
labels: Readonly<Record<string, string>>;
|
|
222
|
+
/**
|
|
223
|
+
* What the new machine starts its worker with: `WORK_CONTROL_PLANE_URL`
|
|
224
|
+
* and `WORK_WORKER_ENROLLMENT`. The code is a secret: never log it.
|
|
225
|
+
*/
|
|
226
|
+
enrollment: {
|
|
227
|
+
controlPlaneUrl: string;
|
|
228
|
+
code: string;
|
|
229
|
+
/** The platform's idempotency token for this create: 64 hex characters. */
|
|
230
|
+
idempotencyKey: string;
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* `ref`: the machine exists (or already did, for this key). `pending`: not
|
|
235
|
+
* yet; Work asks again with the same request. `refused`: the platform made
|
|
236
|
+
* nothing and would refuse again; Work withdraws the code, shows the
|
|
237
|
+
* reason, and asks again later with a new enrollment.
|
|
238
|
+
*/
|
|
239
|
+
export type MachineCreateResult = {
|
|
240
|
+
ref: string;
|
|
241
|
+
} | {
|
|
242
|
+
pending: true;
|
|
243
|
+
} | {
|
|
244
|
+
refused: string;
|
|
245
|
+
};
|
|
246
|
+
export declare const MachineCreateResultSchema: z.ZodType<MachineCreateResult, MachineCreateResult>;
|
|
247
|
+
export declare const MachineDestroyResultSchema: z.ZodObject<{
|
|
248
|
+
done: z.ZodBoolean;
|
|
249
|
+
}, z.core.$strict>;
|
|
250
|
+
export declare const MachineStopResultSchema: z.ZodObject<{
|
|
251
|
+
done: z.ZodBoolean;
|
|
252
|
+
}, z.core.$strict>;
|
|
253
|
+
export declare const MachineStartResultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
254
|
+
done: z.ZodBoolean;
|
|
255
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
256
|
+
gone: z.ZodLiteral<true>;
|
|
257
|
+
}, z.core.$strict>]>;
|
|
258
|
+
export declare const MachineDescribeResultSchema: z.ZodObject<{
|
|
259
|
+
state: z.ZodEnum<{
|
|
260
|
+
gone: "gone";
|
|
261
|
+
running: "running";
|
|
262
|
+
stopped: "stopped";
|
|
263
|
+
unknown: "unknown";
|
|
264
|
+
}>;
|
|
265
|
+
}, z.core.$strict>;
|
|
266
|
+
export declare const MACHINE_EVENT_KINDS: readonly ["machine.created", "machine.connected", "machine.lost", "machine.stopped", "machine.started", "machine.released", "machine.destroyed", "machine.disk-low"];
|
|
267
|
+
export type MachineEventKind = (typeof MACHINE_EVENT_KINDS)[number];
|
|
268
|
+
/** Something that happened to a machine. Nothing Work needs depends on it. */
|
|
269
|
+
export interface MachineEvent {
|
|
270
|
+
kind: MachineEventKind;
|
|
271
|
+
/** ISO 8601. */
|
|
272
|
+
at: string;
|
|
273
|
+
machine: {
|
|
274
|
+
name: string;
|
|
275
|
+
ref: string | null;
|
|
276
|
+
managed: boolean;
|
|
277
|
+
labels: Readonly<Record<string, string>>;
|
|
278
|
+
for: readonly MachinePrincipal[] | null;
|
|
279
|
+
options: Readonly<Record<string, unknown>>;
|
|
280
|
+
reason: string | null;
|
|
281
|
+
};
|
|
282
|
+
/** `machine.disk-low` only: the report that began the episode. */
|
|
283
|
+
disk?: {
|
|
284
|
+
path: string;
|
|
285
|
+
totalBytes: number;
|
|
286
|
+
freeBytes: number;
|
|
287
|
+
floorBytes: number;
|
|
288
|
+
measuredAt: string;
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* The host's machines: `plan` decides, the verbs act. One provisioner per
|
|
293
|
+
* hook; a host with two clouds dispatches inside its own verbs (by an
|
|
294
|
+
* option or a label).
|
|
295
|
+
*/
|
|
296
|
+
export interface MachinesHook {
|
|
297
|
+
/**
|
|
298
|
+
* Decide: given the facts, the set of machines that should exist. It
|
|
299
|
+
* changes nothing in Work; it may read the host's own config or
|
|
300
|
+
* directory. Return the same names for the same facts: Work works out
|
|
301
|
+
* the difference. A plan that throws, takes too long or returns
|
|
302
|
+
* something invalid changes nothing, and its error is shown.
|
|
303
|
+
*/
|
|
304
|
+
plan(args: MachinePlanFacts): Promise<readonly DesiredMachine[]>;
|
|
305
|
+
/**
|
|
306
|
+
* Make one machine that starts the Work worker with `enrollment`. Work
|
|
307
|
+
* recorded its intent first and repeats this call with the same
|
|
308
|
+
* `idempotencyKey` until it answers `ref`: hand the key to the platform
|
|
309
|
+
* as its idempotency token, so a repeat returns the same machine.
|
|
310
|
+
*/
|
|
311
|
+
create(args: MachineCreateRequest): Promise<MachineCreateResult>;
|
|
312
|
+
/**
|
|
313
|
+
* Remove the machine: the one `ref` names, and any made with
|
|
314
|
+
* `idempotencyKey` or carrying `name` whose create answer was lost.
|
|
315
|
+
* `requestedAt` is when Work first asked. Answer `done: false` while it is
|
|
316
|
+
* still going, or while a machine just created may not be listed yet;
|
|
317
|
+
* Work asks again.
|
|
318
|
+
*/
|
|
319
|
+
destroy(args: MachineTarget & {
|
|
320
|
+
requestedAt: string;
|
|
321
|
+
}): Promise<{
|
|
322
|
+
done: boolean;
|
|
323
|
+
}>;
|
|
324
|
+
/**
|
|
325
|
+
* Stop the machine and keep its disk. `requestedAt` is stable for this
|
|
326
|
+
* stop request. Without a stop verb, no machine is stopped.
|
|
327
|
+
*/
|
|
328
|
+
stop?(args: MachineTarget & {
|
|
329
|
+
requestedAt: string;
|
|
330
|
+
}): Promise<{
|
|
331
|
+
done: boolean;
|
|
332
|
+
}>;
|
|
333
|
+
/**
|
|
334
|
+
* Start a stopped machine; its worker connects again by itself. `gone`
|
|
335
|
+
* when it no longer exists: Work treats it as lost and makes it again.
|
|
336
|
+
* `requestedAt` is stable for this start request.
|
|
337
|
+
*/
|
|
338
|
+
start?(args: MachineTarget & {
|
|
339
|
+
requestedAt: string;
|
|
340
|
+
}): Promise<{
|
|
341
|
+
done: boolean;
|
|
342
|
+
} | {
|
|
343
|
+
gone: true;
|
|
344
|
+
}>;
|
|
345
|
+
/** Lets Work confirm a loss at once instead of waiting out the limit. */
|
|
346
|
+
describe?(args: MachineTarget): Promise<{
|
|
347
|
+
state: "running" | "stopped" | "gone" | "unknown";
|
|
348
|
+
}>;
|
|
349
|
+
/**
|
|
350
|
+
* Hear every machine event, to route it wherever the host likes. Work
|
|
351
|
+
* also records each for the projects named in the machine's `for`.
|
|
352
|
+
*/
|
|
353
|
+
onEvent?(event: MachineEvent): Promise<void> | void;
|
|
354
|
+
}
|
|
355
|
+
/** Whether two principals name the same thing. */
|
|
356
|
+
export declare function samePrincipal(left: MachinePrincipal, right: MachinePrincipal): boolean;
|
|
357
|
+
/**
|
|
358
|
+
* Whether changing whom a machine is for lets someone new reach what the
|
|
359
|
+
* previous owners left on it (sandboxes, volumes, sign-ins), so it must be
|
|
360
|
+
* reset first. Narrowing never does; opening a machine to anyone, or to a
|
|
361
|
+
* principal that could not use it before, does.
|
|
362
|
+
*/
|
|
363
|
+
export declare function principalsChangeNeedsReset(args: {
|
|
364
|
+
from: readonly MachinePrincipal[] | null;
|
|
365
|
+
to: readonly MachinePrincipal[] | null;
|
|
366
|
+
}): boolean;
|
|
367
|
+
/** Principals in a stable order with duplicates removed, to compare and store. */
|
|
368
|
+
export declare function normalizePrincipals(principals: readonly MachinePrincipal[]): MachinePrincipal[];
|
|
369
|
+
/** Whether two principal lists (or "anyone") are the same. */
|
|
370
|
+
export declare function samePrincipals(left: readonly MachinePrincipal[] | null, right: readonly MachinePrincipal[] | null): boolean;
|
|
371
|
+
/**
|
|
372
|
+
* One principal and nobody else: no one else's work lands on the machine,
|
|
373
|
+
* so process isolation is enough and it may hold that owner's sign-ins.
|
|
374
|
+
*/
|
|
375
|
+
export declare function servesOneOwner(principals: readonly MachinePrincipal[] | null): boolean;
|
|
376
|
+
/** A machine taking no one's work: any isolation is enough. */
|
|
377
|
+
export declare function servesNobody(principals: readonly MachinePrincipal[] | null): boolean;
|
|
378
|
+
/** Whether a machine for `principals` takes this waiting work. */
|
|
379
|
+
export declare function principalsTake(args: {
|
|
380
|
+
for: readonly MachinePrincipal[] | null;
|
|
381
|
+
work: Pick<WaitingWork, "project" | "user" | "key">;
|
|
382
|
+
}): boolean;
|
|
383
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/machines/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GACnB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAErC,eAAO,MAAM,sBAAsB,EAAE,CAAC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