@episoda/cli 0.2.197 → 0.2.199
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.
|
|
3049
|
+
version: "0.2.199",
|
|
3050
3050
|
description: "CLI tool for Episoda local development workflow orchestration",
|
|
3051
3051
|
main: "dist/index.js",
|
|
3052
3052
|
types: "dist/index.d.ts",
|
|
@@ -13011,11 +13011,30 @@ function handlePtyKill(payload) {
|
|
|
13011
13011
|
console.warn(`[PTY] Kill failed for ${agent_run_id}; performed fallback cleanup`);
|
|
13012
13012
|
}
|
|
13013
13013
|
}
|
|
13014
|
+
function handlePtyStdin(payload) {
|
|
13015
|
+
const { agent_run_id, module_uid, text } = payload;
|
|
13016
|
+
const target = sessions.get(agent_run_id);
|
|
13017
|
+
if (!target) {
|
|
13018
|
+
return { success: false, error: `No active PTY session found for agent_run_id ${agent_run_id}` };
|
|
13019
|
+
}
|
|
13020
|
+
if (module_uid && target.moduleUid !== module_uid) {
|
|
13021
|
+
return { success: false, error: `PTY session ${agent_run_id} belongs to ${target.moduleUid}, not ${module_uid}` };
|
|
13022
|
+
}
|
|
13023
|
+
try {
|
|
13024
|
+
target.pty.write(`${text.replace(/\n/g, "\r")}\r`);
|
|
13025
|
+
return { success: true };
|
|
13026
|
+
} catch (error) {
|
|
13027
|
+
return { success: false, error: error?.message || "Failed to write PTY stdin" };
|
|
13028
|
+
}
|
|
13029
|
+
}
|
|
13014
13030
|
function createCredentialBootstrap(payload, agentRunId) {
|
|
13015
13031
|
const bootstrap = payload.credential_bootstrap;
|
|
13016
13032
|
if (!bootstrap?.oauth?.access_token) {
|
|
13017
13033
|
return { env: {}, cleanupDirs: [] };
|
|
13018
13034
|
}
|
|
13035
|
+
if (bootstrap.provider === "codex" && !bootstrap.oauth.refresh_token) {
|
|
13036
|
+
throw new Error("Codex PTY spawn aborted: refresh_token is missing from credential bundle. Please reconnect Codex in Settings.");
|
|
13037
|
+
}
|
|
13019
13038
|
const baseDir = fs30.mkdtempSync(path30.join(os14.tmpdir(), `episoda-pty-${agentRunId}-`));
|
|
13020
13039
|
const cleanupDirs = [baseDir];
|
|
13021
13040
|
if (bootstrap.provider === "claude") {
|
|
@@ -13040,6 +13059,9 @@ function createCredentialBootstrap(payload, agentRunId) {
|
|
|
13040
13059
|
const authPayload = {
|
|
13041
13060
|
auth_mode: "chatgpt",
|
|
13042
13061
|
OPENAI_API_KEY: null,
|
|
13062
|
+
// EP1473: Codex CLI 0.104.0+ requires last_refresh during token/model bootstrap.
|
|
13063
|
+
// Without it, Codex fails with "Token data is not available" before any work begins.
|
|
13064
|
+
last_refresh: (/* @__PURE__ */ new Date()).toISOString(),
|
|
13043
13065
|
tokens: {
|
|
13044
13066
|
access_token: bootstrap.oauth.access_token,
|
|
13045
13067
|
refresh_token: bootstrap.oauth.refresh_token,
|
|
@@ -15201,6 +15223,17 @@ var ProjectMessageRouter = class {
|
|
|
15201
15223
|
handlePtyKill(payload);
|
|
15202
15224
|
}
|
|
15203
15225
|
});
|
|
15226
|
+
client.on("pty_stdin", async (message) => {
|
|
15227
|
+
if (message.type === "pty_stdin") {
|
|
15228
|
+
const payload = message.payload;
|
|
15229
|
+
console.log(`[Daemon] EP1476: Received pty_stdin for run ${payload.agent_run_id}${payload.module_uid ? ` (module ${payload.module_uid})` : ""}`);
|
|
15230
|
+
client.updateActivity();
|
|
15231
|
+
const result = handlePtyStdin(payload);
|
|
15232
|
+
if (!result.success) {
|
|
15233
|
+
console.warn(`[Daemon] EP1476: pty_stdin failed for run ${payload.agent_run_id}: ${result.error}`);
|
|
15234
|
+
}
|
|
15235
|
+
}
|
|
15236
|
+
});
|
|
15204
15237
|
}
|
|
15205
15238
|
};
|
|
15206
15239
|
|