freddie 0.0.55 → 0.0.57
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "freddie",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.57",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Open JS agent harness built on pi-mono, floosie, xstate, and anentrypoint-design",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"@mariozechner/pi-ai": "^0.70.6",
|
|
18
18
|
"@mariozechner/pi-coding-agent": "^0.70.6",
|
|
19
19
|
"@mariozechner/pi-tui": "^0.70.6",
|
|
20
|
-
"anentrypoint-design": "^0.0.29",
|
|
21
20
|
"commander": "^14.0.0",
|
|
22
21
|
"express": "^5.0.0",
|
|
23
22
|
"flatspace": "^1.0.18",
|
package/src/web/server.js
CHANGED
|
@@ -10,14 +10,17 @@ export async function createDashboard({ port = 0 } = {}) {
|
|
|
10
10
|
const app = express()
|
|
11
11
|
app.use(express.json())
|
|
12
12
|
app.use(express.static(__dirname))
|
|
13
|
-
|
|
13
|
+
const vendored = path.join(__dirname, 'vendor', 'anentrypoint-design', 'dist')
|
|
14
|
+
const fromNodeModules = path.join(__dirname, '..', '..', 'node_modules', 'anentrypoint-design', 'dist')
|
|
15
|
+
const fs = await import('node:fs')
|
|
16
|
+
const designDist = fs.existsSync(vendored) ? vendored : fromNodeModules
|
|
17
|
+
app.use('/vendor/anentrypoint-design', express.static(designDist))
|
|
14
18
|
for (const r of host.gui.routes.list()) {
|
|
15
19
|
const verb = r.method.toLowerCase()
|
|
16
20
|
if (typeof app[verb] === 'function') app[verb](r.path, r.handler)
|
|
17
21
|
}
|
|
18
22
|
const debugApi = host.gui._state.apis.get('debug')
|
|
19
23
|
if (debugApi?.attach) debugApi.attach(app)
|
|
20
|
-
const server = await new Promise((res, rej) => { const s = app.listen(port, () => res(s)); s.once('error', rej) })
|
|
21
|
-
const actualPort = server.address().port
|
|
24
|
+
const { server, actualPort } = await new Promise((res, rej) => { const s = app.listen(port, () => res({ server: s, actualPort: s.address().port })); s.once('error', rej) })
|
|
22
25
|
return { server, port: actualPort, url: `http://127.0.0.1:${actualPort}/`, stop: () => new Promise(r => server.close(() => r())) }
|
|
23
26
|
}
|