@inflatable-cookie/longhorn 0.1.0

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.
Files changed (178) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +38 -0
  3. package/package.json +205 -0
  4. package/src/agent-control/index.ts +20 -0
  5. package/src/agent-control/inject.ts +4 -0
  6. package/src/agent-control/shim.ts +722 -0
  7. package/src/bridge/direct.ts +22 -0
  8. package/src/bridge/generated/fields.ts +32 -0
  9. package/src/bridge/generated/protocol.ts +218 -0
  10. package/src/bridge/generated/variant-fields.ts +10 -0
  11. package/src/bridge/index.ts +15 -0
  12. package/src/bridge/job.ts +51 -0
  13. package/src/bridge/loopback.ts +84 -0
  14. package/src/bridge/operation.ts +166 -0
  15. package/src/bridge/router.ts +71 -0
  16. package/src/bridge/runtime/connection.ts +318 -0
  17. package/src/bridge/runtime/policy.ts +89 -0
  18. package/src/bridge/runtime/retry.ts +60 -0
  19. package/src/bridge/runtime.ts +3 -0
  20. package/src/bridge/session.ts +67 -0
  21. package/src/bridge/stream/connection.ts +146 -0
  22. package/src/bridge/stream/source.ts +61 -0
  23. package/src/bridge/stream/tracker.ts +109 -0
  24. package/src/bridge/stream.ts +6 -0
  25. package/src/bridge/supervision.ts +204 -0
  26. package/src/bridge/validation/base.ts +164 -0
  27. package/src/bridge/validation/jobs.ts +105 -0
  28. package/src/bridge/validation/negotiation.ts +242 -0
  29. package/src/bridge/validation/operations.ts +213 -0
  30. package/src/bridge/validation/streams.ts +47 -0
  31. package/src/bridge/validation.ts +5 -0
  32. package/src/commands/client.ts +124 -0
  33. package/src/commands/controller.ts +411 -0
  34. package/src/commands/generated/fields.ts +43 -0
  35. package/src/commands/generated/protocol.ts +876 -0
  36. package/src/commands/generated/variant-fields.ts +88 -0
  37. package/src/commands/index.ts +13 -0
  38. package/src/commands/keyboard.ts +361 -0
  39. package/src/commands/ports.ts +82 -0
  40. package/src/commands/projectors.ts +306 -0
  41. package/src/commands/validation.ts +444 -0
  42. package/src/config/client.ts +215 -0
  43. package/src/config/generated/base.ts +714 -0
  44. package/src/config/generated/fields.ts +54 -0
  45. package/src/config/generated/label-template.ts +14 -0
  46. package/src/config/generated/labels.ts +30 -0
  47. package/src/config/generated/protocol.ts +3 -0
  48. package/src/config/generated/restore.ts +658 -0
  49. package/src/config/generated/variant-fields.ts +129 -0
  50. package/src/config/index.ts +12 -0
  51. package/src/config/names.ts +19 -0
  52. package/src/config/validation/commands.ts +155 -0
  53. package/src/config/validation/outcomes.ts +243 -0
  54. package/src/config/validation/primitives.ts +174 -0
  55. package/src/config/validation/projection.ts +351 -0
  56. package/src/config/validation.ts +7 -0
  57. package/src/core/connection.ts +252 -0
  58. package/src/core/index.ts +2 -0
  59. package/src/core/transport.ts +24 -0
  60. package/src/history/client.ts +65 -0
  61. package/src/history/controller.ts +385 -0
  62. package/src/history/direct.ts +21 -0
  63. package/src/history/generated/fields.ts +18 -0
  64. package/src/history/generated/protocol.ts +389 -0
  65. package/src/history/generated/variant-fields.ts +27 -0
  66. package/src/history/index.ts +13 -0
  67. package/src/history/ports.ts +31 -0
  68. package/src/history/serialized.ts +38 -0
  69. package/src/history/validation.ts +334 -0
  70. package/src/history-tree/client.ts +16 -0
  71. package/src/history-tree/controller.ts +199 -0
  72. package/src/history-tree/direct.ts +3 -0
  73. package/src/history-tree/generated/fields.ts +26 -0
  74. package/src/history-tree/generated/protocol.ts +711 -0
  75. package/src/history-tree/generated/variant-fields.ts +39 -0
  76. package/src/history-tree/index.ts +13 -0
  77. package/src/history-tree/ports.ts +43 -0
  78. package/src/history-tree/serialized.ts +15 -0
  79. package/src/history-tree/validation.ts +269 -0
  80. package/src/layout/generated/protocol.ts +289 -0
  81. package/src/layout/index.ts +4 -0
  82. package/src/layout/ratio.ts +22 -0
  83. package/src/layout/validation.ts +110 -0
  84. package/src/layout/visibility.ts +30 -0
  85. package/src/licence/client.ts +32 -0
  86. package/src/licence/controller.ts +301 -0
  87. package/src/licence/direct.ts +3 -0
  88. package/src/licence/generated/fields.ts +17 -0
  89. package/src/licence/generated/key-conformance.json +42 -0
  90. package/src/licence/generated/protocol.ts +249 -0
  91. package/src/licence/generated/variant-fields.ts +34 -0
  92. package/src/licence/index.ts +14 -0
  93. package/src/licence/key.ts +125 -0
  94. package/src/licence/ports.ts +39 -0
  95. package/src/licence/serialized.ts +13 -0
  96. package/src/licence/validation.ts +226 -0
  97. package/src/native-content/client.ts +474 -0
  98. package/src/native-content/direct.ts +16 -0
  99. package/src/native-content/generated/fields.ts +32 -0
  100. package/src/native-content/generated/protocol.ts +498 -0
  101. package/src/native-content/generated/variant-fields.ts +77 -0
  102. package/src/native-content/index.ts +12 -0
  103. package/src/native-content/ports.ts +46 -0
  104. package/src/native-content/serialized.ts +50 -0
  105. package/src/native-content/validation/base.ts +194 -0
  106. package/src/native-content/validation/messages.ts +192 -0
  107. package/src/native-content/validation/state.ts +404 -0
  108. package/src/native-content/validation.ts +7 -0
  109. package/src/notifications/client.ts +106 -0
  110. package/src/notifications/controller.ts +240 -0
  111. package/src/notifications/direct.ts +12 -0
  112. package/src/notifications/generated/fields.ts +19 -0
  113. package/src/notifications/generated/labels.ts +20 -0
  114. package/src/notifications/generated/protocol.ts +522 -0
  115. package/src/notifications/generated/variant-fields.ts +37 -0
  116. package/src/notifications/index.ts +16 -0
  117. package/src/notifications/ports.ts +22 -0
  118. package/src/notifications/serialized.ts +27 -0
  119. package/src/notifications/toast.ts +41 -0
  120. package/src/notifications/tone.ts +27 -0
  121. package/src/notifications/validation.ts +246 -0
  122. package/src/operation/bridge.ts +168 -0
  123. package/src/operation/client.ts +167 -0
  124. package/src/operation/controller.ts +321 -0
  125. package/src/operation/direct.ts +15 -0
  126. package/src/operation/generated/fields.ts +20 -0
  127. package/src/operation/generated/labels.ts +15 -0
  128. package/src/operation/generated/protocol.ts +762 -0
  129. package/src/operation/generated/variant-fields.ts +60 -0
  130. package/src/operation/index.ts +14 -0
  131. package/src/operation/ports.ts +29 -0
  132. package/src/operation/serialized.ts +39 -0
  133. package/src/operation/validation.ts +479 -0
  134. package/src/settings/client.ts +142 -0
  135. package/src/settings/connection.ts +246 -0
  136. package/src/settings/generated/fields.ts +34 -0
  137. package/src/settings/generated/protocol.ts +668 -0
  138. package/src/settings/generated/variant-fields.ts +26 -0
  139. package/src/settings/index.ts +12 -0
  140. package/src/settings/names.ts +8 -0
  141. package/src/settings/registry.ts +141 -0
  142. package/src/settings/validation/authority.ts +66 -0
  143. package/src/settings/validation/command.ts +165 -0
  144. package/src/settings/validation/error.ts +33 -0
  145. package/src/settings/validation/primitives.ts +203 -0
  146. package/src/settings/validation/projection.ts +50 -0
  147. package/src/settings/validation/registry.ts +170 -0
  148. package/src/settings/validation.ts +4 -0
  149. package/src/surface-transfer/client.ts +54 -0
  150. package/src/surface-transfer/generated/fields.ts +12 -0
  151. package/src/surface-transfer/generated/protocol.ts +61 -0
  152. package/src/surface-transfer/generated/variant-fields.ts +30 -0
  153. package/src/surface-transfer/index.ts +9 -0
  154. package/src/surface-transfer/validation.ts +209 -0
  155. package/src/surfaces/client.ts +140 -0
  156. package/src/surfaces/generated/fields.ts +19 -0
  157. package/src/surfaces/generated/protocol.ts +217 -0
  158. package/src/surfaces/generated/variant-fields.ts +42 -0
  159. package/src/surfaces/index.ts +9 -0
  160. package/src/surfaces/validation.ts +199 -0
  161. package/src/transfer/client.ts +133 -0
  162. package/src/transfer/connection.ts +87 -0
  163. package/src/transfer/generated/fields.ts +23 -0
  164. package/src/transfer/generated/protocol.ts +171 -0
  165. package/src/transfer/generated/variant-fields.ts +45 -0
  166. package/src/transfer/index.ts +11 -0
  167. package/src/transfer/payload.ts +71 -0
  168. package/src/transfer/validation.ts +282 -0
  169. package/src/update/client.ts +29 -0
  170. package/src/update/controller.ts +255 -0
  171. package/src/update/direct.ts +3 -0
  172. package/src/update/generated/fields.ts +14 -0
  173. package/src/update/generated/protocol.ts +238 -0
  174. package/src/update/generated/variant-fields.ts +44 -0
  175. package/src/update/index.ts +14 -0
  176. package/src/update/ports.ts +36 -0
  177. package/src/update/serialized.ts +12 -0
  178. package/src/update/validation.ts +191 -0
