@ebay-dt/bonfire-core 0.2.0-alpha.18 → 0.2.0-alpha.20
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/dist/lifecycle.d.ts +2 -2
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js.map +1 -1
- package/package.json +1 -1
package/dist/lifecycle.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export type LifecycleOperationOutcome = {
|
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
32
|
export type LifecycleRecoveryKind = "ordinary-publication" | "deployment-upload" | "deployment-preview-unconfirmed" | "deployment-publication";
|
|
33
|
-
export type LifecycleRecoveryOperation = "create" | "delete" | "deploy";
|
|
33
|
+
export type LifecycleRecoveryOperation = "create" | "duplicate" | "delete" | "deploy";
|
|
34
34
|
export type LifecycleRecoveryValue = {
|
|
35
35
|
recoveryId: string;
|
|
36
36
|
operation: LifecycleRecoveryOperation;
|
|
@@ -62,7 +62,7 @@ export type ManualFilesystemMutationValue = {
|
|
|
62
62
|
remoteStatus: "manual";
|
|
63
63
|
};
|
|
64
64
|
export type BranchPreparationStatus = "ready" | "disabled" | "deferred" | "unsafe";
|
|
65
|
-
export type BranchPreparationDeferredReason = "dirty-worktree" | "fetch-failed" | "merge-conflict" | "protected-collision";
|
|
65
|
+
export type BranchPreparationDeferredReason = "dirty-worktree" | "fetch-failed" | "merge-conflict" | "protected-collision" | "pending-recovery";
|
|
66
66
|
export type BranchPreparationUnsafeReason = "detached-head" | "branch-changed" | "unresolved-operation" | "missing-primary" | "identity-divergence" | "failed-abort" | "merge-failed" | "push-failed" | "reconciliation-failed";
|
|
67
67
|
export type BranchPreparationReason = BranchPreparationDeferredReason | BranchPreparationUnsafeReason;
|
|
68
68
|
export type BranchPreparationEffects = {
|
package/dist/lifecycle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["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ACvB,eAAe,CAAC,KAAK,CAAC,CAExB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EACtC,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,GAC7B,MAAM,IAAI;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAEtC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EACtC,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,GAC7B,MAAM,IAAI;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAE,CAEhD","sourcesContent":["import type { PrototypeRef } from \"./prototype-ref.js\";\n\nexport type AutomaticBranchSwitchMode = \"enabled\" | \"disabled\";\n\nexport class AutomaticBranchSwitchSettingError extends Error {\n readonly code = \"invalid-input\" as const;\n\n constructor() {\n super(\"Invalid automatic branch-switch setting\");\n this.name = \"AutomaticBranchSwitchSettingError\";\n }\n}\n\nexport function parseAutomaticBranchSwitchSetting(\n value: unknown,\n): AutomaticBranchSwitchMode {\n if (value === undefined || value === \"false\") return \"enabled\";\n if (value === \"true\") return \"disabled\";\n throw new AutomaticBranchSwitchSettingError();\n}\n\nexport const DEPLOYMENT_READY_STATES = Object.freeze([\n \"BLOCKED\",\n \"BUILDING\",\n \"CANCELED\",\n \"ERROR\",\n \"INITIALIZING\",\n \"QUEUED\",\n \"READY\",\n] as const);\n\nexport type DeploymentReadyState = (typeof DEPLOYMENT_READY_STATES)[number];\n\nexport function isDeploymentReadyState(\n value: unknown,\n): value is DeploymentReadyState {\n return (\n typeof value === \"string\" &&\n (DEPLOYMENT_READY_STATES as readonly string[]).includes(value)\n );\n}\n\nexport type DeploymentWarningCode =\n | \"metadata-persistence-failed\"\n | \"primary-merge-failed\"\n | \"publication-cleanup-failed\"\n | \"upload-unconfirmed\"\n | \"preview-unconfirmed\";\n\nexport type LifecycleOperationOutcome = {\n local: {\n status: \"completed\" | \"failed\";\n checkpointSha?: string;\n };\n upload: {\n status: \"not-attempted\" | \"confirmed\" | \"unconfirmed\" | \"failed\";\n sourceSha?: string;\n };\n preview: {\n status: \"not-attempted\" | \"accepted\" | \"unconfirmed\" | \"failed\";\n previewUrl?: string;\n deploymentId?: string;\n };\n publication: {\n status: \"not-attempted\" | \"confirmed\" | \"failed\" | \"pending\" | \"superseded\";\n revision?: string;\n recoveryId?: string;\n };\n};\n\nexport type LifecycleRecoveryKind =\n | \"ordinary-publication\"\n | \"deployment-upload\"\n | \"deployment-preview-unconfirmed\"\n | \"deployment-publication\";\n\nexport type LifecycleRecoveryOperation = \"create\" | \"delete\" | \"deploy\";\n\nexport type LifecycleRecoveryValue = {\n recoveryId: string;\n operation: LifecycleRecoveryOperation;\n kind: LifecycleRecoveryKind;\n ref: PrototypeRef;\n sourceSha: string;\n previewUrl?: string;\n deploymentId?: string;\n readyState?: DeploymentReadyState;\n acceptedAt?: string;\n outcome: LifecycleOperationOutcome;\n};\n\n/** All unfinished recovery records returned during lifecycle hydration. */\nexport type LifecycleRecoveriesValue = readonly LifecycleRecoveryValue[];\n\nexport type LifecycleErrorCode =\n | \"unauthenticated\"\n | \"forbidden\"\n | \"invalid-input\"\n | \"not-found\"\n | \"already-exists\"\n | \"repository-busy\"\n | \"working-tree-conflict\"\n | \"protected-prototype-path\"\n | \"filesystem-failure\"\n | \"git-failure\"\n | \"deployment-failure\"\n | \"deployment-unavailable\"\n | \"timeout\"\n | \"unexpected-failure\";\n\nexport type LifecycleError = {\n code: LifecycleErrorCode;\n};\n\nexport type LifecycleResult<Value> =\n { ok: true; value: Value } | { ok: false; error: LifecycleError };\n\nexport type LifecycleRemoteStatus = \"pushed\" | \"local-only\" | \"manual\";\n\n/** Explicit result marker for filesystem-only lifecycle mutations. */\nexport type ManualFilesystemMutationValue = {\n remoteStatus: \"manual\";\n};\nexport type BranchPreparationStatus =\n \"ready\" | \"disabled\" | \"deferred\" | \"unsafe\";\n\nexport type BranchPreparationDeferredReason =\n \"dirty-worktree\" | \"fetch-failed\" | \"merge-conflict\" | \"protected-collision\";\n\nexport type BranchPreparationUnsafeReason =\n | \"detached-head\"\n | \"branch-changed\"\n | \"unresolved-operation\"\n | \"missing-primary\"\n | \"identity-divergence\"\n | \"failed-abort\"\n | \"merge-failed\"\n | \"push-failed\"\n | \"reconciliation-failed\";\n\nexport type BranchPreparationReason =\n BranchPreparationDeferredReason | BranchPreparationUnsafeReason;\n\nexport type BranchPreparationEffects = {\n changed: boolean;\n pushed: boolean;\n reconciledPaths: readonly string[];\n restartRequired: boolean;\n /** Platform paths changed by the committed-baseline reconciliation. */\n platformPaths?: readonly string[];\n /** Changed package manifests/lockfiles requiring dependency preparation. */\n dependencyPaths?: readonly string[];\n preparationRequired?: boolean;\n};\n\n/** Result of the existing dependency-installation boundary. */\nexport type DependencyPreparationValue = {\n status: \"not-required\" | \"prepared\" | \"failed\" | \"skipped\";\n dependencyPaths: readonly string[];\n /** True when a protected marker was consumed or retained. */\n pending: boolean;\n restartRequired: boolean;\n};\n\ntype BranchPreparationBase = {\n effects: BranchPreparationEffects;\n affectedPaths?: readonly string[];\n};\n\nexport type BranchPreparationValue =\n | (BranchPreparationBase & { status: \"ready\" })\n | (BranchPreparationBase & { status: \"disabled\" })\n | (BranchPreparationBase & {\n status: \"deferred\";\n reason: BranchPreparationDeferredReason;\n })\n | (BranchPreparationBase & {\n status: \"unsafe\";\n reason: BranchPreparationUnsafeReason;\n });\n\nexport type BranchPreparationAttention = Extract<\n BranchPreparationValue,\n { status: \"disabled\" | \"deferred\" | \"unsafe\" }\n>;\n\nexport type RepositorySummaryRefresh =\n | {\n status: \"refreshed\";\n summary: import(\"./git-management.js\").RepositorySummary;\n }\n | { status: \"failed\"; error: LifecycleErrorCode };\n\nexport type RepositoryUpdateValue = {\n preparation: BranchPreparationValue;\n summaryRefresh: RepositorySummaryRefresh;\n dependencyPreparation?: DependencyPreparationValue;\n};\n\nexport type LifecyclePrototypeValue = {\n ref: PrototypeRef;\n url: string;\n remoteStatus: LifecycleRemoteStatus;\n outcome?: LifecycleOperationOutcome;\n};\n\nexport type CreatePrototypeValue = LifecyclePrototypeValue;\nexport type DuplicatePrototypeValue = LifecyclePrototypeValue;\n\nexport type EditPrototypeValue = {\n edited: true;\n ref: PrototypeRef;\n};\n\nexport type DeletePrototypeValue = {\n deleted: true;\n ref: PrototypeRef;\n outcome?: LifecycleOperationOutcome;\n};\n\nexport type SavePrototypeValue = {\n saved: true;\n};\n\nexport type DiscardPrototypeValue = {\n discarded: true;\n};\n\ntype DeploymentValueBase = {\n ref: PrototypeRef;\n sourceSha: string;\n /** Legacy singular warning field; prefer warnings for new consumers. */\n warning: DeploymentWarningCode | undefined;\n /** Independent deployment and repository warnings, when available. */\n warnings?: readonly DeploymentWarningCode[];\n};\n\nexport type DeploymentValue =\n | (DeploymentValueBase & {\n deployed: true;\n previewUrl: string;\n deploymentId: string;\n readyState: DeploymentReadyState;\n outcome?: LifecycleOperationOutcome;\n })\n | (DeploymentValueBase & {\n deployed: false;\n previewUrl?: never;\n deploymentId?: never;\n readyState?: never;\n outcome: LifecycleOperationOutcome;\n });\n\nexport type DirtyObservationStatus = \"clean\" | \"dirty\";\n\nexport type DirtyObservationValue = {\n status: DirtyObservationStatus;\n /** Existing deployment preview, when one has been persisted. */\n previewUrl?: string | null;\n};\n\nexport function lifecycleSuccess<Value>(value: Value): LifecycleResult<Value> {\n return { ok: true, value };\n}\n\nexport function lifecycleFailure(\n code: LifecycleErrorCode,\n): LifecycleResult<never> {\n return { ok: false, error: { code } };\n}\n\nexport function isLifecycleSuccess<Value>(\n result: LifecycleResult<Value>,\n): result is { ok: true; value: Value } {\n return result.ok;\n}\n\nexport function isLifecycleFailure<Value>(\n result: LifecycleResult<Value>,\n): result is { ok: false; error: LifecycleError } {\n return !result.ok;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oB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,kBAAkB,CAAC,KAAK,EACtC,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,GAC7B,MAAM,IAAI;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAEtC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EACtC,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,GAC7B,MAAM,IAAI;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAE,CAEhD","sourcesContent":["import type { PrototypeRef } from \"./prototype-ref.js\";\n\nexport type AutomaticBranchSwitchMode = \"enabled\" | \"disabled\";\n\nexport class AutomaticBranchSwitchSettingError extends Error {\n readonly code = \"invalid-input\" as const;\n\n constructor() {\n super(\"Invalid automatic branch-switch setting\");\n this.name = \"AutomaticBranchSwitchSettingError\";\n }\n}\n\nexport function parseAutomaticBranchSwitchSetting(\n value: unknown,\n): AutomaticBranchSwitchMode {\n if (value === undefined || value === \"false\") return \"enabled\";\n if (value === \"true\") return \"disabled\";\n throw new AutomaticBranchSwitchSettingError();\n}\n\nexport const DEPLOYMENT_READY_STATES = Object.freeze([\n \"BLOCKED\",\n \"BUILDING\",\n \"CANCELED\",\n \"ERROR\",\n \"INITIALIZING\",\n \"QUEUED\",\n \"READY\",\n] as const);\n\nexport type DeploymentReadyState = (typeof DEPLOYMENT_READY_STATES)[number];\n\nexport function isDeploymentReadyState(\n value: unknown,\n): value is DeploymentReadyState {\n return (\n typeof value === \"string\" &&\n (DEPLOYMENT_READY_STATES as readonly string[]).includes(value)\n );\n}\n\nexport type DeploymentWarningCode =\n | \"metadata-persistence-failed\"\n | \"primary-merge-failed\"\n | \"publication-cleanup-failed\"\n | \"upload-unconfirmed\"\n | \"preview-unconfirmed\";\n\nexport type LifecycleOperationOutcome = {\n local: {\n status: \"completed\" | \"failed\";\n checkpointSha?: string;\n };\n upload: {\n status: \"not-attempted\" | \"confirmed\" | \"unconfirmed\" | \"failed\";\n sourceSha?: string;\n };\n preview: {\n status: \"not-attempted\" | \"accepted\" | \"unconfirmed\" | \"failed\";\n previewUrl?: string;\n deploymentId?: string;\n };\n publication: {\n status: \"not-attempted\" | \"confirmed\" | \"failed\" | \"pending\" | \"superseded\";\n revision?: string;\n recoveryId?: string;\n };\n};\n\nexport type LifecycleRecoveryKind =\n | \"ordinary-publication\"\n | \"deployment-upload\"\n | \"deployment-preview-unconfirmed\"\n | \"deployment-publication\";\n\nexport type LifecycleRecoveryOperation =\n \"create\" | \"duplicate\" | \"delete\" | \"deploy\";\n\nexport type LifecycleRecoveryValue = {\n recoveryId: string;\n operation: LifecycleRecoveryOperation;\n kind: LifecycleRecoveryKind;\n ref: PrototypeRef;\n sourceSha: string;\n previewUrl?: string;\n deploymentId?: string;\n readyState?: DeploymentReadyState;\n acceptedAt?: string;\n outcome: LifecycleOperationOutcome;\n};\n\n/** All unfinished recovery records returned during lifecycle hydration. */\nexport type LifecycleRecoveriesValue = readonly LifecycleRecoveryValue[];\n\nexport type LifecycleErrorCode =\n | \"unauthenticated\"\n | \"forbidden\"\n | \"invalid-input\"\n | \"not-found\"\n | \"already-exists\"\n | \"repository-busy\"\n | \"working-tree-conflict\"\n | \"protected-prototype-path\"\n | \"filesystem-failure\"\n | \"git-failure\"\n | \"deployment-failure\"\n | \"deployment-unavailable\"\n | \"timeout\"\n | \"unexpected-failure\";\n\nexport type LifecycleError = {\n code: LifecycleErrorCode;\n};\n\nexport type LifecycleResult<Value> =\n { ok: true; value: Value } | { ok: false; error: LifecycleError };\n\nexport type LifecycleRemoteStatus = \"pushed\" | \"local-only\" | \"manual\";\n\n/** Explicit result marker for filesystem-only lifecycle mutations. */\nexport type ManualFilesystemMutationValue = {\n remoteStatus: \"manual\";\n};\nexport type BranchPreparationStatus =\n \"ready\" | \"disabled\" | \"deferred\" | \"unsafe\";\n\nexport type BranchPreparationDeferredReason =\n | \"dirty-worktree\"\n | \"fetch-failed\"\n | \"merge-conflict\"\n | \"protected-collision\"\n | \"pending-recovery\";\n\nexport type BranchPreparationUnsafeReason =\n | \"detached-head\"\n | \"branch-changed\"\n | \"unresolved-operation\"\n | \"missing-primary\"\n | \"identity-divergence\"\n | \"failed-abort\"\n | \"merge-failed\"\n | \"push-failed\"\n | \"reconciliation-failed\";\n\nexport type BranchPreparationReason =\n BranchPreparationDeferredReason | BranchPreparationUnsafeReason;\n\nexport type BranchPreparationEffects = {\n changed: boolean;\n pushed: boolean;\n reconciledPaths: readonly string[];\n restartRequired: boolean;\n /** Platform paths changed by the committed-baseline reconciliation. */\n platformPaths?: readonly string[];\n /** Changed package manifests/lockfiles requiring dependency preparation. */\n dependencyPaths?: readonly string[];\n preparationRequired?: boolean;\n};\n\n/** Result of the existing dependency-installation boundary. */\nexport type DependencyPreparationValue = {\n status: \"not-required\" | \"prepared\" | \"failed\" | \"skipped\";\n dependencyPaths: readonly string[];\n /** True when a protected marker was consumed or retained. */\n pending: boolean;\n restartRequired: boolean;\n};\n\ntype BranchPreparationBase = {\n effects: BranchPreparationEffects;\n affectedPaths?: readonly string[];\n};\n\nexport type BranchPreparationValue =\n | (BranchPreparationBase & { status: \"ready\" })\n | (BranchPreparationBase & { status: \"disabled\" })\n | (BranchPreparationBase & {\n status: \"deferred\";\n reason: BranchPreparationDeferredReason;\n })\n | (BranchPreparationBase & {\n status: \"unsafe\";\n reason: BranchPreparationUnsafeReason;\n });\n\nexport type BranchPreparationAttention = Extract<\n BranchPreparationValue,\n { status: \"disabled\" | \"deferred\" | \"unsafe\" }\n>;\n\nexport type RepositorySummaryRefresh =\n | {\n status: \"refreshed\";\n summary: import(\"./git-management.js\").RepositorySummary;\n }\n | { status: \"failed\"; error: LifecycleErrorCode };\n\nexport type RepositoryUpdateValue = {\n preparation: BranchPreparationValue;\n summaryRefresh: RepositorySummaryRefresh;\n dependencyPreparation?: DependencyPreparationValue;\n};\n\nexport type LifecyclePrototypeValue = {\n ref: PrototypeRef;\n url: string;\n remoteStatus: LifecycleRemoteStatus;\n outcome?: LifecycleOperationOutcome;\n};\n\nexport type CreatePrototypeValue = LifecyclePrototypeValue;\nexport type DuplicatePrototypeValue = LifecyclePrototypeValue;\n\nexport type EditPrototypeValue = {\n edited: true;\n ref: PrototypeRef;\n};\n\nexport type DeletePrototypeValue = {\n deleted: true;\n ref: PrototypeRef;\n outcome?: LifecycleOperationOutcome;\n};\n\nexport type SavePrototypeValue = {\n saved: true;\n};\n\nexport type DiscardPrototypeValue = {\n discarded: true;\n};\n\ntype DeploymentValueBase = {\n ref: PrototypeRef;\n sourceSha: string;\n /** Legacy singular warning field; prefer warnings for new consumers. */\n warning: DeploymentWarningCode | undefined;\n /** Independent deployment and repository warnings, when available. */\n warnings?: readonly DeploymentWarningCode[];\n};\n\nexport type DeploymentValue =\n | (DeploymentValueBase & {\n deployed: true;\n previewUrl: string;\n deploymentId: string;\n readyState: DeploymentReadyState;\n outcome?: LifecycleOperationOutcome;\n })\n | (DeploymentValueBase & {\n deployed: false;\n previewUrl?: never;\n deploymentId?: never;\n readyState?: never;\n outcome: LifecycleOperationOutcome;\n });\n\nexport type DirtyObservationStatus = \"clean\" | \"dirty\";\n\nexport type DirtyObservationValue = {\n status: DirtyObservationStatus;\n /** Existing deployment preview, when one has been persisted. */\n previewUrl?: string | null;\n};\n\nexport function lifecycleSuccess<Value>(value: Value): LifecycleResult<Value> {\n return { ok: true, value };\n}\n\nexport function lifecycleFailure(\n code: LifecycleErrorCode,\n): LifecycleResult<never> {\n return { ok: false, error: { code } };\n}\n\nexport function isLifecycleSuccess<Value>(\n result: LifecycleResult<Value>,\n): result is { ok: true; value: Value } {\n return result.ok;\n}\n\nexport function isLifecycleFailure<Value>(\n result: LifecycleResult<Value>,\n): result is { ok: false; error: LifecycleError } {\n return !result.ok;\n}\n"]}
|
package/dist/lifecycle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAIA,MAAM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CAAC;IACnD,SAAS;IACT,UAAU;IACV,UAAU;IACV,OAAO;IACP,cAAc;IACd,QAAQ;IACR,OAAO;CACC,CAAC,CAAC;AAIZ,MAAM,UAAU,sBAAsB,CACpC,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACxB,uBAA6C,CAAC,QAAQ,CAAC,KAAK,CAAC,CAC/D,CAAC;AACJ,CAAC;AAkOD,MAAM,UAAU,gBAAgB,CAAQ,KAAY;IAClD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,IAAwB;IAExB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,MAA8B;IAE9B,OAAO,MAAM,CAAC,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,MAA8B;IAE9B,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;AACpB,CAAC","sourcesContent":["import type { PrototypeRef } from \"./prototype-ref.js\";\n\nexport type AutomaticBranchSwitchMode = \"enabled\" | \"disabled\";\n\nexport class AutomaticBranchSwitchSettingError extends Error {\n readonly code = \"invalid-input\" as const;\n\n constructor() {\n super(\"Invalid automatic branch-switch setting\");\n this.name = \"AutomaticBranchSwitchSettingError\";\n }\n}\n\nexport function parseAutomaticBranchSwitchSetting(\n value: unknown,\n): AutomaticBranchSwitchMode {\n if (value === undefined || value === \"false\") return \"enabled\";\n if (value === \"true\") return \"disabled\";\n throw new AutomaticBranchSwitchSettingError();\n}\n\nexport const DEPLOYMENT_READY_STATES = Object.freeze([\n \"BLOCKED\",\n \"BUILDING\",\n \"CANCELED\",\n \"ERROR\",\n \"INITIALIZING\",\n \"QUEUED\",\n \"READY\",\n] as const);\n\nexport type DeploymentReadyState = (typeof DEPLOYMENT_READY_STATES)[number];\n\nexport function isDeploymentReadyState(\n value: unknown,\n): value is DeploymentReadyState {\n return (\n typeof value === \"string\" &&\n (DEPLOYMENT_READY_STATES as readonly string[]).includes(value)\n );\n}\n\nexport type DeploymentWarningCode =\n | \"metadata-persistence-failed\"\n | \"primary-merge-failed\"\n | \"publication-cleanup-failed\"\n | \"upload-unconfirmed\"\n | \"preview-unconfirmed\";\n\nexport type LifecycleOperationOutcome = {\n local: {\n status: \"completed\" | \"failed\";\n checkpointSha?: string;\n };\n upload: {\n status: \"not-attempted\" | \"confirmed\" | \"unconfirmed\" | \"failed\";\n sourceSha?: string;\n };\n preview: {\n status: \"not-attempted\" | \"accepted\" | \"unconfirmed\" | \"failed\";\n previewUrl?: string;\n deploymentId?: string;\n };\n publication: {\n status: \"not-attempted\" | \"confirmed\" | \"failed\" | \"pending\" | \"superseded\";\n revision?: string;\n recoveryId?: string;\n };\n};\n\nexport type LifecycleRecoveryKind =\n | \"ordinary-publication\"\n | \"deployment-upload\"\n | \"deployment-preview-unconfirmed\"\n | \"deployment-publication\";\n\nexport type LifecycleRecoveryOperation =\n \"create\" | \"duplicate\" | \"delete\" | \"deploy\";\n\nexport type LifecycleRecoveryValue = {\n recoveryId: string;\n operation: LifecycleRecoveryOperation;\n kind: LifecycleRecoveryKind;\n ref: PrototypeRef;\n sourceSha: string;\n previewUrl?: string;\n deploymentId?: string;\n readyState?: DeploymentReadyState;\n acceptedAt?: string;\n outcome: LifecycleOperationOutcome;\n};\n\n/** All unfinished recovery records returned during lifecycle hydration. */\nexport type LifecycleRecoveriesValue = readonly LifecycleRecoveryValue[];\n\nexport type LifecycleErrorCode =\n | \"unauthenticated\"\n | \"forbidden\"\n | \"invalid-input\"\n | \"not-found\"\n | \"already-exists\"\n | \"repository-busy\"\n | \"working-tree-conflict\"\n | \"protected-prototype-path\"\n | \"filesystem-failure\"\n | \"git-failure\"\n | \"deployment-failure\"\n | \"deployment-unavailable\"\n | \"timeout\"\n | \"unexpected-failure\";\n\nexport type LifecycleError = {\n code: LifecycleErrorCode;\n};\n\nexport type LifecycleResult<Value> =\n { ok: true; value: Value } | { ok: false; error: LifecycleError };\n\nexport type LifecycleRemoteStatus = \"pushed\" | \"local-only\" | \"manual\";\n\n/** Explicit result marker for filesystem-only lifecycle mutations. */\nexport type ManualFilesystemMutationValue = {\n remoteStatus: \"manual\";\n};\nexport type BranchPreparationStatus =\n \"ready\" | \"disabled\" | \"deferred\" | \"unsafe\";\n\nexport type BranchPreparationDeferredReason =\n | \"dirty-worktree\"\n | \"fetch-failed\"\n | \"merge-conflict\"\n | \"protected-collision\"\n | \"pending-recovery\";\n\nexport type BranchPreparationUnsafeReason =\n | \"detached-head\"\n | \"branch-changed\"\n | \"unresolved-operation\"\n | \"missing-primary\"\n | \"identity-divergence\"\n | \"failed-abort\"\n | \"merge-failed\"\n | \"push-failed\"\n | \"reconciliation-failed\";\n\nexport type BranchPreparationReason =\n BranchPreparationDeferredReason | BranchPreparationUnsafeReason;\n\nexport type BranchPreparationEffects = {\n changed: boolean;\n pushed: boolean;\n reconciledPaths: readonly string[];\n restartRequired: boolean;\n /** Platform paths changed by the committed-baseline reconciliation. */\n platformPaths?: readonly string[];\n /** Changed package manifests/lockfiles requiring dependency preparation. */\n dependencyPaths?: readonly string[];\n preparationRequired?: boolean;\n};\n\n/** Result of the existing dependency-installation boundary. */\nexport type DependencyPreparationValue = {\n status: \"not-required\" | \"prepared\" | \"failed\" | \"skipped\";\n dependencyPaths: readonly string[];\n /** True when a protected marker was consumed or retained. */\n pending: boolean;\n restartRequired: boolean;\n};\n\ntype BranchPreparationBase = {\n effects: BranchPreparationEffects;\n affectedPaths?: readonly string[];\n};\n\nexport type BranchPreparationValue =\n | (BranchPreparationBase & { status: \"ready\" })\n | (BranchPreparationBase & { status: \"disabled\" })\n | (BranchPreparationBase & {\n status: \"deferred\";\n reason: BranchPreparationDeferredReason;\n })\n | (BranchPreparationBase & {\n status: \"unsafe\";\n reason: BranchPreparationUnsafeReason;\n });\n\nexport type BranchPreparationAttention = Extract<\n BranchPreparationValue,\n { status: \"disabled\" | \"deferred\" | \"unsafe\" }\n>;\n\nexport type RepositorySummaryRefresh =\n | {\n status: \"refreshed\";\n summary: import(\"./git-management.js\").RepositorySummary;\n }\n | { status: \"failed\"; error: LifecycleErrorCode };\n\nexport type RepositoryUpdateValue = {\n preparation: BranchPreparationValue;\n summaryRefresh: RepositorySummaryRefresh;\n dependencyPreparation?: DependencyPreparationValue;\n};\n\nexport type LifecyclePrototypeValue = {\n ref: PrototypeRef;\n url: string;\n remoteStatus: LifecycleRemoteStatus;\n outcome?: LifecycleOperationOutcome;\n};\n\nexport type CreatePrototypeValue = LifecyclePrototypeValue;\nexport type DuplicatePrototypeValue = LifecyclePrototypeValue;\n\nexport type EditPrototypeValue = {\n edited: true;\n ref: PrototypeRef;\n};\n\nexport type DeletePrototypeValue = {\n deleted: true;\n ref: PrototypeRef;\n outcome?: LifecycleOperationOutcome;\n};\n\nexport type SavePrototypeValue = {\n saved: true;\n};\n\nexport type DiscardPrototypeValue = {\n discarded: true;\n};\n\ntype DeploymentValueBase = {\n ref: PrototypeRef;\n sourceSha: string;\n /** Legacy singular warning field; prefer warnings for new consumers. */\n warning: DeploymentWarningCode | undefined;\n /** Independent deployment and repository warnings, when available. */\n warnings?: readonly DeploymentWarningCode[];\n};\n\nexport type DeploymentValue =\n | (DeploymentValueBase & {\n deployed: true;\n previewUrl: string;\n deploymentId: string;\n readyState: DeploymentReadyState;\n outcome?: LifecycleOperationOutcome;\n })\n | (DeploymentValueBase & {\n deployed: false;\n previewUrl?: never;\n deploymentId?: never;\n readyState?: never;\n outcome: LifecycleOperationOutcome;\n });\n\nexport type DirtyObservationStatus = \"clean\" | \"dirty\";\n\nexport type DirtyObservationValue = {\n status: DirtyObservationStatus;\n /** Existing deployment preview, when one has been persisted. */\n previewUrl?: string | null;\n};\n\nexport function lifecycleSuccess<Value>(value: Value): LifecycleResult<Value> {\n return { ok: true, value };\n}\n\nexport function lifecycleFailure(\n code: LifecycleErrorCode,\n): LifecycleResult<never> {\n return { ok: false, error: { code } };\n}\n\nexport function isLifecycleSuccess<Value>(\n result: LifecycleResult<Value>,\n): result is { ok: true; value: Value } {\n return result.ok;\n}\n\nexport function isLifecycleFailure<Value>(\n result: LifecycleResult<Value>,\n): result is { ok: false; error: LifecycleError } {\n return !result.ok;\n}\n"]}
|