@lensmcp/protocol-types 1.26.2 → 1.26.4
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/index.d.ts +13 -1
- package/index.js +1 -1
- package/lib/changes.d.ts +15 -3
- package/lib/cluster-hosts.d.ts +272 -0
- package/lib/cluster-hosts.js +1 -0
- package/lib/dashboard-lint.d.ts +22 -0
- package/lib/dashboard-updates.d.ts +80 -0
- package/lib/dashboard-updates.js +1 -0
- package/lib/dashboard.d.ts +8 -1
- package/lib/docker-errors.d.ts +123 -0
- package/lib/docker-errors.js +1 -0
- package/lib/docker-jobs.d.ts +673 -0
- package/lib/docker-jobs.js +1 -0
- package/lib/docker-report.d.ts +99 -0
- package/lib/docker-report.js +2 -0
- package/lib/docker-runs.d.ts +300 -0
- package/lib/docker-runs.js +3 -0
- package/lib/host-agents.d.ts +139 -0
- package/lib/host-agents.js +1 -0
- package/lib/hosts.d.ts +206 -0
- package/lib/hosts.js +1 -0
- package/lib/main-mirror.d.ts +117 -0
- package/lib/main-mirror.js +1 -0
- package/lib/peers.d.ts +1881 -0
- package/lib/peers.js +1 -0
- package/lib/proof.d.ts +32 -0
- package/lib/remote-instances.d.ts +129 -0
- package/lib/remote-instances.js +1 -0
- package/lib/resources.d.ts +2 -0
- package/lib/resources.js +1 -1
- package/lib/static-checks.d.ts +290 -0
- package/lib/static-checks.js +1 -0
- package/lib/team-delivery.d.ts +13 -0
- package/lib/team.d.ts +60 -2
- package/lib/workspace-actions.d.ts +104 -1
- package/lib/workspace-actions.js +1 -1
- package/package.json +1 -1
package/lib/peers.d.ts
ADDED
|
@@ -0,0 +1,1881 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type DockerRunState, type DockerVmRead } from './docker-jobs.js';
|
|
3
|
+
import type { HostAgentsAdvert } from './host-agents.js';
|
|
4
|
+
import type { WorkspaceActionLane, WorkspaceActionState } from './workspace-actions.js';
|
|
5
|
+
/**
|
|
6
|
+
* WORKER MACS — the peer contract (planning/docker/00-plan.md §§ 7–10 and «The contract»; issues/open/overseer-74).
|
|
7
|
+
* The organizer is this Mac's LensMCP; a worker is the same LensMCP on another Mac, that runs the organizer's work.
|
|
8
|
+
* What the slices of Phase 2 share is here: who a peer is, what each side pins, the pairing exchange, and the control
|
|
9
|
+
* messages of the channel — one discriminated union, each message an envelope with `v: 1`, an id and, for a reply,
|
|
10
|
+
* the id it answers.
|
|
11
|
+
*
|
|
12
|
+
* The rules this contract is built for (plan «Security»): nothing listens before pairing; the worker never listens;
|
|
13
|
+
* every connection is mutual TLS 1.3 between two pinned certificates; a message names a job, a launch or a bundle —
|
|
14
|
+
* never a command, a file outside a run folder or a shell; everything a peer sends is checked against a schema here
|
|
15
|
+
* before any code of LensMCP reads it.
|
|
16
|
+
*
|
|
17
|
+
* Who owns what: slices D11 (identity and pairing) and D12 (the channel) define their shapes fully — the envelope, the
|
|
18
|
+
* replies, `hello`'s envelope, `ping`, `forget` and the pairing exchange — with a schema each. The messages of the
|
|
19
|
+
* other slices (`job.*`, `bundle.*`, `tunnel.*`, `launch.*`, `store.*`, `version.*`, `capacity`) are declared with the
|
|
20
|
+
* fields §§ 8–10 name, each marked with its slice: that slice owns its fields, and registers the schema its handler is
|
|
21
|
+
* checked by (a message of a type nobody handles is refused before its body is read).
|
|
22
|
+
*
|
|
23
|
+
* Pure, as the rest of this package: the dashboard reads these too.
|
|
24
|
+
*/
|
|
25
|
+
/** The peer protocol (§ 9): a peer on another `peer/vN` is never mixed with this one. */
|
|
26
|
+
export declare const PEER_PROTOCOL: "peer/v1";
|
|
27
|
+
export type PeerProtocol = typeof PEER_PROTOCOL;
|
|
28
|
+
/** The port the organizer's peer hub listens on, on the ONE LAN address the person picks (DW-Q6). */
|
|
29
|
+
export declare const PEER_PORT = 7466;
|
|
30
|
+
export declare const PEER_TIMING: {
|
|
31
|
+
/** A ping each way this often (§ 8). */
|
|
32
|
+
readonly pingMs: 5000;
|
|
33
|
+
/** Lost after this long without a word from the other side: longer than a Wi-Fi blip (§§ 8, 10). */
|
|
34
|
+
readonly lostMs: 45000;
|
|
35
|
+
/** How long a pairing window stays open (§ 7). */
|
|
36
|
+
readonly windowMs: number;
|
|
37
|
+
/** How long the organizer's person has to approve a worker that answered with the right code. */
|
|
38
|
+
readonly approveMs: number;
|
|
39
|
+
/** A worker's capacity advert, at the latest (§ 8; slice D14). */
|
|
40
|
+
readonly capacityMs: 30000;
|
|
41
|
+
};
|
|
42
|
+
/** The pairing code (§ 7): ten Crockford base32 characters — 50 bits — single use, five tries, then the window closes. */
|
|
43
|
+
export declare const PAIRING_CODE: {
|
|
44
|
+
readonly length: 10;
|
|
45
|
+
readonly tries: 5;
|
|
46
|
+
};
|
|
47
|
+
/** Crockford's base32: digits and letters without I, L, O and U. A code is read without case, `O` as 0 and `I`/`L` as 1, a hyphen ignored. */
|
|
48
|
+
export declare const CROCKFORD_ALPHABET = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
49
|
+
/** The paths of the channel (§ 8). Every request is the worker's: the organizer cannot open a stream on a connection it did not dial. */
|
|
50
|
+
export declare const PEER_PATHS: {
|
|
51
|
+
/** The pairing exchange, and the wait for the person's approval (slice D11). */
|
|
52
|
+
readonly pair: "/peer/v1/pair";
|
|
53
|
+
/** The long-lived duplex control stream (slice D12). */
|
|
54
|
+
readonly control: "/peer/v1/control";
|
|
55
|
+
/** `PUT /peer/v1/runs/<id>/log | samples | events | artifacts/<name>`: a remote run's results (slice D16). */
|
|
56
|
+
readonly runs: "/peer/v1/runs/";
|
|
57
|
+
/** `GET /peer/v1/bundles/<id>`: a git bundle the organizer offered (slice D15; its main, `main.moved`: D34). */
|
|
58
|
+
readonly bundles: "/peer/v1/bundles/";
|
|
59
|
+
/**
|
|
60
|
+
* `PUT /peer/v1/sent/<id>`: a git bundle the WORKER sends the other way — its main's commits or its snapshot of what
|
|
61
|
+
* is uncommitted there (slice D34), a goal's branch (D30) — announced by `bundle.sent` once it is up.
|
|
62
|
+
*/
|
|
63
|
+
readonly sent: "/peer/v1/sent/";
|
|
64
|
+
/** `POST /peer/v1/tunnel/<tid>`: one proxied connection, piped to its target on the worker (slice D17). */
|
|
65
|
+
readonly tunnel: "/peer/v1/tunnel/";
|
|
66
|
+
};
|
|
67
|
+
/** What a remote run streams to the organizer (§ 10; slice D16). */
|
|
68
|
+
export type RunUploadKind = 'log' | 'samples' | 'events' | 'artifacts';
|
|
69
|
+
export declare const RUN_UPLOAD_KINDS: readonly RunUploadKind[];
|
|
70
|
+
/**
|
|
71
|
+
* `~/.lensmcp/peers/` (0700; every file 0600) — under `LENSMCP_HOME` when it is set (plan «The contract»):
|
|
72
|
+
*
|
|
73
|
+
* identity.key this Mac's ECDSA P-256 key (PKCS#8) identity.crt its self-signed certificate
|
|
74
|
+
* window.json the organizer's pairing window, with its code while it is open
|
|
75
|
+
* workers.json the organizer's pins: the workers, and the address the hub listens on
|
|
76
|
+
* organizer.json the worker's pin: the one organizer it serves
|
|
77
|
+
* hub.json what the organizer's peer hub is doing (pid, address, the workers connected now)
|
|
78
|
+
* hub.log what it did, a line each — never a code, a proof or a key
|
|
79
|
+
* runs/ per-run sockets (slice D17)
|
|
80
|
+
* instances/ per-remote-instance sockets (slice D35): a goal's runtime on a worker, as the organizer serves it
|
|
81
|
+
*/
|
|
82
|
+
export declare const PEER_FILES: {
|
|
83
|
+
readonly dir: "peers";
|
|
84
|
+
readonly key: "identity.key";
|
|
85
|
+
readonly cert: "identity.crt";
|
|
86
|
+
readonly window: "window.json";
|
|
87
|
+
readonly workers: "workers.json";
|
|
88
|
+
readonly organizer: "organizer.json";
|
|
89
|
+
readonly hub: "hub.json";
|
|
90
|
+
readonly hubLock: "hub.lock";
|
|
91
|
+
readonly hubLog: "hub.log";
|
|
92
|
+
readonly runs: "runs";
|
|
93
|
+
readonly instances: "instances";
|
|
94
|
+
};
|
|
95
|
+
/** SHA-256 of a certificate's DER, 64 lowercase hex characters: what a pin holds. */
|
|
96
|
+
export declare const FINGERPRINT_PATTERN: RegExp;
|
|
97
|
+
/** A peer as the other side sees it. `name` and `model` are what the peer says of itself: shown, never trusted. */
|
|
98
|
+
export interface PeerIdentity {
|
|
99
|
+
/** Its Mac's name (the Computer Name, or `LENSMCP_PEER_NAME`). Unique among an organizer's workers. */
|
|
100
|
+
name: string;
|
|
101
|
+
/** Its Mac's model identifier, as `sysctl hw.model` says it («Mac14,13»). */
|
|
102
|
+
model: string;
|
|
103
|
+
/** Its certificate's {@link FINGERPRINT_PATTERN fingerprint}. */
|
|
104
|
+
fingerprint: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The four words the person compares (§ 7 step 3), from BIP-39's English list: of BOTH certificates' fingerprints
|
|
108
|
+
* as each side saw them — a man in the middle on either side changes them, whichever certificate he substitutes.
|
|
109
|
+
*/
|
|
110
|
+
export type PeerWords = readonly [string, string, string, string];
|
|
111
|
+
/** `pending`: the code was right, the organizer's person has not approved yet — nothing runs. `paired`: approved. */
|
|
112
|
+
export type PeerPinState = 'pending' | 'paired';
|
|
113
|
+
/** A worker the organizer pinned (`workers.json`). */
|
|
114
|
+
export interface WorkerPin extends PeerIdentity {
|
|
115
|
+
words: PeerWords;
|
|
116
|
+
state: PeerPinState;
|
|
117
|
+
/** When it answered with the right code (ms). */
|
|
118
|
+
answeredAt: number;
|
|
119
|
+
/** A pending pin is dropped at this time unless the person approved it. */
|
|
120
|
+
approveBy?: number;
|
|
121
|
+
approvedAt?: number;
|
|
122
|
+
/** The address it paired from, as the hub saw it. Evidence only: a worker is its certificate, never its address. */
|
|
123
|
+
from?: string;
|
|
124
|
+
}
|
|
125
|
+
/** Where the organizer's hub listens: one address of one interface, never all of them (DW-Q6). */
|
|
126
|
+
export interface PeerListen {
|
|
127
|
+
address: string;
|
|
128
|
+
port: number;
|
|
129
|
+
}
|
|
130
|
+
/** The organizer a worker pinned (`organizer.json`). A worker serves one organizer. */
|
|
131
|
+
export interface OrganizerPin extends PeerIdentity {
|
|
132
|
+
words: PeerWords;
|
|
133
|
+
state: PeerPinState;
|
|
134
|
+
/** Where it dials. */
|
|
135
|
+
address: string;
|
|
136
|
+
port: number;
|
|
137
|
+
answeredAt: number;
|
|
138
|
+
approvedAt?: number;
|
|
139
|
+
}
|
|
140
|
+
/** A pairing window as anyone may read it — never with its code. */
|
|
141
|
+
export interface PairingWindowView {
|
|
142
|
+
id: string;
|
|
143
|
+
address: string;
|
|
144
|
+
port: number;
|
|
145
|
+
openedAt: number;
|
|
146
|
+
closesAt: number;
|
|
147
|
+
/** `open`: it takes a code. `used`: a worker gave the right one (single use). `closed`: it expired, was closed, or five codes were wrong. */
|
|
148
|
+
state: 'open' | 'used' | 'closed';
|
|
149
|
+
triesLeft: number;
|
|
150
|
+
why?: string;
|
|
151
|
+
/** The worker that gave the right code, by its fingerprint. */
|
|
152
|
+
answeredBy?: string;
|
|
153
|
+
}
|
|
154
|
+
/** A worker's capacity, as it advertises it in `hello` and `capacity`. Slice D14's. */
|
|
155
|
+
export interface PeerCapacity {
|
|
156
|
+
/** Docker's VM: its total and what a new container can still take (the probe), and how that was read. */
|
|
157
|
+
vm?: {
|
|
158
|
+
totalMb: number;
|
|
159
|
+
availableMb: number;
|
|
160
|
+
read: DockerVmRead;
|
|
161
|
+
};
|
|
162
|
+
/** The host's free memory (MiB). */
|
|
163
|
+
hostFreeMb: number;
|
|
164
|
+
cpus: number;
|
|
165
|
+
arch: string;
|
|
166
|
+
macos: string;
|
|
167
|
+
docker?: string;
|
|
168
|
+
/** The images present: `repository:tag` and id. */
|
|
169
|
+
images: Array<{
|
|
170
|
+
ref: string;
|
|
171
|
+
id: string;
|
|
172
|
+
}>;
|
|
173
|
+
/** Its own machine queue: running and waiting, by lane. */
|
|
174
|
+
queue: {
|
|
175
|
+
running: Record<WorkspaceActionLane, number>;
|
|
176
|
+
waiting: Record<WorkspaceActionLane, number>;
|
|
177
|
+
};
|
|
178
|
+
/** The LensMCP version its peer role runs. */
|
|
179
|
+
lensmcp: string;
|
|
180
|
+
/**
|
|
181
|
+
* Phase 5 (slice D31): its accounts and the agents it runs — never a token. On the wire it is the advert's `agents`
|
|
182
|
+
* part ({@link HostAgentsAdvert}, host-agents.ts), read field by field at the organizer (apps/agent `readHostAgents`).
|
|
183
|
+
*/
|
|
184
|
+
agents?: HostAgentsAdvert;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* A remote run as the organizer records it: a workspace action's states, and `lost` — its worker went silent for
|
|
188
|
+
* {@link PEER_TIMING.lostMs} (or was revoked) while it ran. A new run state (§ 10): never «passed», never proof, and a
|
|
189
|
+
* worker that comes back does not change it. Slices D16 and D18 write it.
|
|
190
|
+
*/
|
|
191
|
+
export type RemoteRunState = WorkspaceActionState | 'lost';
|
|
192
|
+
export declare const REMOTE_RUN_LOST: Extract<RemoteRunState, 'lost'>;
|
|
193
|
+
/** A run on the worker, as its own registry says it: the Docker run's states (`lost` there: its runner died). */
|
|
194
|
+
export type PeerRunState = DockerRunState;
|
|
195
|
+
/** The `host` of a proof made on a worker (§ 12): evidence, as `runtime` and `runnerHash` are — not a candidate input. Slice D25's. */
|
|
196
|
+
export interface ProofHostEvidence {
|
|
197
|
+
/** The worker's certificate fingerprint. */
|
|
198
|
+
peer: string;
|
|
199
|
+
name: string;
|
|
200
|
+
arch: string;
|
|
201
|
+
os: string;
|
|
202
|
+
docker?: string;
|
|
203
|
+
lensmcp: string;
|
|
204
|
+
}
|
|
205
|
+
/** An id of a message: what a reply names. Letters, digits, `_` and `-`, up to 64. */
|
|
206
|
+
export declare const PEER_MESSAGE_ID: RegExp;
|
|
207
|
+
/** Every message on a peer stream, one JSON object per line. A reply names the message it answers in `replyTo`. */
|
|
208
|
+
export interface PeerEnvelope<T extends string = string, B = unknown> {
|
|
209
|
+
v: 1;
|
|
210
|
+
id: string;
|
|
211
|
+
replyTo?: string;
|
|
212
|
+
type: T;
|
|
213
|
+
body: B;
|
|
214
|
+
}
|
|
215
|
+
/** Why a message, a stream or a connection was refused. One word a program reads, one sentence a person can. */
|
|
216
|
+
export type PeerErrorCode =
|
|
217
|
+
/** Not a type of the allowlist. */
|
|
218
|
+
'unknown-type'
|
|
219
|
+
/** A type the other side sends, never this one. */
|
|
220
|
+
| 'wrong-direction'
|
|
221
|
+
/** Its envelope or its body did not pass the schema. */
|
|
222
|
+
| 'bad-message'
|
|
223
|
+
/** The worker's first message on the control stream is `hello`. */
|
|
224
|
+
| 'hello-first'
|
|
225
|
+
/** A type of the allowlist this side has no handler for (its slice is not built, or not running here). */
|
|
226
|
+
| 'not-handled'
|
|
227
|
+
/** A line longer than the stream takes. */
|
|
228
|
+
| 'too-large'
|
|
229
|
+
/** Too many at once, or too fast: try later. */
|
|
230
|
+
| 'busy'
|
|
231
|
+
/** The other side's handler refused it; `message` says why. */
|
|
232
|
+
| 'refused'
|
|
233
|
+
/** No reply in time. */
|
|
234
|
+
| 'timeout'
|
|
235
|
+
/** The link went while the message waited for its reply. */
|
|
236
|
+
| 'lost'
|
|
237
|
+
/** The handler failed; the details stay in this side's log. */
|
|
238
|
+
| 'internal'
|
|
239
|
+
/** No pairing window is open. */
|
|
240
|
+
| 'no-window'
|
|
241
|
+
/** A worker already gave the right code: a window is used once. */
|
|
242
|
+
| 'window-used'
|
|
243
|
+
/** The window closed: it expired, was closed, or five codes were wrong. */
|
|
244
|
+
| 'window-closed'
|
|
245
|
+
/** The code was wrong: `triesLeft` says how many the window still takes. */
|
|
246
|
+
| 'wrong-code'
|
|
247
|
+
/** The exchange broke the protocol (a step out of order, a field that does not match). */
|
|
248
|
+
| 'protocol';
|
|
249
|
+
export interface PeerErrorBody {
|
|
250
|
+
code: PeerErrorCode;
|
|
251
|
+
message: string;
|
|
252
|
+
/** With `wrong-code`: the codes the window still takes. */
|
|
253
|
+
triesLeft?: number;
|
|
254
|
+
/** With `busy`: when to try again. */
|
|
255
|
+
retryAfterMs?: number;
|
|
256
|
+
}
|
|
257
|
+
/** The reply to a message that was handled: what its handler answered, if anything. */
|
|
258
|
+
export interface PeerAck {
|
|
259
|
+
result?: unknown;
|
|
260
|
+
}
|
|
261
|
+
/** `ping`, each way every {@link PEER_TIMING.pingMs}; answered by `pong` with the same `at`. */
|
|
262
|
+
export interface PeerPing {
|
|
263
|
+
at: number;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* `hello` (§ 9): the worker's first message on the control stream, each time it connects. D12 defines its envelope
|
|
267
|
+
* and reads `protocol`; D13 decides what the versions mean («out of step»); D14 fills `capacity`.
|
|
268
|
+
*/
|
|
269
|
+
export interface PeerHello {
|
|
270
|
+
protocol: PeerProtocol;
|
|
271
|
+
/** The LensMCP version the worker's peer role runs (D13). */
|
|
272
|
+
lensmcp: string;
|
|
273
|
+
/** Whether the worker follows the organizer's version by itself (D13's `HelloVersions.follow`; absent: yes). */
|
|
274
|
+
follow?: boolean;
|
|
275
|
+
/** The versions its store holds (D13). */
|
|
276
|
+
store?: string[];
|
|
277
|
+
/** Its capacity, as `capacity` sends it (D14): {@link WorkerAdvert}. */
|
|
278
|
+
capacity?: WorkerAdvert;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* What a worker says it has room for, in `hello` and in `capacity` (slices D14, D21): the body is apps/agent's
|
|
282
|
+
* `HostCapacity` (capacity.ts — `localCapacity({ vm: true, others: 'always' })` plus its images), which the organizer
|
|
283
|
+
* reads field by field (`readHostCapacity`) before placement decides on it, and `runs`: the organizer's runs this
|
|
284
|
+
* worker holds now, by their id on the channel (slice D18) — a run its worker no longer names (a daemon that was
|
|
285
|
+
* killed and started again holds none) goes quiet, and reads `lost` 45 s after the last word of it. The channel
|
|
286
|
+
* checks only its size (the line it travels in) — the reader is the check.
|
|
287
|
+
*/
|
|
288
|
+
export type WorkerAdvert = Record<string, unknown> & {
|
|
289
|
+
runs?: string[];
|
|
290
|
+
};
|
|
291
|
+
/** The organizer's answer to `hello` (the `result` of its `ack`). */
|
|
292
|
+
export interface PeerWelcome {
|
|
293
|
+
protocol: PeerProtocol;
|
|
294
|
+
/** The organizer's own LensMCP version: the one the worker's peer role must run (§ 9, D13). */
|
|
295
|
+
lensmcp: string;
|
|
296
|
+
/** The organizer's name, as its person knows it. */
|
|
297
|
+
name: string;
|
|
298
|
+
/** D13: `false` while the versions differ — «paired, out of step»: the worker gets no work. */
|
|
299
|
+
inStep?: boolean;
|
|
300
|
+
/** D13: why it is out of step, in one sentence. */
|
|
301
|
+
why?: string;
|
|
302
|
+
}
|
|
303
|
+
/** `forget` (slice D11): the worker forgot this organizer (`lensmcp worker forget`) — the organizer drops its pin too. */
|
|
304
|
+
export interface PeerForget {
|
|
305
|
+
why?: string;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* `job.offer` (organizer → worker) — slice D14. A job's NAME, a commit and the organizer's repository — never a command:
|
|
309
|
+
* the worker reads what runs from the shipped tree's own `lensmcp.json` (the kinds it knows only), and runs it through
|
|
310
|
+
* its OWN machine queue. Placement (D21) made the offer: the worker answers at once with {@link JobOfferTaken} (or
|
|
311
|
+
* refuses), joins its queue with the budget the offer names, and says it STARTED (`job.state` `started`) or gives it
|
|
312
|
+
* back (`job.done` `givenBack`) within 30 s — the organizer's `answerOffer`.
|
|
313
|
+
*/
|
|
314
|
+
export interface JobOffer {
|
|
315
|
+
/** The run's id on the channel (`q_…`), minted by the organizer: its queue entry, its labels and its results on both sides. */
|
|
316
|
+
runId: string;
|
|
317
|
+
job: string;
|
|
318
|
+
/** The commit the job runs at (§ 10: a clean commit, Phase 2), by its whole id. */
|
|
319
|
+
candidate: string;
|
|
320
|
+
/** The organizer's repository id (`checkoutIdentity(root).repoId`): the worker's mirror is `<repository>.git` (§ 12: its clone has another path). */
|
|
321
|
+
repository: string;
|
|
322
|
+
/** The lane the organizer read for it — the worker's own read of the commit's manifest decides. */
|
|
323
|
+
lane?: WorkspaceActionLane;
|
|
324
|
+
/** Its kind, and what it declares on the host and in Docker's VM (MiB), as placement read them: what the worker's queue admits it by before the commit is here. */
|
|
325
|
+
kind?: string;
|
|
326
|
+
hostMb?: number;
|
|
327
|
+
vmMb?: number;
|
|
328
|
+
/** A proof of the run is asked for (D25: `--candidate`): the worker fingerprints the job before and after, with itself as the host. */
|
|
329
|
+
proof?: boolean;
|
|
330
|
+
/** The longest it may run, minutes: the person's `--timeout`, else the commit's own. */
|
|
331
|
+
timeoutMinutes?: number;
|
|
332
|
+
/**
|
|
333
|
+
* The provider keys the job names in `inputs.secrets`, by name → value — ONLY for a paid run the person authorized
|
|
334
|
+
* (`--allow-paid` from their own terminal, § 10). Written 0600 in the run folder, redacted from every log the worker
|
|
335
|
+
* sends, deleted at cleanup. Absent: the job runs with the stub AI (`LENSMCP_STUB_AI_URL`) and none of those names.
|
|
336
|
+
*/
|
|
337
|
+
secrets?: Record<string, string>;
|
|
338
|
+
/** The run's URL on the organizer (`https://run-<short>.<apex>`): the job's `LENSMCP_RUN_ORIGIN`, where the gateway gives one. */
|
|
339
|
+
origin?: string;
|
|
340
|
+
}
|
|
341
|
+
/** What the worker answers a `job.offer` it takes with: what its mirror holds, so the bundle carries only what is new. */
|
|
342
|
+
export interface JobOfferTaken {
|
|
343
|
+
taken: true;
|
|
344
|
+
/** Its mirror's newest shipped commits (D15 `mirrorHaves`): the bundle is cut against them. */
|
|
345
|
+
haves: string[];
|
|
346
|
+
/** It holds the commit already: no bundle comes, and the run starts. */
|
|
347
|
+
holds: boolean;
|
|
348
|
+
}
|
|
349
|
+
/** `job.cancel` (organizer → worker) — slices D14 / D18: the run is stopped on the worker, its `cleanup` run, its stack taken down. */
|
|
350
|
+
export interface JobCancel {
|
|
351
|
+
runId: string;
|
|
352
|
+
why: string;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* `job.state` (worker → organizer) — slices D14 / D16: where the run stands on the worker, read by D16's
|
|
356
|
+
* `receiveRunState` (results-read.ts `readRemoteUpdate`, field by field). `docker` is the worker's run record cut to
|
|
357
|
+
* what is the run's — no pid, path or label of the worker's.
|
|
358
|
+
*/
|
|
359
|
+
export interface JobStateMessage {
|
|
360
|
+
runId: string;
|
|
361
|
+
at: number;
|
|
362
|
+
/**
|
|
363
|
+
* The worker's queue let the offered job in: its answer to the offer (D21 `answerOffer` `started`). The organizer
|
|
364
|
+
* records the run then — and refuses (`taken-back:`) a start it no longer waits for: the worker cancels the run.
|
|
365
|
+
*/
|
|
366
|
+
started?: true;
|
|
367
|
+
/** Waiting in the worker's own machine queue, or let in by it. */
|
|
368
|
+
state?: 'queued' | 'running';
|
|
369
|
+
note?: string;
|
|
370
|
+
/** Where it waits in the worker's queue, and why — or, once let in, how long it waited. */
|
|
371
|
+
queue?: {
|
|
372
|
+
lane?: WorkspaceActionLane;
|
|
373
|
+
place?: number;
|
|
374
|
+
of?: number;
|
|
375
|
+
why?: string;
|
|
376
|
+
waitedMs?: number;
|
|
377
|
+
};
|
|
378
|
+
docker?: Record<string, unknown>;
|
|
379
|
+
/**
|
|
380
|
+
* The port its stack's edge is published on, on the WORKER's loopback (`docker compose port`, § 3): the organizer
|
|
381
|
+
* routes the run's URL to it through a tunnel (slice D17). The worker pipes a tunnel to this port only.
|
|
382
|
+
*/
|
|
383
|
+
edgePort?: number;
|
|
384
|
+
}
|
|
385
|
+
/** `job.stage` (worker → organizer) — slice D16: what `lensmcp docker stage` said on the worker. */
|
|
386
|
+
export interface JobStageMessage {
|
|
387
|
+
runId: string;
|
|
388
|
+
stage: string;
|
|
389
|
+
at: number;
|
|
390
|
+
}
|
|
391
|
+
/** How a run ended on the worker: never `lost` — that is the organizer's word for a worker it no longer hears. */
|
|
392
|
+
export type JobEnd = 'passed' | 'failed' | 'errored' | 'cancelled' | 'timeout';
|
|
393
|
+
/**
|
|
394
|
+
* `job.done` (worker → organizer) — slices D14 / D16: the run ended on the worker; its results were streamed before.
|
|
395
|
+
* `step` is how its command came out (exit, counts and failures where the manifest names a report) — D16's
|
|
396
|
+
* `RemoteStepVerdict`, read field by field. A run that never ran says why: given back (its queue did not let it in
|
|
397
|
+
* within 30 s — placement may take it elsewhere, D21) or refused (the commit, its manifest, the bundle).
|
|
398
|
+
*/
|
|
399
|
+
export interface JobDoneMessage {
|
|
400
|
+
runId: string;
|
|
401
|
+
at: number;
|
|
402
|
+
state: JobEnd;
|
|
403
|
+
note?: string;
|
|
404
|
+
step?: Record<string, unknown>;
|
|
405
|
+
docker?: Record<string, unknown>;
|
|
406
|
+
givenBack?: {
|
|
407
|
+
why: string;
|
|
408
|
+
};
|
|
409
|
+
refused?: {
|
|
410
|
+
why: string;
|
|
411
|
+
};
|
|
412
|
+
/** The proof the offer asked for (D25 `ProofEvidence`): eligible, or why not, with its fingerprints. */
|
|
413
|
+
proof?: Record<string, unknown>;
|
|
414
|
+
}
|
|
415
|
+
/** `bundle.ready` (organizer → worker) — slice D15: a bundle to fetch from `GET /peer/v1/bundles/<id>`. */
|
|
416
|
+
export interface BundleReady {
|
|
417
|
+
/** The run it carries the commit of (D14: an offered run waits for its bundle). */
|
|
418
|
+
runId?: string;
|
|
419
|
+
bundleId: string;
|
|
420
|
+
repository: string;
|
|
421
|
+
/** The commits it carries, and what it is incremental against (what the worker said its mirror holds). */
|
|
422
|
+
heads: string[];
|
|
423
|
+
basis?: string[];
|
|
424
|
+
size: number;
|
|
425
|
+
sha256: string;
|
|
426
|
+
/**
|
|
427
|
+
* The candidate's record (D24 `CandidateShipment`): the commit with the organizer's changes and the job's declared
|
|
428
|
+
* inputs, which the worker checks whole (`readCandidateShipment`) and applies onto the commit (`applyCandidate`).
|
|
429
|
+
*/
|
|
430
|
+
shipment?: Record<string, unknown>;
|
|
431
|
+
/** Where each of its blobs (the diff, the inputs) is fetched: by sha256, the id `GET /peer/v1/bundles/<id>` serves it by. */
|
|
432
|
+
blobs?: Record<string, string>;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* `bundle.sent` (worker → organizer) — slice D34 (a goal's branch: D30): a bundle the worker put up by `PUT
|
|
436
|
+
* /peer/v1/sent/<id>`, for ONE ref of its own namespace at the organizer — `refs/lensmcp/peers/<its fingerprint>/<ref>`,
|
|
437
|
+
* `refs` naming that one ref relative to it: `heads/main` (its main's commits) or `wip/main` (a snapshot of what is
|
|
438
|
+
* uncommitted there). The commit is the bundle's one ref, `refs/lensmcp/ship/<sha>`, as D15 cuts it; its size and
|
|
439
|
+
* sha256 bind the bytes. Answered by {@link BundleSentAnswer}.
|
|
440
|
+
*/
|
|
441
|
+
export interface BundleSent {
|
|
442
|
+
bundleId: string;
|
|
443
|
+
repository: string;
|
|
444
|
+
refs: string[];
|
|
445
|
+
size: number;
|
|
446
|
+
sha256: string;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* `tunnel.open` (organizer → worker) — slice D17: open `POST /peer/v1/tunnel/<tid>` and pipe it to the run's edge on
|
|
450
|
+
* `127.0.0.1:<port>`. `port` is what the organizer believes the edge's port is: the worker pipes to ITS OWN record of
|
|
451
|
+
* the run's edge, and refuses a port that is not that one.
|
|
452
|
+
*/
|
|
453
|
+
export interface TunnelOpen {
|
|
454
|
+
tunnelId: string;
|
|
455
|
+
runId: string;
|
|
456
|
+
port?: number;
|
|
457
|
+
}
|
|
458
|
+
/** `tunnel.close` (organizer → worker) — slice D17. */
|
|
459
|
+
export interface TunnelClose {
|
|
460
|
+
tunnelId: string;
|
|
461
|
+
why?: string;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* `launch.start` (organizer → worker) — Phase 5, slice D29 (§ 13): LensMCP's launcher, never a command. It names a role,
|
|
465
|
+
* a client and the words it is told; the worker runs the client exactly as `launches.ts` does locally — from ITS store's
|
|
466
|
+
* folder of `lensmcp` (the organizer's version, § 9), in a checkout of the repository on that Mac, under an account of
|
|
467
|
+
* that Mac by its id. No argument, path of the organizer, MCP server list or skill folder travels: a launch on a worker
|
|
468
|
+
* keeps that Mac's own client settings. Answered by {@link LaunchStarted}, or refused (`refused`, with why).
|
|
469
|
+
*/
|
|
470
|
+
export interface LaunchStart {
|
|
471
|
+
/** The launch's id, minted by the organizer (`ln-<time>-<6 hex>`): its record there, its registry entry here. */
|
|
472
|
+
launchId: string;
|
|
473
|
+
/** The organizer's repository (its coordination id): the worker's checkouts of it are the ones its main mirror binds (D34). */
|
|
474
|
+
repository: string;
|
|
475
|
+
goal: string;
|
|
476
|
+
task?: string;
|
|
477
|
+
role: string;
|
|
478
|
+
/** The session that launched it (a manager), or `person` / `overseer`: the record's `by`. */
|
|
479
|
+
by: string;
|
|
480
|
+
client: 'claude' | 'codex';
|
|
481
|
+
model?: string;
|
|
482
|
+
effort?: string;
|
|
483
|
+
/**
|
|
484
|
+
* The goal's checkout on that host, as the worker names it (an absolute path there). It must be one of that Mac's
|
|
485
|
+
* checkouts of the repository — its main mirror's, or a worktree of it — else the launch is refused. Exactly one of
|
|
486
|
+
* `worktree` and `placedGoal`.
|
|
487
|
+
*/
|
|
488
|
+
worktree?: string;
|
|
489
|
+
/**
|
|
490
|
+
* The goal is placed on that worker (D30): the launch runs in the goal's own worktree there, which the worker finds
|
|
491
|
+
* by the goal — the organizer keeps no folder of it. Refused when the goal is not placed on that Mac for this
|
|
492
|
+
* repository.
|
|
493
|
+
*/
|
|
494
|
+
placedGoal?: true;
|
|
495
|
+
/** What it reads first, on its stdin (launches.ts MAX_PROMPT_CHARS). */
|
|
496
|
+
prompt: string;
|
|
497
|
+
/** What its role holds for the whole session (launches.ts `roleText`, MAX_ROLE_TEXT_CHARS). */
|
|
498
|
+
roleText?: string;
|
|
499
|
+
/** The name its session shows (Claude Code `-n`). */
|
|
500
|
+
name?: string;
|
|
501
|
+
/** Stopped past this many minutes (launches.ts MAX_LAUNCH_MINUTES at most). */
|
|
502
|
+
maxMinutes: number;
|
|
503
|
+
/** An account on THAT Mac, by its id — never a token: its sign-in folder is the worker's own. None: the client's selected one there. */
|
|
504
|
+
account?: string;
|
|
505
|
+
/** Put in the launched client's environment as `LENSMCP_PEER_LAUNCH_KEY` (§ 13). Never logged, listed or answered. */
|
|
506
|
+
launchKey: string;
|
|
507
|
+
/** The organizer's LensMCP version: the worker launches only when it runs it (§ 9), from its store's folder of it. */
|
|
508
|
+
lensmcp: string;
|
|
509
|
+
/** Continue one exact native conversation that ran on this worker — its launch there, its thread, and the checkout it ran in when that is another (it is carried over, as launches.ts does). */
|
|
510
|
+
resume?: {
|
|
511
|
+
launchId: string;
|
|
512
|
+
threadId: string;
|
|
513
|
+
from?: string;
|
|
514
|
+
};
|
|
515
|
+
/** The kind of role it staffs (launches.ts `capKind`). */
|
|
516
|
+
capKind?: 'writers' | 'checkers';
|
|
517
|
+
}
|
|
518
|
+
/** What the worker answers a `launch.start` it ran with. */
|
|
519
|
+
export interface LaunchStarted {
|
|
520
|
+
started: true;
|
|
521
|
+
/** The client's process on the worker — its group's leader. The organizer never signals it nor asks `ps` about it. */
|
|
522
|
+
pid: number;
|
|
523
|
+
/** The checkout it runs in, as the worker resolved it (its real path), and that checkout's branch. */
|
|
524
|
+
worktree: string;
|
|
525
|
+
branch?: string;
|
|
526
|
+
startedAt: number;
|
|
527
|
+
deadline: number;
|
|
528
|
+
/** Claude Code's session id, chosen before it starts. */
|
|
529
|
+
threadId?: string;
|
|
530
|
+
/** The lensmcp it was given first on its PATH: the worker's store's folder of this version. */
|
|
531
|
+
lensmcp: string;
|
|
532
|
+
}
|
|
533
|
+
/** `launch.stop` (organizer → worker) — slice D29: its process group is stopped (SIGTERM, SIGKILL after the grace). */
|
|
534
|
+
export interface LaunchStop {
|
|
535
|
+
launchId: string;
|
|
536
|
+
why?: string;
|
|
537
|
+
}
|
|
538
|
+
/** What a launch ended on, as its worker read its output: its client's quota stop, or its context (launches.ts). */
|
|
539
|
+
export interface LaunchEndFacts {
|
|
540
|
+
quota?: {
|
|
541
|
+
client: 'claude' | 'codex';
|
|
542
|
+
why: string;
|
|
543
|
+
until: number;
|
|
544
|
+
firstTurn: boolean;
|
|
545
|
+
account?: string;
|
|
546
|
+
};
|
|
547
|
+
/** The client's own words when it ran out of context. */
|
|
548
|
+
context?: string;
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* `launch.state` (worker → organizer) — slice D29: where the launch stands by the worker's own `ps` look, on every change
|
|
552
|
+
* and on a beat while it runs. A state the organizer did not see before ends the launch there: its store's records of it
|
|
553
|
+
* are written by the organizer (`launchEnded`, its notices), and its key goes.
|
|
554
|
+
*/
|
|
555
|
+
export interface LaunchStateMessage {
|
|
556
|
+
launchId: string;
|
|
557
|
+
state: 'running' | 'exited' | 'stopped' | 'failed';
|
|
558
|
+
pid?: number;
|
|
559
|
+
at: number;
|
|
560
|
+
exitCode?: number;
|
|
561
|
+
endedAt?: number;
|
|
562
|
+
threadId?: string;
|
|
563
|
+
ended?: LaunchEndFacts;
|
|
564
|
+
}
|
|
565
|
+
/** `launch.tail` (worker → organizer) — slice D29: what its log said since the last tail, as readable lines, its key taken out. */
|
|
566
|
+
export interface LaunchTail {
|
|
567
|
+
launchId: string;
|
|
568
|
+
lines: string[];
|
|
569
|
+
at: number;
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* `store.call` (worker → organizer) — Phase 5, slices D27/D28 (planning/docker/27-remote-store.md «The wire»): one
|
|
573
|
+
* member of the organizer's coordination store, as one launch. Its own `v`, `kind` and `id` ride inside the envelope's:
|
|
574
|
+
* the call is what `libs/storage` remote-store.ts sends and the organizer's executor reads, whatever carries it. Its
|
|
575
|
+
* answer is a {@link StoreReply}, carried back as the `result` of the envelope's `ack`. Schema: {@link StoreCallSchema}.
|
|
576
|
+
*/
|
|
577
|
+
export interface StoreCall {
|
|
578
|
+
v: 1;
|
|
579
|
+
kind: 'store.call';
|
|
580
|
+
/** The reply carries it back. */
|
|
581
|
+
id: string;
|
|
582
|
+
/** A store member — a method called with `args`, or a property read (storage store-methods.ts). */
|
|
583
|
+
method: string;
|
|
584
|
+
/** Each argument as tagged JSON (storage remote-store.ts `encodeWire`). */
|
|
585
|
+
args: unknown[];
|
|
586
|
+
/** `LENSMCP_PEER_LAUNCH_KEY`: the call acts as that launch's session only. Never logged, listed or answered. */
|
|
587
|
+
launchKey: string;
|
|
588
|
+
/** The look at the checkout, taken on the worker: git's facts, never its paths. */
|
|
589
|
+
observe?: {
|
|
590
|
+
intervalMs?: number;
|
|
591
|
+
snapshot?: StoreCheckoutLook;
|
|
592
|
+
failed?: true;
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
/** Git's facts about a worker's checkout — what `checkoutSnapshot` makes, without its folders. */
|
|
596
|
+
export interface StoreCheckoutLook {
|
|
597
|
+
branch: string | null;
|
|
598
|
+
head: string | null;
|
|
599
|
+
files: Array<{
|
|
600
|
+
path: string;
|
|
601
|
+
from?: string;
|
|
602
|
+
status: string;
|
|
603
|
+
staged?: {
|
|
604
|
+
added: number | null;
|
|
605
|
+
removed: number | null;
|
|
606
|
+
};
|
|
607
|
+
unstaged?: {
|
|
608
|
+
added: number | null;
|
|
609
|
+
removed: number | null;
|
|
610
|
+
};
|
|
611
|
+
}>;
|
|
612
|
+
truncated: boolean;
|
|
613
|
+
}
|
|
614
|
+
/** Why a store call failed, as it crosses: a refusal keeps its words; anything else says only that it could not run. */
|
|
615
|
+
export interface StoreCallError {
|
|
616
|
+
name: 'CoordinationError' | 'CapacityRefusal' | 'CoordinationBusyError' | 'StoreCallRefused' | 'Error';
|
|
617
|
+
message: string;
|
|
618
|
+
/** A refusal for want of a slot: the room it found (storage goal-capacity.ts `CapacityRoom`). */
|
|
619
|
+
room?: object;
|
|
620
|
+
step?: 'open' | 'write' | 'commit' | 'read';
|
|
621
|
+
waitedMs?: number;
|
|
622
|
+
tries?: number;
|
|
623
|
+
wrote?: boolean;
|
|
624
|
+
/** The store file by its name, never a folder. */
|
|
625
|
+
where?: string;
|
|
626
|
+
wal?: boolean;
|
|
627
|
+
}
|
|
628
|
+
/** `store.reply` (organizer → worker) — slices D27/D28: the answer to one {@link StoreCall}, as the `result` of its `ack`. */
|
|
629
|
+
export interface StoreReply {
|
|
630
|
+
v: 1;
|
|
631
|
+
kind: 'store.reply';
|
|
632
|
+
/** The call it answers. */
|
|
633
|
+
id: string;
|
|
634
|
+
/** The call saved a write before it answered or failed. */
|
|
635
|
+
wrote: boolean;
|
|
636
|
+
result?: unknown;
|
|
637
|
+
error?: StoreCallError;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* `store.read` (worker → organizer) — slice D32 (planning/docker/00-plan.md § 13, DW-Q2: read-only): the WORKER's own
|
|
641
|
+
* read of the organizer's board, for the worker's dashboard. It carries no launch key — it acts as no launch: the hub
|
|
642
|
+
* runs it as the worker whose link it came on (its pin, read again at every call), and only the board's read members
|
|
643
|
+
* run (storage store-methods.ts `WORKER_BOARD_READS`): never a write, never a person's member, never a member that
|
|
644
|
+
* reads the organizer's files or folders. Several reads ride one call and one open of the store; the answer is a
|
|
645
|
+
* {@link StoreReply} whose `result` is the reads' answers in order (tagged JSON). Schema: {@link StoreReadSchema}.
|
|
646
|
+
*/
|
|
647
|
+
export interface StoreRead {
|
|
648
|
+
v: 1;
|
|
649
|
+
kind: 'store.read';
|
|
650
|
+
id: string;
|
|
651
|
+
/** The organizer's repository, as its coordination store names it — the worker's main checkout is bound to it (D34). */
|
|
652
|
+
repoId: string;
|
|
653
|
+
/** At most {@link STORE_READ_LIMITS}`.calls`: each a member of the board's reads, and its arguments as tagged JSON. */
|
|
654
|
+
calls: Array<{
|
|
655
|
+
method: string;
|
|
656
|
+
args: unknown[];
|
|
657
|
+
}>;
|
|
658
|
+
}
|
|
659
|
+
/** `version.install` (organizer → worker) — slice D13: install the organizer's version, from the registry or from the organizer's tarball. */
|
|
660
|
+
export interface VersionInstall {
|
|
661
|
+
version: string;
|
|
662
|
+
from: 'registry' | 'organizer';
|
|
663
|
+
/** With `organizer`: the tarball's bundle id and its sha256. */
|
|
664
|
+
tarball?: {
|
|
665
|
+
bundleId: string;
|
|
666
|
+
sha256: string;
|
|
667
|
+
size: number;
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
/** What one side runs: its LensMCP version and its peer protocol (D13's `PeerSide` in `apps/agent` versions.ts). */
|
|
671
|
+
export interface PeerVersions {
|
|
672
|
+
lensmcp: string;
|
|
673
|
+
protocol: string;
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* `version.state` (worker → organizer) — slice D13, carried by D14: the worker's `PeerVersionState` (apps/agent
|
|
677
|
+
* versions.ts), what both dashboards say of it. `why` is D13's `OutOfStep`: its `kind`, and its facts.
|
|
678
|
+
*/
|
|
679
|
+
export type VersionState = {
|
|
680
|
+
state: 'in-step';
|
|
681
|
+
worker: PeerVersions;
|
|
682
|
+
organizer: PeerVersions;
|
|
683
|
+
} | {
|
|
684
|
+
state: 'installing';
|
|
685
|
+
worker: PeerVersions;
|
|
686
|
+
organizer: PeerVersions;
|
|
687
|
+
from: 'registry' | 'organizer';
|
|
688
|
+
since: number;
|
|
689
|
+
} | {
|
|
690
|
+
state: 'waiting-for-person';
|
|
691
|
+
worker: PeerVersions;
|
|
692
|
+
organizer: PeerVersions;
|
|
693
|
+
stored: boolean;
|
|
694
|
+
} | {
|
|
695
|
+
state: 'out-of-step';
|
|
696
|
+
worker: PeerVersions;
|
|
697
|
+
organizer: PeerVersions;
|
|
698
|
+
why: {
|
|
699
|
+
kind: string;
|
|
700
|
+
} & Record<string, string | number | boolean>;
|
|
701
|
+
};
|
|
702
|
+
/** `capacity` (worker → organizer) — slice D14: every 30 s and on change. */
|
|
703
|
+
export type CapacityMessage = WorkerAdvert;
|
|
704
|
+
/**
|
|
705
|
+
* `instance.tunnel.open` (organizer → worker) — slice D35: open `POST /peer/v1/tunnel/<tid>` and hand it to the
|
|
706
|
+
* worker's own gateway for the remote instance `instanceId` (`apps/agent` `peers/remote-instance.ts`
|
|
707
|
+
* `answerInstanceTunnel`). It names the instance and nothing else: the worker dials ITS gateway at the port its own
|
|
708
|
+
* control socket says, and lets through only requests whose Host is that instance's — by its own record of the
|
|
709
|
+
* instances it runs for this organizer (`remote-instances.ts`). A stream is closed as any tunnel's: `tunnel.close { tunnelId }`.
|
|
710
|
+
*/
|
|
711
|
+
export interface InstanceTunnelOpen {
|
|
712
|
+
tunnelId: string;
|
|
713
|
+
instanceId: string;
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* `instance.state` (worker → organizer) — slice D35, sent by D30 (goal worktrees on a worker): an instance the worker
|
|
717
|
+
* runs for this organizer came up (`up`, with its apex and its lens dashboard's base as its gateway serves them) or went
|
|
718
|
+
* (`gone`). The hub then routes it (`routeRemoteInstance`) or takes its routes away. Its apex is checked again by the
|
|
719
|
+
* organizer's gateway, which never names a host the worker says unless it is `<name>.<the workspace's apex>`.
|
|
720
|
+
*/
|
|
721
|
+
export interface InstanceStateMessage {
|
|
722
|
+
instanceId: string;
|
|
723
|
+
state: 'up' | 'gone';
|
|
724
|
+
apex?: string;
|
|
725
|
+
dashboardBase?: string;
|
|
726
|
+
at: number;
|
|
727
|
+
why?: string;
|
|
728
|
+
}
|
|
729
|
+
/** Every control message's body, by type. */
|
|
730
|
+
export interface PeerBodies {
|
|
731
|
+
hello: PeerHello;
|
|
732
|
+
ping: PeerPing;
|
|
733
|
+
pong: PeerPing;
|
|
734
|
+
ack: PeerAck;
|
|
735
|
+
error: PeerErrorBody;
|
|
736
|
+
forget: PeerForget;
|
|
737
|
+
capacity: CapacityMessage;
|
|
738
|
+
'job.offer': JobOffer;
|
|
739
|
+
'job.cancel': JobCancel;
|
|
740
|
+
'job.state': JobStateMessage;
|
|
741
|
+
'job.stage': JobStageMessage;
|
|
742
|
+
'job.done': JobDoneMessage;
|
|
743
|
+
'bundle.ready': BundleReady;
|
|
744
|
+
'bundle.sent': BundleSent;
|
|
745
|
+
'tunnel.open': TunnelOpen;
|
|
746
|
+
'tunnel.close': TunnelClose;
|
|
747
|
+
'launch.start': LaunchStart;
|
|
748
|
+
'launch.stop': LaunchStop;
|
|
749
|
+
'launch.state': LaunchStateMessage;
|
|
750
|
+
'launch.tail': LaunchTail;
|
|
751
|
+
'store.call': StoreCall;
|
|
752
|
+
'store.reply': StoreReply;
|
|
753
|
+
'store.read': StoreRead;
|
|
754
|
+
'version.install': VersionInstall;
|
|
755
|
+
'version.state': VersionState;
|
|
756
|
+
'main.moved': MainMoved;
|
|
757
|
+
'main.state': MainStateNotice;
|
|
758
|
+
'instance.tunnel.open': InstanceTunnelOpen;
|
|
759
|
+
'instance.state': InstanceStateMessage;
|
|
760
|
+
'goal.place': GoalPlace;
|
|
761
|
+
'goal.sent': GoalSent;
|
|
762
|
+
'goal.changes': GoalChanges;
|
|
763
|
+
'goal.update': GoalUpdate;
|
|
764
|
+
}
|
|
765
|
+
export type PeerMessageType = keyof PeerBodies;
|
|
766
|
+
/** One control message: the discriminated union, by `type`. */
|
|
767
|
+
export type PeerMessage = {
|
|
768
|
+
[T in PeerMessageType]: PeerEnvelope<T, PeerBodies[T]>;
|
|
769
|
+
}[PeerMessageType];
|
|
770
|
+
/** What the organizer sends (§ 8, left column). */
|
|
771
|
+
export declare const TO_WORKER: readonly ["job.offer", "job.cancel", "bundle.ready", "tunnel.open", "tunnel.close", "launch.start", "launch.stop", "store.reply", "version.install", "main.moved", "instance.tunnel.open", "goal.place", "goal.changes", "goal.update"];
|
|
772
|
+
/** What the worker sends (§ 8, right column), and `forget`. */
|
|
773
|
+
export declare const TO_ORGANIZER: readonly ["hello", "capacity", "job.state", "job.stage", "job.done", "bundle.sent", "launch.state", "launch.tail", "store.call", "version.state", "forget", "main.state", "instance.state", "store.read", "goal.sent"];
|
|
774
|
+
/** Either side sends a ping. */
|
|
775
|
+
export declare const EITHER_WAY: readonly ["ping"];
|
|
776
|
+
/** The replies: each names the message it answers, and is answered by nothing. */
|
|
777
|
+
export declare const PEER_REPLIES: readonly ["ack", "error", "pong"];
|
|
778
|
+
export type ToWorkerType = (typeof TO_WORKER)[number];
|
|
779
|
+
export type ToOrganizerType = (typeof TO_ORGANIZER)[number];
|
|
780
|
+
export type PeerReplyType = (typeof PEER_REPLIES)[number];
|
|
781
|
+
export type PeerSide = 'organizer' | 'worker';
|
|
782
|
+
/** The slice each message belongs to — who owns its fields, and registers its handler. */
|
|
783
|
+
export declare const PEER_MESSAGE_SLICE: {
|
|
784
|
+
readonly [T in PeerMessageType]: string;
|
|
785
|
+
};
|
|
786
|
+
/** Whether `type` is a message of the allowlist. */
|
|
787
|
+
export declare const isPeerMessageType: (type: string) => type is PeerMessageType;
|
|
788
|
+
/** Whether `side` may SEND a message of `type`: the organizer sends {@link TO_WORKER}, the worker {@link TO_ORGANIZER}, both a ping and the replies. */
|
|
789
|
+
export declare function peerMaySend(side: PeerSide, type: string): boolean;
|
|
790
|
+
export declare const isPeerReply: (type: string) => type is PeerReplyType;
|
|
791
|
+
/**
|
|
792
|
+
* The exchange, one JSON object per line each way, on ONE TLS connection — so both certificates are fixed for all of
|
|
793
|
+
* it (§ 7 step 2):
|
|
794
|
+
*
|
|
795
|
+
* worker → pair.hello its nonce, name, model, version
|
|
796
|
+
* organizer → pair.challenge its nonce (no proof yet: nothing to guess at offline)
|
|
797
|
+
* worker → pair.proof HMAC(key(code, both nonces), "worker" ‖ organizer fp ‖ worker fp ‖ both nonces)
|
|
798
|
+
* organizer → pair.accepted its own proof, the same over "organizer", its name, model, the four words
|
|
799
|
+
* | error wrong-code (triesLeft), window-closed, …
|
|
800
|
+
* organizer → pair.approved | pair.declined once its person answered (or the time to approve ran out)
|
|
801
|
+
*
|
|
802
|
+
* A worker whose pin is pending and whose link dropped comes back with `pair.resume` and hears the answer. The code
|
|
803
|
+
* itself never travels; a man in the middle presents another certificate, so the proofs it relays bind the wrong
|
|
804
|
+
* fingerprints, and the four words differ on the two screens.
|
|
805
|
+
*/
|
|
806
|
+
export interface PairBodies {
|
|
807
|
+
'pair.hello': {
|
|
808
|
+
protocol: PeerProtocol;
|
|
809
|
+
nonce: string;
|
|
810
|
+
name: string;
|
|
811
|
+
model: string;
|
|
812
|
+
lensmcp: string;
|
|
813
|
+
};
|
|
814
|
+
'pair.resume': {
|
|
815
|
+
protocol: PeerProtocol;
|
|
816
|
+
};
|
|
817
|
+
'pair.challenge': {
|
|
818
|
+
nonce: string;
|
|
819
|
+
};
|
|
820
|
+
'pair.proof': {
|
|
821
|
+
proof: string;
|
|
822
|
+
};
|
|
823
|
+
'pair.accepted': {
|
|
824
|
+
proof: string;
|
|
825
|
+
name: string;
|
|
826
|
+
model: string;
|
|
827
|
+
words: PeerWords;
|
|
828
|
+
approveBy: number;
|
|
829
|
+
};
|
|
830
|
+
'pair.approved': {
|
|
831
|
+
at: number;
|
|
832
|
+
};
|
|
833
|
+
'pair.declined': {
|
|
834
|
+
why: string;
|
|
835
|
+
};
|
|
836
|
+
error: PeerErrorBody;
|
|
837
|
+
}
|
|
838
|
+
export type PairMessageType = keyof PairBodies;
|
|
839
|
+
export type PairMessage = {
|
|
840
|
+
[T in PairMessageType]: PeerEnvelope<T, PairBodies[T]>;
|
|
841
|
+
}[PairMessageType];
|
|
842
|
+
/** The envelope, whatever its type: the body is any object until its type's schema reads it. */
|
|
843
|
+
export declare const PeerEnvelopeSchema: z.ZodObject<{
|
|
844
|
+
v: z.ZodLiteral<1>;
|
|
845
|
+
id: z.ZodString;
|
|
846
|
+
replyTo: z.ZodOptional<z.ZodString>;
|
|
847
|
+
type: z.ZodString;
|
|
848
|
+
body: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
849
|
+
}, z.core.$strict>;
|
|
850
|
+
export declare const PeerErrorBodySchema: z.ZodObject<{
|
|
851
|
+
code: z.ZodEnum<{
|
|
852
|
+
timeout: "timeout";
|
|
853
|
+
lost: "lost";
|
|
854
|
+
refused: "refused";
|
|
855
|
+
"unknown-type": "unknown-type";
|
|
856
|
+
"wrong-direction": "wrong-direction";
|
|
857
|
+
"bad-message": "bad-message";
|
|
858
|
+
"hello-first": "hello-first";
|
|
859
|
+
"not-handled": "not-handled";
|
|
860
|
+
"too-large": "too-large";
|
|
861
|
+
busy: "busy";
|
|
862
|
+
internal: "internal";
|
|
863
|
+
"no-window": "no-window";
|
|
864
|
+
"window-used": "window-used";
|
|
865
|
+
"window-closed": "window-closed";
|
|
866
|
+
"wrong-code": "wrong-code";
|
|
867
|
+
protocol: "protocol";
|
|
868
|
+
}>;
|
|
869
|
+
message: z.ZodString;
|
|
870
|
+
triesLeft: z.ZodOptional<z.ZodNumber>;
|
|
871
|
+
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
872
|
+
}, z.core.$strict>;
|
|
873
|
+
/**
|
|
874
|
+
* {@link WorkerAdvert} on the wire: an object, its `runs` run ids. The rest is read field by field by apps/agent's
|
|
875
|
+
* `readHostCapacity` (capacity.ts) before anything decides on it — an advert it cannot read is not kept.
|
|
876
|
+
*/
|
|
877
|
+
export declare const WorkerAdvertSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
878
|
+
/**
|
|
879
|
+
* The schemas of the channel's own messages (D11, D12). The other slices' types register theirs with their handlers
|
|
880
|
+
* (the work's: {@link PEER_WORK_SCHEMAS}); `hello`'s version part is D13's (`follow`), its capacity D14's.
|
|
881
|
+
*/
|
|
882
|
+
export declare const PEER_BODY_SCHEMAS: {
|
|
883
|
+
readonly hello: z.ZodObject<{
|
|
884
|
+
protocol: z.ZodLiteral<"peer/v1">;
|
|
885
|
+
lensmcp: z.ZodString;
|
|
886
|
+
follow: z.ZodOptional<z.ZodBoolean>;
|
|
887
|
+
store: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
888
|
+
capacity: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
889
|
+
}, z.core.$strict>;
|
|
890
|
+
readonly ping: z.ZodObject<{
|
|
891
|
+
at: z.ZodNumber;
|
|
892
|
+
}, z.core.$strict>;
|
|
893
|
+
readonly pong: z.ZodObject<{
|
|
894
|
+
at: z.ZodNumber;
|
|
895
|
+
}, z.core.$strict>;
|
|
896
|
+
readonly ack: z.ZodObject<{
|
|
897
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
898
|
+
}, z.core.$strict>;
|
|
899
|
+
readonly error: z.ZodObject<{
|
|
900
|
+
code: z.ZodEnum<{
|
|
901
|
+
timeout: "timeout";
|
|
902
|
+
lost: "lost";
|
|
903
|
+
refused: "refused";
|
|
904
|
+
"unknown-type": "unknown-type";
|
|
905
|
+
"wrong-direction": "wrong-direction";
|
|
906
|
+
"bad-message": "bad-message";
|
|
907
|
+
"hello-first": "hello-first";
|
|
908
|
+
"not-handled": "not-handled";
|
|
909
|
+
"too-large": "too-large";
|
|
910
|
+
busy: "busy";
|
|
911
|
+
internal: "internal";
|
|
912
|
+
"no-window": "no-window";
|
|
913
|
+
"window-used": "window-used";
|
|
914
|
+
"window-closed": "window-closed";
|
|
915
|
+
"wrong-code": "wrong-code";
|
|
916
|
+
protocol: "protocol";
|
|
917
|
+
}>;
|
|
918
|
+
message: z.ZodString;
|
|
919
|
+
triesLeft: z.ZodOptional<z.ZodNumber>;
|
|
920
|
+
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
921
|
+
}, z.core.$strict>;
|
|
922
|
+
readonly forget: z.ZodObject<{
|
|
923
|
+
why: z.ZodOptional<z.ZodString>;
|
|
924
|
+
}, z.core.$strict>;
|
|
925
|
+
};
|
|
926
|
+
/** The organizer's answer to `hello`, as the worker reads it. */
|
|
927
|
+
export declare const PeerWelcomeSchema: z.ZodObject<{
|
|
928
|
+
protocol: z.ZodLiteral<"peer/v1">;
|
|
929
|
+
lensmcp: z.ZodString;
|
|
930
|
+
name: z.ZodString;
|
|
931
|
+
inStep: z.ZodOptional<z.ZodBoolean>;
|
|
932
|
+
why: z.ZodOptional<z.ZodString>;
|
|
933
|
+
}, z.core.$strict>;
|
|
934
|
+
/** The pairing exchange's schemas: one per step, strict — a field this version does not know refuses the step. */
|
|
935
|
+
export declare const PAIR_BODY_SCHEMAS: {
|
|
936
|
+
readonly 'pair.hello': z.ZodObject<{
|
|
937
|
+
protocol: z.ZodLiteral<"peer/v1">;
|
|
938
|
+
nonce: z.ZodString;
|
|
939
|
+
name: z.ZodString;
|
|
940
|
+
model: z.ZodString;
|
|
941
|
+
lensmcp: z.ZodString;
|
|
942
|
+
}, z.core.$strict>;
|
|
943
|
+
readonly 'pair.resume': z.ZodObject<{
|
|
944
|
+
protocol: z.ZodLiteral<"peer/v1">;
|
|
945
|
+
}, z.core.$strict>;
|
|
946
|
+
readonly 'pair.challenge': z.ZodObject<{
|
|
947
|
+
nonce: z.ZodString;
|
|
948
|
+
}, z.core.$strict>;
|
|
949
|
+
readonly 'pair.proof': z.ZodObject<{
|
|
950
|
+
proof: z.ZodString;
|
|
951
|
+
}, z.core.$strict>;
|
|
952
|
+
readonly 'pair.accepted': z.ZodObject<{
|
|
953
|
+
proof: z.ZodString;
|
|
954
|
+
name: z.ZodString;
|
|
955
|
+
model: z.ZodString;
|
|
956
|
+
words: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString, z.ZodString], null>;
|
|
957
|
+
approveBy: z.ZodNumber;
|
|
958
|
+
}, z.core.$strict>;
|
|
959
|
+
readonly 'pair.approved': z.ZodObject<{
|
|
960
|
+
at: z.ZodNumber;
|
|
961
|
+
}, z.core.$strict>;
|
|
962
|
+
readonly 'pair.declined': z.ZodObject<{
|
|
963
|
+
why: z.ZodString;
|
|
964
|
+
}, z.core.$strict>;
|
|
965
|
+
readonly error: z.ZodObject<{
|
|
966
|
+
code: z.ZodEnum<{
|
|
967
|
+
timeout: "timeout";
|
|
968
|
+
lost: "lost";
|
|
969
|
+
refused: "refused";
|
|
970
|
+
"unknown-type": "unknown-type";
|
|
971
|
+
"wrong-direction": "wrong-direction";
|
|
972
|
+
"bad-message": "bad-message";
|
|
973
|
+
"hello-first": "hello-first";
|
|
974
|
+
"not-handled": "not-handled";
|
|
975
|
+
"too-large": "too-large";
|
|
976
|
+
busy: "busy";
|
|
977
|
+
internal: "internal";
|
|
978
|
+
"no-window": "no-window";
|
|
979
|
+
"window-used": "window-used";
|
|
980
|
+
"window-closed": "window-closed";
|
|
981
|
+
"wrong-code": "wrong-code";
|
|
982
|
+
protocol: "protocol";
|
|
983
|
+
}>;
|
|
984
|
+
message: z.ZodString;
|
|
985
|
+
triesLeft: z.ZodOptional<z.ZodNumber>;
|
|
986
|
+
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
987
|
+
}, z.core.$strict>;
|
|
988
|
+
};
|
|
989
|
+
/**
|
|
990
|
+
* MAIN ON A WORKER (§ 14, slice D34): the worker's main checkout is a mirror of the organizer's main, and nothing lives
|
|
991
|
+
* on the worker alone. Main moves on the organizer only — by a fast-forward on a clean main (the Changes page's rule) —
|
|
992
|
+
* and its push to origin stays the person's. The worker sends what it commits into its own namespace at the organizer
|
|
993
|
+
* (`bundle.sent` for `heads/<branch>`), and what it leaves uncommitted as a snapshot that moves no branch (`wip/<branch>`);
|
|
994
|
+
* the organizer tells it where main is whenever main moves (`main.moved`), and it says how its main stands
|
|
995
|
+
* (`main.state`). The bytes go by the two bulk paths: `GET /peer/v1/bundles/<id>` (main's, to the worker) and
|
|
996
|
+
* `PUT /peer/v1/sent/<id>` (the worker's).
|
|
997
|
+
*/
|
|
998
|
+
export declare const MAIN_MIRROR: {
|
|
999
|
+
/** The branch the organizer's main checkout is on, and a worker's main follows, unless said. */
|
|
1000
|
+
readonly branch: "main";
|
|
1001
|
+
/** What is uncommitted on a worker's main is snapshotted once nothing there changed for this long (§ 14: «10 minutes of quiet»). */
|
|
1002
|
+
readonly quietMs: number;
|
|
1003
|
+
/** …and at least this often while it keeps changing: hours of edits without a pause are not on one Mac alone. */
|
|
1004
|
+
readonly snapshotEveryMs: number;
|
|
1005
|
+
/** The largest bundle of a worker's main commits the organizer takes. */
|
|
1006
|
+
readonly maxSendBytes: number;
|
|
1007
|
+
/** The largest snapshot the organizer takes. */
|
|
1008
|
+
readonly maxWipBytes: number;
|
|
1009
|
+
/** The commits a worker names in `main.state` for main's next bundle to be cut against. */
|
|
1010
|
+
readonly maxHaves: 16;
|
|
1011
|
+
};
|
|
1012
|
+
/** Where a worker's sent commits stand against the organizer's main. */
|
|
1013
|
+
export type MainBringIn =
|
|
1014
|
+
/** Main holds every commit the worker sent. */
|
|
1015
|
+
'in-main'
|
|
1016
|
+
/** A fast-forward on a clean main: main moved to them. */
|
|
1017
|
+
| 'brought-in'
|
|
1018
|
+
/** A fast-forward, and main has uncommitted changes (or is not on its branch): they wait until it is clean. */
|
|
1019
|
+
| 'waiting'
|
|
1020
|
+
/** Main moved past what they were made on: the worker updates from main, and sends again. */
|
|
1021
|
+
| 'not-ff'
|
|
1022
|
+
/** Not taken: a bundle the intake refused, a ref outside what the worker may send. */
|
|
1023
|
+
| 'refused';
|
|
1024
|
+
export declare const MAIN_BRING_IN: readonly MainBringIn[];
|
|
1025
|
+
/** What the organizer did with a worker's sent main — the answer to its `bundle.sent`, and in every `main.moved` since. */
|
|
1026
|
+
export interface MainSendVerdict {
|
|
1027
|
+
state: MainBringIn;
|
|
1028
|
+
/** The worker's commits not on main when this was decided (a bring-in: those it brought). */
|
|
1029
|
+
count: number;
|
|
1030
|
+
/** The worker's sent tip. */
|
|
1031
|
+
sha?: string;
|
|
1032
|
+
/** Main's head after it. */
|
|
1033
|
+
main?: string;
|
|
1034
|
+
why: string;
|
|
1035
|
+
at: number;
|
|
1036
|
+
}
|
|
1037
|
+
/** The answer to `bundle.sent` (the `result` of its `ack`). */
|
|
1038
|
+
export interface BundleSentAnswer {
|
|
1039
|
+
took: boolean;
|
|
1040
|
+
/** The ref, relative to the worker's namespace. */
|
|
1041
|
+
ref: string;
|
|
1042
|
+
sha?: string;
|
|
1043
|
+
/** Why it was not taken: a word a program reads, a sentence a person can. */
|
|
1044
|
+
code?: string;
|
|
1045
|
+
why?: string;
|
|
1046
|
+
/** For `heads/<branch>`: what became of the commits. */
|
|
1047
|
+
verdict?: MainSendVerdict;
|
|
1048
|
+
}
|
|
1049
|
+
/** How a worker's main stands against the organizer's. */
|
|
1050
|
+
export type MainFollowState =
|
|
1051
|
+
/** It is the organizer's main. */
|
|
1052
|
+
'in-step'
|
|
1053
|
+
/** It just fast-forwarded to it. */
|
|
1054
|
+
| 'fast-forward'
|
|
1055
|
+
/** It holds commits main has not taken yet, and lacks nothing of main's. */
|
|
1056
|
+
| 'ahead'
|
|
1057
|
+
/** Main has commits it lacks, and it is not clean: «M to pull» waits for «Update from main». */
|
|
1058
|
+
| 'waiting'
|
|
1059
|
+
/** Both have commits the other lacks: «Update from main» merges main in. */
|
|
1060
|
+
| 'to-update'
|
|
1061
|
+
/** The organizer has not said where main is yet. */
|
|
1062
|
+
| 'not-following'
|
|
1063
|
+
/** The main checkout is on another branch, or none. */
|
|
1064
|
+
| 'off-branch';
|
|
1065
|
+
export declare const MAIN_FOLLOW_STATES: readonly MainFollowState[];
|
|
1066
|
+
/** `main.moved` (organizer → worker) — slice D34: main is at `sha` now; the bundle that carries it is `GET /peer/v1/bundles/<id>`. */
|
|
1067
|
+
export interface MainMoved {
|
|
1068
|
+
/** The repository, as the coordination store names it. */
|
|
1069
|
+
repository: string;
|
|
1070
|
+
branch: string;
|
|
1071
|
+
sha: string;
|
|
1072
|
+
/** Cut against what the worker holds as far as the organizer knows; the whole history when it knows nothing. */
|
|
1073
|
+
bundle: {
|
|
1074
|
+
id: string;
|
|
1075
|
+
size: number;
|
|
1076
|
+
sha256: string;
|
|
1077
|
+
};
|
|
1078
|
+
/** What became of the worker's own sent commits, as main stands now. */
|
|
1079
|
+
verdict?: MainSendVerdict;
|
|
1080
|
+
at: number;
|
|
1081
|
+
}
|
|
1082
|
+
/** The worker's answer to `main.moved`. */
|
|
1083
|
+
export interface MainMovedAnswer {
|
|
1084
|
+
took: boolean;
|
|
1085
|
+
/** Its main checkout lacks a commit the bundle needs: send the whole history. */
|
|
1086
|
+
needWhole?: boolean;
|
|
1087
|
+
why?: string;
|
|
1088
|
+
/** What its main did with it. */
|
|
1089
|
+
follow?: MainFollowState;
|
|
1090
|
+
head?: string;
|
|
1091
|
+
}
|
|
1092
|
+
/** Who a conflict on a worker's main asked: the person for the person's commits, a goal's manager for an agent's. */
|
|
1093
|
+
export interface MainAsked {
|
|
1094
|
+
who: 'person' | 'manager';
|
|
1095
|
+
goal?: string;
|
|
1096
|
+
/** Who was told, as the asking said it. None: the Changes page says it, and nobody else was reached. */
|
|
1097
|
+
to?: string;
|
|
1098
|
+
}
|
|
1099
|
+
/** «Update from main» on a worker's main, as it ended. */
|
|
1100
|
+
export interface MainUpdateReport {
|
|
1101
|
+
outcome: 'merged' | 'fast-forward' | 'current' | 'conflicts' | 'waiting' | 'refused';
|
|
1102
|
+
at: number;
|
|
1103
|
+
why: string;
|
|
1104
|
+
/** The merge it made, or the commit it moved to. */
|
|
1105
|
+
sha?: string;
|
|
1106
|
+
/** The files the merge conflicted in: the merge was undone. */
|
|
1107
|
+
conflicts?: string[];
|
|
1108
|
+
asked?: MainAsked[];
|
|
1109
|
+
}
|
|
1110
|
+
/** `main.state` (worker → organizer) — slice D34: the worker's main as it stands, on every change and with each send. */
|
|
1111
|
+
export interface MainStateNotice {
|
|
1112
|
+
repository: string;
|
|
1113
|
+
branch: string;
|
|
1114
|
+
head?: string;
|
|
1115
|
+
/** The organizer's main as the worker holds it. */
|
|
1116
|
+
organizerHead?: string;
|
|
1117
|
+
/** Commits it holds — its head, its upstream's, the last main it got — for main's next bundle to be cut against. */
|
|
1118
|
+
haves: string[];
|
|
1119
|
+
/** Its commits the organizer does not hold. */
|
|
1120
|
+
notSent: number;
|
|
1121
|
+
/** Main's commits it lacks, as it knows main. */
|
|
1122
|
+
toPull: number;
|
|
1123
|
+
/** What is uncommitted there: files, and the newest change's time (ms). */
|
|
1124
|
+
uncommitted: {
|
|
1125
|
+
files: number;
|
|
1126
|
+
changedAt?: number;
|
|
1127
|
+
};
|
|
1128
|
+
/** The newest snapshot of it, and whether the organizer has it. */
|
|
1129
|
+
snapshot?: {
|
|
1130
|
+
sha: string;
|
|
1131
|
+
at: number;
|
|
1132
|
+
files: number;
|
|
1133
|
+
sent: boolean;
|
|
1134
|
+
};
|
|
1135
|
+
follow: MainFollowState;
|
|
1136
|
+
/** The last «Update from main». */
|
|
1137
|
+
update?: MainUpdateReport;
|
|
1138
|
+
at: number;
|
|
1139
|
+
}
|
|
1140
|
+
/** The schemas slice D34's messages are checked by before a handler reads them. */
|
|
1141
|
+
export declare const MAIN_MIRROR_SCHEMAS: {
|
|
1142
|
+
readonly 'bundle.sent': z.ZodObject<{
|
|
1143
|
+
bundleId: z.ZodString;
|
|
1144
|
+
repository: z.ZodString;
|
|
1145
|
+
refs: z.ZodArray<z.ZodString>;
|
|
1146
|
+
size: z.ZodNumber;
|
|
1147
|
+
sha256: z.ZodString;
|
|
1148
|
+
}, z.core.$strict>;
|
|
1149
|
+
readonly 'main.moved': z.ZodObject<{
|
|
1150
|
+
repository: z.ZodString;
|
|
1151
|
+
branch: z.ZodString;
|
|
1152
|
+
sha: z.ZodString;
|
|
1153
|
+
bundle: z.ZodObject<{
|
|
1154
|
+
id: z.ZodString;
|
|
1155
|
+
size: z.ZodNumber;
|
|
1156
|
+
sha256: z.ZodString;
|
|
1157
|
+
}, z.core.$strict>;
|
|
1158
|
+
verdict: z.ZodOptional<z.ZodObject<{
|
|
1159
|
+
state: z.ZodEnum<{
|
|
1160
|
+
waiting: "waiting";
|
|
1161
|
+
refused: "refused";
|
|
1162
|
+
"in-main": "in-main";
|
|
1163
|
+
"brought-in": "brought-in";
|
|
1164
|
+
"not-ff": "not-ff";
|
|
1165
|
+
}>;
|
|
1166
|
+
count: z.ZodNumber;
|
|
1167
|
+
sha: z.ZodOptional<z.ZodString>;
|
|
1168
|
+
main: z.ZodOptional<z.ZodString>;
|
|
1169
|
+
why: z.ZodString;
|
|
1170
|
+
at: z.ZodNumber;
|
|
1171
|
+
}, z.core.$strict>>;
|
|
1172
|
+
at: z.ZodNumber;
|
|
1173
|
+
}, z.core.$strict>;
|
|
1174
|
+
readonly 'main.state': z.ZodObject<{
|
|
1175
|
+
repository: z.ZodString;
|
|
1176
|
+
branch: z.ZodString;
|
|
1177
|
+
head: z.ZodOptional<z.ZodString>;
|
|
1178
|
+
organizerHead: z.ZodOptional<z.ZodString>;
|
|
1179
|
+
haves: z.ZodArray<z.ZodString>;
|
|
1180
|
+
notSent: z.ZodNumber;
|
|
1181
|
+
toPull: z.ZodNumber;
|
|
1182
|
+
uncommitted: z.ZodObject<{
|
|
1183
|
+
files: z.ZodNumber;
|
|
1184
|
+
changedAt: z.ZodOptional<z.ZodNumber>;
|
|
1185
|
+
}, z.core.$strict>;
|
|
1186
|
+
snapshot: z.ZodOptional<z.ZodObject<{
|
|
1187
|
+
sha: z.ZodString;
|
|
1188
|
+
at: z.ZodNumber;
|
|
1189
|
+
files: z.ZodNumber;
|
|
1190
|
+
sent: z.ZodBoolean;
|
|
1191
|
+
}, z.core.$strict>>;
|
|
1192
|
+
follow: z.ZodEnum<{
|
|
1193
|
+
waiting: "waiting";
|
|
1194
|
+
"in-step": "in-step";
|
|
1195
|
+
"fast-forward": "fast-forward";
|
|
1196
|
+
ahead: "ahead";
|
|
1197
|
+
"to-update": "to-update";
|
|
1198
|
+
"not-following": "not-following";
|
|
1199
|
+
"off-branch": "off-branch";
|
|
1200
|
+
}>;
|
|
1201
|
+
update: z.ZodOptional<z.ZodObject<{
|
|
1202
|
+
outcome: z.ZodEnum<{
|
|
1203
|
+
waiting: "waiting";
|
|
1204
|
+
refused: "refused";
|
|
1205
|
+
current: "current";
|
|
1206
|
+
"fast-forward": "fast-forward";
|
|
1207
|
+
merged: "merged";
|
|
1208
|
+
conflicts: "conflicts";
|
|
1209
|
+
}>;
|
|
1210
|
+
at: z.ZodNumber;
|
|
1211
|
+
why: z.ZodString;
|
|
1212
|
+
sha: z.ZodOptional<z.ZodString>;
|
|
1213
|
+
conflicts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1214
|
+
asked: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1215
|
+
who: z.ZodEnum<{
|
|
1216
|
+
person: "person";
|
|
1217
|
+
manager: "manager";
|
|
1218
|
+
}>;
|
|
1219
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
1220
|
+
to: z.ZodOptional<z.ZodString>;
|
|
1221
|
+
}, z.core.$strict>>>;
|
|
1222
|
+
}, z.core.$strict>>;
|
|
1223
|
+
at: z.ZodNumber;
|
|
1224
|
+
}, z.core.$strict>;
|
|
1225
|
+
};
|
|
1226
|
+
/** The answers to them, as the side that sent each reads its `ack`'s result. */
|
|
1227
|
+
export declare const MAIN_MIRROR_ANSWER_SCHEMAS: {
|
|
1228
|
+
readonly 'bundle.sent': z.ZodObject<{
|
|
1229
|
+
took: z.ZodBoolean;
|
|
1230
|
+
ref: z.ZodString;
|
|
1231
|
+
sha: z.ZodOptional<z.ZodString>;
|
|
1232
|
+
code: z.ZodOptional<z.ZodString>;
|
|
1233
|
+
why: z.ZodOptional<z.ZodString>;
|
|
1234
|
+
verdict: z.ZodOptional<z.ZodObject<{
|
|
1235
|
+
state: z.ZodEnum<{
|
|
1236
|
+
waiting: "waiting";
|
|
1237
|
+
refused: "refused";
|
|
1238
|
+
"in-main": "in-main";
|
|
1239
|
+
"brought-in": "brought-in";
|
|
1240
|
+
"not-ff": "not-ff";
|
|
1241
|
+
}>;
|
|
1242
|
+
count: z.ZodNumber;
|
|
1243
|
+
sha: z.ZodOptional<z.ZodString>;
|
|
1244
|
+
main: z.ZodOptional<z.ZodString>;
|
|
1245
|
+
why: z.ZodString;
|
|
1246
|
+
at: z.ZodNumber;
|
|
1247
|
+
}, z.core.$strict>>;
|
|
1248
|
+
}, z.core.$strict>;
|
|
1249
|
+
readonly 'main.moved': z.ZodObject<{
|
|
1250
|
+
took: z.ZodBoolean;
|
|
1251
|
+
needWhole: z.ZodOptional<z.ZodBoolean>;
|
|
1252
|
+
why: z.ZodOptional<z.ZodString>;
|
|
1253
|
+
follow: z.ZodOptional<z.ZodEnum<{
|
|
1254
|
+
waiting: "waiting";
|
|
1255
|
+
"in-step": "in-step";
|
|
1256
|
+
"fast-forward": "fast-forward";
|
|
1257
|
+
ahead: "ahead";
|
|
1258
|
+
"to-update": "to-update";
|
|
1259
|
+
"not-following": "not-following";
|
|
1260
|
+
"off-branch": "off-branch";
|
|
1261
|
+
}>>;
|
|
1262
|
+
head: z.ZodOptional<z.ZodString>;
|
|
1263
|
+
}, z.core.$strict>;
|
|
1264
|
+
};
|
|
1265
|
+
/**
|
|
1266
|
+
* The schemas the work's messages are checked by, by type — each handler registers its type's (`hub.handle`,
|
|
1267
|
+
* `link.handle`). Kept apart from {@link PEER_BODY_SCHEMAS}, which the channel also holds its own sends to (a slice's
|
|
1268
|
+
* spec sends narrower tests of these). Strict at the top: a field this version does not know refuses the message.
|
|
1269
|
+
*/
|
|
1270
|
+
export declare const PEER_WORK_SCHEMAS: {
|
|
1271
|
+
readonly capacity: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1272
|
+
readonly 'job.offer': z.ZodObject<{
|
|
1273
|
+
runId: z.ZodString;
|
|
1274
|
+
job: z.ZodString;
|
|
1275
|
+
candidate: z.ZodString;
|
|
1276
|
+
repository: z.ZodString;
|
|
1277
|
+
lane: z.ZodOptional<z.ZodEnum<{
|
|
1278
|
+
light: "light";
|
|
1279
|
+
heavy: "heavy";
|
|
1280
|
+
}>>;
|
|
1281
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
1282
|
+
compose: "compose";
|
|
1283
|
+
testcontainers: "testcontainers";
|
|
1284
|
+
playwright: "playwright";
|
|
1285
|
+
}>>;
|
|
1286
|
+
hostMb: z.ZodOptional<z.ZodNumber>;
|
|
1287
|
+
vmMb: z.ZodOptional<z.ZodNumber>;
|
|
1288
|
+
proof: z.ZodOptional<z.ZodBoolean>;
|
|
1289
|
+
timeoutMinutes: z.ZodOptional<z.ZodNumber>;
|
|
1290
|
+
secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1291
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
1292
|
+
}, z.core.$strict>;
|
|
1293
|
+
readonly 'job.cancel': z.ZodObject<{
|
|
1294
|
+
runId: z.ZodString;
|
|
1295
|
+
why: z.ZodString;
|
|
1296
|
+
}, z.core.$strict>;
|
|
1297
|
+
readonly 'job.state': z.ZodObject<{
|
|
1298
|
+
runId: z.ZodString;
|
|
1299
|
+
at: z.ZodNumber;
|
|
1300
|
+
started: z.ZodOptional<z.ZodLiteral<true>>;
|
|
1301
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
1302
|
+
running: "running";
|
|
1303
|
+
queued: "queued";
|
|
1304
|
+
}>>;
|
|
1305
|
+
note: z.ZodOptional<z.ZodString>;
|
|
1306
|
+
queue: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1307
|
+
docker: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1308
|
+
edgePort: z.ZodOptional<z.ZodNumber>;
|
|
1309
|
+
}, z.core.$strict>;
|
|
1310
|
+
readonly 'job.stage': z.ZodObject<{
|
|
1311
|
+
runId: z.ZodString;
|
|
1312
|
+
stage: z.ZodString;
|
|
1313
|
+
at: z.ZodNumber;
|
|
1314
|
+
}, z.core.$strict>;
|
|
1315
|
+
readonly 'job.done': z.ZodObject<{
|
|
1316
|
+
runId: z.ZodString;
|
|
1317
|
+
at: z.ZodNumber;
|
|
1318
|
+
state: z.ZodEnum<{
|
|
1319
|
+
errored: "errored";
|
|
1320
|
+
passed: "passed";
|
|
1321
|
+
failed: "failed";
|
|
1322
|
+
cancelled: "cancelled";
|
|
1323
|
+
timeout: "timeout";
|
|
1324
|
+
}>;
|
|
1325
|
+
note: z.ZodOptional<z.ZodString>;
|
|
1326
|
+
step: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1327
|
+
docker: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1328
|
+
givenBack: z.ZodOptional<z.ZodObject<{
|
|
1329
|
+
why: z.ZodString;
|
|
1330
|
+
}, z.core.$strict>>;
|
|
1331
|
+
refused: z.ZodOptional<z.ZodObject<{
|
|
1332
|
+
why: z.ZodString;
|
|
1333
|
+
}, z.core.$strict>>;
|
|
1334
|
+
proof: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1335
|
+
}, z.core.$strict>;
|
|
1336
|
+
readonly 'bundle.ready': z.ZodObject<{
|
|
1337
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
1338
|
+
bundleId: z.ZodString;
|
|
1339
|
+
repository: z.ZodString;
|
|
1340
|
+
heads: z.ZodArray<z.ZodString>;
|
|
1341
|
+
basis: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1342
|
+
size: z.ZodNumber;
|
|
1343
|
+
sha256: z.ZodString;
|
|
1344
|
+
shipment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1345
|
+
blobs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1346
|
+
}, z.core.$strict>;
|
|
1347
|
+
readonly 'tunnel.open': z.ZodObject<{
|
|
1348
|
+
tunnelId: z.ZodString;
|
|
1349
|
+
runId: z.ZodString;
|
|
1350
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
1351
|
+
}, z.core.$strict>;
|
|
1352
|
+
readonly 'tunnel.close': z.ZodObject<{
|
|
1353
|
+
tunnelId: z.ZodString;
|
|
1354
|
+
why: z.ZodOptional<z.ZodString>;
|
|
1355
|
+
}, z.core.$strict>;
|
|
1356
|
+
readonly 'version.install': z.ZodObject<{
|
|
1357
|
+
version: z.ZodString;
|
|
1358
|
+
from: z.ZodEnum<{
|
|
1359
|
+
registry: "registry";
|
|
1360
|
+
organizer: "organizer";
|
|
1361
|
+
}>;
|
|
1362
|
+
tarball: z.ZodOptional<z.ZodObject<{
|
|
1363
|
+
bundleId: z.ZodString;
|
|
1364
|
+
sha256: z.ZodString;
|
|
1365
|
+
size: z.ZodNumber;
|
|
1366
|
+
}, z.core.$strict>>;
|
|
1367
|
+
}, z.core.$strict>;
|
|
1368
|
+
readonly 'version.state': z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1369
|
+
state: z.ZodLiteral<"in-step">;
|
|
1370
|
+
worker: z.ZodObject<{
|
|
1371
|
+
lensmcp: z.ZodString;
|
|
1372
|
+
protocol: z.ZodString;
|
|
1373
|
+
}, z.core.$strict>;
|
|
1374
|
+
organizer: z.ZodObject<{
|
|
1375
|
+
lensmcp: z.ZodString;
|
|
1376
|
+
protocol: z.ZodString;
|
|
1377
|
+
}, z.core.$strict>;
|
|
1378
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1379
|
+
state: z.ZodLiteral<"installing">;
|
|
1380
|
+
worker: z.ZodObject<{
|
|
1381
|
+
lensmcp: z.ZodString;
|
|
1382
|
+
protocol: z.ZodString;
|
|
1383
|
+
}, z.core.$strict>;
|
|
1384
|
+
organizer: z.ZodObject<{
|
|
1385
|
+
lensmcp: z.ZodString;
|
|
1386
|
+
protocol: z.ZodString;
|
|
1387
|
+
}, z.core.$strict>;
|
|
1388
|
+
from: z.ZodEnum<{
|
|
1389
|
+
registry: "registry";
|
|
1390
|
+
organizer: "organizer";
|
|
1391
|
+
}>;
|
|
1392
|
+
since: z.ZodNumber;
|
|
1393
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1394
|
+
state: z.ZodLiteral<"waiting-for-person">;
|
|
1395
|
+
worker: z.ZodObject<{
|
|
1396
|
+
lensmcp: z.ZodString;
|
|
1397
|
+
protocol: z.ZodString;
|
|
1398
|
+
}, z.core.$strict>;
|
|
1399
|
+
organizer: z.ZodObject<{
|
|
1400
|
+
lensmcp: z.ZodString;
|
|
1401
|
+
protocol: z.ZodString;
|
|
1402
|
+
}, z.core.$strict>;
|
|
1403
|
+
stored: z.ZodBoolean;
|
|
1404
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1405
|
+
state: z.ZodLiteral<"out-of-step">;
|
|
1406
|
+
worker: z.ZodObject<{
|
|
1407
|
+
lensmcp: z.ZodString;
|
|
1408
|
+
protocol: z.ZodString;
|
|
1409
|
+
}, z.core.$strict>;
|
|
1410
|
+
organizer: z.ZodObject<{
|
|
1411
|
+
lensmcp: z.ZodString;
|
|
1412
|
+
protocol: z.ZodString;
|
|
1413
|
+
}, z.core.$strict>;
|
|
1414
|
+
why: z.ZodObject<{
|
|
1415
|
+
kind: z.ZodEnum<{
|
|
1416
|
+
restarting: "restarting";
|
|
1417
|
+
protocol: "protocol";
|
|
1418
|
+
version: "version";
|
|
1419
|
+
installed: "installed";
|
|
1420
|
+
"install-failed": "install-failed";
|
|
1421
|
+
"restart-failed": "restart-failed";
|
|
1422
|
+
"no-store": "no-store";
|
|
1423
|
+
}>;
|
|
1424
|
+
}, z.core.$catchall<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
1425
|
+
}, z.core.$strict>], "state">;
|
|
1426
|
+
};
|
|
1427
|
+
/** The work's message types: each has its schema in {@link PEER_WORK_SCHEMAS}. */
|
|
1428
|
+
export type PeerWorkType = keyof typeof PEER_WORK_SCHEMAS;
|
|
1429
|
+
/**
|
|
1430
|
+
* How much one store call carries (D28): its arguments, encoded, and its answer, encoded — both inside one line of the
|
|
1431
|
+
* control stream (512 KiB with its envelope). A call past them is refused before it goes; an answer past them is
|
|
1432
|
+
* refused with the size, and the caller asks for less (a filter, a page).
|
|
1433
|
+
*/
|
|
1434
|
+
export declare const STORE_CALL_LIMITS: {
|
|
1435
|
+
readonly args: 16;
|
|
1436
|
+
readonly argsBytes: number;
|
|
1437
|
+
readonly answerBytes: number;
|
|
1438
|
+
};
|
|
1439
|
+
/** The launch key (§ 13): 256 random bits, base64url — 43 characters. Never logged, listed or answered. */
|
|
1440
|
+
export declare const PEER_LAUNCH_KEY_PATTERN: RegExp;
|
|
1441
|
+
/** A {@link StoreCall}, as the organizer's hub checks it before the executor reads it (the executor checks it again, field by field). */
|
|
1442
|
+
export declare const StoreCallSchema: z.ZodObject<{
|
|
1443
|
+
v: z.ZodLiteral<1>;
|
|
1444
|
+
kind: z.ZodLiteral<"store.call">;
|
|
1445
|
+
id: z.ZodString;
|
|
1446
|
+
method: z.ZodString;
|
|
1447
|
+
args: z.ZodArray<z.ZodUnknown>;
|
|
1448
|
+
launchKey: z.ZodString;
|
|
1449
|
+
observe: z.ZodOptional<z.ZodObject<{
|
|
1450
|
+
intervalMs: z.ZodOptional<z.ZodNumber>;
|
|
1451
|
+
snapshot: z.ZodOptional<z.ZodObject<{
|
|
1452
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
1453
|
+
head: z.ZodNullable<z.ZodString>;
|
|
1454
|
+
files: z.ZodArray<z.ZodObject<{
|
|
1455
|
+
path: z.ZodString;
|
|
1456
|
+
from: z.ZodOptional<z.ZodString>;
|
|
1457
|
+
status: z.ZodString;
|
|
1458
|
+
staged: z.ZodOptional<z.ZodObject<{
|
|
1459
|
+
added: z.ZodNullable<z.ZodNumber>;
|
|
1460
|
+
removed: z.ZodNullable<z.ZodNumber>;
|
|
1461
|
+
}, z.core.$strict>>;
|
|
1462
|
+
unstaged: z.ZodOptional<z.ZodObject<{
|
|
1463
|
+
added: z.ZodNullable<z.ZodNumber>;
|
|
1464
|
+
removed: z.ZodNullable<z.ZodNumber>;
|
|
1465
|
+
}, z.core.$strict>>;
|
|
1466
|
+
}, z.core.$strict>>;
|
|
1467
|
+
truncated: z.ZodBoolean;
|
|
1468
|
+
}, z.core.$strict>>;
|
|
1469
|
+
failed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
1470
|
+
}, z.core.$strict>>;
|
|
1471
|
+
}, z.core.$strict>;
|
|
1472
|
+
/** A {@link StoreReply}, as the worker reads the `ack`'s result. */
|
|
1473
|
+
export declare const StoreReplySchema: z.ZodObject<{
|
|
1474
|
+
v: z.ZodLiteral<1>;
|
|
1475
|
+
kind: z.ZodLiteral<"store.reply">;
|
|
1476
|
+
id: z.ZodString;
|
|
1477
|
+
wrote: z.ZodBoolean;
|
|
1478
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
1479
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
1480
|
+
name: z.ZodEnum<{
|
|
1481
|
+
Error: "Error";
|
|
1482
|
+
CoordinationError: "CoordinationError";
|
|
1483
|
+
CapacityRefusal: "CapacityRefusal";
|
|
1484
|
+
CoordinationBusyError: "CoordinationBusyError";
|
|
1485
|
+
StoreCallRefused: "StoreCallRefused";
|
|
1486
|
+
}>;
|
|
1487
|
+
message: z.ZodString;
|
|
1488
|
+
room: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1489
|
+
step: z.ZodOptional<z.ZodEnum<{
|
|
1490
|
+
open: "open";
|
|
1491
|
+
commit: "commit";
|
|
1492
|
+
write: "write";
|
|
1493
|
+
read: "read";
|
|
1494
|
+
}>>;
|
|
1495
|
+
waitedMs: z.ZodOptional<z.ZodNumber>;
|
|
1496
|
+
tries: z.ZodOptional<z.ZodNumber>;
|
|
1497
|
+
wrote: z.ZodOptional<z.ZodBoolean>;
|
|
1498
|
+
where: z.ZodOptional<z.ZodString>;
|
|
1499
|
+
wal: z.ZodOptional<z.ZodBoolean>;
|
|
1500
|
+
}, z.core.$strict>>;
|
|
1501
|
+
}, z.core.$strict>;
|
|
1502
|
+
/**
|
|
1503
|
+
* The remote instances' messages (slice D35), strict — what the hub's `handle('instance.state', …)` and the worker
|
|
1504
|
+
* daemon's `handle('instance.tunnel.open', …)` are registered with. A tunnel's id follows the hub's rule for the bulk
|
|
1505
|
+
* paths (`POST /peer/v1/tunnel/<tid>`); an apex is a lowercase `.localhost` name, checked again by the organizer's
|
|
1506
|
+
* gateway; a base is one path segment.
|
|
1507
|
+
*/
|
|
1508
|
+
export declare const REMOTE_INSTANCE_BODY_SCHEMAS: {
|
|
1509
|
+
readonly 'instance.tunnel.open': z.ZodObject<{
|
|
1510
|
+
tunnelId: z.ZodString;
|
|
1511
|
+
instanceId: z.ZodString;
|
|
1512
|
+
}, z.core.$strict>;
|
|
1513
|
+
readonly 'instance.state': z.ZodObject<{
|
|
1514
|
+
instanceId: z.ZodString;
|
|
1515
|
+
state: z.ZodEnum<{
|
|
1516
|
+
up: "up";
|
|
1517
|
+
gone: "gone";
|
|
1518
|
+
}>;
|
|
1519
|
+
apex: z.ZodOptional<z.ZodString>;
|
|
1520
|
+
dashboardBase: z.ZodOptional<z.ZodString>;
|
|
1521
|
+
at: z.ZodNumber;
|
|
1522
|
+
why: z.ZodOptional<z.ZodString>;
|
|
1523
|
+
}, z.core.$strict>;
|
|
1524
|
+
};
|
|
1525
|
+
/**
|
|
1526
|
+
* What a launch on a worker carries at most: the prompt and the role text as launches.ts holds them locally
|
|
1527
|
+
* (MAX_PROMPT_CHARS, MAX_ROLE_TEXT_CHARS), the minutes it may run (MAX_LAUNCH_MINUTES), and its tail — a beat's new lines,
|
|
1528
|
+
* each cut as a readable line is (launches.ts TAIL_LINE_CHARS).
|
|
1529
|
+
*/
|
|
1530
|
+
export declare const PEER_LAUNCH_LIMITS: {
|
|
1531
|
+
readonly promptChars: number;
|
|
1532
|
+
readonly roleTextChars: number;
|
|
1533
|
+
readonly maxMinutes: 720;
|
|
1534
|
+
readonly tailLines: 40;
|
|
1535
|
+
readonly tailLineChars: 400;
|
|
1536
|
+
};
|
|
1537
|
+
/** A launch's id (storage launches.ts `LAUNCH_ID`): `ln-<time, base 36>-<6 hex>`. */
|
|
1538
|
+
export declare const PEER_LAUNCH_ID: RegExp;
|
|
1539
|
+
/** The schemas D29's messages are checked by before a handler reads them — strict at the top, as PEER_WORK_SCHEMAS. */
|
|
1540
|
+
export declare const PEER_LAUNCH_SCHEMAS: {
|
|
1541
|
+
readonly 'launch.start': z.ZodObject<{
|
|
1542
|
+
launchId: z.ZodString;
|
|
1543
|
+
repository: z.ZodString;
|
|
1544
|
+
goal: z.ZodString;
|
|
1545
|
+
task: z.ZodOptional<z.ZodString>;
|
|
1546
|
+
role: z.ZodString;
|
|
1547
|
+
by: z.ZodString;
|
|
1548
|
+
client: z.ZodEnum<{
|
|
1549
|
+
claude: "claude";
|
|
1550
|
+
codex: "codex";
|
|
1551
|
+
}>;
|
|
1552
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1553
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
1554
|
+
worktree: z.ZodOptional<z.ZodString>;
|
|
1555
|
+
placedGoal: z.ZodOptional<z.ZodLiteral<true>>;
|
|
1556
|
+
prompt: z.ZodString;
|
|
1557
|
+
roleText: z.ZodOptional<z.ZodString>;
|
|
1558
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1559
|
+
maxMinutes: z.ZodNumber;
|
|
1560
|
+
account: z.ZodOptional<z.ZodString>;
|
|
1561
|
+
launchKey: z.ZodString;
|
|
1562
|
+
lensmcp: z.ZodString;
|
|
1563
|
+
resume: z.ZodOptional<z.ZodObject<{
|
|
1564
|
+
launchId: z.ZodString;
|
|
1565
|
+
threadId: z.ZodString;
|
|
1566
|
+
from: z.ZodOptional<z.ZodString>;
|
|
1567
|
+
}, z.core.$strict>>;
|
|
1568
|
+
capKind: z.ZodOptional<z.ZodEnum<{
|
|
1569
|
+
writers: "writers";
|
|
1570
|
+
checkers: "checkers";
|
|
1571
|
+
}>>;
|
|
1572
|
+
}, z.core.$strict>;
|
|
1573
|
+
readonly 'launch.stop': z.ZodObject<{
|
|
1574
|
+
launchId: z.ZodString;
|
|
1575
|
+
why: z.ZodOptional<z.ZodString>;
|
|
1576
|
+
}, z.core.$strict>;
|
|
1577
|
+
readonly 'launch.state': z.ZodObject<{
|
|
1578
|
+
launchId: z.ZodString;
|
|
1579
|
+
state: z.ZodEnum<{
|
|
1580
|
+
running: "running";
|
|
1581
|
+
failed: "failed";
|
|
1582
|
+
stopped: "stopped";
|
|
1583
|
+
exited: "exited";
|
|
1584
|
+
}>;
|
|
1585
|
+
at: z.ZodNumber;
|
|
1586
|
+
pid: z.ZodOptional<z.ZodNumber>;
|
|
1587
|
+
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
1588
|
+
endedAt: z.ZodOptional<z.ZodNumber>;
|
|
1589
|
+
threadId: z.ZodOptional<z.ZodString>;
|
|
1590
|
+
ended: z.ZodOptional<z.ZodObject<{
|
|
1591
|
+
quota: z.ZodOptional<z.ZodObject<{
|
|
1592
|
+
client: z.ZodEnum<{
|
|
1593
|
+
claude: "claude";
|
|
1594
|
+
codex: "codex";
|
|
1595
|
+
}>;
|
|
1596
|
+
why: z.ZodString;
|
|
1597
|
+
until: z.ZodNumber;
|
|
1598
|
+
firstTurn: z.ZodBoolean;
|
|
1599
|
+
account: z.ZodOptional<z.ZodString>;
|
|
1600
|
+
}, z.core.$strict>>;
|
|
1601
|
+
context: z.ZodOptional<z.ZodString>;
|
|
1602
|
+
}, z.core.$strict>>;
|
|
1603
|
+
}, z.core.$strict>;
|
|
1604
|
+
readonly 'launch.tail': z.ZodObject<{
|
|
1605
|
+
launchId: z.ZodString;
|
|
1606
|
+
lines: z.ZodArray<z.ZodString>;
|
|
1607
|
+
at: z.ZodNumber;
|
|
1608
|
+
}, z.core.$strict>;
|
|
1609
|
+
};
|
|
1610
|
+
/** The worker's answer to `launch.start`, as the organizer reads its `ack`'s result. */
|
|
1611
|
+
export declare const LaunchStartedSchema: z.ZodObject<{
|
|
1612
|
+
started: z.ZodLiteral<true>;
|
|
1613
|
+
pid: z.ZodNumber;
|
|
1614
|
+
worktree: z.ZodString;
|
|
1615
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
1616
|
+
startedAt: z.ZodNumber;
|
|
1617
|
+
deadline: z.ZodNumber;
|
|
1618
|
+
threadId: z.ZodOptional<z.ZodString>;
|
|
1619
|
+
lensmcp: z.ZodString;
|
|
1620
|
+
}, z.core.$strict>;
|
|
1621
|
+
/**
|
|
1622
|
+
* How much one board read carries (D32): reads in one call, their arguments, encoded — and its answer, encoded, at
|
|
1623
|
+
* {@link STORE_CALL_LIMITS}' cap: one line of the control stream. An answer past it is refused with its size.
|
|
1624
|
+
*/
|
|
1625
|
+
export declare const STORE_READ_LIMITS: {
|
|
1626
|
+
readonly calls: 24;
|
|
1627
|
+
readonly argsBytes: number;
|
|
1628
|
+
readonly answerBytes: number;
|
|
1629
|
+
};
|
|
1630
|
+
/** A {@link StoreRead}, as the hub checks it before the read scope's executor reads it (which checks it again, field by field). */
|
|
1631
|
+
export declare const StoreReadSchema: z.ZodObject<{
|
|
1632
|
+
v: z.ZodLiteral<1>;
|
|
1633
|
+
kind: z.ZodLiteral<"store.read">;
|
|
1634
|
+
id: z.ZodString;
|
|
1635
|
+
repoId: z.ZodString;
|
|
1636
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
1637
|
+
method: z.ZodString;
|
|
1638
|
+
args: z.ZodArray<z.ZodUnknown>;
|
|
1639
|
+
}, z.core.$strict>>;
|
|
1640
|
+
}, z.core.$strict>;
|
|
1641
|
+
/**
|
|
1642
|
+
* A GOAL PLACED ON A WORKER (§ 13, slice D30): a goal is placed on one host when it is claimed, and stays there. Placed
|
|
1643
|
+
* on a worker, its worktree is made there, from the worker's checkout of the repository, on the goal's branch
|
|
1644
|
+
* (`goal.place`, organizer → worker, with a bundle of the commit the branch starts at: `GET /peer/v1/bundles/<id>`).
|
|
1645
|
+
* That worker is then the only writer of the goal's branch: it sends the branch as incremental bundles (`PUT
|
|
1646
|
+
* /peer/v1/sent/<id>`, then `goal.sent`) into its own namespace at the organizer, `refs/lensmcp/peers/<its
|
|
1647
|
+
* fingerprint>/heads/<branch>`, and the organizer moves its own `refs/heads/<branch>` from there by a fast-forward only.
|
|
1648
|
+
* Main stays the organizer's. The organizer's Changes page reads the goal's checkout on the worker (`goal.changes`), and
|
|
1649
|
+
* «Update from main» runs there (`goal.update`, with main's bundle). None of these names a folder: a goal, a branch, a
|
|
1650
|
+
* commit, a bundle.
|
|
1651
|
+
*/
|
|
1652
|
+
export declare const GOAL_ON_WORKER: {
|
|
1653
|
+
/** The largest bundle of a goal's branch the organizer takes. */
|
|
1654
|
+
readonly maxSendBytes: number;
|
|
1655
|
+
/** The most one Changes answer from a worker carries: one line of the control stream, with room for its envelope. */
|
|
1656
|
+
readonly maxChangesBytes: number;
|
|
1657
|
+
/** A goal's branch, as a worker sends it: `heads/<branch>` relative to its namespace. Its branch is LensMCP's own, `lensmcp/g-…`. */
|
|
1658
|
+
readonly branchPrefix: "lensmcp/g-";
|
|
1659
|
+
};
|
|
1660
|
+
/** What a placed goal's worktree runs (planning/team/21): on demand (its data, nothing running), a checkout only, or always served. */
|
|
1661
|
+
export type GoalPlaceServices = 'on-demand' | 'none' | 'always';
|
|
1662
|
+
/** `goal.place` (organizer → worker) — slice D30: make the placed goal's worktree, on its branch, from this bundle's commit. */
|
|
1663
|
+
export interface GoalPlace {
|
|
1664
|
+
goal: string;
|
|
1665
|
+
/** Its title: shown, never a name of anything. */
|
|
1666
|
+
title: string;
|
|
1667
|
+
/** The repository, as the organizer's store names it. */
|
|
1668
|
+
repository: string;
|
|
1669
|
+
/** The id the organizer gives the placed worktree (`placedWorktreeId`): its store's identity of it, never one of the organizer's checkouts'. */
|
|
1670
|
+
worktreeId: string;
|
|
1671
|
+
/** The worktree's name, `g-<slug>-<goal6>` (`goalWorktreeName`): its folder's, and its instance's apex label. */
|
|
1672
|
+
name: string;
|
|
1673
|
+
/** The goal's branch: `lensmcp/<name>`. */
|
|
1674
|
+
branch: string;
|
|
1675
|
+
/** The commit the branch starts at when the worker has no branch of that name: the organizer's goal branch, else main. */
|
|
1676
|
+
base: string;
|
|
1677
|
+
/** The bundle that carries `base`, cut against what the organizer knows the worker holds. */
|
|
1678
|
+
bundle: {
|
|
1679
|
+
id: string;
|
|
1680
|
+
size: number;
|
|
1681
|
+
sha256: string;
|
|
1682
|
+
};
|
|
1683
|
+
services?: GoalPlaceServices;
|
|
1684
|
+
at: number;
|
|
1685
|
+
}
|
|
1686
|
+
/** The worker's answer to `goal.place`. */
|
|
1687
|
+
export interface GoalPlaceAnswer {
|
|
1688
|
+
state: 'ready' | 'creating' | 'failed';
|
|
1689
|
+
/** The worktree's HEAD, once it is there. */
|
|
1690
|
+
head?: string;
|
|
1691
|
+
onDemand?: boolean;
|
|
1692
|
+
/** Its checkout lacks a commit the bundle needs: send the whole history. */
|
|
1693
|
+
needWhole?: boolean;
|
|
1694
|
+
why?: string;
|
|
1695
|
+
}
|
|
1696
|
+
/** `goal.sent` (worker → organizer) — slice D30: the goal's branch, put up by `PUT /peer/v1/sent/<id>`. */
|
|
1697
|
+
export interface GoalSent {
|
|
1698
|
+
bundleId: string;
|
|
1699
|
+
repository: string;
|
|
1700
|
+
goal: string;
|
|
1701
|
+
/** Relative to the worker's namespace: `heads/<the goal's branch>`, and nothing else. */
|
|
1702
|
+
ref: string;
|
|
1703
|
+
size: number;
|
|
1704
|
+
sha256: string;
|
|
1705
|
+
}
|
|
1706
|
+
/** What became of the organizer's own `refs/heads/<branch>` after a send. */
|
|
1707
|
+
export type GoalMirror =
|
|
1708
|
+
/** The branch did not exist here: made at the sent commit. */
|
|
1709
|
+
'created' | 'fast-forward'
|
|
1710
|
+
/** It is there already. */
|
|
1711
|
+
| 'current'
|
|
1712
|
+
/** The sent commit does not contain the branch here: refused, and the goal's manager told. */
|
|
1713
|
+
| 'not-ff'
|
|
1714
|
+
/** The branch is checked out in a checkout on this Mac: it is not moved under it. */
|
|
1715
|
+
| 'checked-out';
|
|
1716
|
+
export interface GoalSentAnswer {
|
|
1717
|
+
took: boolean;
|
|
1718
|
+
ref: string;
|
|
1719
|
+
sha?: string;
|
|
1720
|
+
mirror?: GoalMirror;
|
|
1721
|
+
/** Who was told of a refusal (the goal's manager). */
|
|
1722
|
+
told?: string;
|
|
1723
|
+
code?: string;
|
|
1724
|
+
why?: string;
|
|
1725
|
+
}
|
|
1726
|
+
/** `goal.changes` (organizer → worker) — slice D30: the Changes page's read of the placed goal's checkout. */
|
|
1727
|
+
export interface GoalChanges {
|
|
1728
|
+
goal: string;
|
|
1729
|
+
what: 'row' | 'files' | 'diff' | 'commits' | 'commit' | 'against';
|
|
1730
|
+
path?: string;
|
|
1731
|
+
sha?: string;
|
|
1732
|
+
full?: boolean;
|
|
1733
|
+
/** `diff` against main (the Changes page's «against main»). */
|
|
1734
|
+
againstMain?: boolean;
|
|
1735
|
+
}
|
|
1736
|
+
/** The worker's answer: the reader's value, bounded by {@link GOAL_ON_WORKER}`.maxChangesBytes`, or why not. */
|
|
1737
|
+
export interface GoalChangesAnswer {
|
|
1738
|
+
ok: boolean;
|
|
1739
|
+
value?: unknown;
|
|
1740
|
+
/** As the Changes page answers it: 404 no such file, 409 a refusal, … */
|
|
1741
|
+
status?: number;
|
|
1742
|
+
why?: string;
|
|
1743
|
+
/** Past what one answer carries: the list was cut, or the diff left out. */
|
|
1744
|
+
shortened?: boolean;
|
|
1745
|
+
}
|
|
1746
|
+
/** `goal.update` (organizer → worker) — slice D30: «Update from main» on the placed goal's worktree, main as the organizer has it now. */
|
|
1747
|
+
export interface GoalUpdate {
|
|
1748
|
+
goal: string;
|
|
1749
|
+
main: {
|
|
1750
|
+
branch: string;
|
|
1751
|
+
sha: string;
|
|
1752
|
+
bundle: {
|
|
1753
|
+
id: string;
|
|
1754
|
+
size: number;
|
|
1755
|
+
sha256: string;
|
|
1756
|
+
};
|
|
1757
|
+
};
|
|
1758
|
+
at: number;
|
|
1759
|
+
}
|
|
1760
|
+
/** How «Update from main» ended on the worker: the Changes page's own outcomes. */
|
|
1761
|
+
export interface GoalUpdateAnswer {
|
|
1762
|
+
outcome: 'current' | 'merged' | 'asked' | 'conflicts' | 'refused';
|
|
1763
|
+
why: string;
|
|
1764
|
+
sha?: string;
|
|
1765
|
+
/** Main's commits it lacked. */
|
|
1766
|
+
behind?: number;
|
|
1767
|
+
/** Uncommitted files, when it held the merge. */
|
|
1768
|
+
dirty?: number;
|
|
1769
|
+
conflicts?: string[];
|
|
1770
|
+
needWhole?: boolean;
|
|
1771
|
+
}
|
|
1772
|
+
/** The schemas of slice D30's messages, strict: what the hub's and the link's handlers are registered with. */
|
|
1773
|
+
export declare const GOAL_PEER_SCHEMAS: {
|
|
1774
|
+
readonly 'goal.place': z.ZodObject<{
|
|
1775
|
+
goal: z.ZodString;
|
|
1776
|
+
title: z.ZodString;
|
|
1777
|
+
repository: z.ZodString;
|
|
1778
|
+
worktreeId: z.ZodString;
|
|
1779
|
+
name: z.ZodString;
|
|
1780
|
+
branch: z.ZodString;
|
|
1781
|
+
base: z.ZodString;
|
|
1782
|
+
bundle: z.ZodObject<{
|
|
1783
|
+
id: z.ZodString;
|
|
1784
|
+
size: z.ZodNumber;
|
|
1785
|
+
sha256: z.ZodString;
|
|
1786
|
+
}, z.core.$strict>;
|
|
1787
|
+
services: z.ZodOptional<z.ZodEnum<{
|
|
1788
|
+
always: "always";
|
|
1789
|
+
none: "none";
|
|
1790
|
+
"on-demand": "on-demand";
|
|
1791
|
+
}>>;
|
|
1792
|
+
at: z.ZodNumber;
|
|
1793
|
+
}, z.core.$strict>;
|
|
1794
|
+
readonly 'goal.sent': z.ZodObject<{
|
|
1795
|
+
bundleId: z.ZodString;
|
|
1796
|
+
repository: z.ZodString;
|
|
1797
|
+
goal: z.ZodString;
|
|
1798
|
+
ref: z.ZodString;
|
|
1799
|
+
size: z.ZodNumber;
|
|
1800
|
+
sha256: z.ZodString;
|
|
1801
|
+
}, z.core.$strict>;
|
|
1802
|
+
readonly 'goal.changes': z.ZodObject<{
|
|
1803
|
+
goal: z.ZodString;
|
|
1804
|
+
what: z.ZodEnum<{
|
|
1805
|
+
files: "files";
|
|
1806
|
+
commit: "commit";
|
|
1807
|
+
diff: "diff";
|
|
1808
|
+
row: "row";
|
|
1809
|
+
commits: "commits";
|
|
1810
|
+
against: "against";
|
|
1811
|
+
}>;
|
|
1812
|
+
path: z.ZodOptional<z.ZodString>;
|
|
1813
|
+
sha: z.ZodOptional<z.ZodString>;
|
|
1814
|
+
full: z.ZodOptional<z.ZodBoolean>;
|
|
1815
|
+
againstMain: z.ZodOptional<z.ZodBoolean>;
|
|
1816
|
+
}, z.core.$strict>;
|
|
1817
|
+
readonly 'goal.update': z.ZodObject<{
|
|
1818
|
+
goal: z.ZodString;
|
|
1819
|
+
main: z.ZodObject<{
|
|
1820
|
+
branch: z.ZodString;
|
|
1821
|
+
sha: z.ZodString;
|
|
1822
|
+
bundle: z.ZodObject<{
|
|
1823
|
+
id: z.ZodString;
|
|
1824
|
+
size: z.ZodNumber;
|
|
1825
|
+
sha256: z.ZodString;
|
|
1826
|
+
}, z.core.$strict>;
|
|
1827
|
+
}, z.core.$strict>;
|
|
1828
|
+
at: z.ZodNumber;
|
|
1829
|
+
}, z.core.$strict>;
|
|
1830
|
+
};
|
|
1831
|
+
/** The answers to them, as the side that sent each reads its `ack`'s result. */
|
|
1832
|
+
export declare const GOAL_PEER_ANSWER_SCHEMAS: {
|
|
1833
|
+
readonly 'goal.place': z.ZodObject<{
|
|
1834
|
+
state: z.ZodEnum<{
|
|
1835
|
+
failed: "failed";
|
|
1836
|
+
ready: "ready";
|
|
1837
|
+
creating: "creating";
|
|
1838
|
+
}>;
|
|
1839
|
+
head: z.ZodOptional<z.ZodString>;
|
|
1840
|
+
onDemand: z.ZodOptional<z.ZodBoolean>;
|
|
1841
|
+
needWhole: z.ZodOptional<z.ZodBoolean>;
|
|
1842
|
+
why: z.ZodOptional<z.ZodString>;
|
|
1843
|
+
}, z.core.$strict>;
|
|
1844
|
+
readonly 'goal.sent': z.ZodObject<{
|
|
1845
|
+
took: z.ZodBoolean;
|
|
1846
|
+
ref: z.ZodString;
|
|
1847
|
+
sha: z.ZodOptional<z.ZodString>;
|
|
1848
|
+
mirror: z.ZodOptional<z.ZodEnum<{
|
|
1849
|
+
created: "created";
|
|
1850
|
+
current: "current";
|
|
1851
|
+
"not-ff": "not-ff";
|
|
1852
|
+
"fast-forward": "fast-forward";
|
|
1853
|
+
"checked-out": "checked-out";
|
|
1854
|
+
}>>;
|
|
1855
|
+
told: z.ZodOptional<z.ZodString>;
|
|
1856
|
+
code: z.ZodOptional<z.ZodString>;
|
|
1857
|
+
why: z.ZodOptional<z.ZodString>;
|
|
1858
|
+
}, z.core.$strict>;
|
|
1859
|
+
readonly 'goal.changes': z.ZodObject<{
|
|
1860
|
+
ok: z.ZodBoolean;
|
|
1861
|
+
value: z.ZodOptional<z.ZodUnknown>;
|
|
1862
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
1863
|
+
why: z.ZodOptional<z.ZodString>;
|
|
1864
|
+
shortened: z.ZodOptional<z.ZodBoolean>;
|
|
1865
|
+
}, z.core.$strict>;
|
|
1866
|
+
readonly 'goal.update': z.ZodObject<{
|
|
1867
|
+
outcome: z.ZodEnum<{
|
|
1868
|
+
refused: "refused";
|
|
1869
|
+
current: "current";
|
|
1870
|
+
asked: "asked";
|
|
1871
|
+
merged: "merged";
|
|
1872
|
+
conflicts: "conflicts";
|
|
1873
|
+
}>;
|
|
1874
|
+
why: z.ZodString;
|
|
1875
|
+
sha: z.ZodOptional<z.ZodString>;
|
|
1876
|
+
behind: z.ZodOptional<z.ZodNumber>;
|
|
1877
|
+
dirty: z.ZodOptional<z.ZodNumber>;
|
|
1878
|
+
conflicts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1879
|
+
needWhole: z.ZodOptional<z.ZodBoolean>;
|
|
1880
|
+
}, z.core.$strict>;
|
|
1881
|
+
};
|