@songsid/agend 2.1.4 → 2.1.5-beta.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.
@@ -0,0 +1,17 @@
1
+ html, body { margin: 0; height: 100%; background: #111; color: #ddd; font: 14px system-ui, sans-serif; }
2
+ body { display: flex; flex-direction: column; }
3
+ #bar { display: flex; align-items: center; gap: 12px; padding: 6px 10px; background: #1c1c1c; border-bottom: 1px solid #333; }
4
+ #bar #title { font-weight: 600; }
5
+ #bar #ttl { margin-left: auto; font-variant-numeric: tabular-nums; color: #9ad; }
6
+ #bar button { background: #402; color: #fbb; border: 1px solid #733; border-radius: 4px; padding: 3px 10px; cursor: pointer; }
7
+ #gate { max-width: 560px; margin: 40px auto; padding: 0 16px; line-height: 1.5; }
8
+ #gate form { display: flex; gap: 8px; margin-top: 12px; }
9
+ #gate input { flex: 1; font: 16px ui-monospace, monospace; letter-spacing: 1px; padding: 8px; background: #000; color: #fff; border: 1px solid #555; border-radius: 4px; }
10
+ #gate button { padding: 8px 16px; background: #246; color: #fff; border: 0; border-radius: 4px; cursor: pointer; }
11
+ #gate-msg { color: #f88; min-height: 1.5em; }
12
+ #term { flex: 1; min-height: 0; padding: 4px; }
13
+ #keys { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: #1c1c1c; border-top: 1px solid #333; }
14
+ #keys button { background: #222; color: #ddd; border: 1px solid #444; border-radius: 4px; padding: 6px 10px; font: 14px ui-monospace, monospace; cursor: pointer; }
15
+ #done { padding: 10px; background: #1c1c1c; border-top: 1px solid #333; }
16
+ #done.ok { color: #8d8; } #done.bad { color: #f88; }
17
+ @media (min-width: 900px) { #keys { display: none; } }
@@ -0,0 +1,43 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
6
+ <meta name="referrer" content="no-referrer">
7
+ <title>AgEnD terminal</title>
8
+ <link rel="stylesheet" href="assets/xterm.css">
9
+ <link rel="stylesheet" href="assets/terminal.css">
10
+ </head>
11
+ <body>
12
+ <header id="bar">
13
+ <span id="title">AgEnD terminal</span>
14
+ <span id="ttl" hidden></span>
15
+ <button id="btn-close" type="button" hidden title="End this session now (the command is stopped and the terminal closes)">Stop</button>
16
+ </header>
17
+ <section id="gate">
18
+ <p>This terminal is connected to <strong>one command only</strong> and closes when it exits or when the time limit lapses. There is no shell behind it.</p>
19
+ <p>Paste the <strong>access token</strong> you received in chat. It is separate from this link; the link alone grants nothing.</p>
20
+ <form id="gate-form" autocomplete="off">
21
+ <input id="token" type="text" inputmode="text" autocapitalize="characters" spellcheck="false" placeholder="access token" maxlength="40" required>
22
+ <button type="submit">Open</button>
23
+ </form>
24
+ <p id="gate-msg" role="alert"></p>
25
+ </section>
26
+ <main id="term" hidden></main>
27
+ <footer id="keys" hidden>
28
+ <button data-seq="\u001b" type="button">Esc</button>
29
+ <button data-seq="\t" type="button">Tab</button>
30
+ <button data-seq="\u001b[A" type="button">&uarr;</button>
31
+ <button data-seq="\u001b[B" type="button">&darr;</button>
32
+ <button data-seq="\u001b[D" type="button">&larr;</button>
33
+ <button data-seq="\u001b[C" type="button">&rarr;</button>
34
+ <button data-seq="\r" type="button">Enter</button>
35
+ <button data-seq="\u0003" type="button">Ctrl-C</button>
36
+ </footer>
37
+ <div id="done" hidden></div>
38
+ <script src="assets/xterm.js"></script>
39
+ <script src="assets/addon-fit.js"></script>
40
+ <script src="assets/addon-web-links.js"></script>
41
+ <script src="assets/terminal.js"></script>
42
+ </body>
43
+ </html>
@@ -0,0 +1,148 @@
1
+ /* Browser side of the AgEnD web terminal. No external origins (CSP). */
2
+ (function () {
3
+ "use strict";
4
+ var base = location.pathname.replace(/\/$/, "");
5
+ var gate = document.getElementById("gate");
6
+ var gateForm = document.getElementById("gate-form");
7
+ var gateMsg = document.getElementById("gate-msg");
8
+ var tokenInput = document.getElementById("token");
9
+ var termEl = document.getElementById("term");
10
+ var keys = document.getElementById("keys");
11
+ var ttlEl = document.getElementById("ttl");
12
+ var doneEl = document.getElementById("done");
13
+ var closeBtn = document.getElementById("btn-close");
14
+ var ws = null, term = null, fit = null, ttlTimer = null, expiresAt = 0;
15
+ var finished = false, reconnectAttempts = 0;
16
+
17
+ // A reload or a second tab within the TTL still holds the HttpOnly cookie:
18
+ // try the WebSocket first and only fall back to the token gate on refusal.
19
+ // This GET-free probe keeps the page itself side-effect free.
20
+ connect(true);
21
+
22
+ gateForm.addEventListener("submit", function (ev) {
23
+ ev.preventDefault();
24
+ var token = tokenInput.value.trim();
25
+ if (!token) return;
26
+ gateMsg.textContent = "";
27
+ fetch(base + "/open", {
28
+ method: "POST",
29
+ credentials: "same-origin",
30
+ headers: { "Content-Type": "application/json" },
31
+ body: JSON.stringify({ token: token })
32
+ }).then(function (res) {
33
+ if (res.status === 204) {
34
+ tokenInput.value = "";
35
+ // The one-time token is now consumed: the first connection MUST get the
36
+ // full retry budget even though the server's TTL is not yet known.
37
+ if (!expiresAt) expiresAt = Date.now() + 60000;
38
+ reconnectAttempts = 0;
39
+ connect(false);
40
+ return;
41
+ }
42
+ return res.json().catch(function () { return {}; }).then(function (body) {
43
+ if (res.status === 403 && typeof body.remaining === "number") {
44
+ gateMsg.textContent = "Invalid token. " + body.remaining + " attempt" + (body.remaining === 1 ? "" : "s") + " left before this session is destroyed.";
45
+ } else if (res.status === 409) {
46
+ gateMsg.textContent = "This token was already used. If that was not you, tell the fleet admin: the link may have leaked.";
47
+ } else if (res.status === 410) {
48
+ gateMsg.textContent = "This session has ended.";
49
+ } else {
50
+ gateMsg.textContent = "Could not open: " + (body.error || res.status);
51
+ }
52
+ });
53
+ }).catch(function () { gateMsg.textContent = "Network error."; });
54
+ });
55
+
56
+ function connect(probe) {
57
+ var proto = location.protocol === "https:" ? "wss://" : "ws://";
58
+ var opened = false;
59
+ // One live connection at a time: a new connect() supersedes the previous
60
+ // one, and every callback below is fenced on `conn` so a stale socket's
61
+ // events can never touch the current state (a pending cookie probe while
62
+ // the user submits a token, or an old socket closing after a reconnect).
63
+ if (ws && ws.readyState <= 1) { try { ws.close(); } catch (e) { /* ignore */ } }
64
+ var conn = new WebSocket(proto + location.host + base + "/ws");
65
+ ws = conn;
66
+ conn.binaryType = "arraybuffer";
67
+ conn.onopen = function () {
68
+ if (ws !== conn) return;
69
+ opened = true; reconnectAttempts = 0;
70
+ gate.hidden = true; termEl.hidden = false; keys.hidden = false; closeBtn.hidden = false;
71
+ if (!term) {
72
+ term = new Terminal({ cursorBlink: true, fontSize: 14, scrollback: 2000, theme: { background: "#111" } });
73
+ fit = new FitAddon.FitAddon();
74
+ term.loadAddon(fit);
75
+ term.loadAddon(new WebLinksAddon.WebLinksAddon());
76
+ term.open(termEl);
77
+ term.onData(function (s) { send(new TextEncoder().encode(s)); });
78
+ term.onBinary(function (s) { var b = new Uint8Array(s.length); for (var i = 0; i < s.length; i++) b[i] = s.charCodeAt(i) & 255; send(b); });
79
+ term.onResize(function (size) { if (ws && ws.readyState === 1) ws.send(JSON.stringify({ t: "resize", cols: size.cols, rows: size.rows })); });
80
+ window.addEventListener("resize", function () { if (fit) fit.fit(); });
81
+ } else {
82
+ term.reset(); // the server replays its buffer on (re)connect
83
+ }
84
+ fit.fit();
85
+ term.focus();
86
+ };
87
+ conn.onmessage = function (ev) {
88
+ if (ws !== conn) return;
89
+ if (typeof ev.data === "string") {
90
+ var msg; try { msg = JSON.parse(ev.data); } catch (e) { return; }
91
+ if (msg.t === "hello") {
92
+ document.getElementById("title").textContent = "AgEnD · " + msg.kind + " · " + msg.backend;
93
+ expiresAt = Date.now() + msg.ttlRemainingMs;
94
+ if (ttlTimer) clearInterval(ttlTimer); // exactly one countdown, however many reconnects
95
+ ttlEl.hidden = false; tick(); ttlTimer = setInterval(tick, 1000);
96
+ if (msg.truncated && term) term.writeln("\x1b[33m[earlier output truncated]\x1b[0m");
97
+ } else if (msg.t === "exit") {
98
+ finish(msg.ok, (msg.ok ? "Finished" : "Ended") + ": " + msg.detail + (typeof msg.exitCode === "number" ? " (exit " + msg.exitCode + ")" : ""));
99
+ }
100
+ return;
101
+ }
102
+ if (term) term.write(new Uint8Array(ev.data));
103
+ };
104
+ conn.onclose = function (ev) {
105
+ if (ws !== conn || finished) return;
106
+ if (!opened && probe) { gate.hidden = false; return; } // initial cookie probe refused → token gate
107
+ if (opened && ev.code === 4000) { finish(false, "Replaced by a newer connection."); return; }
108
+ if (opened && (ev.code === 1000 || ev.code === 1001 || ev.code === 1008)) { finish(false, "Connection closed (" + (ev.reason || ev.code) + ")."); return; }
109
+ // Transient drop, or a reconnect attempt that failed before opening: the
110
+ // process is still running; keep trying within the TTL and the budget.
111
+ scheduleReconnect();
112
+ };
113
+ }
114
+
115
+ function scheduleReconnect() {
116
+ if (reconnectAttempts < 5 && (expiresAt === 0 || Date.now() < expiresAt)) {
117
+ reconnectAttempts++;
118
+ setTimeout(function () { if (!finished) connect(false); }, 500 * reconnectAttempts);
119
+ return;
120
+ }
121
+ finish(false, "Connection lost.");
122
+ }
123
+
124
+ function send(bytes) { if (ws && ws.readyState === 1 && bytes.length) ws.send(bytes); }
125
+
126
+ function tick() {
127
+ var left = Math.max(0, expiresAt - Date.now());
128
+ var m = Math.floor(left / 60000), s = Math.floor((left % 60000) / 1000);
129
+ ttlEl.textContent = "closes in " + m + ":" + (s < 10 ? "0" : "") + s;
130
+ }
131
+
132
+ function finish(ok, text) {
133
+ finished = true;
134
+ if (ttlTimer) clearInterval(ttlTimer);
135
+ doneEl.hidden = false; doneEl.className = ok ? "ok" : "bad"; doneEl.textContent = text;
136
+ keys.hidden = true; closeBtn.hidden = true;
137
+ if (term) term.options.disableStdin = true;
138
+ }
139
+
140
+ keys.addEventListener("click", function (ev) {
141
+ var b = ev.target.closest("button[data-seq]");
142
+ if (!b) return;
143
+ send(new TextEncoder().encode(JSON.parse('"' + b.getAttribute("data-seq") + '"')));
144
+ if (term) term.focus();
145
+ });
146
+ // Stop = end the session for real (server-side cancel), not just a Ctrl-C the CLI may ignore.
147
+ closeBtn.addEventListener("click", function () { if (ws && ws.readyState === 1) ws.send(JSON.stringify({ t: "cancel" })); });
148
+ })();
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2019, The xterm.js authors (https://github.com/xtermjs/xterm.js)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2017-2019, The xterm.js authors (https://github.com/xtermjs/xterm.js)
2
+ Copyright (c) 2014-2016, SourceLair Private Company (https://www.sourcelair.com)
3
+ Copyright (c) 2012-2013, Christopher Jeffrey (https://github.com/chjj/)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ # Vendored browser assets for the web terminal
2
+
3
+ These files are copied verbatim from the official npm tarballs (`npm pack`) and
4
+ served by AgEnD itself (`/t/<sid>/assets/*`). They are **not** install-time
5
+ dependencies: the CSP of the terminal page forbids every external origin, so
6
+ the fleet must ship them. All three packages are MIT licensed (see LICENSE.*).
7
+
8
+ | file | package | version | tarball sha512 (npm `dist.integrity`) |
9
+ |---|---|---|---|
10
+ | xterm.js, xterm.css | @xterm/xterm | 6.0.0 | sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg== |
11
+ | addon-fit.js | @xterm/addon-fit | 0.11.0 | sha512-jYcgT6xtVYhnhgxh3QgYDnnNMYTcf8ElbxxFzX0IZo+vabQqSPAjC3c1wJrKB5E19VwQei89QCiZZP86DCPF7g== |
12
+ | addon-web-links.js | @xterm/addon-web-links | 0.12.0 | sha512-4Smom3RPyVp7ZMYOYDoC/9eGJJJqYhnPLGGqJ6wOBfB8VxPViJNSKdgRYb8NpaM6YSelEKbA2SStD7lGyqaobw== |
13
+
14
+ The only local edit: the trailing `//# sourceMappingURL=…` line was removed
15
+ from all three .js files (no source maps are shipped). To refresh:
16
+
17
+ ```
18
+ npm pack @xterm/xterm@<v> @xterm/addon-fit@<v> @xterm/addon-web-links@<v>
19
+ tar xzf …; cp package/lib/*.js package/css/xterm.css package/LICENSE here
20
+ ```
21
+
22
+ then update this table with the new versions and `npm view <pkg> dist.integrity`.
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FitAddon=t():e.FitAddon=t()}(globalThis,(()=>(()=>{"use strict";var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const t=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal)return;if(!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core._renderService.dimensions;if(0===e.css.cell.width||0===e.css.cell.height)return;const t=0===this._terminal.options.scrollback?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue("height")),o=Math.max(0,parseInt(r.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),n=i-(parseInt(s.getPropertyValue("padding-top"))+parseInt(s.getPropertyValue("padding-bottom"))),l=o-(parseInt(s.getPropertyValue("padding-right"))+parseInt(s.getPropertyValue("padding-left")))-t;return{cols:Math.max(2,Math.floor(l/e.css.cell.width)),rows:Math.max(1,Math.floor(n/e.css.cell.height))}}}})(),e})()));
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WebLinksAddon=t():e.WebLinksAddon=t()}(globalThis,(()=>(()=>{"use strict";var e={490:(e,t)=>{function n(e){try{const t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch(e){return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.LinkComputer=t.WebLinkProvider=void 0,t.WebLinkProvider=class{constructor(e,t,n,o={}){this._terminal=e,this._regex=t,this._handler=n,this._options=o}provideLinks(e,t){const n=o.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map((e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){const{range:o}=e;this._options.hover(t,n,o)}},e)))}};class o{static computeLink(e,t,r,i){const s=new RegExp(t.source,(t.flags||"")+"g"),[a,c]=o._getWindowedLineStrings(e-1,r),l=a.join("");let d;const p=[];for(;d=s.exec(l);){const e=d[0];if(!n(e))continue;const[t,s]=o._mapStrIdx(r,c,0,d.index),[a,l]=o._mapStrIdx(r,t,s,e.length);if(-1===t||-1===s||-1===a||-1===l)continue;const h={start:{x:s+1,y:t+1},end:{x:l,y:a+1}};p.push({range:h,text:e,activate:i})}return p}static _getWindowedLineStrings(e,t){let n,o=e,r=e,i=0,s="";const a=[];if(n=t.buffer.active.getLine(e)){const e=n.translateToString(!0);if(n.isWrapped&&" "!==e[0]){for(i=0;(n=t.buffer.active.getLine(--o))&&i<2048&&(s=n.translateToString(!0),i+=s.length,a.push(s),n.isWrapped&&-1===s.indexOf(" ")););a.reverse()}for(a.push(e),i=0;(n=t.buffer.active.getLine(++r))&&n.isWrapped&&i<2048&&(s=n.translateToString(!0),i+=s.length,a.push(s),-1===s.indexOf(" ")););}return[a,o]}static _mapStrIdx(e,t,n,o){const r=e.buffer.active,i=r.getNullCell();let s=n;for(;o;){const e=r.getLine(t);if(!e)return[-1,-1];for(let n=s;n<e.length;++n){e.getCell(n,i);const s=i.getChars();if(i.getWidth()&&(o-=s.length||1,n===e.length-1&&""===s)){const e=r.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,i),2===i.getWidth()&&(o+=1))}if(o<0)return[t,n]}t++,s=0}return[t,s]}}t.LinkComputer=o}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}var o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.WebLinksAddon=void 0;const t=n(490),r=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function i(e,t){const n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}e.WebLinksAddon=class{constructor(e=i,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;const n=this._options,o=n.urlRegex||r;this._linkProvider=this._terminal.registerLinkProvider(new t.WebLinkProvider(this._terminal,o,this._handler,n))}dispose(){this._linkProvider?.dispose()}}})(),o})()));
@@ -0,0 +1,285 @@
1
+ /**
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
+ */
33
+
34
+ /**
35
+ * Default styles for xterm.js
36
+ */
37
+
38
+ .xterm {
39
+ cursor: text;
40
+ position: relative;
41
+ user-select: none;
42
+ -ms-user-select: none;
43
+ -webkit-user-select: none;
44
+ }
45
+
46
+ .xterm.focus,
47
+ .xterm:focus {
48
+ outline: none;
49
+ }
50
+
51
+ .xterm .xterm-helpers {
52
+ position: absolute;
53
+ top: 0;
54
+ /**
55
+ * The z-index of the helpers must be higher than the canvases in order for
56
+ * IMEs to appear on top.
57
+ */
58
+ z-index: 5;
59
+ }
60
+
61
+ .xterm .xterm-helper-textarea {
62
+ padding: 0;
63
+ border: 0;
64
+ margin: 0;
65
+ /* Move textarea out of the screen to the far left, so that the cursor is not visible */
66
+ position: absolute;
67
+ opacity: 0;
68
+ left: -9999em;
69
+ top: 0;
70
+ width: 0;
71
+ height: 0;
72
+ z-index: -5;
73
+ /** Prevent wrapping so the IME appears against the textarea at the correct position */
74
+ white-space: nowrap;
75
+ overflow: hidden;
76
+ resize: none;
77
+ }
78
+
79
+ .xterm .composition-view {
80
+ /* TODO: Composition position got messed up somewhere */
81
+ background: #000;
82
+ color: #FFF;
83
+ display: none;
84
+ position: absolute;
85
+ white-space: nowrap;
86
+ z-index: 1;
87
+ }
88
+
89
+ .xterm .composition-view.active {
90
+ display: block;
91
+ }
92
+
93
+ .xterm .xterm-viewport {
94
+ /* On OS X this is required in order for the scroll bar to appear fully opaque */
95
+ background-color: #000;
96
+ overflow-y: scroll;
97
+ cursor: default;
98
+ position: absolute;
99
+ right: 0;
100
+ left: 0;
101
+ top: 0;
102
+ bottom: 0;
103
+ }
104
+
105
+ .xterm .xterm-screen {
106
+ position: relative;
107
+ }
108
+
109
+ .xterm .xterm-screen canvas {
110
+ position: absolute;
111
+ left: 0;
112
+ top: 0;
113
+ }
114
+
115
+ .xterm-char-measure-element {
116
+ display: inline-block;
117
+ visibility: hidden;
118
+ position: absolute;
119
+ top: 0;
120
+ left: -9999em;
121
+ line-height: normal;
122
+ }
123
+
124
+ .xterm.enable-mouse-events {
125
+ /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
126
+ cursor: default;
127
+ }
128
+
129
+ .xterm.xterm-cursor-pointer,
130
+ .xterm .xterm-cursor-pointer {
131
+ cursor: pointer;
132
+ }
133
+
134
+ .xterm.column-select.focus {
135
+ /* Column selection mode */
136
+ cursor: crosshair;
137
+ }
138
+
139
+ .xterm .xterm-accessibility:not(.debug),
140
+ .xterm .xterm-message {
141
+ position: absolute;
142
+ left: 0;
143
+ top: 0;
144
+ bottom: 0;
145
+ right: 0;
146
+ z-index: 10;
147
+ color: transparent;
148
+ pointer-events: none;
149
+ }
150
+
151
+ .xterm .xterm-accessibility-tree:not(.debug) *::selection {
152
+ color: transparent;
153
+ }
154
+
155
+ .xterm .xterm-accessibility-tree {
156
+ font-family: monospace;
157
+ user-select: text;
158
+ white-space: pre;
159
+ }
160
+
161
+ .xterm .xterm-accessibility-tree > div {
162
+ transform-origin: left;
163
+ width: fit-content;
164
+ }
165
+
166
+ .xterm .live-region {
167
+ position: absolute;
168
+ left: -9999px;
169
+ width: 1px;
170
+ height: 1px;
171
+ overflow: hidden;
172
+ }
173
+
174
+ .xterm-dim {
175
+ /* Dim should not apply to background, so the opacity of the foreground color is applied
176
+ * explicitly in the generated class and reset to 1 here */
177
+ opacity: 1 !important;
178
+ }
179
+
180
+ .xterm-underline-1 { text-decoration: underline; }
181
+ .xterm-underline-2 { text-decoration: double underline; }
182
+ .xterm-underline-3 { text-decoration: wavy underline; }
183
+ .xterm-underline-4 { text-decoration: dotted underline; }
184
+ .xterm-underline-5 { text-decoration: dashed underline; }
185
+
186
+ .xterm-overline {
187
+ text-decoration: overline;
188
+ }
189
+
190
+ .xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
191
+ .xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
192
+ .xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
193
+ .xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
194
+ .xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }
195
+
196
+ .xterm-strikethrough {
197
+ text-decoration: line-through;
198
+ }
199
+
200
+ .xterm-screen .xterm-decoration-container .xterm-decoration {
201
+ z-index: 6;
202
+ position: absolute;
203
+ }
204
+
205
+ .xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
206
+ z-index: 7;
207
+ }
208
+
209
+ .xterm-decoration-overview-ruler {
210
+ z-index: 8;
211
+ position: absolute;
212
+ top: 0;
213
+ right: 0;
214
+ pointer-events: none;
215
+ }
216
+
217
+ .xterm-decoration-top {
218
+ z-index: 2;
219
+ position: relative;
220
+ }
221
+
222
+
223
+
224
+ /* Derived from vs/base/browser/ui/scrollbar/media/scrollbar.css */
225
+
226
+ /* xterm.js customization: Override xterm's cursor style */
227
+ .xterm .xterm-scrollable-element > .scrollbar {
228
+ cursor: default;
229
+ }
230
+
231
+ /* Arrows */
232
+ .xterm .xterm-scrollable-element > .scrollbar > .scra {
233
+ cursor: pointer;
234
+ font-size: 11px !important;
235
+ }
236
+
237
+ .xterm .xterm-scrollable-element > .visible {
238
+ opacity: 1;
239
+
240
+ /* Background rule added for IE9 - to allow clicks on dom node */
241
+ background:rgba(0,0,0,0);
242
+
243
+ transition: opacity 100ms linear;
244
+ /* In front of peek view */
245
+ z-index: 11;
246
+ }
247
+ .xterm .xterm-scrollable-element > .invisible {
248
+ opacity: 0;
249
+ pointer-events: none;
250
+ }
251
+ .xterm .xterm-scrollable-element > .invisible.fade {
252
+ transition: opacity 800ms linear;
253
+ }
254
+
255
+ /* Scrollable Content Inset Shadow */
256
+ .xterm .xterm-scrollable-element > .shadow {
257
+ position: absolute;
258
+ display: none;
259
+ }
260
+ .xterm .xterm-scrollable-element > .shadow.top {
261
+ display: block;
262
+ top: 0;
263
+ left: 3px;
264
+ height: 3px;
265
+ width: 100%;
266
+ box-shadow: var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset;
267
+ }
268
+ .xterm .xterm-scrollable-element > .shadow.left {
269
+ display: block;
270
+ top: 3px;
271
+ left: 0;
272
+ height: 100%;
273
+ width: 3px;
274
+ box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
275
+ }
276
+ .xterm .xterm-scrollable-element > .shadow.top-left-corner {
277
+ display: block;
278
+ top: 0;
279
+ left: 0;
280
+ height: 3px;
281
+ width: 3px;
282
+ }
283
+ .xterm .xterm-scrollable-element > .shadow.top.left {
284
+ box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
285
+ }