@phenx-inc/ctlsurf 0.1.15 → 0.1.18

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.
Files changed (22) hide show
  1. package/out/main/index.js +278 -48
  2. package/out/renderer/assets/{cssMode-woG3Vtms.js → cssMode-Cxe23-tB.js} +3 -3
  3. package/out/renderer/assets/{freemarker2-DgtqmvCd.js → freemarker2-Be0nj7Oa.js} +1 -1
  4. package/out/renderer/assets/{handlebars-YEqC-zOn.js → handlebars-C0It7_Nu.js} +1 -1
  5. package/out/renderer/assets/{html-CwvkGxeB.js → html-BW6LB-7J.js} +1 -1
  6. package/out/renderer/assets/{htmlMode-DzdyF21q.js → htmlMode-D_V-1VlE.js} +3 -3
  7. package/out/renderer/assets/{index-CpDga7fF.js → index-D568SpEt.js} +109 -111
  8. package/out/renderer/assets/{javascript-Dy9cX9Fu.js → javascript-D_LoeNc7.js} +2 -2
  9. package/out/renderer/assets/{jsonMode-CPhJ_ION.js → jsonMode-K3WSinSE.js} +3 -3
  10. package/out/renderer/assets/{liquid-BJdFPWrv.js → liquid-BqfOd6m8.js} +1 -1
  11. package/out/renderer/assets/{lspLanguageFeatures-BMM3SRX4.js → lspLanguageFeatures-Bjf28WU6.js} +1 -1
  12. package/out/renderer/assets/{mdx-kg2kuPRK.js → mdx-BoESjI38.js} +1 -1
  13. package/out/renderer/assets/{python-aIrmxkmH.js → python-DlafOOgB.js} +1 -1
  14. package/out/renderer/assets/{razor-DdymcPOc.js → razor-CB6E9DBD.js} +1 -1
  15. package/out/renderer/assets/{tsMode-D7kqIJ_o.js → tsMode-DYu1z_nn.js} +1 -1
  16. package/out/renderer/assets/{typescript-Cq3g-z7h.js → typescript-CDjkh0d5.js} +1 -1
  17. package/out/renderer/assets/{xml-BuBP5jOc.js → xml-C-XlilKZ.js} +1 -1
  18. package/out/renderer/assets/{yaml-B-3hWmol.js → yaml-BTrtxLEo.js} +1 -1
  19. package/out/renderer/index.html +1 -1
  20. package/package.json +5 -1
  21. package/src/renderer/App.tsx +0 -12
  22. package/src/renderer/components/TerminalPanel.tsx +100 -82
package/out/main/index.js CHANGED
@@ -4,10 +4,10 @@ const path = require("path");
4
4
  const fs = require("fs");
5
5
  const os = require("os");
6
6
  const module$1 = require("module");
7
- const require$$1$1 = require("crypto");
7
+ const require$$1 = require("crypto");
8
8
  const require$$0$3 = require("events");
9
- const require$$1$2 = require("https");
10
- const require$$2$1 = require("http");
9
+ const require$$1$1 = require("https");
10
+ const require$$2 = require("http");
11
11
  const require$$3 = require("net");
12
12
  const require$$4 = require("tls");
13
13
  const require$$0$2 = require("stream");
@@ -293,30 +293,6 @@ function cleanOutput(str) {
293
293
  function getDefaultExportFromCjs(x) {
294
294
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
295
295
  }
296
- function getAugmentedNamespace(n) {
297
- if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
298
- var f = n.default;
299
- if (typeof f == "function") {
300
- var a = function a2() {
301
- if (this instanceof a2) {
302
- return Reflect.construct(f, arguments, this.constructor);
303
- }
304
- return f.apply(this, arguments);
305
- };
306
- a.prototype = f.prototype;
307
- } else a = {};
308
- Object.defineProperty(a, "__esModule", { value: true });
309
- Object.keys(n).forEach(function(k) {
310
- var d = Object.getOwnPropertyDescriptor(n, k);
311
- Object.defineProperty(a, k, d.get ? d : {
312
- enumerable: true,
313
- get: function() {
314
- return n[k];
315
- }
316
- });
317
- });
318
- return a;
319
- }
320
296
  var bufferUtil = { exports: {} };
321
297
  var constants;
322
298
  var hasRequiredConstants;
@@ -341,12 +317,223 @@ function requireConstants() {
341
317
  };
342
318
  return constants;
343
319
  }
