c64-debug-mcp 1.0.10 → 1.0.12

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.
package/dist/http.cjs CHANGED
@@ -3641,14 +3641,23 @@ var readMemoryTool = createViceTool({
3641
3641
  import_zod4.z.object({
3642
3642
  address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3643
3643
  length: import_zod4.z.number().int().positive().max(65535).describe("Number of bytes to read")
3644
+ }).refine((input) => input.address + input.length <= 65536, {
3645
+ message: "address + length must stay within the 64K address space",
3646
+ path: ["length"]
3644
3647
  }),
3645
3648
  import_zod4.z.object({
3646
3649
  start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3647
3650
  end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)")
3651
+ }).refine((input) => input.start <= input.end, {
3652
+ message: "End address must be greater than or equal to start address",
3653
+ path: ["end"]
3654
+ }).refine((input) => input.end < 65536, {
3655
+ message: "End address must stay within the 64K address space",
3656
+ path: ["end"]
3648
3657
  })
3649
3658
  ]),
3650
3659
  dataSchema: import_zod4.z.object({
3651
- address: address16Schema.describe("Start address of the returned memory chunk"),
3660
+ address: import_zod4.z.number().int().min(0).max(65535).describe("Start address of the returned memory chunk"),
3652
3661
  length: import_zod4.z.number().int().min(0).describe("Number of bytes returned"),
3653
3662
  data: byteArraySchema.describe("Raw bytes returned from memory")
3654
3663
  }),
