c64bridge 0.9.0 → 0.9.2

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 (61) hide show
  1. package/README.md +161 -135
  2. package/data/assembly/assembly-spec.md +1 -1
  3. package/data/context/bootstrap.md +3 -3
  4. package/data/context/fast-paths.md +3 -1
  5. package/data/graphics/petscii-style-guide.md +1 -1
  6. package/data/graphics/sprite-charset-best-practices.md +14 -13
  7. package/data/sound/sid-file-structure.md +5 -5
  8. package/data/sound/sid-programming-best-practices.md +5 -5
  9. package/data/vice/vice-binary-monitor-spec.md +26 -10
  10. package/dist/.tsbuildinfo +1 -1
  11. package/dist/c64Client.js +107 -8
  12. package/dist/device.js +43 -3
  13. package/dist/rag/indexer.js +18 -8
  14. package/dist/sidwaveCompiler.js +1 -1
  15. package/dist/tools/debug.js +158 -5
  16. package/dist/tools/input.js +336 -0
  17. package/dist/tools/memory.js +326 -1
  18. package/dist/tools/programRunners.js +45 -6
  19. package/dist/tools/registry/batch.js +167 -0
  20. package/dist/tools/registry/graphics.js +101 -1
  21. package/dist/tools/registry/index.js +4 -0
  22. package/dist/tools/registry/input.js +2 -0
  23. package/dist/tools/registry/memory.js +61 -1
  24. package/dist/tools/responses.js +14 -1
  25. package/dist/tools/schema.js +4 -5
  26. package/dist/{assemblyConverter.js → tools/translation/assembler.js} +66 -163
  27. package/dist/{basicConverter.js → tools/translation/basicTokenizer.js} +1 -1
  28. package/dist/tools/translation/disassembler.js +150 -0
  29. package/dist/tools/translation/opcodeInventory.js +126 -0
  30. package/dist/tools/translation/symbolRegistry.js +49 -0
  31. package/dist/tools/types.js +19 -4
  32. package/dist/vice/process.js +43 -2
  33. package/dist/vice/viceClient.js +5 -1
  34. package/doc/reviews/audit.md +143 -0
  35. package/mcp/schemas/c64_batch.schema.json +53 -0
  36. package/mcp/schemas/c64_config.schema.json +461 -2
  37. package/mcp/schemas/c64_debug.schema.json +641 -3
  38. package/mcp/schemas/c64_disk.schema.json +340 -2
  39. package/mcp/schemas/c64_drive.schema.json +157 -2
  40. package/mcp/schemas/c64_extract.schema.json +359 -2
  41. package/mcp/schemas/c64_graphics.schema.json +415 -3
  42. package/mcp/schemas/c64_input.schema.json +254 -0
  43. package/mcp/schemas/c64_memory.schema.json +562 -3
  44. package/mcp/schemas/c64_printer.schema.json +253 -2
  45. package/mcp/schemas/c64_program.schema.json +499 -2
  46. package/mcp/schemas/c64_rag.schema.json +82 -2
  47. package/mcp/schemas/c64_select_backend.schema.json +35 -2
  48. package/mcp/schemas/c64_sound.schema.json +793 -2
  49. package/mcp/schemas/c64_stream.schema.json +73 -2
  50. package/mcp/schemas/c64_system.schema.json +301 -2
  51. package/mcp/schemas/c64_vice.schema.json +71 -2
  52. package/mcp/server.json +1 -1
  53. package/mcp/tools.json +7509 -1929
  54. package/mcp.json +1 -1
  55. package/package.json +2 -2
  56. package/scripts/c64-cli.mjs +2 -2
  57. package/scripts/run-coverage.mjs +61 -3
  58. package/scripts/run-tests.mjs +1 -0
  59. package/scripts/run-tests.ts +3 -0
  60. package/scripts/update-readme.ts +79 -2
  61. package/server.json +2 -2
@@ -14,7 +14,11 @@
14
14
  "get_registers",
15
15
  "set_registers",
16
16
  "step",
