@evident-ai/cli 3.1.0 → 3.1.1-dev.019c4e9

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/index.js CHANGED
@@ -2076,6 +2076,18 @@ var RunnerConnection = class {
2076
2076
  }
2077
2077
  };
2078
2078
 
2079
+ // src/lib/tunnel/ready-marker.ts
2080
+ import { writeFileSync } from "fs";
2081
+ function writeTunnelReadyMarker(path, agentId) {
2082
+ try {
2083
+ writeFileSync(path, `${agentId}
2084
+ `);
2085
+ return { ok: true };
2086
+ } catch (error2) {
2087
+ return { ok: false, error: error2 instanceof Error ? error2.message : String(error2) };
2088
+ }
2089
+ }
2090
+
2079
2091
  // src/lib/channels/driver.ts
2080
2092
  import { homedir } from "os";
2081
2093
 
@@ -5150,7 +5162,7 @@ async function ensureOpenCodeRunning(ctx) {
5150
5162
  console.log(chalk5.yellow("Tip: Run with the correct port:"));
5151
5163
  console.log(
5152
5164
  chalk5.dim(
5153
- ` ${getCliName()} run --agent ${ctx.agentId} --port ${runningInstances[0].port}`
5165
+ ` ${getCliName()} run --runner ${ctx.agentId} --port ${runningInstances[0].port}`
5154
5166
  )
5155
5167
  );
5156
5168
  }
@@ -5280,7 +5292,7 @@ async function resolveAgentIdFromKey(authHeader) {
5280
5292
  return { agent_id: data.agent_id };
5281
5293
  }
5282
5294
  return {
5283
- error: "Cannot resolve runner ID: auth type is not agent_key. Please provide --agent explicitly."
5295
+ error: "Cannot resolve runner ID: auth type is not agent_key. Please provide --runner explicitly."
5284
5296
  };
5285
5297
  } catch (error2) {
5286
5298
  const message = error2 instanceof Error ? error2.message : "Unknown error";
@@ -6076,6 +6088,18 @@ async function run(options) {
6076
6088
  type: "info",
6077
6089
  message: `Tunnel ${isReconnect ? "reconnected" : "connected"} (runner: ${agentId})`
6078
6090
  });
6091
+ if (options.tunnelReadyFile) {
6092
+ const marker = writeTunnelReadyMarker(options.tunnelReadyFile, agentId);
6093
+ if (marker.ok) {
6094
+ log2(state, `Wrote tunnel readiness marker to ${options.tunnelReadyFile}`, "debug");
6095
+ } else {
6096
+ log2(
6097
+ state,
6098
+ `Failed to write tunnel readiness marker to ${options.tunnelReadyFile}: ${marker.error}`,
6099
+ "error"
6100
+ );
6101
+ }
6102
+ }
6079
6103
  emitAgentConnected(state.agentId, {
6080
6104
  port: state.port,
6081
6105
  cli_version: getCliVersion(),
@@ -6240,6 +6264,9 @@ program.command("run").description("Connect to Evident and process messages").op
6240
6264
  "Allow Evident to write files into this directory (repeatable). Omit to disable file sync entirely.",
6241
6265
  (value, previous) => previous.concat([value]),
6242
6266
  []
6267
+ ).option(
6268
+ "--tunnel-ready-file <path>",
6269
+ "Path to write once the tunnel is connected (set by the MicroVM hooks; unused on a developer machine)"
6243
6270
  ).action(
6244
6271
  (options) => {
6245
6272
  run({
@@ -6259,7 +6286,8 @@ program.command("run").description("Connect to Evident and process messages").op
6259
6286
  sessionCleanupInterval: options.sessionCleanupInterval,
6260
6287
  // Raw values — expansion/validation is single-sourced in run.ts's
6261
6288
  // resolveFileSyncDirectories.
6262
- enableFileSyncTo: options.enableFileSyncTo
6289
+ enableFileSyncTo: options.enableFileSyncTo,
6290
+ tunnelReadyFile: options.tunnelReadyFile
6263
6291
  });
6264
6292
  }
6265
6293
  );