@phenx-inc/ctlsurf 0.3.7 → 0.3.8

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 (34) hide show
  1. package/out/headless/index.mjs +209 -13
  2. package/out/headless/index.mjs.map +3 -3
  3. package/out/main/index.js +85 -51
  4. package/out/preload/index.js +3 -0
  5. package/out/renderer/assets/{cssMode-DQW-brNd.js → cssMode-CYoo4t9f.js} +3 -3
  6. package/out/renderer/assets/{freemarker2-DxgOckH2.js → freemarker2--UQnPZsn.js} +1 -1
  7. package/out/renderer/assets/{handlebars-BX1Wpk_3.js → handlebars-DVDrmX0C.js} +1 -1
  8. package/out/renderer/assets/{html-t-KXioI0.js → html-D1-cXoLy.js} +1 -1
  9. package/out/renderer/assets/{htmlMode-Dya7iUjr.js → htmlMode-f5nBuprq.js} +3 -3
  10. package/out/renderer/assets/{index-D6JBcQ20.css → index-65hyKM_8.css} +16 -0
  11. package/out/renderer/assets/{index-DNqZidnO.js → index-D23nru43.js} +64 -23
  12. package/out/renderer/assets/{javascript-DZzW2adn.js → javascript-CcarFzBL.js} +2 -2
  13. package/out/renderer/assets/{jsonMode-D_Wv7XH8.js → jsonMode-BvF-xK9U.js} +3 -3
  14. package/out/renderer/assets/{liquid-BJAHAm2T.js → liquid-CHLtUKl2.js} +1 -1
  15. package/out/renderer/assets/{lspLanguageFeatures-BgMd-KJk.js → lspLanguageFeatures-B9aNeatS.js} +1 -1
  16. package/out/renderer/assets/{mdx-B6Zod3ry.js → mdx-HGDrkifZ.js} +1 -1
  17. package/out/renderer/assets/{python-Cgt13-KH.js → python-B_dPzjJ6.js} +1 -1
  18. package/out/renderer/assets/{razor-BcwFJGYS.js → razor-CHheM4ot.js} +1 -1
  19. package/out/renderer/assets/{tsMode-BTjzM6fl.js → tsMode-CdC3i1gG.js} +1 -1
  20. package/out/renderer/assets/{typescript-DZYDQEUb.js → typescript-BX6guVRK.js} +1 -1
  21. package/out/renderer/assets/{xml-CloiUoIW.js → xml-CpS-pOPE.js} +1 -1
  22. package/out/renderer/assets/{yaml-CdKdpE-z.js → yaml-Du0AjOHW.js} +1 -1
  23. package/out/renderer/index.html +2 -2
  24. package/package.json +1 -1
  25. package/src/main/bridge.ts +9 -3
  26. package/src/main/headless.ts +35 -2
  27. package/src/main/index.ts +10 -39
  28. package/src/main/orchestrator.ts +29 -1
  29. package/src/main/tui.ts +20 -8
  30. package/src/main/updateCheck.ts +40 -0
  31. package/src/preload/index.ts +6 -0
  32. package/src/renderer/App.tsx +2 -0
  33. package/src/renderer/components/AgentPicker.tsx +38 -3
  34. package/src/renderer/styles.css +16 -0
package/out/main/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  const electron = require("electron");
3
3
  const path = require("path");
4
4
  const fs = require("fs");
5
- const require$$1$1 = require("https");
5
+ const https = require("https");
6
6
  const os = require("os");
7
7
  const module$1 = require("module");
8
8
  const require$$1 = require("crypto");
@@ -14,6 +14,47 @@ const require$$0$2 = require("stream");
14
14
  const require$$7 = require("url");
15
15
  const require$$0 = require("zlib");
16
16
  const require$$0$1 = require("buffer");
