codeam-cli 2.6.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/index.js +108 -24
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,25 @@ 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.6.0] — 2026-05-08
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **vsc-plugin:** Replay X-Plugin-Auth-Token + delta conversation upload
|
|
12
|
+
- **jetbrains-plugin:** Full parity with CLI — auth token, missing handlers, chunk emissions
|
|
13
|
+
|
|
14
|
+
### CI
|
|
15
|
+
|
|
16
|
+
- **release:** Make verifyPlugin non-fatal so JetBrains release ships
|
|
17
|
+
|
|
18
|
+
### Chore
|
|
19
|
+
|
|
20
|
+
- **cli:** Bump source version to 2.6.0 for unified release line
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- **shared:** Selector detector locks onto trust-dialog text without a cursor
|
|
25
|
+
|
|
7
26
|
## [2.5.4] — 2026-05-07
|
|
8
27
|
|
|
9
28
|
### Fixed
|
package/dist/index.js
CHANGED
|
@@ -519,8 +519,8 @@ var require_windowsPtyAgent = __commonJS({
|
|
|
519
519
|
"use strict";
|
|
520
520
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
521
521
|
exports2.argsToCommandLine = exports2.WindowsPtyAgent = void 0;
|
|
522
|
-
var
|
|
523
|
-
var
|
|
522
|
+
var fs13 = require("fs");
|
|
523
|
+
var os12 = require("os");
|
|
524
524
|
var path19 = require("path");
|
|
525
525
|
var child_process_1 = require("child_process");
|
|
526
526
|
var net_1 = require("net");
|
|
@@ -578,7 +578,7 @@ var require_windowsPtyAgent = __commonJS({
|
|
|
578
578
|
this._outSocket.on("connect", function() {
|
|
579
579
|
_this._outSocket.emit("ready_datapipe");
|
|
580
580
|
});
|
|
581
|
-
var inSocketFD =
|
|
581
|
+
var inSocketFD = fs13.openSync(term.conin, "w");
|
|
582
582
|
this._inSocket = new net_1.Socket({
|
|
583
583
|
fd: inSocketFD,
|
|
584
584
|
readable: false,
|
|
@@ -702,7 +702,7 @@ var require_windowsPtyAgent = __commonJS({
|
|
|
702
702
|
configurable: true
|
|
703
703
|
});
|
|
704
704
|
WindowsPtyAgent2.prototype._getWindowsBuildNumber = function() {
|
|
705
|
-
var osVersion = /(\d+)\.(\d+)\.(\d+)/g.exec(
|
|
705
|
+
var osVersion = /(\d+)\.(\d+)\.(\d+)/g.exec(os12.release());
|
|
706
706
|
var buildNumber = 0;
|
|
707
707
|
if (osVersion && osVersion.length === 4) {
|
|
708
708
|
buildNumber = parseInt(osVersion[3]);
|
|
@@ -1012,7 +1012,7 @@ var require_unixTerminal = __commonJS({
|
|
|
1012
1012
|
})();
|
|
1013
1013
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1014
1014
|
exports2.UnixTerminal = void 0;
|
|
1015
|
-
var
|
|
1015
|
+
var fs13 = require("fs");
|
|
1016
1016
|
var path19 = require("path");
|
|
1017
1017
|
var tty = require("tty");
|
|
1018
1018
|
var terminal_1 = require_terminal();
|
|
@@ -1275,7 +1275,7 @@ var require_unixTerminal = __commonJS({
|
|
|
1275
1275
|
return;
|
|
1276
1276
|
}
|
|
1277
1277
|
var task = this._writeQueue[0];
|
|
1278
|
-
|
|
1278
|
+
fs13.write(this._fd, task.buffer, task.offset, function(err, written) {
|
|
1279
1279
|
if (err) {
|
|
1280
1280
|
if ("code" in err && err.code === "EAGAIN") {
|
|
1281
1281
|
_this._writeImmediate = setImmediate(function() {
|
|
@@ -1477,7 +1477,7 @@ var import_qrcode_terminal = __toESM(require("qrcode-terminal"));
|
|
|
1477
1477
|
// package.json
|
|
1478
1478
|
var package_default = {
|
|
1479
1479
|
name: "codeam-cli",
|
|
1480
|
-
version: "2.
|
|
1480
|
+
version: "2.7.0",
|
|
1481
1481
|
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.",
|
|
1482
1482
|
type: "commonjs",
|
|
1483
1483
|
main: "dist/index.js",
|
|
@@ -7001,6 +7001,88 @@ async function pair() {
|
|
|
7001
7001
|
await start();
|
|
7002
7002
|
}
|
|
7003
7003
|
|
|
7004
|
+
// src/commands/pair-auto.ts
|
|
7005
|
+
var fs10 = __toESM(require("fs"));
|
|
7006
|
+
var os9 = __toESM(require("os"));
|
|
7007
|
+
var import_crypto3 = require("crypto");
|
|
7008
|
+
var API_BASE5 = process.env.CODEAM_API_URL ?? "https://codeagent-mobile-api.vercel.app";
|
|
7009
|
+
function fail(msg) {
|
|
7010
|
+
console.error(`
|
|
7011
|
+
${msg}
|
|
7012
|
+
`);
|
|
7013
|
+
process.exit(1);
|
|
7014
|
+
}
|
|
7015
|
+
function readTokenFromArgs(args2) {
|
|
7016
|
+
const inline = args2.find((a) => a.startsWith("--token="));
|
|
7017
|
+
if (inline) {
|
|
7018
|
+
const value = inline.slice("--token=".length).trim();
|
|
7019
|
+
if (value.length > 0) return value;
|
|
7020
|
+
}
|
|
7021
|
+
const fileFlag = args2.find((a) => a.startsWith("--token-file="));
|
|
7022
|
+
if (fileFlag) {
|
|
7023
|
+
const path19 = fileFlag.slice("--token-file=".length);
|
|
7024
|
+
try {
|
|
7025
|
+
const content = fs10.readFileSync(path19, "utf8").trim();
|
|
7026
|
+
if (content.length === 0) fail(`--token-file ${path19} is empty`);
|
|
7027
|
+
try {
|
|
7028
|
+
fs10.unlinkSync(path19);
|
|
7029
|
+
} catch {
|
|
7030
|
+
}
|
|
7031
|
+
return content;
|
|
7032
|
+
} catch (err) {
|
|
7033
|
+
fail(`Could not read --token-file: ${err.message}`);
|
|
7034
|
+
}
|
|
7035
|
+
}
|
|
7036
|
+
if (process.env.CODEAM_AUTO_TOKEN) return process.env.CODEAM_AUTO_TOKEN;
|
|
7037
|
+
fail("codeam pair-auto requires --token-file=<path>, --token=<value>, or CODEAM_AUTO_TOKEN env");
|
|
7038
|
+
}
|
|
7039
|
+
async function claim(token, pluginId) {
|
|
7040
|
+
const url = `${API_BASE5}/api/pairing/claim-auto-token`;
|
|
7041
|
+
const body = {
|
|
7042
|
+
token,
|
|
7043
|
+
pluginId,
|
|
7044
|
+
ideName: "codeam-cli (codespace)",
|
|
7045
|
+
ideVersion: process.env.npm_package_version ?? "unknown",
|
|
7046
|
+
hostname: os9.hostname(),
|
|
7047
|
+
codespaceName: process.env.CODESPACE_NAME ?? ""
|
|
7048
|
+
};
|
|
7049
|
+
const res = await fetch(url, {
|
|
7050
|
+
method: "POST",
|
|
7051
|
+
headers: { "Content-Type": "application/json" },
|
|
7052
|
+
body: JSON.stringify(body)
|
|
7053
|
+
});
|
|
7054
|
+
const json = await res.json();
|
|
7055
|
+
if (!res.ok || !("success" in json) || !json.success) {
|
|
7056
|
+
const errBody = json;
|
|
7057
|
+
const code = errBody?.error?.code ?? `HTTP_${res.status}`;
|
|
7058
|
+
const msg = errBody?.error?.message ?? `Server returned ${res.status}`;
|
|
7059
|
+
fail(`Auto-pair failed (${code}): ${msg}`);
|
|
7060
|
+
}
|
|
7061
|
+
const ok = json;
|
|
7062
|
+
if (!ok.data?.sessionId) {
|
|
7063
|
+
fail("Auto-pair response missing sessionId");
|
|
7064
|
+
}
|
|
7065
|
+
return ok.data;
|
|
7066
|
+
}
|
|
7067
|
+
async function pairAuto(args2) {
|
|
7068
|
+
const token = readTokenFromArgs(args2);
|
|
7069
|
+
const pluginId = (0, import_crypto3.randomUUID)();
|
|
7070
|
+
console.log(" Claiming pairing token\u2026");
|
|
7071
|
+
const claimed = await claim(token, pluginId);
|
|
7072
|
+
addSession({
|
|
7073
|
+
id: claimed.sessionId,
|
|
7074
|
+
pluginId,
|
|
7075
|
+
userName: claimed.user.name,
|
|
7076
|
+
userEmail: claimed.user.email,
|
|
7077
|
+
plan: claimed.user.plan,
|
|
7078
|
+
pairedAt: Date.now(),
|
|
7079
|
+
pluginAuthToken: claimed.pluginAuthToken
|
|
7080
|
+
});
|
|
7081
|
+
console.log(` Paired with ${claimed.user.name} (${claimed.user.plan})`);
|
|
7082
|
+
console.log(" Starting agent loop\u2026");
|
|
7083
|
+
await start();
|
|
7084
|
+
}
|
|
7085
|
+
|
|
7004
7086
|
// src/commands/sessions.ts
|
|
7005
7087
|
var import_picocolors4 = __toESM(require("picocolors"));
|
|
7006
7088
|
async function sessions(args2) {
|
|
@@ -7102,8 +7184,8 @@ async function logout() {
|
|
|
7102
7184
|
|
|
7103
7185
|
// src/commands/deploy.ts
|
|
7104
7186
|
var import_child_process12 = require("child_process");
|
|
7105
|
-
var
|
|
7106
|
-
var
|
|
7187
|
+
var fs11 = __toESM(require("fs"));
|
|
7188
|
+
var os10 = __toESM(require("os"));
|
|
7107
7189
|
var path17 = __toESM(require("path"));
|
|
7108
7190
|
var import_util6 = require("util");
|
|
7109
7191
|
var import_picocolors9 = __toESM(require("picocolors"));
|
|
@@ -8703,7 +8785,7 @@ async function deploy() {
|
|
|
8703
8785
|
process.exit(1);
|
|
8704
8786
|
}
|
|
8705
8787
|
}
|
|
8706
|
-
const localClaudeDir = path17.join(
|
|
8788
|
+
const localClaudeDir = path17.join(os10.homedir(), ".claude");
|
|
8707
8789
|
const localCredsKind = await detectLocalClaudeCredentials(localClaudeDir);
|
|
8708
8790
|
let bridged = "none";
|
|
8709
8791
|
if (localCredsKind !== "none") {
|
|
@@ -8747,7 +8829,7 @@ async function deploy() {
|
|
|
8747
8829
|
process.exit(1);
|
|
8748
8830
|
}
|
|
8749
8831
|
claudeStep.stop("\u2713 Claude CLI installed");
|
|
8750
|
-
const haveLocalClaude =
|
|
8832
|
+
const haveLocalClaude = fs11.existsSync(localClaudeDir) && fs11.statSync(localClaudeDir).isDirectory();
|
|
8751
8833
|
if (haveLocalClaude) {
|
|
8752
8834
|
const copyStep = fe();
|
|
8753
8835
|
copyStep.start("Copying local Claude config to workspace\u2026");
|
|
@@ -8801,10 +8883,10 @@ async function deploy() {
|
|
|
8801
8883
|
}
|
|
8802
8884
|
}
|
|
8803
8885
|
if (bridged !== "none") {
|
|
8804
|
-
const localClaudeJson = path17.join(
|
|
8805
|
-
if (
|
|
8886
|
+
const localClaudeJson = path17.join(os10.homedir(), ".claude.json");
|
|
8887
|
+
if (fs11.existsSync(localClaudeJson)) {
|
|
8806
8888
|
try {
|
|
8807
|
-
const contents =
|
|
8889
|
+
const contents = fs11.readFileSync(localClaudeJson);
|
|
8808
8890
|
await provider.uploadFile(
|
|
8809
8891
|
workspace.id,
|
|
8810
8892
|
"/home/codespace/.claude.json",
|
|
@@ -8994,7 +9076,7 @@ async function runRemoteClaudeLogin(provider, workspaceId) {
|
|
|
8994
9076
|
}
|
|
8995
9077
|
}
|
|
8996
9078
|
async function detectLocalClaudeCredentials(localClaudeDir) {
|
|
8997
|
-
if (
|
|
9079
|
+
if (fs11.existsSync(path17.join(localClaudeDir, ".credentials.json"))) {
|
|
8998
9080
|
return "flat-file";
|
|
8999
9081
|
}
|
|
9000
9082
|
if (process.platform === "darwin") {
|
|
@@ -9028,7 +9110,7 @@ async function verifyClaudeAuth(provider, workspaceId) {
|
|
|
9028
9110
|
}
|
|
9029
9111
|
async function bridgeClaudeCredentials(provider, workspaceId, localClaudeDir) {
|
|
9030
9112
|
const fileBased = path17.join(localClaudeDir, ".credentials.json");
|
|
9031
|
-
if (
|
|
9113
|
+
if (fs11.existsSync(fileBased)) return "flat-file";
|
|
9032
9114
|
if (process.platform === "darwin") {
|
|
9033
9115
|
try {
|
|
9034
9116
|
const { stdout } = await execFileP6(
|
|
@@ -9236,7 +9318,7 @@ async function stopWorkspaceFromLocal(target) {
|
|
|
9236
9318
|
// src/commands/version.ts
|
|
9237
9319
|
var import_picocolors11 = __toESM(require("picocolors"));
|
|
9238
9320
|
function version() {
|
|
9239
|
-
const v = true ? "2.
|
|
9321
|
+
const v = true ? "2.7.0" : "unknown";
|
|
9240
9322
|
console.log(`${import_picocolors11.default.bold("codeam-cli")} ${import_picocolors11.default.cyan(v)}`);
|
|
9241
9323
|
}
|
|
9242
9324
|
|
|
@@ -9273,8 +9355,8 @@ function help() {
|
|
|
9273
9355
|
}
|
|
9274
9356
|
|
|
9275
9357
|
// src/lib/updateNotifier.ts
|
|
9276
|
-
var
|
|
9277
|
-
var
|
|
9358
|
+
var fs12 = __toESM(require("fs"));
|
|
9359
|
+
var os11 = __toESM(require("os"));
|
|
9278
9360
|
var path18 = __toESM(require("path"));
|
|
9279
9361
|
var https5 = __toESM(require("https"));
|
|
9280
9362
|
var import_picocolors13 = __toESM(require("picocolors"));
|
|
@@ -9283,12 +9365,12 @@ var REGISTRY_URL = `https://registry.npmjs.org/${PKG_NAME}/latest`;
|
|
|
9283
9365
|
var TTL_MS = 24 * 60 * 60 * 1e3;
|
|
9284
9366
|
var REQUEST_TIMEOUT_MS = 1500;
|
|
9285
9367
|
function cachePath() {
|
|
9286
|
-
const dir = path18.join(
|
|
9368
|
+
const dir = path18.join(os11.homedir(), ".codeam");
|
|
9287
9369
|
return path18.join(dir, "update-check.json");
|
|
9288
9370
|
}
|
|
9289
9371
|
function readCache() {
|
|
9290
9372
|
try {
|
|
9291
|
-
const raw =
|
|
9373
|
+
const raw = fs12.readFileSync(cachePath(), "utf8");
|
|
9292
9374
|
const parsed = JSON.parse(raw);
|
|
9293
9375
|
if (typeof parsed.fetchedAt !== "number" || typeof parsed.latest !== "string") return null;
|
|
9294
9376
|
return parsed;
|
|
@@ -9299,8 +9381,8 @@ function readCache() {
|
|
|
9299
9381
|
function writeCache(cache) {
|
|
9300
9382
|
try {
|
|
9301
9383
|
const file = cachePath();
|
|
9302
|
-
|
|
9303
|
-
|
|
9384
|
+
fs12.mkdirSync(path18.dirname(file), { recursive: true });
|
|
9385
|
+
fs12.writeFileSync(file, JSON.stringify(cache));
|
|
9304
9386
|
} catch {
|
|
9305
9387
|
}
|
|
9306
9388
|
}
|
|
@@ -9371,7 +9453,7 @@ function checkForUpdates() {
|
|
|
9371
9453
|
if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
|
|
9372
9454
|
if (process.env.CI) return;
|
|
9373
9455
|
if (!process.stdout.isTTY) return;
|
|
9374
|
-
const current = true ? "2.
|
|
9456
|
+
const current = true ? "2.7.0" : null;
|
|
9375
9457
|
if (!current) return;
|
|
9376
9458
|
const cache = readCache();
|
|
9377
9459
|
const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
|
|
@@ -9401,6 +9483,8 @@ async function main() {
|
|
|
9401
9483
|
return help();
|
|
9402
9484
|
case "pair":
|
|
9403
9485
|
return pair();
|
|
9486
|
+
case "pair-auto":
|
|
9487
|
+
return pairAuto(args);
|
|
9404
9488
|
case "sessions":
|
|
9405
9489
|
return sessions(args);
|
|
9406
9490
|
case "status":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeam-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"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 — from anywhere.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/index.js",
|