c64-debug-mcp 1.0.11 → 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 +52 -82
- package/dist/http.js +52 -82
- package/dist/stdio.cjs +52 -82
- package/dist/stdio.js +52 -82
- package/package.json +1 -1
package/dist/http.cjs
CHANGED
|
@@ -213,7 +213,7 @@ function parseAddress16(input) {
|
|
|
213
213
|
}
|
|
214
214
|
return parsed;
|
|
215
215
|
}
|
|
216
|
-
var address16Schema = import_zod2.z.
|
|
216
|
+
var address16Schema = import_zod2.z.preprocess(parseAddress16, import_zod2.z.number().int().min(0).max(65535)).describe("16-bit C64 address: decimal (53248) or hex string with prefix ($D000, 0xD000)");
|
|
217
217
|
function parseByte(input) {
|
|
218
218
|
if (typeof input === "number") {
|
|
219
219
|
if (!Number.isInteger(input) || input < 0 || input > 255) {
|
|
@@ -337,7 +337,7 @@ function parseByte(input) {
|
|
|
337
337
|
}
|
|
338
338
|
]);
|
|
339
339
|
}
|
|
340
|
-
var byteValueSchema = import_zod2.z.
|
|
340
|
+
var byteValueSchema = import_zod2.z.preprocess(parseByte, import_zod2.z.number().int().min(0).max(255)).describe("8-bit byte value: decimal (255), hex with prefix ($FF, 0xFF), or binary with prefix (%11111111, 0b11111111)");
|
|
341
341
|
var byteArraySchema = import_zod2.z.array(byteValueSchema).describe('Array of byte values in mixed formats: [255, "$FF", "%11111111", 42]');
|
|
342
342
|
var c64RegisterValueSchema = import_zod2.z.object(
|
|
343
343
|
Object.fromEntries(
|
|
@@ -3636,41 +3636,35 @@ var setRegistersTool = createViceTool({
|
|
|
3636
3636
|
});
|
|
3637
3637
|
var readMemoryTool = createViceTool({
|
|
3638
3638
|
id: "memory_read",
|
|
3639
|
-
description: "Reads a memory chunk.
|
|
3640
|
-
inputSchema: import_zod4.z.
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
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
|
-
})
|
|
3649
|
-
]),
|
|
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
|
+
}),
|
|
3650
3645
|
dataSchema: import_zod4.z.object({
|
|
3651
3646
|
address: address16Schema.describe("Start address of the returned memory chunk"),
|
|
3652
3647
|
length: import_zod4.z.number().int().min(0).describe("Number of bytes returned"),
|
|
3653
3648
|
data: byteArraySchema.describe("Raw bytes returned from memory")
|
|
3654
3649
|
}),
|
|
3655
3650
|
execute: async (input) => {
|
|
3656
|
-
|
|
3651
|
+
const address = input.start_address;
|
|
3657
3652
|
let length;
|
|
3658
|
-
if (
|
|
3659
|
-
|
|
3660
|
-
const end = parseAddress16(input.end);
|
|
3661
|
-
if (end < start) {
|
|
3653
|
+
if (input.end_address !== void 0) {
|
|
3654
|
+
if (address > input.end_address) {
|
|
3662
3655
|
throw new Error("End address must be greater than or equal to start address");
|
|
3663
3656
|
}
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
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
|
+
}
|
|
3669
3666
|
} else {
|
|
3670
|
-
throw new Error("
|
|
3671
|
-
}
|
|
3672
|
-
if (address + length > 65536) {
|
|
3673
|
-
throw new Error("address + length must stay within the 64K address space");
|
|
3667
|
+
throw new Error("Must provide either data_length or end_address");
|
|
3674
3668
|
}
|
|
3675
3669
|
const result = await c64Session.readMemory(address, address + length - 1);
|
|
3676
3670
|
return {
|
|
@@ -3686,20 +3680,16 @@ var writeMemoryTool = createViceTool({
|
|
|
3686
3680
|
inputSchema: import_zod4.z.object({
|
|
3687
3681
|
address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
|
|
3688
3682
|
data: byteArraySchema.min(1).describe("Bytes to write: decimal (255), hex ($FF, 0xFF), or binary (%11111111, 0b11111111). Mixed formats allowed.")
|
|
3683
|
+
}).refine((input) => input.address + input.data.length - 1 <= 65535, {
|
|
3684
|
+
message: "address + data.length must stay within the 16-bit address space",
|
|
3685
|
+
path: ["data"]
|
|
3689
3686
|
}),
|
|
3690
3687
|
dataSchema: import_zod4.z.object({
|
|
3691
3688
|
worked: import_zod4.z.boolean().describe("Whether the write operation completed successfully"),
|
|
3692
|
-
address:
|
|
3689
|
+
address: address16Schema.describe("Start address where the bytes were written"),
|
|
3693
3690
|
length: import_zod4.z.number().int().min(1).describe("Number of bytes written")
|
|
3694
3691
|
}).extend(debugStateSchema.shape),
|
|
3695
|
-
execute: async (input) =>
|
|
3696
|
-
const address = parseAddress16(input.address);
|
|
3697
|
-
const data = input.data.map((b) => parseByte(b));
|
|
3698
|
-
if (address + data.length - 1 > 65535) {
|
|
3699
|
-
throw new Error("address + data.length must stay within the 16-bit address space");
|
|
3700
|
-
}
|
|
3701
|
-
return await c64Session.writeMemory(address, data);
|
|
3702
|
-
}
|
|
3692
|
+
execute: async (input) => await c64Session.writeMemory(input.address, input.data)
|
|
3703
3693
|
});
|
|
3704
3694
|
var executeTool = createViceTool({
|
|
3705
3695
|
id: "execute",
|
|
@@ -3745,27 +3735,17 @@ var listBreakpointsTool = createViceTool({
|
|
|
3745
3735
|
});
|
|
3746
3736
|
var breakpointSetTool = createViceTool({
|
|
3747
3737
|
id: "breakpoint_set",
|
|
3748
|
-
description: "Creates an execution breakpoint or read/write watchpoint.
|
|
3749
|
-
inputSchema: import_zod4.z.
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
import_zod4.z.object({
|
|
3760
|
-
kind: breakpointKindSchema,
|
|
3761
|
-
start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
|
|
3762
|
-
end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
|
|
3763
|
-
condition: import_zod4.z.string().optional(),
|
|
3764
|
-
label: import_zod4.z.string().optional(),
|
|
3765
|
-
temporary: import_zod4.z.boolean().default(false),
|
|
3766
|
-
enabled: import_zod4.z.boolean().default(true)
|
|
3767
|
-
})
|
|
3768
|
-
]),
|
|
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
|
+
}),
|
|
3769
3749
|
dataSchema: import_zod4.z.object({
|
|
3770
3750
|
breakpoint: breakpointSchema,
|
|
3771
3751
|
executionState: executionStateSchema,
|
|
@@ -3774,35 +3754,25 @@ var breakpointSetTool = createViceTool({
|
|
|
3774
3754
|
registers: c64PartialRegisterValueSchema.nullable()
|
|
3775
3755
|
}),
|
|
3776
3756
|
execute: async (input) => {
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
if (end < start) {
|
|
3757
|
+
const address = input.start_address;
|
|
3758
|
+
let length;
|
|
3759
|
+
if (input.end_address !== void 0) {
|
|
3760
|
+
if (address > input.end_address) {
|
|
3782
3761
|
throw new Error("End address must be greater than or equal to start address");
|
|
3783
3762
|
}
|
|
3784
|
-
|
|
3785
|
-
kind: input.kind,
|
|
3786
|
-
address: start,
|
|
3787
|
-
length: end - start + 1,
|
|
3788
|
-
condition: input.condition,
|
|
3789
|
-
label: input.label,
|
|
3790
|
-
temporary: input.temporary,
|
|
3791
|
-
enabled: input.enabled
|
|
3792
|
-
};
|
|
3793
|
-
} else if ("address" in input && "length" in input) {
|
|
3794
|
-
normalizedInput = {
|
|
3795
|
-
kind: input.kind,
|
|
3796
|
-
address: parseAddress16(input.address),
|
|
3797
|
-
length: input.length,
|
|
3798
|
-
condition: input.condition,
|
|
3799
|
-
label: input.label,
|
|
3800
|
-
temporary: input.temporary,
|
|
3801
|
-
enabled: input.enabled
|
|
3802
|
-
};
|
|
3763
|
+
length = input.end_address - address + 1;
|
|
3803
3764
|
} else {
|
|
3804
|
-
|
|
3765
|
+
length = input.data_length;
|
|
3805
3766
|
}
|
|
3767
|
+
const normalizedInput = {
|
|
3768
|
+
kind: input.kind,
|
|
3769
|
+
address,
|
|
3770
|
+
length,
|
|
3771
|
+
condition: input.condition,
|
|
3772
|
+
label: input.label,
|
|
3773
|
+
temporary: input.temporary,
|
|
3774
|
+
enabled: input.enabled
|
|
3775
|
+
};
|
|
3806
3776
|
const result = await c64Session.breakpointSet(normalizedInput);
|
|
3807
3777
|
return {
|
|
3808
3778
|
breakpoint: normalizeBreakpoint(result.breakpoint),
|
package/dist/http.js
CHANGED
|
@@ -190,7 +190,7 @@ function parseAddress16(input) {
|
|
|
190
190
|
}
|
|
191
191
|
return parsed;
|
|
192
192
|
}
|
|
193
|
-
var address16Schema = z2.
|
|
193
|
+
var address16Schema = z2.preprocess(parseAddress16, z2.number().int().min(0).max(65535)).describe("16-bit C64 address: decimal (53248) or hex string with prefix ($D000, 0xD000)");
|
|
194
194
|
function parseByte(input) {
|
|
195
195
|
if (typeof input === "number") {
|
|
196
196
|
if (!Number.isInteger(input) || input < 0 || input > 255) {
|
|
@@ -314,7 +314,7 @@ function parseByte(input) {
|
|
|
314
314
|
}
|
|
315
315
|
]);
|
|
316
316
|
}
|
|
317
|
-
var byteValueSchema = z2.
|
|
317
|
+
var byteValueSchema = z2.preprocess(parseByte, z2.number().int().min(0).max(255)).describe("8-bit byte value: decimal (255), hex with prefix ($FF, 0xFF), or binary with prefix (%11111111, 0b11111111)");
|
|
318
318
|
var byteArraySchema = z2.array(byteValueSchema).describe('Array of byte values in mixed formats: [255, "$FF", "%11111111", 42]');
|
|
319
319
|
var c64RegisterValueSchema = z2.object(
|
|
320
320
|
Object.fromEntries(
|
|
@@ -3613,41 +3613,35 @@ var setRegistersTool = createViceTool({
|
|
|
3613
3613
|
});
|
|
3614
3614
|
var readMemoryTool = createViceTool({
|
|
3615
3615
|
id: "memory_read",
|
|
3616
|
-
description: "Reads a memory chunk.
|
|
3617
|
-
inputSchema: z3.
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
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
|
-
})
|
|
3626
|
-
]),
|
|
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
|
+
}),
|
|
3627
3622
|
dataSchema: z3.object({
|
|
3628
3623
|
address: address16Schema.describe("Start address of the returned memory chunk"),
|
|
3629
3624
|
length: z3.number().int().min(0).describe("Number of bytes returned"),
|
|
3630
3625
|
data: byteArraySchema.describe("Raw bytes returned from memory")
|
|
3631
3626
|
}),
|
|
3632
3627
|
execute: async (input) => {
|
|
3633
|
-
|
|
3628
|
+
const address = input.start_address;
|
|
3634
3629
|
let length;
|
|
3635
|
-
if (
|
|
3636
|
-
|
|
3637
|
-
const end = parseAddress16(input.end);
|
|
3638
|
-
if (end < start) {
|
|
3630
|
+
if (input.end_address !== void 0) {
|
|
3631
|
+
if (address > input.end_address) {
|
|
3639
3632
|
throw new Error("End address must be greater than or equal to start address");
|
|
3640
3633
|
}
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
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
|
+
}
|
|
3646
3643
|
} else {
|
|
3647
|
-
throw new Error("
|
|
3648
|
-
}
|
|
3649
|
-
if (address + length > 65536) {
|
|
3650
|
-
throw new Error("address + length must stay within the 64K address space");
|
|
3644
|
+
throw new Error("Must provide either data_length or end_address");
|
|
3651
3645
|
}
|
|
3652
3646
|
const result = await c64Session.readMemory(address, address + length - 1);
|
|
3653
3647
|
return {
|
|
@@ -3663,20 +3657,16 @@ var writeMemoryTool = createViceTool({
|
|
|
3663
3657
|
inputSchema: z3.object({
|
|
3664
3658
|
address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
|
|
3665
3659
|
data: byteArraySchema.min(1).describe("Bytes to write: decimal (255), hex ($FF, 0xFF), or binary (%11111111, 0b11111111). Mixed formats allowed.")
|
|
3660
|
+
}).refine((input) => input.address + input.data.length - 1 <= 65535, {
|
|
3661
|
+
message: "address + data.length must stay within the 16-bit address space",
|
|
3662
|
+
path: ["data"]
|
|
3666
3663
|
}),
|
|
3667
3664
|
dataSchema: z3.object({
|
|
3668
3665
|
worked: z3.boolean().describe("Whether the write operation completed successfully"),
|
|
3669
|
-
address:
|
|
3666
|
+
address: address16Schema.describe("Start address where the bytes were written"),
|
|
3670
3667
|
length: z3.number().int().min(1).describe("Number of bytes written")
|
|
3671
3668
|
}).extend(debugStateSchema.shape),
|
|
3672
|
-
execute: async (input) =>
|
|
3673
|
-
const address = parseAddress16(input.address);
|
|
3674
|
-
const data = input.data.map((b) => parseByte(b));
|
|
3675
|
-
if (address + data.length - 1 > 65535) {
|
|
3676
|
-
throw new Error("address + data.length must stay within the 16-bit address space");
|
|
3677
|
-
}
|
|
3678
|
-
return await c64Session.writeMemory(address, data);
|
|
3679
|
-
}
|
|
3669
|
+
execute: async (input) => await c64Session.writeMemory(input.address, input.data)
|
|
3680
3670
|
});
|
|
3681
3671
|
var executeTool = createViceTool({
|
|
3682
3672
|
id: "execute",
|
|
@@ -3722,27 +3712,17 @@ var listBreakpointsTool = createViceTool({
|
|
|
3722
3712
|
});
|
|
3723
3713
|
var breakpointSetTool = createViceTool({
|
|
3724
3714
|
id: "breakpoint_set",
|
|
3725
|
-
description: "Creates an execution breakpoint or read/write watchpoint.
|
|
3726
|
-
inputSchema: z3.
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
z3.object({
|
|
3737
|
-
kind: breakpointKindSchema,
|
|
3738
|
-
start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
|
|
3739
|
-
end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
|
|
3740
|
-
condition: z3.string().optional(),
|
|
3741
|
-
label: z3.string().optional(),
|
|
3742
|
-
temporary: z3.boolean().default(false),
|
|
3743
|
-
enabled: z3.boolean().default(true)
|
|
3744
|
-
})
|
|
3745
|
-
]),
|
|
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
|
+
}),
|
|
3746
3726
|
dataSchema: z3.object({
|
|
3747
3727
|
breakpoint: breakpointSchema,
|
|
3748
3728
|
executionState: executionStateSchema,
|
|
@@ -3751,35 +3731,25 @@ var breakpointSetTool = createViceTool({
|
|
|
3751
3731
|
registers: c64PartialRegisterValueSchema.nullable()
|
|
3752
3732
|
}),
|
|
3753
3733
|
execute: async (input) => {
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
if (end < start) {
|
|
3734
|
+
const address = input.start_address;
|
|
3735
|
+
let length;
|
|
3736
|
+
if (input.end_address !== void 0) {
|
|
3737
|
+
if (address > input.end_address) {
|
|
3759
3738
|
throw new Error("End address must be greater than or equal to start address");
|
|
3760
3739
|
}
|
|
3761
|
-
|
|
3762
|
-
kind: input.kind,
|
|
3763
|
-
address: start,
|
|
3764
|
-
length: end - start + 1,
|
|
3765
|
-
condition: input.condition,
|
|
3766
|
-
label: input.label,
|
|
3767
|
-
temporary: input.temporary,
|
|
3768
|
-
enabled: input.enabled
|
|
3769
|
-
};
|
|
3770
|
-
} else if ("address" in input && "length" in input) {
|
|
3771
|
-
normalizedInput = {
|
|
3772
|
-
kind: input.kind,
|
|
3773
|
-
address: parseAddress16(input.address),
|
|
3774
|
-
length: input.length,
|
|
3775
|
-
condition: input.condition,
|
|
3776
|
-
label: input.label,
|
|
3777
|
-
temporary: input.temporary,
|
|
3778
|
-
enabled: input.enabled
|
|
3779
|
-
};
|
|
3740
|
+
length = input.end_address - address + 1;
|
|
3780
3741
|
} else {
|
|
3781
|
-
|
|
3742
|
+
length = input.data_length;
|
|
3782
3743
|
}
|
|
3744
|
+
const normalizedInput = {
|
|
3745
|
+
kind: input.kind,
|
|
3746
|
+
address,
|
|
3747
|
+
length,
|
|
3748
|
+
condition: input.condition,
|
|
3749
|
+
label: input.label,
|
|
3750
|
+
temporary: input.temporary,
|
|
3751
|
+
enabled: input.enabled
|
|
3752
|
+
};
|
|
3783
3753
|
const result = await c64Session.breakpointSet(normalizedInput);
|
|
3784
3754
|
return {
|
|
3785
3755
|
breakpoint: normalizeBreakpoint(result.breakpoint),
|
package/dist/stdio.cjs
CHANGED
|
@@ -210,7 +210,7 @@ function parseAddress16(input) {
|
|
|
210
210
|
}
|
|
211
211
|
return parsed;
|
|
212
212
|
}
|
|
213
|
-
var address16Schema = import_zod2.z.
|
|
213
|
+
var address16Schema = import_zod2.z.preprocess(parseAddress16, import_zod2.z.number().int().min(0).max(65535)).describe("16-bit C64 address: decimal (53248) or hex string with prefix ($D000, 0xD000)");
|
|
214
214
|
function parseByte(input) {
|
|
215
215
|
if (typeof input === "number") {
|
|
216
216
|
if (!Number.isInteger(input) || input < 0 || input > 255) {
|
|
@@ -334,7 +334,7 @@ function parseByte(input) {
|
|
|
334
334
|
}
|
|
335
335
|
]);
|
|
336
336
|
}
|
|
337
|
-
var byteValueSchema = import_zod2.z.
|
|
337
|
+
var byteValueSchema = import_zod2.z.preprocess(parseByte, import_zod2.z.number().int().min(0).max(255)).describe("8-bit byte value: decimal (255), hex with prefix ($FF, 0xFF), or binary with prefix (%11111111, 0b11111111)");
|
|
338
338
|
var byteArraySchema = import_zod2.z.array(byteValueSchema).describe('Array of byte values in mixed formats: [255, "$FF", "%11111111", 42]');
|
|
339
339
|
var c64RegisterValueSchema = import_zod2.z.object(
|
|
340
340
|
Object.fromEntries(
|
|
@@ -3633,41 +3633,35 @@ var setRegistersTool = createViceTool({
|
|
|
3633
3633
|
});
|
|
3634
3634
|
var readMemoryTool = createViceTool({
|
|
3635
3635
|
id: "memory_read",
|
|
3636
|
-
description: "Reads a memory chunk.
|
|
3637
|
-
inputSchema: import_zod4.z.
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
import_zod4.z.object({
|
|
3643
|
-
start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
|
|
3644
|
-
end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)")
|
|
3645
|
-
})
|
|
3646
|
-
]),
|
|
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
|
+
}),
|
|
3647
3642
|
dataSchema: import_zod4.z.object({
|
|
3648
3643
|
address: address16Schema.describe("Start address of the returned memory chunk"),
|
|
3649
3644
|
length: import_zod4.z.number().int().min(0).describe("Number of bytes returned"),
|
|
3650
3645
|
data: byteArraySchema.describe("Raw bytes returned from memory")
|
|
3651
3646
|
}),
|
|
3652
3647
|
execute: async (input) => {
|
|
3653
|
-
|
|
3648
|
+
const address = input.start_address;
|
|
3654
3649
|
let length;
|
|
3655
|
-
if (
|
|
3656
|
-
|
|
3657
|
-
const end = parseAddress16(input.end);
|
|
3658
|
-
if (end < start) {
|
|
3650
|
+
if (input.end_address !== void 0) {
|
|
3651
|
+
if (address > input.end_address) {
|
|
3659
3652
|
throw new Error("End address must be greater than or equal to start address");
|
|
3660
3653
|
}
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
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
|
+
}
|
|
3666
3663
|
} else {
|
|
3667
|
-
throw new Error("
|
|
3668
|
-
}
|
|
3669
|
-
if (address + length > 65536) {
|
|
3670
|
-
throw new Error("address + length must stay within the 64K address space");
|
|
3664
|
+
throw new Error("Must provide either data_length or end_address");
|
|
3671
3665
|
}
|
|
3672
3666
|
const result = await c64Session.readMemory(address, address + length - 1);
|
|
3673
3667
|
return {
|
|
@@ -3683,20 +3677,16 @@ var writeMemoryTool = createViceTool({
|
|
|
3683
3677
|
inputSchema: import_zod4.z.object({
|
|
3684
3678
|
address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
|
|
3685
3679
|
data: byteArraySchema.min(1).describe("Bytes to write: decimal (255), hex ($FF, 0xFF), or binary (%11111111, 0b11111111). Mixed formats allowed.")
|
|
3680
|
+
}).refine((input) => input.address + input.data.length - 1 <= 65535, {
|
|
3681
|
+
message: "address + data.length must stay within the 16-bit address space",
|
|
3682
|
+
path: ["data"]
|
|
3686
3683
|
}),
|
|
3687
3684
|
dataSchema: import_zod4.z.object({
|
|
3688
3685
|
worked: import_zod4.z.boolean().describe("Whether the write operation completed successfully"),
|
|
3689
|
-
address:
|
|
3686
|
+
address: address16Schema.describe("Start address where the bytes were written"),
|
|
3690
3687
|
length: import_zod4.z.number().int().min(1).describe("Number of bytes written")
|
|
3691
3688
|
}).extend(debugStateSchema.shape),
|
|
3692
|
-
execute: async (input) =>
|
|
3693
|
-
const address = parseAddress16(input.address);
|
|
3694
|
-
const data = input.data.map((b) => parseByte(b));
|
|
3695
|
-
if (address + data.length - 1 > 65535) {
|
|
3696
|
-
throw new Error("address + data.length must stay within the 16-bit address space");
|
|
3697
|
-
}
|
|
3698
|
-
return await c64Session.writeMemory(address, data);
|
|
3699
|
-
}
|
|
3689
|
+
execute: async (input) => await c64Session.writeMemory(input.address, input.data)
|
|
3700
3690
|
});
|
|
3701
3691
|
var executeTool = createViceTool({
|
|
3702
3692
|
id: "execute",
|
|
@@ -3742,27 +3732,17 @@ var listBreakpointsTool = createViceTool({
|
|
|
3742
3732
|
});
|
|
3743
3733
|
var breakpointSetTool = createViceTool({
|
|
3744
3734
|
id: "breakpoint_set",
|
|
3745
|
-
description: "Creates an execution breakpoint or read/write watchpoint.
|
|
3746
|
-
inputSchema: import_zod4.z.
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
import_zod4.z.object({
|
|
3757
|
-
kind: breakpointKindSchema,
|
|
3758
|
-
start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
|
|
3759
|
-
end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
|
|
3760
|
-
condition: import_zod4.z.string().optional(),
|
|
3761
|
-
label: import_zod4.z.string().optional(),
|
|
3762
|
-
temporary: import_zod4.z.boolean().default(false),
|
|
3763
|
-
enabled: import_zod4.z.boolean().default(true)
|
|
3764
|
-
})
|
|
3765
|
-
]),
|
|
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
|
+
}),
|
|
3766
3746
|
dataSchema: import_zod4.z.object({
|
|
3767
3747
|
breakpoint: breakpointSchema,
|
|
3768
3748
|
executionState: executionStateSchema,
|
|
@@ -3771,35 +3751,25 @@ var breakpointSetTool = createViceTool({
|
|
|
3771
3751
|
registers: c64PartialRegisterValueSchema.nullable()
|
|
3772
3752
|
}),
|
|
3773
3753
|
execute: async (input) => {
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
if (end < start) {
|
|
3754
|
+
const address = input.start_address;
|
|
3755
|
+
let length;
|
|
3756
|
+
if (input.end_address !== void 0) {
|
|
3757
|
+
if (address > input.end_address) {
|
|
3779
3758
|
throw new Error("End address must be greater than or equal to start address");
|
|
3780
3759
|
}
|
|
3781
|
-
|
|
3782
|
-
kind: input.kind,
|
|
3783
|
-
address: start,
|
|
3784
|
-
length: end - start + 1,
|
|
3785
|
-
condition: input.condition,
|
|
3786
|
-
label: input.label,
|
|
3787
|
-
temporary: input.temporary,
|
|
3788
|
-
enabled: input.enabled
|
|
3789
|
-
};
|
|
3790
|
-
} else if ("address" in input && "length" in input) {
|
|
3791
|
-
normalizedInput = {
|
|
3792
|
-
kind: input.kind,
|
|
3793
|
-
address: parseAddress16(input.address),
|
|
3794
|
-
length: input.length,
|
|
3795
|
-
condition: input.condition,
|
|
3796
|
-
label: input.label,
|
|
3797
|
-
temporary: input.temporary,
|
|
3798
|
-
enabled: input.enabled
|
|
3799
|
-
};
|
|
3760
|
+
length = input.end_address - address + 1;
|
|
3800
3761
|
} else {
|
|
3801
|
-
|
|
3762
|
+
length = input.data_length;
|
|
3802
3763
|
}
|
|
3764
|
+
const normalizedInput = {
|
|
3765
|
+
kind: input.kind,
|
|
3766
|
+
address,
|
|
3767
|
+
length,
|
|
3768
|
+
condition: input.condition,
|
|
3769
|
+
label: input.label,
|
|
3770
|
+
temporary: input.temporary,
|
|
3771
|
+
enabled: input.enabled
|
|
3772
|
+
};
|
|
3803
3773
|
const result = await c64Session.breakpointSet(normalizedInput);
|
|
3804
3774
|
return {
|
|
3805
3775
|
breakpoint: normalizeBreakpoint(result.breakpoint),
|
package/dist/stdio.js
CHANGED
|
@@ -187,7 +187,7 @@ function parseAddress16(input) {
|
|
|
187
187
|
}
|
|
188
188
|
return parsed;
|
|
189
189
|
}
|
|
190
|
-
var address16Schema = z2.
|
|
190
|
+
var address16Schema = z2.preprocess(parseAddress16, z2.number().int().min(0).max(65535)).describe("16-bit C64 address: decimal (53248) or hex string with prefix ($D000, 0xD000)");
|
|
191
191
|
function parseByte(input) {
|
|
192
192
|
if (typeof input === "number") {
|
|
193
193
|
if (!Number.isInteger(input) || input < 0 || input > 255) {
|
|
@@ -311,7 +311,7 @@ function parseByte(input) {
|
|
|
311
311
|
}
|
|
312
312
|
]);
|
|
313
313
|
}
|
|
314
|
-
var byteValueSchema = z2.
|
|
314
|
+
var byteValueSchema = z2.preprocess(parseByte, z2.number().int().min(0).max(255)).describe("8-bit byte value: decimal (255), hex with prefix ($FF, 0xFF), or binary with prefix (%11111111, 0b11111111)");
|
|
315
315
|
var byteArraySchema = z2.array(byteValueSchema).describe('Array of byte values in mixed formats: [255, "$FF", "%11111111", 42]');
|
|
316
316
|
var c64RegisterValueSchema = z2.object(
|
|
317
317
|
Object.fromEntries(
|
|
@@ -3610,41 +3610,35 @@ var setRegistersTool = createViceTool({
|
|
|
3610
3610
|
});
|
|
3611
3611
|
var readMemoryTool = createViceTool({
|
|
3612
3612
|
id: "memory_read",
|
|
3613
|
-
description: "Reads a memory chunk.
|
|
3614
|
-
inputSchema: z3.
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
z3.object({
|
|
3620
|
-
start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
|
|
3621
|
-
end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)")
|
|
3622
|
-
})
|
|
3623
|
-
]),
|
|
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
|
+
}),
|
|
3624
3619
|
dataSchema: z3.object({
|
|
3625
3620
|
address: address16Schema.describe("Start address of the returned memory chunk"),
|
|
3626
3621
|
length: z3.number().int().min(0).describe("Number of bytes returned"),
|
|
3627
3622
|
data: byteArraySchema.describe("Raw bytes returned from memory")
|
|
3628
3623
|
}),
|
|
3629
3624
|
execute: async (input) => {
|
|
3630
|
-
|
|
3625
|
+
const address = input.start_address;
|
|
3631
3626
|
let length;
|
|
3632
|
-
if (
|
|
3633
|
-
|
|
3634
|
-
const end = parseAddress16(input.end);
|
|
3635
|
-
if (end < start) {
|
|
3627
|
+
if (input.end_address !== void 0) {
|
|
3628
|
+
if (address > input.end_address) {
|
|
3636
3629
|
throw new Error("End address must be greater than or equal to start address");
|
|
3637
3630
|
}
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
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
|
+
}
|
|
3643
3640
|
} else {
|
|
3644
|
-
throw new Error("
|
|
3645
|
-
}
|
|
3646
|
-
if (address + length > 65536) {
|
|
3647
|
-
throw new Error("address + length must stay within the 64K address space");
|
|
3641
|
+
throw new Error("Must provide either data_length or end_address");
|
|
3648
3642
|
}
|
|
3649
3643
|
const result = await c64Session.readMemory(address, address + length - 1);
|
|
3650
3644
|
return {
|
|
@@ -3660,20 +3654,16 @@ var writeMemoryTool = createViceTool({
|
|
|
3660
3654
|
inputSchema: z3.object({
|
|
3661
3655
|
address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
|
|
3662
3656
|
data: byteArraySchema.min(1).describe("Bytes to write: decimal (255), hex ($FF, 0xFF), or binary (%11111111, 0b11111111). Mixed formats allowed.")
|
|
3657
|
+
}).refine((input) => input.address + input.data.length - 1 <= 65535, {
|
|
3658
|
+
message: "address + data.length must stay within the 16-bit address space",
|
|
3659
|
+
path: ["data"]
|
|
3663
3660
|
}),
|
|
3664
3661
|
dataSchema: z3.object({
|
|
3665
3662
|
worked: z3.boolean().describe("Whether the write operation completed successfully"),
|
|
3666
|
-
address:
|
|
3663
|
+
address: address16Schema.describe("Start address where the bytes were written"),
|
|
3667
3664
|
length: z3.number().int().min(1).describe("Number of bytes written")
|
|
3668
3665
|
}).extend(debugStateSchema.shape),
|
|
3669
|
-
execute: async (input) =>
|
|
3670
|
-
const address = parseAddress16(input.address);
|
|
3671
|
-
const data = input.data.map((b) => parseByte(b));
|
|
3672
|
-
if (address + data.length - 1 > 65535) {
|
|
3673
|
-
throw new Error("address + data.length must stay within the 16-bit address space");
|
|
3674
|
-
}
|
|
3675
|
-
return await c64Session.writeMemory(address, data);
|
|
3676
|
-
}
|
|
3666
|
+
execute: async (input) => await c64Session.writeMemory(input.address, input.data)
|
|
3677
3667
|
});
|
|
3678
3668
|
var executeTool = createViceTool({
|
|
3679
3669
|
id: "execute",
|
|
@@ -3719,27 +3709,17 @@ var listBreakpointsTool = createViceTool({
|
|
|
3719
3709
|
});
|
|
3720
3710
|
var breakpointSetTool = createViceTool({
|
|
3721
3711
|
id: "breakpoint_set",
|
|
3722
|
-
description: "Creates an execution breakpoint or read/write watchpoint.
|
|
3723
|
-
inputSchema: z3.
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
z3.object({
|
|
3734
|
-
kind: breakpointKindSchema,
|
|
3735
|
-
start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
|
|
3736
|
-
end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
|
|
3737
|
-
condition: z3.string().optional(),
|
|
3738
|
-
label: z3.string().optional(),
|
|
3739
|
-
temporary: z3.boolean().default(false),
|
|
3740
|
-
enabled: z3.boolean().default(true)
|
|
3741
|
-
})
|
|
3742
|
-
]),
|
|
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
|
+
}),
|
|
3743
3723
|
dataSchema: z3.object({
|
|
3744
3724
|
breakpoint: breakpointSchema,
|
|
3745
3725
|
executionState: executionStateSchema,
|
|
@@ -3748,35 +3728,25 @@ var breakpointSetTool = createViceTool({
|
|
|
3748
3728
|
registers: c64PartialRegisterValueSchema.nullable()
|
|
3749
3729
|
}),
|
|
3750
3730
|
execute: async (input) => {
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
if (end < start) {
|
|
3731
|
+
const address = input.start_address;
|
|
3732
|
+
let length;
|
|
3733
|
+
if (input.end_address !== void 0) {
|
|
3734
|
+
if (address > input.end_address) {
|
|
3756
3735
|
throw new Error("End address must be greater than or equal to start address");
|
|
3757
3736
|
}
|
|
3758
|
-
|
|
3759
|
-
kind: input.kind,
|
|
3760
|
-
address: start,
|
|
3761
|
-
length: end - start + 1,
|
|
3762
|
-
condition: input.condition,
|
|
3763
|
-
label: input.label,
|
|
3764
|
-
temporary: input.temporary,
|
|
3765
|
-
enabled: input.enabled
|
|
3766
|
-
};
|
|
3767
|
-
} else if ("address" in input && "length" in input) {
|
|
3768
|
-
normalizedInput = {
|
|
3769
|
-
kind: input.kind,
|
|
3770
|
-
address: parseAddress16(input.address),
|
|
3771
|
-
length: input.length,
|
|
3772
|
-
condition: input.condition,
|
|
3773
|
-
label: input.label,
|
|
3774
|
-
temporary: input.temporary,
|
|
3775
|
-
enabled: input.enabled
|
|
3776
|
-
};
|
|
3737
|
+
length = input.end_address - address + 1;
|
|
3777
3738
|
} else {
|
|
3778
|
-
|
|
3739
|
+
length = input.data_length;
|
|
3779
3740
|
}
|
|
3741
|
+
const normalizedInput = {
|
|
3742
|
+
kind: input.kind,
|
|
3743
|
+
address,
|
|
3744
|
+
length,
|
|
3745
|
+
condition: input.condition,
|
|
3746
|
+
label: input.label,
|
|
3747
|
+
temporary: input.temporary,
|
|
3748
|
+
enabled: input.enabled
|
|
3749
|
+
};
|
|
3780
3750
|
const result = await c64Session.breakpointSet(normalizedInput);
|
|
3781
3751
|
return {
|
|
3782
3752
|
breakpoint: normalizeBreakpoint(result.breakpoint),
|