episoda 0.2.85 → 0.2.87

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.
@@ -2748,7 +2748,7 @@ var require_package = __commonJS({
2748
2748
  "package.json"(exports2, module2) {
2749
2749
  module2.exports = {
2750
2750
  name: "episoda",
2751
- version: "0.2.85",
2751
+ version: "0.2.87",
2752
2752
  description: "CLI tool for Episoda local development workflow orchestration",
2753
2753
  main: "dist/index.js",
2754
2754
  types: "dist/index.d.ts",
@@ -5021,15 +5021,25 @@ async function ensureCodexBinary() {
5021
5021
 
5022
5022
  // src/agent/codex-config.ts
5023
5023
  function generateCodexAuthJson(credentials) {
5024
+ if (!credentials.refreshToken) {
5025
+ throw new Error(
5026
+ "Codex refresh token is missing. Please re-authenticate with Codex in Settings > AI Providers."
5027
+ );
5028
+ }
5029
+ const tokens = {
5030
+ id_token: credentials.idToken || credentials.accessToken,
5031
+ // Fallback to access_token if no id_token
5032
+ access_token: credentials.accessToken,
5033
+ refresh_token: credentials.refreshToken
5034
+ // EP1139: Required field
5035
+ };
5036
+ if (credentials.accountId) {
5037
+ tokens.account_id = credentials.accountId;
5038
+ }
5024
5039
  const authData = {
5025
5040
  OPENAI_API_KEY: null,
5026
- tokens: {
5027
- id_token: credentials.idToken || credentials.accessToken,
5028
- // Fallback to access_token if no id_token
5029
- access_token: credentials.accessToken,
5030
- refresh_token: credentials.refreshToken || null,
5031
- account_id: credentials.accountId || null
5032
- },
5041
+ // This null is expected by Codex CLI
5042
+ tokens,
5033
5043
  last_refresh: (/* @__PURE__ */ new Date()).toISOString()
5034
5044
  };
5035
5045
  return JSON.stringify(authData, null, 2);