@autohq/cli 0.1.207 → 0.1.208

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.
@@ -23016,6 +23016,24 @@ var SetupOnboardingPullRequestStatusResponseSchema = external_exports.object({
23016
23016
  ready: external_exports.boolean()
23017
23017
  });
23018
23018
 
23019
+ // ../../packages/schemas/src/runtime-log.ts
23020
+ var RUNTIME_LOG_LEVELS = ["debug", "info", "warn", "error"];
23021
+ var RuntimeLogLevelSchema = external_exports.enum(RUNTIME_LOG_LEVELS);
23022
+ var DEFAULT_RUNTIME_LOG_LEVEL = "info";
23023
+ var LEVEL_SEVERITY = {
23024
+ debug: 10,
23025
+ info: 20,
23026
+ warn: 30,
23027
+ error: 40
23028
+ };
23029
+ function parseRuntimeLogLevel(value2) {
23030
+ const parsed = RuntimeLogLevelSchema.safeParse(value2?.trim());
23031
+ return parsed.success ? parsed.data : DEFAULT_RUNTIME_LOG_LEVEL;
23032
+ }
23033
+ function runtimeLogLevelEnabled(configured, lineLevel) {
23034
+ return LEVEL_SEVERITY[lineLevel] >= LEVEL_SEVERITY[configured];
23035
+ }
23036
+
23019
23037
  // ../../packages/schemas/src/runtimes.ts
