@henols/vice-mcp 0.2.1 → 0.2.3
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/README.md +4 -3
- package/THIRD-PARTY-NOTICES.md +423 -25
- package/{r2000-acme-ident.ts → anno-acme-ident.ts} +13 -13
- package/anno-bank.ts +171 -0
- package/anno-cli.ts +3040 -0
- package/{r2000-confidence.ts → anno-confidence.ts} +22 -22
- package/anno-coverage.ts +2465 -0
- package/anno-derive.ts +590 -0
- package/anno-details.ts +169 -0
- package/anno-enum-gen.ts +919 -0
- package/anno-export-asm.ts +2396 -0
- package/anno-graphics.ts +338 -0
- package/anno-hazard-report.ts +1367 -0
- package/anno-import.ts +495 -0
- package/anno-index.ts +150 -0
- package/anno-join.ts +480 -0
- package/{r2000-memmap-render.ts → anno-memmap-render.ts} +236 -95
- package/anno-provenance-ledger.ts +472 -0
- package/{r2000-regbits-gen.ts → anno-regbits-gen.ts} +20 -15
- package/{r2000-regbits.json → anno-regbits.json} +2 -2
- package/anno-register.ts +399 -0
- package/anno-store-export.ts +661 -0
- package/anno-store.ts +4002 -0
- package/anno-symbols.ts +266 -0
- package/anno-tools.ts +3264 -0
- package/anno-types.ts +1909 -0
- package/backend-detect.mts +124 -312
- package/block-class.ts +201 -0
- package/build.ts +4 -2
- package/capture-predicate.ts +597 -0
- package/channel-lock.ts +349 -0
- package/disasm-decoder.ts +14 -14
- package/disasm-opcodes.ts +4 -4
- package/disasm-renderer.ts +2 -2
- package/evid-ingest.ts +217 -0
- package/evid-reconcile.ts +316 -0
- package/host-tool-client.ts +430 -0
- package/hostpath.ts +1 -1
- package/incident-record.ts +23 -12
- package/install-resources.ts +30 -14
- package/memmap-lookup.ts +285 -0
- package/package.json +48 -23
- package/prg-image.ts +118 -0
- package/repo-root.ts +107 -8
- package/resources/backend-detect.mjs +98 -236
- package/resources/broker-control.mjs +189 -16
- package/resources/broker-epoch.mjs +1 -1
- package/resources/broker-kill.mjs +8 -2
- package/resources/broker-launch.mjs +373 -214
- package/resources/broker-state.mjs +64 -18
- package/resources/container-guard.mjs +1 -1
- package/resources/ghidra-project.mjs +790 -0
- package/resources/host-tool.mjs +2561 -0
- package/resources/vice-broker.mjs +330 -184
- package/resources/vice-launcher.sh +130 -12
- package/stock-address.ts +6 -6
- package/stock-cia.ts +2 -2
- package/stock-condition.ts +8 -8
- package/stock-connect.ts +10 -6
- package/stock-derived.ts +29 -37
- package/stock-diagnose.ts +200 -36
- package/stock-dispatch.ts +200 -68
- package/stock-execution.ts +5 -3
- package/stock-handler.ts +1 -1
- package/stock-input.ts +9 -9
- package/stock-machine.ts +17 -6
- package/stock-paths.ts +18 -14
- package/stock-petscii.ts +1 -1
- package/stock-protocol.ts +17 -12
- package/stock-recycle.ts +83 -2
- package/stock-registers.ts +54 -29
- package/stock-reproducible-run.ts +811 -0
- package/stock-run-until.ts +100 -1
- package/stock-sprites.ts +3 -3
- package/stock-symbols.ts +13 -13
- package/stock-timing.ts +2 -2
- package/stock-vicii.ts +1 -1
- package/stop-oracle.ts +167 -0
- package/text-capability-probe.ts +660 -0
- package/text-connect.ts +157 -0
- package/text-protocol.ts +810 -0
- package/text-tools.ts +778 -0
- package/textmon-backtrace.ts +385 -0
- package/textmon-cpuhistory.ts +335 -0
- package/textmon-memmap.ts +494 -0
- package/textmon-profile.ts +458 -0
- package/textmon-registers.ts +748 -0
- package/tools-manifest.stock.json +864 -3
- package/version.ts +1 -1
- package/vice-broker-client.ts +189 -42
- package/vice-errors.ts +268 -0
- package/vice-proxy.ts +392 -2175
- package/vsf-slice.ts +640 -0
- package/capability-registry.ts +0 -388
- package/r2000-cli.ts +0 -1103
- package/r2000-d64.ts +0 -310
- package/r2000-enum-gen.ts +0 -574
- package/r2000-launch.ts +0 -357
- package/r2000-mcp-client.ts +0 -596
- package/r2000-project.ts +0 -190
- package/r2000-symbols.ts +0 -388
- package/r2000-tools.ts +0 -914
- package/r2000-verify.ts +0 -184
- package/refresh-manifest.ts +0 -124
- package/tools-manifest.json +0 -1223
- package/vice-probe.ts +0 -278
- package/vice-sync.ts +0 -336
- package/vice.ts +0 -772
|
@@ -2,17 +2,41 @@
|
|
|
2
2
|
// Compiled by `tsc` from broker-state.mts. Edit the TypeScript source and rebuild;
|
|
3
3
|
// changes made directly to this file are silently overwritten by the next build, and are never
|
|
4
4
|
// deployed to the host on their own -- install-resources.mjs copies THIS file's on-disk contents
|
|
5
|
-
// verbatim to tools/, so an edit made only here reaches the host but is lost on the very next
|
|
5
|
+
// verbatim to .c64-re-tools/bin/, so an edit made only here reaches the host but is lost on the very next
|
|
6
6
|
// rebuild.
|
|
7
7
|
import { createServer } from "node:net";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
// MonitorChannel (plan 41-03, D-14): exactly two channels exist -- stock VICE
|
|
10
|
+
// exposes precisely the binary monitor and the `-remotemonitor` text
|
|
11
|
+
// channel -- and this project has no plan to add a third. Frozen so a
|
|
12
|
+
// consumer cannot accidentally push a third value onto it at runtime.
|
|
13
|
+
//
|
|
14
|
+
// Declared here a SECOND time in channel-lock.ts (and a third time, as a
|
|
15
|
+
// local literal union, in vice-broker-client.ts) rather than imported from a
|
|
16
|
+
// single shared home: channel-lock.ts is a container-side module and this
|
|
17
|
+
// module is host-bound and compiled into resources/*.mjs, so neither can
|
|
18
|
+
// import the other at runtime. The shared thing between the declarations is
|
|
19
|
+
// the two-value CONTRACT ("binary" | "text"), not the declaration itself.
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
export const MONITOR_CHANNELS = Object.freeze(["binary", "text"]);
|
|
22
|
+
/** Clears ONE channel's entry when `channel` is passed (an explicit
|
|
23
|
+
* `monitor_release` for that channel), or EVERY channel's entry when it is
|
|
24
|
+
* omitted (the whole record's ownership is going away -- recycle, release,
|
|
25
|
+
* or the instance's own process exit; see InstanceRecord.monitorClients'
|
|
26
|
+
* own header comment for the exact call sites of each case) -- so a dead or
|
|
27
|
+
* torn-down client can never hold this lock forever, on any channel. The
|
|
28
|
+
* ONE place a holder entry is cleared, apart from broker-launch.mts's
|
|
29
|
+
* handleExit(), which assigns `{}` directly for a documented reason (see
|
|
30
|
+
* that function's own comment). A no-op when the targeted channel (or, with
|
|
31
|
+
* no channel, every channel) is not currently held -- idempotent, matching
|
|
32
|
+
* monitor_release's own tolerance for an already-cleared record. */
|
|
33
|
+
export function clearMonitorClient(record, channel) {
|
|
34
|
+
if (channel !== undefined) {
|
|
35
|
+
delete record.monitorClients[channel];
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
for (const ch of MONITOR_CHANNELS)
|
|
39
|
+
delete record.monitorClients[ch];
|
|
16
40
|
}
|
|
17
41
|
export function createBrokerState() {
|
|
18
42
|
return { instances: new Map(), grants: new Map(), blockedPorts: new Set() };
|
|
@@ -23,7 +47,20 @@ export function createBrokerState() {
|
|
|
23
47
|
* trip. */
|
|
24
48
|
export function _snapshotState(state) {
|
|
25
49
|
return {
|
|
26
|
-
|
|
50
|
+
// Phase 33, plan 33-06: `profile` is the SECOND nested object on an
|
|
51
|
+
// InstanceRecord (after `viceArgs`), so it needs its own copy for this
|
|
52
|
+
// function's documented "deep, plain-object copy" contract to stay true --
|
|
53
|
+
// a spread alone would hand a caller a reference into live broker state,
|
|
54
|
+
// and this file's own snapshot test asserts that mutating a nested value
|
|
55
|
+
// in the result leaves the broker's state unchanged. The key is
|
|
56
|
+
// reproduced only when present, so an absent profile stays absent in the
|
|
57
|
+
// snapshot (absent means profile-less, and a snapshot must not invent a
|
|
58
|
+
// `profile: undefined` key that the record itself does not carry).
|
|
59
|
+
instances: Array.from(state.instances.values()).map((r) => ({
|
|
60
|
+
...r,
|
|
61
|
+
viceArgs: [...r.viceArgs],
|
|
62
|
+
...(r.profile === undefined ? {} : { profile: { ...r.profile } }),
|
|
63
|
+
})),
|
|
27
64
|
grants: Array.from(state.grants.values()).map((g) => ({ ...g })),
|
|
28
65
|
blockedPorts: Array.from(state.blockedPorts).sort((a, b) => a - b),
|
|
29
66
|
};
|
|
@@ -149,14 +186,23 @@ export function countReady(state) {
|
|
|
149
186
|
export function countTotal(state) {
|
|
150
187
|
return state.instances.size;
|
|
151
188
|
}
|
|
152
|
-
/** Counts instances currently "launching"
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
189
|
+
/** Counts instances currently "launching". Plan 41-05 (folded todo) retired
|
|
190
|
+
* the warm floor and its own maintainWarmFloor() -- the SECOND launch path
|
|
191
|
+
* that used to read this counter as a pre-check before starting a new
|
|
192
|
+
* launch, alongside the cold-acquire arm's own equivalent check. With only
|
|
193
|
+
* one launch path left (vice-broker.mts's handleAcquire(), guarded by
|
|
194
|
+
* acquirePortAndLaunch()'s own single-owner `inFlight` boolean in
|
|
195
|
+
* broker-launch.mts -- a SEPARATE, synchronous primitive, not this
|
|
196
|
+
* function), nothing in production calls this counter today; it remains
|
|
197
|
+
* exported alongside countReady()/countTotal() as status-shaped
|
|
198
|
+
* infrastructure. It is named here, and its history preserved, because it
|
|
199
|
+
* is why a SINGLE counter -- not two, one per launch path -- was the fix
|
|
200
|
+
* for the 2026-08-01 outage (three simultaneous x64sc launches: one SEGV,
|
|
201
|
+
* one exit 1, one exit 0 at the identical spawn second): two counters that
|
|
202
|
+
* could ever disagree about whether a boot was already under way is exactly
|
|
203
|
+
* how that outage happened, and the discipline of reading exactly one is
|
|
204
|
+
* what this function's own existence still documents, even with one launch
|
|
205
|
+
* path left to (potentially) consult it. */
|
|
160
206
|
export function countLaunching(state) {
|
|
161
207
|
let n = 0;
|
|
162
208
|
for (const record of state.instances.values()) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Compiled by `tsc` from container-guard.mts. Edit the TypeScript source and rebuild;
|
|
3
3
|
// changes made directly to this file are silently overwritten by the next build, and are never
|
|
4
4
|
// deployed to the host on their own -- install-resources.mjs copies THIS file's on-disk contents
|
|
5
|
-
// verbatim to tools/, so an edit made only here reaches the host but is lost on the very next
|
|
5
|
+
// verbatim to .c64-re-tools/bin/, so an edit made only here reaches the host but is lost on the very next
|
|
6
6
|
// rebuild.
|
|
7
7
|
// container-guard.mts
|
|
8
8
|
//
|