17
+ const NPM_PACKAGE = "@phenx-inc/ctlsurf";
18
+ function compareSemver(a, b2) {
19
+ const pa = a.split(".").map((n) => parseInt(n, 10) || 0);
20
+ const pb = b2.split(".").map((n) => parseInt(n, 10) || 0);
21
+ for (let i = 0; i < 3; i++) {
22
+ const ai = pa[i] || 0;
23
+ const bi = pb[i] || 0;
24
+ if (ai !== bi) return ai - bi;
25
+ }
26
+ return 0;
27
+ }
28
+ function fetchLatestNpmVersion(timeoutMs = 8e3) {
29
+ return new Promise((resolve) => {
30
+ const url = `https://registry.npmjs.org/${encodeURIComponent(NPM_PACKAGE)}/latest`;
31
+ const req = https.get(url, { headers: { "Accept": "application/json" } }, (res) => {
32
+ if (res.statusCode !== 200) {
33
+ res.resume();
34
+ resolve(null);
35
+ return;
36
+ }
37
+ let body = "";
38
+ res.setEncoding("utf8");
39
+ res.on("data", (chunk) => {
40
+ body += chunk;
41
+ });
42
+ res.on("end", () => {
43
+ try {
44
+ const json = JSON.parse(body);
45
+ resolve(typeof json?.version === "string" ? json.version : null);
46
+ } catch {
47
+ resolve(null);
48
+ }
49
+ });
50
+ });
51
+ req.on("error", () => resolve(null));
52
+ req.setTimeout(timeoutMs, () => {
53
+ req.destroy();
54
+ resolve(null);
55
+ });
56
+ });
57
+ }
17
58
  function getShellCommand() {
18
59
  if (process.platform === "win32") return "powershell.exe";
19
60
  return process.env.SHELL || "/bin/zsh";
@@ -5689,6 +5730,7 @@ var k = class extends S {
5689
5730
  class ConversationBridge {
5690
5731
  wsClient = null;
5691
5732
  sessionActive = false;
5733
+ loggingEnabled = false;
5692
5734
  inputBuffer = "";
5693
5735
  outputBuffer = "";
5694
5736
  outputFlushTimer = null;
@@ -5698,7 +5740,11 @@ class ConversationBridge {
5698
5740
  setWsClient(ws) {
5699
5741
  this.wsClient = ws;
5700
5742
  }
5743
+ setLoggingEnabled(enabled) {
5744
+ this.loggingEnabled = enabled;
5745
+ }
5701
5746
  startSession() {
5747
+ if (!this.loggingEnabled) return;
5702
5748
  this.clearOutputTimers();
5703
5749
  this.outputBuffer = "";
5704
5750
  this.inputBuffer = "";
@@ -5707,13 +5753,13 @@ class ConversationBridge {
5707
5753
  console.log("[bridge] Session started");
5708
5754
  }
5709
5755
  feedOutput(data) {
5710
- if (!this.sessionActive) return;
5756
+ if (!this.sessionActive || !this.loggingEnabled) return;
5711
5757
  this.outputBuffer += data;
5712
5758
  this.terminalCapture.write(data);
5713
5759
  this.scheduleOutputFlush();
5714
5760
  }
5715
5761
  feedInput(data) {
5716
- if (!this.sessionActive) return;
5762
+ if (!this.sessionActive || !this.loggingEnabled) return;
5717
5763
  this.inputBuffer += data;
5718
5764
  if (data.includes("\r") || data.includes("\n")) {
5719
5765
  const cleaned = cleanInput(this.inputBuffer);
@@ -5735,7 +5781,7 @@ class ConversationBridge {
5735
5781
  this.sendEntry("terminal_output", cleaned);
5736
5782
  }
5737
5783
  sendEntry(type, content) {
5738
- if (!this.wsClient) return;
5784
+ if (!this.wsClient || !this.loggingEnabled) return;
5739
5785
  this.wsClient.sendChatLog({
5740
5786
  ts: (/* @__PURE__ */ new Date()).toISOString(),
5741
5787
  type,
@@ -8431,7 +8477,7 @@ function requireWebsocket() {
8431
8477
  if (hasRequiredWebsocket) return websocket;
8432
8478
  hasRequiredWebsocket = 1;
8433
8479
  const EventEmitter = require$$0$3;
8434
- const https = require$$1$1;
8480
+ const https$1 = https;
8435
8481
  const http = require$$2;
8436
8482
  const net = require$$3;
8437
8483
  const tls = require$$4;
@@ -8966,7 +9012,7 @@ function requireWebsocket() {
8966
9012
  }
8967
9013
  const defaultPort = isSecure ? 443 : 80;
8968
9014
  const key = randomBytes(16).toString("base64");
8969
- const request = isSecure ? https.request : http.request;
9015
+ const request = isSecure ? https$1.request : http.request;
8970
9016
  const protocolSet = /* @__PURE__ */ new Set();
8971
9017
  let perMessageDeflate;
8972
9018
  opts.createConnection = opts.createConnection || (isSecure ? tlsConnect : netConnect);
@@ -10434,7 +10480,8 @@ class Orchestrator {
10434
10480
  currentCwd = null;
10435
10481
  settings = {
10436
10482
  activeProfile: "production",
10437
- profiles: { ...DEFAULT_PROFILES }
10483
+ profiles: { ...DEFAULT_PROFILES },
10484
+ logChat: false
10438
10485
  };
10439
10486
  constructor(settingsDir, events) {
10440
10487
  this.settingsDir = settingsDir;
@@ -10469,6 +10516,21 @@ class Orchestrator {
10469
10516
  }
10470
10517
  });
10471
10518
  this.bridge.setWsClient(this.workerWs);
10519
+ this.bridge.setLoggingEnabled(!!this.settings.logChat);
10520
+ }
10521
+ // ─── Chat logging ───────────────────────────────
10522
+ get logChatEnabled() {
10523
+ return !!this.settings.logChat;
10524
+ }
10525
+ setLogChat(enabled) {
10526
+ this.settings.logChat = enabled;
10527
+ this.saveSettings();
10528
+ this.bridge.setLoggingEnabled(enabled);
10529
+ if (!enabled) {
10530
+ this.bridge.endSession();
10531
+ } else if (this.activeTabId) {
10532
+ this.bridge.startSession();
10533
+ }
10472
10534
  }
10473
10535
  // ─── Settings ───────────────────────────────────
10474
10536
  getActiveProfile() {
@@ -10516,7 +10578,8 @@ class Orchestrator {
10516
10578
  baseUrl: raw.ctlsurfBaseUrl || "https://app.ctlsurf.com",
10517
10579
  dataspacePageId: raw.ctlsurfDataspacePageId || ""
10518
10580
  }
10519
- }
10581
+ },
10582
+ logChat: !!raw.logChat
10520
10583
  };
10521
10584
  this.saveSettings();
10522
10585
  log$1("[settings] Migrated legacy settings to profiles");
@@ -10525,15 +10588,20 @@ class Orchestrator {
10525
10588
  if (!this.settings.profiles.production) {
10526
10589
  this.settings.profiles.production = { ...DEFAULT_PROFILES.production };
10527
10590
  }
10591
+ if (this.settings.logChat === void 0) {
10592
+ this.settings.logChat = false;
10593
+ }
10528
10594
  }
10529
10595
  }
10530
10596
  } catch {
10531
10597
  this.settings = {
10532
10598
  activeProfile: "production",
10533
- profiles: { ...DEFAULT_PROFILES }
10599
+ profiles: { ...DEFAULT_PROFILES },
10600
+ logChat: false
10534
10601
  };
10535
10602
  }
10536
10603
  this.applyProfile(this.getActiveProfile());
10604
+ this.bridge.setLoggingEnabled(!!this.settings.logChat);
10537
10605
  }
10538
10606
  saveSettings() {
10539
10607
  const settingsPath = path.join(this.settingsDir, "settings.json");
@@ -10663,7 +10731,9 @@ class Orchestrator {
10663
10731
  const t = this.tabs.get(tabId);
10664
10732
  if (t?.termStreamTimer) clearTimeout(t.termStreamTimer);
10665
10733
  });
10666
- this.bridge.startSession();
10734
+ if (this.settings.logChat) {
10735
+ this.bridge.startSession();
10736
+ }
10667
10737
  const profile = this.getActiveProfile();
10668
10738
  const shouldTrack = opts?.trackTime !== void 0 ? opts.trackTime : profile.trackTime !== false;
10669
10739
  if (shouldTrack) {
@@ -10928,7 +10998,6 @@ electron.ipcMain.handle("app:browseCwd", async () => {
10928
10998
  if (result.canceled || !result.filePaths[0]) return null;
10929
10999
  return result.filePaths[0];
10930
11000
  });
10931
- const NPM_PACKAGE = "@phenx-inc/ctlsurf";
10932
11001
  const UPDATE_CHECK_INTERVAL_MS = 6 * 60 * 60 * 1e3;
10933
11002
  let updateInfo = {
10934
11003
  current: electron.app.getVersion(),
@@ -10936,46 +11005,6 @@ let updateInfo = {
10936
11005
  hasUpdate: false,
10937
11006
  checkedAt: null
10938
11007
  };
10939
- function compareSemver(a, b2) {
10940
- const pa = a.split(".").map((n) => parseInt(n, 10) || 0);
10941
- const pb = b2.split(".").map((n) => parseInt(n, 10) || 0);
10942
- for (let i = 0; i < 3; i++) {
10943
- const ai = pa[i] || 0;
10944
- const bi = pb[i] || 0;
10945
- if (ai !== bi) return ai - bi;
10946
- }
10947
- return 0;
10948
- }
10949
- function fetchLatestNpmVersion() {
10950
- return new Promise((resolve) => {
10951
- const url = `https://registry.npmjs.org/${encodeURIComponent(NPM_PACKAGE)}/latest`;
10952
- const req = require$$1$1.get(url, { headers: { "Accept": "application/json" } }, (res) => {
10953
- if (res.statusCode !== 200) {
10954
- res.resume();
10955
- resolve(null);
10956
- return;
10957
- }
10958
- let body = "";
10959
- res.setEncoding("utf8");
10960
- res.on("data", (chunk) => {
10961
- body += chunk;
10962
- });
10963
- res.on("end", () => {
10964
- try {
10965
- const json = JSON.parse(body);
10966
- resolve(typeof json?.version === "string" ? json.version : null);
10967
- } catch {
10968
- resolve(null);
10969
- }
10970
- });
10971
- });
10972
- req.on("error", () => resolve(null));
10973
- req.setTimeout(8e3, () => {
10974
- req.destroy();
10975
- resolve(null);
10976
- });
10977
- });
10978
- }
10979
11008
  async function checkForUpdate() {
10980
11009
  const latest = await fetchLatestNpmVersion();
10981
11010
  updateInfo = {
@@ -11101,6 +11130,11 @@ electron.ipcMain.handle("profiles:save", (_event, id, data) => {
11101
11130
  });
11102
11131
  electron.ipcMain.handle("profiles:switch", (_event, id) => orchestrator.switchProfile(id));
11103
11132
  electron.ipcMain.handle("profiles:delete", (_event, id) => orchestrator.deleteProfile(id));
11133
+ electron.ipcMain.handle("logchat:get", () => ({ enabled: orchestrator.logChatEnabled }));
11134
+ electron.ipcMain.handle("logchat:set", (_event, enabled) => {
11135
+ orchestrator.setLogChat(!!enabled);
11136
+ return { enabled: orchestrator.logChatEnabled };
11137
+ });
11104
11138
  electron.ipcMain.handle("tracking:get", () => ({ active: orchestrator.isActiveTabTracking() }));
11105
11139
  electron.ipcMain.handle("tracking:set", async (_event, enabled) => {
11106
11140
  await orchestrator.setActiveTabTracking(enabled);
@@ -45,6 +45,9 @@ const api = {
45
45
  // Tracking (active tab)
46
46
  getTracking: () => electron.ipcRenderer.invoke("tracking:get"),
47
47
  setTracking: (enabled) => electron.ipcRenderer.invoke("tracking:set", enabled),
48
+ // Chat logging (global)
49
+ getLogChat: () => electron.ipcRenderer.invoke("logchat:get"),
50
+ setLogChat: (enabled) => electron.ipcRenderer.invoke("logchat:set", enabled),
48
51
  // Filesystem
49
52
  readDir: (dirPath) => electron.ipcRenderer.invoke("fs:readDir", dirPath),
50
53
  readFile: (filePath) => electron.ipcRenderer.invoke("fs:readFile", filePath),
@@ -1,6 +1,6 @@
1
- import { c as createWebWorker, l as languages } from "./index-DNqZidnO.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-BgMd-KJk.js";
3
- import { h, i, j, t, k } from "./lspLanguageFeatures-BgMd-KJk.js";
1
+ import { c as createWebWorker, l as languages } from "./index-D23nru43.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-B9aNeatS.js";
3
+ import { h, i, j, t, k } from "./lspLanguageFeatures-B9aNeatS.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-DNqZidnO.js";
1
+ import { l as languages } from "./index-D23nru43.js";
2
2
  const EMPTY_ELEMENTS = [
3
3
  "assign",
4
4
  "flush",
@@ -1,4 +1,4 @@
1
- import { l as languages } from "./index-DNqZidnO.js";
1
+ import { l as languages } from "./index-D23nru43.js";
2
2
  const EMPTY_ELEMENTS = [
3
3
  "area",
4
4
  "base",
@@ -1,4 +1,4 @@
1
- import { l as languages } from "./index-DNqZidnO.js";
1
+ import { l as languages } from "./index-D23nru43.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-DNqZidnO.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-BgMd-KJk.js";
3
- import { a, e, d, R, i, j, t, k } from "./lspLanguageFeatures-BgMd-KJk.js";
1
+ import { c as createWebWorker, l as languages } from "./index-D23nru43.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-B9aNeatS.js";
3
+ import { a, e, d, R, i, j, t, k } from "./lspLanguageFeatures-B9aNeatS.js";
4
4
  const STOP_WHEN_IDLE_FOR = 2 * 60 * 1e3;
5
5
  class WorkerManager {
6
6
  constructor(defaults) {
@@ -8207,6 +8207,22 @@ html, body, #root {
8207
8207
  color: #414868;
8208
8208
  }
8209
8209
 
8210
+ .agent-picker-option {
8211
+ margin-top: 16px;
8212
+ display: flex;
8213
+ align-items: center;
8214
+ gap: 8px;
8215
+ font-size: 12px;
8216
+ color: #a9b1d6;
8217
+ cursor: pointer;
8218
+ user-select: none;
8219
+ }
8220
+
8221
+ .agent-picker-option input[type="checkbox"] {
8222
+ cursor: pointer;
8223
+ accent-color: #7aa2f7;
8224
+ }
8225
+
8210
8226
  /* Settings dialog */
8211
8227
  .settings-overlay {
8212
8228
  position: fixed;
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./cssMode-DQW-brNd.js","./lspLanguageFeatures-BgMd-KJk.js","./htmlMode-Dya7iUjr.js","./jsonMode-D_Wv7XH8.js","./javascript-DZzW2adn.js","./typescript-DZYDQEUb.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./cssMode-CYoo4t9f.js","./lspLanguageFeatures-B9aNeatS.js","./htmlMode-f5nBuprq.js","./jsonMode-BvF-xK9U.js","./javascript-CcarFzBL.js","./typescript-BX6guVRK.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
  }
@@ -206558,7 +206558,7 @@ const lessDefaults = new LanguageServiceDefaultsImpl$3(
206558
206558
  modeConfigurationDefault$2
206559
206559
  );
206560
206560
  function getMode$3() {
206561
- return __vitePreload(() => import("./cssMode-DQW-brNd.js"), true ? __vite__mapDeps([0,1]) : void 0, import.meta.url);
206561
+ return __vitePreload(() => import("./cssMode-CYoo4t9f.js"), true ? __vite__mapDeps([0,1]) : void 0, import.meta.url);
206562
206562
  }
206563
206563
  languages.onLanguage("less", () => {
206564
206564
  getMode$3().then((mode2) => mode2.setupMode(lessDefaults));
@@ -206663,7 +206663,7 @@ const razorLanguageService = registerHTMLLanguageService(
206663
206663
  );
206664
206664
  const razorDefaults = razorLanguageService.defaults;
206665
206665
  function getMode$2() {
206666
- return __vitePreload(() => import("./htmlMode-Dya7iUjr.js"), true ? __vite__mapDeps([2,1]) : void 0, import.meta.url);
206666
+ return __vitePreload(() => import("./htmlMode-f5nBuprq.js"), true ? __vite__mapDeps([2,1]) : void 0, import.meta.url);
206667
206667
  }
206668
206668
  function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
206669
206669
  const defaults = new LanguageServiceDefaultsImpl$2(languageId, options, modeConfiguration);
@@ -206747,7 +206747,7 @@ const jsonDefaults = new LanguageServiceDefaultsImpl$1(
206747
206747
  );
206748
206748
  const getWorker$1 = () => getMode$1().then((mode2) => mode2.getWorker());
206749
206749
  function getMode$1() {
206750
- return __vitePreload(() => import("./jsonMode-D_Wv7XH8.js"), true ? __vite__mapDeps([3,1]) : void 0, import.meta.url);
206750
+ return __vitePreload(() => import("./jsonMode-BvF-xK9U.js"), true ? __vite__mapDeps([3,1]) : void 0, import.meta.url);
206751
206751
  }
206752
206752
  languages.register({
206753
206753
  id: "json",
@@ -206993,7 +206993,7 @@ const getJavaScriptWorker = () => {
206993
206993
  return getMode().then((mode) => mode.getJavaScriptWorker());
206994
206994
  };
206995
206995
  function getMode() {
206996
- return __vitePreload(() => import("./tsMode-BTjzM6fl.js"), true ? [] : void 0, import.meta.url);
206996
+ return __vitePreload(() => import("./tsMode-CdC3i1gG.js"), true ? [] : void 0, import.meta.url);
206997
206997
  }
206998
206998
  languages.onLanguage("typescript", () => {
206999
206999
  return getMode().then((mode) => mode.setupTypeScript(typescriptDefaults));
@@ -207188,49 +207188,49 @@ registerLanguage({
207188
207188
  extensions: [".ftl", ".ftlh", ".ftlx"],
207189
207189
  aliases: ["FreeMarker2", "Apache FreeMarker2"],
207190
207190
  loader: () => {
207191
- return __vitePreload(() => import("./freemarker2-DxgOckH2.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAutoInterpolationDollar);
207191
+ return __vitePreload(() => import("./freemarker2--UQnPZsn.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAutoInterpolationDollar);
207192
207192
  }
207193
207193
  });
207194
207194
  registerLanguage({
207195
207195
  id: "freemarker2.tag-angle.interpolation-dollar",
207196
207196
  aliases: ["FreeMarker2 (Angle/Dollar)", "Apache FreeMarker2 (Angle/Dollar)"],
207197
207197
  loader: () => {
207198
- return __vitePreload(() => import("./freemarker2-DxgOckH2.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAngleInterpolationDollar);
207198
+ return __vitePreload(() => import("./freemarker2--UQnPZsn.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAngleInterpolationDollar);
207199
207199
  }
207200
207200
  });
207201
207201
  registerLanguage({
207202
207202
  id: "freemarker2.tag-bracket.interpolation-dollar",
207203
207203
  aliases: ["FreeMarker2 (Bracket/Dollar)", "Apache FreeMarker2 (Bracket/Dollar)"],
207204
207204
  loader: () => {
207205
- return __vitePreload(() => import("./freemarker2-DxgOckH2.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagBracketInterpolationDollar);
207205
+ return __vitePreload(() => import("./freemarker2--UQnPZsn.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagBracketInterpolationDollar);
207206
207206
  }
207207
207207
  });
207208
207208
  registerLanguage({
207209
207209
  id: "freemarker2.tag-angle.interpolation-bracket",
207210
207210
  aliases: ["FreeMarker2 (Angle/Bracket)", "Apache FreeMarker2 (Angle/Bracket)"],
207211
207211
  loader: () => {
207212
- return __vitePreload(() => import("./freemarker2-DxgOckH2.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAngleInterpolationBracket);
207212
+ return __vitePreload(() => import("./freemarker2--UQnPZsn.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAngleInterpolationBracket);
207213
207213
  }
207214
207214
  });
207215
207215
  registerLanguage({
207216
207216
  id: "freemarker2.tag-bracket.interpolation-bracket",
207217
207217
  aliases: ["FreeMarker2 (Bracket/Bracket)", "Apache FreeMarker2 (Bracket/Bracket)"],
207218
207218
  loader: () => {
207219
- return __vitePreload(() => import("./freemarker2-DxgOckH2.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagBracketInterpolationBracket);
207219
+ return __vitePreload(() => import("./freemarker2--UQnPZsn.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagBracketInterpolationBracket);
207220
207220
  }
207221
207221
  });
207222
207222
  registerLanguage({
207223
207223
  id: "freemarker2.tag-auto.interpolation-dollar",
207224
207224
  aliases: ["FreeMarker2 (Auto/Dollar)", "Apache FreeMarker2 (Auto/Dollar)"],
207225
207225
  loader: () => {
207226
- return __vitePreload(() => import("./freemarker2-DxgOckH2.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAutoInterpolationDollar);
207226
+ return __vitePreload(() => import("./freemarker2--UQnPZsn.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAutoInterpolationDollar);
207227
207227
  }
207228
207228
  });
207229
207229
  registerLanguage({
207230
207230
  id: "freemarker2.tag-auto.interpolation-bracket",
207231
207231
  aliases: ["FreeMarker2 (Auto/Bracket)", "Apache FreeMarker2 (Auto/Bracket)"],
207232
207232
  loader: () => {
207233
- return __vitePreload(() => import("./freemarker2-DxgOckH2.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAutoInterpolationBracket);
207233
+ return __vitePreload(() => import("./freemarker2--UQnPZsn.js"), true ? [] : void 0, import.meta.url).then((m) => m.TagAutoInterpolationBracket);
207234
207234
  }
207235
207235
  });
207236
207236
  registerLanguage({
@@ -207251,7 +207251,7 @@ registerLanguage({
207251
207251
  extensions: [".handlebars", ".hbs"],
207252
207252
  aliases: ["Handlebars", "handlebars", "hbs"],
207253
207253
  mimetypes: ["text/x-handlebars-template"],
207254
- loader: () => __vitePreload(() => import("./handlebars-BX1Wpk_3.js"), true ? [] : void 0, import.meta.url)
207254
+ loader: () => __vitePreload(() => import("./handlebars-DVDrmX0C.js"), true ? [] : void 0, import.meta.url)
207255
207255
  });
207256
207256
  registerLanguage({
207257
207257
  id: "hcl",
@@ -207264,7 +207264,7 @@ registerLanguage({
207264
207264
  extensions: [".html", ".htm", ".shtml", ".xhtml", ".mdoc", ".jsp", ".asp", ".aspx", ".jshtm"],
207265
207265
  aliases: ["HTML", "htm", "html", "xhtml"],
207266
207266
  mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
207267
- loader: () => __vitePreload(() => import("./html-t-KXioI0.js"), true ? [] : void 0, import.meta.url)
207267
+ loader: () => __vitePreload(() => import("./html-D1-cXoLy.js"), true ? [] : void 0, import.meta.url)
207268
207268
  });
207269
207269
  registerLanguage({
207270
207270
  id: "ini",
@@ -207287,7 +207287,7 @@ registerLanguage({
207287
207287
  filenames: ["jakefile"],
207288
207288
  aliases: ["JavaScript", "javascript", "js"],
207289
207289
  mimetypes: ["text/javascript"],
207290
- loader: () => __vitePreload(() => import("./javascript-DZzW2adn.js"), true ? __vite__mapDeps([4,5]) : void 0, import.meta.url)
207290
+ loader: () => __vitePreload(() => import("./javascript-CcarFzBL.js"), true ? __vite__mapDeps([4,5]) : void 0, import.meta.url)
207291
207291
  });
207292
207292
  registerLanguage({
207293
207293
  id: "julia",
@@ -207326,7 +207326,7 @@ registerLanguage({
207326
207326
  extensions: [".liquid", ".html.liquid"],
207327
207327
  aliases: ["Liquid", "liquid"],
207328
207328
  mimetypes: ["application/liquid"],
207329
- loader: () => __vitePreload(() => import("./liquid-BJAHAm2T.js"), true ? [] : void 0, import.meta.url)
207329
+ loader: () => __vitePreload(() => import("./liquid-CHLtUKl2.js"), true ? [] : void 0, import.meta.url)
207330
207330
  });
207331
207331
  registerLanguage({
207332
207332
  id: "m3",
@@ -207344,7 +207344,7 @@ registerLanguage({
207344
207344
  id: "mdx",
207345
207345
  extensions: [".mdx"],
207346
207346
  aliases: ["MDX", "mdx"],
207347
- loader: () => __vitePreload(() => import("./mdx-B6Zod3ry.js"), true ? [] : void 0, import.meta.url)
207347
+ loader: () => __vitePreload(() => import("./mdx-HGDrkifZ.js"), true ? [] : void 0, import.meta.url)
207348
207348
  });
207349
207349
  registerLanguage({
207350
207350
  id: "mips",
@@ -207443,7 +207443,7 @@ registerLanguage({
207443
207443
  extensions: [".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi"],
207444
207444
  aliases: ["Python", "py"],
207445
207445
  firstLine: "^#!/.*\\bpython[0-9.-]*\\b",
207446
- loader: () => __vitePreload(() => import("./python-Cgt13-KH.js"), true ? [] : void 0, import.meta.url)
207446
+ loader: () => __vitePreload(() => import("./python-B_dPzjJ6.js"), true ? [] : void 0, import.meta.url)
207447
207447
  });
207448
207448
  registerLanguage({
207449
207449
  id: "qsharp",
@@ -207462,7 +207462,7 @@ registerLanguage({
207462
207462
  extensions: [".cshtml"],
207463
207463
  aliases: ["Razor", "razor"],
207464
207464
  mimetypes: ["text/x-cshtml"],
207465
- loader: () => __vitePreload(() => import("./razor-BcwFJGYS.js"), true ? [] : void 0, import.meta.url)
207465
+ loader: () => __vitePreload(() => import("./razor-CHheM4ot.js"), true ? [] : void 0, import.meta.url)
207466
207466
  });
207467
207467
  registerLanguage({
207468
207468
  id: "redis",
@@ -207595,7 +207595,7 @@ registerLanguage({
207595
207595
  aliases: ["TypeScript", "ts", "typescript"],
207596
207596
  mimetypes: ["text/typescript"],
207597
207597
  loader: () => {
207598
- return __vitePreload(() => import("./typescript-DZYDQEUb.js"), true ? [] : void 0, import.meta.url);
207598
+ return __vitePreload(() => import("./typescript-BX6guVRK.js"), true ? [] : void 0, import.meta.url);
207599
207599
  }
207600
207600
  });
207601
207601
  registerLanguage({
@@ -207640,14 +207640,14 @@ registerLanguage({
207640
207640
  firstLine: "(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",
207641
207641
  aliases: ["XML", "xml"],
207642
207642
  mimetypes: ["text/xml", "application/xml", "application/xaml+xml", "application/xml-dtd"],
207643
- loader: () => __vitePreload(() => import("./xml-CloiUoIW.js"), true ? [] : void 0, import.meta.url)
207643
+ loader: () => __vitePreload(() => import("./xml-CpS-pOPE.js"), true ? [] : void 0, import.meta.url)
207644
207644
  });
207645
207645
  registerLanguage({
207646
207646
  id: "yaml",
207647
207647
  extensions: [".yaml", ".yml"],
207648
207648
  aliases: ["YAML", "yaml", "YML", "yml"],
207649
207649
  mimetypes: ["application/x-yaml", "text/x-yaml"],
207650
- loader: () => __vitePreload(() => import("./yaml-CdKdpE-z.js"), true ? [] : void 0, import.meta.url)
207650
+ loader: () => __vitePreload(() => import("./yaml-Du0AjOHW.js"), true ? [] : void 0, import.meta.url)
207651
207651
  });
207652
207652
  var __defProp = Object.defineProperty;
207653
207653
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -211138,6 +211138,36 @@ function EditorPanel({ cwd: cwd2 }) {
211138
211138
  }
211139
211139
  function AgentPicker({ agents, cwd: cwd2, onSelect, onChangeCwd }) {
211140
211140
  const displayPath = cwd2.replace(/^\/Users\/[^/]+/, "~");
211141
+ const [logChat, setLogChat] = reactExports.useState(false);
211142
+ const [loaded, setLoaded] = reactExports.useState(false);
211143
+ reactExports.useEffect(() => {
211144
+ let cancelled = false;
211145
+ window.worker.getLogChat().then((r) => {
211146
+ if (cancelled) return;
211147
+ setLogChat(!!r?.enabled);
211148
+ setLoaded(true);
211149
+ }).catch(() => setLoaded(true));
211150
+ return () => {
211151
+ cancelled = true;
211152
+ };
211153
+ }, []);
211154
+ const toggleLogChat = async () => {
211155
+ const next = !logChat;
211156
+ setLogChat(next);
211157
+ try {
211158
+ await window.worker.setLogChat(next);
211159
+ } catch {
211160
+ }
211161
+ };
211162
+ const handleSelect = async (agent) => {
211163
+ if (loaded) {
211164
+ try {
211165
+ await window.worker.setLogChat(logChat);
211166
+ } catch {
211167
+ }
211168
+ }
211169
+ onSelect(agent);
211170
+ };
211141
211171
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "agent-picker-overlay", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "agent-picker-modal", children: [
211142
211172
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "agent-picker-brand", children: "ctlsurf" }),
211143
211173
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "agent-picker-cwd", onClick: onChangeCwd, title: "Click to change directory", children: [
@@ -211150,7 +211180,7 @@ function AgentPicker({ agents, cwd: cwd2, onSelect, onChangeCwd }) {
211150
211180
  "button",
211151
211181
  {
211152
211182
  className: "agent-picker-item",
211153
- onClick: () => onSelect(a),
211183
+ onClick: () => handleSelect(a),
211154
211184
  children: [
211155
211185
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "agent-picker-name", children: a.name }),
211156
211186
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "agent-picker-desc", children: a.description })
@@ -211158,6 +211188,17 @@ function AgentPicker({ agents, cwd: cwd2, onSelect, onChangeCwd }) {
211158
211188
  },
211159
211189
  a.id
211160
211190
  )) }),
211191
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "agent-picker-option", onClick: (e) => e.stopPropagation(), children: [
211192
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
211193
+ "input",
211194
+ {
211195
+ type: "checkbox",
211196
+ checked: logChat,
211197
+ onChange: toggleLogChat
211198
+ }
211199
+ ),
211200
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Log chat to ctlsurf" })
211201
+ ] }),
211161
211202
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "agent-picker-hint", children: "Select an agent to start" })
211162
211203
  ] }) });
211163
211204
  }
@@ -1,5 +1,5 @@
1
- import { conf as conf$1, language as language$1 } from "./typescript-DZYDQEUb.js";
2
- import "./index-DNqZidnO.js";
1
+ import { conf as conf$1, language as language$1 } from "./typescript-BX6guVRK.js";
2
+ import "./index-D23nru43.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-DNqZidnO.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-BgMd-KJk.js";
3
- import { a, D, h, R, c, i, j, t, k } from "./lspLanguageFeatures-BgMd-KJk.js";
1
+ import { c as createWebWorker, l as languages, e as editor } from "./index-D23nru43.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-B9aNeatS.js";
3
+ import { a, D, h, R, c, i, j, t, k } from "./lspLanguageFeatures-B9aNeatS.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-DNqZidnO.js";
1
+ import { l as languages } from "./index-D23nru43.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-DNqZidnO.js";
1
+ import { R as Range$1, l as languages, e as editor, U as Uri, M as MarkerSeverity } from "./index-D23nru43.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-DNqZidnO.js";
1
+ import { l as languages } from "./index-D23nru43.js";
2
2
  const conf = {
3
3
  comments: {
4
4
  blockComment: ["{/*", "*/}"]
@@ -1,4 +1,4 @@
1
- import { l as languages } from "./index-DNqZidnO.js";
1
+ import { l as languages } from "./index-D23nru43.js";
2
2
  const conf = {
3
3
  comments: {
4
4
  lineComment: "#",
@@ -1,4 +1,4 @@
1
- import { l as languages } from "./index-DNqZidnO.js";
1
+ import { l as languages } from "./index-D23nru43.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-DNqZidnO.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-D23nru43.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-DNqZidnO.js";
1
+ import { l as languages } from "./index-D23nru43.js";
2
2
  const conf = {
3
3
  wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
4
4
  comments: {