@flame0510/project-aether 1.8.0 → 1.9.1

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.
@@ -1,10 +1,5 @@
1
- import { Skeleton, CardRowSkeleton } from '../components/Skeleton';
1
+ import { ListPageSkeleton } from '../components/Skeleton';
2
2
 
3
- const PageSkeleton = () => (
4
- <div style={{ padding: '24px 20px', maxWidth: 1080, margin: '0 auto' }}>
5
- <Skeleton width={120} height={20} accent style={{ marginBottom: 20 }} />
6
- <CardRowSkeleton count={5} height={48} />
7
- </div>
8
- );
9
-
10
- export default PageSkeleton;
3
+ export default function MemoryLoading() {
4
+ return <ListPageSkeleton />;
5
+ }
@@ -1,10 +1,5 @@
1
- import { Skeleton, CardRowSkeleton } from '../components/Skeleton';
1
+ import { ListPageSkeleton } from '../components/Skeleton';
2
2
 
3
- const PageSkeleton = () => (
4
- <div style={{ padding: '24px 20px', maxWidth: 1080, margin: '0 auto' }}>
5
- <Skeleton width={120} height={20} accent style={{ marginBottom: 20 }} />
6
- <CardRowSkeleton count={5} height={48} />
7
- </div>
8
- );
9
-
10
- export default PageSkeleton;
3
+ export default function PluginsLoading() {
4
+ return <ListPageSkeleton />;
5
+ }
@@ -1,10 +1,5 @@
1
- import { Skeleton, CardRowSkeleton } from '../components/Skeleton';
1
+ import { ListPageSkeleton } from '../components/Skeleton';
2
2
 
3
- const PageSkeleton = () => (
4
- <div style={{ padding: '24px 20px', maxWidth: 1080, margin: '0 auto' }}>
5
- <Skeleton width={120} height={20} accent style={{ marginBottom: 20 }} />
6
- <CardRowSkeleton count={5} height={48} />
7
- </div>
8
- );
9
-
10
- export default PageSkeleton;
3
+ export default function SkillsLoading() {
4
+ return <ListPageSkeleton />;
5
+ }
@@ -1,10 +1,5 @@
1
- import { Skeleton, CardRowSkeleton } from '../components/Skeleton';
1
+ import { ListPageSkeleton } from '../components/Skeleton';
2
2
 
