airloom 0.1.26 → 0.1.28

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/dist/index.js CHANGED
@@ -1044,9 +1044,33 @@ function fixSpawnHelperPermissions() {
1044
1044
  }
1045
1045
  }
1046
1046
  fixSpawnHelperPermissions();
1047
- var OSC_COLOR_RE = /(?:\x1b\])?\d+(?:;\d+)?;rgb:[0-9a-f]{2,4}(?:\/[0-9a-f]{2,4}){2}(?:\x1b\\|\x07)?/gi;
1048
- function stripOscColorResponses(data) {
1049
- return data.replace(OSC_COLOR_RE, "");
1047
+ var QUERY_RESPONSE_RE = new RegExp(
1048
+ [
1049
+ // OSC color (full form): ESC] <id>[;<id>] ; rgb:RR/GG/BB [ST]
1050
+ String.raw`\x1b\]\d+(?:;\d+)?;rgb:[0-9a-fA-F]{2,4}(?:\/[0-9a-fA-F]{2,4}){2}(?:\x1b\\|\x07)?`,
1051
+ // OSC color (bare, ESC stripped): <id>[;<id>] ; rgb:RR/GG/BB
1052
+ // Anchored to start-of-string so we only strip it when the response is the
1053
+ // entire (or leading) content of a write, not embedded in normal text.
1054
+ String.raw`(?<=^|\n)\d+(?:;\d+)?;rgb:[0-9a-fA-F]{2,4}(?:\/[0-9a-fA-F]{2,4}){2}(?:\x1b\\|\x07)?`,
1055
+ // CSI DA / DSR / CPR / window reports (full form: ESC[ … )
1056
+ // Note: mode reports end in `$y` (with $ modifier), not bare `y`, so `y`
1057
+ // is deliberately excluded from this terminator set.
1058
+ String.raw`\x1b\[[?>]?[\d;]*[cnRt]`,
1059
+ // CSI mode report (full form): ESC[ [?] <params> $ y
1060
+ String.raw`\x1b\[\??[\d;]*\$y`,
1061
+ // Bare DA/secondary DA: ?1;2c ?6c >0;276;0c
1062
+ // Anchored to start-of-string/line to avoid stripping legitimate text
1063
+ // containing "?c" or ">c" (e.g. shell redirections like `cmd >c`).
1064
+ String.raw`(?<=^|\n)[?>][\d;]*c`,
1065
+ // Bare mode report: 4;2$y
1066
+ // Anchored to start-of-string/line to avoid stripping legitimate text
1067
+ // like shell expressions containing "$y".
1068
+ String.raw`(?<=^|\n)[\d;]+\$y`
1069
+ ].join("|"),
1070
+ "g"
1071
+ );
1072
+ function stripTerminalQueryResponses(data) {
1073
+ return data.replace(QUERY_RESPONSE_RE, "");
1050
1074
  }
1051
1075
  function resolveExecutable2(command, envPath = process.env.PATH ?? "") {
1052
1076
  if (!command) return null;
@@ -1240,14 +1264,14 @@ var TerminalSession = class {
1240
1264
  }
1241
1265
  writeInput(message) {
1242
1266
  if (!this.pty) return;
1243
- const data = stripOscColorResponses(message.data);
1267
+ const data = stripTerminalQueryResponses(message.data);
1244
1268
  if (!data) return;
1245
1269
  this.batcher?.noteInput();
1246
1270
  this.pty.write(data);
1247
1271
  }
1248
1272
  writeRawInput(data) {
1249
1273
  if (!this.pty) return;
1250
- const cleaned = stripOscColorResponses(data);
1274
+ const cleaned = stripTerminalQueryResponses(data);
1251
1275
  if (!cleaned) return;
1252
1276
  this.batcher?.noteInput();
1253
1277
  this.pty.write(cleaned);
@@ -1469,37 +1493,39 @@ var HOST_HTML = `<!DOCTYPE html>
1469
1493
  <title>Airloom - Host</title>
1470
1494
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@xterm/xterm@6.0.0/css/xterm.css">
1471
1495
  <style>
1496
+ :root{color-scheme:light dark;--bg:#0a0a0a;--surface:#1a1a1a;--border:#2a2a2a;--text:#e0e0e0;--text-muted:#888;--accent:#7c8aff;--accent-hover:#6b79ee;--input-bg:#111;--input-border:#333;--term-bg:#05070c;--tool-bg:#333;--tool-hover:#444;--msg-user:#2a3a6a;--msg-asst:#1e1e1e}
1497
+ @media(prefers-color-scheme:light){:root{--bg:#f5f5f7;--surface:#fff;--border:#d1d1d6;--text:#1c1c1e;--text-muted:#6e6e73;--accent:#5856d6;--accent-hover:#4a48c4;--input-bg:#fff;--input-border:#d1d1d6;--term-bg:#fff;--tool-bg:#e5e5ea;--tool-hover:#d1d1d6;--msg-user:#d6d5f7;--msg-asst:#f2f2f7}}
1472
1498
  *{margin:0;padding:0;box-sizing:border-box}
1473
- body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#0a0a0a;color:#e0e0e0;min-height:100vh}
1499
+ body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:var(--bg);color:var(--text);min-height:100vh}
1474
1500
  .container{max-width:800px;margin:0 auto;padding:20px}
1475
1501
  .page-header{display:flex;align-items:center;gap:12px;margin-bottom:20px}
1476
1502
  .page-header svg{width:36px;height:36px;flex-shrink:0}
1477
- .page-header h1{font-size:1.5rem;color:#7c8aff}
1478
- h2{font-size:1.1rem;margin-bottom:12px;color:#a0a0a0}
1479
- .card{background:#1a1a1a;border:1px solid #2a2a2a;border-radius:12px;padding:20px;margin-bottom:16px}
1503
+ .page-header h1{font-size:1.5rem;color:var(--accent)}
1504
+ h2{font-size:1.1rem;margin-bottom:12px;color:var(--text-muted)}
1505
+ .card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:20px;margin-bottom:16px}
1480
1506
  .status{display:flex;align-items:center;gap:8px;margin-bottom:8px}
1481
1507
  .dot{width:8px;height:8px;border-radius:50%}
1482
1508
  .dot.on{background:#4caf50} .dot.off{background:#f44336} .dot.wait{background:#ff9800;animation:pulse 1.5s infinite}
1483
1509
  @keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
1484
1510
  .pairing{text-align:center}
1485
1511
  .pairing img{max-width:200px;margin:16px auto;display:block;border-radius:8px}
1486
- .pairing-code{font-family:monospace;font-size:2rem;letter-spacing:4px;color:#7c8aff;margin:12px 0}
1512
+ .pairing-code{font-family:monospace;font-size:2rem;letter-spacing:4px;color:var(--accent);margin:12px 0}
1487
1513
  .config-form{display:flex;flex-direction:column;gap:12px}
1488
- select,input,button{padding:10px 14px;border-radius:8px;border:1px solid #333;background:#111;color:#e0e0e0;font-size:.95rem}
1489
- select:focus,input:focus{outline:none;border-color:#7c8aff}
1490
- button{background:#7c8aff;color:#fff;border:none;cursor:pointer;font-weight:600}
1491
- button:hover{background:#6b79ee}
1514
+ select,input,button{padding:10px 14px;border-radius:8px;border:1px solid var(--input-border);background:var(--input-bg);color:var(--text);font-size:.95rem}
1515
+ select:focus,input:focus{outline:none;border-color:var(--accent)}
1516
+ button{background:var(--accent);color:#fff;border:none;cursor:pointer;font-weight:600}
1517
+ button:hover{background:var(--accent-hover)}
1492
1518
  .messages{max-height:400px;overflow-y:auto;display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
1493
1519
  .msg{padding:10px 14px;border-radius:10px;max-width:85%;word-break:break-word;font-size:.9rem;line-height:1.5;white-space:pre-wrap}
1494
- .msg.user{background:#2a3a6a;align-self:flex-end}
1495
- .msg.assistant{background:#1e1e1e;border:1px solid #2a2a2a;align-self:flex-start}
1520
+ .msg.user{background:var(--msg-user);align-self:flex-end}
1521
+ .msg.assistant{background:var(--msg-asst);border:1px solid var(--border);align-self:flex-start}
1496
1522
  .input-area{display:flex;gap:8px}
1497
- .input-area textarea{flex:1;resize:none;min-height:44px;max-height:120px;padding:10px 14px;border-radius:8px;border:1px solid #333;background:#111;color:#e0e0e0;font-family:inherit;font-size:.9rem}
1498
- .terminal-container{background:#05070c;border:1px solid #2a2a2a;border-radius:8px;height:420px;overflow:hidden;margin-bottom:12px}
1523
+ .input-area textarea{flex:1;resize:none;min-height:44px;max-height:120px;padding:10px 14px;border-radius:8px;border:1px solid var(--input-border);background:var(--input-bg);color:var(--text);font-family:inherit;font-size:.9rem}
1524
+ .terminal-container{background:var(--term-bg);border:1px solid var(--border);border-radius:8px;height:420px;overflow:hidden;margin-bottom:12px}
1499
1525
  #terminal{width:100%;height:100%;padding:8px}
1500
1526
  .toolbar{display:flex;gap:8px;margin-bottom:12px}
1501
- .tool-btn{padding:6px 12px;font-size:.85rem;background:#333;border:none;border-radius:6px;color:#e0e0e0;cursor:pointer}
1502
- .tool-btn:hover{background:#444}
1527
+ .tool-btn{padding:6px 12px;font-size:.85rem;background:var(--tool-bg);border:none;border-radius:6px;color:var(--text);cursor:pointer}
1528
+ .tool-btn:hover{background:var(--tool-hover)}
1503
1529
  </style>
1504
1530
  </head>
1505
1531
  <body>
@@ -1510,14 +1536,14 @@ var HOST_HTML = `<!DOCTYPE html>
1510
1536
  </div>
1511
1537
  <div class="card">
1512
1538
  <div class="status"><div class="dot wait" id="dot"></div><span id="statusText">Initializing...</span></div>
1513
- <p style="color:#888;font-size:.9rem;margin-top:8px" id="launchText">Launch: current shell</p>
1539
+ <p style="color:var(--text-muted);font-size:.9rem;margin-top:8px" id="launchText">Launch: current shell</p>
1514
1540
  </div>
1515
1541
 
1516
1542
  <div class="card pairing" id="pairingCard" style="display:none">
1517
1543
  <h2>Connect Your Phone</h2>
1518
1544
  <img id="qrCode" alt="QR Code"/>
1519
1545
  <div class="pairing-code" id="pairingCode"></div>
1520
- <p style="color:#888;font-size:.85rem">Scan QR or enter code in viewer</p>
1546
+ <p style="color:var(--text-muted);font-size:.85rem">Scan QR or enter code in viewer</p>
1521
1547
  </div>
1522
1548
 
1523
1549
  <!-- Terminal mode: shell, Devin, Codex etc. (default when no AI adapter) -->
@@ -1527,7 +1553,7 @@ var HOST_HTML = `<!DOCTYPE html>
1527
1553
  <div class="config-form">
1528
1554
  <select id="cliPreset"></select>
1529
1555
  <input type="text" id="command" placeholder="Custom launch command" style="display:none"/>
1530
- <p style="color:#666;font-size:.8rem;margin-top:4px" id="presetDesc"></p>
1556
+ <p style="color:var(--text-muted);font-size:.8rem;margin-top:4px" id="presetDesc"></p>
1531
1557
  <button id="applyLaunchBtn">Apply Launch Target</button>
1532
1558
  </div>
1533
1559
  </div>
@@ -1568,6 +1594,27 @@ let fitAddon = null;
1568
1594
  let termInitialized = false;
1569
1595
  let cliPresets = [];
1570
1596
 
1597
+ const darkTheme = {
1598
+ background: '#05070c', foreground: '#e6edf3', cursor: '#7c8aff', cursorAccent: '#05070c',
1599
+ selectionBackground: 'rgba(124,138,255,0.28)',
1600
+ black: '#0a0d14', red: '#ff7b72', green: '#3fb950', yellow: '#d29922',
1601
+ blue: '#7c8aff', magenta: '#bc8cff', cyan: '#39c5cf', white: '#c9d1d9',
1602
+ brightBlack: '#6e7681', brightRed: '#ffa198', brightGreen: '#56d364', brightYellow: '#e3b341',
1603
+ brightBlue: '#a5b4ff', brightMagenta: '#d2a8ff', brightCyan: '#56d4dd', brightWhite: '#f0f6fc',
1604
+ };
1605
+ const lightTheme = {
1606
+ background: '#ffffff', foreground: '#1c1c1e', cursor: '#5856d6', cursorAccent: '#ffffff',
1607
+ selectionBackground: 'rgba(88,86,214,0.20)',
1608
+ black: '#1c1c1e', red: '#c41a16', green: '#007400', yellow: '#826b28',
1609
+ blue: '#0000ff', magenta: '#a90d91', cyan: '#3e8a8a', white: '#e5e5ea',
1610
+ brightBlack: '#6e6e73', brightRed: '#eb4d3d', brightGreen: '#36b738', brightYellow: '#b79a14',
1611
+ brightBlue: '#0451a5', brightMagenta: '#c42275', brightCyan: '#318495', brightWhite: '#f2f2f7',
1612
+ };
1613
+ function getTheme() { return matchMedia('(prefers-color-scheme:light)').matches ? lightTheme : darkTheme; }
1614
+ matchMedia('(prefers-color-scheme:light)').addEventListener('change', () => {
1615
+ if (term) term.options.theme = getTheme();
1616
+ });
1617
+
1571
1618
  function initTerminal() {
1572
1619
  if (termInitialized) return;
1573
1620
  termInitialized = true;
@@ -1577,14 +1624,7 @@ function initTerminal() {
1577
1624
  fontSize: 14,
1578
1625
  lineHeight: 1.25,
1579
1626
  scrollback: 5000,
1580
- theme: {
1581
- background: '#05070c', foreground: '#e6edf3', cursor: '#7c8aff', cursorAccent: '#05070c',
1582
- selectionBackground: 'rgba(124,138,255,0.28)',
1583
- black: '#0a0d14', red: '#ff7b72', green: '#3fb950', yellow: '#d29922',
1584
- blue: '#7c8aff', magenta: '#bc8cff', cyan: '#39c5cf', white: '#c9d1d9',
1585
- brightBlack: '#6e7681', brightRed: '#ffa198', brightGreen: '#56d364', brightYellow: '#e3b341',
1586
- brightBlue: '#a5b4ff', brightMagenta: '#d2a8ff', brightCyan: '#56d4dd', brightWhite: '#f0f6fc',
1587
- },
1627
+ theme: getTheme(),
1588
1628
  });
1589
1629
  fitAddon = new FitAddon();
1590
1630
  term.loadAddon(fitAddon);
@@ -1871,7 +1911,7 @@ async function main() {
1871
1911
  const tokenDetails = await rest.auth.requestToken({
1872
1912
  clientId: "*",
1873
1913
  // viewer picks its own clientId
1874
- capability: { [channelName]: ["publish", "subscribe", "presence"] },
1914
+ capability: { "airloom:*": ["publish", "subscribe", "presence"] },
1875
1915
  ttl: ABLY_TOKEN_TTL
1876
1916
  });
1877
1917
  console.log(`[ably] Scoped token issued (TTL: ${Math.round(ABLY_TOKEN_TTL / 6e4)}min, channel: ${channelName})`);
@@ -1 +1 @@
1
- import{g as c}from"./index-B8POXsBS.js";function f(t,i){for(var o=0;o<i.length;o++){const e=i[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(e,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n,a;function b(){return a||(a=1,n=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}),n}var u=b();const w=c(u),p=f({__proto__:null,default:w},[u]);export{p as b};
1
+ import{g as c}from"./index-BIIt6Ahm.js";function f(t,i){for(var o=0;o<i.length;o++){const e=i[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(e,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n,a;function b(){return a||(a=1,n=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}),n}var u=b();const w=c(u),p=f({__proto__:null,default:w},[u]);export{p as b};