@fabrika/provider-contract 0.8.0 → 0.9.0-dev.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabrika/provider-contract",
3
- "version": "0.8.0",
3
+ "version": "0.9.0-dev.1",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,6 +31,6 @@
31
31
  "test": "bun test"
32
32
  },
33
33
  "dependencies": {
34
- "@fabrika/auth-core": "0.8.0"
34
+ "@fabrika/auth-core": "0.9.0-dev.1"
35
35
  }
36
36
  }
package/src/control.ts CHANGED
@@ -66,10 +66,18 @@ export interface ProviderApprovedAccess {
66
66
  readonly checker: string
67
67
  }
68
68
 
69
+ /**
70
+ * `dev`: the environment follows a workspace through a platform-owned launcher, which its provider starts instead of the
71
+ * serving entry (ADR-0043). The kind is Control's registry, never the application's.
72
+ */
73
+ export type ProviderEnvironmentKind = 'standard' | 'dev'
74
+
69
75
  /** Persisted deploy data for one app environment. */
70
76
  export interface ProviderEnvironment {
71
77
  readonly appId: string
72
78
  readonly env: string
79
+ /** Absent means `standard`. */
80
+ readonly kind?: ProviderEnvironmentKind
73
81
  readonly domain?: string
74
82
  /** Canonical externally reachable HTTP(S) origin; independent of provider domain routing. */
75
83
  readonly publicOrigin?: string
@@ -483,6 +491,21 @@ export interface ProviderNamespaceCapabilities {
483
491
  readonly operator?: ProviderNamespaceOperator
484
492
  }
485
493
 
494
+ /** One call on the service of a `dev` environment, between its bootstrap runs. */
495
+ export interface ProviderDevEnvironmentInput {
496
+ readonly environment: ProviderEnvironment
497
+ readonly signal: AbortSignal
498
+ }
499
+
500
+ /**
501
+ * The service of a `dev` environment outside a run (ADR-0049): Control stops it after an idle period and starts it on
502
+ * the next commit. Files the launcher wrote survive both.
503
+ */
504
+ export interface ProviderDevEnvironments {
505
+ stop(input: ProviderDevEnvironmentInput): Promise<void>
506
+ start(input: ProviderDevEnvironmentInput): Promise<void>
507
+ }
508
+
486
509
  /**
487
510
  * The control-plane capability bundle selected statically by one composition root.
488
511
  *
@@ -504,6 +527,8 @@ export interface ControlProvider {
504
527
  reconcile?(input: ProviderReconcileInput): Promise<ProviderReconcileOutcome>
505
528
  readonly secrets?: ProviderManagedSecrets
506
529
  readonly namespaces?: ProviderNamespaceCapabilities
530
+ /** Absent means the provider runs no `dev` environment, and Control refuses one. */
531
+ readonly devEnvironments?: ProviderDevEnvironments
507
532
  /** Absent means the provider deploys public sources only. */
508
533
  readonly source?: ProviderSourceCapabilities
509
534
  /**
package/src/steps.ts CHANGED
@@ -59,7 +59,9 @@ export const runSteps = async <TStep extends { readonly id: string; readonly des
59
59
  log(`→ ${step.id}`)
60
60
  try {
61
61
  await untilCancelled(runOne(step), signal)
62
- results.push({ id: step.id, status: 'succeeded', startedAt, finishedAt: Date.now() })
62
+ const finishedAt = Date.now()
63
+ log(`✓ ${step.id} (${((finishedAt - startedAt) / 1000).toFixed(1)}s)`)
64
+ results.push({ id: step.id, status: 'succeeded', startedAt, finishedAt })
63
65
  } catch (error) {
64
66
  const message = error instanceof Error ? error.message : String(error)
65
67
  stopped = true