@yemi33/minions 0.1.236 → 0.1.237

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/CHANGELOG.md CHANGED
@@ -1,12 +1,13 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.236 (2026-04-03)
3
+ ## 0.1.237 (2026-04-03)
4
4
 
5
5
  ### Fixes
6
6
  - CLI audit — kill dashboard on restart, expose kill/complete, update help
7
7
  - clean _pendingReason on all status→done transitions, not just updateWorkItemStatus
8
8
 
9
9
  ### Other
10
+ - docs: update GitHub Pages with all features + fresh screenshots
10
11
  - docs: fix outdated references across all documentation
11
12
 
12
13
  ## 0.1.233 (2026-04-03)
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Capture dashboard screenshots for GitHub Pages.
4
+ * Run: npx playwright test docs/capture-demos.js (or node docs/capture-demos.js)
5
+ */
6
+ const { chromium } = require('@playwright/test');
7
+ const path = require('path');
8
+
9
+ const DEMO_DIR = path.join(__dirname, 'demo');
10
+ const BASE = 'http://localhost:7331';
11
+
12
+ async function capture() {
13
+ const browser = await chromium.launch({ headless: true });
14
+ const ctx = await browser.newContext({ viewport: { width: 1400, height: 900 }, colorScheme: 'dark' });
15
+ const page = await ctx.newPage();
16
+
17
+ // Wait for dashboard to load
18
+ await page.goto(BASE, { waitUntil: 'networkidle' });
19
+ await page.waitForTimeout(2000);
20
+
21
+ // 1. Home / Overview
22
+ console.log(' Capturing: home');
23
+ await page.screenshot({ path: path.join(DEMO_DIR, '01-dashboard-overview.png'), fullPage: false });
24
+
25
+ // 2. Work Items
26
+ console.log(' Capturing: work items');
27
+ await page.click('a[data-page="work"]');
28
+ await page.waitForTimeout(1500);
29
+ await page.screenshot({ path: path.join(DEMO_DIR, '02-work-items.png'), fullPage: false });
30
+
31
+ // 3. Plans & PRD
32
+ console.log(' Capturing: plans & PRD');
33
+ await page.click('a[data-page="plans"]');
34
+ await page.waitForTimeout(1500);
35
+ await page.screenshot({ path: path.join(DEMO_DIR, '03-plans-prd.png'), fullPage: false });
36
+
37
+ // 4. Pull Requests
38
+ console.log(' Capturing: pull requests');
39
+ await page.click('a[data-page="prs"]');
40
+ await page.waitForTimeout(1500);
41
+ await page.screenshot({ path: path.join(DEMO_DIR, '04-pull-requests.png'), fullPage: false });
42
+
43
+ // 5. Meetings
44
+ console.log(' Capturing: meetings');
45
+ await page.click('a[data-page="meetings"]');
46
+ await page.waitForTimeout(1500);
47
+ await page.screenshot({ path: path.join(DEMO_DIR, '05-meetings.png'), fullPage: false });
48
+
49
+ // 6. Pipelines
50
+ console.log(' Capturing: pipelines');
51
+ await page.click('a[data-page="pipelines"]');
52
+ await page.waitForTimeout(1500);
53
+ await page.screenshot({ path: path.join(DEMO_DIR, '06-pipelines.png'), fullPage: false });
54
+
55
+ // 7. Notes & KB
56
+ console.log(' Capturing: notes & KB');
57
+ await page.click('a[data-page="inbox"]');
58
+ await page.waitForTimeout(1500);
59
+ await page.screenshot({ path: path.join(DEMO_DIR, '07-notes-kb.png'), fullPage: false });
60
+
61
+ // 8. Schedules
62
+ console.log(' Capturing: schedules');
63
+ await page.click('a[data-page="schedule"]');
64
+ await page.waitForTimeout(1500);
65
+ await page.screenshot({ path: path.join(DEMO_DIR, '08-schedules.png'), fullPage: false });
66
+
67
+ // 9. Engine page (dispatch, log, metrics)
68
+ console.log(' Capturing: engine');
69
+ await page.click('a[data-page="engine"]');
70
+ await page.waitForTimeout(1500);
71
+ await page.screenshot({ path: path.join(DEMO_DIR, '09-engine.png'), fullPage: false });
72
+
73
+ // 10. Command Center
74
+ console.log(' Capturing: command center');
75
+ await page.click('#cc-toggle-btn');
76
+ await page.waitForTimeout(1000);
77
+ await page.screenshot({ path: path.join(DEMO_DIR, '10-command-center.png'), fullPage: false });
78
+
79
+ await browser.close();
80
+ console.log('\n Done! Screenshots saved to docs/demo/');
81
+ }
82
+
83
+ capture().catch(e => { console.error(e); process.exit(1); });
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/docs/index.html CHANGED
@@ -83,7 +83,7 @@
83
83
  <!-- Hero -->
