@lumenflow/core 2.18.2 → 2.19.0

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 (167) hide show
  1. package/dist/adapters/terminal-renderer.adapter.d.ts.map +1 -1
  2. package/dist/adapters/terminal-renderer.adapter.js +6 -4
  3. package/dist/adapters/terminal-renderer.adapter.js.map +1 -1
  4. package/dist/atomic-merge.d.ts +21 -0
  5. package/dist/atomic-merge.d.ts.map +1 -0
  6. package/dist/atomic-merge.js +83 -0
  7. package/dist/atomic-merge.js.map +1 -0
  8. package/dist/delegation-escalation.d.ts +91 -0
  9. package/dist/delegation-escalation.d.ts.map +1 -0
  10. package/dist/delegation-escalation.js +258 -0
  11. package/dist/delegation-escalation.js.map +1 -0
  12. package/dist/delegation-monitor.d.ts +230 -0
  13. package/dist/delegation-monitor.d.ts.map +1 -0
  14. package/dist/delegation-monitor.js +675 -0
  15. package/dist/delegation-monitor.js.map +1 -0
  16. package/dist/delegation-recovery.d.ts +83 -0
  17. package/dist/delegation-recovery.d.ts.map +1 -0
  18. package/dist/delegation-recovery.js +299 -0
  19. package/dist/delegation-recovery.js.map +1 -0
  20. package/dist/delegation-registry-schema.d.ts +80 -0
  21. package/dist/delegation-registry-schema.d.ts.map +1 -0
  22. package/dist/delegation-registry-schema.js +91 -0
  23. package/dist/delegation-registry-schema.js.map +1 -0
  24. package/dist/delegation-registry-store.d.ts +159 -0
  25. package/dist/delegation-registry-store.d.ts.map +1 -0
  26. package/dist/delegation-registry-store.js +299 -0
  27. package/dist/delegation-registry-store.js.map +1 -0
  28. package/dist/delegation-tree.d.ts +57 -0
  29. package/dist/delegation-tree.d.ts.map +1 -0
  30. package/dist/delegation-tree.js +203 -0
  31. package/dist/delegation-tree.js.map +1 -0
  32. package/dist/gates-agent-mode.d.ts +25 -0
  33. package/dist/gates-agent-mode.d.ts.map +1 -1
  34. package/dist/gates-agent-mode.js +41 -0
  35. package/dist/gates-agent-mode.js.map +1 -1
  36. package/dist/index.d.ts +10 -7
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +14 -9
  39. package/dist/index.js.map +1 -1
  40. package/dist/lumenflow-config-schema.d.ts +9 -3
  41. package/dist/lumenflow-config-schema.d.ts.map +1 -1
  42. package/dist/lumenflow-config-schema.js +18 -3
  43. package/dist/lumenflow-config-schema.js.map +1 -1
  44. package/dist/lumenflow-config.d.ts +2 -0
  45. package/dist/lumenflow-config.d.ts.map +1 -1
  46. package/dist/lumenflow-config.js +1 -0
  47. package/dist/lumenflow-config.js.map +1 -1
  48. package/dist/micro-worktree-shared.d.ts +134 -0
  49. package/dist/micro-worktree-shared.d.ts.map +1 -0
  50. package/dist/micro-worktree-shared.js +350 -0
  51. package/dist/micro-worktree-shared.js.map +1 -0
  52. package/dist/micro-worktree.d.ts +4 -273
  53. package/dist/micro-worktree.d.ts.map +1 -1
  54. package/dist/micro-worktree.js +17 -549
  55. package/dist/micro-worktree.js.map +1 -1
  56. package/dist/rollback-utils.d.ts +52 -0
  57. package/dist/rollback-utils.d.ts.map +1 -1
  58. package/dist/rollback-utils.js +111 -0
  59. package/dist/rollback-utils.js.map +1 -1
  60. package/dist/schemas/index.d.ts +3 -3
  61. package/dist/schemas/index.d.ts.map +1 -1
  62. package/dist/schemas/index.js +6 -6
  63. package/dist/schemas/index.js.map +1 -1
  64. package/dist/schemas/initiative-arg-validators.d.ts +1 -0
  65. package/dist/schemas/initiative-arg-validators.d.ts.map +1 -1
  66. package/dist/schemas/initiative-schemas.d.ts +3 -1
  67. package/dist/schemas/initiative-schemas.d.ts.map +1 -1
  68. package/dist/schemas/initiative-schemas.js +2 -1
  69. package/dist/schemas/initiative-schemas.js.map +1 -1
  70. package/dist/schemas/setup-arg-validators.d.ts +4 -4
  71. package/dist/schemas/setup-arg-validators.d.ts.map +1 -1
  72. package/dist/schemas/setup-arg-validators.js +6 -6
  73. package/dist/schemas/setup-arg-validators.js.map +1 -1
  74. package/dist/schemas/setup-schemas.d.ts +7 -7
  75. package/dist/schemas/setup-schemas.d.ts.map +1 -1
  76. package/dist/schemas/setup-schemas.js +10 -10
  77. package/dist/schemas/setup-schemas.js.map +1 -1
  78. package/dist/schemas/wu-lifecycle-arg-validators.d.ts +2 -1
  79. package/dist/schemas/wu-lifecycle-arg-validators.d.ts.map +1 -1
  80. package/dist/schemas/wu-lifecycle-schemas.d.ts +5 -3
  81. package/dist/schemas/wu-lifecycle-schemas.d.ts.map +1 -1
  82. package/dist/schemas/wu-lifecycle-schemas.js +5 -1
  83. package/dist/schemas/wu-lifecycle-schemas.js.map +1 -1
  84. package/dist/template-loader.d.ts +7 -3
  85. package/dist/template-loader.d.ts.map +1 -1
  86. package/dist/template-loader.js +22 -6
  87. package/dist/template-loader.js.map +1 -1
  88. package/dist/wu-consistency-checker.d.ts +1 -0
  89. package/dist/wu-consistency-checker.d.ts.map +1 -1
  90. package/dist/wu-consistency-checker.js +31 -2
  91. package/dist/wu-consistency-checker.js.map +1 -1
  92. package/dist/wu-context-constants.d.ts +0 -2
  93. package/dist/wu-context-constants.d.ts.map +1 -1
  94. package/dist/wu-context-constants.js +0 -2
  95. package/dist/wu-context-constants.js.map +1 -1
  96. package/dist/wu-done-branch-only.d.ts +2 -11
  97. package/dist/wu-done-branch-only.d.ts.map +1 -1
  98. package/dist/wu-done-branch-only.js +81 -45
  99. package/dist/wu-done-branch-only.js.map +1 -1
  100. package/dist/wu-done-cleanup.js +33 -1
  101. package/dist/wu-done-cleanup.js.map +1 -1
  102. package/dist/wu-done-initiative-sync.d.ts.map +1 -1
  103. package/dist/wu-done-initiative-sync.js +20 -5
  104. package/dist/wu-done-initiative-sync.js.map +1 -1
  105. package/dist/wu-done-machine.d.ts +175 -0
  106. package/dist/wu-done-machine.d.ts.map +1 -0
  107. package/dist/wu-done-machine.js +225 -0
  108. package/dist/wu-done-machine.js.map +1 -0
  109. package/dist/wu-done-metadata.d.ts.map +1 -1
  110. package/dist/wu-done-metadata.js +3 -1
  111. package/dist/wu-done-metadata.js.map +1 -1
  112. package/dist/wu-done-validation.d.ts +0 -37
  113. package/dist/wu-done-validation.d.ts.map +1 -1
  114. package/dist/wu-done-validation.js +1 -155
  115. package/dist/wu-done-validation.js.map +1 -1
  116. package/dist/wu-done-validators.d.ts +1 -2
  117. package/dist/wu-done-validators.d.ts.map +1 -1
  118. package/dist/wu-done-validators.js +1 -3
  119. package/dist/wu-done-validators.js.map +1 -1
  120. package/dist/wu-done-worktree-services.d.ts +191 -0
  121. package/dist/wu-done-worktree-services.d.ts.map +1 -0
  122. package/dist/wu-done-worktree-services.js +273 -0
  123. package/dist/wu-done-worktree-services.js.map +1 -0
  124. package/dist/wu-done-worktree.d.ts +0 -19
  125. package/dist/wu-done-worktree.d.ts.map +1 -1
  126. package/dist/wu-done-worktree.js +165 -118
  127. package/dist/wu-done-worktree.js.map +1 -1
  128. package/dist/wu-git-constants.d.ts +4 -0
  129. package/dist/wu-git-constants.d.ts.map +1 -1
  130. package/dist/wu-git-constants.js +4 -0
  131. package/dist/wu-git-constants.js.map +1 -1
  132. package/dist/wu-helpers.d.ts +5 -1
  133. package/dist/wu-helpers.d.ts.map +1 -1
  134. package/dist/wu-helpers.js +5 -1
  135. package/dist/wu-helpers.js.map +1 -1
  136. package/dist/wu-lint.d.ts +24 -0
  137. package/dist/wu-lint.d.ts.map +1 -1
  138. package/dist/wu-lint.js +48 -1
  139. package/dist/wu-lint.js.map +1 -1
  140. package/dist/wu-paths-constants.d.ts +3 -3
  141. package/dist/wu-paths-constants.d.ts.map +1 -1
  142. package/dist/wu-paths-constants.js +3 -3
  143. package/dist/wu-paths-constants.js.map +1 -1
  144. package/dist/wu-recovery.d.ts +89 -0
  145. package/dist/wu-recovery.d.ts.map +1 -1
  146. package/dist/wu-recovery.js +118 -0
  147. package/dist/wu-recovery.js.map +1 -1
  148. package/dist/wu-schema.d.ts +6 -6
  149. package/dist/wu-spawn-context.d.ts +1 -1
  150. package/dist/wu-spawn-context.d.ts.map +1 -1
  151. package/dist/wu-spawn-context.js +8 -2
  152. package/dist/wu-spawn-context.js.map +1 -1
  153. package/dist/wu-spawn-helpers.js +2 -2
  154. package/dist/wu-spawn-helpers.js.map +1 -1
  155. package/dist/wu-state-schema.d.ts +12 -12
  156. package/dist/wu-state-schema.d.ts.map +1 -1
  157. package/dist/wu-state-schema.js +10 -10
  158. package/dist/wu-state-schema.js.map +1 -1
  159. package/dist/wu-state-store.d.ts +10 -4
  160. package/dist/wu-state-store.d.ts.map +1 -1
  161. package/dist/wu-state-store.js +309 -11
  162. package/dist/wu-state-store.js.map +1 -1
  163. package/dist/wu-transaction.d.ts +21 -0
  164. package/dist/wu-transaction.d.ts.map +1 -1
  165. package/dist/wu-transaction.js +17 -0
  166. package/dist/wu-transaction.js.map +1 -1
  167. package/package.json +15 -9
