@creact-labs/creact 0.1.8 → 0.2.1

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.
Files changed (146) hide show
  1. package/README.md +85 -22
  2. package/dist/cli.d.ts +11 -0
  3. package/dist/cli.js +88 -0
  4. package/dist/index.d.ts +19 -44
  5. package/dist/index.js +20 -68
  6. package/dist/jsx/index.d.ts +2 -0
  7. package/dist/jsx/index.js +1 -0
  8. package/dist/jsx/jsx-dev-runtime.d.ts +4 -0
  9. package/dist/jsx/jsx-dev-runtime.js +4 -0
  10. package/dist/jsx/jsx-runtime.d.ts +38 -0
  11. package/dist/jsx/jsx-runtime.js +38 -0
  12. package/dist/jsx/types.d.ts +12 -0
  13. package/dist/jsx/types.js +4 -0
  14. package/dist/primitives/context.d.ts +34 -0
  15. package/dist/primitives/context.js +63 -0
  16. package/dist/primitives/index.d.ts +3 -0
  17. package/dist/primitives/index.js +3 -0
  18. package/dist/primitives/instance.d.ts +72 -0
  19. package/dist/primitives/instance.js +235 -0
  20. package/dist/primitives/store.d.ts +22 -0
  21. package/dist/primitives/store.js +97 -0
  22. package/dist/provider/backend.d.ts +110 -0
  23. package/dist/provider/backend.js +37 -0
  24. package/dist/provider/interface.d.ts +48 -0
  25. package/dist/provider/interface.js +39 -0
  26. package/dist/reactive/effect.d.ts +11 -0
  27. package/dist/reactive/effect.js +42 -0
  28. package/dist/reactive/index.d.ts +3 -0
  29. package/dist/reactive/index.js +3 -0
  30. package/dist/reactive/signal.d.ts +32 -0
  31. package/dist/reactive/signal.js +60 -0
  32. package/dist/reactive/tracking.d.ts +41 -0
  33. package/dist/reactive/tracking.js +161 -0
  34. package/dist/runtime/fiber.d.ts +21 -0
  35. package/dist/runtime/fiber.js +16 -0
  36. package/dist/runtime/index.d.ts +4 -0
  37. package/dist/runtime/index.js +4 -0
  38. package/dist/runtime/reconcile.d.ts +66 -0
  39. package/dist/runtime/reconcile.js +210 -0
  40. package/dist/runtime/render.d.ts +42 -0
  41. package/dist/runtime/render.js +231 -0
  42. package/dist/runtime/run.d.ts +119 -0
  43. package/dist/runtime/run.js +334 -0
  44. package/dist/runtime/state-machine.d.ts +95 -0
  45. package/dist/runtime/state-machine.js +209 -0
  46. package/dist/types.d.ts +13 -0
  47. package/dist/types.js +4 -0
  48. package/package.json +29 -24
  49. package/dist/cli/commands/BuildCommand.d.ts +0 -40
  50. package/dist/cli/commands/BuildCommand.js +0 -151
  51. package/dist/cli/commands/DeployCommand.d.ts +0 -38
  52. package/dist/cli/commands/DeployCommand.js +0 -194
  53. package/dist/cli/commands/DevCommand.d.ts +0 -52
  54. package/dist/cli/commands/DevCommand.js +0 -394
  55. package/dist/cli/commands/PlanCommand.d.ts +0 -39
  56. package/dist/cli/commands/PlanCommand.js +0 -164
  57. package/dist/cli/commands/index.d.ts +0 -36
  58. package/dist/cli/commands/index.js +0 -43
  59. package/dist/cli/core/ArgumentParser.d.ts +0 -46
  60. package/dist/cli/core/ArgumentParser.js +0 -127
  61. package/dist/cli/core/BaseCommand.d.ts +0 -75
  62. package/dist/cli/core/BaseCommand.js +0 -95
  63. package/dist/cli/core/CLIContext.d.ts +0 -68
  64. package/dist/cli/core/CLIContext.js +0 -183
  65. package/dist/cli/core/CommandRegistry.d.ts +0 -64
  66. package/dist/cli/core/CommandRegistry.js +0 -89
  67. package/dist/cli/core/index.d.ts +0 -36
  68. package/dist/cli/core/index.js +0 -43
  69. package/dist/cli/index.d.ts +0 -35
  70. package/dist/cli/index.js +0 -100
  71. package/dist/cli/output.d.ts +0 -204
  72. package/dist/cli/output.js +0 -437
  73. package/dist/cli/utils.d.ts +0 -59
  74. package/dist/cli/utils.js +0 -76
  75. package/dist/context/createContext.d.ts +0 -90
  76. package/dist/context/createContext.js +0 -113
  77. package/dist/context/index.d.ts +0 -30
  78. package/dist/context/index.js +0 -35
  79. package/dist/core/CReact.d.ts +0 -409
  80. package/dist/core/CReact.js +0 -1151
  81. package/dist/core/CloudDOMBuilder.d.ts +0 -447
  82. package/dist/core/CloudDOMBuilder.js +0 -1234
  83. package/dist/core/ContextDependencyTracker.d.ts +0 -165
  84. package/dist/core/ContextDependencyTracker.js +0 -448
  85. package/dist/core/ErrorRecoveryManager.d.ts +0 -145
  86. package/dist/core/ErrorRecoveryManager.js +0 -443
  87. package/dist/core/EventBus.d.ts +0 -91
  88. package/dist/core/EventBus.js +0 -185
  89. package/dist/core/ProviderOutputTracker.d.ts +0 -211
  90. package/dist/core/ProviderOutputTracker.js +0 -476
  91. package/dist/core/ReactiveUpdateQueue.d.ts +0 -76
  92. package/dist/core/ReactiveUpdateQueue.js +0 -121
  93. package/dist/core/Reconciler.d.ts +0 -415
  94. package/dist/core/Reconciler.js +0 -1044
  95. package/dist/core/RenderScheduler.d.ts +0 -153
  96. package/dist/core/RenderScheduler.js +0 -519
  97. package/dist/core/Renderer.d.ts +0 -336
  98. package/dist/core/Renderer.js +0 -944
  99. package/dist/core/Runtime.d.ts +0 -246
  100. package/dist/core/Runtime.js +0 -640
  101. package/dist/core/StateBindingManager.d.ts +0 -121
  102. package/dist/core/StateBindingManager.js +0 -309
  103. package/dist/core/StateMachine.d.ts +0 -441
  104. package/dist/core/StateMachine.js +0 -883
  105. package/dist/core/StructuralChangeDetector.d.ts +0 -140
  106. package/dist/core/StructuralChangeDetector.js +0 -363
  107. package/dist/core/Validator.d.ts +0 -127
  108. package/dist/core/Validator.js +0 -279
  109. package/dist/core/errors.d.ts +0 -153
  110. package/dist/core/errors.js +0 -202
  111. package/dist/core/index.d.ts +0 -38
  112. package/dist/core/index.js +0 -64
  113. package/dist/core/types.d.ts +0 -265
  114. package/dist/core/types.js +0 -48
  115. package/dist/hooks/context.d.ts +0 -147
  116. package/dist/hooks/context.js +0 -334
  117. package/dist/hooks/useContext.d.ts +0 -113
  118. package/dist/hooks/useContext.js +0 -169
  119. package/dist/hooks/useEffect.d.ts +0 -105
  120. package/dist/hooks/useEffect.js +0 -540
  121. package/dist/hooks/useInstance.d.ts +0 -139
  122. package/dist/hooks/useInstance.js +0 -455
  123. package/dist/hooks/useState.d.ts +0 -120
  124. package/dist/hooks/useState.js +0 -298
  125. package/dist/jsx.d.ts +0 -143
  126. package/dist/jsx.js +0 -76
  127. package/dist/providers/DummyBackendProvider.d.ts +0 -193
  128. package/dist/providers/DummyBackendProvider.js +0 -189
  129. package/dist/providers/DummyCloudProvider.d.ts +0 -128
  130. package/dist/providers/DummyCloudProvider.js +0 -157
  131. package/dist/providers/IBackendProvider.d.ts +0 -177
  132. package/dist/providers/IBackendProvider.js +0 -31
  133. package/dist/providers/ICloudProvider.d.ts +0 -230
  134. package/dist/providers/ICloudProvider.js +0 -31
  135. package/dist/providers/index.d.ts +0 -31
  136. package/dist/providers/index.js +0 -31
  137. package/dist/test-event-callbacks.d.ts +0 -0
  138. package/dist/test-event-callbacks.js +0 -1
  139. package/dist/utils/Logger.d.ts +0 -144
  140. package/dist/utils/Logger.js +0 -220
  141. package/dist/utils/Output.d.ts +0 -161
  142. package/dist/utils/Output.js +0 -401
  143. package/dist/utils/deepEqual.d.ts +0 -71
  144. package/dist/utils/deepEqual.js +0 -276
  145. package/dist/utils/naming.d.ts +0 -241
  146. package/dist/utils/naming.js +0 -376