84
84
  <div class="hero">
85
85
  <h1>Minions <span>Mission Control</span></h1>
86
- <p class="tagline">5 autonomous AI agents, one engine, one dashboard. Plan, implement, review, and ship code hands-free.</p>
86
+ <p class="tagline">5 autonomous AI agents, one engine, one dashboard. Plan, implement, review, and ship code &mdash; hands-free.</p>
87
87
  <div class="hero-badges">
88
88
  <span class="hero-badge green">Zero Dependencies</span>
89
89
  <span class="hero-badge blue">Claude-Powered</span>
@@ -108,66 +108,108 @@
108
108
  <!-- Features -->
109
109
  <div class="container">
110
110
  <div class="features">
111
- <div class="feature"><h3>Autonomous Dispatch</h3><p>Engine discovers work from PRDs, PRs, and manual queue routes to the right agent based on skills and availability.</p></div>
112
- <div class="feature"><h3>Plan Lifecycle</h3><p>Plan &rarr; Review &rarr; Approve &rarr; PRD &rarr; Execute &rarr; Verify. Human-in-the-loop at every gate.</p></div>
111
+ <div class="feature"><h3>Autonomous Dispatch</h3><p>Engine discovers work from plans, PRs, pipelines, and queues &mdash; routes to the right agent based on skills and availability.</p></div>
112
+ <div class="feature"><h3>Plan Lifecycle</h3><p>Plan &rarr; Approve &rarr; PRD &rarr; Execute &rarr; Review &rarr; Verify. Human-in-the-loop at every gate.</p></div>
113
+ <div class="feature"><h3>Team Meetings</h3><p>Multi-agent meetings with investigate, debate, and conclude rounds. Agents research, discuss, and produce actionable conclusions.</p></div>
114
+ <div class="feature"><h3>Multi-Stage Pipelines</h3><p>Chain tasks, meetings, plans, and more into automated workflows. Cron triggers or manual. Artifacts flow between stages.</p></div>
115
+ <div class="feature"><h3>Eval Loop</h3><p>After implementation, auto-dispatches review &rarr; fix cycles. Configurable iterations and cost ceiling per work item.</p></div>
113
116
  <div class="feature"><h3>Git Worktree Isolation</h3><p>Each agent works in its own worktree. No conflicts, no cross-contamination, safe parallel execution.</p></div>
114
- <div class="feature"><h3>Knowledge Consolidation</h3><p>Agent findings auto-consolidate into team notes and a searchable knowledge base. The minions learns as it works.</p></div>
117
+ <div class="feature"><h3>Knowledge Consolidation</h3><p>Agent findings auto-consolidate into team notes and a searchable knowledge base. The team learns as it works.</p></div>
115
118
  <div class="feature"><h3>PR Integration</h3><p>Auto-syncs PRs from Azure DevOps and GitHub. Detects review feedback, build failures, and human comments.</p></div>
