|
7 | 7 |
|
8 | 8 | from ..._types import SequenceNotStr |
9 | 9 | from .after_idle import AfterIdle |
| 10 | +from .lifecycle_configuration import LifecycleConfiguration |
10 | 11 |
|
11 | | -__all__ = ["LaunchParameters", "Lifecycle", "LifecycleLifecycleHooks", "LifecycleResumeTriggers", "UserParameters"] |
12 | | - |
13 | | - |
14 | | -class LifecycleLifecycleHooks(TypedDict, total=False): |
15 | | - """Optional lifecycle hooks. |
16 | | -
|
17 | | - suspend_commands run through the suspend path before the Devbox suspends; see launch_commands for work on every startup. |
18 | | - """ |
19 | | - |
20 | | - suspend_commands: Optional[SequenceNotStr[str]] |
21 | | - """Commands to run through the suspend path before the Devbox suspends (e.g. |
22 | | -
|
23 | | - cleanup, quiesce daemons). |
24 | | - """ |
25 | | - |
26 | | - suspend_deadline_ms: Optional[int] |
27 | | - """Deadline in milliseconds for broker drain and suspend_commands during suspend. |
28 | | -
|
29 | | - Defaults to 30000 ms and may not exceed 60000 ms. If exceeded, suspend work is |
30 | | - abandoned, the timeout is logged, and the Devbox still proceeds to suspend by |
31 | | - shutting down vmagent and killing the VM. |
32 | | - """ |
33 | | - |
34 | | - |
35 | | -class LifecycleResumeTriggers(TypedDict, total=False): |
36 | | - """Triggers that can resume a suspended Devbox.""" |
37 | | - |
38 | | - axon_event: Optional[bool] |
39 | | - """When true, axon events targeting a suspended Devbox will trigger a resume.""" |
40 | | - |
41 | | - http: Optional[bool] |
42 | | - """When true, HTTP traffic to a suspended Devbox via tunnel will trigger a resume.""" |
43 | | - |
44 | | - |
45 | | -class Lifecycle(TypedDict, total=False): |
46 | | - """Lifecycle configuration for idle and resume behavior. |
47 | | -
|
48 | | - Configure idle policy via lifecycle.after_idle (if both this and the top-level after_idle are set, they must match), resume triggers via lifecycle.resume_triggers, and optional lifecycle hooks via lifecycle.lifecycle_hooks. |
49 | | - """ |
50 | | - |
51 | | - after_idle: Optional[AfterIdle] |
52 | | - """Configure Devbox lifecycle based on idle activity. |
53 | | -
|
54 | | - If both this and the top-level after_idle are set, they must have the same |
55 | | - value. Prefer this field for new integrations. |
56 | | - """ |
57 | | - |
58 | | - lifecycle_hooks: Optional[LifecycleLifecycleHooks] |
59 | | - """Optional lifecycle hooks. |
60 | | -
|
61 | | - suspend_commands run through the suspend path before the Devbox suspends; see |
62 | | - launch_commands for work on every startup. |
63 | | - """ |
64 | | - |
65 | | - resume_triggers: Optional[LifecycleResumeTriggers] |
66 | | - """Triggers that can resume a suspended Devbox.""" |
| 12 | +__all__ = ["LaunchParameters", "UserParameters"] |
67 | 13 |
|
68 | 14 |
|
69 | 15 | class UserParameters(TypedDict, total=False): |
@@ -119,7 +65,7 @@ class LaunchParameters(TypedDict, total=False): |
119 | 65 | launch_commands: Optional[SequenceNotStr[str]] |
120 | 66 | """Set of commands to be run at launch time, before the entrypoint process is run.""" |
121 | 67 |
|
122 | | - lifecycle: Optional[Lifecycle] |
| 68 | + lifecycle: Optional[LifecycleConfiguration] |
123 | 69 | """Lifecycle configuration for idle and resume behavior. |
124 | 70 |
|
125 | 71 | Configure idle policy via lifecycle.after_idle (if both this and the top-level |
|
0 commit comments