23020
23038
  var RuntimeRecordSchema = external_exports.object({
23021
23039
  id: RuntimeIdSchema2,
@@ -26676,7 +26694,7 @@ Object.assign(lookup, {
26676
26694
  // package.json
26677
26695
  var package_default = {
26678
26696
  name: "@autohq/cli",
26679
- version: "0.1.207",
26697
+ version: "0.1.208",
26680
26698
  license: "SEE LICENSE IN README.md",
26681
26699
  publishConfig: {
26682
26700
  access: "public"
@@ -47907,13 +47925,61 @@ function deliveryMode(delivery) {
47907
47925
  return "interrupt";
47908
47926
  }
47909
47927
 
47928
+ // src/commands/agent-bridge/runtime-log.ts
47929
+ var RUNTIME_LOG_COMPONENT = "runtime-cli";
47930
+ function createRuntimeLogger(env = process.env) {
47931
+ const level = parseRuntimeLogLevel(env.AUTO_RUNTIME_LOG_LEVEL);
47932
+ const emit = (lineLevel) => {
47933
+ return (message, context) => {
47934
+ if (!runtimeLogLevelEnabled(level, lineLevel)) {
47935
+ return;
47936
+ }
47937
+ writeRuntimeLogLine(lineLevel, message, context);
47938
+ };
47939
+ };
47940
+ return {
47941
+ level,
47942
+ debug: emit("debug"),
47943
+ info: emit("info"),
47944
+ warn: emit("warn"),
47945
+ error: emit("error")
47946
+ };
47947
+ }
47948
+ function writeRuntimeLogLine(level, message, context) {
47949
+ const payload = {
47950
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
47951
+ level,
47952
+ component: RUNTIME_LOG_COMPONENT,
47953
+ message,
47954
+ ...context ?? {}
47955
+ };
47956
+ process.stderr.write(`${JSON.stringify(payload, replaceErrors)}
47957
+ `);
47958
+ }
47959
+ function replaceErrors(_key, value2) {
47960
+ if (value2 instanceof Error) {
47961
+ return { name: value2.name, message: value2.message, stack: value2.stack };
47962
+ }
47963
+ return value2;
47964
+ }
47965
+
47910
47966
  // src/commands/agent-bridge/entrypoint.ts
47911
47967
  async function runAgentBridgeProcess(input) {
47912
47968
  const runAgentBridge = input.runAgentBridge ?? runAgentBridgeClaudeCode;
47913
- await runAgentBridge({
47914
- ...agentBridgeOptionsFromEnv(input),
47915
- onBootstrap: createGitCredentialRelayStarter(input.writeOutput)
47969
+ const log = createRuntimeLogger(input.env);
47970
+ log.info("agent bridge process starting", {
47971
+ bridge_url_host: bridgeUrlHost(input.env.AUTO_BRIDGE_URL),
47972
+ log_level: log.level
47916
47973
  });
47974
+ try {
47975
+ await runAgentBridge({
47976
+ ...agentBridgeOptionsFromEnv(input),
47977
+ onBootstrap: createGitCredentialRelayStarter(input.writeOutput, log)
47978
+ });
47979
+ } catch (error51) {
47980
+ log.error("agent bridge process failed", { error: error51 });
47981
+ throw error51;
47982
+ }
47917
47983
  }
47918
47984
  function agentBridgeOptionsFromEnv(input) {
47919
47985
  return {
@@ -47922,7 +47988,7 @@ function agentBridgeOptionsFromEnv(input) {
47922
47988
  writeOutput: input.writeOutput
47923
47989
  };
47924
47990
  }
47925
- function createGitCredentialRelayStarter(writeOutput) {
47991
+ function createGitCredentialRelayStarter(writeOutput, log) {
47926
47992
  let relay;
47927
47993
  let startup;
47928
47994
  return async (bootstrap) => {
@@ -47942,12 +48008,14 @@ function createGitCredentialRelayStarter(writeOutput) {
47942
48008
  startup = startGitCredentialRelay(gitCredentials).then((started) => {
47943
48009
  relay = started;
47944
48010
  writeOutput?.(`agent_bridge_git_credential_relay port=${started.port}`);
48011
+ log?.info("git credential relay started", { port: started.port });
47945
48012
  return started;
47946
48013
  }).catch((error51) => {
47947
48014
  startup = void 0;
47948
48015
  writeOutput?.(
47949
48016
  `agent_bridge_git_credential_relay_failed error=${error51 instanceof Error ? error51.message : String(error51)}`
47950
48017
  );
48018
+ log?.warn("git credential relay failed to start", { error: error51 });
47951
48019
  return void 0;
47952
48020
  });
47953
48021
  await startup;
@@ -47960,6 +48028,16 @@ function requiredEnv(env, key) {
47960
48028
  }
47961
48029
  return value2;
47962
48030
  }
48031
+ function bridgeUrlHost(bridgeUrl) {
48032
+ if (!bridgeUrl) {
48033
+ return void 0;
48034
+ }
48035
+ try {
48036
+ return new URL(bridgeUrl).host;
48037
+ } catch {
48038
+ return void 0;
48039
+ }
48040
+ }
47963
48041
 
47964
48042
  // src/lib/entrypoint.ts
47965
48043
  import { realpathSync as realpathSync2 } from "fs";
package/dist/index.js CHANGED
@@ -18932,6 +18932,31 @@ var init_setup = __esm({
18932
18932
  }
18933
18933
  });
18934
18934
 
18935
+ // ../../packages/schemas/src/runtime-log.ts
18936
+ function parseRuntimeLogLevel(value) {
18937
+ const parsed = RuntimeLogLevelSchema.safeParse(value?.trim());
18938
+ return parsed.success ? parsed.data : DEFAULT_RUNTIME_LOG_LEVEL;
18939
+ }
18940
+ function runtimeLogLevelEnabled(configured, lineLevel) {
18941
+ return LEVEL_SEVERITY[lineLevel] >= LEVEL_SEVERITY[configured];
18942
+ }
18943
+ var RUNTIME_LOG_LEVELS, RuntimeLogLevelSchema, DEFAULT_RUNTIME_LOG_LEVEL, LEVEL_SEVERITY;
18944
+ var init_runtime_log = __esm({
18945
+ "../../packages/schemas/src/runtime-log.ts"() {
18946
+ "use strict";
18947
+ init_zod();
18948
+ RUNTIME_LOG_LEVELS = ["debug", "info", "warn", "error"];
18949
+ RuntimeLogLevelSchema = external_exports.enum(RUNTIME_LOG_LEVELS);
18950
+ DEFAULT_RUNTIME_LOG_LEVEL = "info";
18951
+ LEVEL_SEVERITY = {
18952
+ debug: 10,
18953
+ info: 20,
18954
+ warn: 30,
18955
+ error: 40
18956
+ };
18957
+ }
18958
+ });
18959
+
18935
18960
  // ../../packages/schemas/src/runtimes.ts
18936
18961
  var RuntimeRecordSchema, SessionCommandDispatchWorkflowInputSchema, SessionCommandDispatchSignalPayloadSchema, RealtimeRunCursorSchema;
18937
18962
  var init_runtimes = __esm({
@@ -18999,6 +19024,7 @@ var init_src = __esm({
18999
19024
  init_secrets();
19000
19025
  init_session_commands();
19001
19026
  init_setup();
19027
+ init_runtime_log();
19002
19028
  init_runtimes();
19003
19029
  init_sessions();
19004
19030
  init_agents();
@@ -21689,7 +21715,7 @@ var init_package = __esm({
21689
21715
  "package.json"() {
21690
21716
  package_default = {
21691
21717
  name: "@autohq/cli",
21692
- version: "0.1.207",
21718
+ version: "0.1.208",
21693
21719
  license: "SEE LICENSE IN README.md",
21694
21720
  publishConfig: {
21695
21721
  access: "public"
@@ -32982,13 +33008,62 @@ function deliveryMode(delivery) {
32982
33008
  return "interrupt";
32983
33009
  }
32984
33010
 
33011
+ // src/commands/agent-bridge/runtime-log.ts
33012
+ init_src();
33013
+ var RUNTIME_LOG_COMPONENT = "runtime-cli";
33014
+ function createRuntimeLogger(env = process.env) {
33015
+ const level = parseRuntimeLogLevel(env.AUTO_RUNTIME_LOG_LEVEL);
33016
+ const emit = (lineLevel) => {
33017
+ return (message, context) => {
33018
+ if (!runtimeLogLevelEnabled(level, lineLevel)) {
33019
+ return;
33020
+ }
33021
+ writeRuntimeLogLine(lineLevel, message, context);
33022
+ };
33023
+ };
33024
+ return {
33025
+ level,
33026
+ debug: emit("debug"),
33027
+ info: emit("info"),
33028
+ warn: emit("warn"),
33029
+ error: emit("error")
33030
+ };
33031
+ }
33032
+ function writeRuntimeLogLine(level, message, context) {
33033
+ const payload = {
33034
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
33035
+ level,
33036
+ component: RUNTIME_LOG_COMPONENT,
33037
+ message,
33038
+ ...context ?? {}
33039
+ };
33040
+ process.stderr.write(`${JSON.stringify(payload, replaceErrors)}
33041
+ `);
33042
+ }
33043
+ function replaceErrors(_key, value) {
33044
+ if (value instanceof Error) {
33045
+ return { name: value.name, message: value.message, stack: value.stack };
33046
+ }
33047
+ return value;
33048
+ }
33049
+
32985
33050
  // src/commands/agent-bridge/entrypoint.ts
32986
33051
  async function runAgentBridgeProcess(input) {
32987
33052
  const runAgentBridge = input.runAgentBridge ?? runAgentBridgeClaudeCode;
32988
- await runAgentBridge({
32989
- ...agentBridgeOptionsFromEnv(input),
32990
- onBootstrap: createGitCredentialRelayStarter(input.writeOutput)
33053
+ const log = createRuntimeLogger(input.env);
33054
+ log.info("agent bridge process starting", {
33055
+ bridge_url_host: bridgeUrlHost(input.env.AUTO_BRIDGE_URL),
33056
+ log_level: log.level
32991
33057
  });
33058
+ try {
33059
+ await runAgentBridge({
33060
+ ...agentBridgeOptionsFromEnv(input),
33061
+ onBootstrap: createGitCredentialRelayStarter(input.writeOutput, log)
33062
+ });
33063
+ } catch (error51) {
33064
+ log.error("agent bridge process failed", { error: error51 });
33065
+ throw error51;
33066
+ }
32992
33067
  }
32993
33068
  function agentBridgeOptionsFromEnv(input) {
32994
33069
  return {
@@ -32997,7 +33072,7 @@ function agentBridgeOptionsFromEnv(input) {
32997
33072
  writeOutput: input.writeOutput
32998
33073
  };
32999
33074
  }
33000
- function createGitCredentialRelayStarter(writeOutput) {
33075
+ function createGitCredentialRelayStarter(writeOutput, log) {
33001
33076
  let relay;
33002
33077
  let startup;
33003
33078
  return async (bootstrap) => {
@@ -33017,12 +33092,14 @@ function createGitCredentialRelayStarter(writeOutput) {
33017
33092
  startup = startGitCredentialRelay(gitCredentials).then((started) => {
33018
33093
  relay = started;
33019
33094
  writeOutput?.(`agent_bridge_git_credential_relay port=${started.port}`);
33095
+ log?.info("git credential relay started", { port: started.port });
33020
33096
  return started;
33021
33097
  }).catch((error51) => {
33022
33098
  startup = void 0;
33023
33099
  writeOutput?.(
33024
33100
  `agent_bridge_git_credential_relay_failed error=${error51 instanceof Error ? error51.message : String(error51)}`
33025
33101
  );
33102
+ log?.warn("git credential relay failed to start", { error: error51 });
33026
33103
  return void 0;
33027
33104
  });
33028
33105
  await startup;
@@ -33035,6 +33112,16 @@ function requiredEnv(env, key) {
33035
33112
  }
33036
33113
  return value;
33037
33114
  }
33115
+ function bridgeUrlHost(bridgeUrl) {
33116
+ if (!bridgeUrl) {
33117
+ return void 0;
33118
+ }
33119
+ try {
33120
+ return new URL(bridgeUrl).host;
33121
+ } catch {
33122
+ return void 0;
33123
+ }
33124
+ }
33038
33125
 
33039
33126
  // src/commands/agent-bridge/commands.ts
33040
33127
  function registerAgentBridgeCommands(program, context) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.207",
3
+ "version": "0.1.208",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"