@@ -548,6 +548,16 @@ export interface Instance {
548548 */
549549 phase_durations_ms ?: { [ key : string ] : number } ;
550550
551+ /**
552+ * Whole-instance restart supervision policy.
553+ */
554+ restart_policy ?: RestartPolicy ;
555+
556+ /**
557+ * Runtime status for restart policy decisions.
558+ */
559+ restart_status ?: RestartStatus ;
560+
551561 /**
552562 * Base memory size (human-readable)
553563 */
@@ -788,6 +798,66 @@ export interface PortMapping {
788798 protocol ?: 'tcp' | 'udp' ;
789799}
790800
801+ /**
802+ * Whole-instance restart supervision policy.
803+ */
804+ export interface RestartPolicy {
805+ /**
806+ * Delay before each restart attempt, expressed as a Go duration like "5s" or "1m".
807+ */
808+ backoff ?: string ;
809+
810+ /**
811+ * Consecutive automatic restart attempts before blocking retries. 0 means
812+ * unlimited.
813+ */
814+ max_attempts ?: number ;
815+
816+ /**
817+ * Restart behavior when the guest program exits:
818+ *
819+ * - never: do not automatically restart
820+ * - always: restart after any guest exit
821+ * - on_failure: restart only for nonzero, signaled, OOM, or unknown exits
822+ */
823+ policy ?: 'never' | 'always' | 'on_failure' ;
824+
825+ /**
826+ * Running this long resets the consecutive restart attempt count.
827+ */
828+ stable_after ?: string ;
829+ }
830+
831+ /**
832+ * Runtime status for restart policy decisions.
833+ */
834+ export interface RestartStatus {
835+ /**
836+ * Consecutive automatic restart attempts in the current failure window.
837+ */
838+ attempts ?: number ;
839+
840+ /**
841+ * Reason automatic restarts are currently blocked.
842+ */
843+ blocked_reason ?: 'manual_stop' | 'max_attempts_exceeded' | null ;
844+
845+ /**
846+ * Last time Hypeman attempted an automatic restart.
847+ */
848+ last_attempt_at ?: string | null ;
849+
850+ /**
851+ * Most recent non-exit failure signal that entered restart policy.
852+ */
853+ last_reason ?: 'health_check_failed' | null ;
854+
855+ /**
856+ * Next scheduled automatic restart attempt after backoff.
857+ */
858+ next_attempt_at ?: string | null ;
859+ }
860+
791861export interface SetSnapshotScheduleRequest {
792862 /**
793863 * Snapshot interval (Go duration format, minimum 1m).
@@ -1043,6 +1113,11 @@ export interface InstanceCreateParams {
10431113 */
10441114 overlay_size ?: string ;
10451115
1116+ /**
1117+ * Whole-instance restart supervision policy.
1118+ */
1119+ restart_policy ?: RestartPolicy ;
1120+
10461121 /**
10471122 * Base memory size (human-readable format like "1GB", "512MB", "2G")
10481123 */
@@ -1229,6 +1304,11 @@ export interface InstanceUpdateParams {
12291304 * lifecycle state.
12301305 */
12311306 health_check ?: HealthCheck ;
1307+
1308+ /**
1309+ * Whole-instance restart supervision policy.
1310+ */
1311+ restart_policy ?: RestartPolicy ;
12321312}
12331313
12341314export interface InstanceListParams {
@@ -1355,6 +1435,8 @@ export declare namespace Instances {
13551435 type InstanceStats as InstanceStats ,
13561436 type PathInfo as PathInfo ,
13571437 type PortMapping as PortMapping ,
1438+ type RestartPolicy as RestartPolicy ,
1439+ type RestartStatus as RestartStatus ,
13581440 type SetSnapshotScheduleRequest as SetSnapshotScheduleRequest ,
13591441 type SnapshotPolicy as SnapshotPolicy ,
13601442 type SnapshotSchedule as SnapshotSchedule ,
0 commit comments