import type { CapabilityRight } from './ICapabilityToken';
/**
 * Topic claim - assertion of authority over a topic prefix.
 *
 * Vision 27 §1.5 (Separator Semantics):
 * - DOT (.) = supervision hierarchy, wildcards blocked
 * - Topic prefix 'flowpad.tree' claims authority over:
 *   - 'flowpad.tree' (exact match)
 *   - 'flowpad.tree.child' (children)
 *   - 'flowpad.tree.accepts.*' (all operations)
 *
 * Joe Armstrong (Erlang, "Programming Erlang"):
 *   "The supervisor owns its subtree. This is the fundamental security model."
 *
 * Mark Miller (Capability Security, E Language):
 *   "Claiming a prefix is like registering a process in Erlang -
 *    it prevents confusion attacks where two actors think they own the same name."
 *
 * Butler Lampson (Turing Award, Capability Systems):
 *   "The namespace IS the security boundary. Prefix claiming establishes that boundary."
 */
export interface ITopicClaim {
    /**
     * The topic prefix being claimed.
     * Uses DOT notation for supervision hierarchy.
     *
     * @example 'flowpad.tree' claims all topics under flowpad.tree.*
     * @example 'flowpad' claims entire flowpad namespace
     */
    prefix: string;
    /**
     * Mount path of the claiming component (owner).
     * This is the component that has authority over the prefix.
     *
     * @example 'flowpad/tree' (component mount path)
     */
    owner: string;
    /**
     * Mount path of the parent who delegated this claim (if any).
     * Root claims have no delegatedBy (they are self-asserted).
     *
     * Joe Armstrong: "The parent delegates authority to the child.
     * The child's claim is only valid if the parent authorized it."
     *
     * @example 'flowpad' (parent mount path)
     */
    delegatedBy?: string;
    /**
     * Timestamp when the claim was established.
     * Used for audit trail and conflict resolution.
     */
    claimedAt: number;
    /**
     * Capabilities granted by this claim.
     * Uses the same right system as ICapabilityToken.
     *
     * @example ['read', 'write', 'invoke', 'emit', 'spawn']
     */
    capabilities: CapabilityRight[];
    /**
     * Whether this claim is exclusive (blocks overlapping claims).
     * Default: true (exclusive claims are the norm).
     *
     * Non-exclusive claims allow multiple components to share a prefix,
     * which may be useful for broadcast/pub-sub scenarios.
     */
    exclusive: boolean;
    /**
     * Whether this claim is revoked.
     * Revoked claims remain in the registry for audit purposes.
     */
    revoked: boolean;
    /**
     * Timestamp when the claim was revoked (if applicable).
     */
    revokedAt?: number;
    /**
     * Reason for revocation (if applicable).
     * Useful for audit trail.
     *
     * @example 'component_destroyed', 'explicit_release', 'parent_revoked'
     */
    revocationReason?: string;
}
/**
 * Result of a claim operation.
 */
export interface IClaimResult {
    /** Whether the claim was successful */
    success: boolean;
    /** The claim if successful */
    claim?: ITopicClaim;
    /**
     * Error message if claim failed.
     *
     * Common failures:
     * - 'prefix_already_claimed': Another component owns this prefix
     * - 'parent_prefix_not_owned': Attempting to claim under non-owned prefix
     * - 'prefix_conflict': Claim would overlap with existing claim
     */
    error?: string;
    /**
     * The conflicting claim if there was a conflict.
     * Helps diagnose why the claim failed.
     */
    conflictingClaim?: ITopicClaim;
}
/**
 * Options for topic claim operations.
 */
export interface IClaimOptions {
    /**
     * Capabilities to grant with this claim.
     * @default ['read', 'write', 'invoke', 'emit']
     */
    capabilities?: CapabilityRight[];
    /**
     * Whether the claim is exclusive.
     * @default true
     */
    exclusive?: boolean;
    /**
     * If true, allows claiming a prefix that extends an existing claim
     * by the same owner (e.g., owner has 'flowpad', now claiming 'flowpad.tree').
     *
     * This supports hierarchical ownership where a supervisor
     * claims its own subtree progressively.
     *
     * @default true
     */
    allowExtension?: boolean;
}
/**
 * Query options for finding claims.
 */
export interface IClaimQuery {
    /** Filter by owner mount path */
    owner?: string;
    /** Filter by prefix (exact match) */
    prefix?: string;
    /** Filter by prefix pattern (startsWith match) */
    prefixPattern?: string;
    /** Include revoked claims in results */
    includeRevoked?: boolean;
}
//# sourceMappingURL=ITopicClaim.d.ts.map