@phenx-inc/ctlsurf 0.1.16 → 0.1.20

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 (27) hide show
  1. package/out/headless/index.mjs +21 -62
  2. package/out/headless/index.mjs.map +2 -2
  3. package/out/main/index.js +278 -48
  4. package/out/renderer/assets/{cssMode-CihsrbZY.js → cssMode-Cxe23-tB.js} +3 -3
  5. package/out/renderer/assets/{freemarker2-DFrJ_l05.js → freemarker2-Be0nj7Oa.js} +1 -1
  6. package/out/renderer/assets/{handlebars-BZi7_LdH.js → handlebars-C0It7_Nu.js} +1 -1
  7. package/out/renderer/assets/{html-CdaPU_YJ.js → html-BW6LB-7J.js} +1 -1
  8. package/out/renderer/assets/{htmlMode-DZnUcBOX.js → htmlMode-D_V-1VlE.js} +3 -3
  9. package/out/renderer/assets/{index-CKhIh5ZQ.js → index-D568SpEt.js} +117 -145
  10. package/out/renderer/assets/{javascript-DvV4owMk.js → javascript-D_LoeNc7.js} +2 -2
  11. package/out/renderer/assets/{jsonMode-DX3yX_PF.js → jsonMode-K3WSinSE.js} +3 -3
  12. package/out/renderer/assets/{liquid-c7QWTywx.js → liquid-BqfOd6m8.js} +1 -1
  13. package/out/renderer/assets/{lspLanguageFeatures-Dp-OZOZS.js → lspLanguageFeatures-Bjf28WU6.js} +1 -1
  14. package/out/renderer/assets/{mdx-Bi7NE1tt.js → mdx-BoESjI38.js} +1 -1
  15. package/out/renderer/assets/{python-BeMAHtzr.js → python-DlafOOgB.js} +1 -1
  16. package/out/renderer/assets/{razor-Cfc9e2QR.js → razor-CB6E9DBD.js} +1 -1
  17. package/out/renderer/assets/{tsMode-CKrhuOxD.js → tsMode-DYu1z_nn.js} +1 -1
  18. package/out/renderer/assets/{typescript-BEFZ19OD.js → typescript-CDjkh0d5.js} +1 -1
  19. package/out/renderer/assets/{xml-CVdJPpsd.js → xml-C-XlilKZ.js} +1 -1
  20. package/out/renderer/assets/{yaml-B_Px-4th.js → yaml-BTrtxLEo.js} +1 -1
  21. package/out/renderer/index.html +1 -1
  22. package/package.json +5 -1
  23. package/src/main/headless.ts +12 -0
  24. package/src/main/tui.ts +31 -107
  25. package/src/renderer/App.tsx +8 -25
  26. package/src/renderer/components/PaneLayout.tsx +6 -44
  27. package/src/renderer/components/TerminalPanel.tsx +100 -82
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./cssMode-CihsrbZY.js","./lspLanguageFeatures-Dp-OZOZS.js","./htmlMode-DZnUcBOX.js","./jsonMode-DX3yX_PF.js","./javascript-DvV4owMk.js","./typescript-BEFZ19OD.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-CihsrbZY.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-DZnUcBOX.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-DX3yX_PF.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-CKrhuOxD.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-DFrJ_l05.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-DFrJ_l05.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-DFrJ_l05.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-DFrJ_l05.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-DFrJ_l05.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-DFrJ_l05.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-DFrJ_l05.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-BZi7_LdH.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-CdaPU_YJ.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-DvV4owMk.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-c7QWTywx.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-Bi7NE1tt.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-BeMAHtzr.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-Cfc9e2QR.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-BEFZ19OD.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-CVdJPpsd.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_Px-4th.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;
@@ -211152,7 +211160,7 @@ const DragContext = reactExports.createContext({
211152
211160
  setDragPaneId: () => {
211153
211161
  }
211154
211162
  });
211155
- function PaneLayout({ layout: layout2, panes, onLayoutChange, onToggle, paneHostPrefix }) {
211163
+ function PaneLayout({ layout: layout2, panes, onLayoutChange, onToggle }) {
211156
211164
  const [dragPaneId, setDragPaneId] = reactExports.useState(null);
211157
211165
  const handleDrop = reactExports.useCallback((targetPaneId, zone) => {
211158
211166
  if (!dragPaneId || dragPaneId === targetPaneId) return;
@@ -211174,12 +211182,11 @@ function PaneLayout({ layout: layout2, panes, onLayoutChange, onToggle, paneHost
211174
211182
  onToggle,
211175
211183
  onLayoutChange,
211176
211184
  parentDirection: null,
211177
- path: [],
211178
- paneHostPrefix
211185
+ path: []
211179
211186
  }
211180
211187
  ) }) });
211181
211188
  }
