@ainecto/cli 0.16.11 → 0.16.12
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/dist/bin/ainecto.js +34 -7
- package/dist/bin/ainecto.js.map +1 -1
- package/dist/bin/mcp.js +2 -2
- package/dist/term/compute.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/bin/ainecto.js
CHANGED
|
@@ -5699,9 +5699,9 @@ function legacyRoleInput(flag, envVars = process.env) {
|
|
|
5699
5699
|
|
|
5700
5700
|
// src/core/version.ts
|
|
5701
5701
|
var UNBUNDLED_VERSION = "dev";
|
|
5702
|
-
var CLI_VERSION = true ? "0.16.
|
|
5702
|
+
var CLI_VERSION = true ? "0.16.12" : UNBUNDLED_VERSION;
|
|
5703
5703
|
var CLI_BUNDLED = true;
|
|
5704
|
-
var CLI_BUILD = true ? "
|
|
5704
|
+
var CLI_BUILD = true ? "b7901ba" : void 0;
|
|
5705
5705
|
function cliVersionLabel(version, build, release2) {
|
|
5706
5706
|
return release2 || build === void 0 ? version : `${version}-dev+${build}`;
|
|
5707
5707
|
}
|
|
@@ -15979,7 +15979,11 @@ async function runToEnd(spawnImpl, command, args, options) {
|
|
|
15979
15979
|
async function detectByVersion(spawnImpl, command, options) {
|
|
15980
15980
|
const run = await runToEnd(spawnImpl, command, ["--version"], options);
|
|
15981
15981
|
if (run.spawnError || run.timedOut || run.code !== 0) {
|
|
15982
|
-
return {
|
|
15982
|
+
return {
|
|
15983
|
+
installed: false,
|
|
15984
|
+
broken: run.spawnError === "EACCES" || run.spawnError === void 0 && !run.timedOut && run.code !== null,
|
|
15985
|
+
detail: run.spawnError ?? (run.timedOut ? "timed out" : `exit ${run.code}`)
|
|
15986
|
+
};
|
|
15983
15987
|
}
|
|
15984
15988
|
return { installed: true, version: run.stdout.trim().split("\n")[0]?.trim() };
|
|
15985
15989
|
}
|
|
@@ -18640,14 +18644,18 @@ async function runPairing(input) {
|
|
|
18640
18644
|
}
|
|
18641
18645
|
};
|
|
18642
18646
|
let outcome;
|
|
18647
|
+
let failed = "error";
|
|
18643
18648
|
try {
|
|
18644
18649
|
outcome = await pairOnce();
|
|
18645
18650
|
if (cancelled && outcome.kind === "timeout") outcome = { kind: "cancelled" };
|
|
18646
18651
|
return outcome;
|
|
18652
|
+
} catch (error) {
|
|
18653
|
+
if (error instanceof Error && error.code === "PAIR_REMOVE_PENDING") failed = "remove-pending";
|
|
18654
|
+
throw error;
|
|
18647
18655
|
} finally {
|
|
18648
18656
|
clearTimeout(timer);
|
|
18649
18657
|
input.cancel?.removeEventListener("abort", onCancel);
|
|
18650
|
-
if (outcome?.kind !== "paired") await input.transport.abort(outcome?.kind ??
|
|
18658
|
+
if (outcome?.kind !== "paired") await input.transport.abort(outcome?.kind ?? failed);
|
|
18651
18659
|
}
|
|
18652
18660
|
async function pairOnce() {
|
|
18653
18661
|
const pcPublicRaw = publicRawFromJwk(input.pcKey);
|
|
@@ -22443,7 +22451,13 @@ async function checkAgents(adapters, log) {
|
|
|
22443
22451
|
(d) => ({ installed: d.installed, version: d.version, detail: d.detail })
|
|
22444
22452
|
);
|
|
22445
22453
|
if (!detected?.installed) {
|
|
22446
|
-
return {
|
|
22454
|
+
return {
|
|
22455
|
+
id: adapter.id,
|
|
22456
|
+
installed: false,
|
|
22457
|
+
...detected?.broken !== void 0 ? { broken: detected.broken } : {},
|
|
22458
|
+
ready: false,
|
|
22459
|
+
detail: detected?.detail
|
|
22460
|
+
};
|
|
22447
22461
|
}
|
|
22448
22462
|
const auth = await probe(
|
|
22449
22463
|
log,
|
|
@@ -22464,6 +22478,9 @@ async function checkAgents(adapters, log) {
|
|
|
22464
22478
|
}
|
|
22465
22479
|
function agentStartLine(check, name, billedTo) {
|
|
22466
22480
|
const reconnect = "(`ainecto stop`, then `ainecto start`)";
|
|
22481
|
+
if (!check.installed && check.broken) {
|
|
22482
|
+
return `${name} is on this PC, but it did not run${check.detail ? ` (${check.detail})` : ""} \u2014 the install may be broken. Reinstall it, then reconnect this PC ${reconnect}.`;
|
|
22483
|
+
}
|
|
22467
22484
|
if (!check.installed) {
|
|
22468
22485
|
return `${name} was not found on this PC, or did not run${check.detail ? ` (${check.detail})` : ""}. To use it from AiNecto, check that it is installed where this PC's \`ainecto\` can run it (PATH), then reconnect this PC ${reconnect}.`;
|
|
22469
22486
|
}
|
|
@@ -22476,6 +22493,7 @@ function agentStartRecords(checks, nameOf, billedTo) {
|
|
|
22476
22493
|
return checks.map((check) => ({
|
|
22477
22494
|
id: check.id,
|
|
22478
22495
|
installed: check.installed,
|
|
22496
|
+
...check.broken !== void 0 ? { broken: check.broken } : {},
|
|
22479
22497
|
ready: check.ready,
|
|
22480
22498
|
...check.auth ? { auth: check.auth } : {},
|
|
22481
22499
|
...check.version ? { version: check.version } : {},
|
|
@@ -22483,6 +22501,14 @@ function agentStartRecords(checks, nameOf, billedTo) {
|
|
|
22483
22501
|
line: agentStartLine(check, nameOf(check.id), billedTo(check.id))
|
|
22484
22502
|
}));
|
|
22485
22503
|
}
|
|
22504
|
+
function noAgentToRun(checks, nameOf) {
|
|
22505
|
+
const broken = checks.filter((check) => !check.installed && check.broken).map((check) => `${nameOf(check.id)}${check.detail ? ` (${check.detail})` : ""}`);
|
|
22506
|
+
if (broken.length === 0) {
|
|
22507
|
+
return "None of Claude Code (`claude`), Codex (`codex`) or Antigravity (`agy`) is on PATH, and terminals from the web are off on this PC. Install one and sign in, or allow terminals from the web with `ainecto remote on`, then run `ainecto` again.";
|
|
22508
|
+
}
|
|
22509
|
+
const list = broken.length === 1 ? broken[0] : `${broken.slice(0, -1).join(", ")} and ${broken.at(-1)}`;
|
|
22510
|
+
return `${list} ${broken.length === 1 ? "is" : "are"} on this PC, but did not run \u2014 the install may be broken, and terminals from the web are off on this PC. Reinstall one and sign in, or allow terminals from the web with \`ainecto remote on\`, then run \`ainecto\` again.`;
|
|
22511
|
+
}
|
|
22486
22512
|
function openAgents(checks) {
|
|
22487
22513
|
return checks.filter((check) => check.installed).map((check) => ({ id: check.id, ready: check.ready, ...check.auth ? { auth: check.auth } : {} }));
|
|
22488
22514
|
}
|
|
@@ -22706,7 +22732,8 @@ async function executeAgentServe(input) {
|
|
|
22706
22732
|
})
|
|
22707
22733
|
];
|
|
22708
22734
|
const checks = await checkAgents(all, log);
|
|
22709
|
-
const
|
|
22735
|
+
const nameOf = (id) => all.find((adapter) => adapter.id === id)?.displayName ?? id;
|
|
22736
|
+
const started = agentStartRecords(checks, nameOf, (id) => BILLED_TO[id]);
|
|
22710
22737
|
log.write({ event: "serve_start", pid: process.pid, version: CLI_VERSION_LABEL, endpoint: input.endpoint, host, agents: started });
|
|
22711
22738
|
for (const agent of started) input.io.stderr.write(`${agent.line}
|
|
22712
22739
|
`);
|
|
@@ -22714,7 +22741,7 @@ async function executeAgentServe(input) {
|
|
|
22714
22741
|
const remote = await pcRemoteSetup({ endpoint: input.endpoint, auth: input.auth, account: () => readAccount(client()), io: input.io });
|
|
22715
22742
|
const plan = pcPlan({ agents: agents.length, remoteEnabled: remote.remoteEnabled });
|
|
22716
22743
|
if (plan === "nothing") {
|
|
22717
|
-
throw new Error(
|
|
22744
|
+
throw new Error(noAgentToRun(checks, nameOf));
|
|
22718
22745
|
}
|
|
22719
22746
|
let agentBusy = () => false;
|
|
22720
22747
|
const upgrades = upgradeWatch({
|