116
- <div class="feature"><h3>Live Dashboard</h3><p>Real-time mission control on port 7331. Agent status, work items, PRD progress, dispatch queue, and metrics.</p></div>
119
+ <div class="feature"><h3>Scheduled Tasks</h3><p>Cron-style recurring work: nightly tests, weekly audits, daily standups. Visual cron builder in the dashboard.</p></div>
120
+ <div class="feature"><h3>Command Center</h3><p>Natural language interface for delegating work to agents. CC orchestrates &mdash; agents implement.</p></div>
121
+ <div class="feature"><h3>Live Dashboard</h3><p>Real-time mission control on port 7331. Paginated views, optimistic updates, and visibility-aware polling.</p></div>
122
+ <div class="feature"><h3>One-Command Updates</h3><p><code>minions update</code> pulls latest from npm and applies. Config and charters preserved automatically.</p></div>
117
123
  </div>
118
124
 
119
125
  <!-- Demo scenarios -->
120
126
  <div class="scenario">
121
127
  <div class="scenario-header"><div class="scenario-num">1</div><h2>Dashboard Overview</h2></div>
122
- <p>All 5 agents visible with live status <span class="hl">3 working</span>, <span class="hl">2 idle</span>. Work items sorted by priority, PRD progress with dependency tracking.</p>
128
+ <p>Home page with agent status cards, project bar, and setup guidance. All agents visible at a glance.</p>
123
129
  <div class="demo-frame">
124
- <img src="demo/01-dashboard-overview.gif" alt="Dashboard overview with agents working">
125
- <div class="demo-caption">Scrolling through: Minions Members, Work Items (6 items across statuses), and PRD Progress (40% complete)</div>
130
+ <img src="demo/01-dashboard-overview.png" alt="Dashboard overview with agent cards">
131
+ <div class="demo-caption">Home page showing Minions Members, project bar, and engine status badge</div>
126
132
  </div>
127
133
  </div>
128
134
 
129
135
  <div class="scenario">
130
- <div class="scenario-header"><div class="scenario-num">2</div><h2>Command Center</h2></div>
131
- <p>Natural language interface type what you need. Create plans, dispatch work, ask questions about the codebase.</p>
136
+ <div class="scenario-header"><div class="scenario-num">2</div><h2>Work Items</h2></div>
137
+ <p>Paginated table with status, type, priority, agent, and linked PRs. <span class="badge badge-yellow">PENDING</span> <span class="badge badge-blue">DISPATCHED</span> <span class="badge badge-green">DONE</span> <span class="badge badge-red">FAILED</span>. Retry, delete, and archive with optimistic updates.</p>
132
138
  <div class="demo-frame">
133
- <img src="demo/02-command-center.gif" alt="Command Center typing">
134
- <div class="demo-caption"><span class="badge badge-blue">CC</span> Typing a plan request, then switching to a one-off work item the CC routes each to the right action</div>
139
+ <img src="demo/02-work-items.png" alt="Work items table">
140
+ <div class="demo-caption">Work items page &mdash; 20 per page with create, edit, retry, and delete actions</div>
135
141
  </div>
136
142
  </div>
137
143
 
138
144
  <div class="scenario">
139
- <div class="scenario-header"><div class="scenario-num">3</div><h2>Work Items</h2></div>
140
- <p>Full lifecycle: <span class="badge badge-yellow">PENDING</span> <span class="badge badge-blue">DISPATCHED</span> <span class="badge badge-blue">IN-PR</span> <span class="badge badge-green">DONE</span> <span class="badge badge-red">FAILED</span>. Retry failed items with one click.</p>
145
+ <div class="scenario-header"><div class="scenario-num">3</div><h2>Plans &amp; PRD</h2></div>
146
+ <p>Plan cards with Approve / Discuss &amp; Revise / Reject. PRD dependency graph with per-item retry. Archive completed plans.</p>
141
147
  <div class="demo-frame">
