bluedither 1.0.9 → 1.0.10

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.
@@ -276,8 +276,26 @@ const server = createServer((req, res) => {
276
276
  }
277
277
  });
278
278
 
279
- server.listen(PORT, () => {
280
- console.log(`\n BlueDither Fine-Tuner running at http://localhost:${PORT}\n`);
279
+ server.on('error', (err) => {
280
+ if (err.code === 'EADDRINUSE') {
281
+ const nextPort = server._bdPort + 1;
282
+ if (nextPort > PORT + 20) {
283
+ console.error(`\n ✗ Could not find an available port (tried ${PORT}–${nextPort - 1}).\n`);
284
+ process.exit(1);
285
+ }
286
+ server._bdPort = nextPort;
287
+ server.listen(nextPort);
288
+ } else {
289
+ throw err;
290
+ }
291
+ });
292
+
293
+ server.on('listening', () => {
294
+ const actualPort = server.address().port;
295
+ console.log(`\n BlueDither Fine-Tuner running at http://localhost:${actualPort}\n`);
281
296
  console.log(` Tokens: ${TOKENS_PATH}`);
282
297
  console.log(` Edit in browser → hit Commit → tokens.json updated on disk.\n`);
283
298
  });
299
+
300
+ server._bdPort = PORT;
301
+ server.listen(PORT);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluedither",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "A bold, dithered-shader hero theme for Claude Code — skill + fine-tuner",
5
5
  "type": "module",
6
6
  "bin": {