episoda 0.2.47 → 0.2.48

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.
@@ -2693,7 +2693,7 @@ var require_package = __commonJS({
2693
2693
  "package.json"(exports2, module2) {
2694
2694
  module2.exports = {
2695
2695
  name: "episoda",
2696
- version: "0.2.47",
2696
+ version: "0.2.48",
2697
2697
  description: "CLI tool for Episoda local development workflow orchestration",
2698
2698
  main: "dist/index.js",
2699
2699
  types: "dist/index.d.ts",
@@ -7510,9 +7510,7 @@ var Daemon = class _Daemon {
7510
7510
  // EP833: Track consecutive health check failures per tunnel
7511
7511
  this.tunnelHealthFailures = /* @__PURE__ */ new Map();
7512
7512
  // 3 second timeout for health checks
7513
- // EP911: Track last reported health status to avoid unnecessary DB writes
7514
- this.lastReportedHealthStatus = /* @__PURE__ */ new Map();
7515
- // moduleUid -> status
7513
+ // EP1020: lastReportedHealthStatus removed - health columns dropped from database
7516
7514
  // EP837: Prevent concurrent commit syncs (backpressure guard)
7517
7515
  this.commitSyncInProgress = false;
7518
7516
  // EP843: Per-module mutex for tunnel operations
@@ -7744,7 +7742,6 @@ var Daemon = class _Daemon {
7744
7742
  await tunnelManager.stopTunnel(moduleUid);
7745
7743
  await stopDevServer(moduleUid);
7746
7744
  await clearTunnelUrl(moduleUid);
7747
- this.lastReportedHealthStatus.delete(moduleUid);
7748
7745
  this.tunnelHealthFailures.delete(moduleUid);
7749
7746
  console.log(`[Daemon] EP823: Tunnel stopped for ${moduleUid}`);
7750
7747
  return { success: true };
@@ -9061,7 +9058,6 @@ var Daemon = class _Daemon {
9061
9058
  const isHealthy = await this.checkTunnelHealth(tunnel);
9062
9059
  if (isHealthy) {
9063
9060
  this.tunnelHealthFailures.delete(tunnel.moduleUid);
9064
- await this.reportTunnelHealth(tunnel.moduleUid, "healthy", config);
9065
9061
  } else {
9066
9062
  const failures = (this.tunnelHealthFailures.get(tunnel.moduleUid) || 0) + 1;
9067
9063
  this.tunnelHealthFailures.set(tunnel.moduleUid, failures);
@@ -9072,7 +9068,6 @@ var Daemon = class _Daemon {
9072
9068
  await this.restartTunnel(tunnel.moduleUid, tunnel.port);
9073
9069
  });
9074
9070
  this.tunnelHealthFailures.delete(tunnel.moduleUid);
9075
- await this.reportTunnelHealth(tunnel.moduleUid, "unhealthy", config);
9076
9071
  }
9077
9072
  }
9078
9073
  }
@@ -9166,33 +9161,8 @@ var Daemon = class _Daemon {
9166
9161
  console.error(`[Daemon] EP833: Error restarting preview for ${moduleUid}:`, error);
9167
9162
  }
9168
9163
  }
9169
- /**
9170
- * EP833: Report tunnel health status to the API
9171
- * EP904: Use fetchWithAuth for token refresh
9172
- * EP911: Only report when status CHANGES to reduce DB writes
9173
- */
9174
- async reportTunnelHealth(moduleUid, healthStatus, config) {
9175
- if (!config.access_token) {
9176
- return;
9177
- }
9178
- const lastStatus = this.lastReportedHealthStatus.get(moduleUid);
9179
- if (lastStatus === healthStatus) {
9180
- return;
9181
- }
9182
- const apiUrl = config.api_url || "https://episoda.dev";
9183
- try {
9184
- await fetchWithAuth(`${apiUrl}/api/modules/${moduleUid}/health`, {
9185
- method: "PATCH",
9186
- body: JSON.stringify({
9187
- tunnel_health_status: healthStatus,
9188
- tunnel_last_health_check: (/* @__PURE__ */ new Date()).toISOString()
9189
- })
9190
- });
9191
- this.lastReportedHealthStatus.set(moduleUid, healthStatus);
9192
- } catch (error) {
9193
- console.warn(`[Daemon] EP833: Failed to report health for ${moduleUid}:`, error instanceof Error ? error.message : error);
9194
- }
9195
- }
9164
+ // EP1020: reportTunnelHealth() removed - tunnel_health_status and tunnel_last_health_check columns dropped
9165
+ // Health checking (checkTunnelHealth) and auto-restart logic preserved for detecting dead tunnels
9196
9166
  /**
9197
9167
  * EP833: Kill processes matching a pattern
9198
9168
  * Used to clean up orphaned cloudflared processes