Open History to see the last commit
1import { KeybindingCommand, KeybindingRule, KeybindingsConfig } from "@t3tools/contracts";
2import * as NodeServices from "@effect/platform-node/NodeServices";
3import { assert, it } from "@effect/vitest";
4import { assertFailure } from "@effect/vitest/utils";
5import * as Cause from "effect/Cause";
6import * as Effect from "effect/Effect";
7import * as FileSystem from "effect/FileSystem";
8import * as Layer from "effect/Layer";
9import * as Logger from "effect/Logger";
10import * as Path from "effect/Path";
11import * as Schema from "effect/Schema";
12import * as ServerConfig from "./config.ts";
13import * as Keybindings from "./keybindings.ts";
14import { KeybindingsConfigError } from "@t3tools/contracts";
15
16const KeybindingsConfigJson = Schema.fromJsonString(KeybindingsConfig);
17const encodeKeybindingsConfigJson = Schema.encodeEffect(KeybindingsConfigJson);
18const decodeKeybindingsConfigJson = Schema.decodeUnknownEffect(KeybindingsConfigJson);
19const encodeResolvedKeybindingFromConfig = Schema.encodeEffect(
20 Keybindings.ResolvedKeybindingFromConfig,
21);
22const decodeResolvedKeybindingFromConfigExit = Schema.decodeUnknownExit(
23 Keybindings.ResolvedKeybindingFromConfig,
24);
25const makeKeybindingsLayer = () => {
26 return Keybindings.layer.pipe(
27 Layer.provideMerge(
28 Layer.fresh(
29 ServerConfig.layerTest(process.cwd(), {
30 prefix: "t3code-keybindings-test-",
31 }),
32 ),
33 ),
34 );
35};
36
37const toDetailResult = <A, R>(effect: Effect.Effect<A, KeybindingsConfigError, R>) =>
38 effect.pipe(
39 Effect.mapError((error) => error.detail),
40 Effect.result,
41 );
42
43const writeKeybindingsConfig = (configPath: string, rules: readonly KeybindingRule[]) =>
44 Effect.gen(function* () {
45 const fileSystem = yield* FileSystem.FileSystem;
46 const path = yield* Path.Path;
47 const encoded = yield* encodeKeybindingsConfigJson(rules);
48 yield* fileSystem.makeDirectory(path.dirname(configPath), { recursive: true });
49 yield* fileSystem.writeFileString(configPath, encoded);
50 });
51
52const readKeybindingsConfig = (configPath: string) =>
53 Effect.gen(function* () {
54 const fileSystem = yield* FileSystem.FileSystem;
55 const rawConfig = yield* fileSystem.readFileString(configPath);
56 return yield* decodeKeybindingsConfigJson(rawConfig);
57 });
58
59it.layer(NodeServices.layer)("keybindings", (it) => {
60 it.effect("parses shortcuts including plus key", () =>
61 Effect.sync(() => {
62 assert.deepEqual(Keybindings.parseKeybindingShortcut("mod+j"), {
63 key: "j",
64 metaKey: false,
65 ctrlKey: false,
66 shiftKey: false,
67 altKey: false,
68 modKey: true,
69 });
70 assert.deepEqual(Keybindings.parseKeybindingShortcut("mod++"), {
71 key: "+",
72 metaKey: false,
73 ctrlKey: false,
74 shiftKey: false,
75 altKey: false,
76 modKey: true,
77 });
78 }),
79 );
80
81 it.effect("compiles valid rule with parsed when AST", () =>
82 Effect.sync(() => {
83 const compiled = Keybindings.compileResolvedKeybindingRule({
84 key: "mod+d",
85 command: "terminal.split",
86 when: "terminalOpen && !terminalFocus",
87 });
88
89 assert.deepEqual(compiled, {
90 command: "terminal.split",
91 shortcut: {
92 key: "d",
93 metaKey: false,
94 ctrlKey: false,
95 shiftKey: false,
96 altKey: false,
97 modKey: true,
98 },
99 whenAst: {
100 type: "and",
101 left: { type: "identifier", name: "terminalOpen" },
102 right: {
103 type: "not",
104 node: { type: "identifier", name: "terminalFocus" },
105 },
106 },
107 });
108 }),
109 );
110
111 it.effect("encodes resolved plus-key shortcuts", () =>
112 Effect.gen(function* () {
113 const encoded = yield* encodeResolvedKeybindingFromConfig({
114 command: "terminal.toggle",
115 shortcut: {
116 key: "+",
117 metaKey: false,
118 ctrlKey: false,
119 shiftKey: false,
120 altKey: false,
121 modKey: true,
122 },
123 });
124
125 assert.equal(encoded.key, "mod++");
126 assert.equal(encoded.command, "terminal.toggle");
127 }),
128 );
129
130 it.effect("rejects invalid rules", () =>
131 Effect.sync(() => {
132 assert.isNull(
133 Keybindings.compileResolvedKeybindingRule({
134 key: "mod+shift+d+o",
135 command: "terminal.new",
136 }),
137 );
138
139 assert.isNull(
140 Keybindings.compileResolvedKeybindingRule({
141 key: "mod+d",
142 command: "terminal.split",
143 when: "terminalFocus && (",
144 }),
145 );
146
147 assert.isNull(
148 Keybindings.compileResolvedKeybindingRule({
149 key: "mod+d",
150 command: "terminal.split",
151 when: `${"!".repeat(300)}terminalFocus`,
152 }),
153 );
154 }),
155 );
156
157 it.effect("formats invalid resolved keybinding rules with the custom message", () =>
158 Effect.sync(() => {
159 const result = decodeResolvedKeybindingFromConfigExit({
160 key: "mod+shift+d+o",
161 command: "terminal.new",
162 });
163
164 if (result._tag !== "Failure") {
165 assert.fail("Expected invalid keybinding decode to fail");
166 }
167
168 const detail = Cause.pretty(result.cause);
169 assert.isTrue(detail.includes("Invalid keybinding rule"));
170 assert.isFalse(detail.includes("Invalid data"));
171 }),
172 );
173
174 it.effect("bootstraps default keybindings when config file is missing", () =>
175 Effect.gen(function* () {
176 const fs = yield* FileSystem.FileSystem;
177 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
178 assert.isFalse(yield* fs.exists(keybindingsConfigPath));
179
180 yield* Effect.gen(function* () {
181 const keybindings = yield* Keybindings.Keybindings;
182 yield* keybindings.syncDefaultKeybindingsOnStartup;
183 });
184
185 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
186 assert.deepEqual(persisted, Keybindings.DEFAULT_KEYBINDINGS);
187 }).pipe(Effect.provide(makeKeybindingsLayer())),
188 );
189
190 it.effect("ships configurable thread navigation defaults", () =>
191 Effect.sync(() => {
192 const defaultsByCommand = new Map(
193 Keybindings.DEFAULT_KEYBINDINGS.map((binding) => [binding.command, binding.key] as const),
194 );
195
196 assert.equal(defaultsByCommand.get("thread.previous"), "mod+shift+[");
197 assert.equal(defaultsByCommand.get("thread.next"), "mod+shift+]");
198 assert.equal(defaultsByCommand.get("thread.jump.1"), "mod+1");
199 assert.equal(defaultsByCommand.get("thread.jump.9"), "mod+9");
200 assert.equal(defaultsByCommand.get("modelPicker.toggle"), "mod+shift+m");
201 assert.equal(defaultsByCommand.get("themeEditor.toggle"), "mod+alt+shift+t");
202 assert.equal(defaultsByCommand.get("filePicker.toggle"), "mod+p");
203 assert.equal(defaultsByCommand.get("projectSearch.toggle"), "mod+shift+f");
204 assert.equal(defaultsByCommand.get("sidebar.toggle"), "mod+b");
205 assert.equal(defaultsByCommand.get("rightPanel.toggle"), "mod+alt+b");
206 assert.equal(defaultsByCommand.get("terminal.splitVertical"), "mod+shift+d");
207 assert.equal(defaultsByCommand.get("modelPicker.jump.1"), "mod+1");
208 assert.equal(defaultsByCommand.get("modelPicker.jump.9"), "mod+9");
209 }),
210 );
211
212 it.effect("uses defaults in runtime when config is malformed without overriding file", () =>
213 Effect.gen(function* () {
214 const fs = yield* FileSystem.FileSystem;
215 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
216 yield* fs.writeFileString(keybindingsConfigPath, "{ not-json");
217
218 const configState = yield* Effect.gen(function* () {
219 const keybindings = yield* Keybindings.Keybindings;
220 return yield* keybindings.loadConfigState;
221 });
222
223 assert.deepEqual(
224 configState.keybindings,
225 Keybindings.compileResolvedKeybindingsConfig(Keybindings.DEFAULT_KEYBINDINGS),
226 );
227 assert.deepEqual(configState.issues, [
228 {
229 kind: "keybindings.malformed-config",
230 message: configState.issues[0]?.message ?? "",
231 },
232 ]);
233 assert.equal(yield* fs.readFileString(keybindingsConfigPath), "{ not-json");
234 }).pipe(Effect.provide(makeKeybindingsLayer())),
235 );
236
237 it.effect("ignores invalid entries in runtime and reports them as issues", () =>
238 Effect.gen(function* () {
239 const fs = yield* FileSystem.FileSystem;
240 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
241 yield* fs.writeFileString(
242 keybindingsConfigPath,
243 // @effect-diagnostics-next-line preferSchemaOverJson:off
244 JSON.stringify([
245 { key: "mod+j", command: "terminal.toggle" },
246 { key: "mod+shift+d+o", command: "terminal.new" },
247 { key: "mod+x", command: "invalid.command" },
248 ]),
249 );
250
251 const configState = yield* Effect.gen(function* () {
252 const keybindings = yield* Keybindings.Keybindings;
253 return yield* keybindings.loadConfigState;
254 });
255
256 assert.isTrue(configState.keybindings.some((entry) => entry.command === "terminal.toggle"));
257 assert.isFalse(
258 configState.keybindings.some((entry) => String(entry.command) === "invalid.command"),
259 );
260 assert.deepEqual(configState.issues, [
261 {
262 kind: "keybindings.invalid-entry",
263 index: 1,
264 message: configState.issues[0]?.message ?? "",
265 },
266 {
267 kind: "keybindings.invalid-entry",
268 index: 2,
269 message: configState.issues[1]?.message ?? "",
270 },
271 ]);
272 }).pipe(Effect.provide(makeKeybindingsLayer())),
273 );
274
275 it.effect(
276 "upserts missing default keybindings on startup without overriding existing command rules",
277 () =>
278 Effect.gen(function* () {
279 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
280 yield* writeKeybindingsConfig(keybindingsConfigPath, [
281 { key: "mod+shift+t", command: "terminal.toggle" },
282 { key: "mod+shift+r", command: "script.run-tests.run" },
283 ]);
284
285 yield* Effect.gen(function* () {
286 const keybindings = yield* Keybindings.Keybindings;
287 yield* keybindings.syncDefaultKeybindingsOnStartup;
288 });
289
290 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
291 const byCommand = new Map(persisted.map((entry) => [entry.command, entry]));
292
293 const persistedToggle = byCommand.get("terminal.toggle");
294 assert.isNotNull(persistedToggle);
295 assert.equal(persistedToggle?.key, "mod+shift+t");
296 assert.isFalse(
297 persisted.some((entry) => entry.command === "terminal.toggle" && entry.key === "mod+j"),
298 );
299
300 for (const defaultRule of Keybindings.DEFAULT_KEYBINDINGS) {
301 assert.isTrue(byCommand.has(defaultRule.command), `expected ${defaultRule.command}`);
302 }
303 assert.isTrue(byCommand.has("script.run-tests.run"));
304 }).pipe(Effect.provide(makeKeybindingsLayer())),
305 );
306
307 it.effect("skips conflicting default keybindings on startup and logs a detailed warning", () => {
308 const messages: string[] = [];
309 const logger = Logger.make(({ message }) => {
310 messages.push(String(message));
311 });
312
313 return Effect.gen(function* () {
314 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
315 yield* writeKeybindingsConfig(keybindingsConfigPath, [
316 { key: "mod+j", command: "script.custom-action.run" },
317 ]);
318
319 yield* Effect.gen(function* () {
320 const keybindings = yield* Keybindings.Keybindings;
321 yield* keybindings.syncDefaultKeybindingsOnStartup;
322 });
323
324 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
325 assert.isFalse(persisted.some((entry) => entry.command === "terminal.toggle"));
326 assert.isTrue(persisted.some((entry) => entry.command === "script.custom-action.run"));
327
328 assert.isTrue(
329 messages.some((message) =>
330 message.includes("skipping default keybinding due to shortcut conflict"),
331 ),
332 );
333 }).pipe(
334 Effect.provide(
335 Layer.mergeAll(
336 makeKeybindingsLayer(),
337 Logger.layer([logger], { mergeWithExisting: false }),
338 ),
339 ),
340 );
341 });
342
343 it.effect("upserts custom keybindings to configured path", () =>
344 Effect.gen(function* () {
345 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
346 yield* writeKeybindingsConfig(keybindingsConfigPath, [
347 { key: "mod+j", command: "terminal.toggle" },
348 ]);
349
350 const resolved = yield* Effect.gen(function* () {
351 const keybindings = yield* Keybindings.Keybindings;
352 return yield* keybindings.upsertKeybindingRule({
353 key: "mod+shift+r",
354 command: "script.run-tests.run",
355 });
356 });
357
358 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
359 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
360
361 assert.deepEqual(persistedView, [
362 { key: "mod+j", command: "terminal.toggle" },
363 { key: "mod+shift+r", command: "script.run-tests.run" },
364 ]);
365 assert.isTrue(resolved.some((entry) => entry.command === "script.run-tests.run"));
366 }).pipe(Effect.provide(makeKeybindingsLayer())),
367 );
368
369 it.effect("appends additional custom keybindings for the same command", () =>
370 Effect.gen(function* () {
371 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
372 yield* writeKeybindingsConfig(keybindingsConfigPath, [
373 { key: "mod+r", command: "script.run-tests.run" },
374 ]);
375 yield* Effect.gen(function* () {
376 const keybindings = yield* Keybindings.Keybindings;
377 return yield* keybindings.upsertKeybindingRule({
378 key: "mod+shift+r",
379 command: "script.run-tests.run",
380 });
381 });
382
383 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
384 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
385 assert.deepEqual(persistedView, [
386 { key: "mod+r", command: "script.run-tests.run" },
387 { key: "mod+shift+r", command: "script.run-tests.run" },
388 ]);
389 }).pipe(Effect.provide(makeKeybindingsLayer())),
390 );
391
392 it.effect("replaces only the targeted custom keybinding", () =>
393 Effect.gen(function* () {
394 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
395 yield* writeKeybindingsConfig(keybindingsConfigPath, [
396 { key: "mod+r", command: "script.run-tests.run" },
397 { key: "mod+shift+r", command: "script.run-tests.run" },
398 ]);
399 yield* Effect.gen(function* () {
400 const keybindings = yield* Keybindings.Keybindings;
401 return yield* keybindings.upsertKeybindingRule({
402 key: "mod+alt+r",
403 command: "script.run-tests.run",
404 replace: { key: "mod+r", command: "script.run-tests.run" },
405 });
406 });
407
408 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
409 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
410 assert.deepEqual(persistedView, [
411 { key: "mod+shift+r", command: "script.run-tests.run" },
412 { key: "mod+alt+r", command: "script.run-tests.run" },
413 ]);
414 }).pipe(Effect.provide(makeKeybindingsLayer())),
415 );
416
417 it.effect("replacing with a rule that already exists elsewhere does not duplicate it", () =>
418 Effect.gen(function* () {
419 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
420 yield* writeKeybindingsConfig(keybindingsConfigPath, [
421 { key: "mod+r", command: "script.run-tests.run" },
422 { key: "mod+alt+r", command: "script.run-tests.run" },
423 ]);
424 yield* Effect.gen(function* () {
425 const keybindings = yield* Keybindings.Keybindings;
426 return yield* keybindings.upsertKeybindingRule({
427 key: "mod+alt+r",
428 command: "script.run-tests.run",
429 replace: { key: "mod+r", command: "script.run-tests.run" },
430 });
431 });
432
433 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
434 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
435 assert.deepEqual(persistedView, [{ key: "mod+alt+r", command: "script.run-tests.run" }]);
436 }).pipe(Effect.provide(makeKeybindingsLayer())),
437 );
438
439 it.effect("removes only the targeted custom keybinding", () =>
440 Effect.gen(function* () {
441 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
442 yield* writeKeybindingsConfig(keybindingsConfigPath, [
443 { key: "mod+r", command: "script.run-tests.run" },
444 { key: "mod+shift+r", command: "script.run-tests.run" },
445 ]);
446 yield* Effect.gen(function* () {
447 const keybindings = yield* Keybindings.Keybindings;
448 return yield* keybindings.removeKeybindingRule({
449 key: "mod+r",
450 command: "script.run-tests.run",
451 });
452 });
453
454 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
455 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
456 assert.deepEqual(persistedView, [{ key: "mod+shift+r", command: "script.run-tests.run" }]);
457 }).pipe(Effect.provide(makeKeybindingsLayer())),
458 );
459
460 it.effect("refuses to overwrite malformed keybindings config", () =>
461 Effect.gen(function* () {
462 const fs = yield* FileSystem.FileSystem;
463 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
464 yield* fs.writeFileString(keybindingsConfigPath, "{ not-json");
465
466 const result = yield* Effect.gen(function* () {
467 const keybindings = yield* Keybindings.Keybindings;
468 return yield* keybindings.upsertKeybindingRule({
469 key: "mod+shift+r",
470 command: "script.run-tests.run",
471 });
472 }).pipe(toDetailResult);
473 assertFailure(result, "expected JSON array");
474
475 const persistedRaw = yield* fs.readFileString(keybindingsConfigPath);
476 assert.equal(persistedRaw, "{ not-json");
477 }).pipe(Effect.provide(makeKeybindingsLayer())),
478 );
479
480 it.effect("reports non-array config parse errors without duplicate prefix", () =>
481 Effect.gen(function* () {
482 const fs = yield* FileSystem.FileSystem;
483 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
484 yield* fs.writeFileString(
485 keybindingsConfigPath,
486 '{"key":"mod+j","command":"terminal.toggle"}',
487 );
488
489 const firstResult = yield* Effect.gen(function* () {
490 const keybindings = yield* Keybindings.Keybindings;
491 return yield* keybindings.upsertKeybindingRule({
492 key: "mod+shift+r",
493 command: "script.run-tests.run",
494 });
495 }).pipe(toDetailResult);
496 assertFailure(firstResult, "expected JSON array");
497
498 const secondResult = yield* Effect.gen(function* () {
499 const keybindings = yield* Keybindings.Keybindings;
500 return yield* keybindings.upsertKeybindingRule({
501 key: "mod+shift+r",
502 command: "script.run-tests.run",
503 });
504 }).pipe(toDetailResult);
505 assertFailure(secondResult, "expected JSON array");
506 }).pipe(Effect.provide(makeKeybindingsLayer())),
507 );
508
509 it.effect("fails when config directory is not writable", () =>
510 Effect.gen(function* () {
511 const fs = yield* FileSystem.FileSystem;
512 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
513 const { dirname } = yield* Path.Path;
514 yield* writeKeybindingsConfig(keybindingsConfigPath, [
515 { key: "mod+j", command: "terminal.toggle" },
516 ]);
517 yield* fs.chmod(dirname(keybindingsConfigPath), 0o500);
518
519 const result = yield* Effect.gen(function* () {
520 const keybindings = yield* Keybindings.Keybindings;
521 return yield* keybindings.upsertKeybindingRule({
522 key: "mod+shift+r",
523 command: "script.run-tests.run",
524 });
525 }).pipe(toDetailResult);
526 assertFailure(result, "failed to write keybindings config");
527
528 yield* fs.chmod(dirname(keybindingsConfigPath), 0o700);
529
530 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
531 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
532 assert.deepEqual(persistedView, [{ key: "mod+j", command: "terminal.toggle" }]);
533 }).pipe(Effect.provide(makeKeybindingsLayer())),
534 );
535
536 it.effect("caches loaded resolved config across repeated reads", () =>
537 Effect.gen(function* () {
538 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
539 yield* writeKeybindingsConfig(keybindingsConfigPath, [
540 { key: "mod+j", command: "terminal.toggle" },
541 ]);
542
543 const [first, second] = yield* Effect.gen(function* () {
544 const keybindings = yield* Keybindings.Keybindings;
545 const firstLoad = (yield* keybindings.loadConfigState).keybindings;
546 const secondLoad = (yield* keybindings.loadConfigState).keybindings;
547 return [firstLoad, secondLoad] as const;
548 });
549
550 assert.deepEqual(first, second);
551 assert.isTrue(second.some((entry) => entry.command === "terminal.toggle"));
552 }).pipe(Effect.provide(makeKeybindingsLayer())),
553 );
554
555 it.effect("updates cached resolved config after upsert", () =>
556 Effect.gen(function* () {
557 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
558 yield* writeKeybindingsConfig(keybindingsConfigPath, [
559 { key: "mod+j", command: "terminal.toggle" },
560 ]);
561
562 const loadedAfterUpsert = yield* Effect.gen(function* () {
563 const keybindings = yield* Keybindings.Keybindings;
564 yield* keybindings.loadConfigState;
565 yield* keybindings.upsertKeybindingRule({
566 key: "mod+shift+r",
567 command: "script.run-tests.run",
568 });
569 return (yield* keybindings.loadConfigState).keybindings;
570 });
571
572 assert.isTrue(loadedAfterUpsert.some((entry) => entry.command === "script.run-tests.run"));
573 assert.isTrue(loadedAfterUpsert.some((entry) => entry.command === "terminal.toggle"));
574 }).pipe(Effect.provide(makeKeybindingsLayer())),
575 );
576
577 it.effect("serializes concurrent upserts to avoid lost updates", () =>
578 Effect.gen(function* () {
579 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
580 yield* writeKeybindingsConfig(keybindingsConfigPath, []);
581
582 const commands = Array.from(
583 { length: 20 },
584 (_, index): KeybindingCommand => `script.concurrent-${index}.run`,
585 );
586 yield* Effect.gen(function* () {
587 const keybindings = yield* Keybindings.Keybindings;
588 yield* Effect.all(
589 commands.map((command, index) =>
590 keybindings.upsertKeybindingRule({
591 key: `mod+${String.fromCharCode(97 + index)}`,
592 command,
593 }),
594 ),
595 { concurrency: "unbounded", discard: true },
596 );
597 });
598
599 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
600 const persistedCommands = new Set(persisted.map((entry) => entry.command));
601 for (const command of commands) {
602 assert.isTrue(persistedCommands.has(command), `expected persisted command ${command}`);
603 }
604 }).pipe(Effect.provide(makeKeybindingsLayer())),
605 );
606});