@cef-ai/cli 0.2.1 → 0.2.2

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 CHANGED
@@ -1007,8 +1007,8 @@ Create a `.env` file in the same directory as your `cef.config.yaml`:
1007
1007
 
1008
1008
  ```bash
1009
1009
  CEF_AUTH_TOKEN=your-jwt-token-here
1010
- CEF_ORCHESTRATOR_URL=https://compute-1.devnet.ddc-dragon.com/orchestrator
1011
- CEF_ROB_API_URL=https://api.rob.dev.cere.io/rms-node-backend
1010
+ CEF_ORCHESTRATOR_URL=https://orchestrator.compute.test.ddcdragon.com
1011
+ CEF_ROB_API_URL=https://rob.compute.test.ddcdragon.com/rms-node-backend
1012
1012
  ```
1013
1013
 
1014
1014
  | Variable | Required For | Description |
@@ -1,7 +1,32 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
1
4
  import http from 'http';
2
5
  import { WebSocketServer } from 'ws';
3
- import { getDevUiHtml } from './ui.js';
6
+ const STATIC_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), 'static');
7
+ const MIME_TYPES = {
8
+ '.html': 'text/html; charset=utf-8',
9
+ '.css': 'text/css; charset=utf-8',
10
+ '.js': 'application/javascript; charset=utf-8',
11
+ };
12
+ function loadStaticFiles() {
13
+ const files = new Map();
14
+ for (const name of fs.readdirSync(STATIC_DIR)) {
15
+ const ext = path.extname(name);
16
+ const contentType = MIME_TYPES[ext];
17
+ if (!contentType)
18
+ continue;
19
+ const content = fs.readFileSync(path.join(STATIC_DIR, name));
20
+ files.set('/' + name, { content, contentType });
21
+ }
22
+ // Alias "/" to "/index.html"
23
+ const index = files.get('/index.html');
24
+ if (index)
25
+ files.set('/', index);
26
+ return files;
27
+ }
4
28
  export function createDevServer(runtime, options) {
29
+ const staticFiles = loadStaticFiles();
5
30
  const wsClients = new Set();
6
31
  // Stream logs and trace events to WebSocket clients
7
32
  const broadcast = (msg) => {
@@ -94,11 +119,14 @@ export function createDevServer(runtime, options) {
94
119
  return;
95
120
  }
96
121
  }
97
- // ─── Dev UI ──────────────────────────────────────────────────
98
- if (req.method === 'GET' && (pathname === '/' || pathname === '/index.html')) {
99
- res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
100
- res.end(getDevUiHtml());
101
- return;
122
+ // ─── Static files (Dev UI) ──────────────────────────────────
123
+ if (req.method === 'GET') {
124
+ const file = staticFiles.get(pathname);
125
+ if (file) {
126
+ res.writeHead(200, { 'Content-Type': file.contentType });
127
+ res.end(file.content);
128
+ return;
129
+ }
102
130
  }
103
131
  // ─── 404 ────────────────────────────────────────────────────
104
132
  json(res, { error: 'Not found' }, 404);