@lardexx/arenacode 0.0.0-stage → 2.5.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/LICENSE +21 -0
- package/README.md +288 -2
- package/bin/arenacode.js +19 -0
- package/docs/ANALYSIS.md +201 -0
- package/docs/PUBLISHING.md +65 -0
- package/docs/TUI.md +114 -0
- package/docs/tui-approve.html +28 -0
- package/docs/tui-approve.png +0 -0
- package/docs/tui-home.html +28 -0
- package/docs/tui-home.png +0 -0
- package/docs/tui-palette.html +28 -0
- package/docs/tui-palette.png +0 -0
- package/docs/tui-plan.html +28 -0
- package/docs/tui-plan.png +0 -0
- package/docs/tui-preview.html +28 -0
- package/docs/tui-session.png +0 -0
- package/docs/tui-slash.html +28 -0
- package/package.json +32 -4
- package/src/bridge.js +135 -0
- package/src/cli.js +720 -0
- package/src/config.js +141 -0
- package/src/local.js +507 -0
- package/src/meta.js +143 -0
- package/src/prompts/agent-prompt.md +237 -0
- package/src/tui/app.js +1368 -0
- package/src/tui/dialogs.js +136 -0
- package/src/tui/keys.js +134 -0
- package/src/tui/logo.js +54 -0
- package/src/tui/render.js +256 -0
- package/src/tui/term.js +93 -0
- package/src/tui/theme.js +246 -0
- package/src/tui/widgets.js +374 -0
- package/src/turn.js +213 -0
- package/src/ui.js +130 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>arenacode TUI — snapshot</title>
|
|
6
|
+
<style>
|
|
7
|
+
:root { color-scheme: dark; }
|
|
8
|
+
html, body { background: #0a0a0a; }
|
|
9
|
+
body { margin:0; padding:30px; color:#eeeeee;
|
|
10
|
+
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono",
|
|
11
|
+
"Noto Sans Mono", "Liberation Mono", monospace; }
|
|
12
|
+
h1 { font-size:13px; font-weight:600; color:#808080; margin:0 0 6px; letter-spacing:.06em; text-transform:uppercase; }
|
|
13
|
+
p { color:#484848; font-size:12px; margin:0 0 18px; }
|
|
14
|
+
.frame { display:inline-block; background:#0a0a0a; border:1px solid #1e1e1e; border-radius:10px;
|
|
15
|
+
padding:14px 16px; box-shadow:0 18px 60px rgba(0,0,0,.55); }
|
|
16
|
+
/* line-height 1 is what keeps ▀/▄ blocks and painted backgrounds tiling with no seams */
|
|
17
|
+
pre { margin:0; font-size:13px; line-height:1; white-space:pre; letter-spacing:0;
|
|
18
|
+
font-variant-ligatures:none; font-kerning:none; tab-size:2;
|
|
19
|
+
text-rendering:geometricPrecision; -webkit-font-smoothing:antialiased; }
|
|
20
|
+
.ln { height:1em; line-height:1em; white-space:pre; }
|
|
21
|
+
.ln > span { display:inline; }
|
|
22
|
+
</style>
|
|
23
|
+
</head>
|
|
24
|
+
<body>
|
|
25
|
+
<h1>arenacode — terminal UI</h1>
|
|
26
|
+
<p>captured from a real pty · opencode-style layout, ANSI colours preserved</p>
|
|
27
|
+
<div class="frame"><pre><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> <span style="background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20);font-weight:700">Plan</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">esc</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20)">1. read hello.txt</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20)">2. run echo from-pc</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20)">3. report</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="background:rgb(250,178,131)"> </span><span style="color:rgb(10,10,10);background:rgb(250,178,131)">Approve</span><span style="background:rgb(250,178,131)"> </span><span style="color:rgb(10,10,10);background:rgb(250,178,131)">a</span><span style="background:rgb(250,178,131)"> </span> </div><div class="ln"> <span style="background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20)">Reject</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">r</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20)">Revise</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">f</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(37,62,98)">┃</span><span style="background:rgb(8,8,8)"> </span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(37,62,98)">┃</span><span style="background:rgb(8,8,8)"> </span><span style="color:rgb(95,95,95);background:rgb(8,8,8)">read hello.txt and ru</span><span style="color:rgb(95,95,95);background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20)">↑↓</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">select</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20)">enter</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">confirm</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20)">esc</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">cancel</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(37,62,98)">┃</span><span style="background:rgb(8,8,8)"> </span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(245,167,66)">⠙ Thinking: Looking at the folder</span> </div><div class="ln"> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20)">$</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20)">Plan to approve</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">1. read hello.txt</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">2. run echo from-pc</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">3. report</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(30,30,30)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(128,128,128);background:rgb(30,30,30)">Ask anything… "Read package.json and add a lint script"</span><span style="background:rgb(30,30,30)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(30,30,30)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(92,156,245);background:rgb(30,30,30)">Build</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(128,128,128);background:rgb(30,30,30)">·</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(238,238,238);background:rgb(30,30,30)">arenacode</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(128,128,128);background:rgb(30,30,30)">bridge 2.5.2</span><span style="background:rgb(30,30,30)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">╹</span><span style="color:rgb(30,30,30)">▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀</span> </div><div class="ln"> <span style="color:rgb(92,156,245)">⠙</span> <span style="color:rgb(128,128,128)">Plan to approve</span> <span style="color:rgb(238,238,238)">esc</span> <span style="color:rgb(128,128,128)">interrupt</span> </div><div class="ln"> </div><div class="ln"> <span style="color:rgb(128,128,128)">/tmp/arenacode-tui-Yni8YC/project</span> <span style="color:rgb(128,128,128)">eed49c · v2.5.2</span> </div></pre></div>
|
|
28
|
+
</body></html>
|
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>arenacode TUI — snapshot</title>
|
|
6
|
+
<style>
|
|
7
|
+
:root { color-scheme: dark; }
|
|
8
|
+
html, body { background: #0a0a0a; }
|
|
9
|
+
body { margin:0; padding:30px; color:#eeeeee;
|
|
10
|
+
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono",
|
|
11
|
+
"Noto Sans Mono", "Liberation Mono", monospace; }
|
|
12
|
+
h1 { font-size:13px; font-weight:600; color:#808080; margin:0 0 6px; letter-spacing:.06em; text-transform:uppercase; }
|
|
13
|
+
p { color:#484848; font-size:12px; margin:0 0 18px; }
|
|
14
|
+
.frame { display:inline-block; background:#0a0a0a; border:1px solid #1e1e1e; border-radius:10px;
|
|
15
|
+
padding:14px 16px; box-shadow:0 18px 60px rgba(0,0,0,.55); }
|
|
16
|
+
/* line-height 1 is what keeps ▀/▄ blocks and painted backgrounds tiling with no seams */
|
|
17
|
+
pre { margin:0; font-size:13px; line-height:1; white-space:pre; letter-spacing:0;
|
|
18
|
+
font-variant-ligatures:none; font-kerning:none; tab-size:2;
|
|
19
|
+
text-rendering:geometricPrecision; -webkit-font-smoothing:antialiased; }
|
|
20
|
+
.ln { height:1em; line-height:1em; white-space:pre; }
|
|
21
|
+
.ln > span { display:inline; }
|
|
22
|
+
</style>
|
|
23
|
+
</head>
|
|
24
|
+
<body>
|
|
25
|
+
<h1>arenacode — terminal UI</h1>
|
|
26
|
+
<p>captured from a real pty · opencode-style layout, ANSI colours preserved</p>
|
|
27
|
+
<div class="frame"><pre><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20)">read hello.txt and run a command</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(245,167,66)">⠙ Thinking: Looking at the folder</span> </div><div class="ln"> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">→</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20)">Reading file: hello.txt</span><span style="color:rgb(128,128,128);background:rgb(20,20,20)"> (23 B)</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">hello from the project</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">$</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20)">echo from-pc</span><span style="color:rgb(128,128,128);background:rgb(20,20,20)"> (exit 0)</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">from-pc</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">←</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(238,238,238);background:rgb(20,20,20)">Writing file: written.txt</span><span style="color:rgb(128,128,128);background:rgb(20,20,20)"> (17 B)</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(10,10,10)">┃</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">`write written.txt`</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(238,238,238)">All done: the client answered every card.</span> </div><div class="ln"> </div><div class="ln"> <span style="color:rgb(250,178,131)">▣</span> <span style="color:rgb(238,238,238)">Build</span><span style="color:rgb(128,128,128)"> · arenacode · 0.2s</span> </div><div class="ln"> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(30,30,30)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(128,128,128);background:rgb(30,30,30)">Ask anything… "Read package.json and add a lint script"</span><span style="background:rgb(30,30,30)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(30,30,30)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(92,156,245);background:rgb(30,30,30)">Build</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(128,128,128);background:rgb(30,30,30)">·</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(238,238,238);background:rgb(30,30,30)">arenacode</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(128,128,128);background:rgb(30,30,30)">bridge 2.5.2</span><span style="background:rgb(30,30,30)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">╹</span><span style="color:rgb(30,30,30)">▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀</span> </div><div class="ln"> <span style="color:rgb(238,238,238)">tab</span> <span style="color:rgb(128,128,128)">agents</span> <span style="color:rgb(238,238,238)">ctrl+p</span> <span style="color:rgb(128,128,128)">commands</span> </div><div class="ln"> </div><div class="ln"> <span style="color:rgb(128,128,128)">/tmp/arenacode-tui-4BFYh5/project</span> <span style="color:rgb(128,128,128)">1c4600 · v2.5.2</span> </div></pre></div>
|
|
28
|
+
</body></html>
|
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>arenacode TUI — snapshot</title>
|
|
6
|
+
<style>
|
|
7
|
+
:root { color-scheme: dark; }
|
|
8
|
+
html, body { background: #0a0a0a; }
|
|
9
|
+
body { margin:0; padding:30px; color:#eeeeee;
|
|
10
|
+
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono",
|
|
11
|
+
"Noto Sans Mono", "Liberation Mono", monospace; }
|
|
12
|
+
h1 { font-size:13px; font-weight:600; color:#808080; margin:0 0 6px; letter-spacing:.06em; text-transform:uppercase; }
|
|
13
|
+
p { color:#484848; font-size:12px; margin:0 0 18px; }
|
|
14
|
+
.frame { display:inline-block; background:#0a0a0a; border:1px solid #1e1e1e; border-radius:10px;
|
|
15
|
+
padding:14px 16px; box-shadow:0 18px 60px rgba(0,0,0,.55); }
|
|
16
|
+
/* line-height 1 is what keeps ▀/▄ blocks and painted backgrounds tiling with no seams */
|
|
17
|
+
pre { margin:0; font-size:13px; line-height:1; white-space:pre; letter-spacing:0;
|
|
18
|
+
font-variant-ligatures:none; font-kerning:none; tab-size:2;
|
|
19
|
+
text-rendering:geometricPrecision; -webkit-font-smoothing:antialiased; }
|
|
20
|
+
.ln { height:1em; line-height:1em; white-space:pre; }
|
|
21
|
+
.ln > span { display:inline; }
|
|
22
|
+
</style>
|
|
23
|
+
</head>
|
|
24
|
+
<body>
|
|
25
|
+
<h1>arenacode — terminal UI</h1>
|
|
26
|
+
<p>captured from a real pty · opencode-style layout, ANSI colours preserved</p>
|
|
27
|
+
<div class="frame"><pre><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> <span style="background:rgb(30,30,30)"> </span><span style="color:rgb(238,238,238);background:rgb(30,30,30);font-weight:700">/new</span><span style="color:rgb(128,128,128);background:rgb(30,30,30)"> Start a new session</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(128,128,128);background:rgb(30,30,30)">ctrl+x n</span><span style="background:rgb(30,30,30)"> </span> </div><div class="ln"> <span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">/tasks</span><span style="color:rgb(128,128,128);background:rgb(20,20,20)"> Show the task queue</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">ctrl+x l</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">/files</span><span style="color:rgb(128,128,128);background:rgb(20,20,20)"> Browse the workspace files</span><span style="background:rgb(20,20,20)"> </span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">/mode</span><span style="color:rgb(128,128,128);background:rgb(20,20,20)"> Switch agent / plan</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">tab</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">/theme</span><span style="color:rgb(128,128,128);background:rgb(20,20,20)"> Cycle the colour theme</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">ctrl+x t</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">/status</span><span style="color:rgb(128,128,128);background:rgb(20,20,20)"> Ping the bridge</span><span style="background:rgb(20,20,20)"> </span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">/help</span><span style="color:rgb(128,128,128);background:rgb(20,20,20)"> Every keybinding</span><span style="background:rgb(20,20,20)"> </span><span style="color:rgb(128,128,128);background:rgb(20,20,20)">f1</span><span style="background:rgb(20,20,20)"> </span> </div><div class="ln"> <span style="color:rgb(250,178,131)">/connect</span><span style="color:rgb(128,128,128)"> bridge offline at http://127.0.0.1:9</span> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(30,30,30)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(238,238,238);background:rgb(30,30,30)">/</span><span style="background:rgb(30,30,30)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(30,30,30)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">┃</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(92,156,245);background:rgb(30,30,30)">Build</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(128,128,128);background:rgb(30,30,30)">·</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(238,238,238);background:rgb(30,30,30)">arenacode</span><span style="background:rgb(30,30,30)"> </span><span style="color:rgb(128,128,128);background:rgb(30,30,30)">bridge 2.5.2</span><span style="background:rgb(30,30,30)"> </span> </div><div class="ln"> <span style="color:rgb(92,156,245)">╹</span><span style="color:rgb(30,30,30)">▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀</span> </div><div class="ln"> <span style="color:rgb(238,238,238)">tab</span> <span style="color:rgb(128,128,128)">agents</span> <span style="color:rgb(238,238,238)">ctrl+p</span> <span style="color:rgb(128,128,128)">commands</span> </div><div class="ln"> </div><div class="ln"> <span style="color:rgb(245,167,66)">● Tip </span><span style="color:rgb(128,128,128)">Press </span><span style="color:rgb(238,238,238)">ctrl+p</span><span style="color:rgb(128,128,128)"> for every command</span> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> </div><div class="ln"> <span style="color:rgb(128,128,128)">~/arenacode-cli</span> <span style="color:rgb(128,128,128)">v2.5.2</span> </div><div class="ln">Script done on 2026-11-02 16:40:06+00:00 [COMMAND_EXIT_CODE="0"]</div><div class="ln"> </div></pre></div>
|
|
28
|
+
</body></html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lardexx/arenacode",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "2.5.2",
|
|
4
|
+
"description": "Terminal client for ArenaCode: talks to an arena-bridge, streams the Agent Mode timeline, and runs local commands and file operations on your PC. Node port of the ArenaCode desktop client.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"bin": {
|
|
8
|
+
"arenacode": "bin/arenacode.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "src/cli.js",
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=18.0.0"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin/",
|
|
16
|
+
"src/",
|
|
17
|
+
"docs/",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"test": "node test/integration.js"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"arenacode",
|
|
26
|
+
"arena-bridge",
|
|
27
|
+
"cli",
|
|
28
|
+
"agent",
|
|
29
|
+
"tunnel"
|
|
30
|
+
],
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/src/bridge.js
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { VERSION } = require('./config');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* HTTP client for arena-bridge 2.5.x.
|
|
7
|
+
*
|
|
8
|
+
* Wire format reproduced from the ArenaCode desktop client:
|
|
9
|
+
* Content-Type: application/json
|
|
10
|
+
* Authorization: Bearer <API key>
|
|
11
|
+
* X-Arena-Device: <machine id>
|
|
12
|
+
* User-Agent: ArenaCode/1.0
|
|
13
|
+
*/
|
|
14
|
+
class Bridge {
|
|
15
|
+
constructor(url, key, device) {
|
|
16
|
+
this.url = String(url).replace(/\/+$/, '');
|
|
17
|
+
this.key = key || '';
|
|
18
|
+
this.device = device || '';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
headers(extra = {}) {
|
|
22
|
+
const h = {
|
|
23
|
+
'Content-Type': 'application/json',
|
|
24
|
+
'User-Agent': `ArenaCode/${VERSION}`,
|
|
25
|
+
...extra,
|
|
26
|
+
};
|
|
27
|
+
if (this.key) h.Authorization = `Bearer ${this.key}`;
|
|
28
|
+
if (this.device) h['X-Arena-Device'] = this.device;
|
|
29
|
+
return h;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async request(method, path, { body, timeout = 30_000, raw = false, headers = {} } = {}) {
|
|
33
|
+
const controller = new AbortController();
|
|
34
|
+
const timer = setTimeout(() => controller.abort(), timeout);
|
|
35
|
+
try {
|
|
36
|
+
const res = await fetch(this.url + path, {
|
|
37
|
+
method,
|
|
38
|
+
headers: this.headers(headers),
|
|
39
|
+
body: body === undefined ? undefined : typeof body === 'string' || Buffer.isBuffer(body) ? body : JSON.stringify(body),
|
|
40
|
+
signal: controller.signal,
|
|
41
|
+
});
|
|
42
|
+
if (raw) {
|
|
43
|
+
return { status: res.status, buffer: Buffer.from(await res.arrayBuffer()), headers: res.headers };
|
|
44
|
+
}
|
|
45
|
+
const text = await res.text();
|
|
46
|
+
let json = null;
|
|
47
|
+
try {
|
|
48
|
+
json = text ? JSON.parse(text) : null;
|
|
49
|
+
} catch {
|
|
50
|
+
json = { raw: text };
|
|
51
|
+
}
|
|
52
|
+
return { status: res.status, json, text };
|
|
53
|
+
} catch (e) {
|
|
54
|
+
const reason = e.name === 'AbortError' ? `timeout after ${Math.round(timeout / 1000)}s` : e.message;
|
|
55
|
+
return { status: 0, json: { error: `bridge non raggiungibile: ${reason}` }, text: '' };
|
|
56
|
+
} finally {
|
|
57
|
+
clearTimeout(timer);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// --- endpoints ---------------------------------------------------------
|
|
62
|
+
health() {
|
|
63
|
+
return this.request('GET', '/health', { timeout: 8000 });
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
authCheck() {
|
|
67
|
+
return this.request('GET', '/auth/check', { timeout: 8000 });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
createTask(payload) {
|
|
71
|
+
return this.request('POST', '/task', { body: payload, timeout: 30_000 });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
getTask(taskId) {
|
|
75
|
+
return this.request('GET', `/task/${encodeURIComponent(taskId)}`);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
listTasks(state = 'all') {
|
|
79
|
+
return this.request('GET', `/tasks?state=${encodeURIComponent(state)}`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Long-poll of the Agent Mode timeline. The bridge answers as soon as there is
|
|
84
|
+
* an event with cursor > since, or after `wait` seconds (max 25).
|
|
85
|
+
*/
|
|
86
|
+
events(taskId, since = 0, wait = 25) {
|
|
87
|
+
return this.request(
|
|
88
|
+
'GET',
|
|
89
|
+
`/task/${encodeURIComponent(taskId)}/events?format=json&since=${since}&wait=${wait}`,
|
|
90
|
+
{ timeout: (wait + 15) * 1000 },
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
cancel(taskId) {
|
|
95
|
+
return this.request('POST', `/task/${encodeURIComponent(taskId)}/cancel`, { body: {} });
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
localResult(taskId, payload) {
|
|
99
|
+
return this.request('POST', `/task/${encodeURIComponent(taskId)}/local-result`, { body: payload, timeout: 60_000 });
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
localState(taskId, allow) {
|
|
103
|
+
return this.request('POST', `/task/${encodeURIComponent(taskId)}/local-state`, { body: { allow } });
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
userEvent(taskId, payload) {
|
|
107
|
+
return this.request('POST', `/task/${encodeURIComponent(taskId)}/user-event`, { body: payload });
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
uiPayload(taskId, rid) {
|
|
111
|
+
return this.request('GET', `/task/${encodeURIComponent(taskId)}/ui-payload/${encodeURIComponent(rid)}`);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
fs(relPath = '') {
|
|
115
|
+
return this.request('GET', `/fs?path=${encodeURIComponent(relPath)}`);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
file(relPath) {
|
|
119
|
+
return this.request('GET', `/file?path=${encodeURIComponent(relPath)}`);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
fileRaw(relPath) {
|
|
123
|
+
return this.request('GET', `/file?path=${encodeURIComponent(relPath)}&raw=1`, { raw: true, timeout: 60_000 });
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
upload(relPath, buffer) {
|
|
127
|
+
return this.request('POST', `/upload?path=${encodeURIComponent(relPath)}`, {
|
|
128
|
+
body: buffer,
|
|
129
|
+
headers: { 'Content-Type': 'application/octet-stream' },
|
|
130
|
+
timeout: 120_000,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
module.exports = { Bridge };
|