+
+
+
+
+
+ {/* Preset buttons */}
+
+ {TTL_PRESETS.map((preset) => (
+
+ ))}
+
+
+ {/* Custom input */}
+
+
+ {customInput && !isNaN(parseInt(customInput, 10)) && (
+
+ {formatDuration(parseInt(customInput, 10) * 60)}
+
+ )}
+
+
+ {/* Current value display */}
+ {value !== undefined && (
+
+ TTL: {formatDuration(value)}
+
+ )}
+
+ );
+}
+
+function formatDuration(seconds: number): string {
+ if (seconds < 60) return `${seconds}s`;
+ if (seconds < 3600) return `${Math.floor(seconds / 60)}m`;
+ const hours = Math.floor(seconds / 3600);
+ const mins = Math.floor((seconds % 3600) / 60);
+ return mins > 0 ? `${hours}h ${mins}m` : `${hours}h`;
+}
diff --git a/dashboard/src/types/index.ts b/dashboard/src/types/index.ts
index 6ef0c58b..18e897c9 100644
--- a/dashboard/src/types/index.ts
+++ b/dashboard/src/types/index.ts
@@ -220,6 +220,7 @@ export interface CreateSessionRequest {
permissionMode?: string;
/** @deprecated Use permissionMode. */
autoApprove?: boolean;
+ ttl_seconds?: number;
}
// ── Pane ────────────────────────────────────────────────────────