@@ -1,441 +0,0 @@
1
- /**
2
-
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
-
5
- * you may not use this file except in compliance with the License.
6
-
7
- * You may obtain a copy of the License at
8
-
9
- *
10
-
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
-
13
- *
14
-
15
- * Unless required by applicable law or agreed to in writing, software
16
-
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
-
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
-
21
- * See the License for the specific language governing permissions and
22
-
23
- * limitations under the License.
24
-
25
- *
26
-
27
- * Copyright 2025 Daniel Coutinho Ribeiro
28
-
29
- */
30
- import { CloudDOMNode, ChangeSet } from './types';
31
- import { IBackendProvider } from '../providers/IBackendProvider';
32
- import { DeploymentError, DeploymentErrorData } from './errors';
33
- /**
34
- * DeploymentStatus represents the lifecycle state of a deployment
35
- *
36
- * State transitions:
37
- * - PENDING → APPLYING (deployment starts)
38
- * - APPLYING → DEPLOYED (deployment succeeds)
39
- * - APPLYING → FAILED (deployment fails)
40
- * - APPLYING → ROLLED_BACK (rollback completes)
41
- *
42
- * REQ-O01: State machine with crash recovery
43
- */
44
- export type DeploymentStatus = 'PENDING' | 'APPLYING' | 'DEPLOYED' | 'FAILED' | 'ROLLED_BACK';
45
- /**
46
- * StateMachineEvent represents events emitted by the state machine
47
- *
48
- * Used for observability and telemetry integration.
49
- */
50
- export type StateMachineEvent = 'started' | 'checkpoint' | 'completed' | 'failed' | 'rolled_back';
51
- /**
52
- * AuditLogEntry represents an audit trail entry for state changes
53
- *
54
- * REQ-O05: Audit log for compliance and debugging
55
- */
56
- export interface AuditLogEntry {
57
- /** Timestamp when action occurred (milliseconds since epoch) */
58
- timestamp: number;
59
- /** User who initiated the action */
60
- user: string;
61
- /** Action performed */
62
- action: 'start' | 'checkpoint' | 'complete' | 'fail' | 'rollback';
63
- /** Stack name */
64
- stackName: string;
65
- /** Status of the action */
66
- status: 'completed' | 'failed';
67
- /** Error message if action failed */
68
- error?: string;
69
- /** Change set being applied (optional) */
70
- changeSet?: ChangeSet;
71
- /** Checkpoint index (optional) */
72
- checkpoint?: number;
73
- }
74
- /**
75
- * DeploymentState represents the complete state of a deployment transaction
76
- *
77
- * Stored in BackendProvider for crash recovery and audit trail.
78
- *
79
- * REQ-O01: Transactional deployment with checkpoints
80
- */
81
- export interface DeploymentState {
82
- /** Current deployment status */
83
- status: DeploymentStatus;
84
- /** CloudDOM tree being deployed */
85
- cloudDOM: CloudDOMNode[];
86
- /** Change set computed by Reconciler (optional, only during deployment) */
87
- changeSet?: ChangeSet;
88
- /** Index of last successfully deployed resource (for crash recovery) */
89
- checkpoint?: number;
90
- /** Structured error data (if status is FAILED) */
91
- error?: DeploymentErrorData;
92
- /** Timestamp when state was last updated (milliseconds since epoch) */
93
- timestamp: number;
94
- /** User who initiated the deployment */
95
- user: string;
96
- /** Stack name for this deployment */
97
- stackName: string;
98
- }
99
- /**
100
- * StateMachineEventPayload wraps state with event metadata
101
- *
102
- * Used for telemetry, metrics, and structured logging.
103
- */
104
- export interface StateMachineEventPayload {
105
- /** Event type */
106
- event: StateMachineEvent;
107
- /** Current deployment state */
108
- state: DeploymentState;
109
- /** Additional metadata (optional) */
110
- metadata?: Record<string, any>;
111
- }
112
- /**
113
- * StateMachine manages deployment lifecycle with crash recovery
114
- *
115
- * Responsibilities:
116
- * - Track deployment state transitions
117
- * - Save checkpoints after each resource deploys
118
- * - Enable crash recovery (resume or rollback)
119
- * - Provide atomic state persistence via BackendProvider
120
- * - Prevent concurrent deployments via locking (REQ-O02)
121
- * - Emit audit trail for compliance (REQ-O05)
122
- * - Retry transient backend failures (REQ-O03)
123
- *
124
- * Design principles:
125
- * - All state changes are atomic (saved to BackendProvider immediately)
126
- * - Checkpoints enable resume from any point
127
- * - Rollback applies reverse change set
128
- * - State machine is universal (works with all providers)
129
- * - Locking prevents race conditions
130
- * - Audit trail provides compliance and debugging
131
- *
132
- * REQ-O01: CloudDOM State Machine
133
- * REQ-O02: State Locking
134
- * REQ-O03: Retry Logic
135
- * REQ-O05: Audit Log
136
- * REQ-ARCH-01: Provider-Orchestration Separation
137
- *
138
- * @example
139
- * ```typescript
140
- * const stateMachine = new StateMachine(backendProvider);
141
- *
142
- * // Listen to events
143
- * stateMachine.on('checkpoint', (state) => {
144
- * logger.info(`Checkpoint: ${state.checkpoint}`);
145
- * });
146
- *
147
- * // Start deployment (acquires lock)
148
- * await stateMachine.startDeployment('my-stack', changeSet, cloudDOM, 'user@example.com');
149
- *
150
- * // Update checkpoint after each resource
151
- * await stateMachine.updateCheckpoint('my-stack', 0);
152
- * await stateMachine.updateCheckpoint('my-stack', 1);
153
- *
154
- * // Complete deployment (releases lock)
155
- * await stateMachine.completeDeployment('my-stack');
156
- *
157
- * // Or handle failure (releases lock)
158
- * await stateMachine.failDeployment('my-stack', new DeploymentError('Provider timeout'));
159
- * ```
160
- */
161
- export declare class StateMachine {
162
- private backendProvider;
163
- private options;
164
- private listeners;
165
- /**
166
- * Map of active lock renewal timers by stack name
167
- * Used to clean up timers when deployment completes
168
- */
169
- private lockRenewalTimers;
170
- /**
171
- * Valid state transitions
172
- *
173
- * Defines allowed transitions for state machine validation.
174
- */
175
- private static readonly VALID_TRANSITIONS;
176
- constructor(backendProvider: IBackendProvider<DeploymentState>, options?: {
177
- /** Number of retries for transient backend failures (default: 3) */
178
- maxRetries?: number;
179
- /** Enable audit logging (default: true) */
180
- enableAuditLog?: boolean;
181
- /** Enable state snapshots (default: false) */
182
- enableSnapshots?: boolean;
183
- /** Lock TTL in seconds (default: 600 = 10 minutes) */
184
- lockTTL?: number;
185
- });
186
- /**
187
- * Subscribe to state machine events
188
- *
189
- * Enables observability and telemetry integration.
190
- *
191
- * @param event - Event type to listen for
192
- * @param handler - Callback function receiving structured payload
193
- */
194
- on(event: StateMachineEvent, handler: (payload: StateMachineEventPayload) => void): void;
195
- /**
196
- * Unsubscribe from state machine events
197
- *
198
- * @param event - Event type to stop listening for
199
- * @param handler - Callback function to remove
200
- */
201
- off(event: StateMachineEvent, handler: (payload: StateMachineEventPayload) => void): void;
202
- /**
203
- * Emit event to all listeners with structured payload
204
- *
205
- * @param event - Event type
206
- * @param state - Current deployment state
207
- * @param metadata - Additional metadata (optional)
208
- */
209
- private emit;
210
- /**
211
- * Start lock auto-renewal for a stack
212
- *
213
- * Renews the lock at 50% of the TTL interval to prevent expiration
214
- * during long deployments. Only starts renewal if backend supports locking.
215
- *
216
- * @param stackName - Name of the stack
217
- * @param holder - Lock holder identifier
218
- * @param ttl - Lock TTL in seconds
219
- */
220
- private startLockRenewal;
221
- /**
222
- * Stop lock auto-renewal for a stack
223
- *
224
- * Cleans up the renewal timer to prevent memory leaks.
225
- *
226
- * @param stackName - Name of the stack
227
- */
228
- private stopLockRenewal;
229
- /**
230
- * Validate state transition
231
- *
232
- * Ensures state machine only transitions through valid states.
233
- * Prevents accidental invalid state mutations.
234
- *
235
- * @param from - Current state
236
- * @param to - Target state
237
- * @throws DeploymentError if transition is invalid
238
- */
239
- private validateTransition;
240
- /**
241
- * Retry operation with exponential backoff
242
- *
243
- * Handles transient backend failures (network issues, timeouts, etc.)
244
- *
245
- * REQ-O03: Error handling and retry logic
246
- *
247
- * @param operation - Async operation to retry
248
- * @param retries - Number of retries (default: from options)
249
- * @returns Promise resolving to operation result
250
- * @throws Error if all retries fail
251
- */
252
- private withRetry;
253
- /**
254
- * Log action to audit trail
255
- *
256
- * REQ-O05: Audit log for compliance
257
- *
258
- * @param stackName - Stack name
259
- * @param action - Action performed
260
- * @param state - Current deployment state
261
- * @param error - Error if action failed
262
- */
263
- private logAction;
264
- /**
265
- * Save state snapshot for time-travel debugging
266
- *
267
- * Creates a deep copy to ensure immutability.
268
- *
269
- * REQ-O01: Immutable state snapshots
270
- *
271
- * @param stackName - Stack name
272
- * @param state - Current deployment state
273
- */
274
- private saveSnapshot;
275
- /**
276
- * Start a deployment transaction
277
- *
278
- * Transitions state from PENDING to APPLYING and saves to backend.
279
- * Acquires lock to prevent concurrent deployments.
280
- *
281
- * REQ-O01.1: WHEN deployment starts THEN CloudDOM state SHALL transition to APPLYING
282
- * REQ-O02: State locking to prevent concurrent deployments
283
- *
284
- * @param stackName - Name of the stack being deployed
285
- * @param changeSet - Change set computed by Reconciler
286
- * @param cloudDOM - CloudDOM tree being deployed
287
- * @param user - User initiating the deployment
288
- * @returns Promise that resolves when state is saved
289
- * @throws DeploymentError if lock cannot be acquired or state save fails
290
- */
291
- startDeployment(stackName: string, changeSet: ChangeSet, cloudDOM: CloudDOMNode[], user: string): Promise<void>;
292
- /**
293
- * Update checkpoint after each resource deploys
294
- *
295
- * Saves progress to enable crash recovery. If deployment crashes,
296
- * it can resume from the last checkpoint.
297
- *
298
- * REQ-O01.5: WHEN any provider executes THEN StateMachine SHALL checkpoint after each resource
299
- *
300
- * @param stackName - Name of the stack being deployed
301
- * @param checkpoint - Index of last successfully deployed resource
302
- * @returns Promise that resolves when checkpoint is saved
303
- * @throws DeploymentError if state is invalid or save fails
304
- */
305
- updateCheckpoint(stackName: string, checkpoint: number): Promise<void>;
306
- /**
307
- * Mark deployment as complete
308
- *
309
- * Transitions state from APPLYING to DEPLOYED and releases lock.
310
- *
311
- * REQ-O01.2: WHEN deployment succeeds THEN state SHALL transition to DEPLOYED
312
- * REQ-O02: Release lock after deployment completes
313
- *
314
- * @param stackName - Name of the stack that was deployed
315
- * @returns Promise that resolves when state is saved
316
- * @throws DeploymentError if state is invalid or save fails
317
- */
318
- completeDeployment(stackName: string): Promise<void>;
319
- /**
320
- * Mark deployment as failed
321
- *
322
- * Transitions state from APPLYING to FAILED, stores error details, and releases lock.
323
- *
324
- * @param stackName - Name of the stack that failed
325
- * @param error - Error that caused the failure (should be DeploymentError or subclass)
326
- * @returns Promise that resolves when state is saved
327
- * @throws DeploymentError if state is invalid or save fails
328
- */
329
- failDeployment(stackName: string, error: Error | DeploymentError): Promise<void>;
330
- /**
331
- * Resume interrupted deployment from checkpoint
332
- *
333
- * Returns the change set and checkpoint so deployment can continue
334
- * from where it left off.
335
- *
336
- * REQ-O01.4: WHEN CReact restarts THEN it SHALL detect incomplete transactions
337
- * and offer resume/rollback
338
- *
339
- * @param stackName - Name of the stack to resume
340
- * @returns Promise resolving to change set, checkpoint index, and cloudDOM
341
- * @throws DeploymentError if no incomplete deployment found
342
- */
343
- resumeDeployment(stackName: string): Promise<{
344
- changeSet: ChangeSet;
345
- checkpoint: number;
346
- cloudDOM: CloudDOMNode[];
347
- }>;
348
- /**
349
- * Rollback to previous state
350
- *
351
- * Applies reverse change set (deletes → creates, creates → deletes)
352
- * and transitions state to ROLLED_BACK. Releases lock.
353
- *
354
- * Note: This method only updates the state machine status. The actual
355
- * rollback logic (applying reverse change set) is handled by the caller
356
- * (typically CReact or CLI).
357
- *
358
- * REQ-O01: Crash recovery with rollback
359
- * REQ-O02: Release lock after rollback
360
- *
361
- * @param stackName - Name of the stack to rollback
362
- * @returns Promise that resolves when state is saved
363
- * @throws DeploymentError if state is invalid or save fails
364
- */
365
- rollback(stackName: string): Promise<void>;
366
- /**
367
- * Get current deployment state for a stack
368
- *
369
- * @param stackName - Name of the stack
370
- * @returns Promise resolving to deployment state, or undefined if not found
371
- */
372
- getState(stackName: string): Promise<DeploymentState | undefined>;
373
- /**
374
- * Update the CloudDOM in the deployment state (for post-deployment effects)
375
- *
376
- * @param stackName - Stack name
377
- * @param cloudDOM - Updated CloudDOM with new outputs
378
- * @throws DeploymentError if state update fails
379
- */
380
- updateCloudDOM(stackName: string, cloudDOM: CloudDOMNode[]): Promise<void>;
381
- /**
382
- * Check if a stack has an incomplete deployment
383
- *
384
- * Used on startup to detect crashed deployments that need recovery.
385
- *
386
- * REQ-O01.3: WHEN CReact process crashes mid-deploy THEN state SHALL remain in APPLYING
387
- * REQ-O01.4: WHEN CReact restarts THEN it SHALL detect incomplete transactions
388
- *
389
- * @param stackName - Name of the stack to check
390
- * @returns Promise resolving to true if deployment is incomplete
391
- */
392
- hasIncompleteDeployment(stackName: string): Promise<boolean>;
393
- /**
394
- * Get checkpoint info for display
395
- *
396
- * Returns human-readable checkpoint information for CLI/UI.
397
- * Includes resource ID for better UX.
398
- *
399
- * @param stackName - Name of the stack
400
- * @returns Promise resolving to checkpoint info, or undefined if not found
401
- */
402
- getCheckpointInfo(stackName: string): Promise<{
403
- checkpoint: number;
404
- resourceId?: string;
405
- totalResources: number;
406
- percentComplete: number;
407
- } | undefined>;
408
- /**
409
- * Auto-recover from incomplete deployment
410
- *
411
- * Convenience method for CLI/orchestrator to automatically resume or rollback
412
- * based on configuration.
413
- *
414
- * @param stackName - Name of the stack to recover
415
- * @param strategy - Recovery strategy ('resume' or 'rollback')
416
- * @returns Promise resolving to recovery info, or undefined if no recovery needed
417
- */
418
- autoRecover(stackName: string, strategy: 'resume' | 'rollback'): Promise<{
419
- action: 'resumed' | 'rolled_back' | 'none';
420
- checkpoint?: number;
421
- changeSet?: ChangeSet;
422
- cloudDOM?: CloudDOMNode[];
423
- }>;
424
- /**
425
- * Detect and fix drift in deployed resources
426
- *
427
- * Checks if resources in the backend state still match reality.
428
- * If drift is detected, refreshes the state to reflect actual cloud state.
429
- *
430
- * This is called automatically during state load to ensure state accuracy.
431
- *
432
- * @param stackName - Stack name to check for drift
433
- * @param cloudProvider - Cloud provider with drift detection capabilities
434
- * @returns Promise resolving to drift detection results
435
- */
436
- detectAndFixDrift(stackName: string, cloudProvider: import('../providers/ICloudProvider').ICloudProvider): Promise<{
437
- driftDetected: boolean;
438
- driftResults: import('../providers/ICloudProvider').DriftDetectionResult[];
439
- resourcesFixed: number;
440
- }>;
441
- }