@defrex/autobuild 1.15.0 → 1.16.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.
@@ -174,3 +174,9 @@ export function untilAborted<T>(
174
174
  )
175
175
  })
176
176
  }
177
+
178
+ export {
179
+ LaunchCutByDeadline,
180
+ isLaunchCutByDeadline,
181
+ type CutLaunch,
182
+ } from './launch-cut'
@@ -0,0 +1,37 @@
1
+ /**
2
+ * A runner launch the bounded invocation's work deadline cut after the
3
+ * build's execution lease was claimed (GitHub #1415). Kept free of runtime
4
+ * imports so the dispatcher can recognise it without loading the
5
+ * server-only invocation budget.
6
+ */
7
+
8
+ export interface CutLaunch {
9
+ slug: string
10
+ /** The execution lease holder the cut launch claimed. */
11
+ instance: string
12
+ /** Whether the provider start was requested: only then can a guest be
13
+ * running, and the lease is released only after a confirmed fence. */
14
+ startRequested: boolean
15
+ /** The open workspace the launch targeted, when known. */
16
+ workspace?: { provider: string; ref: string }
17
+ }
18
+
19
+ /** Thrown by the CLI's launch when the work deadline cut it mid-flight with
20
+ * its execution lease claimed and no execution handle. Nothing was recorded:
21
+ * the dispatcher settles the lease in teardown and carries the launch in the
22
+ * deferred-work hint. */
23
+ export class LaunchCutByDeadline extends Error {
24
+ override readonly name = 'LaunchCutByDeadline'
25
+ constructor(readonly cut: CutLaunch) {
26
+ super(
27
+ `the work deadline cut the launch of build ${cut.slug} ` +
28
+ (cut.startRequested
29
+ ? 'after its provider start was requested'
30
+ : 'before its provider start'),
31
+ )
32
+ }
33
+ }
34
+
35
+ export function isLaunchCutByDeadline(error: unknown): error is LaunchCutByDeadline {
36
+ return error instanceof LaunchCutByDeadline
37
+ }