@mmmbuto/nexuscrew 0.7.5 → 0.7.7
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 +22 -3
- package/frontend/dist/assets/index-DUbtTZMj.css +32 -0
- package/frontend/dist/assets/index-EVa9bnAC.js +81 -0
- package/frontend/dist/index.html +2 -2
- package/lib/cli/commands.js +48 -1
- package/lib/cli/fleet-service.js +306 -0
- package/lib/cli/init.js +68 -1
- package/lib/files/routes.js +4 -1
- package/lib/fleet/boot.js +62 -0
- package/lib/fleet/builtin.js +477 -0
- package/lib/fleet/definitions.js +384 -0
- package/lib/fleet/index.js +49 -10
- package/lib/fleet/provider.js +102 -0
- package/lib/fleet/routes.js +77 -8
- package/lib/fs/routes.js +56 -0
- package/lib/server.js +8 -3
- package/package.json +2 -2
- package/frontend/dist/assets/index-BWhSqR3J.css +0 -32
- package/frontend/dist/assets/index-Bx8vdLZY.css +0 -32
- package/frontend/dist/assets/index-CLb2xmyu.js +0 -81
- package/frontend/dist/assets/index-CgxfkmRo.js +0 -81
- package/frontend/dist/assets/index-DQMx2p4x.js +0 -81
- package/frontend/dist/assets/index-DWhfVwKW.css +0 -32
- package/frontend/dist/assets/index-DoPZ_3-h.js +0 -81
- package/frontend/dist/assets/index-o9l7pPAf.css +0 -32
- package/frontend/dist/assets/index-q9PUrGO0.js +0 -81
package/lib/fleet/routes.js
CHANGED
|
@@ -1,14 +1,39 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
const express = require('express');
|
|
3
3
|
|
|
4
|
+
// Capability minime del contratto storico per i fleet external/legacy che NON
|
|
5
|
+
// dichiarano capabilities() (design §9c): status/up/down/engine/boot.
|
|
6
|
+
// Il built-in B4 aggiunge define/edit/remove/schema.
|
|
7
|
+
const DEFAULT_CAPS = ['status', 'up', 'down', 'engine', 'boot'];
|
|
8
|
+
|
|
9
|
+
function capList(fleet) {
|
|
10
|
+
return typeof fleet.capabilities === 'function' ? fleet.capabilities() : DEFAULT_CAPS;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Design §9c: una route per un metodo non supportato dal provider ritorna 501
|
|
14
|
+
// (mai 404/502 ambigui). Gli errori nativi del builtin (400/403/409) passano
|
|
15
|
+
// invece nel guard con il loro status.
|
|
16
|
+
function requireCap(fleet, cap) {
|
|
17
|
+
if (!capList(fleet).includes(cap)) {
|
|
18
|
+
const e = new Error('not supported by this fleet provider');
|
|
19
|
+
e.status = 501;
|
|
20
|
+
throw e;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
4
24
|
// Router /api/fleet — fleetP è una Promise<Fleet> (createServer non diventa
|
|
5
25
|
// async): ogni handler attende la resolve; unavailable → 404 sui comandi.
|
|
6
|
-
function fleetRoutes(fleetP) {
|
|
26
|
+
function fleetRoutes(fleetP, cfg = {}) {
|
|
7
27
|
const r = express.Router();
|
|
8
28
|
r.use(express.json({ limit: '4kb' }));
|
|
9
29
|
|
|
10
|
-
const
|
|
30
|
+
const readonly = () => (cfg.readonlyDefault === true || process.env.NEXUSCREW_READONLY === '1');
|
|
31
|
+
|
|
32
|
+
const guard = (fn, opts = {}) => async (req, res) => {
|
|
11
33
|
try {
|
|
34
|
+
// READONLY e' un gate di prodotto, non solo del provider built-in: deve
|
|
35
|
+
// bloccare anche il fleet esterno legacy prima che tocchi systemd/tmux reali.
|
|
36
|
+
if (opts.mutate && readonly()) return res.status(403).json({ error: 'READONLY: mutazione fleet bloccata' });
|
|
12
37
|
const fleet = await fleetP;
|
|
13
38
|
if (!fleet.available) return res.status(404).json({ error: 'fleet non disponibile' });
|
|
14
39
|
res.json(await fn(fleet, req.body || {}));
|
|
@@ -17,17 +42,61 @@ function fleetRoutes(fleetP) {
|
|
|
17
42
|
}
|
|
18
43
|
};
|
|
19
44
|
|
|
45
|
+
// /status espone anche `provider` e `capabilities` (design §9b/§9c), oltre ai
|
|
46
|
+
// campi storici (available/cells/engines). Provider senza capabilities()
|
|
47
|
+
// (external legacy) → DEFAULT_CAPS; external senza campo provider → 'external'.
|
|
20
48
|
r.get('/status', async (_req, res) => {
|
|
21
49
|
try {
|
|
22
50
|
const fleet = await fleetP;
|
|
23
|
-
if (!fleet.available)
|
|
24
|
-
|
|
51
|
+
if (!fleet.available) {
|
|
52
|
+
return res.json({
|
|
53
|
+
available: false,
|
|
54
|
+
provider: fleet.provider || 'disabled',
|
|
55
|
+
bootOwner: 'none', // §9b: provider non disponibile -> nessun boot owner
|
|
56
|
+
capabilities: capList(fleet),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const st = await fleet.status();
|
|
60
|
+
const provider = st.provider || fleet.provider || 'external';
|
|
61
|
+
// bootOwner (§9b): preferisce quello dichiarato dal provider (st.bootOwner);
|
|
62
|
+
// altrimenti deriva dal mode: builtin -> 'builtin', disabled -> 'none',
|
|
63
|
+
// external -> 'external'. Contratto valori: 'builtin' | 'external' | 'none'.
|
|
64
|
+
const bootOwner = st.bootOwner || (provider === 'builtin' ? 'builtin' : provider === 'disabled' ? 'none' : 'external');
|
|
65
|
+
res.json({
|
|
66
|
+
...st,
|
|
67
|
+
provider,
|
|
68
|
+
bootOwner,
|
|
69
|
+
capabilities: capList(fleet),
|
|
70
|
+
});
|
|
25
71
|
} catch (e) { res.status(500).json({ error: String(e.message || e) }); }
|
|
26
72
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
73
|
+
|
|
74
|
+
// /up: il built-in (capability 'edit') è definitions-driven — se il body porta
|
|
75
|
+
// un engine lo persiste sulla cella (f.engine) PRIMA di up, perché l'engine
|
|
76
|
+
// dichiarato vince sull'override runtime (ignored dal builtin.up).
|
|
77
|
+
// External legacy: passthrough up(cell,{engine,boot}) invariato.
|
|
78
|
+
r.post('/up', guard((f, b) => {
|
|
79
|
+
const cell = String(b.cell || '');
|
|
80
|
+
if (b.engine && capList(f).includes('edit')) {
|
|
81
|
+
return f.engine(cell, String(b.engine)).then(() => f.up(cell));
|
|
82
|
+
}
|
|
83
|
+
return f.up(cell, { engine: b.engine, boot: !!b.boot });
|
|
84
|
+
}, { mutate: true }));
|
|
85
|
+
r.post('/down', guard((f, b) => f.down(String(b.cell || ''), { boot: !!b.boot }), { mutate: true }));
|
|
86
|
+
r.post('/restart', guard((f, b) => { requireCap(f, 'restart'); return f.restart(String(b.cell || '')); }, { mutate: true }));
|
|
87
|
+
r.post('/engine', guard((f, b) => f.engine(String(b.cell || ''), String(b.engine || '')), { mutate: true }));
|
|
88
|
+
r.post('/boot', guard((f, b) => f.boot(String(b.cell || ''), b.enabled === true), { mutate: true }));
|
|
89
|
+
|
|
90
|
+
// --- Estensione B4.2: schema + define/edit/remove (engine e cell) ---
|
|
91
|
+
// Ogni route negozia la capability del provider: mancante → 501 (§9c).
|
|
92
|
+
r.get('/schema', guard((f) => { requireCap(f, 'schema'); return f.schema(); }));
|
|
93
|
+
r.post('/define-engine', guard((f, b) => { requireCap(f, 'define'); return f.defineEngine(b.def); }, { mutate: true }));
|
|
94
|
+
r.post('/edit-engine', guard((f, b) => { requireCap(f, 'edit'); return f.editEngine(b.id, b.patch); }, { mutate: true }));
|
|
95
|
+
r.post('/remove-engine', guard((f, b) => { requireCap(f, 'remove'); return f.removeEngine(b.id); }, { mutate: true }));
|
|
96
|
+
r.post('/define-cell', guard((f, b) => { requireCap(f, 'define'); return f.defineCell(b.def); }, { mutate: true }));
|
|
97
|
+
r.post('/edit-cell', guard((f, b) => { requireCap(f, 'edit'); return f.editCell(b.id, b.patch); }, { mutate: true }));
|
|
98
|
+
r.post('/remove-cell', guard((f, b) => { requireCap(f, 'remove'); return f.removeCell(b.id); }, { mutate: true }));
|
|
99
|
+
|
|
31
100
|
return r;
|
|
32
101
|
}
|
|
33
102
|
|
package/lib/fs/routes.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const fsp = require('node:fs/promises');
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
const express = require('express');
|
|
5
|
+
|
|
6
|
+
const MAX_ENTRIES = 500;
|
|
7
|
+
|
|
8
|
+
// Router /api/fs — sfoglia SOLO directory, confinato alla home (o root passata).
|
|
9
|
+
// Serve al folder-picker del dialog "new session": il browser non può sfogliare
|
|
10
|
+
// il filesystem del server, quindi lo fa il server, dietro lo stesso Bearer di
|
|
11
|
+
// tutte le /api. Policy symlink: realpath; se la risoluzione esce dalla root
|
|
12
|
+
// (symlink verso fuori) → 403. Niente file, niente contenuti: solo nomi di dir.
|
|
13
|
+
function fsRoutes({ home }) {
|
|
14
|
+
const r = express.Router();
|
|
15
|
+
|
|
16
|
+
r.get('/dirs', async (req, res) => {
|
|
17
|
+
try {
|
|
18
|
+
const root = await fsp.realpath(home);
|
|
19
|
+
const q = typeof req.query.path === 'string' && req.query.path ? req.query.path : root;
|
|
20
|
+
if (q.includes('\0')) return res.status(400).json({ error: 'path non valido' });
|
|
21
|
+
let real;
|
|
22
|
+
try { real = await fsp.realpath(path.resolve(root, q)); } catch (_) {
|
|
23
|
+
return res.status(404).json({ error: 'directory inesistente' });
|
|
24
|
+
}
|
|
25
|
+
if (real !== root && !real.startsWith(root + path.sep)) {
|
|
26
|
+
return res.status(403).json({ error: 'fuori dalla home' });
|
|
27
|
+
}
|
|
28
|
+
let entries;
|
|
29
|
+
try { entries = await fsp.readdir(real, { withFileTypes: true }); } catch (e) {
|
|
30
|
+
if (e.code === 'ENOTDIR') return res.status(404).json({ error: 'non è una directory' });
|
|
31
|
+
if (e.code === 'EACCES') return res.status(403).json({ error: 'permesso negato' });
|
|
32
|
+
throw e;
|
|
33
|
+
}
|
|
34
|
+
const showHidden = req.query.hidden === '1';
|
|
35
|
+
const names = [];
|
|
36
|
+
for (const d of entries) {
|
|
37
|
+
if (!showHidden && d.name.startsWith('.')) continue;
|
|
38
|
+
if (d.isDirectory()) { names.push(d.name); continue; }
|
|
39
|
+
if (d.isSymbolicLink()) { // symlink: solo se risolve a una dir
|
|
40
|
+
try { if ((await fsp.stat(path.join(real, d.name))).isDirectory()) names.push(d.name); } catch (_) { /* rotto: skip */ }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const dirs = names.sort((a, b) => a.localeCompare(b)).slice(0, MAX_ENTRIES);
|
|
44
|
+
res.json({
|
|
45
|
+
path: real,
|
|
46
|
+
parent: real === root ? null : path.dirname(real),
|
|
47
|
+
home: root,
|
|
48
|
+
dirs,
|
|
49
|
+
});
|
|
50
|
+
} catch (e) { res.status(500).json({ error: String(e.message || e) }); }
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
return r;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
module.exports = { fsRoutes };
|
package/lib/server.js
CHANGED
|
@@ -18,8 +18,9 @@ const { filesRoutes } = require('./files/routes.js');
|
|
|
18
18
|
const { createOutboxWatcher } = require('./files/watcher.js');
|
|
19
19
|
const VERSION = require('../package.json').version;
|
|
20
20
|
const { transcribe } = require('./voice/transcribe.js');
|
|
21
|
-
const {
|
|
21
|
+
const { selectProvider } = require('./fleet/provider.js');
|
|
22
22
|
const { fleetRoutes } = require('./fleet/routes.js');
|
|
23
|
+
const { fsRoutes } = require('./fs/routes.js');
|
|
23
24
|
|
|
24
25
|
function sessionExists(tmuxBin, name) {
|
|
25
26
|
if (typeof name !== 'string' || !/^[\w.@%:+-]{1,128}$/.test(name)) return false;
|
|
@@ -34,7 +35,10 @@ function createServer(opts = {}) {
|
|
|
34
35
|
const watcher = createOutboxWatcher({ root: cfg.filesRoot });
|
|
35
36
|
const previews = createPreviewSampler(cfg.tmuxBin);
|
|
36
37
|
const attachedWs = new Map(); // ws -> session (per il push dei frame files)
|
|
37
|
-
|
|
38
|
+
// selectProvider sceglie UNA volta (startup) il provider external|builtin|disabled
|
|
39
|
+
// (design §4b/§9b/§9g) e ritorna {mode,reason,fleet}; routes consumano il .fleet,
|
|
40
|
+
// quindi fleetP resta una Promise<Fleet> (createServer non diventa async).
|
|
41
|
+
const fleetP = selectProvider(cfg).then((p) => p.fleet);
|
|
38
42
|
|
|
39
43
|
const app = express();
|
|
40
44
|
const distDir = path.join(__dirname, '..', 'frontend', 'dist');
|
|
@@ -87,7 +91,8 @@ function createServer(opts = {}) {
|
|
|
87
91
|
sessionExists: (name) => sessionExists(cfg.tmuxBin, name),
|
|
88
92
|
paste: (session, text) => pasteToSession(cfg.tmuxBin, session, text),
|
|
89
93
|
}));
|
|
90
|
-
api.use('/fleet', fleetRoutes(fleetP));
|
|
94
|
+
api.use('/fleet', fleetRoutes(fleetP, cfg));
|
|
95
|
+
api.use('/fs', fsRoutes({ home: os.homedir() })); // folder-picker del dialog new session
|
|
91
96
|
api.get('/voice/status', (_req, res) => res.json({ serverSttConfigured: !!cfg.voiceUrl }));
|
|
92
97
|
api.post('/voice/transcribe',
|
|
93
98
|
express.raw({ type: () => true, limit: '25mb' }),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mmmbuto/nexuscrew",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "Faithful browser tmux client
|
|
3
|
+
"version": "0.7.7",
|
|
4
|
+
"description": "Faithful browser tmux client — attach to live sessions over a real PTY, localhost-only, mobile-easy",
|
|
5
5
|
"main": "lib/server.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"nexuscrew": "bin/nexuscrew.js"
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
.nc-icon{display:block;flex:0 0 auto}.nc-sheet-head{display:flex;align-items:center;justify-content:space-between}.nc-sheet-state{font-size:12px;opacity:.6}.nc-sheet-label{font-size:12px;opacity:.7;text-transform:uppercase;letter-spacing:.5px}.nc-engines{display:grid;grid-template-columns:1fr 1fr;gap:6px}.nc-engine{display:flex;align-items:center;gap:6px;padding:7px 9px;border:1px solid #1c241c;border-radius:8px;font-size:12px;cursor:pointer;background:#0a0e0a}.nc-engine.sel{border-color:#2e7d32;background:#14200f}.nc-engine input{accent-color:#2e7d32}.nc-check{display:flex;align-items:center;gap:8px;font-size:13px;cursor:pointer}.nc-check input{accent-color:#2e7d32}.nc-note{font-size:11px;color:#e0b020;opacity:.9}.nc-sheet-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:50;background:#0000008c;display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box}.nc-sheet{width:100%;max-width:380px;background:#0e140e;color:#cfe;border:1px solid #243;border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:12px;box-shadow:0 12px 40px #00000080}.nc-sheet-head{display:flex;align-items:center}.nc-sheet-head b{font-size:16px;color:#d8ffe8}.nc-field{display:flex;flex-direction:column;gap:4px;font-size:12px;opacity:.8}.nc-field input,.nc-field select{padding:9px 10px;font:14px/1.2 inherit;background:#0a0e0a;color:#cfe;border:1px solid #243;border-radius:8px}.nc-field input:focus,.nc-field select:focus{outline:none;border-color:#2e7d32}.nc-err{color:#f88;font-size:12px}.nc-sheet-actions{display:flex;justify-content:flex-end;gap:8px}.nc-btn{border:none;border-radius:8px;padding:8px 16px;font-size:13px;cursor:pointer}.nc-btn.ghost{background:none;border:1px solid #243;color:#9fd}.nc-btn.primary{background:#2e7d32;color:#fff}.nc-btn.primary:active{background:#255028}.nc-btn:disabled{opacity:.5;cursor:default}.nc-home{display:flex;flex-direction:column;gap:12px;padding:18px 14px 10px;color:#cfe;max-width:560px;margin:0 auto;min-height:100dvh;box-sizing:border-box}.nc-home-head{position:relative}.nc-wordmark{font-size:26px;font-weight:700;letter-spacing:.5px;color:#d8ffe8}.nc-cursor{display:inline-block;width:12px;height:22px;margin-left:6px;background:#0c6;vertical-align:-2px;animation:nc-blink 1.1s steps(1) infinite}@keyframes nc-blink{50%{opacity:0}}@media (prefers-reduced-motion: reduce){.nc-cursor{animation:none}}.nc-home-sub{margin-top:4px;font-size:13px;opacity:.65}.nc-refresh{position:absolute;top:0;right:0;display:inline-flex;align-items:center;justify-content:center;background:none;border:1px solid #243;color:#9fd;border-radius:8px;min-width:40px;min-height:40px}.nc-filter{padding:10px 12px;font:16px/1.2 inherit;background:#0e140e;color:#cfe;border:1px solid #243;border-radius:8px}.nc-filter:focus{outline:none;border-color:#2e7d32}.nc-session-list{display:flex;flex-direction:column;gap:8px}.nc-session{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid #1c241c;background:#0e140e;color:#cfe;border-radius:10px;text-align:left;min-height:56px}.nc-session:active{background:#14200f;border-color:#2e7d32}.nc-session .dot{flex:0 0 auto;width:9px;height:9px;border-radius:50%;background:#355}.nc-session .dot.on{background:#0c6;box-shadow:0 0 6px #0c68}.nc-session-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.nc-session-main b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.nc-session-main small{opacity:.55;font-size:12px}.nc-badge{flex:0 0 auto;background:#2e7d32;color:#fff;border-radius:10px;padding:1px 8px;font-size:12px;line-height:18px}.nc-err{color:#f88;font-size:13px;padding:4px 2px}.nc-empty{opacity:.5;padding:18px 4px;font-size:13px}.nc-home-foot{margin-top:auto;padding-top:14px;display:flex;justify-content:space-between;gap:8px;font-size:11px;opacity:.4}.nc-group{display:flex;flex-direction:column;gap:8px}.nc-group-title{font-size:11px;opacity:.55;text-transform:uppercase;letter-spacing:.5px;padding:6px 2px 2px}.nc-mcard{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid #1c241c;background:#0e140e;color:#cfe;border-radius:12px;min-height:56px}.nc-mcard-main{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:12px;background:none;border:none;color:inherit;cursor:pointer;padding:0;text-align:left}.nc-mcard-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.nc-mcard-text b{font-size:14px;color:#d8ffe8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nc-mcard-text small{font-size:12px;opacity:.6;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dot.warn{background:#e0b020;box-shadow:0 0 6px #e0b02088}.nc-rel{flex:0 0 auto;font-size:11px;opacity:.45}.nc-power,.nc-menu{flex:0 0 auto;background:none;border:1px solid #243;color:#9fd;border-radius:8px;min-width:38px;min-height:38px;font-size:17px;cursor:pointer}.nc-power:active,.nc-menu:active{border-color:#2e7d32}.nc-fab{position:fixed;right:18px;bottom:18px;z-index:20;width:54px;height:54px;border-radius:50%;background:#2e7d32;color:#fff;border:none;font-size:28px;line-height:1;cursor:pointer;box-shadow:0 6px 18px #00000073}.nc-fab:active{background:#255028}.nc-lang{display:inline-flex;align-items:center;gap:2px}/**
|
|
2
|
-
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
|
|
3
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
4
|
-
* https://github.com/chjj/term.js
|
|
5
|
-
* @license MIT
|
|
6
|
-
*
|
|
7
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
* in the Software without restriction, including without limitation the rights
|
|
10
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
* furnished to do so, subject to the following conditions:
|
|
13
|
-
*
|
|
14
|
-
* The above copyright notice and this permission notice shall be included in
|
|
15
|
-
* all copies or substantial portions of the Software.
|
|
16
|
-
*
|
|
17
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
-
* THE SOFTWARE.
|
|
24
|
-
*
|
|
25
|
-
* Originally forked from (with the author's permission):
|
|
26
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
27
|
-
* http://bellard.org/jslinux/
|
|
28
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
29
|
-
* The original design remains. The terminal itself
|
|
30
|
-
* has been extended to include xterm CSI codes, among
|
|
31
|
-
* other features.
|
|
32
|
-
*/.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;-webkit-user-select:text;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.nc-terminal{position:absolute;top:0;right:0;bottom:0;left:0;padding:4px;background:#0a0e0a}.nc-terminal .xterm{height:100%}.nc-terminal,.nc-terminal .xterm,.nc-terminal .xterm-viewport{touch-action:none}.nc-keybar{display:flex;gap:6px;overflow-x:auto;padding:8px;background:#0e140e;border-top:1px solid #1c241c;-webkit-overflow-scrolling:touch}.nc-keybar button{flex:0 0 auto;padding:10px 12px;min-width:48px;border-radius:8px;border:1px solid #243;background:#122;color:#9fd;font-size:13px}.nc-keybar button:active{background:#0c6;color:#021}.nc-keybar button.armed{background:#0c6;color:#021;border-color:#0c6}.nc-keybar.copy{background:#14210f}.nc-keybar .tag{flex:0 0 auto;align-self:center;padding:0 8px;color:#8e8;font-size:12px}@media (pointer: coarse){.nc-keybar{gap:8px}.nc-keybar button{min-height:42px;font-size:15px}}.nc-files{position:fixed;top:0;right:0;bottom:0;width:min(340px,90vw);background:var(--bg, #111511);border-left:1px solid #2a332a;display:flex;flex-direction:column;z-index:30}.nc-files header{display:flex;justify-content:space-between;align-items:center;padding:8px 10px;border-bottom:1px solid #2a332a}.nc-files nav{display:flex;gap:6px;padding:8px 10px}.nc-files nav button{flex:0 0 auto;padding:4px 10px;border-radius:6px}.nc-files nav button.on{background:#2e7d32;color:#fff}.nc-files nav .up{margin-left:auto}.nc-files ul{list-style:none;margin:0;padding:0;overflow-y:auto;flex:1}.nc-files li{display:flex;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid #1c231c}.nc-files li .name{flex:1;cursor:pointer;overflow-wrap:anywhere}.nc-files li.empty{opacity:.5;justify-content:center}.nc-busy{padding:4px 10px;font-size:12px;color:#e0a030}@media (pointer: coarse){.nc-files nav button,.nc-files li{min-height:42px}}.nc-files header button,.nc-files nav button,.nc-files li button{display:inline-flex;align-items:center;justify-content:center;gap:6px}.nc-composer{border-top:1px solid #2a332a;padding:6px 8px;background:var(--bg, #111511)}.nc-composer-row{display:flex;gap:6px;align-items:flex-end}.nc-composer textarea{flex:1;resize:none;background:#0a0e0a;color:#d8e0d8;border:1px solid #2a332a;border-radius:8px;padding:6px 8px;font:13px/1.4 inherit}.nc-composer .mic.on{background:#b02a2a;color:#fff}.nc-composer-err{font-size:12px;color:#e0a030;padding-bottom:4px}@media (pointer: coarse){.nc-composer .mic,.nc-composer .go{min-width:46px;min-height:46px;font-size:20px}.nc-composer textarea{font-size:16px}}.nc-composer .mic,.nc-composer .go{display:inline-flex;align-items:center;justify-content:center;background:none;border:1px solid #243;color:#9fd;border-radius:8px}.nc-composer .go{color:#7ee787;border-color:#2e7d32}.nc-sidebar{display:flex;flex-direction:column;gap:8px;padding:12px 10px;color:#cfe;width:240px;flex:0 0 240px;min-height:0;overflow-y:auto;box-sizing:border-box;border-right:1px solid #1c241c;background:#0a0e0a}.nc-side-head{display:flex;align-items:center;justify-content:space-between;padding:2px 4px 6px}.nc-side-title{font-size:13px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;opacity:.8}.nc-new-btn{background:#2e7d32;color:#fff;border:none;border-radius:8px;padding:4px 10px;font-size:12px;cursor:pointer}.nc-new-btn:active{background:#255028}.nc-side-group{display:flex;flex-direction:column;gap:6px}.nc-side-group-title{font-size:11px;opacity:.55;text-transform:uppercase;letter-spacing:.5px;padding:10px 4px 2px}.nc-cell{display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid #1c241c;background:#0e140e;border-radius:10px}.nc-cell-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.nc-cell-main b{font-size:13px;color:#d8ffe8}.nc-cell-main small{font-size:11px;opacity:.6}.nc-power{flex:0 0 auto;background:none;border:1px solid #243;color:#9fd;border-radius:8px;min-width:30px;min-height:30px;cursor:pointer;font-size:15px}.nc-power:active{border-color:#2e7d32}.nc-dot{flex:0 0 auto;width:9px;height:9px;border-radius:50%;background:#355}.nc-dot.on{background:#0c6;box-shadow:0 0 6px #0c68}.nc-dot.warn{background:#e0b020;box-shadow:0 0 6px #e0b02088}.nc-side-card{display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid #1c241c;background:#0e140e;border-radius:10px;cursor:grab;-webkit-user-select:none;user-select:none}.nc-side-card:hover{border-color:#244}.nc-side-card.active{border-color:#2e7d32;background:#14200f}.nc-side-card:active{cursor:grabbing}.nc-card-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.nc-card-main b{font-size:13px;color:#d8ffe8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nc-card-main small{font-size:11px;opacity:.55;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nc-rel{flex:0 0 auto;font-size:10px;opacity:.45}.nc-menu{flex:0 0 auto;background:none;border:none;color:#9fd;min-width:26px;min-height:26px;cursor:pointer;font-size:15px;border-radius:6px}.nc-menu:active{color:#f88}.nc-empty{opacity:.4;padding:8px 4px;font-size:12px}.nc-side-lang{margin-top:auto;padding:10px 4px 4px;display:flex;align-items:center;gap:2px;font-size:11px;opacity:.6}.nc-lang-btn{background:none;border:none;color:inherit;cursor:pointer;font-size:11px;padding:0 1px;opacity:.5;text-transform:uppercase}.nc-lang-btn.on{opacity:1;font-weight:700;color:#d8ffe8}.nc-tile{display:flex;flex-direction:column;min-height:0;min-width:0;position:relative;background:#0a0e0a;border:1px solid #1c241c;border-radius:8px;overflow:hidden}.nc-tile.focused{border-color:#2e7d32;box-shadow:0 0 0 1px #2e7d3244 inset}.nc-tile-head{flex:0 0 auto;display:flex;align-items:center;gap:6px;padding:3px 6px;background:#0e140e;border-bottom:1px solid #1c241c;height:28px}.nc-tile-name{flex:1 1 auto;min-width:0;display:inline-flex;align-items:center;gap:6px;background:none;border:none;color:#cfe;cursor:pointer;padding:0}.nc-tile-name b{font-size:12px;font-weight:600;color:#d8ffe8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nc-tile .nc-dot{width:7px;height:7px;flex:0 0 auto}.nc-tile-actions{flex:0 0 auto;display:inline-flex;gap:2px}.nc-tile-actions button{background:none;border:none;color:#9fd;cursor:pointer;min-width:22px;height:22px;font-size:13px;border-radius:4px;padding:0 3px}.nc-tile-actions button:hover{color:#d8ffe8}.nc-tile-actions .nc-tile-close:hover{color:#f88}.nc-tile-body{flex:1 1 auto;position:relative;min-height:0}.nc-tile-body .nc-terminal{width:100%;height:100%}.nc-tile-composer{flex:0 0 auto;border-top:1px solid #1c241c}.nc-tile-files{position:absolute;top:0;right:0;bottom:0;left:0;z-index:5;background:#0e140e}.nc-grid{flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:row;padding:6px;gap:0;position:relative;background:#070a07}.nc-col{display:flex;flex-direction:column;min-width:120px;min-height:0;position:relative}.nc-col.drop-newcol:before{content:"";position:absolute;left:-3px;top:0;bottom:0;width:3px;background:#0c6;border-radius:2px;z-index:6}.nc-tile-slot{display:flex;flex-direction:column;min-height:60px;min-width:0;position:relative}.nc-tile-slot>.nc-tile{flex:1 1 auto;min-height:0}.nc-tile-slot.drop-split:before{content:"";position:absolute;left:0;right:0;top:-3px;height:3px;background:#0c6;border-radius:2px;z-index:6}.nc-divider-v{flex:0 0 6px;cursor:col-resize;margin:0 1px;border-radius:2px}.nc-divider-v:hover{background:#1c3a1c}.nc-divider-h{flex:0 0 6px;cursor:row-resize;margin:1px 0;border-radius:2px}.nc-divider-h:hover{background:#1c3a1c}.nc-drop-line-v{flex:0 0 3px;align-self:stretch;background:#0c6;border-radius:2px}.nc-drop-line-end{margin-left:3px}.nc-grid-empty{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;color:#cfe;opacity:.4;font-size:13px;text-align:center;padding:20px}:root{color-scheme:dark}body,#root{margin:0;height:100vh;height:100dvh;background:#0a0e0a;font-family:ui-monospace,monospace}.nc-app{display:flex;flex-direction:column;height:100vh;height:100dvh;min-height:0}.nc-keybar{flex:0 0 auto}.nc-bar{display:flex;gap:10px;align-items:center;padding:8px;color:#cfe;background:#0e140e}.nc-bar button{background:none;border:1px solid #243;color:#9fd;border-radius:6px;padding:4px 10px}.nc-termwrap{position:relative;flex:1}.nc-auth{color:#cfe;padding:20px;display:flex;flex-direction:column;gap:10px;max-width:420px}.nc-auth input[type=text],.nc-auth input:not([type]){padding:10px;background:#122;border:1px solid #243;color:#cfe;border-radius:6px}.nc-auth button{padding:10px;background:#122;border:1px solid #243;color:#9fd;border-radius:6px}.nc-bar-right{margin-left:auto;display:flex;gap:4px}@media (pointer: coarse){.nc-bar button,.nc-bar-right button{min-height:42px;min-width:42px;font-size:20px}}.nc-bar button,.nc-bar-right button{display:inline-flex;align-items:center;justify-content:center;gap:6px}.nc-bar>button{flex:0 0 auto}.nc-bar>b{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600}.nc-bar-right{flex:0 0 auto}@media (max-width: 480px){.nc-bar-label{display:none}}.nc-workspace{display:flex;flex-direction:row;height:100vh;height:100dvh;min-height:0;background:#0a0e0a;color:#cfe}.nc-workspace-main{flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column}.nc-single-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:40;background:#0a0e0a}.nc-bar-single .nc-bar-center{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.15}.nc-bar-single .nc-bar-center b{font-size:13px;font-weight:600;color:#d8ffe8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.nc-bar-sub{font-size:10px;opacity:.55}.nc-app{animation:nc-slide-in .2s ease-out}@keyframes nc-slide-in{0%{transform:translate(12%);opacity:0}to{transform:translate(0);opacity:1}}@media (prefers-reduced-motion: reduce){.nc-app{animation:none}}:root{--bg-primary: #0d1117;--bg-secondary: #161b22;--bg-tertiary: #21262d;--bg-hover: #30363d;--text-primary: #e6edf3;--text-secondary: #8b949e;--text-tertiary: #6e7681;--border: #30363d;--accent: #6c5ce7;--accent-hover: #7c6cf7;--success: #3fb950;--warning: #d29922;--error: #f85149;--user-bg: #1c2333;--assistant-bg: transparent;--font-mono: "SF Mono", monospace;--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif}*{box-sizing:border-box;margin:0;padding:0}html,body,#root{height:100%;width:100%;overflow:hidden}body{font-family:var(--font-sans);background:var(--bg-primary);color:var(--text-primary);-webkit-font-smoothing:antialiased}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--bg-tertiary);border-radius:3px}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.spinning{animation:spin 1s linear infinite}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
.nc-icon{display:block;flex:0 0 auto}.nc-sheet-head{display:flex;align-items:center;justify-content:space-between}.nc-sheet-state{font-size:12px;opacity:.6}.nc-sheet-label{font-size:12px;opacity:.7;text-transform:uppercase;letter-spacing:.5px}.nc-engines{display:grid;grid-template-columns:1fr 1fr;gap:6px}.nc-engine{display:flex;align-items:center;gap:6px;padding:7px 9px;border:1px solid #1c241c;border-radius:8px;font-size:12px;cursor:pointer;background:#0a0e0a}.nc-engine.sel{border-color:#2e7d32;background:#14200f}.nc-engine input{accent-color:#2e7d32}.nc-check{display:flex;align-items:center;gap:8px;font-size:13px;cursor:pointer}.nc-check input{accent-color:#2e7d32}.nc-note{font-size:11px;color:#e0b020;opacity:.9}.nc-sheet-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:50;background:#0000008c;display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box}.nc-sheet{width:100%;max-width:380px;background:#0e140e;color:#cfe;border:1px solid #243;border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:12px;box-shadow:0 12px 40px #00000080}.nc-sheet-head{display:flex;align-items:center}.nc-sheet-head b{font-size:16px;color:#d8ffe8}.nc-field{display:flex;flex-direction:column;gap:4px;font-size:12px;opacity:.8}.nc-field input,.nc-field select{padding:9px 10px;font:14px/1.2 inherit;background:#0a0e0a;color:#cfe;border:1px solid #243;border-radius:8px}.nc-field input:focus,.nc-field select:focus{outline:none;border-color:#2e7d32}.nc-err{color:#f88;font-size:12px}.nc-sheet-actions{display:flex;justify-content:flex-end;gap:8px}.nc-btn{border:none;border-radius:8px;padding:8px 16px;font-size:13px;cursor:pointer}.nc-btn.ghost{background:none;border:1px solid #243;color:#9fd}.nc-btn.primary{background:#2e7d32;color:#fff}.nc-btn.primary:active{background:#255028}.nc-btn:disabled{opacity:.5;cursor:default}.nc-home{display:flex;flex-direction:column;gap:12px;padding:18px 14px 10px;color:#cfe;max-width:560px;margin:0 auto;min-height:100dvh;box-sizing:border-box}.nc-home-head{position:relative}.nc-wordmark{font-size:26px;font-weight:700;letter-spacing:.5px;color:#d8ffe8}.nc-cursor{display:inline-block;width:12px;height:22px;margin-left:6px;background:#0c6;vertical-align:-2px;animation:nc-blink 1.1s steps(1) infinite}@keyframes nc-blink{50%{opacity:0}}@media (prefers-reduced-motion: reduce){.nc-cursor{animation:none}}.nc-home-sub{margin-top:4px;font-size:13px;opacity:.65}.nc-refresh{position:absolute;top:0;right:0;display:inline-flex;align-items:center;justify-content:center;background:none;border:1px solid #243;color:#9fd;border-radius:8px;min-width:40px;min-height:40px}.nc-filter{padding:10px 12px;font:16px/1.2 inherit;background:#0e140e;color:#cfe;border:1px solid #243;border-radius:8px}.nc-filter:focus{outline:none;border-color:#2e7d32}.nc-session-list{display:flex;flex-direction:column;gap:8px}.nc-session{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid #1c241c;background:#0e140e;color:#cfe;border-radius:10px;text-align:left;min-height:56px}.nc-session:active{background:#14200f;border-color:#2e7d32}.nc-session .dot{flex:0 0 auto;width:9px;height:9px;border-radius:50%;background:#355}.nc-session .dot.on{background:#0c6;box-shadow:0 0 6px #0c68}.nc-session-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.nc-session-main b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.nc-session-main small{opacity:.55;font-size:12px}.nc-badge{flex:0 0 auto;background:#2e7d32;color:#fff;border-radius:10px;padding:1px 8px;font-size:12px;line-height:18px}.nc-err{color:#f88;font-size:13px;padding:4px 2px}.nc-empty{opacity:.5;padding:18px 4px;font-size:13px}.nc-home-foot{margin-top:auto;padding-top:14px;display:flex;justify-content:space-between;gap:8px;font-size:11px;opacity:.4}.nc-group{display:flex;flex-direction:column;gap:8px}.nc-group-title{font-size:11px;opacity:.55;text-transform:uppercase;letter-spacing:.5px;padding:6px 2px 2px}.nc-mcard{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid #1c241c;background:#0e140e;color:#cfe;border-radius:12px;min-height:56px}.nc-mcard-main{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:12px;background:none;border:none;color:inherit;cursor:pointer;padding:0;text-align:left}.nc-mcard-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.nc-mcard-text b{font-size:14px;color:#d8ffe8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nc-mcard-text small{font-size:12px;opacity:.6;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dot.warn{background:#e0b020;box-shadow:0 0 6px #e0b02088}.nc-rel{flex:0 0 auto;font-size:11px;opacity:.45}.nc-power,.nc-menu{flex:0 0 auto;background:none;border:1px solid #243;color:#9fd;border-radius:8px;min-width:38px;min-height:38px;font-size:17px;cursor:pointer}.nc-power:active,.nc-menu:active{border-color:#2e7d32}.nc-fab{position:fixed;right:18px;bottom:18px;z-index:20;width:54px;height:54px;border-radius:50%;background:#2e7d32;color:#fff;border:none;font-size:28px;line-height:1;cursor:pointer;box-shadow:0 6px 18px #00000073}.nc-fab:active{background:#255028}.nc-lang{display:inline-flex;align-items:center;gap:2px}/**
|
|
2
|
-
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
|
|
3
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
4
|
-
* https://github.com/chjj/term.js
|
|
5
|
-
* @license MIT
|
|
6
|
-
*
|
|
7
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
* in the Software without restriction, including without limitation the rights
|
|
10
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
* furnished to do so, subject to the following conditions:
|
|
13
|
-
*
|
|
14
|
-
* The above copyright notice and this permission notice shall be included in
|
|
15
|
-
* all copies or substantial portions of the Software.
|
|
16
|
-
*
|
|
17
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
-
* THE SOFTWARE.
|
|
24
|
-
*
|
|
25
|
-
* Originally forked from (with the author's permission):
|
|
26
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
27
|
-
* http://bellard.org/jslinux/
|
|
28
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
29
|
-
* The original design remains. The terminal itself
|
|
30
|
-
* has been extended to include xterm CSI codes, among
|
|
31
|
-
* other features.
|
|
32
|
-
*/.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;-webkit-user-select:text;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.nc-terminal{position:absolute;top:0;right:0;bottom:0;left:0;padding:4px;background:#0a0e0a}.nc-terminal .xterm{height:100%}.nc-terminal,.nc-terminal .xterm,.nc-terminal .xterm-viewport{touch-action:none}.nc-keybar{display:flex;gap:6px;overflow-x:auto;padding:8px;background:#0e140e;border-top:1px solid #1c241c;-webkit-overflow-scrolling:touch}.nc-keybar button{flex:0 0 auto;padding:10px 12px;min-width:48px;border-radius:8px;border:1px solid #243;background:#122;color:#9fd;font-size:13px}.nc-keybar button:active{background:#0c6;color:#021}.nc-keybar button.armed{background:#0c6;color:#021;border-color:#0c6}.nc-keybar.copy{background:#14210f}.nc-keybar .tag{flex:0 0 auto;align-self:center;padding:0 8px;color:#8e8;font-size:12px}@media (pointer: coarse){.nc-keybar{gap:8px}.nc-keybar button{min-height:42px;font-size:15px}}.nc-files{position:fixed;top:0;right:0;bottom:0;width:min(340px,90vw);background:var(--bg, #111511);border-left:1px solid #2a332a;display:flex;flex-direction:column;z-index:30}.nc-files header{display:flex;justify-content:space-between;align-items:center;padding:8px 10px;border-bottom:1px solid #2a332a}.nc-files nav{display:flex;gap:6px;padding:8px 10px}.nc-files nav button{flex:0 0 auto;padding:4px 10px;border-radius:6px}.nc-files nav button.on{background:#2e7d32;color:#fff}.nc-files nav .up{margin-left:auto}.nc-files ul{list-style:none;margin:0;padding:0;overflow-y:auto;flex:1}.nc-files li{display:flex;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid #1c231c}.nc-files li .name{flex:1;cursor:pointer;overflow-wrap:anywhere}.nc-files li.empty{opacity:.5;justify-content:center}.nc-busy{padding:4px 10px;font-size:12px;color:#e0a030}@media (pointer: coarse){.nc-files nav button,.nc-files li{min-height:42px}}.nc-files header button,.nc-files nav button,.nc-files li button{display:inline-flex;align-items:center;justify-content:center;gap:6px}.nc-composer{border-top:1px solid #2a332a;padding:6px 8px;background:var(--bg, #111511)}.nc-composer-row{display:flex;gap:6px;align-items:flex-end}.nc-composer textarea{flex:1;resize:none;background:#0a0e0a;color:#d8e0d8;border:1px solid #2a332a;border-radius:8px;padding:6px 8px;font:13px/1.4 inherit}.nc-composer .mic.on{background:#b02a2a;color:#fff}.nc-composer-err{font-size:12px;color:#e0a030;padding-bottom:4px}@media (pointer: coarse){.nc-composer .mic,.nc-composer .go{min-width:46px;min-height:46px;font-size:20px}.nc-composer textarea{font-size:16px}}.nc-composer .mic,.nc-composer .go{display:inline-flex;align-items:center;justify-content:center;background:none;border:1px solid #243;color:#9fd;border-radius:8px}.nc-composer .go{color:#7ee787;border-color:#2e7d32}.nc-sidebar{display:flex;flex-direction:column;gap:8px;padding:12px 10px;color:#cfe;width:240px;flex:0 0 240px;min-height:0;overflow-y:auto;box-sizing:border-box;border-right:1px solid #1c241c;background:#0a0e0a}.nc-side-head{display:flex;align-items:center;justify-content:space-between;padding:2px 4px 6px}.nc-side-title{font-size:13px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;opacity:.8}.nc-new-btn{background:#2e7d32;color:#fff;border:none;border-radius:8px;padding:4px 10px;font-size:12px;cursor:pointer}.nc-new-btn:active{background:#255028}.nc-side-group{display:flex;flex-direction:column;gap:6px}.nc-side-group-title{font-size:11px;opacity:.55;text-transform:uppercase;letter-spacing:.5px;padding:10px 4px 2px}.nc-cell{display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid #1c241c;background:#0e140e;border-radius:10px}.nc-cell-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.nc-cell-main b{font-size:13px;color:#d8ffe8}.nc-cell-main small{font-size:11px;opacity:.6}.nc-power{flex:0 0 auto;background:none;border:1px solid #243;color:#9fd;border-radius:8px;min-width:30px;min-height:30px;cursor:pointer;font-size:15px}.nc-power:active{border-color:#2e7d32}.nc-dot{flex:0 0 auto;width:9px;height:9px;border-radius:50%;background:#355}.nc-dot.on{background:#0c6;box-shadow:0 0 6px #0c68}.nc-dot.warn{background:#e0b020;box-shadow:0 0 6px #e0b02088}.nc-side-card{display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid #1c241c;background:#0e140e;border-radius:10px;cursor:grab;-webkit-user-select:none;user-select:none}.nc-side-card:hover{border-color:#244}.nc-side-card.active{border-color:#2e7d32;background:#14200f}.nc-side-card:active{cursor:grabbing}.nc-card-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.nc-card-main b{font-size:13px;color:#d8ffe8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nc-card-main small{font-size:11px;opacity:.55;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nc-rel{flex:0 0 auto;font-size:10px;opacity:.45}.nc-menu{flex:0 0 auto;background:none;border:none;color:#9fd;min-width:26px;min-height:26px;cursor:pointer;font-size:15px;border-radius:6px}.nc-menu:active{color:#f88}.nc-empty{opacity:.4;padding:8px 4px;font-size:12px}.nc-side-lang{margin-top:auto;padding:10px 4px 4px;display:flex;align-items:center;gap:2px;font-size:11px;opacity:.6}.nc-lang-btn{background:none;border:none;color:inherit;cursor:pointer;font-size:11px;padding:0 1px;opacity:.5;text-transform:uppercase}.nc-lang-btn.on{opacity:1;font-weight:700;color:#d8ffe8}.nc-cell.live{cursor:pointer}.nc-cell.live:hover{background:#ffffff0f}.nc-cell.active{outline:1px solid rgba(0,204,102,.5)}.nc-tile{display:flex;flex-direction:column;min-height:0;min-width:0;position:relative;background:#0a0e0a;border:1px solid #1c241c;border-radius:8px;overflow:hidden}.nc-tile.focused{border-color:#2e7d32;box-shadow:0 0 0 1px #2e7d3244 inset}.nc-tile-head{flex:0 0 auto;display:flex;align-items:center;gap:6px;padding:3px 6px;background:#0e140e;border-bottom:1px solid #1c241c;height:28px}.nc-tile-name{flex:1 1 auto;min-width:0;display:inline-flex;align-items:center;gap:6px;background:none;border:none;color:#cfe;cursor:pointer;padding:0}.nc-tile-name b{font-size:12px;font-weight:600;color:#d8ffe8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nc-tile .nc-dot{width:7px;height:7px;flex:0 0 auto}.nc-tile-actions{flex:0 0 auto;display:inline-flex;gap:2px}.nc-tile-actions button{background:none;border:none;color:#9fd;cursor:pointer;min-width:22px;height:22px;font-size:13px;border-radius:4px;padding:0 3px}.nc-tile-actions button:hover{color:#d8ffe8}.nc-tile-actions .nc-tile-close:hover{color:#f88}.nc-tile-body{flex:1 1 auto;position:relative;min-height:0}.nc-tile-body .nc-terminal{width:100%;height:100%}.nc-tile-composer{flex:0 0 auto;border-top:1px solid #1c241c}.nc-tile-files{position:absolute;top:0;right:0;bottom:0;left:0;z-index:5;background:#0e140e}.nc-grid{flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:row;padding:6px;gap:0;position:relative;background:#070a07}.nc-col{display:flex;flex-direction:column;min-width:120px;min-height:0;position:relative}.nc-col.drop-newcol:before{content:"";position:absolute;left:-3px;top:0;bottom:0;width:3px;background:#0c6;border-radius:2px;z-index:6}.nc-tile-slot{display:flex;flex-direction:column;min-height:60px;min-width:0;position:relative}.nc-tile-slot>.nc-tile{flex:1 1 auto;min-height:0}.nc-tile-slot.drop-split:before{content:"";position:absolute;left:0;right:0;top:-3px;height:3px;background:#0c6;border-radius:2px;z-index:6}.nc-divider-v{flex:0 0 6px;cursor:col-resize;margin:0 1px;border-radius:2px}.nc-divider-v:hover{background:#1c3a1c}.nc-divider-h{flex:0 0 6px;cursor:row-resize;margin:1px 0;border-radius:2px}.nc-divider-h:hover{background:#1c3a1c}.nc-drop-line-v{flex:0 0 3px;align-self:stretch;background:#0c6;border-radius:2px}.nc-drop-line-end{margin-left:3px}.nc-grid-empty{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;color:#cfe;opacity:.4;font-size:13px;text-align:center;padding:20px}:root{color-scheme:dark}body,#root{margin:0;height:100vh;height:100dvh;background:#0a0e0a;font-family:ui-monospace,monospace}.nc-app{display:flex;flex-direction:column;height:100vh;height:100dvh;min-height:0}.nc-keybar{flex:0 0 auto}.nc-bar{display:flex;gap:10px;align-items:center;padding:8px;color:#cfe;background:#0e140e}.nc-bar button{background:none;border:1px solid #243;color:#9fd;border-radius:6px;padding:4px 10px}.nc-termwrap{position:relative;flex:1}.nc-auth{color:#cfe;padding:20px;display:flex;flex-direction:column;gap:10px;max-width:420px}.nc-auth input[type=text],.nc-auth input:not([type]){padding:10px;background:#122;border:1px solid #243;color:#cfe;border-radius:6px}.nc-auth button{padding:10px;background:#122;border:1px solid #243;color:#9fd;border-radius:6px}.nc-bar-right{margin-left:auto;display:flex;gap:4px}@media (pointer: coarse){.nc-bar button,.nc-bar-right button{min-height:42px;min-width:42px;font-size:20px}}.nc-bar button,.nc-bar-right button{display:inline-flex;align-items:center;justify-content:center;gap:6px}.nc-bar>button{flex:0 0 auto}.nc-bar>b{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600}.nc-bar-right{flex:0 0 auto}@media (max-width: 480px){.nc-bar-label{display:none}}.nc-workspace{display:flex;flex-direction:row;height:100vh;height:100dvh;min-height:0;background:#0a0e0a;color:#cfe}.nc-workspace-main{flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column}.nc-single-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:40;background:#0a0e0a}.nc-bar-single .nc-bar-center{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.15}.nc-bar-single .nc-bar-center b{font-size:13px;font-weight:600;color:#d8ffe8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.nc-bar-sub{font-size:10px;opacity:.55}.nc-app{animation:nc-slide-in .2s ease-out}@keyframes nc-slide-in{0%{transform:translate(12%);opacity:0}to{transform:translate(0);opacity:1}}@media (prefers-reduced-motion: reduce){.nc-app{animation:none}}:root{--bg-primary: #0d1117;--bg-secondary: #161b22;--bg-tertiary: #21262d;--bg-hover: #30363d;--text-primary: #e6edf3;--text-secondary: #8b949e;--text-tertiary: #6e7681;--border: #30363d;--accent: #6c5ce7;--accent-hover: #7c6cf7;--success: #3fb950;--warning: #d29922;--error: #f85149;--user-bg: #1c2333;--assistant-bg: transparent;--font-mono: "SF Mono", monospace;--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif}*{box-sizing:border-box;margin:0;padding:0}html,body,#root{height:100%;width:100%;overflow:hidden}body{font-family:var(--font-sans);background:var(--bg-primary);color:var(--text-primary);-webkit-font-smoothing:antialiased}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--bg-tertiary);border-radius:3px}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.spinning{animation:spin 1s linear infinite}
|