3
- const PageSkeleton = () => (
4
- <div style={{ padding: '24px 20px', maxWidth: 1080, margin: '0 auto' }}>
5
- <Skeleton width={120} height={20} accent style={{ marginBottom: 20 }} />
6
- <CardRowSkeleton count={5} height={48} />
7
- </div>
8
- );
9
-
10
- export default PageSkeleton;
3
+ export default function ToolsLoading() {
4
+ return <ListPageSkeleton />;
5
+ }
package/bin/rev4a.js CHANGED
@@ -513,14 +513,18 @@ function serve(port) {
513
513
 
514
514
  const children = [];
515
515
  const wsPort = process.env.TERMINAL_WS_PORT || '3741';
516
+ // Shared by server.js (which forwards the terminal WebSocket after checking the session)
517
+ // and the terminal server (which refuses anything without it). New at every start.
518
+ const terminalSecret = require('crypto').randomBytes(32).toString('hex');
516
519
 
517
520
  log('SERVE', `Starting Rev4a on port ${port}…`);
518
521
 
519
- // Next.js
520
- const next = spawn('npx', ['next', 'start', '-p', String(port)], {
522
+ // Next.js, through server.js: the same pages and API, plus the terminal WebSocket on
523
+ // this port (so the terminal needs no reverse proxy in front).
524
+ const next = spawn(process.execPath, ['server.js'], {
521
525
  cwd: ROOT,
522
526
  stdio: 'inherit',
523
- env: childEnv,
527
+ env: { ...childEnv, TERMINAL_WS_PORT: wsPort, REV4A_TERMINAL_SECRET: terminalSecret },
524
528
  });
525
529
  children.push(next);
526
530
  log('SERVE', `Next.js PID ${next.pid}`);
@@ -538,7 +542,7 @@ function serve(port) {
538
542
  const ws = spawn(process.execPath, ['terminal-ws-server.js'], {
539
543
  cwd: ROOT,
540
544
  stdio: 'inherit',
541
- env: { ...childEnv, TERMINAL_WS_PORT: wsPort },
545
+ env: { ...childEnv, TERMINAL_WS_PORT: wsPort, REV4A_TERMINAL_SECRET: terminalSecret },
542
546
  });
543
547
  children.push(ws);
544
548
  log('SERVE', `Terminal WS PID ${ws.pid}`);
@@ -72,7 +72,7 @@
72
72
 
73
73
  **Credentials vault:** The `/credentials` page stores third-party service tokens in `credentials.db` and installs them into containers on explicit sync. Provider API keys live separately in `provider-keys.json`, managed from the Gateway UI.
74
74
 
75
- **Container management UI:** The `/containers` page lists all Docker containers, running or stopped, with status, image, IP and ports, and opens a web terminal into any of them. Fully functional. (Machine CPU, RAM and disk are on `/system`.)
75
+ **Container management UI:** The `/containers` page lists all Docker containers, running or stopped, with status, image, IP and ports, and opens a web terminal into any running one. Fully functional. (Machine CPU, RAM and disk are on `/system`.)
76
76
 
77
77
  **Workspace API:** Lazy-loaded file tree explorer with real-time reads (no caching), supports both host and container workspaces via `docker exec`.
78
78
 
@@ -81,7 +81,7 @@
81
81
  | Feature | Status | Notes |
82
82
  |---|---|---|
83
83
  | Credentials (UI + API) | 🟢 Implemented | SQLite, no encryption yet |
84
- | Container page | 🟢 Functional | Lists all containers, web terminal |
84
+ | Container page | 🟢 Functional | Lists all containers, web terminal (xterm.js, no proxy needed) |
85
85
  | Agent creation wizard | 🟢 Implemented | One-click create with model/template selection |
86
86
  | Provider proxy | 🟢 Implemented | Agents route through Rev4a provider gateway |
87
87
  | Shared volumes | 🟢 Implemented | Skills + repos mounted on all agents |
@@ -749,39 +749,29 @@ ALTER TABLE sessions ADD COLUMN ended_at INTEGER;
749
749
 
750
750
  ## 11. Container Terminal
751
751
 
752
- Rev4a provides a real, interactive terminal for any agent container via
753
- a WebSocket-connected PTY. The implementation is documented in detail in
752
+ Rev4a provides a real, interactive terminal (xterm.js in the browser, a PTY via
753
+ `node-pty` on the host) for any running container. Details in
754
754
  [docs/CONTAINER-TERMINAL.md](CONTAINER-TERMINAL.md).
755
755
 
756
- ### Two-process architecture
757
-
758
756
  | Process | Port | Role |
759
757
  |---|---|---|
760
- | Next.js (`next start`) | 3740 | Serves the terminal page, auth, API |
761
- | `terminal-ws-server.js` | 3741 (127.0.0.1) | WebSocket PTY server via `node-pty` |
762
-
763
- Both are started by `rev4a serve`; the terminal server is a process of its own to avoid
764
- event-loop contention with Next.js during high-throughput I/O. It has no authentication
765
- of its own and is reachable only through a reverse proxy route (see
766
- [CONTAINER-TERMINAL.md](CONTAINER-TERMINAL.md#routing)).
767
-
768
- ### Why custom DOM over xterm.js
769
-
770
- The initial implementation used xterm.js (both canvas and DOM renderers).
771
- Both suffered from black-screen-on-large-output and broken scrolling due to
772
- CSS conflicts. The current implementation uses a plain `<div>` with native
773
- browser scrolling and a hidden `<textarea>` for input — stable under any
774
- output volume.
758
+ | `server.js` | 3740 | Next.js (pages, API) plus the WebSocket upgrade on `/api/terminal-ws` |
759
+ | `terminal-ws-server.js` | 3741 (127.0.0.1) | The PTYs and their sessions |
775
760
 
776
- See [CONTAINER-TERMINAL.md](CONTAINER-TERMINAL.md#terminal-client-browser)
777
- for the full rationale.
761
+ Both are started by `rev4a serve`. The browser opens the terminal on the dashboard's own
762
+ port, so no reverse proxy is needed. `server.js` checks the session cookie, the Origin and
763
+ the container name, then forwards the handshake with a per-boot secret the terminal server
764
+ requires; the terminal server is a process of its own so heavy shell output never stalls
765
+ the dashboard. A shell survives a dropped connection for 2 minutes and is resumed by the
766
+ same session id.
778
767
 
779
768
  ## 12. Technology Stack
780
769
 
781
770
  | Layer | Technology | Notes |
782
771
  |---|---|---|
783
772
  | Orchestrator | Docker / Docker Compose | Already in use |
784
- | Dashboard | Next.js 16 + React 19 | Current Rev4a |
773
+ | Dashboard | Next.js 16 + React 19 | Current Rev4a, served by `server.js` (Next's programmatic API) |
774
+ | Container terminal | xterm.js 6 (browser) + node-pty + `ws` | `docker exec` PTYs, sessions resumable for 2 minutes — `docs/CONTAINER-TERMINAL.md` |
785
775
  | Provider Gateway | Express/Fastify (Node.js) | To implement in Rev4a |
786
776
  | Database | SQLite (WAL mode) | Current `events.db`, may need to scale |
787
777
  | Memory | Per-agent SQLite + central index | New |