211182
- function LayoutRenderer({ node, paneMap, onDrop, onToggle, onLayoutChange, parentDirection, path, paneHostPrefix }) {
211189
+ function LayoutRenderer({ node, paneMap, onDrop, onToggle, onLayoutChange, parentDirection, path }) {
211183
211190
  if (node.type === "leaf") {
211184
211191
  const pane = paneMap.get(node.paneId);
211185
211192
  if (!pane) return null;
@@ -211188,8 +211195,7 @@ function LayoutRenderer({ node, paneMap, onDrop, onToggle, onLayoutChange, paren
211188
211195
  {
211189
211196
  pane,
211190
211197
  onDrop,
211191
- onToggle,
211192
- paneHostPrefix
211198
+ onToggle
211193
211199
  }
211194
211200
  );
211195
211201
  }
@@ -211201,12 +211207,11 @@ function LayoutRenderer({ node, paneMap, onDrop, onToggle, onLayoutChange, paren
211201
211207
  onDrop,
211202
211208
  onToggle,
211203
211209
  onLayoutChange,
211204
- path,
211205
- paneHostPrefix
211210
+ path
211206
211211
  }
211207
211212
  );
211208
211213
  }
211209
- function SplitContainer({ node, paneMap, onDrop, onToggle, onLayoutChange, path, paneHostPrefix }) {
211214
+ function SplitContainer({ node, paneMap, onDrop, onToggle, onLayoutChange, path }) {
211210
211215
  const containerRef = reactExports.useRef(null);
211211
211216
  const draggingDivider = reactExports.useRef(null);
211212
211217
  const sizesRef = reactExports.useRef(node.sizes);
@@ -211291,8 +211296,7 @@ function SplitContainer({ node, paneMap, onDrop, onToggle, onLayoutChange, path,
211291
211296
  onLayoutChange({ ...node, children: newChildren });
211292
211297
  },
211293
211298
  parentDirection: node.direction,
211294
- path: [...path, i2],
211295
- paneHostPrefix
211299
+ path: [...path, i2]
211296
211300
  }
211297
211301
  )
211298
211302
  }
@@ -211314,34 +211318,10 @@ function SplitContainer({ node, paneMap, onDrop, onToggle, onLayoutChange, path,
211314
211318
  }
211315
211319
  );
211316
211320
  }
211317
- function LeafPane({ pane, onDrop, onToggle, paneHostPrefix }) {
211321
+ function LeafPane({ pane, onDrop, onToggle }) {
211318
211322
  const { dragPaneId, setDragPaneId } = reactExports.useContext(DragContext);
211319
211323
  const [hoverZone, setHoverZone] = reactExports.useState(null);
211320
211324
  const paneRef = reactExports.useRef(null);
211321
- const contentRef = reactExports.useRef(null);
211322
- reactExports.useEffect(() => {
211323
- if (!paneHostPrefix || !contentRef.current) return;
211324
- const hostEl = document.getElementById(`${paneHostPrefix}${pane.id}`);
211325
- if (!hostEl) return;
211326
- hostEl.style.position = "";
211327
- hostEl.style.width = "100%";
211328
- hostEl.style.height = "100%";
211329
- hostEl.style.overflow = "";
211330
- hostEl.style.opacity = "1";
211331
- hostEl.style.pointerEvents = "";
211332
- contentRef.current.appendChild(hostEl);
211333
- return () => {
211334
- if (hostEl.parentElement === contentRef.current) {
211335
- document.body.appendChild(hostEl);
211336
- hostEl.style.position = "absolute";
211337
- hostEl.style.width = "1px";
211338
- hostEl.style.height = "1px";
211339
- hostEl.style.overflow = "hidden";
211340
- hostEl.style.opacity = "0";
211341
- hostEl.style.pointerEvents = "none";
211342
- }
211343
- };
211344
- }, [pane.id, paneHostPrefix]);
211345
211325
  const isDragging = dragPaneId === pane.id;
211346
211326
  const isDropTarget = dragPaneId !== null && dragPaneId !== pane.id;
211347
211327
  const computeZone = reactExports.useCallback((e) => {
@@ -211387,7 +211367,7 @@ function LeafPane({ pane, onDrop, onToggle, paneHostPrefix }) {
211387
211367
  ]
211388
211368
  }
211389
211369
  ),
211390
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "leaf-pane-content", ref: contentRef, children: !paneHostPrefix && pane.content }),
211370
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "leaf-pane-content", children: pane.content }),
211391
211371
  isDropTarget && /* @__PURE__ */ jsxRuntimeExports.jsxs(
211392
211372
  "div",
211393
211373
  {
@@ -211641,14 +211621,6 @@ const DEFAULT_LAYOUT = {
211641
211621
  sizes: [50, 50]
211642
211622
  };
211643
211623
  const ALL_PANE_IDS = ["editor", "terminal", "ctlsurf"];
211644
- const offscreenStyle = {
211645
- position: "absolute",
211646
- width: "1px",
211647
- height: "1px",
211648
- overflow: "hidden",
211649
- opacity: 0,
211650
- pointerEvents: "none"
211651
- };
211652
211624
  function App() {
211653
211625
  const [agents, setAgents] = reactExports.useState([]);
211654
211626
  const [selectedAgent, setSelectedAgent] = reactExports.useState(null);
@@ -211781,14 +211753,15 @@ function App() {
211781
211753
  return () => window.removeEventListener("keydown", handleKeyDown);
211782
211754
  }, [togglePane]);
211783
211755
  const panes = [
211784
- { id: "editor", label: "Editor", content: null },
211785
- { id: "terminal", label: "Terminal", content: null },
211786
- { id: "ctlsurf", label: "ctlsurf", content: null }
211756
+ { id: "editor", label: "Editor", content: /* @__PURE__ */ jsxRuntimeExports.jsx(EditorPanel, { cwd: cwd2 }) },
211757
+ {
211758
+ id: "terminal",
211759
+ label: "Terminal",
211760
+ content: /* @__PURE__ */ jsxRuntimeExports.jsx(TerminalPanel, { agent: selectedAgent, onSpawn: handleSpawn, onExit: handleExit })
211761
+ },
211762
+ { id: "ctlsurf", label: "ctlsurf", content: /* @__PURE__ */ jsxRuntimeExports.jsx(CtlsurfPanel, {}) }
211787
211763
  ];
211788
211764
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "app", children: [
211789
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "pane-host-editor", style: visiblePaneIds.includes("editor") ? void 0 : offscreenStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsx(EditorPanel, { cwd: cwd2 }) }),
211790
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "pane-host-terminal", style: visiblePaneIds.includes("terminal") ? void 0 : offscreenStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TerminalPanel, { agent: selectedAgent, onSpawn: handleSpawn, onExit: handleExit }) }),
211791
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "pane-host-ctlsurf", style: visiblePaneIds.includes("ctlsurf") ? void 0 : offscreenStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CtlsurfPanel, {}) }),
211792
211765
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "titlebar", children: [
211793
211766
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "titlebar-title", children: "ctlsurf-worker" }),
211794
211767
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "titlebar-controls", children: [
@@ -211823,8 +211796,7 @@ function App() {
211823
211796
  layout: layout2,
211824
211797
  panes: panes.filter((p) => visiblePaneIds.includes(p.id)),
211825
211798
  onLayoutChange: setLayout,
211826
- onToggle: togglePane,
211827
- paneHostPrefix: "pane-host-"
211799
+ onToggle: togglePane
211828
211800
  }
211829
211801
  ) }),