142
- <img src="demo/03-work-items.gif" alt="Work items table">
143
- <div class="demo-caption">Work items with mixed statuses hovering over <span class="badge badge-red">Retry</span> on a failed exploration task</div>
148
+ <img src="demo/03-plans-prd.png" alt="Plans and PRD progress">
149
+ <div class="demo-caption">Plans page with status-colored cards, PRD dependency graph, and action buttons</div>
144
150
  </div>
145
151
  </div>
146
152
 
147
153
  <div class="scenario">
148
- <div class="scenario-header"><div class="scenario-num">4</div><h2>Plan &amp; Doc Chat</h2></div>
149
- <p>Click any plan to open its detail modal. Use the built-in doc chat to ask questions, steer direction, and revise all before executing.</p>
154
+ <div class="scenario-header"><div class="scenario-num">4</div><h2>Pull Requests</h2></div>
155
+ <p>PR tracker sorted by date, with review, build, and merge status. Linked to work items and PRD items. Manual PR linking supported.</p>
150
156
  <div class="demo-frame">
151
- <img src="demo/04-plan-docchat.gif" alt="Plan detail with doc chat">
152
- <div class="demo-caption">Opening a plan, viewing rendered markdown, then asking "What are the security implications?" in the doc chat</div>
157
+ <img src="demo/04-pull-requests.png" alt="Pull requests tracker">
158
+ <div class="demo-caption">PRs sorted newest-first with build status, review status, and agent attribution</div>
153
159
  </div>
154
160
  </div>
155
161
 
156
162
  <div class="scenario">
157
- <div class="scenario-header"><div class="scenario-num">5</div><h2>PRD Progress</h2></div>
158
- <p>PRD items track dependencies and block dispatching until prerequisites complete. Progress bar shows done items.</p>
163
+ <div class="scenario-header"><div class="scenario-num">5</div><h2>Team Meetings</h2></div>
164
+ <p>Multi-agent meetings with 3 rounds: investigate, debate, conclude. Live progress per participant. Create plans from conclusions.</p>
159
165
  <div class="demo-frame">
160
- <img src="demo/05-prd-progress.gif" alt="PRD progress with dependencies">
161
- <div class="demo-caption">"User Authentication &amp; Authorization" — 5 items with dependency chains, 2 done, 3 to do</div>
166
+ <img src="demo/05-meetings.png" alt="Meetings page">
167
+ <div class="demo-caption">Meetings with round status badges, participant progress, and archive/delete actions</div>
162
168
  </div>
163
169
  </div>
164
170
 
165
171
  <div class="scenario">
166
- <div class="scenario-header"><div class="scenario-num">6</div><h2>Inbox &amp; Metrics</h2></div>
167
- <p>Agent findings flow to the inbox, get consolidated by Haiku into team notes, and classified into the knowledge base. Quality metrics track per-agent performance.</p>
172
+ <div class="scenario-header"><div class="scenario-num">6</div><h2>Pipelines</h2></div>
173
+ <p>Multi-stage workflows chaining tasks, meetings, plans, and more. Cron triggers or manual. Artifact tracking between stages.</p>
168
174
  <div class="demo-frame">