@@ -27,8 +27,10 @@
27
27
  * @see {@link packages/@lumenflow/cli/src/wu-edit.ts} - Spec edits (WU-1274)
28
28
  * @see {@link packages/@lumenflow/cli/src/initiative-create.ts} - Initiative creation (WU-1439)
29
29
  */
30
+ import { MAX_MERGE_RETRIES, MAX_PUSH_RETRIES, DEFAULT_PUSH_RETRY_CONFIG, resolvePushRetryConfig, LUMENFLOW_FORCE_ENV, LUMENFLOW_FORCE_REASON_ENV, LUMENFLOW_WU_TOOL_ENV, DEFAULT_LOG_PREFIX, RetryExhaustionError, isRetryExhaustionError, formatRetryExhaustionError, shouldSkipRemoteOperations, getTempBranchName, createMicroWorktreeDir, findWorktreeByBranch, cleanupOrphanedMicroWorktree, cleanupMicroWorktree, pushRefspecWithForce, pushRefspecWithRetry } from './micro-worktree-shared.js';
30
31
  import type { GitAdapter } from './git-adapter.js';
31
32
  import type { PushRetryConfig } from './lumenflow-config-schema.js';
33
+ import type { FormatRetryExhaustionOptions } from './micro-worktree-shared.js';
32
34
  /**
33
35
  * Context passed to the execute function in withMicroWorktree
34
36
  */