211830
211802
  /* @__PURE__ */ jsxRuntimeExports.jsx(StatusBar, { wsStatus, cwd: cwd2, onChangeCwd: handleChangeCwd }),
@@ -1,5 +1,5 @@
1
- import { conf as conf$1, language as language$1 } from "./typescript-BEFZ19OD.js";
2
- import "./index-CKhIh5ZQ.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-CKhIh5ZQ.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-Dp-OZOZS.js";
3
- import { a, D, h, R, c, i, j, t, k } from "./lspLanguageFeatures-Dp-OZOZS.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-CKhIh5ZQ.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-CKhIh5ZQ.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-CKhIh5ZQ.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-CKhIh5ZQ.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-CKhIh5ZQ.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-CKhIh5ZQ.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-CKhIh5ZQ.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-CKhIh5ZQ.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-CKhIh5ZQ.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-CKhIh5ZQ.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.16",
3
+ "version": "0.1.20",
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
  }
@@ -138,6 +138,12 @@ async function main() {
138
138
  }
139
139
 
140
140
  // Pipe stdin to PTY, with Ctrl+\ as the exit key
141
+ // SGR mouse wheel: \x1b[<64;col;rowM = scroll up, \x1b[<65;col;rowM = scroll down
142
+ const SCROLL_UP_RE = /\x1b\[<64;\d+;\d+M/
143
+ const SCROLL_DOWN_RE = /\x1b\[<65;\d+;\d+M/
144
+ // Use mouse wheel events directly — forward as SGR mouse to the PTY
145
+ // so the inner app can handle them natively
146
+
141
147
  if (process.stdin.isTTY) {
142
148
  process.stdin.setRawMode(true)
143
149
  process.stdin.resume()
@@ -148,6 +154,12 @@ async function main() {
148
154
  shutdown()
149
155
  return
150
156
  }
157
+ // Drop mouse wheel events — Claude Code doesn't support mouse scrolling.
158
+ // Scrolling is handled by the terminal emulator natively when not in
159
+ // alternate screen, or not at all in alternate screen (Claude Code's TUI).
160
+ if (SCROLL_UP_RE.test(str) || SCROLL_DOWN_RE.test(str)) {
161
+ return
162
+ }
151
163
  orchestrator.writePty(str)
152
164
  })
153
165
  }