import { LifecyclePostconditionViolated, ScaffoldedExtensionUnresolved } from "@agentxm/workspace/transitions/planning"; /** * Conversions from model- and protocol-level typed failures into CLI-facing * `AppError` values. These live with the application error vocabulary so the * shared packages stay free of CLI error concerns. * * @experimental This API is unstable and may change without notice. */ import { SkillSelectionNotFound, SkillSelectionUnavailable } from "@agentxm/workspace/skills/lifecycle/application"; import { SubagentSelectionNotFound, SubagentSelectionUnavailable } from "@agentxm/workspace/subagents/lifecycle/application"; import { InstallSelectionUnavailable } from "@agentxm/workspace/lifecycle"; import { FqnInvalidError } from "@agentxm/extension-model/unstable/extensions/fqn"; import { FrontmatterParseFailure } from "@agentxm/extension-content"; import { SubagentContentError } from "@agentxm/extension-content"; import { TransitionLockError, TransitionLockUnavailable, WorkspaceDirectoryError, WorkspaceRestorationError, WorkspaceRestorationIncomplete, WorkspaceSnapshotError, WorkspaceTransitionCompromised } from "@agentxm/workspace/transitions/settlement"; import { ApprovalRecoveryMissing, CandidateFingerprintFailed, PlanInteractionFailed, StaleExecutionCandidate, StepFailure } from "@agentxm/workspace/transitions/planning"; import { ConfiguredAgentOutcomesUnavailable } from "@agentxm/workspace/desired-state"; import { SettingsWriteError } from "@agentxm/workspace/desired-state"; import { LockfileResolvedVersionInvalid, LockfileValidationError, LockfileWriteError } from "@agentxm/workspace/desired-state"; import { AcceptedResolutionMissing, CanonicalPathRemovalError, InlineExtensionSourceMissing, DesiredPackGraphIncomplete, InvalidAgentId, LockedSkillMissing, LockEntryEndpointConflict, LockEntryNameInvalid, PackageContentHashFailed, SettingsEntryMissing, SupersededCanonicalRemovalFailed, SymlinkCreationError, WorkspaceLayoutError, WorkspaceNotInitialized, WorkspaceSourceInvalid } from "@agentxm/workspace/desired-state"; import { LockfileDecodeError, LockfileIoError, LockfileParseError, LockfileVersionUnsupported, SettingsDecodeError, SettingsIoError, SettingsParseError, SkillDiscoveryRootInvalid, SubagentScanFailed, WorkspaceRootEscape, type LockfileReadError, type SettingsReadError } from "@agentxm/workspace/desired-state"; import { ArchiveIntegrityMismatch, CanonicalPackageProbeFailed, PackageCopyFailed, PackageMaterializationFailed, StagedPackageInvalid, RuleDefinitionInvalid, RuleInstallStateMissing, HookDefinitionInvalid, HookInstallStateMissing, KnowledgeDefinitionInvalid, KnowledgeDesiredStateUnreconcilable, KnowledgeInstallStateMissing, KnowledgeIoFailed, KnowledgeObservableContractViolated, KnowledgeResolutionMissing, KnowledgeUnavailable, PackArchiveFetchFailed, PackDefinitionInvalid, PackInstallStateMissing, PackStagingFailed, SkillDefinitionInvalid, SkillInstallStateMissing, SkillMaterializationFailed, McpAgentSyncRefused, McpCanonicalPathUnsafe, McpInstallStateMissing, McpLocalNameConflict, McpRequiredInputsMissing, McpWorkspacePackageInvalid, SubagentContentUnreadable, SubagentDefinitionInvalid, SubagentInstallStateMissing } from "@agentxm/workspace/materialization"; import { AuthoringOwnerMismatch, AuthoringOwnerRequired, AuthoringScopeUnsupported, CreateDestinationInspectionFailed, CreateNameConfigured, ForkPackageConflict, ForkPackageFailed, ForkPackageInvalid, NativeImportConflict, NativeImportFailed, NativeImportInvalid, NativeImportUnsupported, PackGraphInvalid, PackManifestUnavailable, PackMemberAmbiguous, PackMemberNotDeclared, PackMemberNotFound, PackMemberUnmanaged, PackNotAuthored, PackNotConfigured, PackOwnerUnconfigured, PackSelectorAmbiguous, PackSelectorNotAPack, PackSourceMissing, ScaffoldNameInvalid } from "@agentxm/workspace/authoring"; import { CreateDestinationExists } from "@agentxm/workspace/materialization"; import { InstructionMaintenanceFailed, AuthoredContributorUnsupported, ContributorIdentityInvalid, ContributorTreeMismatch, ContributorUnresolved, DesiredStateIncomplete, ManagedRegionViolation, ProjectionIoFailed, ProjectionTargetUnsupported } from "@agentxm/workspace/projection"; import { HookConfigInvalid, HookIoFailed, TransientBackupFailed, McpConfigInvalid, McpConfigIoFailed, McpDefinitionInvalid, McpEntryUnmanaged, McpOwnershipMarkerInvalid, McpSharedTargetConflict, SubagentIoFailed, WriteBackupRetained } from "@agentxm/workspace/projection/agent-adapters"; import { MaterializedTreeInvalid, PathTraversalDetected } from "@agentxm/workspace/desired-state"; import { AgentDetectionFailed, NativeWriteRefused } from "@agentxm/workspace/projection/agent-adapters"; import { RegistryOperationFailed, RegistryProblem, RegistryRequestFailed } from "@agentxm/registry-client"; import { AxmSkillGateUnavailable, GitOperationFailed, SourceHostNotConfigured, SourceNetworkFailure, SourceNotResolvable, SourceSyntaxInvalid, WorkspaceCatalogUnavailable } from "@agentxm/workspace/resolution/sources"; import { AxmSkillCompatibilityUnavailable } from "@agentxm/cli-maintenance/official-skill/application"; import { AxmSkillIncompatible } from "@agentxm/cli-maintenance/official-skill/domain"; import { ExtensionResolutionFailed, PackConstraintShadowed, PackDependencyConflict, PackDependencyInvalid, PackDependencyMissing, PackDependencyUnsatisfied, SourceAuthorityBlocked } from "@agentxm/workspace/resolution"; import { AppError } from "./index.js"; /** * Translate a `FqnInvalidError` into a CLI-facing `AppError` with the canonical * format suggestion. Use at user-input boundaries (CLI handlers, publish * operations) where the parse failure is a user error. * * @experimental This API is unstable and may change without notice. */ export declare const fqnInvalidErrorToAppError: (error: FqnInvalidError) => AppError; /** Preserve the former CLI-facing validation error at higher-level boundaries. */ export declare const frontmatterParseFailureToAppError: (cause: FrontmatterParseFailure) => AppError; /** Translate a subagent content failure into a CLI-facing `AppError`. */ export declare const subagentContentErrorToAppError: (error: SubagentContentError) => AppError; /** * Render the typed restoration failure: the deciding transition cause, the * retained-state consequence, and the preserved snapshot directory when one * exists. */ export declare const restorationIncompleteToAppError: (error: WorkspaceRestorationIncomplete) => AppError; /** Translate a path-protection preimage failure, reproducing each step's detail. */ export declare const workspaceSnapshotErrorToAppError: (error: WorkspaceSnapshotError) => AppError; /** * Translate a refused native write: the workspace could not preserve the * target's preimage, so the native writer stopped before mutating it. */ export declare const nativeWriteRefusedToAppError: (error: NativeWriteRefused) => AppError; /** Translate a workspace state-directory preparation failure. */ export declare const workspaceDirectoryErrorToAppError: (error: WorkspaceDirectoryError) => AppError; /** Translate a transition-lock mechanics failure, reproducing each step's detail. */ export declare const transitionLockErrorToAppError: (error: TransitionLockError) => AppError; /** Translate an elapsed contention wait with the machine-readable holder reference. */ export declare const transitionLockUnavailableToAppError: (error: TransitionLockUnavailable) => AppError; /** Translate a compromised transition hold into its conflict rendering. */ export declare const workspaceTransitionCompromisedToAppError: (error: WorkspaceTransitionCompromised) => AppError; /** Translate a restoration-step failure, reproducing each step's detail. */ export declare const workspaceRestorationErrorToAppError: (error: WorkspaceRestorationError) => AppError; /** * Translate a plan step failure into the CLI-facing `AppError` envelope: the * category is the code, and detail, suggestions, and cause carry over 1:1. */ export declare const stepFailureToAppError: (error: StepFailure) => AppError; /** Translate a stale execution candidate, byte-identical to the former sniffed shape. */ export declare const staleExecutionCandidateToAppError: (_error: StaleExecutionCandidate) => AppError; /** * Interim bridge for producers whose dependencies still fail with `AppError`: * the step failure keeps the category (code), detail, suggestions, and cause * so plan data and machine output stay byte-identical. Call sites dissolve as * later decoupling waves give those dependencies typed failures. */ export declare const appErrorToStepFailure: (error: AppError) => StepFailure; /** * Interim bridge composing `toAppError` with `appErrorToStepFailure`, for * plan-step producers whose dependencies now fail with typed workspace * errors while step plumbing still speaks `StepFailure` categories from the * AppError rendering. Dissolves with the `appErrorToStepFailure` sites. */ export declare const failureToStepFailure: (error: KnownFailure | AppError) => StepFailure; /** * Translate scoped settings-read failures into the facade's former rendering: * a hand-editable settings problem is a validation failure that names the fix. */ export declare const settingsReadErrorToAppError: (error: SettingsReadError) => AppError; /** An unreadable, invalid, or unsupported lockfile is actionable workspace state. */ export declare const lockfileReadErrorToAppError: (error: LockfileReadError) => AppError; /** The workspace root escaped the allowed root while building the read model. */ export declare const workspaceRootEscapeToAppError: (error: WorkspaceRootEscape) => AppError; /** Translate a settings write failure, reproducing each step's detail. */ export declare const settingsWriteErrorToAppError: (error: SettingsWriteError) => AppError; /** Translate a lockfile write failure, reproducing each step's code and detail. */ export declare const lockfileWriteErrorToAppError: (error: LockfileWriteError) => AppError; /** Translate an on-disk lockfile validation failure, reproducing each step's detail. */ export declare const lockfileValidationErrorToAppError: (error: LockfileValidationError) => AppError; /** Translate a workspace layout failure; the kernel owns the fact sentence. */ export declare const workspaceLayoutErrorToAppError: (error: WorkspaceLayoutError) => AppError; /** Translate a missing-workspace failure with the canonical setup suggestion. */ export declare const workspaceNotInitializedToAppError: (error: WorkspaceNotInitialized) => AppError; /** Translate a missing locked skill with the canonical install suggestion. */ export declare const lockedSkillMissingToAppError: (error: LockedSkillMissing) => AppError; /** Translate a missing settings entry for an entry-level update. */ export declare const settingsEntryMissingToAppError: (error: SettingsEntryMissing) => AppError; /** Translate an invalid configurable-agent ID. */ export declare const invalidAgentIdToAppError: (error: InvalidAgentId) => AppError; /** Translate an undecidable pack-retention query. */ export declare const desiredPackGraphIncompleteToAppError: (_error: DesiredPackGraphIncomplete) => AppError; /** Translate a canonical-path removal failure, reproducing each step's detail. */ export declare const canonicalPathRemovalErrorToAppError: (error: CanonicalPathRemovalError) => AppError; /** Translate a symlink creation failure, reproducing each step's detail. */ export declare const symlinkCreationErrorToAppError: (error: SymlinkCreationError) => AppError; /** Translate an undecodable lockfile extension name. */ export declare const lockEntryNameInvalidToAppError: (error: LockEntryNameInvalid) => AppError; /** Translate a lock entry whose accepted endpoint disagrees with configuration. */ export declare const lockEntryEndpointConflictToAppError: (error: LockEntryEndpointConflict) => AppError; /** Translate a missing accepted resolution for a desired extension. */ export declare const acceptedResolutionMissingToAppError: (error: AcceptedResolutionMissing) => AppError; /** Translate an inline entry with no resolvable package source. */ export declare const inlineExtensionSourceMissingToAppError: (error: InlineExtensionSourceMissing) => AppError; /** Translate a superseded-canonical removal failure. */ export declare const supersededCanonicalRemovalFailedToAppError: (error: SupersededCanonicalRemovalFailed) => AppError; /** Translate a package content hash failure. */ export declare const packageContentHashFailedToAppError: (error: PackageContentHashFailed) => AppError; /** Translate an invalid configured workspace source with the canonical recovery. */ export declare const workspaceSourceInvalidToAppError: (error: WorkspaceSourceInvalid) => AppError; /** Translate a skill discovery root problem, reproducing each site's detail. */ export declare const skillDiscoveryRootInvalidToAppError: (error: SkillDiscoveryRootInvalid) => AppError; /** Translate a subagent file scan failure. */ export declare const subagentScanFailedToAppError: (error: SubagentScanFailed) => AppError; /** Translate an inexact lockfile resolved version with the canonical suggestion. */ export declare const lockfileResolvedVersionInvalidToAppError: (error: LockfileResolvedVersionInvalid) => AppError; /** Translate an execution-material fingerprint failure. */ export declare const candidateFingerprintFailedToAppError: (error: CandidateFingerprintFailed) => AppError; /** * Translate a plan interaction failure: the implementation chose the category * and wording at construction, so the envelope carries them over 1:1. */ export declare const planInteractionFailedToAppError: (error: PlanInteractionFailed) => AppError; /** Translate a plan-execution contract violation, byte-identical to the former envelope. */ export declare const approvalRecoveryMissingToAppError: (_error: ApprovalRecoveryMissing) => AppError; /** * Translate an instruction-maintenance failure: the implementation chose the * category and wording at construction, so the envelope carries them over 1:1. */ export declare const instructionMaintenanceFailedToAppError: (error: InstructionMaintenanceFailed) => AppError; /** * Translate a configured-agent-outcomes provider failure: the implementation * chose the category and wording at construction, so the envelope carries * them over 1:1. */ export declare const configuredAgentOutcomesUnavailableToAppError: (error: ConfiguredAgentOutcomesUnavailable) => AppError; /** * Every typed failure the application boundary knows how to convert. Each * package's error union registers here as it stops constructing `AppError` * directly; the dispatcher is the single conversion seam the CLI uses. */ export type KnownFailure = FqnInvalidError | FrontmatterParseFailure | SubagentContentError | WorkspaceRestorationIncomplete | StepFailure | StaleExecutionCandidate | SettingsIoError | SettingsParseError | SettingsDecodeError | LockfileIoError | LockfileParseError | LockfileDecodeError | LockfileVersionUnsupported | WorkspaceRootEscape | SettingsWriteError | LockfileWriteError | LockfileValidationError | LockfileResolvedVersionInvalid | WorkspaceLayoutError | WorkspaceNotInitialized | LockedSkillMissing | SettingsEntryMissing | InvalidAgentId | DesiredPackGraphIncomplete | CanonicalPathRemovalError | SymlinkCreationError | LockEntryNameInvalid | LockEntryEndpointConflict | AcceptedResolutionMissing | InlineExtensionSourceMissing | SupersededCanonicalRemovalFailed | PackageContentHashFailed | WorkspaceSourceInvalid | SkillDiscoveryRootInvalid | SubagentScanFailed | CandidateFingerprintFailed | PlanInteractionFailed | ApprovalRecoveryMissing | ConfiguredAgentOutcomesUnavailable | WorkspaceSnapshotError | NativeWriteRefused | WorkspaceDirectoryError | TransitionLockError | TransitionLockUnavailable | WorkspaceTransitionCompromised | WorkspaceRestorationError | PackageMaterializationFailed | StagedPackageInvalid | CanonicalPackageProbeFailed | PackageCopyFailed | ArchiveIntegrityMismatch | CreateDestinationExists | CreateNameConfigured | CreateDestinationInspectionFailed | AuthoringOwnerRequired | AuthoringOwnerMismatch | ScaffoldNameInvalid | AuthoringScopeUnsupported | PackSelectorNotAPack | PackNotConfigured | PackSelectorAmbiguous | PackSourceMissing | PackNotAuthored | PackOwnerUnconfigured | PackManifestUnavailable | PackGraphInvalid | PackMemberAmbiguous | PackMemberUnmanaged | PackMemberNotFound | PackMemberNotDeclared | PathTraversalDetected | ForkPackageInvalid | ForkPackageConflict | ForkPackageFailed | NativeImportUnsupported | NativeImportInvalid | NativeImportConflict | NativeImportFailed | SourceAuthorityBlocked | LifecyclePostconditionViolated | ScaffoldedExtensionUnresolved | MaterializedTreeInvalid | DesiredStateIncomplete | AuthoredContributorUnsupported | ContributorIdentityInvalid | ContributorUnresolved | ContributorTreeMismatch | ProjectionTargetUnsupported | ManagedRegionViolation | ProjectionIoFailed | InstructionMaintenanceFailed | RuleDefinitionInvalid | RuleInstallStateMissing | HookDefinitionInvalid | HookConfigInvalid | HookIoFailed | HookInstallStateMissing | TransientBackupFailed | WriteBackupRetained | SubagentDefinitionInvalid | SubagentContentUnreadable | SubagentIoFailed | SubagentInstallStateMissing | McpConfigInvalid | McpConfigIoFailed | McpEntryUnmanaged | McpOwnershipMarkerInvalid | McpDefinitionInvalid | McpInstallStateMissing | McpLocalNameConflict | McpCanonicalPathUnsafe | McpWorkspacePackageInvalid | McpRequiredInputsMissing | McpAgentSyncRefused | McpSharedTargetConflict | SkillDefinitionInvalid | SkillMaterializationFailed | SkillInstallStateMissing | SkillSelectionNotFound | SkillSelectionUnavailable | SubagentSelectionNotFound | SubagentSelectionUnavailable | InstallSelectionUnavailable | AxmSkillCompatibilityUnavailable | AxmSkillIncompatible | PackDefinitionInvalid | PackInstallStateMissing | PackArchiveFetchFailed | PackStagingFailed | PackDependencyInvalid | PackDependencyConflict | PackConstraintShadowed | PackDependencyMissing | PackDependencyUnsatisfied | KnowledgeDefinitionInvalid | KnowledgeIoFailed | KnowledgeInstallStateMissing | KnowledgeResolutionMissing | KnowledgeDesiredStateUnreconcilable | KnowledgeUnavailable | KnowledgeObservableContractViolated | AgentDetectionFailed | RegistryProblem | RegistryRequestFailed | RegistryOperationFailed | SourceSyntaxInvalid | SourceHostNotConfigured | SourceNotResolvable | SourceNetworkFailure | GitOperationFailed | WorkspaceCatalogUnavailable | AxmSkillGateUnavailable | ExtensionResolutionFailed; export declare const isKnownFailure: (error: unknown) => error is KnownFailure; /** * Convert a known typed failure into the CLI-facing `AppError` envelope. An * `AppError` passes through unchanged so still-coupled callers can map a * mixed channel with one `Effect.mapError(toAppError)` during the decoupling * waves. */ export declare const toAppError: (error: KnownFailure | AppError) => AppError; //# sourceMappingURL=conversions.d.ts.map