@@ -80,227 +82,8 @@ interface WithMicroWorktreeResult extends MicroWorktreeExecuteResult {
80
82
  * This handles race conditions when multiple agents run wu:create or wu:edit
81
83
  * concurrently. Each retry fetches latest main and rebases.
82
84
  */
83
- export declare const MAX_MERGE_RETRIES = 3;
84
- /**
85
- * Maximum retry attempts for push when origin/main advances
86
- *
87
- * WU-1179: When push fails due to race condition (origin advanced while we
88
- * were working), rollback local main to origin/main and retry.
89
- * Each retry: fetch -> rebase temp branch -> re-merge -> push.
90
- *
91
- * @deprecated Use DEFAULT_PUSH_RETRY_CONFIG.retries instead (WU-1332)
92
- */
93
- export declare const MAX_PUSH_RETRIES = 3;
94
- /**
95
- * WU-1332: Default push retry configuration
96
- *
97
- * Provides sensible defaults for micro-worktree push operations.
98
- * Can be overridden via .lumenflow.config.yaml git.push_retry section.
99
- */
100
- export declare const DEFAULT_PUSH_RETRY_CONFIG: PushRetryConfig;
101
- /**
102
- * Resolve effective push retry config from defaults + global config + operation override.
103
- *
104
- * Priority (lowest to highest):
105
- * 1. DEFAULT_PUSH_RETRY_CONFIG
106
- * 2. Global config from `.lumenflow.config.yaml` (`git.push_retry`)
107
- * 3. Operation-specific override from caller
108
- */
109
- export declare function resolvePushRetryConfig(globalConfig?: Partial<PushRetryConfig>, operationOverride?: Partial<PushRetryConfig>): PushRetryConfig;
110
- /**
111
- * Environment variable name for LUMENFLOW_FORCE bypass
112
- *
113
- * WU-1081: Exported for use in micro-worktree push operations.
114
- */
115
- export declare const LUMENFLOW_FORCE_ENV = "LUMENFLOW_FORCE";
116
- /**
117
- * Environment variable name for LUMENFLOW_FORCE_REASON audit trail
118
- *
119
- * WU-1081: Exported for use in micro-worktree push operations.
120
- */
121
- export declare const LUMENFLOW_FORCE_REASON_ENV = "LUMENFLOW_FORCE_REASON";
122
- /**
123
- * Environment variable name for LUMENFLOW_WU_TOOL
124
- *
125
- * WU-1365: Exported for use by CLI commands that use micro-worktree operations.
126
- * The pre-push hook checks this env var to allow micro-worktree pushes to main.
127
- * Valid values are: wu-create, wu-edit, wu-done, wu-delete, wu-claim, wu-block,
128
- * wu-unblock, initiative-create, initiative-edit, release, lumenflow-upgrade
129
- */
130
- export declare const LUMENFLOW_WU_TOOL_ENV = "LUMENFLOW_WU_TOOL";
131
- /**
132
- * Default log prefix for micro-worktree operations
133
- *
134
- * Extracted to constant to satisfy sonarjs/no-duplicate-string rule.
135
- */
136
- export declare const DEFAULT_LOG_PREFIX = "[micro-wt]";
137
- /**
138
- * WU-1336: Typed error for retry exhaustion in micro-worktree operations
139
- *
140
- * Thrown when push retries are exhausted due to race conditions with parallel agents.
141
- * CLI commands should use `isRetryExhaustionError` to detect this error type and
142
- * `formatRetryExhaustionError` to generate actionable user-facing messages.
143
- *
144
- * This centralizes retry exhaustion handling so CLI commands do not need to
145
- * duplicate detection logic or error formatting.
146
- *
147
- * @example
148
- * ```typescript
149
- * import { RetryExhaustionError, isRetryExhaustionError, formatRetryExhaustionError } from '@lumenflow/core';
150
- *
151
- * try {
152
- * await withMicroWorktree({ ... });
153
- * } catch (error) {
154
- * if (isRetryExhaustionError(error)) {
155
- * console.error(formatRetryExhaustionError(error, { command: 'pnpm initiative:add-wu ...' }));
156
- * } else {
157
- * throw error;
158
- * }
159
- * }
160
- * ```
161
- */
162
- export declare class RetryExhaustionError extends Error {
163
- /** Name of the error class (for instanceof checks across module boundaries) */
164
- readonly name = "RetryExhaustionError";
165
- /** Operation that was being performed (e.g., 'initiative-add-wu') */
166
- readonly operation: string;
167
- /** Number of retry attempts that were exhausted */
168
- readonly retries: number;
169
- constructor(operation: string, retries: number);
170
- }
171
- /**
172
- * WU-1336: Options for formatting retry exhaustion error messages
173
- */
174
- export interface FormatRetryExhaustionOptions {
175
- /** Command to suggest for retrying (e.g., 'pnpm initiative:add-wu --wu WU-123 --initiative INIT-001') */
176
- command: string;
177
- }
178
- /**
179
- * WU-1336: Type guard to check if an error is a retry exhaustion error
180
- *
181
- * Detects both the typed `RetryExhaustionError` class and legacy error messages
182
- * that match the "Push failed after N attempts" pattern.
183
- *
184
- * @param {unknown} error - Error to check
185
- * @returns {boolean} True if this is a retry exhaustion error
186
- *
187
- * @example
188
- * ```typescript
189
- * if (isRetryExhaustionError(error)) {
190
- * // Handle retry exhaustion
191
- * }
192
- * ```
193
- */
194
- export declare function isRetryExhaustionError(error: unknown): error is Error;
195
- /**
196
- * WU-1336: Format retry exhaustion error with actionable next steps
197
- *
198
- * When push retries are exhausted, provides clear guidance on how to proceed.
199
- * CLI commands should use this instead of duplicating error formatting logic.
200
- *
201
- * @param {Error} error - The retry exhaustion error
202
- * @param {FormatRetryExhaustionOptions} options - Formatting options
203
- * @returns {string} Formatted error message with next steps
204
- *
205
- * @example
206
- * ```typescript
207
- * const message = formatRetryExhaustionError(error, {
208
- * command: 'pnpm initiative:add-wu --wu WU-123 --initiative INIT-001',
209
- * });
210
- * console.error(message);
211
- * ```
212
- */
213
- export declare function formatRetryExhaustionError(error: Error, options: FormatRetryExhaustionOptions): string;
214
- /**
215
- * WU-1308: Check if remote operations should be skipped based on git.requireRemote config
216
- *
217
- * When git.requireRemote is false, micro-worktree operations skip:
218
- * - Fetching origin/main before starting
219
- * - Pushing to origin/main after completion
220
- *
221
- * This enables local-only development without a remote repository.
222
- *
223
- * @returns {boolean} True if remote operations should be skipped (requireRemote=false)
224
- *
225
- * @example
226
- * ```yaml
227
- * # .lumenflow.config.yaml
228
- * git:
229
- * requireRemote: false # Enable local-only mode
230
- * ```
231
- */
232
- export declare function shouldSkipRemoteOperations(): boolean;
233
- /**
234
- * Temp branch prefix for micro-worktree operations
235
- *
236
- * @param {string} operation - Operation name (e.g., 'wu-create', 'wu-edit')
237
- * @param {string} id - WU ID (e.g., 'wu-123')
238
- * @returns {string} Temp branch name (e.g., 'tmp/wu-create/wu-123')
239
- */
240
- export declare function getTempBranchName(operation: string, id: string): string;
241
- /**
242
- * Create micro-worktree in /tmp directory
243
- *
244
- * @param {string} prefix - Directory prefix (e.g., 'wu-create-', 'wu-edit-')
245
- * @returns {string} Path to created micro-worktree directory
246
- */
247
- export declare function createMicroWorktreeDir(prefix: string): string;
248
- /**
249
- * Parse git worktree list output to find worktrees by branch
250
- *
251
- * WU-2237: Helper to parse porcelain format output from `git worktree list --porcelain`
252
- *
253
- * @param {string} worktreeListOutput - Output from git worktree list --porcelain
254
- * @param {string} branchName - Branch name to search for (e.g., 'tmp/wu-create/wu-123')
255
- * @returns {string|null} Worktree path if found, null otherwise
256
- */
257
- export declare function findWorktreeByBranch(worktreeListOutput: string, branchName: string): string | null;
258
- /**
259
- * Clean up orphaned micro-worktree and temp branch from a previous interrupted operation
260
- *
261
- * WU-2237: Before creating a new micro-worktree, detect and clean any existing temp
262
- * branch/worktree for the same operation+WU ID. This handles scenarios where:
263
- * - A previous wu:create/wu:edit was interrupted (timeout/crash)
264
- * - The temp branch and /tmp worktree were left behind
265
- * - A subsequent operation would fail with 'branch already exists'
266
- *
267
- * This function is idempotent - safe to call even when no orphans exist.
268
- *
269
- * @param {string} operation - Operation name (e.g., 'wu-create', 'wu-edit')
270
- * @param {string} id - WU ID (e.g., 'WU-123')
271
- * @param {Object} gitAdapter - GitAdapter instance to use (for testability)
272
- * @param {string} logPrefix - Log prefix for console output
273
- * @returns {Promise<{cleanedWorktree: boolean, cleanedBranch: boolean}>} Cleanup status
274
- */
275
- export declare function cleanupOrphanedMicroWorktree(operation: string, id: string, gitAdapter: GitAdapter, logPrefix?: string): Promise<{
276
- cleanedWorktree: boolean;
277
- cleanedBranch: boolean;
278
- }>;
279
- /**
280
- * Cleanup micro-worktree and temp branch
281
- *
282
- * Runs even on failure to prevent orphaned resources.
283
- * Safe to call multiple times (idempotent).
284
- *
285
- * WU-2237: Enhanced to also check git worktree list for registered worktrees
286
- * on the temp branch, in case the worktree path differs from what was expected.
287
- *
288
- * @param {string} worktreePath - Path to micro-worktree
289
- * @param {string} branchName - Temp branch name
290
- * @param {string} logPrefix - Log prefix for console output
291
- */
292
- export declare function cleanupMicroWorktree(worktreePath: string, branchName: string, logPrefix?: string): Promise<void>;
293
- /**
294
- * Stage changes including deletions in micro-worktree
295
- *
296
- * WU-1813: Uses addWithDeletions to properly stage tracked file deletions.
297
- * This replaces the previous pattern of using gitWorktree.add(files) which
298
- * could miss deletions when files were removed.
299
- *
300
- * @param {Object} gitWorktree - GitAdapter instance for the worktree
301
- * @param {string[]|undefined} files - Files to stage (undefined/empty = stage all)
302
- * @returns {Promise<void>}
303
- */
85
+ export { MAX_MERGE_RETRIES, MAX_PUSH_RETRIES, DEFAULT_PUSH_RETRY_CONFIG, resolvePushRetryConfig, LUMENFLOW_FORCE_ENV, LUMENFLOW_FORCE_REASON_ENV, LUMENFLOW_WU_TOOL_ENV, DEFAULT_LOG_PREFIX, RetryExhaustionError, isRetryExhaustionError, formatRetryExhaustionError, shouldSkipRemoteOperations, getTempBranchName, createMicroWorktreeDir, findWorktreeByBranch, cleanupOrphanedMicroWorktree, cleanupMicroWorktree, pushRefspecWithForce, pushRefspecWithRetry, };
86
+ export type { FormatRetryExhaustionOptions };
304
87
  export declare function stageChangesWithDeletions(gitWorktree: GitAdapter, files: string[] | undefined): Promise<void>;
305
88
  /**
306
89
  * WU-1365: Check if prettier is available in the project
@@ -407,57 +190,5 @@ export declare function pushWithRetryConfig(mainGit: GitAdapter, worktreeGit: Gi
407
190
  * @returns {Promise<void>}
408
191
  * @throws {Error} If push fails (env vars still restored)
409
192
  */
410
- export declare function pushRefspecWithForce(gitAdapter: GitAdapter, remote: string, localRef: string, remoteRef: string, reason: string): Promise<void>;
411
- /**
412
- * WU-1337: Push using refspec with LUMENFLOW_FORCE and retry logic
413
- *
414
- * Enhanced version of pushRefspecWithForce that adds retry with rebase
415
- * on non-fast-forward errors. Uses p-retry for exponential backoff and
416
- * respects git.push_retry configuration.
417
- *
418
- * On each retry:
419
- * 1. Fetch origin/main to get latest state
420
- * 2. Rebase the temp branch onto the updated main
421
- * 3. Retry the push with LUMENFLOW_FORCE
422
- *
423
- * This is used by pushOnly mode in withMicroWorktree to handle race conditions
424
- * when multiple agents are pushing to origin/main concurrently.
425
- *
426
- * @param {GitAdapter} gitWorktree - GitAdapter instance for the worktree (for rebase)
427
- * @param {GitAdapter} mainGit - GitAdapter instance for main checkout (for fetch)
428
- * @param {string} remote - Remote name (e.g., 'origin')
429
- * @param {string} localRef - Local ref to push (e.g., 'tmp/wu-claim/wu-123')
430
- * @param {string} remoteRef - Remote ref to update (e.g., 'main')
431
- * @param {string} reason - Audit reason for the LUMENFLOW_FORCE bypass
432
- * @param {string} logPrefix - Log prefix for console output
433
- * @param {PushRetryConfig} config - Push retry configuration
434
- * @returns {Promise<void>}
435
- * @throws {RetryExhaustionError} If push fails after all retries
436
- */
437
- export declare function pushRefspecWithRetry(gitWorktree: GitAdapter, mainGit: GitAdapter, remote: string, localRef: string, remoteRef: string, reason: string, logPrefix?: string, config?: PushRetryConfig): Promise<void>;
438
- /**
439
- * Execute an operation in a micro-worktree with full isolation
440
- *
441
- * This is the main entry point for micro-worktree operations.
442
- * Handles the full lifecycle: create temp branch, create worktree,
443
- * execute operation, merge, push, and cleanup.
444
- *
445
- * WU-1435: Added pushOnly option to keep local main pristine.
446
- * WU-2237: Added pre-creation cleanup of orphaned temp branches/worktrees.
447
- * WU-1337: Push-only path now uses retry with rebase.
448
- *
449
- * @param {Object} options - Options for the operation
450
- * @param {string} options.operation - Operation name (e.g., 'wu-create', 'wu-edit')
451
- * @param {string} options.id - WU ID (e.g., 'WU-123')
452
- * @param {string} options.logPrefix - Log prefix for console output
453
- * @param {boolean} [options.pushOnly=false] - Skip local main merge, push directly to origin/main
454
- * @param {Object} [options.pushRetryOverride] - Optional push retry overrides for this operation
455
- * @param {Function} options.execute - Async function to execute in micro-worktree
456
- * Receives: { worktreePath: string, gitWorktree: GitAdapter }
457
- * Should return: { commitMessage: string, files: string[] }
458
- * @returns {Promise<Object>} Result with ref property for worktree creation
459
- * @throws {Error} If any step fails (cleanup still runs)
460
- */
461
193
  export declare function withMicroWorktree(options: WithMicroWorktreeOptions): Promise<WithMicroWorktreeResult>;
462
- export {};
463
194
  //# sourceMappingURL=micro-worktree.d.ts.map
@@ -1 +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