@shapeshift-labs/frontier-loom-ui 0.1.0
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 +28 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +105 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.js +3827 -0
- package/dist/client.js.map +1 -0
- package/dist/frontier.d.ts +1 -0
- package/dist/frontier.js +37 -0
- package/dist/frontier.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/public/index.html +16 -0
- package/dist/public/styles.css +3278 -0
- package/dist/server.d.ts +113 -0
- package/dist/server.js +1731 -0
- package/dist/server.js.map +1 -0
- package/features/loom-ui-dashboard.json +28 -0
- package/frontier.config.mjs +39 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @shapeshift-labs/frontier-loom-ui
|
|
2
|
+
|
|
3
|
+
Full-height dark operator UI for Loom and Frontier swarm runs.
|
|
4
|
+
|
|
5
|
+
The UI reads the dashboard snapshot API from `@shapeshift-labs/frontier-swarm-codex`. It does not parse swarm internals directly, and the browser surface is read-only: it focuses on run health, lane selection, jobs, evidence/admission status, recent events, and loaded sources.
|
|
6
|
+
|
|
7
|
+
The overview and success views surface landed/applied ledger counts, run health, token load, and timing summaries with compact dark cards. The metrics view includes small, dependency-free dark chart primitives for API-provided run health, bucketed time-series progress, context/token load, failure and ownership pressure, and semantic admission counts when those fields are present in the snapshot. Older snapshots still render from jobs and events as a fallback. The page remains full-height with scroll-contained panels so dense runs do not push the document body.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
frontier-loom-ui --run agent-runs/my-run
|
|
11
|
+
frontier-loom-ui --collection agent-runs/my-run/collected
|
|
12
|
+
frontier-loom-ui --continuation agent-runs/my-run/continuation
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Loom can launch the same package:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
loom ui --collection agent-runs/my-run/collected
|
|
19
|
+
loom swarm dashboard --run agent-runs/my-run
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The browser app is rendered with Frontier DOM JSX via `@shapeshift-labs/frontier-dom/jsx-runtime`; `frontier.config.mjs` declares the Frontier Framework surface and route evidence. The app frame separates API availability from run health, so an online dashboard with rejected or attention-needed jobs is shown as an online service with run issues rather than as an offline UI.
|
|
23
|
+
|
|
24
|
+
## Near-term UI Backlog
|
|
25
|
+
|
|
26
|
+
- `History`: a read-only git-style graph of worker outputs, coordinator joins, semantic replay outcomes, and landed changes. The tab should focus on the visual graph first, with hover/details for ticket id, files, evidence, tests, model/panel result, and acceptance or rejection reason.
|
|
27
|
+
- `Performance`: a chart-first view of tokens, runtime, cache hit rate, waste, and outcome quality over time. This needs a charting-library research pass before implementation, and should include whether panel, tournament, or RSI routing changes are improving workflow efficiency across runs.
|
|
28
|
+
- `Testing`: a high-level quality view for active work and the broader project. It should show pass/fail state, fuzzing results, oracle coverage, recent failures, and whether each active task has enough verification evidence. Raw run artifacts should remain ticket drill-downs rather than becoming the top-level tab.
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import { pathToFileURL } from 'node:url';
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import { startLoomUiServer } from './index.js';
|
|
6
|
+
export async function runFrontierLoomUiCli(argv = process.argv.slice(2)) {
|
|
7
|
+
const args = parseArgs(argv);
|
|
8
|
+
try {
|
|
9
|
+
if (args.help === true || args.h === true || args._[0] === 'help') {
|
|
10
|
+
printHelp();
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
const port = optionalNumberArg(args.port, 'port');
|
|
14
|
+
const result = await startLoomUiServer({
|
|
15
|
+
cwd: stringArg(args.cwd),
|
|
16
|
+
run: stringArg(args.run),
|
|
17
|
+
collection: stringArg(args.collection),
|
|
18
|
+
continuation: stringArg(args.continuation),
|
|
19
|
+
host: stringArg(args.host),
|
|
20
|
+
port
|
|
21
|
+
});
|
|
22
|
+
if (args.json === true)
|
|
23
|
+
process.stdout.write(JSON.stringify({ ok: true, url: result.url }, null, 2) + '\n');
|
|
24
|
+
else
|
|
25
|
+
process.stdout.write(`frontier-loom-ui listening at ${result.url}\n`);
|
|
26
|
+
if (args.open === true)
|
|
27
|
+
openUrl(result.url);
|
|
28
|
+
return 0;
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
32
|
+
return 1;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function parseArgs(argv) {
|
|
36
|
+
const out = { _: [] };
|
|
37
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
38
|
+
const token = argv[index];
|
|
39
|
+
if (!token.startsWith('--')) {
|
|
40
|
+
out._.push(token);
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
const equalsIndex = token.indexOf('=');
|
|
44
|
+
const key = equalsIndex === -1 ? token.slice(2) : token.slice(2, equalsIndex);
|
|
45
|
+
const value = equalsIndex === -1
|
|
46
|
+
? (argv[index + 1] && !argv[index + 1].startsWith('--') ? argv[++index] : true)
|
|
47
|
+
: token.slice(equalsIndex + 1);
|
|
48
|
+
if (out[key] === undefined)
|
|
49
|
+
out[key] = value;
|
|
50
|
+
else if (Array.isArray(out[key]))
|
|
51
|
+
out[key].push(String(value));
|
|
52
|
+
else
|
|
53
|
+
out[key] = [String(out[key]), String(value)];
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
function stringArg(value) {
|
|
58
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
59
|
+
}
|
|
60
|
+
function optionalNumberArg(value, name) {
|
|
61
|
+
if (value === undefined)
|
|
62
|
+
return undefined;
|
|
63
|
+
if (typeof value !== 'string' || value.length === 0)
|
|
64
|
+
throw new Error(`--${name} requires a number`);
|
|
65
|
+
const parsed = Number(value);
|
|
66
|
+
if (!Number.isInteger(parsed) || parsed < 0 || parsed > 65_535)
|
|
67
|
+
throw new Error(`--${name} must be an integer between 0 and 65535`);
|
|
68
|
+
return parsed;
|
|
69
|
+
}
|
|
70
|
+
function openUrl(url) {
|
|
71
|
+
const command = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'cmd' : 'xdg-open';
|
|
72
|
+
const args = process.platform === 'win32' ? ['/c', 'start', '', url] : [url];
|
|
73
|
+
const child = spawn(command, args, { stdio: 'ignore', detached: true });
|
|
74
|
+
child.unref();
|
|
75
|
+
}
|
|
76
|
+
function printHelp() {
|
|
77
|
+
process.stdout.write([
|
|
78
|
+
'frontier-loom-ui [options]',
|
|
79
|
+
'',
|
|
80
|
+
'Options:',
|
|
81
|
+
' --run <dir|swarm-results.json>',
|
|
82
|
+
' --collection <dir|collection.json>',
|
|
83
|
+
' --continuation <dir|continuation.json>',
|
|
84
|
+
' --host <host> --port <port>',
|
|
85
|
+
' --open',
|
|
86
|
+
' --json',
|
|
87
|
+
''
|
|
88
|
+
].join('\n'));
|
|
89
|
+
}
|
|
90
|
+
function isCliEntrypoint() {
|
|
91
|
+
if (!process.argv[1])
|
|
92
|
+
return false;
|
|
93
|
+
try {
|
|
94
|
+
return pathToFileURL(fs.realpathSync(process.argv[1])).href === import.meta.url;
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (isCliEntrypoint()) {
|
|
101
|
+
runFrontierLoomUiCli().then((code) => {
|
|
102
|
+
process.exitCode = code;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
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