c64-debug-mcp 1.0.12 → 1.0.13

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
@@ -3636,40 +3636,35 @@ var setRegistersTool = createViceTool({
3636
3636
  });
3637
3637
  var readMemoryTool = createViceTool({
3638
3638
  id: "memory_read",
3639
- description: "Reads a memory chunk. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3640
- inputSchema: import_zod4.z.union([
3641
- import_zod4.z.object({
3642
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
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"]
3647
- }),
3648
- import_zod4.z.object({
3649
- start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
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"]
3657
- })
3658
- ]),
3639
+ description: "Reads a memory chunk. Specify start_address and either data_length or end_address. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3640
+ inputSchema: import_zod4.z.object({
3641
+ start_address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3642
+ data_length: import_zod4.z.number().int().positive().max(65535).optional().describe("Number of bytes to read (use either data_length or end_address)"),
3643
+ end_address: address16Schema.optional().describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000). Use either data_length or end_address.")
3644
+ }),
3659
3645
  dataSchema: import_zod4.z.object({
3660
- address: import_zod4.z.number().int().min(0).max(65535).describe("Start address of the returned memory chunk"),
3646
+ address: address16Schema.describe("Start address of the returned memory chunk"),
3661
3647
  length: import_zod4.z.number().int().min(0).describe("Number of bytes returned"),
3662
3648
  data: byteArraySchema.describe("Raw bytes returned from memory")
3663
3649
  }),
3664
3650
  execute: async (input) => {
3665
- let address;
3651
+ const address = input.start_address;
3666
3652
  let length;
3667
- if ("start" in input && "end" in input) {
3668
- address = input.start;
3669
- length = input.end - input.start + 1;
3653
+ if (input.end_address !== void 0) {
3654
+ if (address > input.end_address) {
3655
+ throw new Error("End address must be greater than or equal to start address");
3656
+ }
3657
+ if (input.end_address >= 65536) {
3658
+ throw new Error("End address must stay within the 64K address space");
3659
+ }
3660
+ length = input.end_address - address + 1;
3661
+ } else if (input.data_length !== void 0) {
3662
+ length = input.data_length;
3663
+ if (address + length > 65536) {
3664
+ throw new Error("address + length must stay within the 64K address space");
3665
+ }
3670
3666
  } else {
3671
- address = input.address;
3672
- length = input.length;
3667
+ throw new Error("Must provide either data_length or end_address");
3673
3668
  }
3674
3669
  const result = await c64Session.readMemory(address, address + length - 1);
3675
3670
  return {
@@ -3691,7 +3686,7 @@ var writeMemoryTool = createViceTool({
3691
3686
  }),
3692
3687
  dataSchema: import_zod4.z.object({
3693
3688
  worked: import_zod4.z.boolean().describe("Whether the write operation completed successfully"),
3694
- address: import_zod4.z.number().int().min(0).max(65535).describe("Start address where the bytes were written"),
3689
+ address: address16Schema.describe("Start address where the bytes were written"),
3695
3690
  length: import_zod4.z.number().int().min(1).describe("Number of bytes written")
3696
3691
  }).extend(debugStateSchema.shape),
3697
3692
  execute: async (input) => await c64Session.writeMemory(input.address, input.data)
@@ -3740,47 +3735,44 @@ var listBreakpointsTool = createViceTool({
3740
3735
  });
3741
3736
  var breakpointSetTool = createViceTool({
3742
3737
  id: "breakpoint_set",
3743
- description: "Creates an execution breakpoint or read/write watchpoint. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3744
- inputSchema: import_zod4.z.union([
3745
- import_zod4.z.object({
3746
- kind: breakpointKindSchema,
3747
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3748
- length: import_zod4.z.number().int().positive().default(1).describe("Size of the breakpoint range in bytes"),
3749
- condition: import_zod4.z.string().optional(),
3750
- label: import_zod4.z.string().optional(),
3751
- temporary: import_zod4.z.boolean().default(false),
3752
- enabled: import_zod4.z.boolean().default(true)
3753
- }),
3754
- import_zod4.z.object({
3755
- kind: breakpointKindSchema,
3756
- start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3757
- end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3758
- condition: import_zod4.z.string().optional(),
3759
- label: import_zod4.z.string().optional(),
3760
- temporary: import_zod4.z.boolean().default(false),
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"]
3765
- })
3766
- ]),
3738
+ description: "Creates an execution breakpoint or read/write watchpoint. Specify start_address and either data_length or end_address. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3739
+ inputSchema: import_zod4.z.object({
3740
+ kind: breakpointKindSchema,
3741
+ start_address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3742
+ data_length: import_zod4.z.number().int().positive().default(1).describe("Size of the breakpoint range in bytes (use either data_length or end_address)"),
3743
+ end_address: address16Schema.optional().describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000). Use either data_length or end_address."),
3744
+ condition: import_zod4.z.string().optional(),
3745
+ label: import_zod4.z.string().optional(),
3746
+ temporary: import_zod4.z.boolean().default(false),
3747
+ enabled: import_zod4.z.boolean().default(true)
3748
+ }),
3767
3749
  dataSchema: import_zod4.z.object({
3768
3750
  breakpoint: breakpointSchema,
3769
3751
  executionState: executionStateSchema,
3770
3752
  lastStopReason: stopReasonSchema,
3771
- programCounter: import_zod4.z.number().int().min(0).max(65535).nullable(),
3753
+ programCounter: address16Schema.nullable(),
3772
3754
  registers: c64PartialRegisterValueSchema.nullable()
3773
3755
  }),
3774
3756
  execute: async (input) => {
3775
- const normalizedInput = "start" in input && "end" in input ? {
3757
+ const address = input.start_address;
3758
+ let length;
3759
+ if (input.end_address !== void 0) {
3760
+ if (address > input.end_address) {
3761
+ throw new Error("End address must be greater than or equal to start address");
3762
+ }
3763
+ length = input.end_address - address + 1;
3764
+ } else {
3765
+ length = input.data_length;
3766
+ }
3767
+ const normalizedInput = {
3776
3768
  kind: input.kind,
3777
- address: input.start,
3778
- length: input.end - input.start + 1,
3769
+ address,
3770
+ length,
3779
3771
  condition: input.condition,
3780
3772
  label: input.label,
3781
3773
  temporary: input.temporary,
3782
3774
  enabled: input.enabled
3783
- } : input;
3775
+ };
3784
3776
  const result = await c64Session.breakpointSet(normalizedInput);
3785
3777
  return {
3786
3778
  breakpoint: normalizeBreakpoint(result.breakpoint),
package/dist/http.js CHANGED
@@ -3613,40 +3613,35 @@ var setRegistersTool = createViceTool({
3613
3613
  });
3614
3614
  var readMemoryTool = createViceTool({
3615
3615
  id: "memory_read",
3616
- description: "Reads a memory chunk. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3617
- inputSchema: z3.union([
3618
- z3.object({
3619
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
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"]
3624
- }),
3625
- z3.object({
3626
- start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
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"]
3634
- })
3635
- ]),
3616
+ description: "Reads a memory chunk. Specify start_address and either data_length or end_address. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3617
+ inputSchema: z3.object({
3618
+ start_address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3619
+ data_length: z3.number().int().positive().max(65535).optional().describe("Number of bytes to read (use either data_length or end_address)"),
3620
+ end_address: address16Schema.optional().describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000). Use either data_length or end_address.")
3621
+ }),
3636
3622
  dataSchema: z3.object({
3637
- address: z3.number().int().min(0).max(65535).describe("Start address of the returned memory chunk"),
3623
+ address: address16Schema.describe("Start address of the returned memory chunk"),
3638
3624
  length: z3.number().int().min(0).describe("Number of bytes returned"),
3639
3625
  data: byteArraySchema.describe("Raw bytes returned from memory")
3640
3626
  }),
3641
3627
  execute: async (input) => {
3642
- let address;
3628
+ const address = input.start_address;
3643
3629
  let length;
3644
- if ("start" in input && "end" in input) {
3645
- address = input.start;
3646
- length = input.end - input.start + 1;
3630
+ if (input.end_address !== void 0) {
3631
+ if (address > input.end_address) {
3632
+ throw new Error("End address must be greater than or equal to start address");
3633
+ }
3634
+ if (input.end_address >= 65536) {
3635
+ throw new Error("End address must stay within the 64K address space");
3636
+ }
3637
+ length = input.end_address - address + 1;
3638
+ } else if (input.data_length !== void 0) {
3639
+ length = input.data_length;
3640
+ if (address + length > 65536) {
3641
+ throw new Error("address + length must stay within the 64K address space");
3642
+ }
3647
3643
  } else {
3648
- address = input.address;
3649
- length = input.length;
3644
+ throw new Error("Must provide either data_length or end_address");
3650
3645
  }
3651
3646
  const result = await c64Session.readMemory(address, address + length - 1);
3652
3647
  return {
@@ -3668,7 +3663,7 @@ var writeMemoryTool = createViceTool({
3668
3663
  }),
3669
3664
  dataSchema: z3.object({
3670
3665
  worked: z3.boolean().describe("Whether the write operation completed successfully"),
3671
- address: z3.number().int().min(0).max(65535).describe("Start address where the bytes were written"),
3666
+ address: address16Schema.describe("Start address where the bytes were written"),
3672
3667
  length: z3.number().int().min(1).describe("Number of bytes written")
3673
3668
  }).extend(debugStateSchema.shape),
3674
3669
  execute: async (input) => await c64Session.writeMemory(input.address, input.data)
@@ -3717,47 +3712,44 @@ var listBreakpointsTool = createViceTool({
3717
3712
  });
3718
3713
  var breakpointSetTool = createViceTool({
3719
3714
  id: "breakpoint_set",
3720
- description: "Creates an execution breakpoint or read/write watchpoint. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3721
- inputSchema: z3.union([
3722
- z3.object({
3723
- kind: breakpointKindSchema,
3724
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3725
- length: z3.number().int().positive().default(1).describe("Size of the breakpoint range in bytes"),
3726
- condition: z3.string().optional(),
3727
- label: z3.string().optional(),
3728
- temporary: z3.boolean().default(false),
3729
- enabled: z3.boolean().default(true)
3730
- }),
3731
- z3.object({
3732
- kind: breakpointKindSchema,
3733
- start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3734
- end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3735
- condition: z3.string().optional(),
3736
- label: z3.string().optional(),
3737
- temporary: z3.boolean().default(false),
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"]
3742
- })
3743
- ]),
3715
+ description: "Creates an execution breakpoint or read/write watchpoint. Specify start_address and either data_length or end_address. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3716
+ inputSchema: z3.object({
3717
+ kind: breakpointKindSchema,
3718
+ start_address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3719
+ data_length: z3.number().int().positive().default(1).describe("Size of the breakpoint range in bytes (use either data_length or end_address)"),
3720
+ end_address: address16Schema.optional().describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000). Use either data_length or end_address."),
3721
+ condition: z3.string().optional(),
3722
+ label: z3.string().optional(),
3723
+ temporary: z3.boolean().default(false),
3724
+ enabled: z3.boolean().default(true)
3725
+ }),
3744
3726
  dataSchema: z3.object({
3745
3727
  breakpoint: breakpointSchema,
3746
3728
  executionState: executionStateSchema,
3747
3729
  lastStopReason: stopReasonSchema,
3748
- programCounter: z3.number().int().min(0).max(65535).nullable(),
3730
+ programCounter: address16Schema.nullable(),
3749
3731
  registers: c64PartialRegisterValueSchema.nullable()
3750
3732
  }),
3751
3733
  execute: async (input) => {
3752
- const normalizedInput = "start" in input && "end" in input ? {
3734
+ const address = input.start_address;
3735
+ let length;
3736
+ if (input.end_address !== void 0) {
3737
+ if (address > input.end_address) {
3738
+ throw new Error("End address must be greater than or equal to start address");
3739
+ }
3740
+ length = input.end_address - address + 1;
3741
+ } else {
3742
+ length = input.data_length;
3743
+ }
3744
+ const normalizedInput = {
3753
3745
  kind: input.kind,
3754
- address: input.start,
3755
- length: input.end - input.start + 1,
3746
+ address,
3747
+ length,
3756
3748
  condition: input.condition,
3757
3749
  label: input.label,
3758
3750
  temporary: input.temporary,
3759
3751
  enabled: input.enabled
3760
- } : input;
3752
+ };
3761
3753
  const result = await c64Session.breakpointSet(normalizedInput);
3762
3754
  return {
3763
3755
  breakpoint: normalizeBreakpoint(result.breakpoint),
package/dist/stdio.cjs CHANGED
@@ -3633,40 +3633,35 @@ var setRegistersTool = createViceTool({
3633
3633
  });
3634
3634
  var readMemoryTool = createViceTool({
3635
3635
  id: "memory_read",
3636
- description: "Reads a memory chunk. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3637
- inputSchema: import_zod4.z.union([
3638
- import_zod4.z.object({
3639
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
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"]
3644
- }),
3645
- import_zod4.z.object({
3646
- start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
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"]
3654
- })
3655
- ]),
3636
+ description: "Reads a memory chunk. Specify start_address and either data_length or end_address. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3637
+ inputSchema: import_zod4.z.object({
3638
+ start_address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3639
+ data_length: import_zod4.z.number().int().positive().max(65535).optional().describe("Number of bytes to read (use either data_length or end_address)"),
3640
+ end_address: address16Schema.optional().describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000). Use either data_length or end_address.")
3641
+ }),
3656
3642
  dataSchema: import_zod4.z.object({
3657
- address: import_zod4.z.number().int().min(0).max(65535).describe("Start address of the returned memory chunk"),
3643
+ address: address16Schema.describe("Start address of the returned memory chunk"),
3658
3644
  length: import_zod4.z.number().int().min(0).describe("Number of bytes returned"),
3659
3645
  data: byteArraySchema.describe("Raw bytes returned from memory")
3660
3646
  }),
3661
3647
  execute: async (input) => {
3662
- let address;
3648
+ const address = input.start_address;
3663
3649
  let length;
3664
- if ("start" in input && "end" in input) {
3665
- address = input.start;
3666
- length = input.end - input.start + 1;
3650
+ if (input.end_address !== void 0) {
3651
+ if (address > input.end_address) {
3652
+ throw new Error("End address must be greater than or equal to start address");
3653
+ }
3654
+ if (input.end_address >= 65536) {
3655
+ throw new Error("End address must stay within the 64K address space");
3656
+ }
3657
+ length = input.end_address - address + 1;
3658
+ } else if (input.data_length !== void 0) {
3659
+ length = input.data_length;
3660
+ if (address + length > 65536) {
3661
+ throw new Error("address + length must stay within the 64K address space");
3662
+ }
3667
3663
  } else {
3668
- address = input.address;
3669
- length = input.length;
3664
+ throw new Error("Must provide either data_length or end_address");
3670
3665
  }
3671
3666
  const result = await c64Session.readMemory(address, address + length - 1);
3672
3667
  return {
@@ -3688,7 +3683,7 @@ var writeMemoryTool = createViceTool({
3688
3683
  }),
3689
3684
  dataSchema: import_zod4.z.object({
3690
3685
  worked: import_zod4.z.boolean().describe("Whether the write operation completed successfully"),
3691
- address: import_zod4.z.number().int().min(0).max(65535).describe("Start address where the bytes were written"),
3686
+ address: address16Schema.describe("Start address where the bytes were written"),
3692
3687
  length: import_zod4.z.number().int().min(1).describe("Number of bytes written")
3693
3688
  }).extend(debugStateSchema.shape),
3694
3689
  execute: async (input) => await c64Session.writeMemory(input.address, input.data)
@@ -3737,47 +3732,44 @@ var listBreakpointsTool = createViceTool({
3737
3732
  });
3738
3733
  var breakpointSetTool = createViceTool({
3739
3734
  id: "breakpoint_set",
3740
- description: "Creates an execution breakpoint or read/write watchpoint. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3741
- inputSchema: import_zod4.z.union([
3742
- import_zod4.z.object({
3743
- kind: breakpointKindSchema,
3744
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3745
- length: import_zod4.z.number().int().positive().default(1).describe("Size of the breakpoint range in bytes"),
3746
- condition: import_zod4.z.string().optional(),
3747
- label: import_zod4.z.string().optional(),
3748
- temporary: import_zod4.z.boolean().default(false),
3749
- enabled: import_zod4.z.boolean().default(true)
3750
- }),
3751
- import_zod4.z.object({
3752
- kind: breakpointKindSchema,
3753
- start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3754
- end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3755
- condition: import_zod4.z.string().optional(),
3756
- label: import_zod4.z.string().optional(),
3757
- temporary: import_zod4.z.boolean().default(false),
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"]
3762
- })
3763
- ]),
3735
+ description: "Creates an execution breakpoint or read/write watchpoint. Specify start_address and either data_length or end_address. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3736
+ inputSchema: import_zod4.z.object({
3737
+ kind: breakpointKindSchema,
3738
+ start_address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3739
+ data_length: import_zod4.z.number().int().positive().default(1).describe("Size of the breakpoint range in bytes (use either data_length or end_address)"),
3740
+ end_address: address16Schema.optional().describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000). Use either data_length or end_address."),
3741
+ condition: import_zod4.z.string().optional(),
3742
+ label: import_zod4.z.string().optional(),
3743
+ temporary: import_zod4.z.boolean().default(false),
3744
+ enabled: import_zod4.z.boolean().default(true)
3745
+ }),
3764
3746
  dataSchema: import_zod4.z.object({
3765
3747
  breakpoint: breakpointSchema,
3766
3748
  executionState: executionStateSchema,
3767
3749
  lastStopReason: stopReasonSchema,
3768
- programCounter: import_zod4.z.number().int().min(0).max(65535).nullable(),
3750
+ programCounter: address16Schema.nullable(),
3769
3751
  registers: c64PartialRegisterValueSchema.nullable()
3770
3752
  }),
3771
3753
  execute: async (input) => {
3772
- const normalizedInput = "start" in input && "end" in input ? {
3754
+ const address = input.start_address;
3755
+ let length;
3756
+ if (input.end_address !== void 0) {
3757
+ if (address > input.end_address) {
3758
+ throw new Error("End address must be greater than or equal to start address");
3759
+ }
3760
+ length = input.end_address - address + 1;
3761
+ } else {
3762
+ length = input.data_length;
3763
+ }
3764
+ const normalizedInput = {
3773
3765
  kind: input.kind,
3774
- address: input.start,
3775
- length: input.end - input.start + 1,
3766
+ address,
3767
+ length,
3776
3768
  condition: input.condition,
3777
3769
  label: input.label,
3778
3770
  temporary: input.temporary,
3779
3771
  enabled: input.enabled
3780
- } : input;
3772
+ };
3781
3773
  const result = await c64Session.breakpointSet(normalizedInput);
3782
3774
  return {
3783
3775
  breakpoint: normalizeBreakpoint(result.breakpoint),
package/dist/stdio.js CHANGED
@@ -3610,40 +3610,35 @@ var setRegistersTool = createViceTool({
3610
3610
  });
3611
3611
  var readMemoryTool = createViceTool({
3612
3612
  id: "memory_read",
3613
- description: "Reads a memory chunk. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3614
- inputSchema: z3.union([
3615
- z3.object({
3616
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
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"]
3621
- }),
3622
- z3.object({
3623
- start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
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"]
3631
- })
3632
- ]),
3613
+ description: "Reads a memory chunk. Specify start_address and either data_length or end_address. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3614
+ inputSchema: z3.object({
3615
+ start_address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3616
+ data_length: z3.number().int().positive().max(65535).optional().describe("Number of bytes to read (use either data_length or end_address)"),
3617
+ end_address: address16Schema.optional().describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000). Use either data_length or end_address.")
3618
+ }),
3633
3619
  dataSchema: z3.object({
3634
- address: z3.number().int().min(0).max(65535).describe("Start address of the returned memory chunk"),
3620
+ address: address16Schema.describe("Start address of the returned memory chunk"),
3635
3621
  length: z3.number().int().min(0).describe("Number of bytes returned"),
3636
3622
  data: byteArraySchema.describe("Raw bytes returned from memory")
3637
3623
  }),
3638
3624
  execute: async (input) => {
3639
- let address;
3625
+ const address = input.start_address;
3640
3626
  let length;
3641
- if ("start" in input && "end" in input) {
3642
- address = input.start;
3643
- length = input.end - input.start + 1;
3627
+ if (input.end_address !== void 0) {
3628
+ if (address > input.end_address) {
3629
+ throw new Error("End address must be greater than or equal to start address");
3630
+ }
3631
+ if (input.end_address >= 65536) {
3632
+ throw new Error("End address must stay within the 64K address space");
3633
+ }
3634
+ length = input.end_address - address + 1;
3635
+ } else if (input.data_length !== void 0) {
3636
+ length = input.data_length;
3637
+ if (address + length > 65536) {
3638
+ throw new Error("address + length must stay within the 64K address space");
3639
+ }
3644
3640
  } else {
3645
- address = input.address;
3646
- length = input.length;
3641
+ throw new Error("Must provide either data_length or end_address");
3647
3642
  }
3648
3643
  const result = await c64Session.readMemory(address, address + length - 1);
3649
3644
  return {
@@ -3665,7 +3660,7 @@ var writeMemoryTool = createViceTool({
3665
3660
  }),
3666
3661
  dataSchema: z3.object({
3667
3662
  worked: z3.boolean().describe("Whether the write operation completed successfully"),
3668
- address: z3.number().int().min(0).max(65535).describe("Start address where the bytes were written"),
3663
+ address: address16Schema.describe("Start address where the bytes were written"),
3669
3664
  length: z3.number().int().min(1).describe("Number of bytes written")
3670
3665
  }).extend(debugStateSchema.shape),
3671
3666
  execute: async (input) => await c64Session.writeMemory(input.address, input.data)
@@ -3714,47 +3709,44 @@ var listBreakpointsTool = createViceTool({
3714
3709
  });
3715
3710
  var breakpointSetTool = createViceTool({
3716
3711
  id: "breakpoint_set",
3717
- description: "Creates an execution breakpoint or read/write watchpoint. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3718
- inputSchema: z3.union([
3719
- z3.object({
3720
- kind: breakpointKindSchema,
3721
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3722
- length: z3.number().int().positive().default(1).describe("Size of the breakpoint range in bytes"),
3723
- condition: z3.string().optional(),
3724
- label: z3.string().optional(),
3725
- temporary: z3.boolean().default(false),
3726
- enabled: z3.boolean().default(true)
3727
- }),
3728
- z3.object({
3729
- kind: breakpointKindSchema,
3730
- start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3731
- end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3732
- condition: z3.string().optional(),
3733
- label: z3.string().optional(),
3734
- temporary: z3.boolean().default(false),
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"]
3739
- })
3740
- ]),
3712
+ description: "Creates an execution breakpoint or read/write watchpoint. Specify start_address and either data_length or end_address. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3713
+ inputSchema: z3.object({
3714
+ kind: breakpointKindSchema,
3715
+ start_address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3716
+ data_length: z3.number().int().positive().default(1).describe("Size of the breakpoint range in bytes (use either data_length or end_address)"),
3717
+ end_address: address16Schema.optional().describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000). Use either data_length or end_address."),
3718
+ condition: z3.string().optional(),
3719
+ label: z3.string().optional(),
3720
+ temporary: z3.boolean().default(false),
3721
+ enabled: z3.boolean().default(true)
3722
+ }),
3741
3723
  dataSchema: z3.object({
3742
3724
  breakpoint: breakpointSchema,
3743
3725
  executionState: executionStateSchema,
3744
3726
  lastStopReason: stopReasonSchema,
3745
- programCounter: z3.number().int().min(0).max(65535).nullable(),
3727
+ programCounter: address16Schema.nullable(),
3746
3728
  registers: c64PartialRegisterValueSchema.nullable()
3747
3729
  }),
3748
3730
  execute: async (input) => {
3749
- const normalizedInput = "start" in input && "end" in input ? {
3731
+ const address = input.start_address;
3732
+ let length;
3733
+ if (input.end_address !== void 0) {
3734
+ if (address > input.end_address) {
3735
+ throw new Error("End address must be greater than or equal to start address");
3736
+ }
3737
+ length = input.end_address - address + 1;
3738
+ } else {
3739
+ length = input.data_length;
3740
+ }
3741
+ const normalizedInput = {
3750
3742
  kind: input.kind,
3751
- address: input.start,
3752
- length: input.end - input.start + 1,
3743
+ address,
3744
+ length,
3753
3745
  condition: input.condition,
3754
3746
  label: input.label,
3755
3747
  temporary: input.temporary,
3756
3748
  enabled: input.enabled
3757
- } : input;
3749
+ };
3758
3750
  const result = await c64Session.breakpointSet(normalizedInput);
3759
3751
  return {
3760
3752
  breakpoint: normalizeBreakpoint(result.breakpoint),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c64-debug-mcp",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Model Context Protocol server for C64 debugging via VICE emulator",
5
5
  "type": "module",
6
6
  "keywords": [