@@ -3656,19 +3665,11 @@ var readMemoryTool = createViceTool({
3656
3665
  let address;
3657
3666
  let length;
3658
3667
  if ("start" in input && "end" in input) {
3659
- if (input.end < input.start) {
3660
- throw new Error("End address must be greater than or equal to start address");
3661
- }
3662
3668
  address = input.start;
3663
3669
  length = input.end - input.start + 1;
3664
- } else if ("address" in input && "length" in input) {
3670
+ } else {
3665
3671
  address = input.address;
3666
3672
  length = input.length;
3667
- } else {
3668
- throw new Error("Invalid input: must provide either (address, length) or (start, end)");
3669
- }
3670
- if (address + length > 65536) {
3671
- throw new Error("address + length must stay within the 64K address space");
3672
3673
  }
3673
3674
  const result = await c64Session.readMemory(address, address + length - 1);
3674
3675
  return {
@@ -3690,7 +3691,7 @@ var writeMemoryTool = createViceTool({
3690
3691
  }),
3691
3692
  dataSchema: import_zod4.z.object({
3692
3693
  worked: import_zod4.z.boolean().describe("Whether the write operation completed successfully"),
3693
- address: address16Schema.describe("Start address where the bytes were written"),
3694
+ address: import_zod4.z.number().int().min(0).max(65535).describe("Start address where the bytes were written"),
3694
3695
  length: import_zod4.z.number().int().min(1).describe("Number of bytes written")
3695
3696
  }).extend(debugStateSchema.shape),
3696
3697
  execute: async (input) => await c64Session.writeMemory(input.address, input.data)
@@ -3758,43 +3759,28 @@ var breakpointSetTool = createViceTool({
3758
3759
  label: import_zod4.z.string().optional(),
3759
3760
  temporary: import_zod4.z.boolean().default(false),
3760
3761
  enabled: import_zod4.z.boolean().default(true)
3762
+ }).refine((input) => input.start <= input.end, {
3763
+ message: "End address must be greater than or equal to start address",
3764
+ path: ["end"]
3761
3765
  })
3762
3766
  ]),
3763
3767
  dataSchema: import_zod4.z.object({
3764
3768
  breakpoint: breakpointSchema,
3765
3769
  executionState: executionStateSchema,
3766
3770
  lastStopReason: stopReasonSchema,
3767
- programCounter: address16Schema.nullable(),
3771
+ programCounter: import_zod4.z.number().int().min(0).max(65535).nullable(),
3768
3772
  registers: c64PartialRegisterValueSchema.nullable()
3769
3773
  }),
3770
3774
  execute: async (input) => {
3771
- let normalizedInput;
3772
- if ("start" in input && "end" in input) {
3773
- if (input.end < input.start) {
3774
- throw new Error("End address must be greater than or equal to start address");
3775
- }
3776
- normalizedInput = {
3777
- kind: input.kind,
3778
- address: input.start,
3779
- length: input.end - input.start + 1,
3780
- condition: input.condition,
3781
- label: input.label,
3782
- temporary: input.temporary,
3783
- enabled: input.enabled
3784
- };
3785
- } else if ("address" in input && "length" in input) {
3786
- normalizedInput = {
3787
- kind: input.kind,
3788
- address: input.address,
3789
- length: input.length,
3790
- condition: input.condition,
3791
- label: input.label,
3792
- temporary: input.temporary,
3793
- enabled: input.enabled
3794
- };
3795
- } else {
3796
- throw new Error("Invalid input: must provide either (address, length) or (start, end)");
3797
- }
3775
+ const normalizedInput = "start" in input && "end" in input ? {
3776
+ kind: input.kind,
3777
+ address: input.start,
3778
+ length: input.end - input.start + 1,
3779
+ condition: input.condition,
3780
+ label: input.label,
3781
+ temporary: input.temporary,
3782
+ enabled: input.enabled
3783
+ } : input;
3798
3784
  const result = await c64Session.breakpointSet(normalizedInput);
3799
3785
  return {
3800
3786
  breakpoint: normalizeBreakpoint(result.breakpoint),
package/dist/http.js CHANGED
@@ -3618,14 +3618,23 @@ var readMemoryTool = createViceTool({
3618
3618
  z3.object({
3619
3619
  address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3620
3620
  length: z3.number().int().positive().max(65535).describe("Number of bytes to read")
3621
+ }).refine((input) => input.address + input.length <= 65536, {
3622
+ message: "address + length must stay within the 64K address space",
3623
+ path: ["length"]
3621
3624
  }),
3622
3625
  z3.object({
3623
3626
  start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3624
3627
  end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)")
3628
+ }).refine((input) => input.start <= input.end, {
3629
+ message: "End address must be greater than or equal to start address",
3630
+ path: ["end"]
3631
+ }).refine((input) => input.end < 65536, {
3632
+ message: "End address must stay within the 64K address space",
3633
+ path: ["end"]
3625
3634
  })
3626
3635
  ]),
3627
3636
  dataSchema: z3.object({
3628
- address: address16Schema.describe("Start address of the returned memory chunk"),
3637
+ address: z3.number().int().min(0).max(65535).describe("Start address of the returned memory chunk"),
3629
3638
  length: z3.number().int().min(0).describe("Number of bytes returned"),
3630
3639
  data: byteArraySchema.describe("Raw bytes returned from memory")
3631
3640
  }),
@@ -3633,19 +3642,11 @@ var readMemoryTool = createViceTool({
3633
3642
  let address;
3634
3643
  let length;
3635
3644
  if ("start" in input && "end" in input) {
3636
- if (input.end < input.start) {
3637
- throw new Error("End address must be greater than or equal to start address");
3638
- }
3639
3645
  address = input.start;
3640
3646
  length = input.end - input.start + 1;
3641
- } else if ("address" in input && "length" in input) {
3647
+ } else {
3642
3648
  address = input.address;
3643
3649
  length = input.length;
3644
- } else {
3645
- throw new Error("Invalid input: must provide either (address, length) or (start, end)");
3646
- }
3647
- if (address + length > 65536) {
3648
- throw new Error("address + length must stay within the 64K address space");
3649
3650
  }
3650
3651
  const result = await c64Session.readMemory(address, address + length - 1);
3651
3652
  return {
@@ -3667,7 +3668,7 @@ var writeMemoryTool = createViceTool({
3667
3668
  }),
3668
3669
  dataSchema: z3.object({
3669
3670
  worked: z3.boolean().describe("Whether the write operation completed successfully"),
3670
- address: address16Schema.describe("Start address where the bytes were written"),
3671
+ address: z3.number().int().min(0).max(65535).describe("Start address where the bytes were written"),
3671
3672
  length: z3.number().int().min(1).describe("Number of bytes written")
3672
3673
  }).extend(debugStateSchema.shape),
3673
3674
  execute: async (input) => await c64Session.writeMemory(input.address, input.data)
@@ -3735,43 +3736,28 @@ var breakpointSetTool = createViceTool({
3735
3736
  label: z3.string().optional(),
3736
3737
  temporary: z3.boolean().default(false),
3737
3738
  enabled: z3.boolean().default(true)
3739
+ }).refine((input) => input.start <= input.end, {
3740
+ message: "End address must be greater than or equal to start address",
3741
+ path: ["end"]
3738
3742
  })
3739
3743
  ]),
3740
3744
  dataSchema: z3.object({
3741
3745
  breakpoint: breakpointSchema,
3742
3746
  executionState: executionStateSchema,
3743
3747
  lastStopReason: stopReasonSchema,
3744
- programCounter: address16Schema.nullable(),
3748
+ programCounter: z3.number().int().min(0).max(65535).nullable(),
3745
3749
  registers: c64PartialRegisterValueSchema.nullable()
3746
3750
  }),
3747
3751
  execute: async (input) => {
3748
- let normalizedInput;
3749
- if ("start" in input && "end" in input) {
3750
- if (input.end < input.start) {
3751
- throw new Error("End address must be greater than or equal to start address");
3752
- }
3753
- normalizedInput = {
3754
- kind: input.kind,
3755
- address: input.start,
3756
- length: input.end - input.start + 1,
3757
- condition: input.condition,
3758
- label: input.label,
3759
- temporary: input.temporary,
3760
- enabled: input.enabled
3761
- };
3762
- } else if ("address" in input && "length" in input) {
3763
- normalizedInput = {
3764
- kind: input.kind,
3765
- address: input.address,
3766
- length: input.length,
3767
- condition: input.condition,
3768
- label: input.label,
3769
- temporary: input.temporary,
3770
- enabled: input.enabled
3771
- };
3772
- } else {
3773
- throw new Error("Invalid input: must provide either (address, length) or (start, end)");
3774
- }
3752
+ const normalizedInput = "start" in input && "end" in input ? {
3753
+ kind: input.kind,
3754
+ address: input.start,
3755
+ length: input.end - input.start + 1,
3756
+ condition: input.condition,
3757
+ label: input.label,
3758
+ temporary: input.temporary,
3759
+ enabled: input.enabled
3760
+ } : input;
3775
3761
  const result = await c64Session.breakpointSet(normalizedInput);
3776
3762
  return {
3777
3763
  breakpoint: normalizeBreakpoint(result.breakpoint),
package/dist/stdio.cjs CHANGED
@@ -3638,14 +3638,23 @@ var readMemoryTool = createViceTool({
3638
3638
  import_zod4.z.object({
3639
3639
  address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3640
3640
  length: import_zod4.z.number().int().positive().max(65535).describe("Number of bytes to read")
3641
+ }).refine((input) => input.address + input.length <= 65536, {
3642
+ message: "address + length must stay within the 64K address space",
3643
+ path: ["length"]
3641
3644
  }),
3642
3645
  import_zod4.z.object({
3643
3646
  start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3644
3647
  end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)")
3648
+ }).refine((input) => input.start <= input.end, {
3649
+ message: "End address must be greater than or equal to start address",
3650
+ path: ["end"]
3651
+ }).refine((input) => input.end < 65536, {
3652
+ message: "End address must stay within the 64K address space",
3653
+ path: ["end"]
3645
3654
  })
3646
3655
  ]),
3647
3656
  dataSchema: import_zod4.z.object({
3648
- address: address16Schema.describe("Start address of the returned memory chunk"),
3657
+ address: import_zod4.z.number().int().min(0).max(65535).describe("Start address of the returned memory chunk"),
3649
3658
  length: import_zod4.z.number().int().min(0).describe("Number of bytes returned"),
3650
3659
  data: byteArraySchema.describe("Raw bytes returned from memory")
3651
3660
  }),
@@ -3653,19 +3662,11 @@ var readMemoryTool = createViceTool({
3653
3662
  let address;
3654
3663
  let length;
3655
3664
  if ("start" in input && "end" in input) {
3656
- if (input.end < input.start) {
3657
- throw new Error("End address must be greater than or equal to start address");
3658
- }
3659
3665
  address = input.start;
3660
3666
  length = input.end - input.start + 1;
3661
- } else if ("address" in input && "length" in input) {
3667
+ } else {
3662
3668
  address = input.address;
3663
3669
  length = input.length;
3664
- } else {
3665
- throw new Error("Invalid input: must provide either (address, length) or (start, end)");
3666
- }
3667
- if (address + length > 65536) {
3668
- throw new Error("address + length must stay within the 64K address space");
3669
3670
  }
3670
3671
  const result = await c64Session.readMemory(address, address + length - 1);
3671
3672
  return {
@@ -3687,7 +3688,7 @@ var writeMemoryTool = createViceTool({
3687
3688
  }),
3688
3689
  dataSchema: import_zod4.z.object({
3689
3690
  worked: import_zod4.z.boolean().describe("Whether the write operation completed successfully"),
3690
- address: address16Schema.describe("Start address where the bytes were written"),
3691
+ address: import_zod4.z.number().int().min(0).max(65535).describe("Start address where the bytes were written"),
3691
3692
  length: import_zod4.z.number().int().min(1).describe("Number of bytes written")
3692
3693
  }).extend(debugStateSchema.shape),
3693
3694
  execute: async (input) => await c64Session.writeMemory(input.address, input.data)
@@ -3755,43 +3756,28 @@ var breakpointSetTool = createViceTool({
3755
3756
  label: import_zod4.z.string().optional(),
3756
3757
  temporary: import_zod4.z.boolean().default(false),
3757
3758
  enabled: import_zod4.z.boolean().default(true)
3759
+ }).refine((input) => input.start <= input.end, {
3760
+ message: "End address must be greater than or equal to start address",
3761
+ path: ["end"]
3758
3762
  })
3759
3763
  ]),
3760
3764
  dataSchema: import_zod4.z.object({
3761
3765
  breakpoint: breakpointSchema,
3762
3766
  executionState: executionStateSchema,
3763
3767
  lastStopReason: stopReasonSchema,
3764
- programCounter: address16Schema.nullable(),
3768
+ programCounter: import_zod4.z.number().int().min(0).max(65535).nullable(),
3765
3769
  registers: c64PartialRegisterValueSchema.nullable()
3766
3770
  }),
3767
3771
  execute: async (input) => {
3768
- let normalizedInput;
3769
- if ("start" in input && "end" in input) {
3770
- if (input.end < input.start) {
3771
- throw new Error("End address must be greater than or equal to start address");
3772
- }
3773
- normalizedInput = {
3774
- kind: input.kind,
3775
- address: input.start,
3776
- length: input.end - input.start + 1,
3777
- condition: input.condition,
3778
- label: input.label,
3779
- temporary: input.temporary,
3780
- enabled: input.enabled
3781
- };
3782
- } else if ("address" in input && "length" in input) {
3783
- normalizedInput = {
3784
- kind: input.kind,
3785
- address: input.address,
3786
- length: input.length,
3787
- condition: input.condition,
3788
- label: input.label,
3789
- temporary: input.temporary,
3790
- enabled: input.enabled
3791
- };
3792
- } else {
3793
- throw new Error("Invalid input: must provide either (address, length) or (start, end)");
3794
- }
3772
+ const normalizedInput = "start" in input && "end" in input ? {
3773
+ kind: input.kind,
3774
+ address: input.start,
3775
+ length: input.end - input.start + 1,
3776
+ condition: input.condition,
3777
+ label: input.label,
3778
+ temporary: input.temporary,
3779
+ enabled: input.enabled
3780
+ } : input;
3795
3781
  const result = await c64Session.breakpointSet(normalizedInput);
3796
3782
  return {
3797
3783
  breakpoint: normalizeBreakpoint(result.breakpoint),
package/dist/stdio.js CHANGED
@@ -3615,14 +3615,23 @@ var readMemoryTool = createViceTool({
3615
3615
  z3.object({
3616
3616
  address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3617
3617
  length: z3.number().int().positive().max(65535).describe("Number of bytes to read")
3618
+ }).refine((input) => input.address + input.length <= 65536, {
3619
+ message: "address + length must stay within the 64K address space",
3620
+ path: ["length"]
3618
3621
  }),
3619
3622
  z3.object({
3620
3623
  start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3621
3624
  end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)")
3625
+ }).refine((input) => input.start <= input.end, {
3626
+ message: "End address must be greater than or equal to start address",
3627
+ path: ["end"]
3628
+ }).refine((input) => input.end < 65536, {
3629
+ message: "End address must stay within the 64K address space",
3630
+ path: ["end"]
3622
3631
  })
3623
3632
  ]),
3624
3633
  dataSchema: z3.object({
3625
- address: address16Schema.describe("Start address of the returned memory chunk"),
3634
+ address: z3.number().int().min(0).max(65535).describe("Start address of the returned memory chunk"),
3626
3635
  length: z3.number().int().min(0).describe("Number of bytes returned"),
3627
3636
  data: byteArraySchema.describe("Raw bytes returned from memory")
3628
3637
  }),
@@ -3630,19 +3639,11 @@ var readMemoryTool = createViceTool({
3630
3639
  let address;
3631
3640
  let length;
3632
3641
  if ("start" in input && "end" in input) {
3633
- if (input.end < input.start) {
3634
- throw new Error("End address must be greater than or equal to start address");
3635
- }
3636
3642
  address = input.start;
3637
3643
  length = input.end - input.start + 1;
3638
- } else if ("address" in input && "length" in input) {
3644
+ } else {
3639
3645
  address = input.address;
3640
3646
  length = input.length;
3641
- } else {
3642
- throw new Error("Invalid input: must provide either (address, length) or (start, end)");
3643
- }
3644
- if (address + length > 65536) {
3645
- throw new Error("address + length must stay within the 64K address space");
3646
3647
  }
3647
3648
  const result = await c64Session.readMemory(address, address + length - 1);
3648
3649
  return {
@@ -3664,7 +3665,7 @@ var writeMemoryTool = createViceTool({
3664
3665
  }),
3665
3666
  dataSchema: z3.object({
3666
3667
  worked: z3.boolean().describe("Whether the write operation completed successfully"),
3667
- address: address16Schema.describe("Start address where the bytes were written"),
3668
+ address: z3.number().int().min(0).max(65535).describe("Start address where the bytes were written"),
3668
3669
  length: z3.number().int().min(1).describe("Number of bytes written")
3669
3670
  }).extend(debugStateSchema.shape),
3670
3671
  execute: async (input) => await c64Session.writeMemory(input.address, input.data)
@@ -3732,43 +3733,28 @@ var breakpointSetTool = createViceTool({
3732
3733
  label: z3.string().optional(),
3733
3734
  temporary: z3.boolean().default(false),
3734
3735
  enabled: z3.boolean().default(true)
3736
+ }).refine((input) => input.start <= input.end, {
3737
+ message: "End address must be greater than or equal to start address",
3738
+ path: ["end"]
3735
3739
  })
3736
3740
  ]),
3737
3741
  dataSchema: z3.object({
3738
3742
  breakpoint: breakpointSchema,
3739
3743
  executionState: executionStateSchema,
3740
3744
  lastStopReason: stopReasonSchema,
3741
- programCounter: address16Schema.nullable(),
3745
+ programCounter: z3.number().int().min(0).max(65535).nullable(),
3742
3746
  registers: c64PartialRegisterValueSchema.nullable()
3743
3747
  }),
3744
3748
  execute: async (input) => {
3745
- let normalizedInput;
3746
- if ("start" in input && "end" in input) {
3747
- if (input.end < input.start) {
3748
- throw new Error("End address must be greater than or equal to start address");
3749
- }
3750
- normalizedInput = {
3751
- kind: input.kind,
3752
- address: input.start,
3753
- length: input.end - input.start + 1,
3754
- condition: input.condition,
3755
- label: input.label,
3756
- temporary: input.temporary,
3757
- enabled: input.enabled
3758
- };
3759
- } else if ("address" in input && "length" in input) {
3760
- normalizedInput = {
3761
- kind: input.kind,
3762
- address: input.address,
3763
- length: input.length,
3764
- condition: input.condition,
3765
- label: input.label,
3766
- temporary: input.temporary,
3767
- enabled: input.enabled
3768
- };
3769
- } else {
3770
- throw new Error("Invalid input: must provide either (address, length) or (start, end)");
3771
- }
3749
+ const normalizedInput = "start" in input && "end" in input ? {
3750
+ kind: input.kind,
3751
+ address: input.start,
3752
+ length: input.end - input.start + 1,
3753
+ condition: input.condition,
3754
+ label: input.label,
3755
+ temporary: input.temporary,
3756
+ enabled: input.enabled
3757
+ } : input;
3772
3758
  const result = await c64Session.breakpointSet(normalizedInput);
3773
3759
  return {
3774
3760
  breakpoint: normalizeBreakpoint(result.breakpoint),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c64-debug-mcp",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Model Context Protocol server for C64 debugging via VICE emulator",
5
5
  "type": "module",
6
6
  "keywords": [