/** * Conversions from vertical-feature typed failures into the CLI-facing * `AppError` envelope. The shared `toAppError` dispatcher lives with the * CLI-local app-error module and may not depend on feature packages, so the * application boundary owns these conversions directly. * * @experimental This API is unstable and may change without notice. */ import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import { AppError } from "./app-error/index.js"; import { ExtensionLifecycleFailed, StepFailureConversion, type LifecycleFailure, type StepFailureConversionService } from "@agentxm/workspace/lifecycle"; import { AuthoringFailed } from "@agentxm/workspace/authoring"; import { PublishFailed } from "@agentxm/workspace/publishing"; import type { ExpectedCliError } from "./cli-runtime/index.js"; import { type AuthExchangeFailed, type AuthTokenPolicyRequired, type SignedOut, type DeviceAuthorizationPending, type DeviceLoginCodeExpired, type DeviceLoginDenied, type RegistryAccessFailed, type RegistryAccessFailure, type StepUpRequired } from "@agentxm/registry-access/authentication"; import type { SyncWorkspaceExecutionFailure } from "@agentxm/workspace/reconciliation/sync"; import { LintStagingFailed } from "@agentxm/workspace/linting"; import { WorkspaceConfigurationFailed } from "@agentxm/workspace/configuration"; import { WorkspaceInspectionFailed } from "@agentxm/workspace/inspection"; import { WorkspaceSyncFailed, type SyncFailureAdapter, type SyncPolicyFailure } from "@agentxm/workspace/reconciliation"; /** * Translate a lint input-staging failure: the implementation chose the * category, title, and wording at construction, so the envelope carries them * over 1:1. */ export declare const lintStagingFailedToAppError: (error: LintStagingFailed) => AppError; /** * Convert any failure a workspace lint run can surface — the feature's own * typed refusal, or a known kernel failure it read the workspace through — * into the CLI-facing `AppError`. */ export declare const lintFailureToAppError: (failure: unknown) => AppError; /** * Translate a workspace reconciliation policy failure: the implementation chose the * category and wording at construction, so the envelope carries them over 1:1. */ export declare const workspaceSyncFailedToAppError: (error: WorkspaceSyncFailed) => AppError; /** Convert any sync-policy failure into the CLI-facing `AppError` envelope. */ export declare const syncFailureToAppError: (failure: SyncPolicyFailure | SyncWorkspaceExecutionFailure | AppError) => AppError; /** * The sync feature's failure adapter: plan-step categories and details reuse * the boundary's own conversions so machine output stays byte-identical. */ export declare const syncStepFailureAdapter: SyncFailureAdapter; /** Layer wiring the boundary's failure conversions into sync planning. */ export declare const SyncStepFailureConversionLive: Layer.Layer; /** * Translate a publish policy failure: the implementation chose the category * and wording at construction, so the envelope carries them over 1:1 through * the same normalization the envelope constructor applies. */ export declare const publishFailedToAppError: (error: PublishFailed) => AppError; /** * Convert any failure a publish or registry-lifecycle use case can surface — * the feature's own typed failure, the registry-access failures a challenged * remote write settles with, a known kernel or integration failure, or an * envelope that travelled through a still-coupled channel — into the * CLI-facing `AppError`. * * Remote writes are authorized and may be challenged, so the auth family is * part of this channel: a pending verification has to keep its * `pending-human` status and resume action rather than degrade to `internal`. */ export declare const publishFailureToAppError: (failure: unknown) => AppError; /** Convert sharing refusals and workspace/Git read failures into the CLI envelope. */ export declare const shareFailureToAppError: (failure: unknown) => AppError; /** * Translate an authoring policy failure: the implementation chose the * category and wording at construction, so the envelope carries them over * 1:1 through the same normalization the envelope constructor applies. */ export declare const authoringFailedToAppError: (error: AuthoringFailed) => AppError; /** * Convert any failure an authoring operation can surface — the feature's own * typed failure, a known kernel failure, or an envelope that travelled * through a still-coupled channel — into the CLI-facing `AppError`. */ export declare const authoringFailureToAppError: (failure: unknown) => AppError; /** * Translate a lifecycle policy failure: the implementation chose the * category and wording at construction, so the envelope carries them over * 1:1 through the same normalization the envelope constructor applies. */ export declare const extensionLifecycleFailedToAppError: (error: ExtensionLifecycleFailed) => AppError; /** * Convert any failure a lifecycle use case can surface — the feature's own * typed failure, a known kernel or integration failure, or an envelope that * travelled through a still-coupled channel — into the CLI-facing `AppError`. */ export declare const lifecycleFailureToAppError: (failure: unknown) => AppError; /** Serialize any lifecycle failure into the plan-step vocabulary. */ export declare const lifecycleFailureToStepFailure: (failure: LifecycleFailure) => import("@agentxm/workspace/transitions/planning").StepFailure; /** * The lifecycle feature's failure adapter: step categories, details, and * message text reuse the boundary's own conversions so plan data and machine * output stay byte-identical with rendered errors. */ export declare const lifecycleStepFailureConversion: StepFailureConversionService; /** Layer wiring the boundary's failure conversions into lifecycle operations. */ export declare const LifecycleStepFailureConversionLive: Layer.Layer; /** * Supply the boundary's failure adapter to one lifecycle operation invoked * outside the shared runtime layer (handlers that build their own local * service environment). */ export declare const provideLifecycleStepFailureConversion: (effect: Effect.Effect) => Effect.Effect>; /** * Convert only the lifecycle feature's own typed failure into the envelope, * leaving every other member of the channel untouched. */ export declare const coerceLifecycleFailure: (failure: E | ExtensionLifecycleFailed) => E | AppError; /** * Translate a registry-access policy failure: the implementation chose the * category and wording at construction, so the envelope carries them over * 1:1. A typed auth failure in cause position converts recursively so the * serialized cause chain matches the former in-place construction, where the * nested value was already an envelope. */ export declare const registryAccessFailedToAppError: (error: RegistryAccessFailed) => AppError; /** Signed out: one result, rendered the one way. */ export declare const signedOutToAppError: (error: SignedOut) => AppError; /** Ambient-token-only policy: the former builder's envelope, verbatim. */ export declare const authTokenPolicyRequiredToAppError: (error: AuthTokenPolicyRequired) => AppError; export declare const deviceLoginDeniedToAppError: (_error: DeviceLoginDenied) => AppError; export declare const deviceLoginCodeExpiredToAppError: (_error: DeviceLoginCodeExpired) => AppError; /** A bounded device-approval wait elapsed: the pending-human envelope. */ export declare const deviceAuthorizationPendingToAppError: (error: DeviceAuthorizationPending) => AppError; /** * Step-up verification demanded: metadata and cause restore from the carried * transport failure, exactly as the former in-place construction read them * off the mapped envelope. */ export declare const stepUpRequiredToAppError: (error: StepUpRequired) => AppError; /** * Token-exchange auth semantics: overlay the carried detail and suggestions * onto the mapped transport failure through the same semantics helper the * former in-place conversion used, preserving title, metadata, and cause. */ export declare const authExchangeFailedToAppError: (error: AuthExchangeFailed) => AppError; /** Convert any registry-access typed failure into the CLI-facing envelope. */ export declare const registryAccessFailureToAppError: (failure: RegistryAccessFailure) => AppError; /** * Convert only the Registry access capability's own typed failures into the * envelope, leaving every other expected failure untouched. Concretely typed * so the auth members leave the channel instead of being reabsorbed by a * generic parameter. */ export declare const coerceAuthFailure: (failure: ExpectedCliError | RegistryAccessFailure) => ExpectedCliError; /** * Convert any failure an auth use case can surface — the capability's typed * failures, a known registry transport failure, or an envelope that travelled * through a still-coupled channel — into the CLI-facing `AppError`. */ export declare const authFailureToAppError: (failure: unknown) => AppError; /** * Translate a workspace configuration policy failure: the implementation * chose the category and wording at construction, so the envelope carries * them over 1:1 through the same normalization the envelope constructor * applies. */ export declare const workspaceConfigurationFailedToAppError: (error: WorkspaceConfigurationFailed) => AppError; /** * Convert any failure a workspace configuration flow can surface — the * feature's own typed failure, a known kernel or integration failure, or an * envelope that travelled through a still-coupled channel — into the * CLI-facing `AppError`. */ export declare const configurationFailureToAppError: (failure: unknown) => AppError; /** * Convert configuration failures into the envelope while letting the typed * initialization cancellation pass through to the runtime envelope's silent * success exit. */ export declare const coerceConfigurationFailure: (failure: unknown) => ExpectedCliError; /** Serialize any configuration failure into the plan-step vocabulary. */ export declare const configurationFailureToStepFailure: (failure: unknown) => import("@agentxm/workspace/transitions/planning").StepFailure; /** * Translate a workspace inspection query failure: the implementation chose * the category and wording at construction, so the envelope carries them over * 1:1 through the same normalization the envelope constructor applies. */ export declare const workspaceInspectionFailedToAppError: (error: WorkspaceInspectionFailed) => AppError; /** * Convert any failure a workspace inspection query can surface — the * feature's own typed failure, a known kernel or integration failure, or an * envelope that travelled through a still-coupled channel — into the * CLI-facing `AppError`. */ export declare const inspectionFailureToAppError: (failure: unknown) => AppError; //# sourceMappingURL=feature-errors.d.ts.map