import { type ChannelDefaults } from "@cotal-ai/core"; import { CommandFailure, type Report } from "@cotal-ai/workspace"; import { type AdditiveTeamAttempt } from "../lib/team-additive-attempt.js"; import { readChannelMemberImpact, type CardObservation, type CardReceipt, type ChannelRemovalAttempt, type RemovedChannel } from "../lib/team-channel-removal.js"; import { type CardSettlement } from "../lib/team-removal-reconcile.js"; import type { TeamValues } from "./team.js"; export type CardOutcome = RemovedChannel | { name: string; createdRevision: number; outcome: "conflict" | "unknown" | "observed-superseded"; }; export interface CardRemovalRun { intentAttempted: boolean; returned: boolean; outcomes: CardOutcome[]; failure?: CommandFailure; } /** The card phase of a team removal: only the registry cards a returned deployment created, each by * a native delete conditioned on its returned create revision. This is metadata removal: grants, * readers, retained history and the channel subject are untouched, and the space defaults then * apply. A mixed card phase is accepted only once the agent-retirement receipt for the same * deployment reads back complete at execute time. `close` must run once preparation returned. */ export declare function prepareCardRemoval(input: { root: string; space: string; deploymentId: string; original: AdditiveTeamAttempt; receipt: CardReceipt; apply: boolean; }): Promise<{ preview: { kind: "channel-team-removal-preview"; deploymentId: string; space: string; root: string; server: string; authMode: "open" | "auth" | "user"; tlsRequired: boolean; defaults: { deliveryClass: import("@cotal-ai/core").DeliveryClass; replay: boolean; replayWindow: string | null; }; channels: { name: string; createdRevision: number; observedRevision: number | null; state: "absent" | "changed" | "same-revision"; fallback: { deliveryClass: { card: import("@cotal-ai/core").DeliveryClass | null; after: import("@cotal-ai/core").DeliveryClass; }; replay: { card: boolean | null; after: boolean; }; replayWindow: { card: string | null; after: string | null; }; describedContextRemoved: boolean; }; observedMembers: string[] | null; }[]; membershipFeed: "unavailable" | "no-heartbeat" | "display-only-observed"; membershipObservedAt: number | null; scope: "registry-card-metadata-only"; historyPurged: boolean; grantsChanged: boolean; readersStopped: boolean; readerExclusivity: "not-established"; effectAttempted: false; }; close: () => Promise; closeUnconfirmed: () => boolean; execute(): Promise; }>; /** One row per original card: its delete, conflict, unknown or unattempted outcome. */ export declare function cardOutcomeRows(receipt: CardReceipt, outcomes: readonly CardOutcome[]): { channel: string; created: string; outcome: string; }[]; export interface CardReconcileRun { recorded: CardSettlement[]; settlements: CardSettlement[]; returned: boolean; failure?: CommandFailure; } /** Reconcile the original card phase of an unsettled intent from native observation only. It reads * the registry with the deployer view and writes nothing to the broker: no delete, retry or * replacement. Each unconfirmed submission settles only when the card's last message in the * intent's own registry stream rules out every other outcome. Never-submitted cards are reported * unattempted and are not continued. A receipt is written only when every card counts as removed. */ export declare function prepareCardReconcile(input: { root: string; space: string; deploymentId: string; original: AdditiveTeamAttempt; receipt: CardReceipt; intent: ChannelRemovalAttempt; }): Promise<{ settlements: CardSettlement[]; close: () => Promise; closeUnconfirmed: () => boolean; execute(): Promise; }>; /** One row per original card for a reconciliation preview or result. */ export declare function cardSettlementRows(settlements: readonly CardSettlement[]): { channel: string; created: string; state: string; }[]; export declare const RECONCILE_NOTE = "Reconciliation records only what the original registry stream shows now. A removed card names no remover and does not prove the original delete executed. Nothing was deleted, stopped or retried, and never-submitted members stay unattempted. An unsettled intent stays blocking."; /** Remove only the cards of a returned channel-only deployment. */ export declare function removeChannelTeam(deploymentId: string, values: TeamValues): Promise; export declare const CARD_SCOPE_NOTE = "Only the registry cards were removed. The channel stays addressable, its retained history and every read/post grant are unchanged, and current readers were not stopped or proven absent. The space defaults now apply to these names. An unsettled intent stays blocking and is not retry authority."; declare function impactOf(original: AdditiveTeamAttempt, receipt: CardReceipt, cards: CardObservation[], defaults: ChannelDefaults | null, members: Awaited>): { kind: "channel-team-removal-preview"; deploymentId: string; space: string; root: string; server: string; authMode: "open" | "auth" | "user"; tlsRequired: boolean; defaults: { deliveryClass: import("@cotal-ai/core").DeliveryClass; replay: boolean; replayWindow: string | null; }; channels: { name: string; createdRevision: number; observedRevision: number | null; state: "absent" | "changed" | "same-revision"; fallback: { deliveryClass: { card: import("@cotal-ai/core").DeliveryClass | null; after: import("@cotal-ai/core").DeliveryClass; }; replay: { card: boolean | null; after: boolean; }; replayWindow: { card: string | null; after: string | null; }; describedContextRemoved: boolean; }; observedMembers: string[] | null; }[]; membershipFeed: "unavailable" | "no-heartbeat" | "display-only-observed"; membershipObservedAt: number | null; scope: "registry-card-metadata-only"; historyPurged: boolean; grantsChanged: boolean; readersStopped: boolean; readerExclusivity: "not-established"; effectAttempted: false; }; export type CardImpact = ReturnType; /** The card table and disclosure lines, shared by the channel-only and mixed previews. */ export declare function cardImpactBlocks(data: CardImpact): Report["sections"][number]["blocks"]; export {}; //# sourceMappingURL=team-channel-remove.d.ts.map