import { F as FlowNode, a as FlowNodeAuthzExtension, b as FlowNodeRuntimeState, I as IxoEditorType, S as SignedCapability, E as EvaluationStatus, C as Capability, c as CapabilityValidationResult } from './graphql-client-C82HQLeC.mjs';
export { a3 as Addr, J as ApiRequestBlockProps, t as ApiRequestBlockSpec, A as AuthorizationTab, i as AuthorizationTabState, U as AuthzExecActionTypes, Y as BlockRequirements, X as BlocknoteContextValue, W as BlocknoteHandlers, N as BlocknoteProvider, x as CheckboxBlockProps, s as CheckboxBlockSpec, aa as CosmosMsgForEmpty, g as CoverImage, h as CoverImageProps, D as DelegationGrant, ad as Entity, ae as EntityResponse, l as EntitySigningSetup, af as EntityVariables, j as EvaluationTab, k as EvaluationTabState, a6 as Expiration, m as FlowPermissionsPanel, G as GrantPermissionModal, ag as GraphQLClient, aj as GraphQLRequest, ai as GraphQLResponse, K as HttpMethod, r as IxoCollaborativeEditorOptions, q as IxoCollaborativeUser, e as IxoEditor, p as IxoEditorConfig, n as IxoEditorOptions, f as IxoEditorProps, o as IxoEditorTheme, M as KeyValuePair, z as ListBlockProps, y as ListBlockSettings, L as ListBlockSpec, O as OverviewBlock, B as OverviewBlockProps, ab as ProposalAction, H as ProposalBlockProps, P as ProposalBlockSpec, Z as ProposalResponse, _ as SingleChoiceProposal, T as StakeType, T as StakeTypeValue, a7 as Status, a8 as Threshold, a5 as Timestamp, a4 as Uint128, a2 as User, V as ValidatorActionType, a1 as Vote, a0 as VoteInfo, $ as VoteResponse, a9 as Votes, v as blockSpecs, ac as getEntity, w as getExtraSlashMenuItems, ah as ixoGraphQLClient, Q as useBlocknoteContext, R as useBlocknoteHandlers, d as useCreateCollaborativeIxoEditor, u as useCreateIxoEditor } from './graphql-client-C82HQLeC.mjs';
import { Map } from 'yjs';
export { CloneDocumentResult, cloneDocument } from '@ixo/matrix-crdt';
export { Block, BlockNoteEditor, BlockNoteSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from '@blocknote/core';
import 'react';
import 'matrix-js-sdk';

declare const buildAuthzFromProps: (props: Record<string, any>) => FlowNodeAuthzExtension;
declare const buildFlowNodeFromBlock: (block: any) => FlowNode;

interface FlowRuntimeStateManager {
    get: (nodeId: string) => FlowNodeRuntimeState;
    update: (nodeId: string, updates: Partial<FlowNodeRuntimeState>) => void;
}
declare const createRuntimeStateManager: (editor?: IxoEditorType | null) => FlowRuntimeStateManager;

interface DelegationStore {
    get: (capabilityId: string) => SignedCapability | null;
    set: (capability: SignedCapability) => void;
    remove: (capabilityId: string) => void;
    getRoot: () => SignedCapability | null;
    setRootId: (capabilityId: string) => void;
    getAll: () => SignedCapability[];
    has: (capabilityId: string) => boolean;
}
/**
 * Create a delegation store backed by Y.Map
 */
declare const createDelegationStore: (yMap: Map<any>) => DelegationStore;
/**
 * Create an in-memory delegation store (for testing or when Y.Map unavailable)
 */
declare const createMemoryDelegationStore: () => DelegationStore;

interface CapabilityGrant {
    raw: string;
    with?: string;
    audience?: string;
    expiresAt?: number;
    action?: string;
}
type DerivedCapability = CapabilityGrant;
interface UCANManager {
    loadParentCapability: (capability: string) => Promise<CapabilityGrant>;
    deriveNodeCapability: (parent: CapabilityGrant, nodeId: string, actorDid: string) => Promise<DerivedCapability>;
    validateDerivedCapability: (derived: DerivedCapability, nodeId: string, actorDid: string) => Promise<void>;
}

interface NodeActionResult {
    claimId?: string;
    evaluationStatus?: EvaluationStatus;
    submittedByDid?: string;
    payload?: any;
}
interface ExecutionContext {
    runtime: FlowRuntimeStateManager;
    /** @deprecated Use delegationStore instead */
    ucanManager?: UCANManager;
    delegationStore?: DelegationStore;
    verifySignature?: (capabilityRaw: string, issuerDid: string) => Promise<{
        valid: boolean;
        error?: string;
    }>;
    rootIssuer?: string;
    flowUri?: string;
    now?: () => number;
}
interface ExecutionOutcome {
    success: boolean;
    stage: 'activation' | 'authorization' | 'claim' | 'action' | 'complete';
    error?: string;
    result?: NodeActionResult;
    capabilityId?: string;
    /** Invocation CID (new @ixo/ucan) */
    invocationCid?: string;
}
interface ExecuteNodeParams {
    node: FlowNode;
    actorDid: string;
    context: ExecutionContext;
    action: () => Promise<NodeActionResult>;
}
declare const executeNode: ({ node, actorDid, context, action }: ExecuteNodeParams) => Promise<ExecutionOutcome>;

interface AuthorizationResult {
    authorized: boolean;
    reason?: string;
    capabilityId?: string;
    /** Proof chain CIDs for creating invocations (new @ixo/ucan) */
    proofCids?: string[];
    /** @deprecated */
    derived?: DerivedCapability;
}
interface AuthorizationContext {
    /** @deprecated Use delegationStore instead */
    ucanManager?: UCANManager;
    delegationStore?: DelegationStore;
    verifySignature?: (capabilityRaw: string, issuerDid: string) => Promise<{
        valid: boolean;
        error?: string;
    }>;
    rootIssuer?: string;
    flowUri?: string;
}
declare const isActorAuthorized: (node: FlowNode, actorDid: string, context?: AuthorizationContext) => Promise<AuthorizationResult>;

interface ActivationResult {
    active: boolean;
    reason?: string;
}
declare const isNodeActive: (node: FlowNode, runtime: FlowRuntimeStateManager) => ActivationResult;

interface ValidateChainParams {
    /** The capability to validate */
    capability: SignedCapability;
    /** The actor DID trying to use the capability */
    actorDid: string;
    /** Required capability (what the actor wants to do) */
    requiredCapability: Capability;
    /** The delegation store */
    delegationStore: DelegationStore;
    /** Handler to verify signatures */
    verifySignature: (capabilityRaw: string, issuerDid: string) => Promise<{
        valid: boolean;
        error?: string;
    }>;
    /** Expected root issuer (entity DID) */
    rootIssuer: string;
}
/**
 * Validate a capability chain back to the root
 */
declare const validateCapabilityChain: (params: ValidateChainParams) => Promise<CapabilityValidationResult>;
/**
 * Find a valid capability for an actor to perform an action
 */
declare const findValidCapability: (params: {
    actorDid: string;
    requiredCapability: Capability;
    delegationStore: DelegationStore;
    verifySignature: (capabilityRaw: string, issuerDid: string) => Promise<{
        valid: boolean;
        error?: string;
    }>;
    rootIssuer: string;
}) => Promise<{
    found: boolean;
    capabilityId?: string;
    error?: string;
}>;

export { type ActivationResult, type AuthorizationContext, type AuthorizationResult, Capability, CapabilityValidationResult, type DelegationStore, type ExecuteNodeParams, type ExecutionContext, type ExecutionOutcome, type FlowRuntimeStateManager, type NodeActionResult, SignedCapability, buildAuthzFromProps, buildFlowNodeFromBlock, createDelegationStore, createMemoryDelegationStore, createRuntimeStateManager, executeNode, findValidCapability, isActorAuthorized, isNodeActive, validateCapabilityChain };
