codeam-cli 2.4.30 → 2.4.31

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 (31) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/index.js +70 -65
  3. package/dist/vendor/node-pty/lib/conpty_console_list_agent.js +16 -0
  4. package/dist/vendor/node-pty/lib/eventEmitter2.js +47 -0
  5. package/dist/vendor/node-pty/lib/index.js +52 -0
  6. package/dist/vendor/node-pty/lib/interfaces.js +7 -0
  7. package/dist/vendor/node-pty/lib/shared/conout.js +11 -0
  8. package/dist/vendor/node-pty/lib/terminal.js +190 -0
  9. package/dist/vendor/node-pty/lib/types.js +7 -0
  10. package/dist/vendor/node-pty/lib/unixTerminal.js +346 -0
  11. package/dist/vendor/node-pty/lib/utils.js +39 -0
  12. package/dist/vendor/node-pty/lib/windowsConoutConnection.js +125 -0
  13. package/dist/vendor/node-pty/lib/windowsPtyAgent.js +320 -0
  14. package/dist/vendor/node-pty/lib/windowsTerminal.js +199 -0
  15. package/dist/vendor/node-pty/lib/worker/conoutSocketWorker.js +22 -0
  16. package/dist/vendor/node-pty/package.json +64 -0
  17. package/dist/vendor/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
  18. package/dist/vendor/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
  19. package/dist/vendor/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
  20. package/dist/vendor/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
  21. package/dist/vendor/node-pty/prebuilds/win32-arm64/pty.node +0 -0
  22. package/dist/vendor/node-pty/prebuilds/win32-arm64/winpty-agent.exe +0 -0
  23. package/dist/vendor/node-pty/prebuilds/win32-arm64/winpty.dll +0 -0
  24. package/dist/vendor/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
  25. package/dist/vendor/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
  26. package/dist/vendor/node-pty/prebuilds/win32-x64/conpty.node +0 -0
  27. package/dist/vendor/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
  28. package/dist/vendor/node-pty/prebuilds/win32-x64/pty.node +0 -0
  29. package/dist/vendor/node-pty/prebuilds/win32-x64/winpty-agent.exe +0 -0
  30. package/dist/vendor/node-pty/prebuilds/win32-x64/winpty.dll +0 -0
  31. package/package.json +3 -5
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to `codeam-cli` are documented here.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [2.4.30] — 2026-05-05
8
+
9
+ ### Fixed
10
+
11
+ - **cli:** Pin node-pty ^1.1.0 + graceful pipe fallback if ConPTY fails (v2.4.30)
12
+
13
+ ## [2.4.29] — 2026-05-05
14
+
15
+ ### Added
16
+
17
+ - **cli:** Auto-install Claude Code if missing on first launch (v2.4.29)
18
+
7
19
  ## [2.4.28] — 2026-05-05
8
20
 
9
21
  ### Fixed