17
- "step_return"
17
+ "step_return",
18
+ "get_monitor_state",
19
+ "wait_for_state",
20
+ "nuclear_reset",
21
+ "continue_execution"
18
22
  ],
19
23
  "description": "Selects the operation."
20
24
  },
@@ -60,6 +64,14 @@
60
64
  "description": "Automatically remove after first hit.",
61
65
  "default": false
62
66
  },
67
+ "label": {
68
+ "type": [
69
+ "string",
70
+ "null"
71
+ ],
72
+ "description": "Optional human-readable label stored in-process.",
73
+ "maxLength": 64
74
+ },
63
75
  "operations": {
64
76
  "type": [
65
77
  "object",
@@ -191,11 +203,637 @@
191
203
  "into",
192
204
  "over"
193
205
  ]
206
+ },
207
+ "expectedPC": {
208
+ "type": [
209
+ "string",
210
+ "null"
211
+ ],
212
+ "description": "Target PC address to wait for (e.g. $0810).",
213
+ "minLength": 1
214
+ },
215
+ "timeoutMs": {
216
+ "type": [
217
+ "integer",
218
+ "null"
219
+ ],
220
+ "description": "Maximum wait time in milliseconds.",
221
+ "minimum": 1,
222
+ "maximum": 60000,
223
+ "default": 5000
224
+ },
225
+ "pollMs": {
226
+ "type": [
227
+ "integer",
228
+ "null"
229
+ ],
230
+ "description": "Poll interval in milliseconds.",
231
+ "minimum": 10,
232
+ "maximum": 1000,
233
+ "default": 100
194
234
  }
195
235
  },
196
236
  "required": [
197
237
  "op"
198
238
  ],
