@autohq/cli 0.1.216 → 0.1.217
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/dist/agent-bridge.js +27 -2
- package/dist/index.js +22 -1
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -26801,7 +26801,7 @@ Object.assign(lookup, {
|
|
|
26801
26801
|
// package.json
|
|
26802
26802
|
var package_default = {
|
|
26803
26803
|
name: "@autohq/cli",
|
|
26804
|
-
version: "0.1.
|
|
26804
|
+
version: "0.1.217",
|
|
26805
26805
|
license: "SEE LICENSE IN README.md",
|
|
26806
26806
|
publishConfig: {
|
|
26807
26807
|
access: "public"
|
|
@@ -26856,6 +26856,17 @@ var package_default = {
|
|
|
26856
26856
|
var cliVersion = package_default.version;
|
|
26857
26857
|
|
|
26858
26858
|
// src/commands/agent-bridge/socket.ts
|
|
26859
|
+
var AGENT_BRIDGE_TERMINAL_AUTH_EXIT_CODE = 78;
|
|
26860
|
+
var TERMINAL_AUTH_ERROR_MESSAGES = /* @__PURE__ */ new Set([
|
|
26861
|
+
"Bridge token is invalid or expired"
|
|
26862
|
+
]);
|
|
26863
|
+
var AgentBridgeTerminalAuthError = class extends Error {
|
|
26864
|
+
exitCode = AGENT_BRIDGE_TERMINAL_AUTH_EXIT_CODE;
|
|
26865
|
+
constructor(message) {
|
|
26866
|
+
super(message);
|
|
26867
|
+
this.name = "AgentBridgeTerminalAuthError";
|
|
26868
|
+
}
|
|
26869
|
+
};
|
|
26859
26870
|
async function runAgentBridgeSocket(options) {
|
|
26860
26871
|
const socket = lookup(`${options.bridgeUrl}${RUNTIME_BRIDGE_NAMESPACE}`, {
|
|
26861
26872
|
auth: {
|
|
@@ -26882,6 +26893,13 @@ async function runAgentBridgeSocket(options) {
|
|
|
26882
26893
|
reject(error51);
|
|
26883
26894
|
return;
|
|
26884
26895
|
}
|
|
26896
|
+
if (isTerminalAuthError(error51)) {
|
|
26897
|
+
reconnectLoop.stop();
|
|
26898
|
+
handler?.shutdown?.();
|
|
26899
|
+
socket.disconnect();
|
|
26900
|
+
reject(new AgentBridgeTerminalAuthError(error51.message));
|
|
26901
|
+
return;
|
|
26902
|
+
}
|
|
26885
26903
|
options.writeOutput?.(
|
|
26886
26904
|
`agent_bridge_connect_error error=${error51.message}`
|
|
26887
26905
|
);
|
|
@@ -26976,6 +26994,9 @@ async function runAgentBridgeSocket(options) {
|
|
|
26976
26994
|
});
|
|
26977
26995
|
});
|
|
26978
26996
|
}
|
|
26997
|
+
function isTerminalAuthError(error51) {
|
|
26998
|
+
return TERMINAL_AUTH_ERROR_MESSAGES.has(error51.message);
|
|
26999
|
+
}
|
|
26979
27000
|
function createSessiontimeBridgeBootstrapListener(input) {
|
|
26980
27001
|
return async (rawEnvelope, ack) => {
|
|
26981
27002
|
const bootstrapStartedAt = Date.now();
|
|
@@ -48171,9 +48192,13 @@ function runAgentBridgeEntrypoint(input) {
|
|
|
48171
48192
|
`${err instanceof Error ? err.message : String(err)}
|
|
48172
48193
|
`
|
|
48173
48194
|
);
|
|
48174
|
-
process.exit(
|
|
48195
|
+
process.exit(exitCodeForError(err));
|
|
48175
48196
|
});
|
|
48176
48197
|
}
|
|
48198
|
+
function exitCodeForError(error51) {
|
|
48199
|
+
const exitCode = typeof error51 === "object" && error51 !== null && "exitCode" in error51 && typeof error51.exitCode === "number" ? error51.exitCode : void 0;
|
|
48200
|
+
return exitCode ?? 1;
|
|
48201
|
+
}
|
|
48177
48202
|
runAgentBridgeEntrypoint({
|
|
48178
48203
|
moduleUrl: import.meta.url,
|
|
48179
48204
|
argv: process.argv,
|
package/dist/index.js
CHANGED
|
@@ -21829,7 +21829,7 @@ var init_package = __esm({
|
|
|
21829
21829
|
"package.json"() {
|
|
21830
21830
|
package_default = {
|
|
21831
21831
|
name: "@autohq/cli",
|
|
21832
|
-
version: "0.1.
|
|
21832
|
+
version: "0.1.217",
|
|
21833
21833
|
license: "SEE LICENSE IN README.md",
|
|
21834
21834
|
publishConfig: {
|
|
21835
21835
|
access: "public"
|
|
@@ -31538,6 +31538,17 @@ function bootstrapAdditionalData(input) {
|
|
|
31538
31538
|
// src/commands/agent-bridge/socket.ts
|
|
31539
31539
|
init_version();
|
|
31540
31540
|
import { io } from "socket.io-client";
|
|
31541
|
+
var AGENT_BRIDGE_TERMINAL_AUTH_EXIT_CODE = 78;
|
|
31542
|
+
var TERMINAL_AUTH_ERROR_MESSAGES = /* @__PURE__ */ new Set([
|
|
31543
|
+
"Bridge token is invalid or expired"
|
|
31544
|
+
]);
|
|
31545
|
+
var AgentBridgeTerminalAuthError = class extends Error {
|
|
31546
|
+
exitCode = AGENT_BRIDGE_TERMINAL_AUTH_EXIT_CODE;
|
|
31547
|
+
constructor(message) {
|
|
31548
|
+
super(message);
|
|
31549
|
+
this.name = "AgentBridgeTerminalAuthError";
|
|
31550
|
+
}
|
|
31551
|
+
};
|
|
31541
31552
|
async function runAgentBridgeSocket(options) {
|
|
31542
31553
|
const socket = io(`${options.bridgeUrl}${RUNTIME_BRIDGE_NAMESPACE}`, {
|
|
31543
31554
|
auth: {
|
|
@@ -31564,6 +31575,13 @@ async function runAgentBridgeSocket(options) {
|
|
|
31564
31575
|
reject(error51);
|
|
31565
31576
|
return;
|
|
31566
31577
|
}
|
|
31578
|
+
if (isTerminalAuthError(error51)) {
|
|
31579
|
+
reconnectLoop.stop();
|
|
31580
|
+
handler?.shutdown?.();
|
|
31581
|
+
socket.disconnect();
|
|
31582
|
+
reject(new AgentBridgeTerminalAuthError(error51.message));
|
|
31583
|
+
return;
|
|
31584
|
+
}
|
|
31567
31585
|
options.writeOutput?.(
|
|
31568
31586
|
`agent_bridge_connect_error error=${error51.message}`
|
|
31569
31587
|
);
|
|
@@ -31658,6 +31676,9 @@ async function runAgentBridgeSocket(options) {
|
|
|
31658
31676
|
});
|
|
31659
31677
|
});
|
|
31660
31678
|
}
|
|
31679
|
+
function isTerminalAuthError(error51) {
|
|
31680
|
+
return TERMINAL_AUTH_ERROR_MESSAGES.has(error51.message);
|
|
31681
|
+
}
|
|
31661
31682
|
function createSessiontimeBridgeBootstrapListener(input) {
|
|
31662
31683
|
return async (rawEnvelope, ack) => {
|
|
31663
31684
|
const bootstrapStartedAt = Date.now();
|