169
- <img src="demo/06-inbox-metrics.gif" alt="Inbox and metrics">
170
- <div class="demo-caption">Inbox with agent findings, dispatch queue with completed tasks, and agent quality metrics</div>
175
+ <img src="demo/06-pipelines.png" alt="Pipelines page">
176
+ <div class="demo-caption">Pipeline cards with stage flow visualization, run history, and progress bars</div>
177
+ </div>
178
+ </div>
179
+
180
+ <div class="scenario">
181
+ <div class="scenario-header"><div class="scenario-num">7</div><h2>Notes &amp; Knowledge Base</h2></div>
182
+ <p>Inbox for agent findings, consolidated team notes, and categorized knowledge base. Inline Q&amp;A on any document.</p>
183
+ <div class="demo-frame">
184
+ <img src="demo/07-notes-kb.png" alt="Notes and knowledge base">
185
+ <div class="demo-caption">Notes inbox, team notes, and knowledge base with category tabs and pagination</div>
186
+ </div>
187
+ </div>
188
+
189
+ <div class="scenario">
190
+ <div class="scenario-header"><div class="scenario-num">8</div><h2>Scheduled Tasks</h2></div>
191
+ <p>Cron-style recurring work with visual builder. Natural language parsing &mdash; type "every weekday at 9am" and it generates the cron.</p>
192
+ <div class="demo-frame">
193
+ <img src="demo/08-schedules.png" alt="Schedules page">
194
+ <div class="demo-caption">Schedule list with cron expressions, last-run times, and enable/disable toggles</div>
195
+ </div>
196
+ </div>
197
+
198
+ <div class="scenario">
199
+ <div class="scenario-header"><div class="scenario-num">9</div><h2>Engine &amp; Metrics</h2></div>
200
+ <p>Dispatch queue, engine log, agent metrics, token usage, and context pressure. All paginated.</p>
201
+ <div class="demo-frame">
202
+ <img src="demo/09-engine.png" alt="Engine page">
203
+ <div class="demo-caption">Active/pending dispatches, completed history, engine log, and per-agent quality metrics</div>
204
+ </div>
205
+ </div>
206
+
207
+ <div class="scenario">
208
+ <div class="scenario-header"><div class="scenario-num">10</div><h2>Command Center</h2></div>
209
+ <p>Natural language delegation. CC orchestrates &mdash; agents implement. Session persists across refreshes. Actions auto-execute.</p>
210
+ <div class="demo-frame">
211
+ <img src="demo/10-command-center.png" alt="Command Center panel">
212
+ <div class="demo-caption">Command Center side panel with conversation history, action execution, and session indicator</div>
171
213
  </div>
172
214
  </div>
173
215
 
@@ -177,14 +219,17 @@
177
219
  <pre><span class="comment"># Install</span>
178
220
  npm install -g @yemi33/minions
179
221
 
180
- <span class="comment"># Initialize scans for repos, starts engine + dashboard</span>
222
+ <span class="comment"># Initialize &mdash; prompts for project locations, starts engine + dashboard</span>
181
223
  minions init
182
224
 
225
+ <span class="comment"># Give your first task</span>
226
+ minions work "Explore the codebase and document the architecture"
227
+
183
228
  <span class="comment"># Open dashboard</span>
184
- open http://localhost:7331
229
+ http://localhost:7331
185
230
 
186
- <span class="comment"># Use the Command Center to create your first plan</span>
187
- <span class="comment"># Or add work items directly from the dashboard</span></pre>
231
+ <span class="comment"># Update to latest</span>
232
+ minions update</pre>
188
233
  </div>
189
234
 
190
235
  <!-- Architecture -->
@@ -192,20 +237,23 @@ open http://localhost:7331
192
237
  <h2>Architecture</h2>
193
238
  <pre>
194
239
  ┌─────────────────────────────────────────────────────┐
195
- │ ~/.minions/ (central hub)
196
-
197
- │ engine.js ──── 60s tick loop ────┐
198
- │ │ │
199
- │ discover work spawn agents poll PRs
200
- │ │ │ │
201
- │ ┌───┴───┐ ┌──────┴──────┐ ┌──┴───┐
202
- │ │ PRDs │ │ Worktrees │ │ ADO │
203
- │ │ Items │ │ (isolated) │ │ GitHub│
204
- └───────┘ └─────────────┘ └──────┘
205
-
206
- dashboard.js ── port 7331 ── mission control
207
- notes.md ── consolidated team knowledge
208
- knowledge/ ── searchable KB by category
240
+ │ ~/.minions/ (central hub)
241
+
242
+ │ engine.js ──── 60s tick loop ────┐
243
+ │ │ │
244
+ │ discover work spawn agents poll PRs
245
+ │ │ │ │
246
+ │ ┌───┴───┐ ┌──────┴──────┐ ┌──┴───┐
247
+ │ │ Plans │ │ Worktrees │ │ ADO │
248
+ │ │ PRDs │ │ (isolated) │ │GitHub│
249
+ │ Items │ │ per agent │ │ │
250
+ └───────┘ └─────────────┘ └──────┘
251
+
252
+ dashboard.js ── port 7331 ── mission control
253
+ meetings/ ── multi-agent discussions
254
+ │ pipelines/ ── multi-stage workflows │
255
+ │ notes.md ── consolidated team knowledge │
256
+ │ knowledge/ ── searchable KB by category │
209
257
  └─────────────────────────────────────────────────────┘