199
- "description": "Available debugger operations.\n\nOperations:\n- list_checkpoints: List all active VICE checkpoints (breakpoints).\n- get_checkpoint: Fetch a single checkpoint by id.\n- create_checkpoint: Create a new checkpoint (breakpoint) in VICE.\n- delete_checkpoint: Remove a checkpoint by id.\n- toggle_checkpoint: Enable or disable a checkpoint by id.\n- set_condition: Attach a conditional expression to a checkpoint.\n- list_registers: List available registers (metadata).\n- get_registers: Read register values, optionally filtered by name or id.\n- set_registers: Write register values.\n- step: Single-step CPU execution.\n- step_return: Continue execution until the current routine returns.",
200
- "additionalProperties": false
239
+ "description": "Available debugger operations.\n\nOperations:\n- list_checkpoints: List all active VICE checkpoints (breakpoints). Required inputs: none.\n- get_checkpoint: Fetch a single checkpoint by id. Required inputs: id.\n- create_checkpoint: Create a new checkpoint (breakpoint) in VICE. Required inputs: address. Optional inputs: endAddress, stopOnHit, enabled, temporary, label, operations, memspace.\n- delete_checkpoint: Remove a checkpoint by id. Required inputs: id.\n- toggle_checkpoint: Enable or disable a checkpoint by id. Required inputs: id, enabled.\n- set_condition: Attach a conditional expression to a checkpoint. Required inputs: id, expression.\n- list_registers: List available registers (metadata). Required inputs: none. Optional inputs: memspace.\n- get_registers: Read register values, optionally filtered by name or id. Required inputs: none. Optional inputs: memspace, registers.\n- set_registers: Write register values. Required inputs: writes. Optional inputs: memspace.\n- step: Single-step CPU execution. Required inputs: none. Optional inputs: count, mode.\n- step_return: Continue execution until the current routine returns. Required inputs: none.\n- get_monitor_state: Read CPU registers and return the current monitor state. Required inputs: none. Optional inputs: memspace.\n- wait_for_state: Poll CPU registers until PC equals expectedPC or timeout elapses. Required inputs: none. Optional inputs: expectedPC, timeoutMs, pollMs.\n- nuclear_reset: Kill and restart the VICE process (managed instances only). Required inputs: none.\n- continue_execution: Exit the Binary Monitor and resume CPU execution (BM 0xAA Exit). Required inputs: none.",
240
+ "additionalProperties": false,
241
+ "x-c64bridge-operations": [
242
+ {
243
+ "op": "list_checkpoints",
244
+ "description": "List all active VICE checkpoints (breakpoints).",
245
+ "required": [],
246
+ "optional": [],
247
+ "inputSchema": {
248
+ "type": "object",
249
+ "description": "List all active VICE checkpoints (breakpoints).",
250
+ "properties": {
251
+ "op": {
252
+ "const": "list_checkpoints"
253
+ }
254
+ },
255
+ "required": [
256
+ "op"
257
+ ],
258
+ "additionalProperties": false
259
+ }
260
+ },
261
+ {
262
+ "op": "get_checkpoint",
263
+ "description": "Fetch a single checkpoint by id.",
264
+ "required": [
265
+ "id"
266
+ ],
267
+ "optional": [],
268
+ "inputSchema": {
269
+ "type": "object",
270
+ "description": "Fetch a single checkpoint by id.",
271
+ "properties": {
272
+ "op": {
273
+ "const": "get_checkpoint"
274
+ },
275
+ "id": {
276
+ "type": "integer",
277
+ "description": "Debugger checkpoint identifier.",
278
+ "minimum": 1
279
+ }
280
+ },
281
+ "required": [
282
+ "op",
283
+ "id"
284
+ ],
285
+ "additionalProperties": false
286
+ }
287
+ },
288
+ {
289
+ "op": "create_checkpoint",
290
+ "description": "Create a new checkpoint (breakpoint) in VICE.",
291
+ "required": [
292
+ "address"
293
+ ],
294
+ "optional": [
295
+ "endAddress",
296
+ "stopOnHit",
297
+ "enabled",
298
+ "temporary",
299
+ "label",
300
+ "operations",
301
+ "memspace"
302
+ ],
303
+ "inputSchema": {
304
+ "type": "object",
305
+ "description": "Create a new checkpoint (breakpoint) in VICE.",
306
+ "properties": {
307
+ "op": {
308
+ "const": "create_checkpoint"
309
+ },
310
+ "address": {
311
+ "type": "string",
312
+ "description": "Start address (e.g. $0801).",
313
+ "minLength": 1
314
+ },
315
+ "endAddress": {
316
+ "type": [
317
+ "string",
318
+ "null"
319
+ ],
320
+ "description": "Optional end address for range.",
321
+ "minLength": 1
322
+ },
323
+ "stopOnHit": {
324
+ "type": [
325
+ "boolean",
326
+ "null"
327
+ ],
328
+ "description": "Pause execution when hit (default true).",
329
+ "default": true
330
+ },
331
+ "enabled": {
332
+ "type": [
333
+ "boolean",
334
+ "null"
335
+ ],
336
+ "description": "Whether the checkpoint is enabled (default true).",
337
+ "default": true
338
+ },
339
+ "temporary": {
340
+ "type": [
341
+ "boolean",
342
+ "null"
343
+ ],
344
+ "description": "Automatically remove after first hit.",
345
+ "default": false
346
+ },
347
+ "label": {
348
+ "type": [
349
+ "string",
350
+ "null"
351
+ ],
352
+ "description": "Optional human-readable label stored in-process.",
353
+ "maxLength": 64
354
+ },
355
+ "operations": {
356
+ "type": [
357
+ "object",
358
+ "null"
359
+ ],
360
+ "description": "Checkpoint operation filters.",
361
+ "properties": {
362
+ "execute": {
363
+ "type": [
364
+ "boolean",
365
+ "null"
366
+ ],
367
+ "description": "Trigger on execute (default true).",
368
+ "default": true
369
+ },
370
+ "load": {
371
+ "type": [
372
+ "boolean",
373
+ "null"
374
+ ],
375
+ "description": "Trigger on memory load.",
376
+ "default": false
377
+ },
378
+ "store": {
379
+ "type": [
380
+ "boolean",
381
+ "null"
382
+ ],
383
+ "description": "Trigger on memory store.",
384
+ "default": false
385
+ }
386
+ },
387
+ "additionalProperties": false
388
+ },
389
+ "memspace": {
390
+ "type": [
391
+ "integer",
392
+ "null"
393
+ ],
394
+ "description": "VICE memory space (0=CPU, 1=Drive8, etc.).",
395
+ "minimum": 0,
396
+ "maximum": 4
397
+ }
398
+ },
399
+ "required": [
400
+ "op",
401
+ "address"
402
+ ],
403
+ "additionalProperties": false
404
+ }
405
+ },
406
+ {
407
+ "op": "delete_checkpoint",
408
+ "description": "Remove a checkpoint by id.",
409
+ "required": [
410
+ "id"
411
+ ],
412
+ "optional": [],
413
+ "inputSchema": {
414
+ "type": "object",
415
+ "description": "Remove a checkpoint by id.",
416
+ "properties": {
417
+ "op": {
418
+ "const": "delete_checkpoint"
419
+ },
420
+ "id": {
421
+ "type": "integer",
422
+ "description": "Debugger checkpoint identifier.",
423
+ "minimum": 1
424
+ }
425
+ },
426
+ "required": [
427
+ "op",
428
+ "id"
429
+ ],
430
+ "additionalProperties": false
431
+ }
432
+ },
433
+ {
434
+ "op": "toggle_checkpoint",
435
+ "description": "Enable or disable a checkpoint by id.",
436
+ "required": [
437
+ "id",
438
+ "enabled"
439
+ ],
440
+ "optional": [],
441
+ "inputSchema": {
442
+ "type": "object",
443
+ "description": "Enable or disable a checkpoint by id.",
444
+ "properties": {
445
+ "op": {
446
+ "const": "toggle_checkpoint"
447
+ },
448
+ "id": {
449
+ "type": "integer",
450
+ "description": "Debugger checkpoint identifier.",
451
+ "minimum": 1
452
+ },
453
+ "enabled": {
454
+ "type": "boolean",
455
+ "description": "Set to true to enable, false to disable."
456
+ }
457
+ },
458
+ "required": [
459
+ "op",
460
+ "id",
461
+ "enabled"
462
+ ],
463
+ "additionalProperties": false
464
+ }
465
+ },
466
+ {
467
+ "op": "set_condition",
468
+ "description": "Attach a conditional expression to a checkpoint.",
469
+ "required": [
470
+ "id",
471
+ "expression"
472
+ ],
473
+ "optional": [],
474
+ "inputSchema": {
475
+ "type": "object",
476
+ "description": "Attach a conditional expression to a checkpoint.",
477
+ "properties": {
478
+ "op": {
479
+ "const": "set_condition"
480
+ },
481
+ "id": {
482
+ "type": "integer",
483
+ "description": "Debugger checkpoint identifier.",
484
+ "minimum": 1
485
+ },
486
+ "expression": {
487
+ "type": "string",
488
+ "description": "VICE monitor conditional expression.",
489
+ "minLength": 1
490
+ }
491
+ },
492
+ "required": [
493
+ "op",
494
+ "id",
495
+ "expression"
496
+ ],
497
+ "additionalProperties": false
498
+ }
499
+ },
500
+ {
501
+ "op": "list_registers",
502
+ "description": "List available registers (metadata).",
503
+ "required": [],
504
+ "optional": [
505
+ "memspace"
506
+ ],
507
+ "inputSchema": {
508
+ "type": "object",
509
+ "description": "List available registers (metadata).",
510
+ "properties": {
511
+ "op": {
512
+ "const": "list_registers"
513
+ },
514
+ "memspace": {
515
+ "type": [
516
+ "integer",
517
+ "null"
518
+ ],
519
+ "description": "VICE memory space (0=CPU, 1=Drive8, etc.).",
520
+ "minimum": 0,
521
+ "maximum": 4
522
+ }
523
+ },
524
+ "required": [
525
+ "op"
526
+ ],
527
+ "additionalProperties": false
528
+ }
529
+ },
530
+ {
531
+ "op": "get_registers",
532
+ "description": "Read register values, optionally filtered by name or id.",
533
+ "required": [],
534
+ "optional": [
535
+ "memspace",
536
+ "registers"
537
+ ],
538
+ "inputSchema": {
539
+ "type": "object",
540
+ "description": "Read register values, optionally filtered by name or id.",
541
+ "properties": {
542
+ "op": {
543
+ "const": "get_registers"
544
+ },
545
+ "memspace": {
546
+ "type": [
547
+ "integer",
548
+ "null"
549
+ ],
550
+ "description": "VICE memory space (0=CPU, 1=Drive8, etc.).",
551
+ "minimum": 0,
552
+ "maximum": 4
553
+ },
554
+ "registers": {
555
+ "type": [
556
+ "array",
557
+ "null"
558
+ ],
559
+ "description": "Registers to include.",
560
+ "items": {
561
+ "type": "object",
562
+ "description": "Selects a register by id or name.",
563
+ "properties": {
564
+ "name": {
565
+ "type": [
566
+ "string",
567
+ "null"
568
+ ],
569
+ "description": "Register name (case-insensitive)."
570
+ },
571
+ "id": {
572
+ "type": [
573
+ "integer",
574
+ "null"
575
+ ],
576
+ "description": "Register id.",
577
+ "minimum": 0
578
+ }
579
+ },
580
+ "additionalProperties": false
581
+ }
582
+ }
583
+ },
584
+ "required": [
585
+ "op"
586
+ ],
587
+ "additionalProperties": false
588
+ }
589
+ },
590
+ {
591
+ "op": "set_registers",
592
+ "description": "Write register values.",
593
+ "required": [
594
+ "writes"
595
+ ],
596
+ "optional": [
597
+ "memspace"
598
+ ],
599
+ "inputSchema": {
600
+ "type": "object",
601
+ "description": "Write register values.",
602
+ "properties": {
603
+ "op": {
604
+ "const": "set_registers"
605
+ },
606
+ "memspace": {
607
+ "type": [
608
+ "integer",
609
+ "null"
610
+ ],
611
+ "description": "VICE memory space (0=CPU, 1=Drive8, etc.).",
612
+ "minimum": 0,
613
+ "maximum": 4
614
+ },
615
+ "writes": {
616
+ "type": "array",
617
+ "description": "Register writes to apply.",
618
+ "items": {
619
+ "type": "object",
620
+ "description": "Register write descriptor.",
621
+ "properties": {
622
+ "name": {
623
+ "type": [
624
+ "string",
625
+ "null"
626
+ ],
627
+ "description": "Register name (case-insensitive)."
628
+ },
629
+ "id": {
630
+ "type": [
631
+ "integer",
632
+ "null"
633
+ ],
634
+ "description": "Register id.",
635
+ "minimum": 0
636
+ },
637
+ "value": {
638
+ "type": "integer",
639
+ "description": "Value to write.",
640
+ "minimum": 0
641
+ }
642
+ },
643
+ "required": [
644
+ "value"
645
+ ],
646
+ "additionalProperties": false
647
+ },
648
+ "minItems": 1
649
+ }
650
+ },
651
+ "required": [
652
+ "op",
653
+ "writes"
654
+ ],
655
+ "additionalProperties": false
656
+ }
657
+ },
658
+ {
659
+ "op": "step",
660
+ "description": "Single-step CPU execution.",
661
+ "required": [],
662
+ "optional": [
663
+ "count",
664
+ "mode"
665
+ ],
666
+ "inputSchema": {
667
+ "type": "object",
668
+ "description": "Single-step CPU execution.",
669
+ "properties": {
670
+ "op": {
671
+ "const": "step"
672
+ },
673
+ "count": {
674
+ "type": [
675
+ "integer",
676
+ "null"
677
+ ],
678
+ "description": "Number of instructions to step.",
679
+ "minimum": 1,
680
+ "default": 1
681
+ },
682
+ "mode": {
683
+ "type": [
684
+ "string",
685
+ "null"
686
+ ],
687
+ "description": "Step mode (into or over).",
688
+ "enum": [
689
+ "into",
690
+ "over"
691
+ ]
692
+ }
693
+ },
694
+ "required": [
695
+ "op"
696
+ ],
697
+ "additionalProperties": false
698
+ }
699
+ },
700
+ {
701
+ "op": "step_return",
702
+ "description": "Continue execution until the current routine returns.",
703
+ "required": [],
704
+ "optional": [],
705
+ "inputSchema": {
706
+ "type": "object",
707
+ "description": "Continue execution until the current routine returns.",
708
+ "properties": {
709
+ "op": {
710
+ "const": "step_return"
711
+ }
712
+ },
713
+ "required": [
714
+ "op"
715
+ ],
716
+ "additionalProperties": false
717
+ }
718
+ },
719
+ {
720
+ "op": "get_monitor_state",
721
+ "description": "Read CPU registers and return the current monitor state.",
722
+ "required": [],
723
+ "optional": [
724
+ "memspace"
725
+ ],
726
+ "inputSchema": {
727
+ "type": "object",
728
+ "description": "Read CPU registers and return the current monitor state.",
729
+ "properties": {
730
+ "op": {
731
+ "const": "get_monitor_state"
732
+ },
733
+ "memspace": {
734
+ "type": [
735
+ "integer",
736
+ "null"
737
+ ],
738
+ "description": "VICE memory space (0=CPU, 1=Drive8, etc.).",
739
+ "minimum": 0,
740
+ "maximum": 4
741
+ }
742
+ },
743
+ "required": [
744
+ "op"
745
+ ],
746
+ "additionalProperties": false
747
+ }
748
+ },
749
+ {
750
+ "op": "wait_for_state",
751
+ "description": "Poll CPU registers until PC equals expectedPC or timeout elapses.",
752
+ "required": [],
753
+ "optional": [
754
+ "expectedPC",
755
+ "timeoutMs",
756
+ "pollMs"
757
+ ],
758
+ "inputSchema": {
759
+ "type": "object",
760
+ "description": "Poll CPU registers until PC equals expectedPC or timeout elapses.",
761
+ "properties": {
762
+ "op": {
763
+ "const": "wait_for_state"
764
+ },
765
+ "expectedPC": {
766
+ "type": [
767
+ "string",
768
+ "null"
769
+ ],
770
+ "description": "Target PC address to wait for (e.g. $0810).",
771
+ "minLength": 1
772
+ },
773
+ "timeoutMs": {
774
+ "type": [
775
+ "integer",
776
+ "null"
777
+ ],
778
+ "description": "Maximum wait time in milliseconds.",
779
+ "minimum": 1,
780
+ "maximum": 60000,
781
+ "default": 5000
782
+ },
783
+ "pollMs": {
784
+ "type": [
785
+ "integer",
786
+ "null"
787
+ ],
788
+ "description": "Poll interval in milliseconds.",
789
+ "minimum": 10,
790
+ "maximum": 1000,
791
+ "default": 100
792
+ }
793
+ },
794
+ "required": [
795
+ "op"
796
+ ],
797
+ "additionalProperties": false
798
+ }
799
+ },
800
+ {
801
+ "op": "nuclear_reset",
802
+ "description": "Kill and restart the VICE process (managed instances only).",
803
+ "required": [],
804
+ "optional": [],
805
+ "inputSchema": {
806
+ "type": "object",
807
+ "description": "Kill and restart the VICE process (managed instances only).",
808
+ "properties": {
809
+ "op": {
810
+ "const": "nuclear_reset"
811
+ }
812
+ },
813
+ "required": [
814
+ "op"
815
+ ],
816
+ "additionalProperties": false
817
+ }
818
+ },
819
+ {
820
+ "op": "continue_execution",
821
+ "description": "Exit the Binary Monitor and resume CPU execution (BM 0xAA Exit).",
822
+ "required": [],
823
+ "optional": [],
824
+ "inputSchema": {
825
+ "type": "object",
826
+ "description": "Exit the Binary Monitor and resume CPU execution (BM 0xAA Exit).",
827
+ "properties": {
828
+ "op": {
829
+ "const": "continue_execution"
830
+ }
831
+ },
832
+ "required": [
833
+ "op"
834
+ ],
835
+ "additionalProperties": false
836
+ }
837
+ }
838
+ ]
201
839
  }