@episoda/cli 0.2.184 → 0.2.187

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.
@@ -3046,7 +3046,7 @@ var require_package = __commonJS({
3046
3046
  "package.json"(exports2, module2) {
3047
3047
  module2.exports = {
3048
3048
  name: "@episoda/cli",
3049
- version: "0.2.184",
3049
+ version: "0.2.187",
3050
3050
  description: "CLI tool for Episoda local development workflow orchestration",
3051
3051
  main: "dist/index.js",
3052
3052
  types: "dist/index.d.ts",
@@ -12875,7 +12875,7 @@ var pty = __toESM(require("@lydell/node-pty"));
12875
12875
  var INACTIVITY_TIMEOUT_MS3 = 30 * 60 * 1e3;
12876
12876
  var sessions = /* @__PURE__ */ new Map();
12877
12877
  async function handlePtySpawn(payload, client) {
12878
- const { moduleUid, agent_run_id, command, args, env, cwd, cols = 220, rows = 50 } = payload;
12878
+ const { moduleUid, agent_run_id, command, args, stdin, env, cwd, cols = 220, rows = 50 } = payload;
12879
12879
  if (sessions.has(agent_run_id)) {
12880
12880
  console.warn(`[PTY] Session already exists for agent_run_id ${agent_run_id}, ignoring spawn`);
12881
12881
  return;
@@ -12933,6 +12933,9 @@ async function handlePtySpawn(payload, client) {
12933
12933
  console.error(`[PTY] Failed to send pty_data for ${agent_run_id}:`, err.message);
12934
12934
  });
12935
12935
  });
12936
+ if (typeof stdin === "string" && stdin.trim().length > 0) {
12937
+ proc.write(`${stdin.replace(/\n/g, "\r")}\r`);
12938
+ }
12936
12939
  proc.onExit(({ exitCode }) => {
12937
12940
  const durationMs = Date.now() - session.startedAt;
12938
12941
  if (session.watchdogTimer) clearTimeout(session.watchdogTimer);
@@ -15012,9 +15015,19 @@ var ProjectMessageRouter = class {
15012
15015
  client.on("pty_spawn", async (message) => {
15013
15016
  if (message.type === "pty_spawn") {
15014
15017
  const payload = message.payload;
15018
+ let resolvedPayload = payload;
15019
+ if (!payload.cwd && payload.moduleUid) {
15020
+ const worktreeInfo = await getWorktreeInfoForModule(payload.moduleUid);
15021
+ if (worktreeInfo?.path) {
15022
+ resolvedPayload = {
15023
+ ...payload,
15024
+ cwd: worktreeInfo.path
15025
+ };
15026
+ }
15027
+ }
15015
15028
  console.log(`[Daemon] EP1441: Received pty_spawn for ${projectId}: ${payload.agent_run_id}`);
15016
15029
  client.updateActivity();
15017
- await handlePtySpawn(payload, client);
15030
+ await handlePtySpawn(resolvedPayload, client);
15018
15031
  }
15019
15032
  });
15020
15033
  client.on("pty_resize", (message) => {