210
258
  </pre>
211
259
  </div>
@@ -213,9 +261,8 @@ open http://localhost:7331
213
261
  </div>
214
262
 
215
263
  <footer>
216
- <p>Minions &mdash; <a href="https://github.com/yemi33/minions">GitHub</a> &mdash; MIT License &mdash; Zero dependencies, powered by Claude</p>
264
+ <p>Minions &mdash; <a href="https://github.com/yemi33/minions">GitHub</a> &mdash; <a href="https://www.npmjs.com/package/@yemi33/minions">npm</a> &mdash; MIT License &mdash; Zero dependencies, powered by Claude</p>
217
265
  </footer>
218
266
 
219
267
  </body>
220
268
  </html>
221
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.236",
3
+ "version": "0.1.237",
4
4
  "description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
5
5
  "bin": {
6
6
  "minions": "bin/minions.js"
@@ -1,134 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * generate-pixel-art.js
4
- *
5
- * Generates a 16x16 pixel art BMP image of a little robot character.
6
- * Uses only Node.js built-ins — no external dependencies.
7
- *
8
- * Usage: node tools/generate-pixel-art.js [output-path]
9
- * Default output: tools/pixel-robot.bmp
10
- */
11
-
12
- const fs = require('fs');
13
- const path = require('path');
14
-
15
- // --- Color palette (R, G, B) ---
16
- const COLORS = {
17
- _: [0, 0, 0, 0], // transparent (white background)
18
- B: [30, 30, 30], // black (outline)
19
- G: [80, 80, 80], // dark gray (body shadow)
20
- S: [160, 160, 160], // silver (body)
21
- W: [220, 220, 220], // white (highlight)
22
- R: [220, 50, 50], // red (antenna light / accent)
23
- C: [60, 180, 220], // cyan (eyes)
24
- Y: [240, 200, 60], // yellow (chest light)
25
- D: [100, 100, 100], // mid gray (limbs)
26
- };
27
-
28
- // 16x16 pixel grid — a cute robot sprite
29
- // Each character maps to COLORS above
30
- // Row 0 = top of image
31
- const SPRITE = [
32
- '______RR________', // row 0: antenna light
33
- '______BB________', // row 1: antenna stem
34
- '____BBBBBB______', // row 2: head top
35
- '___BWSSSSSWB____', // row 3: head
36
- '___BCCSSWCCB____', // row 4: eyes (cyan pupils)
37
- '___BCCSSWCCB____', // row 5: eyes
38
- '___BSSGGSSSB____', // row 6: mouth
39
- '____BBBBBB______', // row 7: head bottom
40
- '___BSSYYSSB_____', // row 8: chest top + yellow light
41
- '___DBSSSSSBD____', // row 9: chest + arms
42
- '___DBSSSSSBD____', // row 10: chest + arms
43
- '___DBSSSSSBD____', // row 11: chest + arms
44
- '____BBBBBB______', // row 12: waist
45
- '____BD__DB______', // row 13: legs
46
- '____BD__DB______', // row 14: legs
47
- '___BBDD_DDBB____', // row 15: feet
48
- ];
49
-
50
- const WIDTH = 16;
51
- const HEIGHT = 16;
52
-
53
- function createBMP(pixelGrid, width, height) {
54
- // BMP with 24-bit color (no alpha)
55
- const rowSize = Math.ceil((width * 3) / 4) * 4; // rows padded to 4-byte boundary
56
- const pixelDataSize = rowSize * height;
57
- const fileSize = 54 + pixelDataSize; // 14 (file header) + 40 (DIB header) + pixels
58
-
59
- const buf = Buffer.alloc(fileSize);
60
-
61
- // --- BMP File Header (14 bytes) ---
62
- buf.write('BM', 0); // signature
63
- buf.writeUInt32LE(fileSize, 2); // file size
64
- buf.writeUInt16LE(0, 6); // reserved1
65
- buf.writeUInt16LE(0, 8); // reserved2
66
- buf.writeUInt32LE(54, 10); // pixel data offset
67
-
68
- // --- DIB Header (BITMAPINFOHEADER, 40 bytes) ---
69
- buf.writeUInt32LE(40, 14); // DIB header size
70
- buf.writeInt32LE(width, 18); // width
71
- buf.writeInt32LE(height, 22); // height (positive = bottom-up)
72
- buf.writeUInt16LE(1, 26); // color planes
73
- buf.writeUInt16LE(24, 28); // bits per pixel
74
- buf.writeUInt32LE(0, 30); // compression (none)
75
- buf.writeUInt32LE(pixelDataSize, 34); // image size
76
- buf.writeInt32LE(2835, 38); // horizontal resolution (72 DPI)
77
- buf.writeInt32LE(2835, 42); // vertical resolution (72 DPI)
78
- buf.writeUInt32LE(0, 46); // colors in palette
79
- buf.writeUInt32LE(0, 50); // important colors
80
-
81
- // --- Pixel Data (bottom-up, BGR order) ---
82
- for (let y = 0; y < height; y++) {
83
- // BMP stores rows bottom-to-top
84
- const srcRow = pixelGrid[height - 1 - y];
85
- const rowOffset = 54 + y * rowSize;
86
-
87
- for (let x = 0; x < width; x++) {
88
- const char = srcRow[x] || '_';
89
- const color = COLORS[char] || COLORS['_'];
90
- const r = color[0], g = color[1], b = color[2];
91
-
92
- // BMP uses BGR byte order
93
- const pixelOffset = rowOffset + x * 3;
94
- buf[pixelOffset] = b;
95
- buf[pixelOffset + 1] = g;
96
- buf[pixelOffset + 2] = r;
97
- }
98
- // Padding bytes are already 0 from Buffer.alloc
99
- }
100
-
101
- return buf;
102
- }
103
-
104
- // Parse sprite into proper grid
105
- function parseSpriteGrid(spriteLines, width) {
106
- return spriteLines.map(line => {
107
- const chars = [];
108
- for (let i = 0; i < width; i++) {
109
- chars.push(line[i] || '_');
110
- }
111
- return chars;
112
- });
113
- }
114
-
115
- // Fill background with white for "transparent" pixels
116
- function fillBackground(grid) {
117
- return grid.map(row =>
118
- row.map(c => {
119
- if (c === '_') return '_';
120
- return c;
121
- })
122
- );
123
- }
124
-
125
- // Generate
126
- const grid = parseSpriteGrid(SPRITE, WIDTH);
127
- const bmpBuffer = createBMP(grid, WIDTH, HEIGHT);
128
-
129
- const outputPath = process.argv[2] || path.join(__dirname, 'pixel-robot.bmp');
130
- fs.writeFileSync(outputPath, bmpBuffer);
131
-
132
- console.log(`✓ Pixel art robot generated: ${outputPath}`);
133
- console.log(` Size: ${WIDTH}x${HEIGHT} pixels, ${bmpBuffer.length} bytes`);
134
- console.log(` Format: 24-bit BMP (uncompressed)`);
Binary file