@@ -0,0 +1,411 @@
1
+ import { CommandClient } from "./client.ts";
2
+ import type {
3
+ CommandArguments,
4
+ CommandInvocation,
5
+ CommandKeymapMutationResult,
6
+ CommandKeymapPatch,
7
+ CommandKeymapSnapshot,
8
+ CommandPlatform,
9
+ CommandSearchHit,
10
+ } from "./generated/protocol.ts";
11
+ import type {
12
+ CommandDispatch,
13
+ CommandExecutionOutcome,
14
+ CommandExecutionSource,
15
+ CommandPorts,
16
+ CommandUnlisten,
17
+ } from "./ports.ts";
18
+ import {
19
+ joinCommandState,
20
+ projectCommandSurfaces,
21
+ searchCommands,
22
+ type CommandJoinedState,
23
+ type CommandSurfaceProjection,
24
+ } from "./projectors.ts";
25
+
26
+ export type CommandControllerStatus =
27
+ | { readonly kind: "idle" }
28
+ | { readonly kind: "loading" }
29
+ | { readonly kind: "ready" }
30
+ | {
31
+ readonly kind: "recovery";
32
+ readonly recovery: {
33
+ readonly code: string;
34
+ readonly detail: string;
35
+ readonly sourcePreserved: boolean;
36
+ };
37
+ }
38
+ | { readonly kind: "unavailable"; readonly detail: string }
39
+ | { readonly kind: "failed"; readonly error: unknown };
40
+
41
+ export type CommandMutationStatus =
42
+ | { readonly kind: "idle" }
43
+ | { readonly kind: "dirty" }
44
+ | { readonly kind: "previewing" }
45
+ | { readonly kind: "committing" }
46
+ | { readonly kind: "saved" }
47
+ | { readonly kind: "conflict"; readonly detail: string }
48
+ | { readonly kind: "failed"; readonly error: unknown };
49
+
50
+ export interface CommandControllerOptions {
51
+ readonly ports: CommandPorts;
52
+ readonly platform: CommandPlatform;
53
+ readonly search?: (
54
+ records: CommandJoinedState["catalogue"]["commands"],
55
+ query: string,
56
+ ) => Promise<readonly CommandSearchHit[]>;
57
+ }
58
+
59
+ export class CommandController {
60
+ readonly #client: CommandClient;
61
+ readonly #platform: CommandPlatform;
62
+ readonly #search;
63
+ readonly #observers = new Set<() => void>();
64
+ #status: CommandControllerStatus = { kind: "idle" };
65
+ #mutation: CommandMutationStatus = { kind: "idle" };
66
+ #model: CommandJoinedState | undefined;
67
+ #projection: CommandSurfaceProjection | undefined;
68
+ #searchHits: readonly CommandSearchHit[] = [];
69
+ #query = "";
70
+ #draft: CommandKeymapPatch | undefined;
71
+ #unlisten: CommandUnlisten[] = [];
72
+ #lifecycleRevision = 0;
73
+ #loadRevision = 0;
74
+ #searchRevision = 0;
75
+ #started = false;
76
+
77
+ constructor(options: CommandControllerOptions) {
78
+ this.#client = new CommandClient(options.ports);
79
+ this.#platform = options.platform;
80
+ this.#search =
81
+ options.search ??
82
+ (async (records, query) => searchCommands(records, query));
83
+ }
84
+
85
+ get status(): CommandControllerStatus {
86
+ return this.#status;
87
+ }
88
+
89
+ get mutation(): CommandMutationStatus {
90
+ return this.#mutation;
91
+ }
92
+
93
+ get model(): CommandJoinedState | undefined {
94
+ return this.#model;
95
+ }
96
+
97
+ get projection(): CommandSurfaceProjection | undefined {
98
+ return this.#projection;
99
+ }
100
+
101
+ get query(): string {
102
+ return this.#query;
103
+ }
104
+
105
+ get searchHits(): readonly CommandSearchHit[] {
106
+ return this.#searchHits;
107
+ }
108
+
109
+ get draft(): CommandKeymapPatch | undefined {
110
+ return this.#draft;
111
+ }
112
+
113
+ get dirty(): boolean {
114
+ return this.#draft !== undefined;
115
+ }
116
+
117
+ observe(observer: () => void): () => void {
118
+ this.#observers.add(observer);
119
+ return () => this.#observers.delete(observer);
120
+ }
121
+
122
+ async start(): Promise<void> {
123
+ if (this.#started) return;
124
+ this.#started = true;
125
+ const lifecycleRevision = ++this.#lifecycleRevision;
126
+ this.#setStatus({ kind: "loading" });
127
+ try {
128
+ const unlisten = await this.#client.listen(() => {
129
+ void this.refresh();
130
+ });
131
+ if (
132
+ !this.#started ||
133
+ lifecycleRevision !== this.#lifecycleRevision
134
+ ) {
135
+ await disposeAll(unlisten);
136
+ return;
137
+ }
138
+ this.#unlisten.push(...unlisten);
139
+ await this.refresh();
140
+ } catch (error) {
141
+ if (
142
+ this.#started &&
143
+ lifecycleRevision === this.#lifecycleRevision
144
+ ) {
145
+ this.#setStatus({ kind: "failed", error });
146
+ }
147
+ }
148
+ }
149
+
150
+ async stop(): Promise<void> {
151
+ this.#started = false;
152
+ this.#lifecycleRevision += 1;
153
+ this.#loadRevision += 1;
154
+ this.#searchRevision += 1;
155
+ const unlisten = this.#unlisten.splice(0);
156
+ await disposeAll(unlisten);
157
+ this.#model = undefined;
158
+ this.#projection = undefined;
159
+ this.#searchHits = [];
160
+ this.#query = "";
161
+ this.#draft = undefined;
162
+ this.#mutation = { kind: "idle" };
163
+ this.#setStatus({ kind: "idle" });
164
+ }
165
+
166
+ async refresh(): Promise<void> {
167
+ const revision = ++this.#loadRevision;
168
+ try {
169
+ const loaded = await this.#client.load();
170
+ if (!this.#started || revision !== this.#loadRevision) return;
171
+ if (loaded.keymap.status === "recovery") {
172
+ this.#model = undefined;
173
+ this.#projection = undefined;
174
+ this.#setStatus({
175
+ kind: "recovery",
176
+ recovery: loaded.keymap.recovery,
177
+ });
178
+ return;
179
+ }
180
+ if (loaded.keymap.status === "unavailable") {
181
+ this.#model = undefined;
182
+ this.#projection = undefined;
183
+ this.#setStatus({
184
+ kind: "unavailable",
185
+ detail: loaded.keymap.detail,
186
+ });
187
+ return;
188
+ }
189
+ this.#install(
190
+ joinCommandState(
191
+ loaded.catalogue,
192
+ loaded.keymap.snapshot,
193
+ loaded.availability,
194
+ ),
195
+ );
196
+ this.#setStatus({ kind: "ready" });
197
+ await this.search(this.#query);
198
+ } catch (error) {
199
+ if (this.#started && revision === this.#loadRevision) {
200
+ this.#setStatus({ kind: "failed", error });
201
+ }
202
+ }
203
+ }
204
+
205
+ async search(query: string): Promise<readonly CommandSearchHit[]> {
206
+ this.#query = query;
207
+ const model = this.#model;
208
+ const revision = ++this.#searchRevision;
209
+ if (model === undefined) {
210
+ this.#searchHits = [];
211
+ this.#notify();
212
+ return [];
213
+ }
214
+ const hits = await this.#search(model.catalogue.commands, query);
215
+ if (revision !== this.#searchRevision || model !== this.#model) {
216
+ return hits;
217
+ }
218
+ const visible = new Set(this.#projection?.palette.map(({ id }) => id));
219
+ this.#searchHits = hits.filter(({ record }) => visible.has(record.id));
220
+ this.#notify();
221
+ return this.#searchHits;
222
+ }
223
+
224
+ async dispatch(dispatch: CommandDispatch): Promise<CommandExecutionOutcome> {
225
+ return this.dispatchInvocation(
226
+ {
227
+ commandId: dispatch.commandId,
228
+ arguments: dispatch.arguments ?? {},
229
+ },
230
+ dispatch.source,
231
+ );
232
+ }
233
+
234
+ async dispatchInvocation(
235
+ invocation: CommandInvocation,
236
+ source: CommandExecutionSource,
237
+ ): Promise<CommandExecutionOutcome> {
238
+ const model = this.#requiredModel();
239
+ return this.#client.execute({
240
+ requestId: this.#client.nextRequestId(),
241
+ registryGeneration: model.catalogue.registryGeneration,
242
+ observedContextRevision: model.availability.contextRevision,
243
+ invocation,
244
+ source,
245
+ });
246
+ }
247
+
248
+ stageKeymapPatch(patch: CommandKeymapPatch): void {
249
+ this.#draft = patch;
250
+ this.#mutation = { kind: "dirty" };
251
+ this.#notify();
252
+ }
253
+
254
+ cancelKeymapDraft(): void {
255
+ this.#draft = undefined;
256
+ this.#mutation = { kind: "idle" };
257
+ this.#notify();
258
+ }
259
+
260
+ async applyKeymapDraft(): Promise<boolean> {
261
+ const model = this.#requiredModel();
262
+ const patch = this.#draft;
263
+ if (patch === undefined) return true;
264
+ const base = model.keymap;
265
+ const operationRevision = ++this.#loadRevision;
266
+ this.#mutation = { kind: "previewing" };
267
+ this.#notify();
268
+ try {
269
+ const preview = await this.#client.preview({
270
+ registryGeneration: model.catalogue.registryGeneration,
271
+ keymapRevision: base.state.revision,
272
+ activePresetId: base.state.activePresetId,
273
+ activePresetVersion: base.activePresetVersion,
274
+ patch,
275
+ });
276
+ if (operationRevision !== this.#loadRevision || patch !== this.#draft) {
277
+ return false;
278
+ }
279
+ if (preview.status !== "accepted") {
280
+ this.#applyMutationSnapshot(preview.snapshot);
281
+ this.#mutation = {
282
+ kind: "conflict",
283
+ detail:
284
+ preview.status === "rejected"
285
+ ? preview.rejection.detail
286
+ : "Keybindings changed elsewhere",
287
+ };
288
+ this.#notify();
289
+ return false;
290
+ }
291
+ this.#mutation = { kind: "committing" };
292
+ this.#notify();
293
+ const result = await this.#client.commit({
294
+ requestId: this.#client.nextRequestId(),
295
+ evidence: preview.evidence,
296
+ patch,
297
+ });
298
+ if (operationRevision !== this.#loadRevision || patch !== this.#draft) {
299
+ return false;
300
+ }
301
+ return this.#finishMutation(result);
302
+ } catch (error) {
303
+ if (operationRevision === this.#loadRevision) {
304
+ this.#mutation = { kind: "failed", error };
305
+ this.#notify();
306
+ }
307
+ return false;
308
+ }
309
+ }
310
+
311
+ async resetKeymap(): Promise<boolean> {
312
+ const model = this.#requiredModel();
313
+ const base = model.keymap;
314
+ const operationRevision = ++this.#loadRevision;
315
+ this.#mutation = { kind: "committing" };
316
+ this.#notify();
317
+ try {
318
+ const result = await this.#client.reset({
319
+ requestId: this.#client.nextRequestId(),
320
+ registryGeneration: model.catalogue.registryGeneration,
321
+ keymapRevision: base.state.revision,
322
+ activePresetId: base.state.activePresetId,
323
+ activePresetVersion: base.activePresetVersion,
324
+ });
325
+ if (operationRevision !== this.#loadRevision) return false;
326
+ return this.#finishMutation(result);
327
+ } catch (error) {
328
+ if (operationRevision === this.#loadRevision) {
329
+ this.#mutation = { kind: "failed", error };
330
+ this.#notify();
331
+ }
332
+ return false;
333
+ }
334
+ }
335
+
336
+ #finishMutation(result: CommandKeymapMutationResult): boolean {
337
+ this.#applyMutationSnapshot(result.snapshot);
338
+ if (result.status === "applied") {
339
+ this.#draft = undefined;
340
+ this.#mutation = { kind: "saved" };
341
+ this.#notify();
342
+ return true;
343
+ }
344
+ this.#mutation = {
345
+ kind: "conflict",
346
+ detail:
347
+ result.status === "rejected"
348
+ ? result.rejection.detail
349
+ : "Keybindings changed elsewhere",
350
+ };
351
+ this.#notify();
352
+ return false;
353
+ }
354
+
355
+ #applyMutationSnapshot(snapshot: CommandKeymapSnapshot): void {
356
+ const model = this.#requiredModel();
357
+ if (snapshot.registryGeneration !== model.catalogue.registryGeneration) {
358
+ void this.refresh();
359
+ return;
360
+ }
361
+ this.#install(
362
+ joinCommandState(model.catalogue, snapshot, model.availability),
363
+ );
364
+ }
365
+
366
+ #install(model: CommandJoinedState): void {
367
+ const current = this.#model;
368
+ if (
369
+ current !== undefined &&
370
+ (model.catalogue.registryGeneration <
371
+ current.catalogue.registryGeneration ||
372
+ (model.catalogue.registryGeneration ===
373
+ current.catalogue.registryGeneration &&
374
+ (model.keymap.state.revision < current.keymap.state.revision ||
375
+ model.availability.contextRevision <
376
+ current.availability.contextRevision)))
377
+ ) {
378
+ return;
379
+ }
380
+ this.#model = model;
381
+ this.#projection = projectCommandSurfaces(model, this.#platform);
382
+ this.#notify();
383
+ }
384
+
385
+ #requiredModel(): CommandJoinedState {
386
+ if (this.#model === undefined) {
387
+ throw new CommandControllerUnavailableError();
388
+ }
389
+ return this.#model;
390
+ }
391
+
392
+ #setStatus(status: CommandControllerStatus): void {
393
+ this.#status = status;
394
+ this.#notify();
395
+ }
396
+
397
+ #notify(): void {
398
+ for (const observer of this.#observers) observer();
399
+ }
400
+ }
401
+
402
+ export class CommandControllerUnavailableError extends Error {
403
+ constructor() {
404
+ super("command controller has no joined authoritative state");
405
+ this.name = "CommandControllerUnavailableError";
406
+ }
407
+ }
408
+
409
+ async function disposeAll(unlisten: readonly CommandUnlisten[]): Promise<void> {
410
+ await Promise.allSettled(unlisten.map((dispose) => dispose()));
411
+ }
@@ -0,0 +1,43 @@
1
+ // @generated by `effigy generate:commands`; do not edit.
2
+ // Allowed field names per protocol type, from the Rust structs.
3
+ // A `record()` given one of these rejects unknown and missing keys —
4
+ // contract 010's Boundary Validation Target.
5
+
6
+ export const COMMANDS_FIELDS: Record<string, readonly string[]> = {
7
+ "CommandArgumentField": ["id", "required", "default", "kind"],
8
+ "CommandVisibility": ["hidden", "palette", "menu", "shortcut", "settings", "help"],
9
+ "CommandDiscoveryRecord": ["id", "label", "description", "categoryPath", "keywords", "icon", "visibility", "textInputPolicy", "arguments"],
10
+ "CommandAvailabilityReason": ["code", "detail"],
11
+ "CommandAvailability": ["state", "reason"],
12
+ "CommandAvailabilityRecord": ["commandId", "availability"],
13
+ "CommandAvailabilitySnapshot": ["registryGeneration", "contextRevision", "records"],
14
+ "CommandSearchHit": ["record", "score"],
15
+ "CommandModifiers": ["control", "alt", "shift", "meta"],
16
+ "CommandTriggerModifiers": ["primary", "control", "alt", "shift", "meta"],
17
+ "CommandKeyTrigger": ["code", "modifiers"],
18
+ "CommandKeyChord": ["code", "modifiers"],
19
+ "CommandKeyboardInput": ["chord", "repeat", "composing", "editableText"],
20
+ "CommandBindingDefinition": ["id", "platform", "trigger", "contextId", "commandId", "arguments"],
21
+ "CommandBindingReplacement": ["platform", "trigger", "contextId", "commandId", "arguments"],
22
+ "CommandInvocation": ["commandId", "arguments"],
23
+ "CommandEffectiveBinding": ["id", "source", "platform", "trigger", "contextId", "invocation"],
24
+ "CommandShortcutRecord": ["bindingId", "source", "contextId", "chord", "label"],
25
+ "CommandBindingCandidate": ["bindingId", "source", "matchedContextId", "specificity", "invocation", "disposition"],
26
+ "CommandBindingWinner": ["bindingId", "matchedContextId", "invocation"],
27
+ "CommandKeymapConflict": ["platform", "chord", "contextId", "bindingIds", "invocations"],
28
+ "CommandKeymapPresetRecord": ["id", "version"],
29
+ "CommandCatalogueSnapshot": ["protocolVersion", "registryGeneration", "registryDigest", "commands", "presets"],
30
+ "CommandCatalogueChangedEvent": ["protocolVersion", "registryGeneration"],
31
+ "CommandKeymapState": ["revision", "activePresetId", "overrides"],
32
+ "CommandKeymapPatch": ["activePresetId", "clearOverrides", "removeBindingIds", "upsertOverrides"],
33
+ "CommandKeymapCommitEvidence": ["registryGeneration", "keymapRevision", "activePresetId", "activePresetVersion", "patchDigest"],
34
+ "CommandKeymapPreview": ["registryGeneration", "keymapRevision", "activePresetId", "activePresetVersion", "patch"],
35
+ "CommandKeymapCommit": ["requestId", "evidence", "patch"],
36
+ "CommandKeymapReset": ["requestId", "registryGeneration", "keymapRevision", "activePresetId", "activePresetVersion"],
37
+ "CommandKeymapDiagnostic": ["code", "detail"],
38
+ "CommandKeymapSnapshot": ["protocolVersion", "registryGeneration", "registryDigest", "state", "activePresetVersion", "bindings", "conflicts", "origin", "diagnostics"],
39
+ "CommandKeymapChangedEvent": ["protocolVersion", "registryGeneration", "keymapRevision"],
40
+ "CommandKeymapRejection": ["code", "detail"],
41
+ "CommandKeymapRecovery": ["code", "detail", "sourcePreserved"],
42
+ "CommandKeymapMutationReceipt": ["requestId", "previousRevision", "committedRevision", "outcome", "durability", "patchDigest"],
43
+ };