@henols/c64-re-tools 1.0.0 → 2.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +190 -37
- package/distribution/package.ts +36 -0
- package/distribution/plugin.ts +120 -0
- package/package.json +34 -40
- package/skills/c64-assembler/SKILL.md +73 -0
- package/skills/c64-assembler/scripts/assemble.ts +103 -0
- package/skills/c64-basic/SKILL.md +67 -0
- package/skills/c64-basic/scripts/basic.ts +46 -0
- package/skills/c64-disk/SKILL.md +79 -0
- package/skills/c64-disk/scripts/disk.ts +65 -0
- package/skills/c64-emulator/SKILL.md +124 -0
- package/skills/c64-knowledge/SKILL.md +102 -0
- package/skills/c64-knowledge/scripts/knowledge.ts +257 -0
- package/skills/c64-memory-map/SKILL.md +76 -0
- package/skills/c64-memory-map/scripts/memmap.ts +81 -0
- package/skills/c64-memory-map/scripts/platform.ts +424 -0
- package/skills/c64-provenance/SKILL.md +76 -0
- package/skills/c64-provenance/scripts/compare.ts +92 -0
- package/skills/c64-provenance/scripts/provenance.ts +83 -0
- package/skills/c64-reverse-engineering/SKILL.md +90 -0
- package/skills/c64-static-analysis/SKILL.md +96 -0
- package/skills/c64-static-analysis/scripts/analyze.ts +175 -0
- package/skills/c64-static-analysis/scripts/findings.ts +73 -0
- package/skills/c64-testing/SKILL.md +79 -0
- package/skills/c64-testing/references/scenario-format.md +76 -0
- package/skills/c64-testing/scripts/checklist.ts +51 -0
- package/skills/c64-testing/scripts/scenario.ts +473 -0
- package/skills/c64-testing/scripts/test.ts +55 -0
- package/skills/c64-unpacker/SKILL.md +82 -0
- package/skills/c64-unpacker/scripts/evidence.ts +135 -0
- package/skills/c64-unpacker/scripts/unpack.ts +216 -0
- package/src/c64.ts +281 -0
- package/src/cli/ap-sdk.ts +44 -0
- package/src/cli/cleanup.ts +194 -0
- package/src/cli/main.ts +122 -0
- package/src/cli/status.ts +34 -0
- package/src/host/main.ts +121 -0
- package/src/host/server.ts +409 -0
- package/src/host/tools/c1541.ts +255 -0
- package/src/host/tools/index.ts +31 -0
- package/src/host/tools/petcat.ts +70 -0
- package/src/host/tools/status.ts +30 -0
- package/src/host/tools/version.ts +41 -0
- package/src/host/vice/adapter.ts +761 -0
- package/src/host/vice/binary-monitor.ts +389 -0
- package/src/host/vice/chips.ts +108 -0
- package/src/host/vice/connect.ts +34 -0
- package/src/host/vice/process.ts +402 -0
- package/src/host/vice/screen.ts +183 -0
- package/src/host/vice/session.ts +1316 -0
- package/src/host/vice/text-monitor.ts +223 -0
- package/src/host-client/connect.ts +241 -0
- package/src/host-client/tools.ts +89 -0
- package/src/host-client/transfer.ts +100 -0
- package/src/host-client/vice-session.ts +254 -0
- package/src/knowledge/database.ts +132 -0
- package/src/knowledge/history.ts +128 -0
- package/src/knowledge/import.ts +344 -0
- package/src/knowledge/read.ts +191 -0
- package/src/knowledge/schema.ts +140 -0
- package/src/knowledge/write.ts +348 -0
- package/src/mcp/main.ts +109 -0
- package/src/mcp/server.ts +307 -0
- package/src/mcp/tools/debug.ts +237 -0
- package/src/mcp/tools/execution.ts +116 -0
- package/src/mcp/tools/input.ts +69 -0
- package/src/mcp/tools/machine.ts +97 -0
- package/src/mcp/tools/media.ts +106 -0
- package/src/mcp/tools/memory.ts +203 -0
- package/src/mcp/tools/video.ts +260 -0
- package/src/native/acme.ts +116 -0
- package/src/native/discover.ts +141 -0
- package/src/native/dxa.ts +166 -0
- package/src/native/ghidra/analyze.ts +86 -0
- package/src/native/ghidra/index.ts +157 -0
- package/src/native/ghidra/language/c64rt_6510.cspec +34 -0
- package/src/native/ghidra/language/c64rt_6510.ldefs +15 -0
- package/src/native/ghidra/language/c64rt_6510.pspec +15 -0
- package/src/native/ghidra/language/c64rt_6510.slaspec +596 -0
- package/src/native/ghidra/scripts/C64Export.java +242 -0
- package/src/native/ghidra/scripts/C64Prepare.java +60 -0
- package/src/native/local.ts +34 -0
- package/src/native/processes.ts +350 -0
- package/src/native/run.ts +172 -0
- package/src/native/staging.ts +83 -0
- package/src/native/status.ts +101 -0
- package/src/native/types.ts +228 -0
- package/src/native/watchdog.ts +78 -0
- package/src/project.ts +39 -0
- package/src/protocol/framing.ts +132 -0
- package/src/protocol/messages.ts +252 -0
- package/src/protocol/tools.ts +247 -0
- package/src/protocol/vice.ts +1235 -0
- package/src/script.ts +59 -0
- package/src/time.ts +15 -0
- package/src/trace.ts +162 -0
- package/THIRD-PARTY-NOTICES.md +0 -26
- package/bin/cli.mjs +0 -283
- package/skills/acme-build/SKILL.md +0 -260
- package/skills/acme-build/scripts/acme.mjs +0 -341
- package/skills/acme-build/template.a +0 -53
- package/skills/c64-disk-access/SKILL.md +0 -159
- package/skills/c64-disk-access/scripts/c1541.mjs +0 -569
- package/skills/c64-memory-mapping/SKILL.md +0 -631
- package/skills/c64-memory-mapping/memmap.json +0 -8800
- package/skills/c64-memory-mapping/scripts/driver.mjs +0 -553
- package/skills/c64-petcat/SKILL.md +0 -87
- package/skills/c64-petcat/scripts/petcat.mjs +0 -221
- package/skills/c64-program-recon/SKILL.md +0 -706
- package/skills/c64-program-recon/references/control-flow.md +0 -180
- package/skills/c64-program-recon/references/graphics.md +0 -79
- package/skills/c64-program-recon/references/observation-hazards.md +0 -143
- package/skills/c64-program-recon/references/reconstruction.md +0 -133
- package/skills/c64-program-recon/references/sound-and-input.md +0 -74
- package/skills/c64-program-recon/references/tool-selection.md +0 -78
- package/skills/c64-program-recon/scripts/derive.mjs +0 -364
- package/skills/c64-program-recon/scripts/packer-finding.mjs +0 -709
- package/skills/c64-program-recon/templates/memory-map.template.md +0 -101
- package/skills/c64-provenance-diff/SKILL.md +0 -292
- package/skills/c64-provenance-diff/scripts/diff-images.mjs +0 -984
- package/skills/c64-provenance-diff/scripts/recovery-schema.mjs +0 -395
- package/skills/c64-ram-capture/RELEASES.json.example +0 -17
- package/skills/c64-ram-capture/SKILL.md +0 -474
- package/skills/c64-ram-capture/scripts/compare-cross-binary.mjs +0 -525
- package/skills/c64-ram-capture/scripts/compare.mjs +0 -258
- package/skills/c64-ram-capture/scripts/derive-transients.mjs +0 -575
- package/skills/c64-ram-capture/scripts/dump-artifacts.mjs +0 -317
- package/skills/c64-ram-capture/scripts/mcp-module.mjs +0 -174
- package/skills/c64-ram-capture/scripts/project-paths.mjs +0 -81
- package/skills/c64-ram-capture/scripts/releases.mjs +0 -109
- package/skills/c64-ram-capture/scripts/vsf-slice.mjs +0 -147
- package/skills/c64-ram-capture/scripts/watch-loads.mjs +0 -581
- package/skills/c64-ram-capture/templates/capture-record.template.md +0 -99
- package/skills/c64-ram-capture/transients/README.md +0 -137
- package/skills/routine-queue-walker/SKILL.md +0 -394
- package/skills/routine-queue-walker/scripts/completeness-report.mjs +0 -465
- package/skills/vice-wedge-triage/SKILL.md +0 -269
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Slice a flat 64K RAM image out of a VICE `.vsf` snapshot, with no
|
|
3
|
-
// transcription step anywhere.
|
|
4
|
-
//
|
|
5
|
-
// A WRAPPER, DELIBERATELY EMPTY OF LAYOUT KNOWLEDGE. Not one snapshot byte
|
|
6
|
-
// offset, module name or body length appears in this file. Every such fact
|
|
7
|
-
// lives in `src/mcp/vice/vsf-slice.ts`, which this script resolves and
|
|
8
|
-
// invokes. If you came here looking for the layout, you are in the wrong
|
|
9
|
-
// file, and that is the design.
|
|
10
|
-
//
|
|
11
|
-
// WHY IT INVOKES THE OTHER PACKAGE'S MODULE INSTEAD OF CARRYING A COPY.
|
|
12
|
-
// THE CONSTRAINT, MEASURED rather than assumed: the MCP server ships as
|
|
13
|
-
// `@henols/vice-mcp`, whose `files[]` lists only `src/mcp/vice/` contents,
|
|
14
|
-
// while `src/skills/**` ships in the other package (`@henols/c64-re-tools`).
|
|
15
|
-
// A plain `import` from a skill script into the MCP tree resolves on neither
|
|
16
|
-
// npm-installer route, and `scripts/check-npm-packages.mjs`'s transitive
|
|
17
|
-
// closure walk over `files[]` would fail the pack the moment a reachable
|
|
18
|
-
// module sat outside the listed set.
|
|
19
|
-
//
|
|
20
|
-
// That leaves two answers, and this file takes the second:
|
|
21
|
-
//
|
|
22
|
-
// (a) a self-contained skill-side script carrying its own copy of the
|
|
23
|
-
// layout -- the retired skill-side/MCP-side disk-image-reader pair's
|
|
24
|
-
// own precedent (two independent copies of the sector-chain walk,
|
|
25
|
-
// both deleted once the c1541 host-tool seam took over their one job).
|
|
26
|
-
// (b) a CLI entry point on the MCP-side module, which the skill invokes.
|
|
27
|
-
//
|
|
28
|
-
// (b), because the two cases are not alike. That retired pair's own
|
|
29
|
-
// duplicate was of a STABLE, PUBLISHED disk format that has not changed in
|
|
30
|
-
// forty years. The
|
|
31
|
-
// `.vsf` layout is version-sensitive: a second magic block moved the first
|
|
32
|
-
// module offset, the memory module's body length differs between two module
|
|
33
|
-
// minors that are both in the wild, and this project already had ONE stale
|
|
34
|
-
// copy of those numbers -- a prototype carrying a first-module offset that
|
|
35
|
-
// predates that second magic block, which survived only through a
|
|
36
|
-
// byte-by-byte rescan fallback that can lock onto a false module name inside
|
|
37
|
-
// 64 KB of RAM data. The real values, and their derivations, are in
|
|
38
|
-
// `vsf-slice.ts` where they belong. A second copy of the one
|
|
39
|
-
// authoritative reading of a version-sensitive format is precisely the
|
|
40
|
-
// divergence hazard the single-seam convention exists to remove. Recorded
|
|
41
|
-
// here as a decision so the next reader sees a choice rather than an
|
|
42
|
-
// oversight.
|
|
43
|
-
//
|
|
44
|
-
// IT SPAWNS `node` ON AN IN-TREE MODULE, AND NOTHING ELSE. `process.execPath`
|
|
45
|
-
// is the interpreter already running this script, and the target is a
|
|
46
|
-
// JavaScript/TypeScript file inside one of this project's own two packages.
|
|
47
|
-
// No external host binary is reached, so the host-tool execution seam is not
|
|
48
|
-
// involved here and must not be pre-empted -- that seam is for binaries that
|
|
49
|
-
// live on the host outside any container, which this is not.
|
|
50
|
-
//
|
|
51
|
-
// WHAT NOT TO DO:
|
|
52
|
-
// - Never add a fallback that slices the snapshot here. If no rung of the
|
|
53
|
-
// resolution ladder resolves, this script exits non-zero naming every
|
|
54
|
-
// path it tried. A local re-implementation would turn a resolution
|
|
55
|
-
// failure into a WRONG IMAGE, which is the one outcome the whole slicing
|
|
56
|
-
// route exists to avoid.
|
|
57
|
-
// - Never rewrite, prefix or summarise the target module's stderr. It is
|
|
58
|
-
// inherited straight through, so a refusal reaches you in the words of
|
|
59
|
-
// the code that refused.
|
|
60
|
-
// - Never copy a snapshot byte offset, a module body length or a module
|
|
61
|
-
// name into this file, not even in a comment as documentation, and not
|
|
62
|
-
// even into the usage text. The next person to update the layout will
|
|
63
|
-
// update `vsf-slice.ts` and will not know to look here. Its colocated
|
|
64
|
-
// test asserts the absence mechanically, so this is a red gate rather
|
|
65
|
-
// than a promise. (The `$D000-$DFFF` range in the usage below is a C64
|
|
66
|
-
// address range and a fact about the memory-read route, not a snapshot
|
|
67
|
-
// layout constant.)
|
|
68
|
-
import { spawnSync } from "node:child_process";
|
|
69
|
-
|
|
70
|
-
// The resolution ladder used to live HERE,
|
|
71
|
-
// as this file's own `ladder()`/`resolveTarget()` pair. It is now extracted
|
|
72
|
-
// to `mcp-module.mjs` (`resolveMcpModule()`/`refusalMessage()`), because two
|
|
73
|
-
// MORE skill scripts (`acme.mjs`, `packer-finding.mjs`) needed the identical
|
|
74
|
-
// lookup to reach the host-tool execution seam's `host-tool-client.ts`, and
|
|
75
|
-
// three copies of one ladder is exactly the divergence hazard this file's own
|
|
76
|
-
// header (below) already warns about for the `.vsf` layout itself. Import
|
|
77
|
-
// the ladder rather than re-adding a copy here.
|
|
78
|
-
import { resolveMcpModule, refusalMessage, TARGET_PACKAGE } from "./mcp-module.mjs";
|
|
79
|
-
|
|
80
|
-
/** The MCP-side module's file name, in one place. */
|
|
81
|
-
const TARGET_FILE = "vsf-slice.ts";
|
|
82
|
-
|
|
83
|
-
/** Forwards argv to the MCP-side entry point with stdio inherited, so its
|
|
84
|
-
* stdout and stderr reach the caller unmodified and its exit status is this
|
|
85
|
-
* script's exit status. */
|
|
86
|
-
function forward(argv) {
|
|
87
|
-
const resolved = resolveMcpModule(TARGET_FILE);
|
|
88
|
-
|
|
89
|
-
if (!resolved.ok) {
|
|
90
|
-
console.error(
|
|
91
|
-
`vsf-slice.mjs: ${refusalMessage(TARGET_FILE, resolved.rungs)}\n` +
|
|
92
|
-
`${TARGET_FILE} is where the .vsf layout lives. Refusing rather than slicing the snapshot ` +
|
|
93
|
-
`here: a second copy of a version-sensitive byte layout is how a wrong image gets produced ` +
|
|
94
|
-
`with no error.`,
|
|
95
|
-
);
|
|
96
|
-
return 1;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const run = spawnSync(process.execPath, [resolved.path, ...argv], { stdio: "inherit" });
|
|
100
|
-
if (run.error) {
|
|
101
|
-
console.error(`vsf-slice.mjs: could not run ${resolved.path}: ${run.error.message}`);
|
|
102
|
-
return 1;
|
|
103
|
-
}
|
|
104
|
-
if (run.signal) {
|
|
105
|
-
console.error(`vsf-slice.mjs: ${resolved.path} was killed by ${run.signal}`);
|
|
106
|
-
return 1;
|
|
107
|
-
}
|
|
108
|
-
return run.status ?? 1;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Both verbs forward identically. The table exists so an unknown verb is
|
|
112
|
-
// answered here, with this script's usage, rather than by a subprocess whose
|
|
113
|
-
// own usage names a file the caller did not run.
|
|
114
|
-
//
|
|
115
|
-
// Prototype-less, via Object.create(null). A plain object
|
|
116
|
-
// literal inherits Object.prototype, so `commands["constructor"]` and
|
|
117
|
-
// `commands["toString"]` are truthy FUNCTIONS: an unknown verb that happens to
|
|
118
|
-
// be a prototype member passed the known-verb test and was then CALLED, so the
|
|
119
|
-
// documented usage was never printed and the failure surfaced as a confusing
|
|
120
|
-
// message from process.exit() about its argument type instead. Same idiom this
|
|
121
|
-
// file already uses for its flag bag, applied one level up.
|
|
122
|
-
const commands = Object.assign(Object.create(null), { slice: forward, digest: forward });
|
|
123
|
-
|
|
124
|
-
const [cmd, ...rest] = process.argv.slice(2);
|
|
125
|
-
if (!cmd || !commands[cmd]) {
|
|
126
|
-
console.error(`usage: node vsf-slice.mjs <command>
|
|
127
|
-
|
|
128
|
-
slice <snapshot.vsf> --out <image.bin> [--json] write the flat 64K image
|
|
129
|
-
digest <snapshot.vsf> sha256 of the sliced image, writing no file
|
|
130
|
-
|
|
131
|
-
Produces a flat 64K image by slicing the snapshot's memory module body. There
|
|
132
|
-
is no transcription step on this route, so the \`$D000-$DFFF\` volatility rule
|
|
133
|
-
that governs the memory-read route does NOT apply to an image produced this
|
|
134
|
-
way: the snapshot array is RAM under I/O, not the register read view.
|
|
135
|
-
|
|
136
|
-
The layout lives in ${TARGET_FILE} on the MCP side; this script resolves it via
|
|
137
|
-
VICE_MCP_DIR, the in-repo path, or ${TARGET_PACKAGE}, and refuses by name when
|
|
138
|
-
no rung resolves. A malformed snapshot is refused, never truncated.`);
|
|
139
|
-
process.exit(cmd ? 1 : 0);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
try {
|
|
143
|
-
process.exit(commands[cmd]([cmd, ...rest]));
|
|
144
|
-
} catch (e) {
|
|
145
|
-
console.error(`error: ${e.message}`);
|
|
146
|
-
process.exit(1);
|
|
147
|
-
}
|