conbridge-agent 0.3.0 → 0.3.2
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/README.md +1 -1
- package/conbridge-agent.cjs +184 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# conbridge-agent
|
|
2
2
|
|
|
3
|
-
ConBridge Desktop Agent 0.3.
|
|
3
|
+
ConBridge Desktop Agent 0.3.2: connects a computer or server to ConBridge so the AI apps you approve (ChatGPT,
|
|
4
4
|
Claude) can use the folders you share, or, with full access, its terminal. macOS, Linux (servers too), Raspberry Pi and
|
|
5
5
|
Windows; Node.js 22 or later.
|
|
6
6
|
|
package/conbridge-agent.cjs
CHANGED
|
@@ -29,7 +29,7 @@ __export(cli_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(cli_exports);
|
|
30
30
|
|
|
31
31
|
// <define:__CONBRIDGE_BUILD__>
|
|
32
|
-
var define_CONBRIDGE_BUILD_default = { version: "0.3.
|
|
32
|
+
var define_CONBRIDGE_BUILD_default = { version: "0.3.2", commit: "3e6c8cc1bb37", built_at: "2026-10-30T02:48:39.631Z", keychain_helper_sha256: "359d0b3f3fedc26561d0e0b27a93df624fa55c1519c120e23fae46e9f2c2dc6a", distribution: "npm" };
|
|
33
33
|
|
|
34
34
|
// dist/cli.js
|
|
35
35
|
var import_node_child_process10 = require("node:child_process");
|
|
@@ -20255,6 +20255,121 @@ var AGENT_FEATURE_MIN_VERSION = Object.freeze({
|
|
|
20255
20255
|
inventory: "0.3.0"
|
|
20256
20256
|
});
|
|
20257
20257
|
|
|
20258
|
+
// ../../packages/protocol/dist/security/types.js
|
|
20259
|
+
var SECURITY_SEVERITY_WEIGHT = Object.freeze({
|
|
20260
|
+
critical: 30,
|
|
20261
|
+
high: 15,
|
|
20262
|
+
medium: 7,
|
|
20263
|
+
low: 2,
|
|
20264
|
+
info: 0
|
|
20265
|
+
});
|
|
20266
|
+
|
|
20267
|
+
// ../../packages/protocol/dist/security/eol.js
|
|
20268
|
+
var PRODUCT_NAMES = Object.freeze({
|
|
20269
|
+
ubuntu: "Ubuntu",
|
|
20270
|
+
debian: "Debian",
|
|
20271
|
+
centos: "CentOS",
|
|
20272
|
+
alpine: "Alpine Linux",
|
|
20273
|
+
windows: "Windows",
|
|
20274
|
+
"windows-server": "Windows Server",
|
|
20275
|
+
node: "Node.js",
|
|
20276
|
+
php: "PHP",
|
|
20277
|
+
python: "Python",
|
|
20278
|
+
mysql: "MySQL",
|
|
20279
|
+
mariadb: "MariaDB",
|
|
20280
|
+
postgresql: "PostgreSQL",
|
|
20281
|
+
ruby: "Ruby"
|
|
20282
|
+
});
|
|
20283
|
+
var EOL_TABLE = Object.freeze([
|
|
20284
|
+
{ product: "ubuntu", cycle: "16.04", eol: "2021-04-30", extended: "Ubuntu Pro (ESM)" },
|
|
20285
|
+
{ product: "ubuntu", cycle: "18.04", eol: "2023-05-31", extended: "Ubuntu Pro (ESM)" },
|
|
20286
|
+
{ product: "ubuntu", cycle: "20.04", eol: "2025-05-31", extended: "Ubuntu Pro (ESM)" },
|
|
20287
|
+
{ product: "ubuntu", cycle: "23.04", eol: "2024-01-25" },
|
|
20288
|
+
{ product: "ubuntu", cycle: "23.10", eol: "2024-07-11" },
|
|
20289
|
+
{ product: "ubuntu", cycle: "24.10", eol: "2025-07-10" },
|
|
20290
|
+
{ product: "debian", cycle: "9", eol: "2020-07-06" },
|
|
20291
|
+
{ product: "debian", cycle: "10", eol: "2022-09-10" },
|
|
20292
|
+
{ product: "debian", cycle: "11", eol: "2024-08-14", extended: "Debian LTS (until 2026-08-31)" },
|
|
20293
|
+
{ product: "debian", cycle: "12", eol: "2026-06-10", extended: "Debian LTS (until 2028-06-30)" },
|
|
20294
|
+
{ product: "centos", cycle: "7", eol: "2024-06-30" },
|
|
20295
|
+
{ product: "centos", cycle: "8", eol: "2021-12-31" },
|
|
20296
|
+
{ product: "alpine", cycle: "3.17", eol: "2024-11-22" },
|
|
20297
|
+
{ product: "alpine", cycle: "3.18", eol: "2025-05-09" },
|
|
20298
|
+
{ product: "alpine", cycle: "3.19", eol: "2025-11-01" },
|
|
20299
|
+
{ product: "alpine", cycle: "3.20", eol: "2026-04-01" },
|
|
20300
|
+
{ product: "windows", cycle: "10", eol: "2025-10-14", extended: "Extended Security Updates (ESU)" },
|
|
20301
|
+
{ product: "windows-server", cycle: "2012", eol: "2023-10-10", extended: "Extended Security Updates (ESU)" },
|
|
20302
|
+
{ product: "windows-server", cycle: "2016", eol: "2027-01-12" },
|
|
20303
|
+
{ product: "node", cycle: "14", eol: "2023-04-30" },
|
|
20304
|
+
{ product: "node", cycle: "16", eol: "2023-09-11" },
|
|
20305
|
+
{ product: "node", cycle: "17", eol: "2022-06-01" },
|
|
20306
|
+
{ product: "node", cycle: "18", eol: "2025-04-30" },
|
|
20307
|
+
{ product: "node", cycle: "19", eol: "2023-06-01" },
|
|
20308
|
+
{ product: "node", cycle: "20", eol: "2026-04-30" },
|
|
20309
|
+
{ product: "node", cycle: "21", eol: "2024-06-01" },
|
|
20310
|
+
{ product: "node", cycle: "22", eol: "2027-04-30" },
|
|
20311
|
+
{ product: "node", cycle: "23", eol: "2025-06-01" },
|
|
20312
|
+
{ product: "php", cycle: "7.4", eol: "2022-11-28" },
|
|
20313
|
+
{ product: "php", cycle: "8.0", eol: "2023-11-26" },
|
|
20314
|
+
{ product: "php", cycle: "8.1", eol: "2025-12-31" },
|
|
20315
|
+
{ product: "php", cycle: "8.2", eol: "2026-12-31" },
|
|
20316
|
+
{ product: "php", cycle: "8.3", eol: "2027-12-31" },
|
|
20317
|
+
{ product: "python", cycle: "3.7", eol: "2023-06-27" },
|
|
20318
|
+
{ product: "python", cycle: "3.8", eol: "2024-10-07" },
|
|
20319
|
+
{ product: "python", cycle: "3.9", eol: "2025-10-31" },
|
|
20320
|
+
{ product: "python", cycle: "3.10", eol: "2026-10-31" },
|
|
20321
|
+
{ product: "python", cycle: "3.11", eol: "2027-10-31" },
|
|
20322
|
+
{ product: "mysql", cycle: "5.7", eol: "2023-10-21" },
|
|
20323
|
+
{ product: "mysql", cycle: "8.0", eol: "2026-04-30" },
|
|
20324
|
+
{ product: "mariadb", cycle: "10.4", eol: "2024-06-18" },
|
|
20325
|
+
{ product: "mariadb", cycle: "10.5", eol: "2025-06-24" },
|
|
20326
|
+
{ product: "mariadb", cycle: "10.6", eol: "2026-07-06" },
|
|
20327
|
+
{ product: "postgresql", cycle: "11", eol: "2023-11-09" },
|
|
20328
|
+
{ product: "postgresql", cycle: "12", eol: "2024-11-21" },
|
|
20329
|
+
{ product: "postgresql", cycle: "13", eol: "2025-11-13" },
|
|
20330
|
+
{ product: "postgresql", cycle: "14", eol: "2026-11-12" },
|
|
20331
|
+
{ product: "ruby", cycle: "3.0", eol: "2024-04-23" },
|
|
20332
|
+
{ product: "ruby", cycle: "3.1", eol: "2025-03-31" },
|
|
20333
|
+
{ product: "ruby", cycle: "3.2", eol: "2026-03-31" }
|
|
20334
|
+
]);
|
|
20335
|
+
|
|
20336
|
+
// ../../packages/protocol/dist/security/posture.js
|
|
20337
|
+
var SEVERITY_ORDER = Object.freeze({
|
|
20338
|
+
critical: 0,
|
|
20339
|
+
high: 1,
|
|
20340
|
+
medium: 2,
|
|
20341
|
+
low: 3,
|
|
20342
|
+
info: 4
|
|
20343
|
+
});
|
|
20344
|
+
var CATEGORY_ORDER = Object.freeze({
|
|
20345
|
+
access: 0,
|
|
20346
|
+
exposure: 1,
|
|
20347
|
+
lifecycle: 2,
|
|
20348
|
+
hygiene: 3,
|
|
20349
|
+
visibility: 4
|
|
20350
|
+
});
|
|
20351
|
+
var SOFTWARE_PRODUCTS = Object.freeze({
|
|
20352
|
+
node: "node",
|
|
20353
|
+
php: "php",
|
|
20354
|
+
python: "python",
|
|
20355
|
+
mysql: "mysql",
|
|
20356
|
+
mariadb: "mariadb",
|
|
20357
|
+
postgresql: "postgresql",
|
|
20358
|
+
ruby: "ruby"
|
|
20359
|
+
});
|
|
20360
|
+
var IMAGE_PRODUCTS = Object.freeze({
|
|
20361
|
+
node: "node",
|
|
20362
|
+
php: "php",
|
|
20363
|
+
python: "python",
|
|
20364
|
+
mysql: "mysql",
|
|
20365
|
+
mariadb: "mariadb",
|
|
20366
|
+
postgres: "postgresql",
|
|
20367
|
+
ruby: "ruby",
|
|
20368
|
+
ubuntu: "ubuntu",
|
|
20369
|
+
debian: "debian",
|
|
20370
|
+
alpine: "alpine"
|
|
20371
|
+
});
|
|
20372
|
+
|
|
20258
20373
|
// ../../packages/protocol/dist/http.js
|
|
20259
20374
|
var HTTP_API_VERSION = 1;
|
|
20260
20375
|
var requestIdSchema = external_exports.uuid();
|
|
@@ -21879,7 +21994,7 @@ var import_node_fs = require("node:fs");
|
|
|
21879
21994
|
var import_node_path2 = require("node:path");
|
|
21880
21995
|
var import_node_sea = require("node:sea");
|
|
21881
21996
|
var import_node_url = require("node:url");
|
|
21882
|
-
var SOURCE_VERSION = "0.3.
|
|
21997
|
+
var SOURCE_VERSION = "0.3.2";
|
|
21883
21998
|
var BUILD_INFO = typeof define_CONBRIDGE_BUILD_default === "object" && define_CONBRIDGE_BUILD_default !== null ? define_CONBRIDGE_BUILD_default : null;
|
|
21884
21999
|
var AGENT_VERSION = BUILD_INFO?.version ?? SOURCE_VERSION;
|
|
21885
22000
|
function runningAsSea() {
|
|
@@ -22685,6 +22800,7 @@ async function pairDevice(options) {
|
|
|
22685
22800
|
paired_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
22686
22801
|
key_store: options.keyStore.descriptor
|
|
22687
22802
|
};
|
|
22803
|
+
await options.onApproved?.();
|
|
22688
22804
|
await saveIdentity(options.paths, identity);
|
|
22689
22805
|
succeeded = true;
|
|
22690
22806
|
return identity;
|
|
@@ -23337,6 +23453,38 @@ async function installRuntime(stateDir, from = {}) {
|
|
|
23337
23453
|
}
|
|
23338
23454
|
return { entry, changed };
|
|
23339
23455
|
}
|
|
23456
|
+
async function snapshotRuntime(stateDir) {
|
|
23457
|
+
const dir = runtimeDir(stateDir);
|
|
23458
|
+
const backup = `${dir}.previous`;
|
|
23459
|
+
await (0, import_promises7.rm)(backup, { recursive: true, force: true });
|
|
23460
|
+
await (0, import_promises7.mkdir)(backup, { recursive: true, mode: 448 });
|
|
23461
|
+
const saved = /* @__PURE__ */ new Map();
|
|
23462
|
+
for (const name3 of [RUNTIME_ENTRY, KEYCHAIN_HELPER_NAME]) {
|
|
23463
|
+
const info = await (0, import_promises7.stat)((0, import_node_path10.join)(dir, name3)).catch(() => null);
|
|
23464
|
+
if (!info?.isFile())
|
|
23465
|
+
continue;
|
|
23466
|
+
await (0, import_promises7.copyFile)((0, import_node_path10.join)(dir, name3), (0, import_node_path10.join)(backup, name3));
|
|
23467
|
+
saved.set(name3, info.mode & 511);
|
|
23468
|
+
}
|
|
23469
|
+
const discard = () => (0, import_promises7.rm)(backup, { recursive: true, force: true });
|
|
23470
|
+
return {
|
|
23471
|
+
async restore() {
|
|
23472
|
+
await (0, import_promises7.mkdir)(dir, { recursive: true, mode: 448 });
|
|
23473
|
+
for (const name3 of [RUNTIME_ENTRY, KEYCHAIN_HELPER_NAME]) {
|
|
23474
|
+
const mode = saved.get(name3);
|
|
23475
|
+
if (mode !== void 0)
|
|
23476
|
+
await copyAtomic((0, import_node_path10.join)(backup, name3), (0, import_node_path10.join)(dir, name3), mode);
|
|
23477
|
+
else
|
|
23478
|
+
await (0, import_promises7.unlink)((0, import_node_path10.join)(dir, name3)).catch((error63) => {
|
|
23479
|
+
if (errorCode2(error63) !== "ENOENT")
|
|
23480
|
+
throw error63;
|
|
23481
|
+
});
|
|
23482
|
+
}
|
|
23483
|
+
await discard();
|
|
23484
|
+
},
|
|
23485
|
+
discard
|
|
23486
|
+
};
|
|
23487
|
+
}
|
|
23340
23488
|
async function runningFromRuntime(stateDir, entry = currentEntry()) {
|
|
23341
23489
|
const [running, installed] = await Promise.all([realpathLenient(entry), realpathLenient(runtimeEntry(stateDir))]);
|
|
23342
23490
|
return running === installed;
|
|
@@ -28107,7 +28255,6 @@ async function cmdSsh(stateDir, args, io) {
|
|
|
28107
28255
|
}
|
|
28108
28256
|
|
|
28109
28257
|
// dist/cli.js
|
|
28110
|
-
var import_promises16 = require("node:fs/promises");
|
|
28111
28258
|
var USAGE = `conbridge-agent ${AGENT_VERSION}
|
|
28112
28259
|
|
|
28113
28260
|
Usage:
|
|
@@ -28153,20 +28300,33 @@ function lockPath(paths) {
|
|
|
28153
28300
|
async function exists(path) {
|
|
28154
28301
|
return (0, import_promises15.access)(path).then(() => true, () => false);
|
|
28155
28302
|
}
|
|
28156
|
-
async function runInstalledCopy(paths, argv, io) {
|
|
28303
|
+
async function runInstalledCopy(paths, argv, io, keepsIdentity = true) {
|
|
28157
28304
|
if (!runningFromNpm() || await runningFromRuntime(paths.dir))
|
|
28158
28305
|
return null;
|
|
28159
|
-
const
|
|
28160
|
-
|
|
28306
|
+
const previous = await loadIdentity(paths).catch(() => null);
|
|
28307
|
+
const blocked = await keychainUpdateProblem(previous, (descriptor) => openKeyStore(paths, descriptor, { env: io.env }));
|
|
28308
|
+
if (blocked && keepsIdentity) {
|
|
28161
28309
|
io.err(blocked);
|
|
28162
28310
|
return 2;
|
|
28163
28311
|
}
|
|
28164
28312
|
await ensureStateDir(paths.dir);
|
|
28165
|
-
const
|
|
28166
|
-
|
|
28167
|
-
|
|
28168
|
-
|
|
28169
|
-
|
|
28313
|
+
const snapshot = blocked ? await snapshotRuntime(paths.dir) : null;
|
|
28314
|
+
let status;
|
|
28315
|
+
try {
|
|
28316
|
+
const { entry } = await installRuntime(paths.dir);
|
|
28317
|
+
const child = (0, import_node_child_process10.spawnSync)(process.execPath, [entry, ...argv], { stdio: "inherit", env: io.env });
|
|
28318
|
+
if (child.error)
|
|
28319
|
+
throw child.error;
|
|
28320
|
+
status = child.status ?? 1;
|
|
28321
|
+
} catch (error63) {
|
|
28322
|
+
await snapshot?.restore();
|
|
28323
|
+
throw error63;
|
|
28324
|
+
}
|
|
28325
|
+
if (snapshot) {
|
|
28326
|
+
const replaced = (await loadIdentity(paths).catch(() => null))?.device_uuid !== previous?.device_uuid;
|
|
28327
|
+
await (status !== 0 && !replaced ? snapshot.restore() : snapshot.discard());
|
|
28328
|
+
}
|
|
28329
|
+
return status;
|
|
28170
28330
|
}
|
|
28171
28331
|
async function keychainUpdateProblem(identity, open6) {
|
|
28172
28332
|
const descriptor = identity?.key_store;
|
|
@@ -28181,6 +28341,9 @@ async function keychainUpdateProblem(identity, open6) {
|
|
|
28181
28341
|
To move to ${AGENT_VERSION}, create a pairing code in the ConBridge Console and run: npx --yes conbridge-agent@latest pair --force --code XXXX-XXXX (then remove the old device in the Console).`;
|
|
28182
28342
|
}
|
|
28183
28343
|
}
|
|
28344
|
+
function pendingKeyPath(paths) {
|
|
28345
|
+
return `${paths.key}.pending`;
|
|
28346
|
+
}
|
|
28184
28347
|
async function newKeyStore(paths, values, env) {
|
|
28185
28348
|
const helper = await findKeychainHelper({ env });
|
|
28186
28349
|
const requested = values["key-store"] ?? (values.keychain !== void 0 ? "keychain" : void 0);
|
|
@@ -28193,7 +28356,7 @@ async function newKeyStore(paths, values, env) {
|
|
|
28193
28356
|
if (type === "file") {
|
|
28194
28357
|
if (values.keychain !== void 0)
|
|
28195
28358
|
throw new UsageError("--keychain only applies to the keychain key store");
|
|
28196
|
-
return new FileKeyStore(paths
|
|
28359
|
+
return new FileKeyStore(pendingKeyPath(paths));
|
|
28197
28360
|
}
|
|
28198
28361
|
if (values.keychain !== void 0 && !(0, import_node_path17.isAbsolute)(values.keychain))
|
|
28199
28362
|
throw new UsageError("--keychain needs an absolute path");
|
|
@@ -28226,19 +28389,15 @@ async function cmdPair(paths, args, io) {
|
|
|
28226
28389
|
});
|
|
28227
28390
|
if (!values.code)
|
|
28228
28391
|
throw new UsageError("pair needs --code (create one in the ConBridge Console under Connect)");
|
|
28229
|
-
const installed = await runInstalledCopy(paths, ["pair", ...args], io);
|
|
28392
|
+
const installed = await runInstalledCopy(paths, ["pair", ...args], io, false);
|
|
28230
28393
|
if (installed !== null)
|
|
28231
28394
|
return installed;
|
|
28232
28395
|
const gateway = values.gateway ?? DEFAULT_GATEWAY_URL;
|
|
28233
28396
|
const name3 = (values.name ?? (0, import_node_os8.hostname)()).trim().slice(0, 64) || "My computer";
|
|
28234
28397
|
const keyStore = await newKeyStore(paths, values, io.env);
|
|
28235
28398
|
const previous = await loadIdentity(paths);
|
|
28236
|
-
if (previous)
|
|
28237
|
-
|
|
28238
|
-
throw new UsageError("This agent is already paired; use --force to pair again (the old identity is discarded)");
|
|
28239
|
-
await (0, import_promises16.unlink)(paths.identity).catch(() => void 0);
|
|
28240
|
-
await discardOldKey(paths, previous, io.env);
|
|
28241
|
-
}
|
|
28399
|
+
if (previous && !values.force)
|
|
28400
|
+
throw new UsageError("This agent is already paired; use --force to pair again (the old identity is replaced once the new pairing is approved)");
|
|
28242
28401
|
await ensureStateDir(paths.dir);
|
|
28243
28402
|
io.out(`Device key store: ${keyStore.descriptor.type === "keychain" ? "macOS Keychain" : `file ${paths.key}`}`);
|
|
28244
28403
|
const identity = await pairDevice({
|
|
@@ -28250,8 +28409,14 @@ async function cmdPair(paths, args, io) {
|
|
|
28250
28409
|
onOffered: ({ fingerprint }) => {
|
|
28251
28410
|
io.out(`Offer sent. Device fingerprint: ${fingerprint}`);
|
|
28252
28411
|
io.out("Approve this device in the ConBridge Console and check that the fingerprint matches. Waiting...");
|
|
28412
|
+
},
|
|
28413
|
+
onApproved: async () => {
|
|
28414
|
+
if (keyStore.descriptor.type === "file")
|
|
28415
|
+
await (0, import_promises15.rename)(pendingKeyPath(paths), paths.key);
|
|
28253
28416
|
}
|
|
28254
28417
|
});
|
|
28418
|
+
if (previous && !(keyStore.descriptor.type === "file" && previous.key_store?.type !== "keychain"))
|
|
28419
|
+
await discardOldKey(paths, previous, io.env);
|
|
28255
28420
|
io.out(`Paired as "${identity.display_name}" (device ${identity.device_uuid}).`);
|
|
28256
28421
|
if (values["full-access"])
|
|
28257
28422
|
await cmdAccess(paths, ["full"], io);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conbridge-agent",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "ConBridge Desktop Agent: connect this computer to ConBridge so approved AI apps can use the folders you share.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://conbridge.app",
|