| 81 | } else if (arg === '--help' || arg === '-h') { |
| 82 | options.help = true; |
| 83 | } |
| 84 | } |
| 85 | return options; |
| 86 | } |
| 87 | |
| 88 | function usage() { |
| 89 | return [ |
| 90 | 'Usage: node scripts/dashboard-server.js [--port 4180] [--project-root <path>] [--open]', |
| 91 | '', |
| 92 | 'Serves local Mission Control over canonical .planning/ state.', |
| 93 | 'Binds to 127.0.0.1 only. See docs/DASHBOARD_SPEC.md.', |
| 94 | ].join('\n'); |
| 95 | } |
| 96 | |
| 97 | // --------------------------------------------------------------------------- |
| 98 | // Data collection (cached, invalidated by watcher or TTL) |
| 99 | // --------------------------------------------------------------------------- |
| 100 | |
| 101 | function createDataSource(projectRoot) { |
| 102 | const state = { cache: null, collectedAt: 0, dirty: true }; |
| 103 | |