344
- const __viteOptionalPeerDep_bufferutil_ws = {};
345
- const __viteOptionalPeerDep_bufferutil_ws$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
346
- __proto__: null,
347
- default: __viteOptionalPeerDep_bufferutil_ws
348
- }, Symbol.toStringTag, { value: "Module" }));
349
- const require$$1 = /* @__PURE__ */ getAugmentedNamespace(__viteOptionalPeerDep_bufferutil_ws$1);
320
+ var bufferutil = { exports: {} };
321
+ function commonjsRequire(path2) {
322
+ throw new Error('Could not dynamically require "' + path2 + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
323
+ }
324
+ var nodeGypBuild$1 = { exports: {} };
325
+ var nodeGypBuild;
326
+ var hasRequiredNodeGypBuild$1;
327
+ function requireNodeGypBuild$1() {
328
+ if (hasRequiredNodeGypBuild$1) return nodeGypBuild;
329
+ hasRequiredNodeGypBuild$1 = 1;
330
+ var fs$1 = fs;
331
+ var path$1 = path;
332
+ var os$1 = os;
333
+ var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : commonjsRequire;
334
+ var vars = process.config && process.config.variables || {};
335
+ var prebuildsOnly = !!process.env.PREBUILDS_ONLY;
336
+ var abi = process.versions.modules;
337
+ var runtime = isElectron() ? "electron" : isNwjs() ? "node-webkit" : "node";
338
+ var arch = process.env.npm_config_arch || os$1.arch();
339
+ var platform = process.env.npm_config_platform || os$1.platform();
340
+ var libc = process.env.LIBC || (isAlpine(platform) ? "musl" : "glibc");
341
+ var armv = process.env.ARM_VERSION || (arch === "arm64" ? "8" : vars.arm_version) || "";
342
+ var uv = (process.versions.uv || "").split(".")[0];
343
+ nodeGypBuild = load;
344
+ function load(dir) {
345
+ return runtimeRequire(load.resolve(dir));
346
+ }
347
+ load.resolve = load.path = function(dir) {
348
+ dir = path$1.resolve(dir || ".");
349
+ try {
350
+ var name = runtimeRequire(path$1.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
351
+ if (process.env[name + "_PREBUILD"]) dir = process.env[name + "_PREBUILD"];
352
+ } catch (err) {
353
+ }
354
+ if (!prebuildsOnly) {
355
+ var release = getFirst(path$1.join(dir, "build/Release"), matchBuild);
356
+ if (release) return release;
357
+ var debug = getFirst(path$1.join(dir, "build/Debug"), matchBuild);
358
+ if (debug) return debug;
359
+ }
360
+ var prebuild = resolve(dir);
361
+ if (prebuild) return prebuild;
362
+ var nearby = resolve(path$1.dirname(process.execPath));
363
+ if (nearby) return nearby;
364
+ var target = [
365
+ "platform=" + platform,
366
+ "arch=" + arch,
367
+ "runtime=" + runtime,
368
+ "abi=" + abi,
369
+ "uv=" + uv,
370
+ armv ? "armv=" + armv : "",
371
+ "libc=" + libc,
372
+ "node=" + process.versions.node,
373
+ process.versions.electron ? "electron=" + process.versions.electron : "",
374
+ typeof __webpack_require__ === "function" ? "webpack=true" : ""
375
+ // eslint-disable-line
376
+ ].filter(Boolean).join(" ");
377
+ throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
378
+ function resolve(dir2) {
379
+ var tuples = readdirSync(path$1.join(dir2, "prebuilds")).map(parseTuple);
380
+ var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0];
381
+ if (!tuple) return;
382
+ var prebuilds = path$1.join(dir2, "prebuilds", tuple.name);
383
+ var parsed = readdirSync(prebuilds).map(parseTags);
384
+ var candidates = parsed.filter(matchTags(runtime, abi));
385
+ var winner = candidates.sort(compareTags(runtime))[0];
386
+ if (winner) return path$1.join(prebuilds, winner.file);
387
+ }
388
+ };
389
+ function readdirSync(dir) {
390
+ try {
391
+ return fs$1.readdirSync(dir);
392
+ } catch (err) {
393
+ return [];
394
+ }
395
+ }
396
+ function getFirst(dir, filter) {
397
+ var files = readdirSync(dir).filter(filter);
398
+ return files[0] && path$1.join(dir, files[0]);
399
+ }
400
+ function matchBuild(name) {
401
+ return /\.node$/.test(name);
402
+ }
403
+ function parseTuple(name) {
404
+ var arr = name.split("-");
405
+ if (arr.length !== 2) return;
406
+ var platform2 = arr[0];
407
+ var architectures = arr[1].split("+");
408
+ if (!platform2) return;
409
+ if (!architectures.length) return;
410
+ if (!architectures.every(Boolean)) return;
411
+ return { name, platform: platform2, architectures };
412
+ }
413
+ function matchTuple(platform2, arch2) {
414
+ return function(tuple) {
415
+ if (tuple == null) return false;
416
+ if (tuple.platform !== platform2) return false;
417
+ return tuple.architectures.includes(arch2);
418
+ };
419
+ }
420
+ function compareTuples(a, b) {
421
+ return a.architectures.length - b.architectures.length;
422
+ }
423
+ function parseTags(file) {
424
+ var arr = file.split(".");
425
+ var extension2 = arr.pop();
426
+ var tags = { file, specificity: 0 };
427
+ if (extension2 !== "node") return;
428
+ for (var i = 0; i < arr.length; i++) {
429
+ var tag = arr[i];
430
+ if (tag === "node" || tag === "electron" || tag === "node-webkit") {
431
+ tags.runtime = tag;
432
+ } else if (tag === "napi") {
433
+ tags.napi = true;
434
+ } else if (tag.slice(0, 3) === "abi") {
435
+ tags.abi = tag.slice(3);
436
+ } else if (tag.slice(0, 2) === "uv") {
437
+ tags.uv = tag.slice(2);
438
+ } else if (tag.slice(0, 4) === "armv") {
439
+ tags.armv = tag.slice(4);
440
+ } else if (tag === "glibc" || tag === "musl") {
441
+ tags.libc = tag;
442
+ } else {
443
+ continue;
444
+ }
445
+ tags.specificity++;
446
+ }
447
+ return tags;
448
+ }
449
+ function matchTags(runtime2, abi2) {
450
+ return function(tags) {
451
+ if (tags == null) return false;
452
+ if (tags.runtime && tags.runtime !== runtime2 && !runtimeAgnostic(tags)) return false;
453
+ if (tags.abi && tags.abi !== abi2 && !tags.napi) return false;
454
+ if (tags.uv && tags.uv !== uv) return false;
455
+ if (tags.armv && tags.armv !== armv) return false;
456
+ if (tags.libc && tags.libc !== libc) return false;
457
+ return true;
458
+ };
459
+ }
460
+ function runtimeAgnostic(tags) {
461
+ return tags.runtime === "node" && tags.napi;
462
+ }
463
+ function compareTags(runtime2) {
464
+ return function(a, b) {
465
+ if (a.runtime !== b.runtime) {
466
+ return a.runtime === runtime2 ? -1 : 1;
467
+ } else if (a.abi !== b.abi) {
468
+ return a.abi ? -1 : 1;
469
+ } else if (a.specificity !== b.specificity) {
470
+ return a.specificity > b.specificity ? -1 : 1;
471
+ } else {
472
+ return 0;
473
+ }
474
+ };
475
+ }
476
+ function isNwjs() {
477
+ return !!(process.versions && process.versions.nw);
478
+ }
479
+ function isElectron() {
480
+ if (process.versions && process.versions.electron) return true;
481
+ if (process.env.ELECTRON_RUN_AS_NODE) return true;
482
+ return typeof window !== "undefined" && window.process && window.process.type === "renderer";
483
+ }
484
+ function isAlpine(platform2) {
485
+ return platform2 === "linux" && fs$1.existsSync("/etc/alpine-release");
486
+ }
487
+ load.parseTags = parseTags;
488
+ load.matchTags = matchTags;
489
+ load.compareTags = compareTags;
490
+ load.parseTuple = parseTuple;
491
+ load.matchTuple = matchTuple;
492
+ load.compareTuples = compareTuples;
493
+ return nodeGypBuild;
494
+ }
495
+ var hasRequiredNodeGypBuild;
496
+ function requireNodeGypBuild() {
497
+ if (hasRequiredNodeGypBuild) return nodeGypBuild$1.exports;
498
+ hasRequiredNodeGypBuild = 1;
499
+ const runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : commonjsRequire;
500
+ if (typeof runtimeRequire.addon === "function") {
501
+ nodeGypBuild$1.exports = runtimeRequire.addon.bind(runtimeRequire);
502
+ } else {
503
+ nodeGypBuild$1.exports = requireNodeGypBuild$1();
504
+ }
505
+ return nodeGypBuild$1.exports;
506
+ }
507
+ var fallback$1;
508
+ var hasRequiredFallback$1;
509
+ function requireFallback$1() {
510
+ if (hasRequiredFallback$1) return fallback$1;
511
+ hasRequiredFallback$1 = 1;
512
+ const mask = (source, mask2, output, offset, length) => {
513
+ for (var i = 0; i < length; i++) {
514
+ output[offset + i] = source[i] ^ mask2[i & 3];
515
+ }
516
+ };
517
+ const unmask = (buffer, mask2) => {
518
+ const length = buffer.length;
519
+ for (var i = 0; i < length; i++) {
520
+ buffer[i] ^= mask2[i & 3];
521
+ }
522
+ };
523
+ fallback$1 = { mask, unmask };
524
+ return fallback$1;
525
+ }
526
+ var hasRequiredBufferutil;
527
+ function requireBufferutil() {
528
+ if (hasRequiredBufferutil) return bufferutil.exports;
529
+ hasRequiredBufferutil = 1;
530
+ try {
531
+ bufferutil.exports = requireNodeGypBuild()(__dirname);
532
+ } catch (e) {
533
+ bufferutil.exports = requireFallback$1();
534
+ }
535
+ return bufferutil.exports;
536
+ }
350
537
  var hasRequiredBufferUtil;
351
538
  function requireBufferUtil() {
352
539
  if (hasRequiredBufferUtil) return bufferUtil.exports;
@@ -407,7 +594,7 @@ function requireBufferUtil() {
407
594
  };
408
595
  if (!process.env.WS_NO_BUFFER_UTIL) {
409
596
  try {
410
- const bufferUtil$1 = require$$1;
597
+ const bufferUtil$1 = requireBufferutil();
411
598
  bufferUtil.exports.mask = function(source, mask, output, offset, length) {
412
599
  if (length < 48) _mask(source, mask, output, offset, length);
413
600
  else bufferUtil$1.mask(source, mask, output, offset, length);
@@ -855,12 +1042,55 @@ function requirePermessageDeflate() {
855
1042
  return permessageDeflate;
856
1043
  }
857
1044
  var validation = { exports: {} };
858
- const __viteOptionalPeerDep_utf8Validate_ws = {};
859
- const __viteOptionalPeerDep_utf8Validate_ws$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
860
- __proto__: null,
861
- default: __viteOptionalPeerDep_utf8Validate_ws
862
- }, Symbol.toStringTag, { value: "Module" }));
863
- const require$$2 = /* @__PURE__ */ getAugmentedNamespace(__viteOptionalPeerDep_utf8Validate_ws$1);
1045
+ var utf8Validate = { exports: {} };
1046
+ var fallback;
1047
+ var hasRequiredFallback;
1048
+ function requireFallback() {
1049
+ if (hasRequiredFallback) return fallback;
1050
+ hasRequiredFallback = 1;
1051
+ function isValidUTF8(buf) {
1052
+ const len = buf.length;
1053
+ let i = 0;
1054
+ while (i < len) {
1055
+ if ((buf[i] & 128) === 0) {
1056
+ i++;
1057
+ } else if ((buf[i] & 224) === 192) {
1058
+ if (i + 1 === len || (buf[i + 1] & 192) !== 128 || (buf[i] & 254) === 192) {
1059
+ return false;
1060
+ }
1061
+ i += 2;
1062
+ } else if ((buf[i] & 240) === 224) {
1063
+ if (i + 2 >= len || (buf[i + 1] & 192) !== 128 || (buf[i + 2] & 192) !== 128 || buf[i] === 224 && (buf[i + 1] & 224) === 128 || // overlong
1064
+ buf[i] === 237 && (buf[i + 1] & 224) === 160) {
1065
+ return false;
1066
+ }
1067
+ i += 3;
1068
+ } else if ((buf[i] & 248) === 240) {
1069
+ if (i + 3 >= len || (buf[i + 1] & 192) !== 128 || (buf[i + 2] & 192) !== 128 || (buf[i + 3] & 192) !== 128 || buf[i] === 240 && (buf[i + 1] & 240) === 128 || // overlong
1070
+ buf[i] === 244 && buf[i + 1] > 143 || buf[i] > 244) {
1071
+ return false;
1072
+ }
1073
+ i += 4;
1074
+ } else {
1075
+ return false;
1076
+ }
1077
+ }
1078
+ return true;
1079
+ }
1080
+ fallback = isValidUTF8;
1081
+ return fallback;
1082
+ }
1083
+ var hasRequiredUtf8Validate;
1084
+ function requireUtf8Validate() {
1085
+ if (hasRequiredUtf8Validate) return utf8Validate.exports;
1086
+ hasRequiredUtf8Validate = 1;
1087
+ try {
1088
+ utf8Validate.exports = requireNodeGypBuild()(__dirname);
1089
+ } catch (e) {
1090
+ utf8Validate.exports = requireFallback();
1091
+ }
1092
+ return utf8Validate.exports;
1093
+ }
864
1094
  var hasRequiredValidation;
865
1095
  function requireValidation() {
866
1096
  if (hasRequiredValidation) return validation.exports;
@@ -1052,7 +1282,7 @@ function requireValidation() {
1052
1282
  };
1053
1283
  } else if (!process.env.WS_NO_UTF_8_VALIDATE) {
1054
1284
  try {
1055
- const isValidUTF8 = require$$2;
1285
+ const isValidUTF8 = requireUtf8Validate();
1056
1286
  validation.exports.isValidUTF8 = function(buf) {
1057
1287
  return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
1058
1288
  };
@@ -1659,7 +1889,7 @@ function requireSender() {
1659
1889
  if (hasRequiredSender) return sender;
1660
1890
  hasRequiredSender = 1;
1661
1891
  const { Duplex } = require$$0$2;
1662
- const { randomFillSync } = require$$1$1;
1892
+ const { randomFillSync } = require$$1;
1663
1893
  const PerMessageDeflate = requirePermessageDeflate();
1664
1894
  const { EMPTY_BUFFER, kWebSocket, NOOP } = requireConstants();
1665
1895
  const { isBlob, isValidStatusCode } = requireValidation();
@@ -2529,11 +2759,11 @@ function requireWebsocket() {
2529
2759
  if (hasRequiredWebsocket) return websocket;
2530
2760
  hasRequiredWebsocket = 1;
2531
2761
  const EventEmitter = require$$0$3;
2532
- const https = require$$1$2;
2533
- const http = require$$2$1;
2762
+ const https = require$$1$1;
2763
+ const http = require$$2;
2534
2764
  const net = require$$3;
2535
2765
  const tls = require$$4;
2536
- const { randomBytes, createHash } = require$$1$1;
2766
+ const { randomBytes, createHash } = require$$1;
2537
2767
  const { Duplex, Readable } = require$$0$2;
2538
2768
  const { URL } = require$$7;
2539
2769
  const PerMessageDeflate = requirePermessageDeflate();
@@ -3566,9 +3796,9 @@ function requireWebsocketServer() {
3566
3796
  if (hasRequiredWebsocketServer) return websocketServer;
3567
3797
  hasRequiredWebsocketServer = 1;
3568
3798
  const EventEmitter = require$$0$3;
3569
- const http = require$$2$1;
3799
+ const http = require$$2;
3570
3800
  const { Duplex } = require$$0$2;
3571
- const { createHash } = require$$1$1;
3801
+ const { createHash } = require$$1;
3572
3802
  const extension2 = requireExtension();
3573
3803
  const PerMessageDeflate = requirePermessageDeflate();
3574
3804
  const subprotocol2 = requireSubprotocol();
@@ -3996,7 +4226,7 @@ class WorkerWsClient {
3996
4226
  }
3997
4227
  generateFingerprint() {
3998
4228
  const data = `${os.hostname()}:${os.userInfo().username}:${os.platform()}:${os.arch()}`;
3999
- return require$$1$1.createHash("sha256").update(data).digest("hex").slice(0, 32);
4229
+ return require$$1.createHash("sha256").update(data).digest("hex").slice(0, 32);
4000
4230
  }
4001
4231
  setStatus(status) {
4002
4232
  if (this._status !== status) {
@@ -1,6 +1,6 @@
1
- import { c as createWebWorker, l as languages } from "./index-CpDga7fF.js";
2
- import { C as CompletionAdapter, H as HoverAdapter, D as DocumentHighlightAdapter, a as DefinitionAdapter, R as ReferenceAdapter, b as DocumentSymbolAdapter, c as RenameAdapter, d as DocumentColorAdapter, F as FoldingRangeAdapter, e as DiagnosticsAdapter, S as SelectionRangeAdapter, f as DocumentFormattingEditProvider, g as DocumentRangeFormattingEditProvider } from "./lspLanguageFeatures-BMM3SRX4.js";
3
- import { h, i, j, t, k } from "./lspLanguageFeatures-BMM3SRX4.js";
1
+ import { c as createWebWorker, l as languages } from "./index-D568SpEt.js";
2
+ import { C as CompletionAdapter, H as HoverAdapter, D as DocumentHighlightAdapter, a as DefinitionAdapter, R as ReferenceAdapter, b as DocumentSymbolAdapter, c as RenameAdapter, d as DocumentColorAdapter, F as FoldingRangeAdapter, e as DiagnosticsAdapter, S as SelectionRangeAdapter, f as DocumentFormattingEditProvider, g as DocumentRangeFormattingEditProvider } from "./lspLanguageFeatures-Bjf28WU6.js";
3
+ import { h, i, j, t, k } from "./lspLanguageFeatures-Bjf28WU6.js";
4
4
  const STOP_WHEN_IDLE_FOR = 2 * 60 * 1e3;
5
5
  class WorkerManager {
6
6
  constructor(defaults) {
@@ -1,4 +1,4 @@
1
- import { l as languages } from "./index-CpDga7fF.js";
1
+ import { l as languages } from "./index-D568SpEt.js";
2
2
  const EMPTY_ELEMENTS = [
3
3
  "assign",
4
4
  "flush",
@@ -1,4 +1,4 @@
1
- import { l as languages } from "./index-CpDga7fF.js";
1
+ import { l as languages } from "./index-D568SpEt.js";
2
2
  const EMPTY_ELEMENTS = [
3
3
  "area",
4
4
  "base",
@@ -1,4 +1,4 @@
1
- import { l as languages } from "./index-CpDga7fF.js";
1
+ import { l as languages } from "./index-D568SpEt.js";
2
2
  const EMPTY_ELEMENTS = [
3
3
  "area",
4
4
  "base",
@@ -1,6 +1,6 @@
1
- import { c as createWebWorker, l as languages } from "./index-CpDga7fF.js";
2
- import { H as HoverAdapter, D as DocumentHighlightAdapter, h as DocumentLinkAdapter, F as FoldingRangeAdapter, b as DocumentSymbolAdapter, S as SelectionRangeAdapter, c as RenameAdapter, f as DocumentFormattingEditProvider, g as DocumentRangeFormattingEditProvider, C as CompletionAdapter } from "./lspLanguageFeatures-BMM3SRX4.js";
3
- import { a, e, d, R, i, j, t, k } from "./lspLanguageFeatures-BMM3SRX4.js";
1
+ import { c as createWebWorker, l as languages } from "./index-D568SpEt.js";
2
+ import { H as HoverAdapter, D as DocumentHighlightAdapter, h as DocumentLinkAdapter, F as FoldingRangeAdapter, b as DocumentSymbolAdapter, S as SelectionRangeAdapter, c as RenameAdapter, f as DocumentFormattingEditProvider, g as DocumentRangeFormattingEditProvider, C as CompletionAdapter } from "./lspLanguageFeatures-Bjf28WU6.js";
3
+ import { a, e, d, R, i, j, t, k } from "./lspLanguageFeatures-Bjf28WU6.js";
4
4
  const STOP_WHEN_IDLE_FOR = 2 * 60 * 1e3;
5
5
  class WorkerManager {
6
6
  constructor(defaults) {
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./cssMode-woG3Vtms.js","./lspLanguageFeatures-BMM3SRX4.js","./htmlMode-DzdyF21q.js","./jsonMode-CPhJ_ION.js","./javascript-Dy9cX9Fu.js","./typescript-Cq3g-z7h.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./cssMode-Cxe23-tB.js","./lspLanguageFeatures-Bjf28WU6.js","./htmlMode-D_V-1VlE.js","./jsonMode-K3WSinSE.js","./javascript-D_LoeNc7.js","./typescript-CDjkh0d5.js"])))=>i.map(i=>d[i]);
2
2
  function getDefaultExportFromCjs(x) {
3
3
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
4
4
  }
@@ -18721,69 +18721,82 @@ function requireAddonWebLinks() {
18721
18721
  return addonWebLinks.exports;
18722
18722
  }
18723
18723
  var addonWebLinksExports = requireAddonWebLinks();
18724
+ let _terminal = null;
18725
+ let _fitAddon = null;
18726
+ let _currentAgentId = null;
18727
+ function getOrCreateTerminal(onExit) {
18728
+ if (_terminal && _fitAddon) {
18729
+ return { terminal: _terminal, fitAddon: _fitAddon };
18730
+ }
18731
+ const terminal = new xtermExports.Terminal({
18732
+ cursorBlink: true,
18733
+ fontSize: 14,
18734
+ fontFamily: "'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', monospace",
18735
+ theme: {
18736
+ background: "#1a1b26",
18737
+ foreground: "#a9b1d6",
18738
+ cursor: "#c0caf5",
18739
+ selectionBackground: "#33467C",
18740
+ black: "#15161e",
18741
+ red: "#f7768e",
18742
+ green: "#9ece6a",
18743
+ yellow: "#e0af68",
18744
+ blue: "#7aa2f7",
18745
+ magenta: "#bb9af7",
18746
+ cyan: "#7dcfff",
18747
+ white: "#a9b1d6",
18748
+ brightBlack: "#414868",
18749
+ brightRed: "#f7768e",
18750
+ brightGreen: "#9ece6a",
18751
+ brightYellow: "#e0af68",
18752
+ brightBlue: "#7aa2f7",
18753
+ brightMagenta: "#bb9af7",
18754
+ brightCyan: "#7dcfff",
18755
+ brightWhite: "#c0caf5"
18756
+ },
18757
+ scrollback: 1e4,
18758
+ scrollOnUserInput: true,
18759
+ allowTransparency: false
18760
+ });
18761
+ const fitAddon = new addonFitExports.FitAddon();
18762
+ terminal.loadAddon(fitAddon);
18763
+ terminal.loadAddon(new addonWebLinksExports.WebLinksAddon());
18764
+ terminal.onData((data) => {
18765
+ window.worker.writePty(data);
18766
+ });
18767
+ window.worker.onPtyData((data) => {
18768
+ terminal.write(data);
18769
+ });
18770
+ window.worker.onPtyExit((code) => {
18771
+ terminal.writeln(`\r
18772
+ \x1B[33m[Process exited with code ${code}]\x1B[0m`);
18773
+ onExit();
18774
+ });
18775
+ _terminal = terminal;
18776
+ _fitAddon = fitAddon;
18777
+ return { terminal, fitAddon };
18778
+ }
18724
18779
  function TerminalPanel({ agent, onSpawn, onExit }) {
18725
18780
  const containerRef = reactExports.useRef(null);
18726
- const terminalRef = reactExports.useRef(null);
18727
- const fitAddonRef = reactExports.useRef(null);
18728
- const currentAgentRef = reactExports.useRef(null);
18729
18781
  reactExports.useEffect(() => {
18730
- if (!containerRef.current || terminalRef.current) return;
18731
- const terminal = new xtermExports.Terminal({
18732
- cursorBlink: true,
18733
- fontSize: 14,
18734
- fontFamily: "'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', monospace",
18735
- theme: {
18736
- background: "#1a1b26",
18737
- foreground: "#a9b1d6",
18738
- cursor: "#c0caf5",
18739
- selectionBackground: "#33467C",
18740
- black: "#15161e",
18741
- red: "#f7768e",
18742
- green: "#9ece6a",
18743
- yellow: "#e0af68",
18744
- blue: "#7aa2f7",
18745
- magenta: "#bb9af7",
18746
- cyan: "#7dcfff",
18747
- white: "#a9b1d6",
18748
- brightBlack: "#414868",
18749
- brightRed: "#f7768e",
18750
- brightGreen: "#9ece6a",
18751
- brightYellow: "#e0af68",
18752
- brightBlue: "#7aa2f7",
18753
- brightMagenta: "#bb9af7",
18754
- brightCyan: "#7dcfff",
18755
- brightWhite: "#c0caf5"
18756
- },
18757
- scrollback: 1e4,
18758
- scrollOnUserInput: true,
18759
- allowTransparency: false
18760
- });
18761
- const fitAddon = new addonFitExports.FitAddon();
18762
- terminal.loadAddon(fitAddon);
18763
- terminal.loadAddon(new addonWebLinksExports.WebLinksAddon());
18764
- terminal.open(containerRef.current);
18782
+ if (!containerRef.current) return;
18783
+ const { terminal, fitAddon } = getOrCreateTerminal(onExit);
18784
+ const existingParent = terminal.element?.parentElement;
18785
+ if (existingParent && existingParent !== containerRef.current) {
18786
+ containerRef.current.appendChild(terminal.element);
18787
+ } else if (!terminal.element) {
18788
+ terminal.open(containerRef.current);
18789
+ }
18765
18790
  fitAddon.fit();
18766
- terminalRef.current = terminal;
18767
- fitAddonRef.current = fitAddon;
18768
- terminal.onData((data) => {
18769
- window.worker.writePty(data);
18770
- });
18771
- const unsubData = window.worker.onPtyData((data) => {
18772
- terminal.write(data);
18773
- });
18774
- const unsubExit = window.worker.onPtyExit((code) => {
18775
- terminal.writeln(`\r
18776
- \x1B[33m[Process exited with code ${code}]\x1B[0m`);
18777
- onExit();
18778
- });
18791
+ terminal.scrollToBottom();
18779
18792
  let resizeTimeout;
18780
18793
  const handleResize = () => {
18781
18794
  clearTimeout(resizeTimeout);
18782
18795
  resizeTimeout = setTimeout(() => {
18783
- if (fitAddonRef.current && terminalRef.current) {
18784
- fitAddonRef.current.fit();
18785
- terminalRef.current.scrollToBottom();
18786
- const { cols, rows } = terminalRef.current;
18796
+ if (_fitAddon && _terminal) {
18797
+ _fitAddon.fit();
18798
+ _terminal.scrollToBottom();
18799
+ const { cols, rows } = _terminal;
18787
18800
  window.worker.resizePty(cols, rows);
18788
18801
  }
18789
18802
  }, 150);
@@ -18795,26 +18808,21 @@ function TerminalPanel({ agent, onSpawn, onExit }) {
18795
18808
  clearTimeout(resizeTimeout);
18796
18809
  window.removeEventListener("resize", handleResize);
18797
18810
  observer.disconnect();
18798
- unsubData();
18799
- unsubExit();
18800
- terminal.dispose();
18801
- terminalRef.current = null;
18802
- fitAddonRef.current = null;
18803
18811
  };
18804
- }, []);
18812
+ }, [onExit]);
18805
18813
  reactExports.useEffect(() => {
18806
- if (!agent || !terminalRef.current) return;
18807
- if (currentAgentRef.current === agent.id) return;
18808
- currentAgentRef.current = agent.id;
18809
- terminalRef.current.clear();
18814
+ if (!agent || !_terminal) return;
18815
+ if (_currentAgentId === agent.id) return;
18816
+ _currentAgentId = agent.id;
18817
+ _terminal.clear();
18810
18818
  onSpawn(agent).then(() => {
18811
- if (fitAddonRef.current && terminalRef.current) {
18812
- fitAddonRef.current.fit();
18813
- terminalRef.current.scrollToBottom();
18814
- const { cols, rows } = terminalRef.current;
18819
+ if (_fitAddon && _terminal) {
18820
+ _fitAddon.fit();
18821
+ _terminal.scrollToBottom();
18822
+ const { cols, rows } = _terminal;
18815
18823
  window.worker.resizePty(cols, rows);
18816
18824
  }
18817
- terminalRef.current?.focus();
18825
+ _terminal?.focus();
18818
18826
  });
18819
18827
  }, [agent, onSpawn]);
18820
18828
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "terminal-container", ref: containerRef });
@@ -206492,7 +206500,7 @@ const lessDefaults = new LanguageServiceDefaultsImpl$3(
206492
206500
  modeConfigurationDefault$2
206493
206501
  );
206494
206502
  function getMode$3() {
206495
- return __vitePreload(() => import("./cssMode-woG3Vtms.js"), true ? __vite__mapDeps([0,1]) : void 0, import.meta.url);
206503
+ return __vitePreload(() => import("./cssMode-Cxe23-tB.js"), true ? __vite__mapDeps([0,1]) : void 0, import.meta.url);
206496
206504
  }
206497
206505
  languages.onLanguage("less", () => {
206498
206506
  getMode$3().then((mode2) => mode2.setupMode(lessDefaults));
@@ -206597,7 +206605,7 @@ const razorLanguageService = registerHTMLLanguageService(
206597
206605
  );
206598
206606
  const razorDefaults = razorLanguageService.defaults;
206599
206607
  function getMode$2() {
206600
- return __vitePreload(() => import("./htmlMode-DzdyF21q.js"), true ? __vite__mapDeps([2,1]) : void 0, import.meta.url);
206608
+ return __vitePreload(() => import("./htmlMode-D_V-1VlE.js"), true ? __vite__mapDeps([2,1]) : void 0, import.meta.url);
206601
206609
  }
206602
206610
  function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
206603
206611
  const defaults = new LanguageServiceDefaultsImpl$2(languageId, options, modeConfiguration);
@@ -206681,7 +206689,7 @@ const jsonDefaults = new LanguageServiceDefaultsImpl$1(
206681
206689
  );
206682
206690
  const getWorker$1 = () => getMode$1().then((mode2) => mode2.getWorker());
206683
206691
  function getMode$1() {
206684
- return __vitePreload(() => import("./jsonMode-CPhJ_ION.js"), true ? __vite__mapDeps([3,1]) : void 0, import.meta.url);
206692
+ return __vitePreload(() => import("./jsonMode-K3WSinSE.js"), true ? __vite__mapDeps([3,1]) : void 0, import.meta.url);
206685
206693
  }
206686
206694
  languages.register({
206687
206695
  id: "json",
@@ -206927,7 +206935,7 @@ const getJavaScriptWorker = () => {
206927
206935
  return getMode().then((mode) => mode.getJavaScriptWorker());
206928
206936
  };
206929
206937
  function getMode() {
206930
- return __vitePreload(() => import("./tsMode-D7kqIJ_o.js"), true ? [] : void 0, import.meta.url);
206938
+ return __vitePreload(() => import("./tsMode-DYu1z_nn.js"), true ? [] : void 0, import.meta.url);
206931
206939
  }
206932
206940
  languages.onLanguage("typescript", () => {
206933
206941
  return getMode().then((mode) => mode.setupTypeScript(typescriptDefaults));
@@ -207122,49 +207130,49 @@ registerLanguage({
207122
207130
  extensions: [".ftl", ".ftlh", ".ftlx"],
207123
207131
  aliases: ["FreeMarker2", "Apache FreeMarker2"],
207124
207132
  loader: () => {
207125
- return __vitePreload(() => import("./freemarker2-DgtqmvCd.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAutoInterpolationDollar);
207133
+ return __vitePreload(() => import("./freemarker2-Be0nj7Oa.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAutoInterpolationDollar);
207126
207134
  }
207127
207135
  });
207128
207136
  registerLanguage({
207129
207137
  id: "freemarker2.tag-angle.interpolation-dollar",
207130
207138
  aliases: ["FreeMarker2 (Angle/Dollar)", "Apache FreeMarker2 (Angle/Dollar)"],
207131
207139
  loader: () => {
207132
- return __vitePreload(() => import("./freemarker2-DgtqmvCd.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAngleInterpolationDollar);
207140
+ return __vitePreload(() => import("./freemarker2-Be0nj7Oa.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAngleInterpolationDollar);
207133
207141
  }
207134
207142
  });
207135
207143
  registerLanguage({
207136
207144
  id: "freemarker2.tag-bracket.interpolation-dollar",
207137
207145
  aliases: ["FreeMarker2 (Bracket/Dollar)", "Apache FreeMarker2 (Bracket/Dollar)"],
207138
207146
  loader: () => {
207139
- return __vitePreload(() => import("./freemarker2-DgtqmvCd.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagBracketInterpolationDollar);
207147
+ return __vitePreload(() => import("./freemarker2-Be0nj7Oa.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagBracketInterpolationDollar);
207140
207148
  }
207141
207149
  });
207142
207150
  registerLanguage({
207143
207151
  id: "freemarker2.tag-angle.interpolation-bracket",
207144
207152
  aliases: ["FreeMarker2 (Angle/Bracket)", "Apache FreeMarker2 (Angle/Bracket)"],
207145
207153
  loader: () => {
207146
- return __vitePreload(() => import("./freemarker2-DgtqmvCd.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAngleInterpolationBracket);
207154
+ return __vitePreload(() => import("./freemarker2-Be0nj7Oa.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAngleInterpolationBracket);
207147
207155
  }
207148
207156
  });
207149
207157
  registerLanguage({
207150
207158
  id: "freemarker2.tag-bracket.interpolation-bracket",
207151
207159
  aliases: ["FreeMarker2 (Bracket/Bracket)", "Apache FreeMarker2 (Bracket/Bracket)"],
207152
207160
  loader: () => {
207153
- return __vitePreload(() => import("./freemarker2-DgtqmvCd.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagBracketInterpolationBracket);
207161
+ return __vitePreload(() => import("./freemarker2-Be0nj7Oa.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagBracketInterpolationBracket);
207154
207162
  }
207155
207163
  });
207156
207164
  registerLanguage({
207157
207165
  id: "freemarker2.tag-auto.interpolation-dollar",
207158
207166
  aliases: ["FreeMarker2 (Auto/Dollar)", "Apache FreeMarker2 (Auto/Dollar)"],
207159
207167
  loader: () => {
207160
- return __vitePreload(() => import("./freemarker2-DgtqmvCd.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAutoInterpolationDollar);
207168
+ return __vitePreload(() => import("./freemarker2-Be0nj7Oa.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAutoInterpolationDollar);
207161
207169
  }
207162
207170
  });
207163
207171
  registerLanguage({
207164
207172
  id: "freemarker2.tag-auto.interpolation-bracket",
207165
207173
  aliases: ["FreeMarker2 (Auto/Bracket)", "Apache FreeMarker2 (Auto/Bracket)"],
207166
207174
  loader: () => {
207167
- return __vitePreload(() => import("./freemarker2-DgtqmvCd.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAutoInterpolationBracket);
207175
+ return __vitePreload(() => import("./freemarker2-Be0nj7Oa.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAutoInterpolationBracket);
207168
207176
  }
207169
207177
  });
207170
207178
  registerLanguage({
@@ -207185,7 +207193,7 @@ registerLanguage({
207185
207193
  extensions: [".handlebars", ".hbs"],
207186
207194
  aliases: ["Handlebars", "handlebars", "hbs"],
207187
207195
  mimetypes: ["text/x-handlebars-template"],
207188
- loader: () => __vitePreload(() => import("./handlebars-YEqC-zOn.js"), true ? [] : void 0, import.meta.url)
207196
+ loader: () => __vitePreload(() => import("./handlebars-C0It7_Nu.js"), true ? [] : void 0, import.meta.url)
207189
207197
  });
207190
207198
  registerLanguage({
207191
207199
  id: "hcl",
@@ -207198,7 +207206,7 @@ registerLanguage({
207198
207206
  extensions: [".html", ".htm", ".shtml", ".xhtml", ".mdoc", ".jsp", ".asp", ".aspx", ".jshtm"],
207199
207207
  aliases: ["HTML", "htm", "html", "xhtml"],
207200
207208
  mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
207201
- loader: () => __vitePreload(() => import("./html-CwvkGxeB.js"), true ? [] : void 0, import.meta.url)
207209
+ loader: () => __vitePreload(() => import("./html-BW6LB-7J.js"), true ? [] : void 0, import.meta.url)
207202
207210
  });
207203
207211
  registerLanguage({
207204
207212
  id: "ini",
@@ -207221,7 +207229,7 @@ registerLanguage({
207221
207229
  filenames: ["jakefile"],
207222
207230
  aliases: ["JavaScript", "javascript", "js"],
207223
207231
  mimetypes: ["text/javascript"],
207224
- loader: () => __vitePreload(() => import("./javascript-Dy9cX9Fu.js"), true ? __vite__mapDeps([4,5]) : void 0, import.meta.url)
207232
+ loader: () => __vitePreload(() => import("./javascript-D_LoeNc7.js"), true ? __vite__mapDeps([4,5]) : void 0, import.meta.url)
207225
207233
  });
207226
207234
  registerLanguage({
207227
207235
  id: "julia",
@@ -207260,7 +207268,7 @@ registerLanguage({
207260
207268
  extensions: [".liquid", ".html.liquid"],
207261
207269
  aliases: ["Liquid", "liquid"],
207262
207270
  mimetypes: ["application/liquid"],
207263
- loader: () => __vitePreload(() => import("./liquid-BJdFPWrv.js"), true ? [] : void 0, import.meta.url)
207271
+ loader: () => __vitePreload(() => import("./liquid-BqfOd6m8.js"), true ? [] : void 0, import.meta.url)
207264
207272
  });
207265
207273
  registerLanguage({
207266
207274
  id: "m3",
@@ -207278,7 +207286,7 @@ registerLanguage({
207278
207286
  id: "mdx",
207279
207287
  extensions: [".mdx"],
207280
207288
  aliases: ["MDX", "mdx"],
207281
- loader: () => __vitePreload(() => import("./mdx-kg2kuPRK.js"), true ? [] : void 0, import.meta.url)
207289
+ loader: () => __vitePreload(() => import("./mdx-BoESjI38.js"), true ? [] : void 0, import.meta.url)
207282
207290
  });
207283
207291
  registerLanguage({
207284
207292
  id: "mips",
@@ -207377,7 +207385,7 @@ registerLanguage({
207377
207385
  extensions: [".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi"],
207378
207386
  aliases: ["Python", "py"],
207379
207387
  firstLine: "^#!/.*\\bpython[0-9.-]*\\b",
207380
- loader: () => __vitePreload(() => import("./python-aIrmxkmH.js"), true ? [] : void 0, import.meta.url)
207388
+ loader: () => __vitePreload(() => import("./python-DlafOOgB.js"), true ? [] : void 0, import.meta.url)
207381
207389
  });
207382
207390
  registerLanguage({
207383
207391
  id: "qsharp",
@@ -207396,7 +207404,7 @@ registerLanguage({
207396
207404
  extensions: [".cshtml"],
207397
207405
  aliases: ["Razor", "razor"],
207398
207406
  mimetypes: ["text/x-cshtml"],
207399
- loader: () => __vitePreload(() => import("./razor-DdymcPOc.js"), true ? [] : void 0, import.meta.url)
207407
+ loader: () => __vitePreload(() => import("./razor-CB6E9DBD.js"), true ? [] : void 0, import.meta.url)
207400
207408
  });
207401
207409
  registerLanguage({
207402
207410
  id: "redis",
@@ -207529,7 +207537,7 @@ registerLanguage({
207529
207537
  aliases: ["TypeScript", "ts", "typescript"],
207530
207538
  mimetypes: ["text/typescript"],
207531
207539
  loader: () => {
207532
- return __vitePreload(() => import("./typescript-Cq3g-z7h.js"), true ? [] : void 0, import.meta.url);
207540
+ return __vitePreload(() => import("./typescript-CDjkh0d5.js"), true ? [] : void 0, import.meta.url);
207533
207541
  }
207534
207542
  });
207535
207543
  registerLanguage({
@@ -207574,14 +207582,14 @@ registerLanguage({
207574
207582
  firstLine: "(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",
207575
207583
  aliases: ["XML", "xml"],
207576
207584
  mimetypes: ["text/xml", "application/xml", "application/xaml+xml", "application/xml-dtd"],
207577
- loader: () => __vitePreload(() => import("./xml-BuBP5jOc.js"), true ? [] : void 0, import.meta.url)
207585
+ loader: () => __vitePreload(() => import("./xml-C-XlilKZ.js"), true ? [] : void 0, import.meta.url)
207578
207586
  });
207579
207587
  registerLanguage({
207580
207588
  id: "yaml",
207581
207589
  extensions: [".yaml", ".yml"],
207582
207590
  aliases: ["YAML", "yaml", "YML", "yml"],
207583
207591
  mimetypes: ["application/x-yaml", "text/x-yaml"],
207584
- loader: () => __vitePreload(() => import("./yaml-B-3hWmol.js"), true ? [] : void 0, import.meta.url)
207592
+ loader: () => __vitePreload(() => import("./yaml-BTrtxLEo.js"), true ? [] : void 0, import.meta.url)
207585
207593
  });
207586
207594
  var __defProp = Object.defineProperty;
207587
207595
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -211782,25 +211790,15 @@ function App() {
211782
211790
  ))
211783
211791
  ] })
211784
211792
  ] }),
211785
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "main-content", children: [
211786
- visiblePaneIds.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "multi-split-empty", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "All panes hidden. Use the titlebar buttons to show a pane." }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
211787
- PaneLayout,
211788
- {
211789
- layout: layout2,
211790
- panes: panes.filter((p) => visiblePaneIds.includes(p.id)),
211791
- onLayoutChange: setLayout,
211792
- onToggle: togglePane
211793
- }
211794
- ),
211795
- panes.filter((p) => !visiblePaneIds.includes(p.id)).map((p) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: {
211796
- position: "absolute",
211797
- width: "1px",
211798
- height: "1px",
211799
- overflow: "hidden",
211800
- opacity: 0,
211801
- pointerEvents: "none"
211802
- }, children: p.content }, p.id))
211803
- ] }),
211793
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "main-content", children: visiblePaneIds.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "multi-split-empty", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "All panes hidden. Use the titlebar buttons to show a pane." }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
211794
+ PaneLayout,
211795
+ {
211796
+ layout: layout2,
211797
+ panes: panes.filter((p) => visiblePaneIds.includes(p.id)),
211798
+ onLayoutChange: setLayout,
211799
+ onToggle: togglePane
211800
+ }
211801
+ ) }),
211804
211802
  /* @__PURE__ */ jsxRuntimeExports.jsx(StatusBar, { wsStatus, cwd: cwd2, onChangeCwd: handleChangeCwd }),
211805
211803
  /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsDialog, { open: showSettings, onClose: () => setShowSettings(false) }),
211806
211804
  showAgentPicker && agents.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -1,5 +1,5 @@
1
- import { conf as conf$1, language as language$1 } from "./typescript-Cq3g-z7h.js";
2
- import "./index-CpDga7fF.js";
1
+ import { conf as conf$1, language as language$1 } from "./typescript-CDjkh0d5.js";
2
+ import "./index-D568SpEt.js";
3
3
  const conf = conf$1;
4
4
  const language = {
5
5
  // Set defaultToken to invalid to see what you do not tokenize yet
@@ -1,6 +1,6 @@
1
- import { c as createWebWorker, l as languages, e as editor } from "./index-CpDga7fF.js";
2
- import { f as DocumentFormattingEditProvider, g as DocumentRangeFormattingEditProvider, C as CompletionAdapter, H as HoverAdapter, b as DocumentSymbolAdapter, d as DocumentColorAdapter, F as FoldingRangeAdapter, S as SelectionRangeAdapter, e as DiagnosticsAdapter } from "./lspLanguageFeatures-BMM3SRX4.js";
3
- import { a, D, h, R, c, i, j, t, k } from "./lspLanguageFeatures-BMM3SRX4.js";
1
+ import { c as createWebWorker, l as languages, e as editor } from "./index-D568SpEt.js";
2
+ import { f as DocumentFormattingEditProvider, g as DocumentRangeFormattingEditProvider, C as CompletionAdapter, H as HoverAdapter, b as DocumentSymbolAdapter, d as DocumentColorAdapter, F as FoldingRangeAdapter, S as SelectionRangeAdapter, e as DiagnosticsAdapter } from "./lspLanguageFeatures-Bjf28WU6.js";
3
+ import { a, D, h, R, c, i, j, t, k } from "./lspLanguageFeatures-Bjf28WU6.js";
4
4
  const STOP_WHEN_IDLE_FOR = 2 * 60 * 1e3;
5
5
  class WorkerManager {
6
6
  constructor(defaults) {
@@ -1,4 +1,4 @@
1
- import { l as languages } from "./index-CpDga7fF.js";
1
+ import { l as languages } from "./index-D568SpEt.js";
2
2
  const EMPTY_ELEMENTS = [
3
3
  "area",
4
4
  "base",
@@ -1,4 +1,4 @@
1
- import { R as Range$1, l as languages, e as editor, U as Uri, M as MarkerSeverity } from "./index-CpDga7fF.js";
1
+ import { R as Range$1, l as languages, e as editor, U as Uri, M as MarkerSeverity } from "./index-D568SpEt.js";
2
2
  var DocumentUri;
3
3
  (function(DocumentUri2) {
4
4
  function is(value) {
@@ -1,4 +1,4 @@
1
- import { l as languages } from "./index-CpDga7fF.js";
1
+ import { l as languages } from "./index-D568SpEt.js";
2
2
  const conf = {
3
3
  comments: {
4
4
  blockComment: ["{/*", "*/}"]
@@ -1,4 +1,4 @@
1
- import { l as languages } from "./index-CpDga7fF.js";
1
+ import { l as languages } from "./index-D568SpEt.js";
2
2
  const conf = {
3
3
  comments: {
4
4
  lineComment: "#",
@@ -1,4 +1,4 @@
1
- import { l as languages } from "./index-CpDga7fF.js";
1
+ import { l as languages } from "./index-D568SpEt.js";
2
2
  const EMPTY_ELEMENTS = [
3
3
  "area",
4
4
  "base",
@@ -1,4 +1,4 @@
1
- import { c as createWebWorker, e as editor, U as Uri, a as MarkerTag, M as MarkerSeverity, l as languages, t as typescriptDefaults, R as Range } from "./index-CpDga7fF.js";
1
+ import { c as createWebWorker, e as editor, U as Uri, a as MarkerTag, M as MarkerSeverity, l as languages, t as typescriptDefaults, R as Range } from "./index-D568SpEt.js";
2
2
  class WorkerManager {
3
3
  constructor(_modeId, _defaults) {
4
4
  this._modeId = _modeId;
@@ -1,4 +1,4 @@
1
- import { l as languages } from "./index-CpDga7fF.js";
1
+ import { l as languages } from "./index-D568SpEt.js";
2
2
  const conf = {
3
3
  wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
4
4
  comments: {
@@ -1,4 +1,4 @@
1
- import { l as languages } from "./index-CpDga7fF.js";
1
+ import { l as languages } from "./index-D568SpEt.js";
2
2
  const conf = {
3
3
  comments: {
4
4
  blockComment: ["<!--", "-->"]
@@ -1,4 +1,4 @@
1
- import { l as languages } from "./index-CpDga7fF.js";
1
+ import { l as languages } from "./index-D568SpEt.js";
2
2
  const conf = {
3
3
  comments: {
4
4
  lineComment: "#"
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>ctlsurf-worker</title>
7
- <script type="module" crossorigin src="./assets/index-CpDga7fF.js"></script>
7
+ <script type="module" crossorigin src="./assets/index-D568SpEt.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="./assets/index-DK9wLFFm.css">
9
9
  </head>
10
10
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phenx-inc/ctlsurf",
3
- "version": "0.1.15",
3
+ "version": "0.1.18",
4
4
  "description": "Agent-agnostic terminal and desktop app for ctlsurf — run Claude Code, Codex, or any coding agent with live session logging and remote control",
5
5
  "main": "out/main/index.js",
6
6
  "bin": {
@@ -66,5 +66,9 @@
66
66
  "react": "^19.1.0",
67
67
  "react-dom": "^19.1.0",
68
68
  "typescript": "^5.8.3"
69
+ },
70
+ "optionalDependencies": {
71
+ "bufferutil": "^4.1.0",
72
+ "utf-8-validate": "^6.0.6"
69
73
  }
70
74
  }
@@ -274,18 +274,6 @@ export default function App() {
274
274
  onToggle={togglePane}
275
275
  />
276
276
  )}
277
- {panes.filter(p => !visiblePaneIds.includes(p.id)).map(p => (
278
- <div key={p.id} style={{
279
- position: 'absolute',
280
- width: '1px',
281
- height: '1px',
282
- overflow: 'hidden',
283
- opacity: 0,
284
- pointerEvents: 'none',
285
- }}>
286
- {p.content}
287
- </div>
288
- ))}
289
277
  </div>
290
278
 
291
279
  <StatusBar wsStatus={wsStatus} cwd={cwd} onChangeCwd={handleChangeCwd} />
@@ -18,82 +18,107 @@ interface TerminalPanelProps {
18
18
  onExit: () => void
19
19
  }
20
20
 
21
+ // ─── Module-level singleton ──────────────────────────
22
+ // Survives React mount/unmount cycles so PTY connection is never lost.
23
+
24
+ let _terminal: Terminal | null = null
25
+ let _fitAddon: FitAddon | null = null
26
+ let _unsubData: (() => void) | null = null
27
+ let _unsubExit: (() => void) | null = null
28
+ let _currentAgentId: string | null = null
29
+
30
+ function getOrCreateTerminal(onExit: () => void): { terminal: Terminal; fitAddon: FitAddon } {
31
+ if (_terminal && _fitAddon) {
32
+ return { terminal: _terminal, fitAddon: _fitAddon }
33
+ }
34
+
35
+ const terminal = new Terminal({
36
+ cursorBlink: true,
37
+ fontSize: 14,
38
+ fontFamily: "'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', monospace",
39
+ theme: {
40
+ background: '#1a1b26',
41
+ foreground: '#a9b1d6',
42
+ cursor: '#c0caf5',
43
+ selectionBackground: '#33467C',
44
+ black: '#15161e',
45
+ red: '#f7768e',
46
+ green: '#9ece6a',
47
+ yellow: '#e0af68',
48
+ blue: '#7aa2f7',
49
+ magenta: '#bb9af7',
50
+ cyan: '#7dcfff',
51
+ white: '#a9b1d6',
52
+ brightBlack: '#414868',
53
+ brightRed: '#f7768e',
54
+ brightGreen: '#9ece6a',
55
+ brightYellow: '#e0af68',
56
+ brightBlue: '#7aa2f7',
57
+ brightMagenta: '#bb9af7',
58
+ brightCyan: '#7dcfff',
59
+ brightWhite: '#c0caf5'
60
+ },
61
+ scrollback: 10000,
62
+ scrollOnUserInput: true,
63
+ allowTransparency: false
64
+ })
65
+
66
+ const fitAddon = new FitAddon()
67
+ terminal.loadAddon(fitAddon)
68
+ terminal.loadAddon(new WebLinksAddon())
69
+
70
+ // Send keystrokes to pty
71
+ terminal.onData((data) => {
72
+ window.worker.writePty(data)
73
+ })
74
+
75
+ // Receive pty output — subscribed once, never unsubscribed
76
+ _unsubData = window.worker.onPtyData((data) => {
77
+ terminal.write(data)
78
+ })
79
+
80
+ // Handle pty exit
81
+ _unsubExit = window.worker.onPtyExit((code) => {
82
+ terminal.writeln(`\r\n\x1b[33m[Process exited with code ${code}]\x1b[0m`)
83
+ onExit()
84
+ })
85
+
86
+ _terminal = terminal
87
+ _fitAddon = fitAddon
88
+ return { terminal, fitAddon }
89
+ }
90
+
91
+ // ─── Component ───────────────────────────────────────
92
+
21
93
  export function TerminalPanel({ agent, onSpawn, onExit }: TerminalPanelProps) {
22
94
  const containerRef = useRef<HTMLDivElement>(null)
23
- const terminalRef = useRef<Terminal | null>(null)
24
- const fitAddonRef = useRef<FitAddon | null>(null)
25
- const currentAgentRef = useRef<string | null>(null)
26
95
 
27
- // Initialize terminal once
96
+ // Attach terminal to DOM container (or reattach on remount)
28
97
  useEffect(() => {
29
- if (!containerRef.current || terminalRef.current) return
30
-
31
- const terminal = new Terminal({
32
- cursorBlink: true,
33
- fontSize: 14,
34
- fontFamily: "'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', monospace",
35
- theme: {
36
- background: '#1a1b26',
37
- foreground: '#a9b1d6',
38
- cursor: '#c0caf5',
39
- selectionBackground: '#33467C',
40
- black: '#15161e',
41
- red: '#f7768e',
42
- green: '#9ece6a',
43
- yellow: '#e0af68',
44
- blue: '#7aa2f7',
45
- magenta: '#bb9af7',
46
- cyan: '#7dcfff',
47
- white: '#a9b1d6',
48
- brightBlack: '#414868',
49
- brightRed: '#f7768e',
50
- brightGreen: '#9ece6a',
51
- brightYellow: '#e0af68',
52
- brightBlue: '#7aa2f7',
53
- brightMagenta: '#bb9af7',
54
- brightCyan: '#7dcfff',
55
- brightWhite: '#c0caf5'
56
- },
57
- scrollback: 10000,
58
- scrollOnUserInput: true,
59
- allowTransparency: false
60
- })
61
-
62
- const fitAddon = new FitAddon()
63
- terminal.loadAddon(fitAddon)
64
- terminal.loadAddon(new WebLinksAddon())
65
-
66
- terminal.open(containerRef.current)
67
- fitAddon.fit()
98
+ if (!containerRef.current) return
68
99
 
69
- terminalRef.current = terminal
70
- fitAddonRef.current = fitAddon
100
+ const { terminal, fitAddon } = getOrCreateTerminal(onExit)
71
101
 
72
- // Send keystrokes to pty
73
- terminal.onData((data) => {
74
- window.worker.writePty(data)
75
- })
76
-
77
- // Receive pty output
78
- const unsubData = window.worker.onPtyData((data) => {
79
- terminal.write(data)
80
- })
102
+ // If terminal is already open in another container, move it
103
+ const existingParent = terminal.element?.parentElement
104
+ if (existingParent && existingParent !== containerRef.current) {
105
+ containerRef.current.appendChild(terminal.element!)
106
+ } else if (!terminal.element) {
107
+ terminal.open(containerRef.current)
108
+ }
81
109
 
82
- // Handle pty exit
83
- const unsubExit = window.worker.onPtyExit((code) => {
84
- terminal.writeln(`\r\n\x1b[33m[Process exited with code ${code}]\x1b[0m`)
85
- onExit()
86
- })
110
+ fitAddon.fit()
111
+ terminal.scrollToBottom()
87
112
 
88
- // Resize handling — scroll to bottom after fit to prevent jumping to top
113
+ // Resize handling
89
114
  let resizeTimeout: ReturnType<typeof setTimeout>
90
115
  const handleResize = () => {
91
116
  clearTimeout(resizeTimeout)
92
117
  resizeTimeout = setTimeout(() => {
93
- if (fitAddonRef.current && terminalRef.current) {
94
- fitAddonRef.current.fit()
95
- terminalRef.current.scrollToBottom()
96
- const { cols, rows } = terminalRef.current
118
+ if (_fitAddon && _terminal) {
119
+ _fitAddon.fit()
120
+ _terminal.scrollToBottom()
121
+ const { cols, rows } = _terminal
97
122
  window.worker.resizePty(cols, rows)
98
123
  }
99
124
  }, 150)
@@ -107,33 +132,26 @@ export function TerminalPanel({ agent, onSpawn, onExit }: TerminalPanelProps) {
107
132
  clearTimeout(resizeTimeout)
108
133
  window.removeEventListener('resize', handleResize)
109
134
  observer.disconnect()
110
- unsubData()
111
- unsubExit()
112
- terminal.dispose()
113
- terminalRef.current = null
114
- fitAddonRef.current = null
135
+ // Do NOT dispose terminal or unsub PTY listeners
115
136
  }
116
- }, []) // eslint-disable-line react-hooks/exhaustive-deps
137
+ }, [onExit])
117
138
 
118
139
  // Spawn agent when it changes
119
140
  useEffect(() => {
120
- if (!agent || !terminalRef.current) return
121
- if (currentAgentRef.current === agent.id) return
122
-
123
- currentAgentRef.current = agent.id
141
+ if (!agent || !_terminal) return
142
+ if (_currentAgentId === agent.id) return
124
143
 
125
- // Clear terminal for new agent
126
- terminalRef.current.clear()
144
+ _currentAgentId = agent.id
145
+ _terminal.clear()
127
146
 
128
147
  onSpawn(agent).then(() => {
129
- // Send initial resize after spawn
130
- if (fitAddonRef.current && terminalRef.current) {
131
- fitAddonRef.current.fit()
132
- terminalRef.current.scrollToBottom()
133
- const { cols, rows } = terminalRef.current
148
+ if (_fitAddon && _terminal) {
149
+ _fitAddon.fit()
150
+ _terminal.scrollToBottom()
151
+ const { cols, rows } = _terminal
134
152
  window.worker.resizePty(cols, rows)
135
153
  }
136
- terminalRef.current?.focus()
154
+ _terminal?.focus()
137
155
  })
138
156
  }, [agent, onSpawn])
139
157