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.isFalse(defaultsByCommand.has("rightPanel.toggleMaximized"));
207 assert.equal(defaultsByCommand.get("terminal.splitVertical"), "mod+shift+d");
208 assert.equal(defaultsByCommand.get("modelPicker.jump.1"), "mod+1");
209 assert.equal(defaultsByCommand.get("modelPicker.jump.9"), "mod+9");
210 }),
211 );
212
213 it.effect("uses defaults in runtime when config is malformed without overriding file", () =>
214 Effect.gen(function* () {
215 const fs = yield* FileSystem.FileSystem;
216 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
217 yield* fs.writeFileString(keybindingsConfigPath, "{ not-json");
218
219 const configState = yield* Effect.gen(function* () {
220 const keybindings = yield* Keybindings.Keybindings;
221 return yield* keybindings.loadConfigState;
222 });
223
224 assert.deepEqual(
225 configState.keybindings,
226 Keybindings.compileResolvedKeybindingsConfig(Keybindings.DEFAULT_KEYBINDINGS),
227 );
228 assert.deepEqual(configState.issues, [
229 {
230 kind: "keybindings.malformed-config",
231 message: configState.issues[0]?.message ?? "",
232 },
233 ]);
234 assert.equal(yield* fs.readFileString(keybindingsConfigPath), "{ not-json");
235 }).pipe(Effect.provide(makeKeybindingsLayer())),
236 );
237
238 it.effect("ignores invalid entries in runtime and reports them as issues", () =>
239 Effect.gen(function* () {
240 const fs = yield* FileSystem.FileSystem;
241 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
242 yield* fs.writeFileString(
243 keybindingsConfigPath,
244 // @effect-diagnostics-next-line preferSchemaOverJson:off
245 JSON.stringify([
246 { key: "mod+j", command: "terminal.toggle" },
247 { key: "mod+shift+d+o", command: "terminal.new" },
248 { key: "mod+x", command: "invalid.command" },
249 ]),
250 );
251
252 const configState = yield* Effect.gen(function* () {
253 const keybindings = yield* Keybindings.Keybindings;
254 return yield* keybindings.loadConfigState;
255 });
256
257 assert.isTrue(configState.keybindings.some((entry) => entry.command === "terminal.toggle"));
258 assert.isFalse(
259 configState.keybindings.some((entry) => String(entry.command) === "invalid.command"),
260 );
261 assert.deepEqual(configState.issues, [
262 {
263 kind: "keybindings.invalid-entry",
264 index: 1,
265 message: configState.issues[0]?.message ?? "",
266 },
267 {
268 kind: "keybindings.invalid-entry",
269 index: 2,
270 message: configState.issues[1]?.message ?? "",
271 },
272 ]);
273 }).pipe(Effect.provide(makeKeybindingsLayer())),
274 );
275
276 it.effect(
277 "upserts missing default keybindings on startup without overriding existing command rules",
278 () =>
279 Effect.gen(function* () {
280 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
281 yield* writeKeybindingsConfig(keybindingsConfigPath, [
282 { key: "mod+shift+t", command: "terminal.toggle" },
283 { key: "mod+shift+r", command: "script.run-tests.run" },
284 ]);
285
286 yield* Effect.gen(function* () {
287 const keybindings = yield* Keybindings.Keybindings;
288 yield* keybindings.syncDefaultKeybindingsOnStartup;
289 });
290
291 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
292 const byCommand = new Map(persisted.map((entry) => [entry.command, entry]));
293
294 const persistedToggle = byCommand.get("terminal.toggle");
295 assert.isNotNull(persistedToggle);
296 assert.equal(persistedToggle?.key, "mod+shift+t");
297 assert.isFalse(
298 persisted.some((entry) => entry.command === "terminal.toggle" && entry.key === "mod+j"),
299 );
300
301 for (const defaultRule of Keybindings.DEFAULT_KEYBINDINGS) {
302 assert.isTrue(byCommand.has(defaultRule.command), `expected ${defaultRule.command}`);
303 }
304 assert.isTrue(byCommand.has("script.run-tests.run"));
305 }).pipe(Effect.provide(makeKeybindingsLayer())),
306 );
307
308 it.effect("skips conflicting default keybindings on startup and logs a detailed warning", () => {
309 const messages: string[] = [];
310 const logger = Logger.make(({ message }) => {
311 messages.push(String(message));
312 });
313
314 return Effect.gen(function* () {
315 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
316 yield* writeKeybindingsConfig(keybindingsConfigPath, [
317 { key: "mod+j", command: "script.custom-action.run" },
318 ]);
319
320 yield* Effect.gen(function* () {
321 const keybindings = yield* Keybindings.Keybindings;
322 yield* keybindings.syncDefaultKeybindingsOnStartup;
323 });
324
325 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
326 assert.isFalse(persisted.some((entry) => entry.command === "terminal.toggle"));
327 assert.isTrue(persisted.some((entry) => entry.command === "script.custom-action.run"));
328
329 assert.isTrue(
330 messages.some((message) =>
331 message.includes("skipping default keybinding due to shortcut conflict"),
332 ),
333 );
334 }).pipe(
335 Effect.provide(
336 Layer.mergeAll(
337 makeKeybindingsLayer(),
338 Logger.layer([logger], { mergeWithExisting: false }),
339 ),
340 ),
341 );
342 });
343
344 it.effect("upserts custom keybindings to configured path", () =>
345 Effect.gen(function* () {
346 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
347 yield* writeKeybindingsConfig(keybindingsConfigPath, [
348 { key: "mod+j", command: "terminal.toggle" },
349 ]);
350
351 const resolved = yield* Effect.gen(function* () {
352 const keybindings = yield* Keybindings.Keybindings;
353 return yield* keybindings.upsertKeybindingRule({
354 key: "mod+shift+r",
355 command: "script.run-tests.run",
356 });
357 });
358
359 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
360 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
361
362 assert.deepEqual(persistedView, [
363 { key: "mod+j", command: "terminal.toggle" },
364 { key: "mod+shift+r", command: "script.run-tests.run" },
365 ]);
366 assert.isTrue(resolved.some((entry) => entry.command === "script.run-tests.run"));
367 }).pipe(Effect.provide(makeKeybindingsLayer())),
368 );
369
370 it.effect("appends additional custom keybindings for the same command", () =>
371 Effect.gen(function* () {
372 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
373 yield* writeKeybindingsConfig(keybindingsConfigPath, [
374 { key: "mod+r", command: "script.run-tests.run" },
375 ]);
376 yield* Effect.gen(function* () {
377 const keybindings = yield* Keybindings.Keybindings;
378 return yield* keybindings.upsertKeybindingRule({
379 key: "mod+shift+r",
380 command: "script.run-tests.run",
381 });
382 });
383
384 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
385 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
386 assert.deepEqual(persistedView, [
387 { key: "mod+r", command: "script.run-tests.run" },
388 { key: "mod+shift+r", command: "script.run-tests.run" },
389 ]);
390 }).pipe(Effect.provide(makeKeybindingsLayer())),
391 );
392
393 it.effect("replaces only the targeted custom keybinding", () =>
394 Effect.gen(function* () {
395 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
396 yield* writeKeybindingsConfig(keybindingsConfigPath, [
397 { key: "mod+r", command: "script.run-tests.run" },
398 { key: "mod+shift+r", command: "script.run-tests.run" },
399 ]);
400 yield* Effect.gen(function* () {
401 const keybindings = yield* Keybindings.Keybindings;
402 return yield* keybindings.upsertKeybindingRule({
403 key: "mod+alt+r",
404 command: "script.run-tests.run",
405 replace: { key: "mod+r", command: "script.run-tests.run" },
406 });
407 });
408
409 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
410 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
411 assert.deepEqual(persistedView, [
412 { key: "mod+shift+r", command: "script.run-tests.run" },
413 { key: "mod+alt+r", command: "script.run-tests.run" },
414 ]);
415 }).pipe(Effect.provide(makeKeybindingsLayer())),
416 );
417
418 it.effect("replacing with a rule that already exists elsewhere does not duplicate it", () =>
419 Effect.gen(function* () {
420 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
421 yield* writeKeybindingsConfig(keybindingsConfigPath, [
422 { key: "mod+r", command: "script.run-tests.run" },
423 { key: "mod+alt+r", command: "script.run-tests.run" },
424 ]);
425 yield* Effect.gen(function* () {
426 const keybindings = yield* Keybindings.Keybindings;
427 return yield* keybindings.upsertKeybindingRule({
428 key: "mod+alt+r",
429 command: "script.run-tests.run",
430 replace: { key: "mod+r", command: "script.run-tests.run" },
431 });
432 });
433
434 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
435 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
436 assert.deepEqual(persistedView, [{ key: "mod+alt+r", command: "script.run-tests.run" }]);
437 }).pipe(Effect.provide(makeKeybindingsLayer())),
438 );
439
440 it.effect("removes only the targeted custom keybinding", () =>
441 Effect.gen(function* () {
442 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
443 yield* writeKeybindingsConfig(keybindingsConfigPath, [
444 { key: "mod+r", command: "script.run-tests.run" },
445 { key: "mod+shift+r", command: "script.run-tests.run" },
446 ]);
447 yield* Effect.gen(function* () {
448 const keybindings = yield* Keybindings.Keybindings;
449 return yield* keybindings.removeKeybindingRule({
450 key: "mod+r",
451 command: "script.run-tests.run",
452 });
453 });
454
455 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
456 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
457 assert.deepEqual(persistedView, [{ key: "mod+shift+r", command: "script.run-tests.run" }]);
458 }).pipe(Effect.provide(makeKeybindingsLayer())),
459 );
460
461 it.effect("refuses to overwrite malformed keybindings config", () =>
462 Effect.gen(function* () {
463 const fs = yield* FileSystem.FileSystem;
464 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
465 yield* fs.writeFileString(keybindingsConfigPath, "{ not-json");
466
467 const result = yield* Effect.gen(function* () {
468 const keybindings = yield* Keybindings.Keybindings;
469 return yield* keybindings.upsertKeybindingRule({
470 key: "mod+shift+r",
471 command: "script.run-tests.run",
472 });
473 }).pipe(toDetailResult);
474 assertFailure(result, "expected JSON array");
475
476 const persistedRaw = yield* fs.readFileString(keybindingsConfigPath);
477 assert.equal(persistedRaw, "{ not-json");
478 }).pipe(Effect.provide(makeKeybindingsLayer())),
479 );
480
481 it.effect("reports non-array config parse errors without duplicate prefix", () =>
482 Effect.gen(function* () {
483 const fs = yield* FileSystem.FileSystem;
484 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
485 yield* fs.writeFileString(
486 keybindingsConfigPath,
487 '{"key":"mod+j","command":"terminal.toggle"}',
488 );
489
490 const firstResult = yield* Effect.gen(function* () {
491 const keybindings = yield* Keybindings.Keybindings;
492 return yield* keybindings.upsertKeybindingRule({
493 key: "mod+shift+r",
494 command: "script.run-tests.run",
495 });
496 }).pipe(toDetailResult);
497 assertFailure(firstResult, "expected JSON array");
498
499 const secondResult = yield* Effect.gen(function* () {
500 const keybindings = yield* Keybindings.Keybindings;
501 return yield* keybindings.upsertKeybindingRule({
502 key: "mod+shift+r",
503 command: "script.run-tests.run",
504 });
505 }).pipe(toDetailResult);
506 assertFailure(secondResult, "expected JSON array");
507 }).pipe(Effect.provide(makeKeybindingsLayer())),
508 );
509
510 it.effect("fails when config directory is not writable", () =>
511 Effect.gen(function* () {
512 const fs = yield* FileSystem.FileSystem;
513 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
514 const { dirname } = yield* Path.Path;
515 yield* writeKeybindingsConfig(keybindingsConfigPath, [
516 { key: "mod+j", command: "terminal.toggle" },
517 ]);
518 yield* fs.chmod(dirname(keybindingsConfigPath), 0o500);
519
520 const result = yield* Effect.gen(function* () {
521 const keybindings = yield* Keybindings.Keybindings;
522 return yield* keybindings.upsertKeybindingRule({
523 key: "mod+shift+r",
524 command: "script.run-tests.run",
525 });
526 }).pipe(toDetailResult);
527 assertFailure(result, "failed to write keybindings config");
528
529 yield* fs.chmod(dirname(keybindingsConfigPath), 0o700);
530
531 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
532 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
533 assert.deepEqual(persistedView, [{ key: "mod+j", command: "terminal.toggle" }]);
534 }).pipe(Effect.provide(makeKeybindingsLayer())),
535 );
536
537 it.effect("caches loaded resolved config across repeated reads", () =>
538 Effect.gen(function* () {
539 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
540 yield* writeKeybindingsConfig(keybindingsConfigPath, [
541 { key: "mod+j", command: "terminal.toggle" },
542 ]);
543
544 const [first, second] = yield* Effect.gen(function* () {
545 const keybindings = yield* Keybindings.Keybindings;
546 const firstLoad = (yield* keybindings.loadConfigState).keybindings;
547 const secondLoad = (yield* keybindings.loadConfigState).keybindings;
548 return [firstLoad, secondLoad] as const;
549 });
550
551 assert.deepEqual(first, second);
552 assert.isTrue(second.some((entry) => entry.command === "terminal.toggle"));
553 }).pipe(Effect.provide(makeKeybindingsLayer())),
554 );
555
556 it.effect("updates cached resolved config after upsert", () =>
557 Effect.gen(function* () {
558 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
559 yield* writeKeybindingsConfig(keybindingsConfigPath, [
560 { key: "mod+j", command: "terminal.toggle" },
561 ]);
562
563 const loadedAfterUpsert = yield* Effect.gen(function* () {
564 const keybindings = yield* Keybindings.Keybindings;
565 yield* keybindings.loadConfigState;
566 yield* keybindings.upsertKeybindingRule({
567 key: "mod+shift+r",
568 command: "script.run-tests.run",
569 });
570 return (yield* keybindings.loadConfigState).keybindings;
571 });
572
573 assert.isTrue(loadedAfterUpsert.some((entry) => entry.command === "script.run-tests.run"));
574 assert.isTrue(loadedAfterUpsert.some((entry) => entry.command === "terminal.toggle"));
575 }).pipe(Effect.provide(makeKeybindingsLayer())),
576 );
577
578 it.effect("serializes concurrent upserts to avoid lost updates", () =>
579 Effect.gen(function* () {
580 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
581 yield* writeKeybindingsConfig(keybindingsConfigPath, []);
582
583 const commands = Array.from(
584 { length: 20 },
585 (_, index): KeybindingCommand => `script.concurrent-${index}.run`,
586 );
587 yield* Effect.gen(function* () {
588 const keybindings = yield* Keybindings.Keybindings;
589 yield* Effect.all(
590 commands.map((command, index) =>
591 keybindings.upsertKeybindingRule({
592 key: `mod+${String.fromCharCode(97 + index)}`,
593 command,
594 }),
595 ),
596 { concurrency: "unbounded", discard: true },
597 );
598 });
599
600 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
601 const persistedCommands = new Set(persisted.map((entry) => entry.command));
602 for (const command of commands) {
603 assert.isTrue(persistedCommands.has(command), `expected persisted command ${command}`);
604 }
605 }).pipe(Effect.provide(makeKeybindingsLayer())),
606 );
607});