@ebay-dt/bonfire-core 0.2.1 → 0.3.0-alpha.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/README.md +1 -0
- package/dist/git-management.d.ts.map +1 -1
- package/dist/git-management.js +1 -1
- package/dist/git-management.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lifecycle.d.ts +8 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -143,6 +143,7 @@ including uncommitted files.
|
|
|
143
143
|
Lifecycle errors contain only stable codes, never filesystem paths, Git output,
|
|
144
144
|
GitHub CLI output, or secrets. Hosts own user-facing copy for codes such as
|
|
145
145
|
`invalid-input`, `already-exists`, `repository-busy`, `working-tree-conflict`,
|
|
146
|
+
`wrong-branch`, `unresolved-operation`,
|
|
146
147
|
`git-failure`, and `filesystem-failure`.
|
|
147
148
|
|
|
148
149
|
Deployment uses the same validated `PrototypeCommandInput` as other
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-management.d.ts","sourceRoot":"","sources":["../src/git-management.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,eAAO,MAAM,SAAS,gCAAgD,CAAC;AACvE,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,IAAI,EAAG,eAAe,CAAU;IAEzC,cAGC;CACF;AAED,iFAAiF;AACjF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAI3D;AAED,eAAO,MAAM,2BAA2B,u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AC,EAAE,YAAY,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,OAAO,CAAC;IACd,mBAAmB,EAAE,OAAO,CAAC;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,OAAO,GACZ,yBAAyB,CAW3B;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,6EAA6E;IAC7E,oBAAoB,CAAC,EAAE,0BAA0B,CAAC;IAClD,kFAAkF;IAClF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,gFAAgF;IAChF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,mBAAmB,CAAC;IAC/B,WAAW,EAAE,0BAA0B,CAAC;IACxC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACrC,SAAS,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC9C,YAAY,EAAE,yBAAyB,CAAC;CACzC,CAAC","sourcesContent":["import type { BranchPreparationAttention } from \"./lifecycle.js\";\nimport type { PrototypeRef } from \"./prototype-ref.js\";\n\nexport const GIT_MODES = Object.freeze([\"managed\", \"manual\"] as const);\nexport type GitMode = (typeof GIT_MODES)[number];\n\nexport class GitModeSettingError extends Error {\n readonly code = \"invalid-input\" as const;\n\n constructor() {\n super(\"Invalid
|
|
1
|
+
{"version":3,"file":"git-management.d.ts","sourceRoot":"","sources":["../src/git-management.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,eAAO,MAAM,SAAS,gCAAg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IACpD,QAAQ,CAAC,IAAI,EAAG,eAAe,CAAU;IAEzC,cAGC;CACF;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,GACb,sBAAsB,CAuBxB;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,sBAAsB,CAAC;IAC7B,MAAM,EAAE,sBAAsB,CAAC;IAC/B,KAAK,EAAE,qBAAqB,CAAC;IAC7B,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,OAAO,CAAC;IACd,mBAAmB,EAAE,OAAO,CAAC;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,OAAO,GACZ,yBAAyB,CAW3B;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,6EAA6E;IAC7E,oBAAoB,CAAC,EAAE,0BAA0B,CAAC;IAClD,kFAAkF;IAClF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,gFAAgF;IAChF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,mBAAmB,CAAC;IAC/B,WAAW,EAAE,0BAA0B,CAAC;IACxC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACrC,SAAS,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC9C,YAAY,EAAE,yBAAyB,CAAC;CACzC,CAAC","sourcesContent":["import type { BranchPreparationAttention } from \"./lifecycle.js\";\nimport type { PrototypeRef } from \"./prototype-ref.js\";\n\nexport const GIT_MODES = Object.freeze([\"managed\", \"manual\"] as const);\nexport type GitMode = (typeof GIT_MODES)[number];\n\nexport class GitModeSettingError extends Error {\n readonly code = \"invalid-input\" as const;\n\n constructor() {\n super(\"Invalid BF_GIT_MODE; expected managed or manual\");\n this.name = \"GitModeSettingError\";\n }\n}\n\n/** Parse the public managed/manual setting. Undefined preserves managed mode. */\nexport function parseGitModeSetting(value: unknown): GitMode {\n if (value === undefined || value === \"managed\") return \"managed\";\n if (value === \"manual\") return \"manual\";\n throw new GitModeSettingError();\n}\n\nexport const REPOSITORY_READINESS_STATES = Object.freeze([\n \"ready\",\n \"checking\",\n \"attention\",\n \"blocked\",\n \"unavailable\",\n] as const);\nexport type RepositoryReadiness = (typeof REPOSITORY_READINESS_STATES)[number];\n\nexport function isRepositoryReadiness(\n value: unknown,\n): value is RepositoryReadiness {\n return (\n typeof value === \"string\" &&\n (REPOSITORY_READINESS_STATES as readonly string[]).includes(value)\n );\n}\n\nexport const REPOSITORY_UPDATE_CHECK_STATES = Object.freeze([\n \"not-checked\",\n \"checking\",\n \"up-to-date\",\n \"updates-available\",\n \"attention\",\n \"unavailable\",\n] as const);\nexport type RepositoryUpdateCheckState =\n (typeof REPOSITORY_UPDATE_CHECK_STATES)[number];\n\nexport function isRepositoryUpdateCheckState(\n value: unknown,\n): value is RepositoryUpdateCheckState {\n return (\n typeof value === \"string\" &&\n (REPOSITORY_UPDATE_CHECK_STATES as readonly string[]).includes(value)\n );\n}\n\nexport const MANAGED_REPOSITORY_PATHS = Object.freeze([\n \"package.json\",\n \"pnpm-lock.yaml\",\n \"package-lock.json\",\n] as const);\n\nexport const REPOSITORY_ATTENTION_CODES = Object.freeze([\n \"dirty-worktree\",\n \"fetch-failed\",\n \"merge-conflict\",\n \"wrong-branch\",\n \"detached-head\",\n \"unresolved-operation\",\n \"missing-primary\",\n \"push-failed\",\n \"configuration-invalid\",\n \"unknown\",\n] as const);\nexport type RepositoryAttentionCode =\n (typeof REPOSITORY_ATTENTION_CODES)[number];\n\nexport const REPOSITORY_CHANGE_STATUSES = Object.freeze([\n \"uncommitted\",\n \"committed-unpushed\",\n \"updates-available\",\n \"unresolved\",\n \"deployment-attention\",\n] as const);\nexport type RepositoryChangeStatus =\n (typeof REPOSITORY_CHANGE_STATUSES)[number];\n\nexport const REPOSITORY_CHANGE_SCOPES = Object.freeze([\n \"active-prototype\",\n \"owned-prototype\",\n \"other-prototype\",\n \"out-of-scope\",\n \"unknown\",\n] as const);\nexport type RepositoryChangeScope = (typeof REPOSITORY_CHANGE_SCOPES)[number];\n\nexport type RepositoryRelativePath = string & {\n readonly __repositoryRelativePath: unique symbol;\n};\n\nexport class RepositoryRelativePathError extends Error {\n readonly code = \"invalid-input\" as const;\n\n constructor() {\n super(\"Invalid repository-relative path\");\n this.name = \"RepositoryRelativePathError\";\n }\n}\n\n/**\n * Accept only normalized, repository-relative paths suitable for a client\n * summary. Git-specific quoting, absolute paths, and parent traversal are not\n * part of the public contract.\n */\nexport function parseRepositoryRelativePath(\n value: unknown,\n): RepositoryRelativePath {\n if (\n typeof value !== \"string\" ||\n value.length === 0 ||\n value.length > 4096 ||\n value.includes(\"\\0\") ||\n value.includes(\"\\\\\") ||\n value.startsWith(\"/\") ||\n /^[A-Za-z]:/u.test(value)\n ) {\n throw new RepositoryRelativePathError();\n }\n\n const segments = value.split(\"/\");\n if (\n segments.some(\n (segment) => segment.length === 0 || segment === \".\" || segment === \"..\",\n )\n ) {\n throw new RepositoryRelativePathError();\n }\n\n return value as RepositoryRelativePath;\n}\n\nexport type RepositoryChange = {\n path: RepositoryRelativePath;\n status: RepositoryChangeStatus;\n scope: RepositoryChangeScope;\n prototype?: PrototypeRef;\n};\n\nexport type GitManagementCapabilities = {\n mode: GitMode;\n filesystemLifecycle: boolean;\n gitObservation: boolean;\n save: boolean;\n discard: boolean;\n getUpdates: boolean;\n deploy: boolean;\n};\n\nexport function getGitManagementCapabilities(\n mode: GitMode,\n): GitManagementCapabilities {\n const managed = mode === \"managed\";\n return {\n mode,\n filesystemLifecycle: true,\n gitObservation: true,\n save: managed,\n discard: managed,\n getUpdates: managed,\n deploy: managed,\n };\n}\n\nexport type RepositorySummary = {\n mode: GitMode;\n /** The latest non-ready preparation attempt, retained across clean reads. */\n preparationAttention?: BranchPreparationAttention;\n /** A protected installation marker remains, including after a process restart. */\n preparationPending?: boolean;\n /** The running development server must restart to load updated dependencies. */\n restartRequired?: boolean;\n readiness: RepositoryReadiness;\n updateCheck: RepositoryUpdateCheckState;\n changes: readonly RepositoryChange[];\n attention: readonly RepositoryAttentionCode[];\n capabilities: GitManagementCapabilities;\n};\n"]}
|
package/dist/git-management.js
CHANGED
|
@@ -2,7 +2,7 @@ export const GIT_MODES = Object.freeze(["managed", "manual"]);
|
|
|
2
2
|
export class GitModeSettingError extends Error {
|
|
3
3
|
code = "invalid-input";
|
|
4
4
|
constructor() {
|
|
5
|
-
super("Invalid
|
|
5
|
+
super("Invalid BF_GIT_MODE; expected managed or manual");
|
|
6
6
|
this.name = "GitModeSettingError";
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-management.js","sourceRoot":"","sources":["../src/git-management.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAU,CAAC,CAAC;AAGvE,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACnC,IAAI,GAAG,eAAwB,CAAC;IAEzC;QACE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"git-management.js","sourceRoot":"","sources":["../src/git-management.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAU,CAAC,CAAC;AAGvE,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACnC,IAAI,GAAG,eAAwB,CAAC;IAEzC;QACE,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACzD,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,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AAmB,EAAE,IAAI;QACzB,cAAc,EAAE,IAAI;QACpB,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,OAAO;QAChB,UAAU,EAAE,OAAO;QACnB,MAAM,EAAE,OAAO;KAChB,CAAC;AACJ,CAAC","sourcesContent":["import type { BranchPreparationAttention } from \"./lifecycle.js\";\nimport type { PrototypeRef } from \"./prototype-ref.js\";\n\nexport const GIT_MODES = Object.freeze([\"managed\", \"manual\"] as const);\nexport type GitMode = (typeof GIT_MODES)[number];\n\nexport class GitModeSettingError extends Error {\n readonly code = \"invalid-input\" as const;\n\n constructor() {\n super(\"Invalid BF_GIT_MODE; expected managed or manual\");\n this.name = \"GitModeSettingError\";\n }\n}\n\n/** Parse the public managed/manual setting. Undefined preserves managed mode. */\nexport function parseGitModeSetting(value: unknown): GitMode {\n if (value === undefined || value === \"managed\") return \"managed\";\n if (value === \"manual\") return \"manual\";\n throw new GitModeSettingError();\n}\n\nexport const REPOSITORY_READINESS_STATES = Object.freeze([\n \"ready\",\n \"checking\",\n \"attention\",\n \"blocked\",\n \"unavailable\",\n] as const);\nexport type RepositoryReadiness = (typeof REPOSITORY_READINESS_STATES)[number];\n\nexport function isRepositoryReadiness(\n value: unknown,\n): value is RepositoryReadiness {\n return (\n typeof value === \"string\" &&\n (REPOSITORY_READINESS_STATES as readonly string[]).includes(value)\n );\n}\n\nexport const REPOSITORY_UPDATE_CHECK_STATES = Object.freeze([\n \"not-checked\",\n \"checking\",\n \"up-to-date\",\n \"updates-available\",\n \"attention\",\n \"unavailable\",\n] as const);\nexport type RepositoryUpdateCheckState =\n (typeof REPOSITORY_UPDATE_CHECK_STATES)[number];\n\nexport function isRepositoryUpdateCheckState(\n value: unknown,\n): value is RepositoryUpdateCheckState {\n return (\n typeof value === \"string\" &&\n (REPOSITORY_UPDATE_CHECK_STATES as readonly string[]).includes(value)\n );\n}\n\nexport const MANAGED_REPOSITORY_PATHS = Object.freeze([\n \"package.json\",\n \"pnpm-lock.yaml\",\n \"package-lock.json\",\n] as const);\n\nexport const REPOSITORY_ATTENTION_CODES = Object.freeze([\n \"dirty-worktree\",\n \"fetch-failed\",\n \"merge-conflict\",\n \"wrong-branch\",\n \"detached-head\",\n \"unresolved-operation\",\n \"missing-primary\",\n \"push-failed\",\n \"configuration-invalid\",\n \"unknown\",\n] as const);\nexport type RepositoryAttentionCode =\n (typeof REPOSITORY_ATTENTION_CODES)[number];\n\nexport const REPOSITORY_CHANGE_STATUSES = Object.freeze([\n \"uncommitted\",\n \"committed-unpushed\",\n \"updates-available\",\n \"unresolved\",\n \"deployment-attention\",\n] as const);\nexport type RepositoryChangeStatus =\n (typeof REPOSITORY_CHANGE_STATUSES)[number];\n\nexport const REPOSITORY_CHANGE_SCOPES = Object.freeze([\n \"active-prototype\",\n \"owned-prototype\",\n \"other-prototype\",\n \"out-of-scope\",\n \"unknown\",\n] as const);\nexport type RepositoryChangeScope = (typeof REPOSITORY_CHANGE_SCOPES)[number];\n\nexport type RepositoryRelativePath = string & {\n readonly __repositoryRelativePath: unique symbol;\n};\n\nexport class RepositoryRelativePathError extends Error {\n readonly code = \"invalid-input\" as const;\n\n constructor() {\n super(\"Invalid repository-relative path\");\n this.name = \"RepositoryRelativePathError\";\n }\n}\n\n/**\n * Accept only normalized, repository-relative paths suitable for a client\n * summary. Git-specific quoting, absolute paths, and parent traversal are not\n * part of the public contract.\n */\nexport function parseRepositoryRelativePath(\n value: unknown,\n): RepositoryRelativePath {\n if (\n typeof value !== \"string\" ||\n value.length === 0 ||\n value.length > 4096 ||\n value.includes(\"\\0\") ||\n value.includes(\"\\\\\") ||\n value.startsWith(\"/\") ||\n /^[A-Za-z]:/u.test(value)\n ) {\n throw new RepositoryRelativePathError();\n }\n\n const segments = value.split(\"/\");\n if (\n segments.some(\n (segment) => segment.length === 0 || segment === \".\" || segment === \"..\",\n )\n ) {\n throw new RepositoryRelativePathError();\n }\n\n return value as RepositoryRelativePath;\n}\n\nexport type RepositoryChange = {\n path: RepositoryRelativePath;\n status: RepositoryChangeStatus;\n scope: RepositoryChangeScope;\n prototype?: PrototypeRef;\n};\n\nexport type GitManagementCapabilities = {\n mode: GitMode;\n filesystemLifecycle: boolean;\n gitObservation: boolean;\n save: boolean;\n discard: boolean;\n getUpdates: boolean;\n deploy: boolean;\n};\n\nexport function getGitManagementCapabilities(\n mode: GitMode,\n): GitManagementCapabilities {\n const managed = mode === \"managed\";\n return {\n mode,\n filesystemLifecycle: true,\n gitObservation: true,\n save: managed,\n discard: managed,\n getUpdates: managed,\n deploy: managed,\n };\n}\n\nexport type RepositorySummary = {\n mode: GitMode;\n /** The latest non-ready preparation attempt, retained across clean reads. */\n preparationAttention?: BranchPreparationAttention;\n /** A protected installation marker remains, including after a process restart. */\n preparationPending?: boolean;\n /** The running development server must restart to load updated dependencies. */\n restartRequired?: boolean;\n readiness: RepositoryReadiness;\n updateCheck: RepositoryUpdateCheckState;\n changes: readonly RepositoryChange[];\n attention: readonly RepositoryAttentionCode[];\n capabilities: GitManagementCapabilities;\n};\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export type { PrototypeRef } from "./prototype-ref.js";
|
|
|
9
9
|
export { definePrototypeSummary, parsePrototypeMetadata, PrototypeMetadataError, type PrototypeMetadata, type PrototypeSummary, type PrototypeMetadataParseOptions, } from "./prototype-metadata.js";
|
|
10
10
|
export { filterPrototypes, getPrototypeAuthorOptions, sortPrototypes, type PrototypeAuthorOption, type PrototypeAuthorSelection, type PrototypeCatalogQuery, type PrototypeDashboardModel, type PrototypeSort, } from "./prototype-catalog.js";
|
|
11
11
|
export { GIT_MODES, GitModeSettingError, REPOSITORY_ATTENTION_CODES, MANAGED_REPOSITORY_PATHS, REPOSITORY_CHANGE_SCOPES, REPOSITORY_CHANGE_STATUSES, REPOSITORY_READINESS_STATES, REPOSITORY_UPDATE_CHECK_STATES, getGitManagementCapabilities, isRepositoryReadiness, isRepositoryUpdateCheckState, parseGitModeSetting, parseRepositoryRelativePath, RepositoryRelativePathError, type GitManagementCapabilities, type GitMode, type RepositoryAttentionCode, type RepositoryChange, type RepositoryChangeScope, type RepositoryChangeStatus, type RepositoryReadiness, type RepositoryRelativePath, type RepositorySummary, type RepositoryUpdateCheckState, } from "./git-management.js";
|
|
12
|
-
export { AutomaticBranchSwitchSettingError, DEPLOYMENT_READY_STATES, isDeploymentReadyState, isLifecycleFailure, isLifecycleSuccess, parseAutomaticBranchSwitchSetting, lifecycleFailure, lifecycleSuccess, type AutomaticBranchSwitchMode, type BranchPreparationAttention, type BranchPreparationDeferredReason, type DependencyPreparationValue, type BranchPreparationEffects, type BranchPreparationReason, type BranchPreparationUnsafeReason, type RepositorySummaryRefresh, type RepositoryUpdateValue, type DeploymentReadyState, type DeploymentValue, type DeploymentWarningCode, type LifecycleOperationOutcome, type LifecycleRecoveryKind, type LifecycleRecoveryOperation, type LifecycleRecoveryValue, type LifecycleRecoveriesValue, type BranchPreparationStatus, type BranchPreparationValue, type CreatePrototypeValue, type DeletePrototypeValue, type DirtyObservationStatus, type DirtyObservationValue, type DiscardPrototypeValue, type DuplicatePrototypeValue, type EditPrototypeValue, type LifecycleError, type LifecycleErrorCode, type LifecyclePrototypeValue, type ManualFilesystemMutationValue, type LifecycleRemoteStatus, type LifecycleResult, type SavePrototypeValue, } from "./lifecycle.js";
|
|
12
|
+
export { AutomaticBranchSwitchSettingError, DEPLOYMENT_READY_STATES, isDeploymentReadyState, isLifecycleFailure, isLifecycleSuccess, parseAutomaticBranchSwitchSetting, lifecycleFailure, lifecycleSuccess, type AutomaticBranchSwitchMode, type BranchPreparationAttention, type BranchPreparationDeferredReason, type BranchPreparationDiagnostic, type DependencyPreparationValue, type BranchPreparationEffects, type BranchPreparationReason, type BranchPreparationUnsafeReason, type RepositorySummaryRefresh, type RepositoryUpdateValue, type DeploymentReadyState, type DeploymentValue, type DeploymentWarningCode, type LifecycleOperationOutcome, type LifecycleRecoveryKind, type LifecycleRecoveryOperation, type LifecycleRecoveryValue, type LifecycleRecoveriesValue, type BranchPreparationStatus, type BranchPreparationValue, type CreatePrototypeValue, type DeletePrototypeValue, type DirtyObservationStatus, type DirtyObservationValue, type DiscardPrototypeValue, type DuplicatePrototypeValue, type EditPrototypeValue, type LifecycleError, type LifecycleErrorCode, type LifecyclePrototypeValue, type ManualFilesystemMutationValue, type LifecycleRemoteStatus, type LifecycleResult, type SavePrototypeValue, } from "./lifecycle.js";
|
|
13
13
|
export { LifecycleInputError, parseCreatePrototypeInput, parseDuplicatePrototypeInput, parseEditPrototypeInput, parsePrototypeCommandInput, PROTOTYPE_DESCRIPTION_MAX_CODE_POINTS, PROTOTYPE_TITLE_MAX_CODE_POINTS, type CreatePrototypeInput, type DuplicatePrototypeInput, type EditPrototypeInput, type PrototypeCommandInput, } from "./lifecycle-input.js";
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,mBAAmB,EACnB,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,KAAK,KAAK,EACV,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,iBAA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C,EACjC,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,iCAAiC,EACjC,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,EAC1B,qCAAqC,EACrC,+BAA+B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC","sourcesContent":["export {\n defineConfig,\n getSessionCookieName,\n parseHostname,\n type BonfireConfig,\n type BonfireConfigInput,\n} from \"./config.js\";\nexport {\n COLOR_SCHEMES,\n createDefaultPrototypeTheme,\n parsePrototypeTheme,\n parsePrototypeThemeSelection,\n parseThemeRegistry,\n ThemeValidationError,\n type ColorScheme,\n type PrototypeTheme,\n type PrototypeThemeSelection,\n type ThemeDefinition,\n type ThemeRegistry,\n} from \"./theme.js\";\nexport {\n parseBonfireIdentity,\n BonfireIdentityError,\n type BonfireIdentity,\n} from \"./identity.js\";\nexport {\n AgentInputError,\n parseAgent,\n parseAgentCommand,\n parseOpenInAgentInput,\n parseOpenInClaudeCodeInput,\n parseTerminalApp,\n parseUserPreferences,\n TERMINAL_APPS,\n type Agent,\n type AgentActionError,\n type AgentActionErrorCode,\n type AgentActionResult,\n type AgentCommand,\n type AgentLaunchValue,\n type OpenInAgentInput,\n type PrototypePathValue,\n type OpenInClaudeCodeInput,\n type TerminalApp,\n type UserPreferences,\n} from \"./agent.js\";\nexport type { GitHubCliLoginPageModel } from \"./auth-model.js\";\nexport { resolvePrimaryBranch } from \"./primary-branch.js\";\nexport {\n definePrototypeRef,\n getPrototypeUrl,\n parsePrototypePath,\n PrototypeRefError,\n slugifyPrototypeTitle,\n} from \"./prototype-ref.js\";\nexport type { PrototypeRef } from \"./prototype-ref.js\";\nexport {\n definePrototypeSummary,\n parsePrototypeMetadata,\n PrototypeMetadataError,\n type PrototypeMetadata,\n type PrototypeSummary,\n type PrototypeMetadataParseOptions,\n} from \"./prototype-metadata.js\";\nexport {\n filterPrototypes,\n getPrototypeAuthorOptions,\n sortPrototypes,\n type PrototypeAuthorOption,\n type PrototypeAuthorSelection,\n type PrototypeCatalogQuery,\n type PrototypeDashboardModel,\n type PrototypeSort,\n} from \"./prototype-catalog.js\";\nexport {\n GIT_MODES,\n GitModeSettingError,\n REPOSITORY_ATTENTION_CODES,\n MANAGED_REPOSITORY_PATHS,\n REPOSITORY_CHANGE_SCOPES,\n REPOSITORY_CHANGE_STATUSES,\n REPOSITORY_READINESS_STATES,\n REPOSITORY_UPDATE_CHECK_STATES,\n getGitManagementCapabilities,\n isRepositoryReadiness,\n isRepositoryUpdateCheckState,\n parseGitModeSetting,\n parseRepositoryRelativePath,\n RepositoryRelativePathError,\n type GitManagementCapabilities,\n type GitMode,\n type RepositoryAttentionCode,\n type RepositoryChange,\n type RepositoryChangeScope,\n type RepositoryChangeStatus,\n type RepositoryReadiness,\n type RepositoryRelativePath,\n type RepositorySummary,\n type RepositoryUpdateCheckState,\n} from \"./git-management.js\";\nexport {\n AutomaticBranchSwitchSettingError,\n DEPLOYMENT_READY_STATES,\n isDeploymentReadyState,\n isLifecycleFailure,\n isLifecycleSuccess,\n parseAutomaticBranchSwitchSetting,\n lifecycleFailure,\n lifecycleSuccess,\n type AutomaticBranchSwitchMode,\n type BranchPreparationAttention,\n type BranchPreparationDeferredReason,\n type DependencyPreparationValue,\n type BranchPreparationEffects,\n type BranchPreparationReason,\n type BranchPreparationUnsafeReason,\n type RepositorySummaryRefresh,\n type RepositoryUpdateValue,\n type DeploymentReadyState,\n type DeploymentValue,\n type DeploymentWarningCode,\n type LifecycleOperationOutcome,\n type LifecycleRecoveryKind,\n type LifecycleRecoveryOperation,\n type LifecycleRecoveryValue,\n type LifecycleRecoveriesValue,\n type BranchPreparationStatus,\n type BranchPreparationValue,\n type CreatePrototypeValue,\n type DeletePrototypeValue,\n type DirtyObservationStatus,\n type DirtyObservationValue,\n type DiscardPrototypeValue,\n type DuplicatePrototypeValue,\n type EditPrototypeValue,\n type LifecycleError,\n type LifecycleErrorCode,\n type LifecyclePrototypeValue,\n type ManualFilesystemMutationValue,\n type LifecycleRemoteStatus,\n type LifecycleResult,\n type SavePrototypeValue,\n} from \"./lifecycle.js\";\nexport {\n LifecycleInputError,\n parseCreatePrototypeInput,\n parseDuplicatePrototypeInput,\n parseEditPrototypeInput,\n parsePrototypeCommandInput,\n PROTOTYPE_DESCRIPTION_MAX_CODE_POINTS,\n PROTOTYPE_TITLE_MAX_CODE_POINTS,\n type CreatePrototypeInput,\n type DuplicatePrototypeInput,\n type EditPrototypeInput,\n type PrototypeCommandInput,\n} from \"./lifecycle-input.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot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,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,EAC1B,qCAAqC,EACrC,+BAA+B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC","sourcesContent":["export {\n defineConfig,\n getSessionCookieName,\n parseHostname,\n type BonfireConfig,\n type BonfireConfigInput,\n} from \"./config.js\";\nexport {\n COLOR_SCHEMES,\n createDefaultPrototypeTheme,\n parsePrototypeTheme,\n parsePrototypeThemeSelection,\n parseThemeRegistry,\n ThemeValidationError,\n type ColorScheme,\n type PrototypeTheme,\n type PrototypeThemeSelection,\n type ThemeDefinition,\n type ThemeRegistry,\n} from \"./theme.js\";\nexport {\n parseBonfireIdentity,\n BonfireIdentityError,\n type BonfireIdentity,\n} from \"./identity.js\";\nexport {\n AgentInputError,\n parseAgent,\n parseAgentCommand,\n parseOpenInAgentInput,\n parseOpenInClaudeCodeInput,\n parseTerminalApp,\n parseUserPreferences,\n TERMINAL_APPS,\n type Agent,\n type AgentActionError,\n type AgentActionErrorCode,\n type AgentActionResult,\n type AgentCommand,\n type AgentLaunchValue,\n type OpenInAgentInput,\n type PrototypePathValue,\n type OpenInClaudeCodeInput,\n type TerminalApp,\n type UserPreferences,\n} from \"./agent.js\";\nexport type { GitHubCliLoginPageModel } from \"./auth-model.js\";\nexport { resolvePrimaryBranch } from \"./primary-branch.js\";\nexport {\n definePrototypeRef,\n getPrototypeUrl,\n parsePrototypePath,\n PrototypeRefError,\n slugifyPrototypeTitle,\n} from \"./prototype-ref.js\";\nexport type { PrototypeRef } from \"./prototype-ref.js\";\nexport {\n definePrototypeSummary,\n parsePrototypeMetadata,\n PrototypeMetadataError,\n type PrototypeMetadata,\n type PrototypeSummary,\n type PrototypeMetadataParseOptions,\n} from \"./prototype-metadata.js\";\nexport {\n filterPrototypes,\n getPrototypeAuthorOptions,\n sortPrototypes,\n type PrototypeAuthorOption,\n type PrototypeAuthorSelection,\n type PrototypeCatalogQuery,\n type PrototypeDashboardModel,\n type PrototypeSort,\n} from \"./prototype-catalog.js\";\nexport {\n GIT_MODES,\n GitModeSettingError,\n REPOSITORY_ATTENTION_CODES,\n MANAGED_REPOSITORY_PATHS,\n REPOSITORY_CHANGE_SCOPES,\n REPOSITORY_CHANGE_STATUSES,\n REPOSITORY_READINESS_STATES,\n REPOSITORY_UPDATE_CHECK_STATES,\n getGitManagementCapabilities,\n isRepositoryReadiness,\n isRepositoryUpdateCheckState,\n parseGitModeSetting,\n parseRepositoryRelativePath,\n RepositoryRelativePathError,\n type GitManagementCapabilities,\n type GitMode,\n type RepositoryAttentionCode,\n type RepositoryChange,\n type RepositoryChangeScope,\n type RepositoryChangeStatus,\n type RepositoryReadiness,\n type RepositoryRelativePath,\n type RepositorySummary,\n type RepositoryUpdateCheckState,\n} from \"./git-management.js\";\nexport {\n AutomaticBranchSwitchSettingError,\n DEPLOYMENT_READY_STATES,\n isDeploymentReadyState,\n isLifecycleFailure,\n isLifecycleSuccess,\n parseAutomaticBranchSwitchSetting,\n lifecycleFailure,\n lifecycleSuccess,\n type AutomaticBranchSwitchMode,\n type BranchPreparationAttention,\n type BranchPreparationDeferredReason,\n type BranchPreparationDiagnostic,\n type DependencyPreparationValue,\n type BranchPreparationEffects,\n type BranchPreparationReason,\n type BranchPreparationUnsafeReason,\n type RepositorySummaryRefresh,\n type RepositoryUpdateValue,\n type DeploymentReadyState,\n type DeploymentValue,\n type DeploymentWarningCode,\n type LifecycleOperationOutcome,\n type LifecycleRecoveryKind,\n type LifecycleRecoveryOperation,\n type LifecycleRecoveryValue,\n type LifecycleRecoveriesValue,\n type BranchPreparationStatus,\n type BranchPreparationValue,\n type CreatePrototypeValue,\n type DeletePrototypeValue,\n type DirtyObservationStatus,\n type DirtyObservationValue,\n type DiscardPrototypeValue,\n type DuplicatePrototypeValue,\n type EditPrototypeValue,\n type LifecycleError,\n type LifecycleErrorCode,\n type LifecyclePrototypeValue,\n type ManualFilesystemMutationValue,\n type LifecycleRemoteStatus,\n type LifecycleResult,\n type SavePrototypeValue,\n} from \"./lifecycle.js\";\nexport {\n LifecycleInputError,\n parseCreatePrototypeInput,\n parseDuplicatePrototypeInput,\n parseEditPrototypeInput,\n parsePrototypeCommandInput,\n PROTOTYPE_DESCRIPTION_MAX_CODE_POINTS,\n PROTOTYPE_TITLE_MAX_CODE_POINTS,\n type CreatePrototypeInput,\n type DuplicatePrototypeInput,\n type EditPrototypeInput,\n type PrototypeCommandInput,\n} from \"./lifecycle-input.js\";\n"]}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,aAAa,GAGd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,mBAAmB,EACnB,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,GAMrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GAErB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GAYd,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GAIvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,GAMf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,EAC9B,4BAA4B,EAC5B,qBAAqB,EACrB,4BAA4B,EAC5B,mBAAmB,EACnB,2BAA2B,EAC3B,2BAA2B,GAW5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,iCAAiC,EACjC,gBAAgB,EAChB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,aAAa,GAGd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,mBAAmB,EACnB,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,GAMrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GAErB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GAYd,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GAIvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,GAMf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,EAC9B,4BAA4B,EAC5B,qBAAqB,EACrB,4BAA4B,EAC5B,mBAAmB,EACnB,2BAA2B,EAC3B,2BAA2B,GAW5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,iCAAiC,EACjC,gBAAgB,EAChB,gBAAgB,GAmCjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,EAC1B,qCAAqC,EACrC,+BAA+B,GAKhC,MAAM,sBAAsB,CAAC","sourcesContent":["export {\n defineConfig,\n getSessionCookieName,\n parseHostname,\n type BonfireConfig,\n type BonfireConfigInput,\n} from \"./config.js\";\nexport {\n COLOR_SCHEMES,\n createDefaultPrototypeTheme,\n parsePrototypeTheme,\n parsePrototypeThemeSelection,\n parseThemeRegistry,\n ThemeValidationError,\n type ColorScheme,\n type PrototypeTheme,\n type PrototypeThemeSelection,\n type ThemeDefinition,\n type ThemeRegistry,\n} from \"./theme.js\";\nexport {\n parseBonfireIdentity,\n BonfireIdentityError,\n type BonfireIdentity,\n} from \"./identity.js\";\nexport {\n AgentInputError,\n parseAgent,\n parseAgentCommand,\n parseOpenInAgentInput,\n parseOpenInClaudeCodeInput,\n parseTerminalApp,\n parseUserPreferences,\n TERMINAL_APPS,\n type Agent,\n type AgentActionError,\n type AgentActionErrorCode,\n type AgentActionResult,\n type AgentCommand,\n type AgentLaunchValue,\n type OpenInAgentInput,\n type PrototypePathValue,\n type OpenInClaudeCodeInput,\n type TerminalApp,\n type UserPreferences,\n} from \"./agent.js\";\nexport type { GitHubCliLoginPageModel } from \"./auth-model.js\";\nexport { resolvePrimaryBranch } from \"./primary-branch.js\";\nexport {\n definePrototypeRef,\n getPrototypeUrl,\n parsePrototypePath,\n PrototypeRefError,\n slugifyPrototypeTitle,\n} from \"./prototype-ref.js\";\nexport type { PrototypeRef } from \"./prototype-ref.js\";\nexport {\n definePrototypeSummary,\n parsePrototypeMetadata,\n PrototypeMetadataError,\n type PrototypeMetadata,\n type PrototypeSummary,\n type PrototypeMetadataParseOptions,\n} from \"./prototype-metadata.js\";\nexport {\n filterPrototypes,\n getPrototypeAuthorOptions,\n sortPrototypes,\n type PrototypeAuthorOption,\n type PrototypeAuthorSelection,\n type PrototypeCatalogQuery,\n type PrototypeDashboardModel,\n type PrototypeSort,\n} from \"./prototype-catalog.js\";\nexport {\n GIT_MODES,\n GitModeSettingError,\n REPOSITORY_ATTENTION_CODES,\n MANAGED_REPOSITORY_PATHS,\n REPOSITORY_CHANGE_SCOPES,\n REPOSITORY_CHANGE_STATUSES,\n REPOSITORY_READINESS_STATES,\n REPOSITORY_UPDATE_CHECK_STATES,\n getGitManagementCapabilities,\n isRepositoryReadiness,\n isRepositoryUpdateCheckState,\n parseGitModeSetting,\n parseRepositoryRelativePath,\n RepositoryRelativePathError,\n type GitManagementCapabilities,\n type GitMode,\n type RepositoryAttentionCode,\n type RepositoryChange,\n type RepositoryChangeScope,\n type RepositoryChangeStatus,\n type RepositoryReadiness,\n type RepositoryRelativePath,\n type RepositorySummary,\n type RepositoryUpdateCheckState,\n} from \"./git-management.js\";\nexport {\n AutomaticBranchSwitchSettingError,\n DEPLOYMENT_READY_STATES,\n isDeploymentReadyState,\n isLifecycleFailure,\n isLifecycleSuccess,\n parseAutomaticBranchSwitchSetting,\n lifecycleFailure,\n lifecycleSuccess,\n type AutomaticBranchSwitchMode,\n type BranchPreparationAttention,\n type BranchPreparationDeferredReason,\n type BranchPreparationDiagnostic,\n type DependencyPreparationValue,\n type BranchPreparationEffects,\n type BranchPreparationReason,\n type BranchPreparationUnsafeReason,\n type RepositorySummaryRefresh,\n type RepositoryUpdateValue,\n type DeploymentReadyState,\n type DeploymentValue,\n type DeploymentWarningCode,\n type LifecycleOperationOutcome,\n type LifecycleRecoveryKind,\n type LifecycleRecoveryOperation,\n type LifecycleRecoveryValue,\n type LifecycleRecoveriesValue,\n type BranchPreparationStatus,\n type BranchPreparationValue,\n type CreatePrototypeValue,\n type DeletePrototypeValue,\n type DirtyObservationStatus,\n type DirtyObservationValue,\n type DiscardPrototypeValue,\n type DuplicatePrototypeValue,\n type EditPrototypeValue,\n type LifecycleError,\n type LifecycleErrorCode,\n type LifecyclePrototypeValue,\n type ManualFilesystemMutationValue,\n type LifecycleRemoteStatus,\n type LifecycleResult,\n type SavePrototypeValue,\n} from \"./lifecycle.js\";\nexport {\n LifecycleInputError,\n parseCreatePrototypeInput,\n parseDuplicatePrototypeInput,\n parseEditPrototypeInput,\n parsePrototypeCommandInput,\n PROTOTYPE_DESCRIPTION_MAX_CODE_POINTS,\n PROTOTYPE_TITLE_MAX_CODE_POINTS,\n type CreatePrototypeInput,\n type DuplicatePrototypeInput,\n type EditPrototypeInput,\n type PrototypeCommandInput,\n} from \"./lifecycle-input.js\";\n"]}
|
package/dist/lifecycle.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export type LifecycleRecoveryValue = {
|
|
|
45
45
|
};
|
|
46
46
|
/** All unfinished recovery records returned during lifecycle hydration. */
|
|
47
47
|
export type LifecycleRecoveriesValue = readonly LifecycleRecoveryValue[];
|
|
48
|
-
export type LifecycleErrorCode = "unauthenticated" | "forbidden" | "invalid-input" | "not-found" | "already-exists" | "repository-busy" | "working-tree-conflict" | "protected-prototype-path" | "filesystem-failure" | "git-failure" | "deployment-failure" | "deployment-unavailable" | "timeout" | "unexpected-failure";
|
|
48
|
+
export type LifecycleErrorCode = "unauthenticated" | "forbidden" | "invalid-input" | "not-found" | "already-exists" | "repository-busy" | "working-tree-conflict" | "wrong-branch" | "unresolved-operation" | "protected-prototype-path" | "filesystem-failure" | "git-failure" | "deployment-failure" | "deployment-unavailable" | "timeout" | "unexpected-failure";
|
|
49
49
|
export type LifecycleError = {
|
|
50
50
|
code: LifecycleErrorCode;
|
|
51
51
|
};
|
|
@@ -65,6 +65,11 @@ export type BranchPreparationStatus = "ready" | "disabled" | "deferred" | "unsaf
|
|
|
65
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
|
+
export type BranchPreparationDiagnostic = {
|
|
69
|
+
stage: "checkout-identity-branch" | "configure-identity-upstream" | "prepare-reconciliation" | "compose-baseline-tree" | "create-baseline-commit" | "apply-platform-patch" | "update-identity-ref" | "verify-reconciliation" | "rollback-platform-patch";
|
|
70
|
+
reason: "index-locked" | "patch-does-not-apply" | "identity-missing" | "ref-changed" | "permission-denied" | "missing-path-or-object" | "worktree-obstruction" | "worktree-changed" | "unknown";
|
|
71
|
+
exitCode?: number;
|
|
72
|
+
};
|
|
68
73
|
export type BranchPreparationEffects = {
|
|
69
74
|
changed: boolean;
|
|
70
75
|
pushed: boolean;
|
|
@@ -98,6 +103,8 @@ export type BranchPreparationValue = (BranchPreparationBase & {
|
|
|
98
103
|
}) | (BranchPreparationBase & {
|
|
99
104
|
status: "unsafe";
|
|
100
105
|
reason: BranchPreparationUnsafeReason;
|
|
106
|
+
diagnostic?: BranchPreparationDiagnostic;
|
|
107
|
+
rollbackDiagnostic?: BranchPreparationDiagnostic;
|
|
101
108
|
});
|
|
102
109
|
export type BranchPreparationAttention = Extract<BranchPreparationValue, {
|
|
103
110
|
status: "disabled" | "deferred" | "unsafe";
|
package/dist/lifecycle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,UAAU,CAAC;AAE/D,qBAAa,iCAAkC,SAAQ,KAAK;IAC1D,QAAQ,CAAC,IAAI,EAAG,eAAe,CAAU;IAEzC,cAGC;CACF;AAED,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,OAAO,GACb,yBAAyB,CAI3B;AAED,eAAO,MAAM,uBAAuB,0FAQzB,CAAC;AAEZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,oBAAoB,CAK/B;AAED,MAAM,MAAM,qBAAqB,GAC7B,6BAA6B,GAC7B,sBAAsB,GACtB,4BAA4B,GAC5B,oBAAoB,GACpB,qBAAqB,CAAC;AAE1B,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE;QACL,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAC;QAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,MAAM,EAAE;QACN,MAAM,EAAE,eAAe,GAAG,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC;QACjE,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,OAAO,EAAE;QACP,MAAM,EAAE,eAAe,GAAG,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC;QAChE,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,E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;IAC/B,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAE5E;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,kBAAkB,GACvB,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 =\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"]}
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,UAAU,CAAC;AAE/D,qBAAa,iCAAkC,SAAQ,KAAK;IAC1D,QAAQ,CAAC,IAAI,EAAG,eAAe,CAAU;IAEzC,cAGC;CACF;AAED,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,OAAO,GACb,yBAAyB,CAI3B;AAED,eAAO,MAAM,uBAAuB,0FAQzB,CAAC;AAEZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,oBAAoB,CAK/B;AAED,MAAM,MAAM,qBAAqB,GAC7B,6BAA6B,GAC7B,sBAAsB,GACtB,4BAA4B,GAC5B,oBAAoB,GACpB,qBAAqB,CAAC;AAE1B,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE;QACL,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAC;QAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,MAAM,EAAE;QACN,MAAM,EAAE,eAAe,GAAG,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC;QACjE,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,OAAO,EAAE;QACP,MAAM,EAAE,eAAe,GAAG,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC;QAChE,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM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,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,oBAAoB,CAAC;IACjC,OAAO,CAAC,EAAE,yBAAyB,CAAC;CACrC,CAAC,GACF,CAAC,mBAAmB,GAAG;IACrB,QAAQ,EAAE,KAAK,CAAC;IAChB,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,OAAO,EAAE,yBAAyB,CAAC;CACpC,CAAC,CAAC;AAEP,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEvD,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,sBAAsB,CAAC;IAC/B,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAE5E;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,kBAAkB,GACvB,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 =\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 | \"wrong-branch\"\n | \"unresolved-operation\"\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 BranchPreparationDiagnostic = {\n stage:\n | \"checkout-identity-branch\"\n | \"configure-identity-upstream\"\n | \"prepare-reconciliation\"\n | \"compose-baseline-tree\"\n | \"create-baseline-commit\"\n | \"apply-platform-patch\"\n | \"update-identity-ref\"\n | \"verify-reconciliation\"\n | \"rollback-platform-patch\";\n reason:\n | \"index-locked\"\n | \"patch-does-not-apply\"\n | \"identity-missing\"\n | \"ref-changed\"\n | \"permission-denied\"\n | \"missing-path-or-object\"\n | \"worktree-obstruction\"\n | \"worktree-changed\"\n | \"unknown\";\n exitCode?: number;\n};\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 diagnostic?: BranchPreparationDiagnostic;\n rollbackDiagnostic?: BranchPreparationDiagnostic;\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,OAAO,iCAAkC,SAAQ,KAAK;IACjD,IAAI,GAAG,eAAwB,CAAC;IAEzC;QACE,KAAK,CAAC,yCAAyC,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,GAAG,mCAAmC,CAAC;IAClD,CAAC;CACF;AAED,MAAM,UAAU,iCAAiC,CAC/C,KAAc;IAEd,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,SAAS,CAAC;IAC/D,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,UAAU,CAAC;IACxC,MAAM,IAAI,iCAAiC,EAAE,CAAC;AAChD,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,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"]}
|
|
1
|
+
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,iCAAkC,SAAQ,KAAK;IACjD,IAAI,GAAG,eAAwB,CAAC;IAEzC;QACE,KAAK,CAAC,yCAAyC,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,GAAG,mCAAmC,CAAC;IAClD,CAAC;CACF;AAED,MAAM,UAAU,iCAAiC,CAC/C,KAAc;IAEd,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,SAAS,CAAC;IAC/D,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,UAAU,CAAC;IACxC,MAAM,IAAI,iCAAiC,EAAE,CAAC;AAChD,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,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;AA8PD,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 | \"wrong-branch\"\n | \"unresolved-operation\"\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 BranchPreparationDiagnostic = {\n stage:\n | \"checkout-identity-branch\"\n | \"configure-identity-upstream\"\n | \"prepare-reconciliation\"\n | \"compose-baseline-tree\"\n | \"create-baseline-commit\"\n | \"apply-platform-patch\"\n | \"update-identity-ref\"\n | \"verify-reconciliation\"\n | \"rollback-platform-patch\";\n reason:\n | \"index-locked\"\n | \"patch-does-not-apply\"\n | \"identity-missing\"\n | \"ref-changed\"\n | \"permission-denied\"\n | \"missing-path-or-object\"\n | \"worktree-obstruction\"\n | \"worktree-changed\"\n | \"unknown\";\n exitCode?: number;\n};\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 diagnostic?: BranchPreparationDiagnostic;\n rollbackDiagnostic?: BranchPreparationDiagnostic;\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"]}
|