package/dist/index.js CHANGED
@@ -521,7 +521,7 @@ var require_windowsPtyAgent = __commonJS({
521
521
  exports2.argsToCommandLine = exports2.WindowsPtyAgent = void 0;
522
522
  var fs9 = require("fs");
523
523
  var os8 = require("os");
524
- var path14 = require("path");
524
+ var path15 = require("path");
525
525
  var child_process_1 = require("child_process");
526
526
  var net_1 = require("net");
527
527
  var windowsConoutConnection_1 = require_windowsConoutConnection();
@@ -557,7 +557,7 @@ var require_windowsPtyAgent = __commonJS({
557
557
  }
558
558
  }
559
559
  this._ptyNative = this._useConpty ? conptyNative : winptyNative;
560
- cwd = path14.resolve(cwd);
560
+ cwd = path15.resolve(cwd);
561
561
  var commandLine = argsToCommandLine(file, args2);
562
562
  var term;
563
563
  if (this._useConpty) {
@@ -679,7 +679,7 @@ var require_windowsPtyAgent = __commonJS({
679
679
  WindowsPtyAgent2.prototype._getConsoleProcessList = function() {
680
680
  var _this = this;
681
681
  return new Promise(function(resolve2) {
682
- var agent = child_process_1.fork(path14.join(__dirname, "conpty_console_list_agent"), [_this._innerPid.toString()]);
682
+ var agent = child_process_1.fork(path15.join(__dirname, "conpty_console_list_agent"), [_this._innerPid.toString()]);
683
683
  agent.on("message", function(message) {
684
684
  clearTimeout(timeout);
685
685
  resolve2(message.consoleProcessList);
@@ -1013,14 +1013,14 @@ var require_unixTerminal = __commonJS({
1013
1013
  Object.defineProperty(exports2, "__esModule", { value: true });
1014
1014
  exports2.UnixTerminal = void 0;
1015
1015
  var fs9 = require("fs");
1016
- var path14 = require("path");
1016
+ var path15 = require("path");
1017
1017
  var tty = require("tty");
1018
1018
  var terminal_1 = require_terminal();
1019
1019
  var utils_1 = require_utils();
1020
1020
  var native = utils_1.loadNativeModule("pty");
1021
1021
  var pty = native.module;
1022
1022
  var helperPath = native.dir + "/spawn-helper";
1023
- helperPath = path14.resolve(__dirname, helperPath);
1023
+ helperPath = path15.resolve(__dirname, helperPath);
1024
1024
  helperPath = helperPath.replace("app.asar", "app.asar.unpacked");
1025
1025
  helperPath = helperPath.replace("node_modules.asar", "node_modules.asar.unpacked");
1026
1026
  var DEFAULT_FILE = "sh";
@@ -1392,7 +1392,7 @@ var require_src = __commonJS({
1392
1392
  // src/commands/start.ts
1393
1393
  var fs7 = __toESM(require("fs"));
1394
1394
  var os6 = __toESM(require("os"));
1395
- var path8 = __toESM(require("path"));
1395
+ var path9 = __toESM(require("path"));
1396
1396
  var import_crypto = require("crypto");
1397
1397
  var import_child_process5 = require("child_process");
1398
1398
  var import_picocolors2 = __toESM(require("picocolors"));
@@ -1482,7 +1482,7 @@ var import_qrcode_terminal = __toESM(require("qrcode-terminal"));
1482
1482
  // package.json
1483
1483
  var package_default = {
1484
1484
  name: "codeam-cli",
1485
- version: "2.4.30",
1485
+ version: "2.4.31",
1486
1486
  description: "Remote control Claude Code (and other AI coding agents) from your mobile phone. Pair your device, send prompts, stream responses in real-time, and approve commands \u2014 from anywhere.",
1487
1487
  main: "dist/index.js",
1488
1488
  bin: {
@@ -1495,7 +1495,7 @@ var package_default = {
1495
1495
  "LICENSE"
1496
1496
  ],
1497
1497
  scripts: {
1498
- build: "tsup",
1498
+ build: "tsup && node scripts/vendor-node-pty.js",
1499
1499
  dev: "tsup --watch",
1500
1500
  test: "vitest run",
1501
1501
  typecheck: "tsc --noEmit",
@@ -1556,14 +1556,12 @@ var package_default = {
1556
1556
  ws: "^8.18.0",
1557
1557
  zod: "^4.3.6"
1558
1558
  },
1559
- optionalDependencies: {
1560
- "node-pty": "^1.1.0"
1561
- },
1562
1559
  devDependencies: {
1563
1560
  "@codeagent/shared": "*",
1564
1561
  "@types/node": "^22.0.0",
1565
1562
  "@types/qrcode-terminal": "^0.12.0",
1566
1563
  "@types/ws": "^8.5.0",
1564
+ "node-pty": "^1.1.0",
1567
1565
  tsup: "^8.0.0",
1568
1566
  typescript: "^6.0.3",
1569
1567
  vitest: "^4.1.5"
@@ -2262,11 +2260,18 @@ var WindowsPtyStrategy = class {
2262
2260
  };
2263
2261
 
2264
2262
  // src/services/pty/windows-conpty.strategy.ts
2263
+ var path4 = __toESM(require("path"));
2265
2264
  function loadNodePty() {
2265
+ const vendoredPath = path4.join(__dirname, "vendor", "node-pty");
2266
2266
  try {
2267
- return require_lib();
2268
- } catch {
2269
- return null;
2267
+ return require(vendoredPath);
2268
+ } catch (vendorErr) {
2269
+ try {
2270
+ return require_lib();
2271
+ } catch {
2272
+ void vendorErr;
2273
+ return null;
2274
+ }
2270
2275
  }
2271
2276
  }
2272
2277
  var WindowsConPtyStrategy = class _WindowsConPtyStrategy {
@@ -2355,7 +2360,7 @@ var WindowsConPtyStrategy = class _WindowsConPtyStrategy {
2355
2360
 
2356
2361
  // src/services/claude-installer.ts
2357
2362
  var import_child_process3 = require("child_process");
2358
- var path4 = __toESM(require("path"));
2363
+ var path5 = __toESM(require("path"));
2359
2364
  var os4 = __toESM(require("os"));
2360
2365
 
2361
2366
  // ../../node_modules/@clack/prompts/dist/index.mjs
@@ -4273,14 +4278,14 @@ function probeInstallDirs() {
4273
4278
  const home = os4.homedir();
4274
4279
  if (process.platform === "win32") {
4275
4280
  return [
4276
- path4.join(home, ".claude", "local"),
4277
- path4.join(home, "AppData", "Local", "AnthropicClaude"),
4278
- path4.join(home, "AppData", "Local", "Programs", "AnthropicClaude")
4281
+ path5.join(home, ".claude", "local"),
4282
+ path5.join(home, "AppData", "Local", "AnthropicClaude"),
4283
+ path5.join(home, "AppData", "Local", "Programs", "AnthropicClaude")
4279
4284
  ];
4280
4285
  }
4281
4286
  return [
4282
- path4.join(home, ".local", "bin"),
4283
- path4.join(home, ".claude", "local"),
4287
+ path5.join(home, ".local", "bin"),
4288
+ path5.join(home, ".claude", "local"),
4284
4289
  "/usr/local/bin"
4285
4290
  ];
4286
4291
  }
@@ -4289,7 +4294,7 @@ function isAvailable() {
4289
4294
  }
4290
4295
  function augmentPath() {
4291
4296
  const dirs = probeInstallDirs();
4292
- const sep2 = path4.delimiter;
4297
+ const sep2 = path5.delimiter;
4293
4298
  const current = process.env.PATH ?? "";
4294
4299
  const existing = new Set(current.split(sep2).filter(Boolean));
4295
4300
  const additions = dirs.filter((d3) => !existing.has(d3));
@@ -5170,7 +5175,7 @@ function _sendOutputChunk(url, headers, payload) {
5170
5175
 
5171
5176
  // src/services/history.service.ts
5172
5177
  var fs4 = __toESM(require("fs"));
5173
- var path5 = __toESM(require("path"));
5178
+ var path6 = __toESM(require("path"));
5174
5179
  var os5 = __toESM(require("os"));
5175
5180
  var https3 = __toESM(require("https"));
5176
5181
  var http3 = __toESM(require("http"));
@@ -5326,7 +5331,7 @@ var HistoryService = class {
5326
5331
  return this._quotaPercent === null || Date.now() - this._quotaFetchedAt > ttlMs;
5327
5332
  }
5328
5333
  get projectDir() {
5329
- return path5.join(os5.homedir(), ".claude", "projects", encodeCwd(this.cwd));
5334
+ return path6.join(os5.homedir(), ".claude", "projects", encodeCwd(this.cwd));
5330
5335
  }
5331
5336
  /** Set the current Claude conversation ID (extracted from /cost command or session start) */
5332
5337
  setCurrentConversationId(id) {
@@ -5338,7 +5343,7 @@ var HistoryService = class {
5338
5343
  /** Return the current message count in the active conversation. */
5339
5344
  getCurrentMessageCount() {
5340
5345
  if (!this.currentConversationId) return 0;
5341
- const filePath = path5.join(this.projectDir, `${this.currentConversationId}.jsonl`);
5346
+ const filePath = path6.join(this.projectDir, `${this.currentConversationId}.jsonl`);
5342
5347
  return parseJsonl(filePath).length;
5343
5348
  }
5344
5349
  /**
@@ -5349,7 +5354,7 @@ var HistoryService = class {
5349
5354
  const deadline = Date.now() + timeoutMs;
5350
5355
  while (Date.now() < deadline) {
5351
5356
  if (!this.currentConversationId) return null;
5352
- const filePath = path5.join(this.projectDir, `${this.currentConversationId}.jsonl`);
5357
+ const filePath = path6.join(this.projectDir, `${this.currentConversationId}.jsonl`);
5353
5358
  const messages = parseJsonl(filePath);
5354
5359
  if (messages.length > previousCount) {
5355
5360
  for (let i = messages.length - 1; i >= previousCount; i--) {
@@ -5366,13 +5371,13 @@ var HistoryService = class {
5366
5371
  try {
5367
5372
  const files = fs4.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isFile() && e.name.endsWith(".jsonl")).map((e) => {
5368
5373
  try {
5369
- return { name: e.name, mtime: fs4.statSync(path5.join(dir, e.name)).mtimeMs };
5374
+ return { name: e.name, mtime: fs4.statSync(path6.join(dir, e.name)).mtimeMs };
5370
5375
  } catch {
5371
5376
  return { name: e.name, mtime: 0 };
5372
5377
  }
5373
5378
  }).sort((a, b) => b.mtime - a.mtime);
5374
5379
  if (files.length > 0) {
5375
- this.currentConversationId = path5.basename(files[0].name, ".jsonl");
5380
+ this.currentConversationId = path6.basename(files[0].name, ".jsonl");
5376
5381
  }
5377
5382
  } catch {
5378
5383
  }
@@ -5410,7 +5415,7 @@ var HistoryService = class {
5410
5415
  }
5411
5416
  const files = entries.filter((e) => e.isFile() && e.name.endsWith(".jsonl")).map((e) => {
5412
5417
  try {
5413
- return { name: e.name, mtime: fs4.statSync(path5.join(dir, e.name)).mtimeMs };
5418
+ return { name: e.name, mtime: fs4.statSync(path6.join(dir, e.name)).mtimeMs };
5414
5419
  } catch {
5415
5420
  return { name: e.name, mtime: 0 };
5416
5421
  }
@@ -5418,7 +5423,7 @@ var HistoryService = class {
5418
5423
  if (files.length === 0) return null;
5419
5424
  const targetFile = this.currentConversationId ? `${this.currentConversationId}.jsonl` : files[0].name;
5420
5425
  if (!files.some((f) => f.name === targetFile)) return null;
5421
- return this.extractUsageFromFile(path5.join(dir, targetFile));
5426
+ return this.extractUsageFromFile(path6.join(dir, targetFile));
5422
5427
  }
5423
5428
  extractUsageFromFile(filePath) {
5424
5429
  let raw;
@@ -5470,7 +5475,7 @@ var HistoryService = class {
5470
5475
  try {
5471
5476
  files = fs4.readdirSync(projectDir).filter((f) => f.endsWith(".jsonl")).filter((f) => {
5472
5477
  try {
5473
- return fs4.statSync(path5.join(projectDir, f)).mtimeMs >= monthStartMs;
5478
+ return fs4.statSync(path6.join(projectDir, f)).mtimeMs >= monthStartMs;
5474
5479
  } catch {
5475
5480
  return false;
5476
5481
  }
@@ -5481,7 +5486,7 @@ var HistoryService = class {
5481
5486
  for (const file of files) {
5482
5487
  let raw;
5483
5488
  try {
5484
- raw = fs4.readFileSync(path5.join(projectDir, file), "utf8");
5489
+ raw = fs4.readFileSync(path6.join(projectDir, file), "utf8");
5485
5490
  } catch {
5486
5491
  continue;
5487
5492
  }
@@ -5523,8 +5528,8 @@ var HistoryService = class {
5523
5528
  const sessions2 = [];
5524
5529
  for (const entry of entries) {
5525
5530
  if (!entry.isFile() || !entry.name.endsWith(".jsonl")) continue;
5526
- const id = path5.basename(entry.name, ".jsonl");
5527
- const filePath = path5.join(dir, entry.name);
5531
+ const id = path6.basename(entry.name, ".jsonl");
5532
+ const filePath = path6.join(dir, entry.name);
5528
5533
  let mtime = Date.now();
5529
5534
  try {
5530
5535
  mtime = fs4.statSync(filePath).mtimeMs;
@@ -5565,7 +5570,7 @@ var HistoryService = class {
5565
5570
  * showing an empty conversation.
5566
5571
  */
5567
5572
  async loadConversation(sessionId) {
5568
- const filePath = path5.join(this.projectDir, `${sessionId}.jsonl`);
5573
+ const filePath = path6.join(this.projectDir, `${sessionId}.jsonl`);
5569
5574
  const messages = parseJsonl(filePath);
5570
5575
  if (messages.length === 0) return;
5571
5576
  const totalBatches = Math.ceil(messages.length / CONVERSATION_BATCH_SIZE);
@@ -5621,7 +5626,7 @@ function parsePayload(schema, raw) {
5621
5626
 
5622
5627
  // src/services/file-ops.service.ts
5623
5628
  var fs5 = __toESM(require("fs/promises"));
5624
- var path6 = __toESM(require("path"));
5629
+ var path7 = __toESM(require("path"));
5625
5630
  var MAX_FILE_BYTES = 5 * 1024 * 1024;
5626
5631
  var MAX_WALK_DEPTH = 6;
5627
5632
  var MAX_VISITED_DIRS = 5e3;
@@ -5656,8 +5661,8 @@ var SUBDIR_IGNORE = /* @__PURE__ */ new Set([
5656
5661
  "__pycache__"
5657
5662
  ]);
5658
5663
  function isUnder(parent, candidate) {
5659
- const rel = path6.relative(parent, candidate);
5660
- return rel === "" || !rel.startsWith("..") && !path6.isAbsolute(rel);
5664
+ const rel = path7.relative(parent, candidate);
5665
+ return rel === "" || !rel.startsWith("..") && !path7.isAbsolute(rel);
5661
5666
  }
5662
5667
  async function isExistingFile(absPath) {
5663
5668
  try {
@@ -5680,7 +5685,7 @@ async function walkForSuffix(dir, needleVariants, depth, ctx) {
5680
5685
  }
5681
5686
  for (const e of entries) {
5682
5687
  if (!e.isFile()) continue;
5683
- const full = path6.join(dir, e.name);
5688
+ const full = path7.join(dir, e.name);
5684
5689
  if (needleVariants.some((needle) => full.endsWith(needle))) {
5685
5690
  ctx.matches.push(full);
5686
5691
  if (ctx.matches.length >= ctx.cap) return;
@@ -5690,21 +5695,21 @@ async function walkForSuffix(dir, needleVariants, depth, ctx) {
5690
5695
  if (!e.isDirectory()) continue;
5691
5696
  if (SUBDIR_IGNORE.has(e.name)) continue;
5692
5697
  if (e.name.startsWith(".") && SUBDIR_IGNORE.has(e.name)) continue;
5693
- await walkForSuffix(path6.join(dir, e.name), needleVariants, depth + 1, ctx);
5698
+ await walkForSuffix(path7.join(dir, e.name), needleVariants, depth + 1, ctx);
5694
5699
  if (ctx.matches.length >= ctx.cap) return;
5695
5700
  }
5696
5701
  }
5697
5702
  async function findFile(rawPath) {
5698
5703
  const cwd = process.cwd();
5699
- if (path6.isAbsolute(rawPath)) {
5700
- const abs = path6.normalize(rawPath);
5704
+ if (path7.isAbsolute(rawPath)) {
5705
+ const abs = path7.normalize(rawPath);
5701
5706
  if (isUnder(cwd, abs) && await isExistingFile(abs)) return abs;
5702
5707
  }
5703
- const direct = path6.resolve(cwd, rawPath);
5708
+ const direct = path7.resolve(cwd, rawPath);
5704
5709
  if (isUnder(cwd, direct) && await isExistingFile(direct)) return direct;
5705
- const normalized = path6.normalize(rawPath).replace(/^[./\\]+/, "");
5710
+ const normalized = path7.normalize(rawPath).replace(/^[./\\]+/, "");
5706
5711
  const needles = [
5707
- `${path6.sep}${normalized}`,
5712
+ `${path7.sep}${normalized}`,
5708
5713
  `/${normalized}`
5709
5714
  ].filter((v, i, a) => a.indexOf(v) === i);
5710
5715
  const ctx = { visited: 0, matches: [], cap: 16 };
@@ -5718,7 +5723,7 @@ async function findWriteTarget(rawPath) {
5718
5723
  const found = await findFile(rawPath);
5719
5724
  if (found) return found;
5720
5725
  const cwd = process.cwd();
5721
- const fallback = path6.isAbsolute(rawPath) ? path6.normalize(rawPath) : path6.resolve(cwd, rawPath);
5726
+ const fallback = path7.isAbsolute(rawPath) ? path7.normalize(rawPath) : path7.resolve(cwd, rawPath);
5722
5727
  if (!isUnder(cwd, fallback)) return null;
5723
5728
  return fallback;
5724
5729
  }
@@ -5758,7 +5763,7 @@ async function writeProjectFile(rawPath, content) {
5758
5763
  if (Buffer.byteLength(content, "utf-8") > MAX_FILE_BYTES) {
5759
5764
  return { error: "Content too large." };
5760
5765
  }
5761
- await fs5.mkdir(path6.dirname(abs), { recursive: true });
5766
+ await fs5.mkdir(path7.dirname(abs), { recursive: true });
5762
5767
  await fs5.writeFile(abs, content, "utf-8");
5763
5768
  return { ok: true };
5764
5769
  } catch (e) {
@@ -5771,7 +5776,7 @@ async function writeProjectFile(rawPath, content) {
5771
5776
  var import_child_process4 = require("child_process");
5772
5777
  var import_util = require("util");
5773
5778
  var fs6 = __toESM(require("fs/promises"));
5774
- var path7 = __toESM(require("path"));
5779
+ var path8 = __toESM(require("path"));
5775
5780
  var execFileP = (0, import_util.promisify)(import_child_process4.execFile);
5776
5781
  var PROJECT_IGNORE = /* @__PURE__ */ new Set([
5777
5782
  "node_modules",
@@ -5829,12 +5834,12 @@ async function listProjectFiles(opts = {}) {
5829
5834
  return;
5830
5835
  }
5831
5836
  if (PROJECT_IGNORE.has(e.name)) continue;
5832
- const full = path7.join(dir, e.name);
5837
+ const full = path8.join(dir, e.name);
5833
5838
  if (e.isDirectory()) {
5834
5839
  if (depth >= 12) continue;
5835
5840
  await walk(full, depth + 1);
5836
5841
  } else if (e.isFile()) {
5837
- const rel = path7.relative(root, full);
5842
+ const rel = path8.relative(root, full);
5838
5843
  if (q2 && !rel.toLowerCase().includes(q2) && !e.name.toLowerCase().includes(q2)) {
5839
5844
  continue;
5840
5845
  }
@@ -5942,7 +5947,7 @@ async function gitStatus(cwd) {
5942
5947
  let hasMergeInProgress = false;
5943
5948
  try {
5944
5949
  const gitDir = (await git(["rev-parse", "--git-dir"], root)).stdout.trim();
5945
- const mergeHead = path7.isAbsolute(gitDir) ? path7.join(gitDir, "MERGE_HEAD") : path7.join(root, gitDir, "MERGE_HEAD");
5950
+ const mergeHead = path8.isAbsolute(gitDir) ? path8.join(gitDir, "MERGE_HEAD") : path8.join(root, gitDir, "MERGE_HEAD");
5946
5951
  await fs6.access(mergeHead);
5947
5952
  hasMergeInProgress = true;
5948
5953
  } catch {
@@ -6020,7 +6025,7 @@ async function gitResolve(file, side, cwd) {
6020
6025
  function saveFilesTemp(files) {
6021
6026
  return files.filter(({ base64 }) => base64 && base64.length > 0).map(({ filename, base64 }) => {
6022
6027
  const safeName = filename.replace(/[^a-zA-Z0-9._-]/g, "_").slice(0, 80);
6023
- const tmpPath = path8.join(os6.tmpdir(), `codeam-${(0, import_crypto.randomUUID)()}-${safeName}`);
6028
+ const tmpPath = path9.join(os6.tmpdir(), `codeam-${(0, import_crypto.randomUUID)()}-${safeName}`);
6024
6029
  fs7.writeFileSync(tmpPath, Buffer.from(base64, "base64"));
6025
6030
  return tmpPath;
6026
6031
  });
@@ -6094,7 +6099,7 @@ try:
6094
6099
  sys.exit((st>>8)&0xFF)
6095
6100
  except Exception:sys.exit(0)
6096
6101
  `;
6097
- const helperPath = path8.join(os6.tmpdir(), "codeam-quota-helper.py");
6102
+ const helperPath = path9.join(os6.tmpdir(), "codeam-quota-helper.py");
6098
6103
  fs7.writeFileSync(helperPath, helperScript, { mode: 420 });
6099
6104
  const python = findInPath("python3") ?? findInPath("python");
6100
6105
  if (!python) {
@@ -6697,7 +6702,7 @@ async function logout() {
6697
6702
  var import_child_process10 = require("child_process");
6698
6703
  var fs8 = __toESM(require("fs"));
6699
6704
  var os7 = __toESM(require("os"));
6700
- var path13 = __toESM(require("path"));
6705
+ var path14 = __toESM(require("path"));
6701
6706
  var import_util6 = require("util");
6702
6707
  var import_picocolors9 = __toESM(require("picocolors"));
6703
6708
 
@@ -6705,7 +6710,7 @@ var import_picocolors9 = __toESM(require("picocolors"));
6705
6710
  var import_child_process6 = require("child_process");
6706
6711
  var import_util2 = require("util");
6707
6712
  var import_picocolors7 = __toESM(require("picocolors"));
6708
- var path9 = __toESM(require("path"));
6713
+ var path10 = __toESM(require("path"));
6709
6714
  var execFileP2 = (0, import_util2.promisify)(import_child_process6.execFile);
6710
6715
  var MAX_BUFFER = 8 * 1024 * 1024;
6711
6716
  function resetStdinForChild() {
@@ -7194,7 +7199,7 @@ var GitHubCodespacesProvider = class {
7194
7199
  });
7195
7200
  }
7196
7201
  async uploadFile(workspaceId, remotePath, contents, options = {}) {
7197
- const remoteDir = path9.posix.dirname(remotePath);
7202
+ const remoteDir = path10.posix.dirname(remotePath);
7198
7203
  const parts = [
7199
7204
  `mkdir -p ${shellQuote(remoteDir)}`,
7200
7205
  `cat > ${shellQuote(remotePath)}`
@@ -7264,7 +7269,7 @@ function shellQuote(s) {
7264
7269
  // src/services/providers/gitpod.ts
7265
7270
  var import_child_process7 = require("child_process");
7266
7271
  var import_util3 = require("util");
7267
- var path10 = __toESM(require("path"));
7272
+ var path11 = __toESM(require("path"));
7268
7273
  var import_picocolors8 = __toESM(require("picocolors"));
7269
7274
  var execFileP3 = (0, import_util3.promisify)(import_child_process7.execFile);
7270
7275
  var MAX_BUFFER2 = 8 * 1024 * 1024;
@@ -7504,7 +7509,7 @@ var GitpodProvider = class {
7504
7509
  });
7505
7510
  }
7506
7511
  async uploadFile(workspaceId, remotePath, contents, options = {}) {
7507
- const remoteDir = path10.posix.dirname(remotePath);
7512
+ const remoteDir = path11.posix.dirname(remotePath);
7508
7513
  const parts = [
7509
7514
  `mkdir -p ${shellQuote2(remoteDir)}`,
7510
7515
  `cat > ${shellQuote2(remotePath)}`
@@ -7540,7 +7545,7 @@ function shellQuote2(s) {
7540
7545
  // src/services/providers/gitlab-workspaces.ts
7541
7546
  var import_child_process8 = require("child_process");
7542
7547
  var import_util4 = require("util");
7543
- var path11 = __toESM(require("path"));
7548
+ var path12 = __toESM(require("path"));
7544
7549
  var execFileP4 = (0, import_util4.promisify)(import_child_process8.execFile);
7545
7550
  var MAX_BUFFER3 = 8 * 1024 * 1024;
7546
7551
  var GITLAB_API_BASE = process.env.CODEAM_GITLAB_API_URL ?? "https://gitlab.com/api/v4";
@@ -7800,7 +7805,7 @@ Docs: https://docs.gitlab.com/ee/user/workspace/configuration.html`
7800
7805
  }
7801
7806
  async uploadFile(workspaceId, remotePath, contents, options = {}) {
7802
7807
  const sshHost = process.env.CODEAM_GITLAB_SSH_HOST ?? "workspaces.gitlab.com";
7803
- const remoteDir = path11.posix.dirname(remotePath);
7808
+ const remoteDir = path12.posix.dirname(remotePath);
7804
7809
  const parts = [`mkdir -p ${shellQuote3(remoteDir)}`, `cat > ${shellQuote3(remotePath)}`];
7805
7810
  if (options.mode != null) {
7806
7811
  parts.push(`chmod ${options.mode.toString(8)} ${shellQuote3(remotePath)}`);
@@ -7868,7 +7873,7 @@ function shellQuote3(s) {
7868
7873
  // src/services/providers/railway.ts
7869
7874
  var import_child_process9 = require("child_process");
7870
7875
  var import_util5 = require("util");
7871
- var path12 = __toESM(require("path"));
7876
+ var path13 = __toESM(require("path"));
7872
7877
  var execFileP5 = (0, import_util5.promisify)(import_child_process9.execFile);
7873
7878
  var MAX_BUFFER4 = 8 * 1024 * 1024;
7874
7879
  function resetStdinForChild4() {
@@ -8104,7 +8109,7 @@ var RailwayProvider = class {
8104
8109
  if (!projectId || !serviceId) {
8105
8110
  throw new Error("Invalid Railway workspace id (expected projectId/serviceId).");
8106
8111
  }
8107
- const remoteDir = path12.posix.dirname(remotePath);
8112
+ const remoteDir = path13.posix.dirname(remotePath);
8108
8113
  const parts = [`mkdir -p ${shellQuote4(remoteDir)}`, `cat > ${shellQuote4(remotePath)}`];
8109
8114
  if (options.mode != null) {
8110
8115
  parts.push(`chmod ${options.mode.toString(8)} ${shellQuote4(remotePath)}`);
@@ -8296,7 +8301,7 @@ async function deploy() {
8296
8301
  process.exit(1);
8297
8302
  }
8298
8303
  }
8299
- const localClaudeDir = path13.join(os7.homedir(), ".claude");
8304
+ const localClaudeDir = path14.join(os7.homedir(), ".claude");
8300
8305
  const localCredsKind = await detectLocalClaudeCredentials(localClaudeDir);
8301
8306
  let bridged = "none";
8302
8307
  if (localCredsKind !== "none") {
@@ -8394,7 +8399,7 @@ async function deploy() {
8394
8399
  }
8395
8400
  }
8396
8401
  if (bridged !== "none") {
8397
- const localClaudeJson = path13.join(os7.homedir(), ".claude.json");
8402
+ const localClaudeJson = path14.join(os7.homedir(), ".claude.json");
8398
8403
  if (fs8.existsSync(localClaudeJson)) {
8399
8404
  try {
8400
8405
  const contents = fs8.readFileSync(localClaudeJson);
@@ -8587,7 +8592,7 @@ async function runRemoteClaudeLogin(provider, workspaceId) {
8587
8592
  }
8588
8593
  }
8589
8594
  async function detectLocalClaudeCredentials(localClaudeDir) {
8590
- if (fs8.existsSync(path13.join(localClaudeDir, ".credentials.json"))) {
8595
+ if (fs8.existsSync(path14.join(localClaudeDir, ".credentials.json"))) {
8591
8596
  return "flat-file";
8592
8597
  }
8593
8598
  if (process.platform === "darwin") {
@@ -8620,7 +8625,7 @@ async function verifyClaudeAuth(provider, workspaceId) {
8620
8625
  }
8621
8626
  }
8622
8627
  async function bridgeClaudeCredentials(provider, workspaceId, localClaudeDir) {
8623
- const fileBased = path13.join(localClaudeDir, ".credentials.json");
8628
+ const fileBased = path14.join(localClaudeDir, ".credentials.json");
8624
8629
  if (fs8.existsSync(fileBased)) return "flat-file";
8625
8630
  if (process.platform === "darwin") {
8626
8631
  try {
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2019, Microsoft Corporation (MIT License).
4
+ *
5
+ * This module fetches the console process list for a particular PID. It must be
6
+ * called from a different process (child_process.fork) as there can only be a
7
+ * single console attached to a process.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ var utils_1 = require("./utils");
11
+ var getConsoleProcessList = utils_1.loadNativeModule('conpty_console_list').module.getConsoleProcessList;
12
+ var shellPid = parseInt(process.argv[2], 10);
13
+ var consoleProcessList = getConsoleProcessList(shellPid);
14
+ process.send({ consoleProcessList: consoleProcessList });
15
+ process.exit(0);
16
+ //# sourceMappingURL=conpty_console_list_agent.js.map
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2019, Microsoft Corporation (MIT License).
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EventEmitter2 = void 0;
7
+ var EventEmitter2 = /** @class */ (function () {
8
+ function EventEmitter2() {
9
+ this._listeners = [];
10
+ }
11
+ Object.defineProperty(EventEmitter2.prototype, "event", {
12
+ get: function () {
13
+ var _this = this;
14
+ if (!this._event) {
15
+ this._event = function (listener) {
16
+ _this._listeners.push(listener);
17
+ var disposable = {
18
+ dispose: function () {
19
+ for (var i = 0; i < _this._listeners.length; i++) {
20
+ if (_this._listeners[i] === listener) {
21
+ _this._listeners.splice(i, 1);
22
+ return;
23
+ }
24
+ }
25
+ }
26
+ };
27
+ return disposable;
28
+ };
29
+ }
30
+ return this._event;
31
+ },
32
+ enumerable: false,
33
+ configurable: true
34
+ });
35
+ EventEmitter2.prototype.fire = function (data) {
36
+ var queue = [];
37
+ for (var i = 0; i < this._listeners.length; i++) {
38
+ queue.push(this._listeners[i]);
39
+ }
40
+ for (var i = 0; i < queue.length; i++) {
41
+ queue[i].call(undefined, data);
42
+ }
43
+ };
44
+ return EventEmitter2;
45
+ }());
46
+ exports.EventEmitter2 = EventEmitter2;
47
+ //# sourceMappingURL=eventEmitter2.js.map
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2012-2015, Christopher Jeffrey, Peter Sunde (MIT License)
4
+ * Copyright (c) 2016, Daniel Imms (MIT License).
5
+ * Copyright (c) 2018, Microsoft Corporation (MIT License).
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.native = exports.open = exports.createTerminal = exports.fork = exports.spawn = void 0;
9
+ var utils_1 = require("./utils");
10
+ var terminalCtor;
11
+ if (process.platform === 'win32') {
12
+ terminalCtor = require('./windowsTerminal').WindowsTerminal;
13
+ }
14
+ else {
15
+ terminalCtor = require('./unixTerminal').UnixTerminal;
16
+ }
17
+ /**
18
+ * Forks a process as a pseudoterminal.
19
+ * @param file The file to launch.
20
+ * @param args The file's arguments as argv (string[]) or in a pre-escaped
21
+ * CommandLine format (string). Note that the CommandLine option is only
22
+ * available on Windows and is expected to be escaped properly.
23
+ * @param options The options of the terminal.
24
+ * @throws When the file passed to spawn with does not exists.
25
+ * @see CommandLineToArgvW https://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx
26
+ * @see Parsing C++ Comamnd-Line Arguments https://msdn.microsoft.com/en-us/library/17w5ykft.aspx
27
+ * @see GetCommandLine https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156.aspx
28
+ */
29
+ function spawn(file, args, opt) {
30
+ return new terminalCtor(file, args, opt);
31
+ }
32
+ exports.spawn = spawn;
33
+ /** @deprecated */
34
+ function fork(file, args, opt) {
35
+ return new terminalCtor(file, args, opt);
36
+ }
37
+ exports.fork = fork;
38
+ /** @deprecated */
39
+ function createTerminal(file, args, opt) {
40
+ return new terminalCtor(file, args, opt);
41
+ }
42
+ exports.createTerminal = createTerminal;
43
+ function open(options) {
44
+ return terminalCtor.open(options);
45
+ }
46
+ exports.open = open;
47
+ /**
48
+ * Expose the native API when not Windows, note that this is not public API and
49
+ * could be removed at any time.
50
+ */
51
+ exports.native = (process.platform !== 'win32' ? utils_1.loadNativeModule('pty').module : null);
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2016, Daniel Imms (MIT License).
4
+ * Copyright (c) 2018, Microsoft Corporation (MIT License).
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2020, Microsoft Corporation (MIT License).
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getWorkerPipeName = void 0;
7
+ function getWorkerPipeName(conoutPipeName) {
8
+ return conoutPipeName + "-worker";
9
+ }
10
+ exports.getWorkerPipeName = getWorkerPipeName;
11
+ //# sourceMappingURL=conout.js.map