@episoda/cli 0.2.203 → 0.2.204

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.
@@ -3051,7 +3051,7 @@ var require_package = __commonJS({
3051
3051
  "package.json"(exports2, module2) {
3052
3052
  module2.exports = {
3053
3053
  name: "@episoda/cli",
3054
- version: "0.2.203",
3054
+ version: "0.2.204",
3055
3055
  description: "CLI tool for Episoda local development workflow orchestration",
3056
3056
  main: "dist/index.js",
3057
3057
  types: "dist/index.d.ts",
@@ -12904,7 +12904,18 @@ var path30 = __toESM(require("path"));
12904
12904
  var INACTIVITY_TIMEOUT_MS3 = 30 * 60 * 1e3;
12905
12905
  var sessions = /* @__PURE__ */ new Map();
12906
12906
  async function handlePtySpawn(payload, client) {
12907
- const { moduleUid, agent_run_id, command, args, stdin, env, cwd, cols = 220, rows = 50 } = payload;
12907
+ const {
12908
+ moduleUid,
12909
+ agent_run_id,
12910
+ run_type = "one_shot",
12911
+ command,
12912
+ args,
12913
+ stdin,
12914
+ env,
12915
+ cwd,
12916
+ cols = 220,
12917
+ rows = 50
12918
+ } = payload;
12908
12919
  if (sessions.has(agent_run_id)) {
12909
12920
  console.warn(`[PTY] Session already exists for agent_run_id ${agent_run_id}, ignoring spawn`);
12910
12921
  return { success: false, error: "PTY session already exists for this agent run." };
@@ -12946,6 +12957,7 @@ async function handlePtySpawn(payload, client) {
12946
12957
  pty: proc,
12947
12958
  moduleUid,
12948
12959
  agent_run_id,
12960
+ runType: run_type,
12949
12961
  startedAt: Date.now(),
12950
12962
  lastOutputAt: Date.now(),
12951
12963
  watchdogTimer: null,
@@ -13037,6 +13049,10 @@ function handlePtyStdin(payload) {
13037
13049
  return { success: false, error: `PTY session ${agent_run_id} belongs to ${target.moduleUid}, not ${module_uid}` };
13038
13050
  }
13039
13051
  try {
13052
+ if (target.runType === "persistent" && text.trim() === "SHUTDOWN") {
13053
+ target.pty.kill();
13054
+ return { success: true };
13055
+ }
13040
13056
  target.pty.write(`${text.replace(/\n/g, "\r")}\r`);
13041
13057
  return { success: true };
13042
13058
  } catch (error) {