@fnndsc/menu 0.3.1

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.
@@ -0,0 +1,477 @@
1
+ /**
2
+ * @file The wire-contract message schemas.
3
+ *
4
+ * Two discriminated unions, one per direction, keyed on a `type` tag:
5
+ * {@link clientMessageSchema} (surface → daemon) and
6
+ * {@link serverMessageSchema} (daemon → surface). Every request carries a
7
+ * correlation `id` so its reply and any streamed output can be matched to
8
+ * it, and output events carry the sink channel they belong to. These schemas
9
+ * are the single source of truth for the protocol; the human-readable
10
+ * description in `docs/calypso.adoc` is checked against them.
11
+ *
12
+ * @module
13
+ */
14
+ import { z } from 'zod';
15
+ import { PROC_PROMPT_STATES } from './proc.js';
16
+ import { PROGRESS_KINDS, PROGRESS_OPERATIONS, PROGRESS_PHASES, PROGRESS_STATUSES, PROGRESS_UNITS, } from './progress.js';
17
+ import { commandEnvelopeSchema } from './envelope.js';
18
+ /** The sink channel an output event belongs to. */
19
+ export const channelSchema = z.enum(['data', 'err', 'status']);
20
+ // --- Surface → daemon ------------------------------------------------------
21
+ /**
22
+ * Capabilities an attaching surface can safely execute on its own machine.
23
+ *
24
+ * Optional throughout, and absent means false: a surface built against an older
25
+ * contract simply declares less, and the daemon refuses what it did not claim
26
+ * rather than assuming.
27
+ */
28
+ export const surfaceCapabilitiesMessageSchema = z.object({
29
+ shellCommands: z.boolean(),
30
+ hiddenInput: z.boolean().optional(),
31
+ /** Can put a file where its operator can reach it. */
32
+ fileDelivery: z.boolean().optional(),
33
+ /**
34
+ * Has a filesystem of its own, so it can receive many files as a directory
35
+ * structure. A browser cannot, and needs a directory archived into one file
36
+ * before it can be handed over.
37
+ */
38
+ localFilesystem: z.boolean().optional(),
39
+ });
40
+ /** Attach to a session: declares the contract version, token, and surface capabilities. */
41
+ export const attachMessageSchema = z.object({
42
+ type: z.literal('attach'),
43
+ protocolVersion: z.number().int(),
44
+ token: z.string(),
45
+ session: z.string().optional(),
46
+ capabilities: surfaceCapabilitiesMessageSchema.optional(),
47
+ });
48
+ /**
49
+ * Execute one input line, correlated by `id`.
50
+ *
51
+ * `instrument` marks surface-internal traffic (a panel's silent refresh, an
52
+ * ambient cycler) rather than something the operator said: the daemon runs
53
+ * it normally but keeps it off the session bus and out of scrollback, so
54
+ * sibling surfaces and reattach replays carry only operator activity.
55
+ */
56
+ export const executeMessageSchema = z.object({
57
+ type: z.literal('execute'),
58
+ id: z.string(),
59
+ line: z.string(),
60
+ instrument: z.boolean().optional(),
61
+ });
62
+ /** Requests cancellation of the caller's currently executing command. */
63
+ export const cancelMessageSchema = z.object({
64
+ type: z.literal('cancel'),
65
+ id: z.string(),
66
+ });
67
+ /** Request completion candidates for a partial line, correlated by `id`. */
68
+ export const completeRequestSchema = z.object({
69
+ type: z.literal('complete'),
70
+ id: z.string(),
71
+ prefix: z.string(),
72
+ });
73
+ /** Answers a prompt the daemon requested during a command, correlated by `promptId`. */
74
+ export const promptAnswerMessageSchema = z.object({
75
+ type: z.literal('promptAnswer'),
76
+ promptId: z.string(),
77
+ answer: z.string(),
78
+ });
79
+ /** Reports a prompt failure to the daemon (surface cannot or did not answer), correlated by `promptId`. */
80
+ export const promptErrorMessageSchema = z.object({
81
+ type: z.literal('promptError'),
82
+ promptId: z.string(),
83
+ reason: z.string(),
84
+ });
85
+ /** Returns the output of a pipeline segment the daemon asked the surface to run, correlated by `pipeId`. */
86
+ export const pipeResultMessageSchema = z.object({
87
+ type: z.literal('pipeResult'),
88
+ pipeId: z.string(),
89
+ output: z.string(),
90
+ });
91
+ /** Returns a pipeline-segment failure to the daemon, correlated by `pipeId`. */
92
+ export const pipeErrorMessageSchema = z.object({
93
+ type: z.literal('pipeError'),
94
+ pipeId: z.string(),
95
+ reason: z.string(),
96
+ });
97
+ /** Returns the exit code of a shell command the daemon asked the surface to run. */
98
+ export const shellResultMessageSchema = z.object({
99
+ type: z.literal('shellResult'),
100
+ shellId: z.string(),
101
+ exitCode: z.number().int(),
102
+ });
103
+ /** Returns a surface shell-launch failure to the daemon, correlated by `shellId`. */
104
+ export const shellErrorMessageSchema = z.object({
105
+ type: z.literal('shellError'),
106
+ shellId: z.string(),
107
+ reason: z.string(),
108
+ });
109
+ /** Returns the edited content from a local-edit the daemon requested, correlated by `editId`. */
110
+ export const editResultMessageSchema = z.object({
111
+ type: z.literal('editResult'),
112
+ editId: z.string(),
113
+ content: z.string(),
114
+ changed: z.boolean(),
115
+ });
116
+ /** Reports a local-edit failure to the daemon, correlated by `editId`. */
117
+ export const editErrorMessageSchema = z.object({
118
+ type: z.literal('editError'),
119
+ editId: z.string(),
120
+ reason: z.string(),
121
+ });
122
+ /**
123
+ * Reports a completed file delivery, correlated by `deliverId`.
124
+ *
125
+ * `location` is wherever the surface can honestly say the file went — an
126
+ * absolute path for a filesystem, a bare filename for a browser that handed it
127
+ * to the download manager.
128
+ */
129
+ export const deliverResultMessageSchema = z.object({
130
+ type: z.literal('deliverResult'),
131
+ deliverId: z.string(),
132
+ location: z.string(),
133
+ bytes: z.number().nonnegative(),
134
+ });
135
+ /** Reports a failed file delivery to the daemon, correlated by `deliverId`. */
136
+ export const deliverErrorMessageSchema = z.object({
137
+ type: z.literal('deliverError'),
138
+ deliverId: z.string(),
139
+ reason: z.string(),
140
+ });
141
+ /**
142
+ * The operator's regard: the addressable thing most recently indicated on a
143
+ * surface — a file clicked in a browser, a DAG node selected.
144
+ *
145
+ * The value is an address in the namespace (plus the model kind it was
146
+ * indicated through), never view-space coordinates: what has no address is
147
+ * view state and stays surface-side. `groupId` and `paneId` are provenance —
148
+ * which link group and pane the indication happened in — so session-level
149
+ * consumers know where regard came from without the surface's geometry ever
150
+ * crossing the wire.
151
+ */
152
+ export const regardSchema = z.object({
153
+ address: z.string(),
154
+ modelKind: z.string().optional(),
155
+ groupId: z.string(),
156
+ paneId: z.string(),
157
+ });
158
+ /**
159
+ * A regard write, travelling both directions under one shape: a surface
160
+ * reports an indication to the daemon, and the daemon pushes the retained
161
+ * session regard to every surface (last write wins; a late attacher receives
162
+ * the retained value on attach).
163
+ */
164
+ export const regardMessageSchema = z.object({
165
+ type: z.literal('regard'),
166
+ regard: regardSchema,
167
+ });
168
+ /**
169
+ * A liveness subscription: the surface asks the session to keep one subject
170
+ * fresh while the surface is looking at it. The subject is an address in
171
+ * the namespace (`/proc/jobs/feed_N`), never a view. Regard is what the
172
+ * operator indicates; a watch is what a surface keeps open — a different
173
+ * noun, so it has its own message. Watches are owned per surface and
174
+ * released when the surface detaches.
175
+ */
176
+ export const watchMessageSchema = z.object({
177
+ type: z.literal('watch'),
178
+ subject: z.string(),
179
+ });
180
+ /** Ends a surface's liveness subscription for one subject. */
181
+ export const unwatchMessageSchema = z.object({
182
+ type: z.literal('unwatch'),
183
+ subject: z.string(),
184
+ });
185
+ /** What a watched subject is doing: sampled live, settled for good, or last sample failed. */
186
+ export const WATCH_STATES = ['live', 'settled', 'stale'];
187
+ export const watchStateSchema = z.enum(WATCH_STATES);
188
+ /**
189
+ * The daemon's report on a watched subject's liveness, pushed to every
190
+ * surface whenever it changes (a subject settling is news to all of them).
191
+ */
192
+ export const watchedMessageSchema = z.object({
193
+ type: z.literal('watched'),
194
+ subject: z.string(),
195
+ state: watchStateSchema,
196
+ });
197
+ /** Any message a surface may send to the daemon. */
198
+ export const clientMessageSchema = z.discriminatedUnion('type', [
199
+ attachMessageSchema,
200
+ executeMessageSchema,
201
+ cancelMessageSchema,
202
+ completeRequestSchema,
203
+ promptAnswerMessageSchema,
204
+ promptErrorMessageSchema,
205
+ pipeResultMessageSchema,
206
+ pipeErrorMessageSchema,
207
+ shellResultMessageSchema,
208
+ shellErrorMessageSchema,
209
+ editResultMessageSchema,
210
+ editErrorMessageSchema,
211
+ deliverResultMessageSchema,
212
+ deliverErrorMessageSchema,
213
+ regardMessageSchema,
214
+ watchMessageSchema,
215
+ unwatchMessageSchema,
216
+ ]);
217
+ // --- Daemon → surface ------------------------------------------------------
218
+ /**
219
+ * Acknowledges a successful attach. The optional `stack` block reports the
220
+ * daemon's own installed versions and build hash, so a remote surface can
221
+ * greet with the truth of the process it attached to rather than whatever is
222
+ * installed client-side; older daemons simply omit it.
223
+ */
224
+ export const attachedMessageSchema = z.object({
225
+ type: z.literal('attached'),
226
+ session: z.string(),
227
+ protocolVersion: z.number().int(),
228
+ stack: z
229
+ .object({
230
+ chell: z.string(),
231
+ calypso: z.string(),
232
+ build: z.string(),
233
+ brasa: z.string().optional(),
234
+ chili: z.string().optional(),
235
+ salsa: z.string().optional(),
236
+ cumin: z.string().optional(),
237
+ })
238
+ .optional(),
239
+ /** The host-control tiers the daemon declared (`shell`, `files`, `pipes`); empty or absent when off. */
240
+ hostControl: z.array(z.string()).optional(),
241
+ });
242
+ /** The final result of one executed line: one envelope per command. */
243
+ export const resultMessageSchema = z.object({
244
+ type: z.literal('result'),
245
+ id: z.string(),
246
+ envelopes: z.array(commandEnvelopeSchema),
247
+ });
248
+ /** The reply to a completion request. */
249
+ export const completeReplySchema = z.object({
250
+ type: z.literal('complete'),
251
+ id: z.string(),
252
+ prefix: z.string(),
253
+ candidates: z.array(z.string()),
254
+ });
255
+ /** A streamed output event on one channel, correlated to its command. */
256
+ export const outputMessageSchema = z.object({
257
+ type: z.literal('output'),
258
+ id: z.string(),
259
+ channel: channelSchema,
260
+ chunk: z.string(),
261
+ });
262
+ /**
263
+ * The operation producing structured progress.
264
+ *
265
+ * Within a major, the contract promises additive change only, which is a
266
+ * promise a bare enum cannot keep: an unknown value fails the whole message,
267
+ * and a failed parse drops it. An operation a peer names but this build does
268
+ * not know is therefore read as `task` — none of the above — so the work still
269
+ * shows, generically, instead of vanishing.
270
+ */
271
+ export const progressOperationSchema = z.enum(PROGRESS_OPERATIONS).catch('task');
272
+ /**
273
+ * Broad class of progress producer.
274
+ *
275
+ * Optional, so an unknown class degrades to absent: the event still renders
276
+ * from its operation and phase, one axis poorer.
277
+ */
278
+ export const progressKindSchema = z.enum(PROGRESS_KINDS).catch(undefined);
279
+ /**
280
+ * Lifecycle phase of a progress operation.
281
+ *
282
+ * An unknown phase degrades to `working` for the reason given on
283
+ * {@link progressOperationSchema}: an unrecognised phase still means work is
284
+ * under way, and that much is worth showing. `complete` and `failed` are
285
+ * terminal and will not be inferred, so a surface that cannot read a newer
286
+ * peer's terminal phase leaves the announcement open rather than closing it
287
+ * wrongly.
288
+ */
289
+ export const progressPhaseSchema = z.enum(PROGRESS_PHASES).catch('working');
290
+ /**
291
+ * Unit used by the primary progress counter.
292
+ *
293
+ * Optional, so an unknown unit degrades to absent and the counter renders
294
+ * unqualified — 3/10 rather than nothing at all.
295
+ */
296
+ export const progressUnitSchema = z.enum(PROGRESS_UNITS).catch(undefined);
297
+ /**
298
+ * State of the operation or item being reported.
299
+ *
300
+ * An unknown state degrades to `unknown`, which the vocabulary already carries
301
+ * for precisely this: a state that cannot be named is still a state.
302
+ */
303
+ export const progressStatusSchema = z.enum(PROGRESS_STATUSES).catch('unknown');
304
+ /** A structured progress event correlated to a command. */
305
+ export const progressMessageSchema = z.object({
306
+ type: z.literal('progress'),
307
+ id: z.string(),
308
+ operation: progressOperationSchema,
309
+ kind: progressKindSchema.optional(),
310
+ phase: progressPhaseSchema,
311
+ label: z.string().optional(),
312
+ itemId: z.string().optional(),
313
+ current: z.number().nonnegative().optional(),
314
+ total: z.number().nonnegative().optional(),
315
+ percent: z.number().min(0).max(100).optional(),
316
+ unit: progressUnitSchema.optional(),
317
+ status: progressStatusSchema.optional(),
318
+ });
319
+ /** A session-bus broadcast: an envelope tagged with its originating surface. */
320
+ export const sessionMessageSchema = z.object({
321
+ type: z.literal('session'),
322
+ surface: z.string(),
323
+ envelope: commandEnvelopeSchema,
324
+ });
325
+ /** A boundary error: a refused attach, a malformed message, correlated when possible. */
326
+ export const errorMessageSchema = z.object({
327
+ type: z.literal('error'),
328
+ id: z.string().optional(),
329
+ reason: z.string(),
330
+ });
331
+ /**
332
+ * A prompt request the daemon raises during a command: the surface that
333
+ * submitted the command must answer it (with `promptAnswer`) before the
334
+ * command can proceed. `hidden` requests no-echo entry (password).
335
+ */
336
+ export const promptMessageSchema = z.object({
337
+ type: z.literal('prompt'),
338
+ promptId: z.string(),
339
+ message: z.string(),
340
+ hidden: z.boolean(),
341
+ });
342
+ /**
343
+ * The engine-known facts a prompt reflects, independent of any theme.
344
+ *
345
+ * The daemon knows the session context but not how a given surface renders it,
346
+ * so it ships these facts and each surface themes them with its own settings.
347
+ * Rendering inputs a surface owns (theme, segments, terminal width) are not
348
+ * carried here.
349
+ */
350
+ export const promptContextSchema = z.object({
351
+ user: z.string(),
352
+ uri: z.string(),
353
+ cwd: z.string(),
354
+ pacsserver: z.string().nullable(),
355
+ physicalMode: z.boolean(),
356
+ lastExitCode: z.number(),
357
+ lastCommandDurationMs: z.number(),
358
+ procWarmup: z.object({
359
+ loaded: z.number(),
360
+ total: z.number().optional(),
361
+ restored: z.boolean().optional(),
362
+ state: z.enum(PROC_PROMPT_STATES).optional(),
363
+ sweeping: z.boolean().optional(),
364
+ feed: z.object({
365
+ id: z.number(),
366
+ loaded: z.number(),
367
+ total: z.number(),
368
+ }).optional(),
369
+ arrived: z.array(z.number()).optional(),
370
+ }).optional(),
371
+ procIndex: z.object({
372
+ jobs: z.number(),
373
+ feeds: z.number(),
374
+ }).optional(),
375
+ /**
376
+ * Warm-up steps that failed behind the prompt and have not since
377
+ * succeeded. Optional, so an older daemon still parses here.
378
+ */
379
+ warmupFailures: z.array(z.object({
380
+ label: z.string(),
381
+ message: z.string(),
382
+ })).optional(),
383
+ });
384
+ /**
385
+ * The prompt context, pushed by the daemon with each result and on any context
386
+ * change. The daemon knows the session context; each surface renders it with
387
+ * its own theme, so prompt themes are a per-surface choice rather than the
388
+ * daemon's.
389
+ */
390
+ export const promptLineMessageSchema = z.object({
391
+ type: z.literal('promptline'),
392
+ context: promptContextSchema,
393
+ });
394
+ /**
395
+ * Asks the surface to run a pipeline segment on its own machine (never on the
396
+ * daemon host) and return the output. `input` and the reply's `output` are
397
+ * base64, since segment data is arbitrary bytes.
398
+ */
399
+ export const pipeMessageSchema = z.object({
400
+ type: z.literal('pipe'),
401
+ pipeId: z.string(),
402
+ command: z.string(),
403
+ input: z.string(),
404
+ });
405
+ /** Asks the surface to run a shell command on its own machine, never on the daemon host. */
406
+ export const shellMessageSchema = z.object({
407
+ type: z.literal('shell'),
408
+ shellId: z.string(),
409
+ command: z.string(),
410
+ });
411
+ /**
412
+ * Asks the surface to open content in its local editor (never on the daemon
413
+ * host) and return the edited result.
414
+ */
415
+ export const editMessageSchema = z.object({
416
+ type: z.literal('edit'),
417
+ editId: z.string(),
418
+ content: z.string(),
419
+ extension: z.string().optional(),
420
+ });
421
+ /**
422
+ * Asks the surface running the current command to place a file where its
423
+ * operator can reach it.
424
+ *
425
+ * The message names what to deliver, never the bytes. A surface fetches those
426
+ * itself from the daemon's token-gated byte route, so a large file does not
427
+ * cross the session bus base64-encoded — the intent travels through the
428
+ * vocabulary and the bytes travel through the byte route.
429
+ */
430
+ export const deliverMessageSchema = z.object({
431
+ type: z.literal('deliver'),
432
+ deliverId: z.string(),
433
+ path: z.string(),
434
+ filename: z.string(),
435
+ destination: z.string().optional(),
436
+ size: z.number().nonnegative().optional(),
437
+ contentType: z.string().optional(),
438
+ });
439
+ /**
440
+ * The daemon's heartbeat, pushed roughly once a second while any surface is
441
+ * attached: the live process-index counts. Event-driven facts (progress,
442
+ * command latency) travel on their own messages; this carries only what
443
+ * changes without a command.
444
+ */
445
+ export const telemetryMessageSchema = z.object({
446
+ type: z.literal('telemetry'),
447
+ index: z.object({
448
+ jobs: z.number(),
449
+ feeds: z.number(),
450
+ }),
451
+ });
452
+ /** Any message the daemon may send to a surface. */
453
+ export const serverMessageSchema = z.discriminatedUnion('type', [
454
+ attachedMessageSchema,
455
+ resultMessageSchema,
456
+ completeReplySchema,
457
+ outputMessageSchema,
458
+ progressMessageSchema,
459
+ sessionMessageSchema,
460
+ errorMessageSchema,
461
+ promptMessageSchema,
462
+ promptLineMessageSchema,
463
+ telemetryMessageSchema,
464
+ pipeMessageSchema,
465
+ shellMessageSchema,
466
+ editMessageSchema,
467
+ deliverMessageSchema,
468
+ regardMessageSchema,
469
+ watchedMessageSchema,
470
+ ]);
471
+ /**
472
+ * The message types this contract build knows. A surface receiving a typed
473
+ * message outside this set is talking to a newer daemon: the open-world rule
474
+ * is to skip it quietly, not to warn on every arrival.
475
+ */
476
+ export const SERVER_MESSAGE_TYPES = new Set(serverMessageSchema.options.map((option) => option.shape.type.value));
477
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,mDAAmD;AACnD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE/D,8EAA8E;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE;IAC1B,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACnC,sDAAsD;IACtD,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC;;;;OAIG;IACH,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAEH,2FAA2F;AAC3F,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,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