@xn-intenton-z2a/agentic-lib 7.1.61 → 7.1.63
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/.github/workflows/agentic-lib-bot.yml +27 -3
- package/.github/workflows/agentic-lib-init.yml +4 -4
- package/.github/workflows/agentic-lib-schedule.yml +3 -3
- package/.github/workflows/agentic-lib-test.yml +12 -4
- package/.github/workflows/agentic-lib-workflow.yml +71 -23
- package/README.md +51 -8
- package/agentic-lib.toml +89 -17
- package/bin/agentic-lib.js +114 -7
- package/package.json +2 -1
- package/src/actions/agentic-step/action.yml +2 -2
- package/src/actions/agentic-step/config-loader.js +108 -55
- package/src/actions/agentic-step/copilot.js +175 -10
- package/src/actions/agentic-step/index.js +37 -2
- package/src/actions/agentic-step/logging.js +75 -0
- package/src/actions/agentic-step/tasks/discussions.js +17 -1
- package/src/actions/agentic-step/tasks/maintain-features.js +21 -1
- package/src/actions/agentic-step/tasks/maintain-library.js +7 -0
- package/src/actions/agentic-step/tasks/review-issue.js +6 -1
- package/src/actions/agentic-step/tasks/supervise.js +30 -4
- package/src/actions/agentic-step/tasks/transform.js +42 -6
- package/src/agents/agent-discussion-bot.md +13 -0
- package/src/agents/agent-issue-resolution.md +14 -0
- package/src/agents/agent-supervisor.md +3 -1
- package/src/agents/agentic-lib.yml +1 -3
- package/src/iterate.js +285 -0
- package/src/mcp/server.js +24 -127
- package/src/seeds/missions/c64-emulator.md +110 -0
- package/src/seeds/zero-README.md +2 -2
- package/src/seeds/zero-index.html +24 -0
- package/src/seeds/zero-package.json +5 -3
- package/src/seeds/zero-web.test.js +17 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Mission
|
|
2
|
+
|
|
3
|
+
A JavaScript Commodore 64 emulator capable of running the classic game "The Lords of Midnight" (1984, Mike Singleton).
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
The emulator is structured as layered components, each independently testable:
|
|
8
|
+
|
|
9
|
+
1. **MOS 6510 CPU** — the core processor (6502 variant with I/O port at $00/$01)
|
|
10
|
+
2. **Memory subsystem** — 64KB RAM, ROM banking (BASIC, KERNAL, character ROM), I/O area ($D000–$DFFF)
|
|
11
|
+
3. **VIC-II video** — text mode (40x25), bitmap mode, sprites, raster interrupt timing
|
|
12
|
+
4. **SID sound** — 3-voice synthesiser with ADSR envelopes (basic waveform generation)
|
|
13
|
+
5. **CIA timers** — two CIA chips for keyboard scanning, timer interrupts, and joystick input
|
|
14
|
+
6. **Input** — keyboard matrix and joystick mapped to browser events
|
|
15
|
+
7. **PRG/TAP loader** — load `.prg` files (and optionally `.tap` tape images) into memory
|
|
16
|
+
|
|
17
|
+
## Core Functions
|
|
18
|
+
|
|
19
|
+
Export all from `src/lib/main.js`:
|
|
20
|
+
|
|
21
|
+
- `createC64(opts?)` — create an emulator instance with default ROMs and 64KB RAM. Returns an object with `cpu`, `memory`, `vic`, `sid`, `cia1`, `cia2` subsystems.
|
|
22
|
+
- `loadPRG(c64, data)` — load a `.prg` file (Uint8Array) into memory at the address specified in its two-byte header.
|
|
23
|
+
- `step(c64)` — execute one CPU instruction, advance cycle count, and update timers. Returns the new state.
|
|
24
|
+
- `runFrame(c64)` — execute instructions for one video frame (~19656 cycles PAL). Trigger raster interrupts at the appropriate scanlines. Returns the framebuffer.
|
|
25
|
+
- `getFramebuffer(c64)` — return the current screen as a Uint8Array RGBA pixel buffer (320x200 or 384x272 with borders).
|
|
26
|
+
- `pressKey(c64, key)` / `releaseKey(c64, key)` — simulate keyboard input via CIA1 keyboard matrix.
|
|
27
|
+
- `joystickInput(c64, port, directions)` — set joystick state (up/down/left/right/fire) on port 1 or 2.
|
|
28
|
+
- `reset(c64)` — perform a hardware reset (set CPU to reset vector, clear state).
|
|
29
|
+
|
|
30
|
+
## CPU Requirements
|
|
31
|
+
|
|
32
|
+
- All official 6502 opcodes (56 instructions, 151 opcode variants) with correct cycle counts.
|
|
33
|
+
- Decimal mode (BCD arithmetic) support.
|
|
34
|
+
- IRQ and NMI interrupt handling with correct stack behaviour.
|
|
35
|
+
- The 6510 I/O port at $00/$01 for ROM/RAM bank switching.
|
|
36
|
+
- Undocumented/illegal opcodes are NOT required (may be implemented as NOP).
|
|
37
|
+
|
|
38
|
+
## Memory Map
|
|
39
|
+
|
|
40
|
+
- $0000–$00FF: Zero page
|
|
41
|
+
- $0100–$01FF: Stack
|
|
42
|
+
- $0200–$9FFF: Free RAM (programs load here)
|
|
43
|
+
- $A000–$BFFF: BASIC ROM (banked, RAM underneath)
|
|
44
|
+
- $C000–$CFFF: Free RAM
|
|
45
|
+
- $D000–$D3FF: VIC-II registers
|
|
46
|
+
- $D400–$D7FF: SID registers
|
|
47
|
+
- $D800–$DBFF: Colour RAM (nibbles)
|
|
48
|
+
- $DC00–$DCFF: CIA1 (keyboard, joystick, timer)
|
|
49
|
+
- $DD00–$DDFF: CIA2 (serial, timer, VIC bank)
|
|
50
|
+
- $E000–$FFFF: KERNAL ROM (banked, RAM underneath)
|
|
51
|
+
|
|
52
|
+
## Video (VIC-II)
|
|
53
|
+
|
|
54
|
+
- Standard text mode (mode 0) — 40x25 characters, 16 colours, character ROM.
|
|
55
|
+
- Multicolour text mode.
|
|
56
|
+
- Standard bitmap mode (320x200) and multicolour bitmap mode (160x200).
|
|
57
|
+
- Hardware sprites (8 sprites, 24x21 pixels, multicolour optional).
|
|
58
|
+
- Raster interrupt — trigger IRQ at a programmable scanline.
|
|
59
|
+
- Border colour and background colour registers.
|
|
60
|
+
- Correct raster timing is essential — Lords of Midnight uses raster effects.
|
|
61
|
+
|
|
62
|
+
## Sound (SID — basic)
|
|
63
|
+
|
|
64
|
+
- 3 oscillator voices with waveform selection (triangle, sawtooth, pulse, noise).
|
|
65
|
+
- ADSR envelope per voice.
|
|
66
|
+
- Frequency and pulse-width registers.
|
|
67
|
+
- Audio output as PCM sample buffer suitable for Web Audio API playback.
|
|
68
|
+
- Full filter emulation is NOT required (passthrough acceptable).
|
|
69
|
+
|
|
70
|
+
## Input
|
|
71
|
+
|
|
72
|
+
- CIA1 keyboard matrix scan — map browser `KeyboardEvent` codes to the C64 8x8 keyboard matrix.
|
|
73
|
+
- Joystick via CIA1 ($DC01 port 1) and CIA1 ($DC00 port 2) — Lords of Midnight uses keyboard, but joystick support enables other games.
|
|
74
|
+
|
|
75
|
+
## Lords of Midnight Compatibility
|
|
76
|
+
|
|
77
|
+
The target game exercises these specific features:
|
|
78
|
+
- Custom character sets (redefined at $3000 or similar)
|
|
79
|
+
- Full keyboard input (directional + action keys)
|
|
80
|
+
- Raster interrupts for split-screen effects
|
|
81
|
+
- IRQ-driven game loop timing via CIA timer
|
|
82
|
+
- PRG loading at the correct start address
|
|
83
|
+
|
|
84
|
+
## Requirements
|
|
85
|
+
|
|
86
|
+
- No external dependencies for the core emulator (Web Audio API and Canvas API are browser-provided).
|
|
87
|
+
- KERNAL and BASIC ROMs must NOT be bundled (they are copyrighted). Provide a `loadROMs(c64, { kernal, basic, chargen })` function. Tests should use minimal stub ROMs.
|
|
88
|
+
- Comprehensive unit tests for each subsystem:
|
|
89
|
+
- CPU: test each addressing mode and instruction, verify cycle counts, test interrupt handling.
|
|
90
|
+
- Memory: test bank switching, I/O area mapping.
|
|
91
|
+
- VIC-II: test mode switching, framebuffer output for known register states.
|
|
92
|
+
- Input: test keyboard matrix encoding/decoding.
|
|
93
|
+
- Integration test: load a small test PRG that writes to screen memory and verify framebuffer output.
|
|
94
|
+
- README with architecture overview, usage example, and instructions for obtaining legal ROM dumps.
|
|
95
|
+
|
|
96
|
+
## Acceptance Criteria
|
|
97
|
+
|
|
98
|
+
- [ ] CPU executes all 151 official opcodes with correct results and cycle counts
|
|
99
|
+
- [ ] CPU handles IRQ and NMI interrupts correctly (push PC+flags, jump to vector)
|
|
100
|
+
- [ ] Memory bank switching works ($01 register controls ROM/RAM visibility)
|
|
101
|
+
- [ ] VIC-II text mode renders 40x25 character display to framebuffer
|
|
102
|
+
- [ ] VIC-II raster interrupt fires at the programmed scanline
|
|
103
|
+
- [ ] SID produces audible waveform output for at least triangle and pulse waves
|
|
104
|
+
- [ ] CIA1 keyboard matrix correctly maps key presses to the scanned row/column
|
|
105
|
+
- [ ] `loadPRG()` places data at the correct address from the PRG header
|
|
106
|
+
- [ ] `runFrame()` executes approximately the right number of cycles per frame (PAL timing)
|
|
107
|
+
- [ ] A test PRG that writes "HELLO" to screen RAM ($0400) produces correct framebuffer output
|
|
108
|
+
- [ ] `reset()` returns the emulator to a known initial state
|
|
109
|
+
- [ ] All unit tests pass
|
|
110
|
+
- [ ] README documents architecture and ROM loading
|
package/src/seeds/zero-README.md
CHANGED
|
@@ -60,8 +60,8 @@ source = "src/lib/"
|
|
|
60
60
|
tests = "tests/unit/"
|
|
61
61
|
|
|
62
62
|
[limits]
|
|
63
|
-
feature-issues = 2 # max concurrent feature issues
|
|
64
|
-
attempts-per-issue = 2 # max retries per issue
|
|
63
|
+
max-feature-issues = 2 # max concurrent feature issues
|
|
64
|
+
max-attempts-per-issue = 2 # max retries per issue
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
## Updating
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>repository0</title>
|
|
7
|
+
<style>
|
|
8
|
+
body { font-family: system-ui, -apple-system, sans-serif; max-width: 800px; margin: 0 auto; padding: 2rem; color: #333; }
|
|
9
|
+
h1 { border-bottom: 2px solid #eee; padding-bottom: 0.5rem; }
|
|
10
|
+
a { color: #0366d6; }
|
|
11
|
+
.status { background: #f6f8fa; padding: 1rem; border-radius: 6px; margin: 1rem 0; }
|
|
12
|
+
</style>
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<h1>repository0</h1>
|
|
16
|
+
<div class="status">
|
|
17
|
+
<p>This website is maintained by the autonomous pipeline. It showcases the library built from the project's mission.</p>
|
|
18
|
+
</div>
|
|
19
|
+
<h2>About</h2>
|
|
20
|
+
<p>See <a href="https://github.com/xn-intenton-z2a/repository0">the repository</a> for source code and mission details.</p>
|
|
21
|
+
<h2>Demo</h2>
|
|
22
|
+
<p><em>The pipeline will evolve this section to demonstrate the library's capabilities.</em></p>
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
@@ -5,16 +5,18 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/lib/main.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "
|
|
8
|
+
"build": "npm run build:web",
|
|
9
|
+
"build:web": "mkdir -p docs && touch docs/.nojekyll && cp -r src/web/* docs/ 2>/dev/null || echo 'No web files to build'",
|
|
9
10
|
"test": "vitest --run tests/unit/*.test.js",
|
|
10
11
|
"test:unit": "vitest --run --coverage tests/unit/*.test.js",
|
|
11
|
-
"start": "node src/lib/main.js"
|
|
12
|
+
"start": "node src/lib/main.js",
|
|
13
|
+
"start:web": "npx serve docs"
|
|
12
14
|
},
|
|
13
15
|
"keywords": [],
|
|
14
16
|
"author": "",
|
|
15
17
|
"license": "MIT",
|
|
16
18
|
"dependencies": {
|
|
17
|
-
"@xn-intenton-z2a/agentic-lib": "^7.1.
|
|
19
|
+
"@xn-intenton-z2a/agentic-lib": "^7.1.63"
|
|
18
20
|
},
|
|
19
21
|
"devDependencies": {
|
|
20
22
|
"@vitest/coverage-v8": "^4.0.18",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Copyright (C) 2025-2026 Polycode Limited
|
|
3
|
+
import { describe, test, expect } from "vitest";
|
|
4
|
+
import { readFileSync, existsSync } from "fs";
|
|
5
|
+
|
|
6
|
+
describe("Website", () => {
|
|
7
|
+
test("src/web/index.html exists", () => {
|
|
8
|
+
expect(existsSync("src/web/index.html")).toBe(true);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test("index.html contains valid HTML structure", () => {
|
|
12
|
+
const html = readFileSync("src/web/index.html", "utf8");
|
|
13
|
+
expect(html).toContain("<!DOCTYPE html>");
|
|
14
|
+
expect(html).toContain("<html");
|
|
15
|
+
expect(html).toContain("</html>");
|
|
16
|
+
});
|
|
17
|
+
});
|