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

declare const DynamicListBlockSpec: {
    config: {
        readonly type: "dynamicList";
        readonly propSchema: {
            readonly listId: {
                readonly default: "";
            };
            readonly title: {
                readonly default: "";
            };
            readonly columns: {
                readonly default: "[]";
            };
            readonly dataSource: {
                readonly default: "{}";
            };
            readonly snapshot: {
                readonly default: "";
            };
            readonly snapshotTimestamp: {
                readonly default: "";
            };
            readonly panelDescription: {
                readonly default: "";
            };
            readonly actions: {
                readonly default: "[]";
            };
            readonly skill: {
                readonly default: "";
            };
        };
        readonly content: "none";
    };
    implementation: _blocknote_core.TiptapBlockImplementation<{
        readonly type: "dynamicList";
        readonly propSchema: {
            readonly listId: {
                readonly default: "";
            };
            readonly title: {
                readonly default: "";
            };
            readonly columns: {
                readonly default: "[]";
            };
            readonly dataSource: {
                readonly default: "{}";
            };
            readonly snapshot: {
                readonly default: "";
            };
            readonly snapshotTimestamp: {
                readonly default: "";
            };
            readonly panelDescription: {
                readonly default: "";
            };
            readonly actions: {
                readonly default: "[]";
            };
            readonly skill: {
                readonly default: "";
            };
        };
        readonly content: "none";
    }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
};

interface DynamicListBlockProps extends IxoBlockProps {
}

/**
 * Position in the list item layout
 * - topLeft: Primary identifier (e.g., name, title)
 * - bottomLeft: Secondary info (e.g., subtitle, address, description)
 * - topRight: Primary value (e.g., amount, percentage, status)
 * - bottomRight: Secondary value (e.g., role, date, additional info)
 */
type ColumnPosition = 'topLeft' | 'bottomLeft' | 'topRight' | 'bottomRight';
/**
 * Column definition for dynamic lists
 */
interface DynamicListColumn {
    /** Unique key matching data object properties */
    key: string;
    /** Display label for the column header (shown in table view, used for accessibility) */
    label: string;
    /** Position in the list item layout - optional, columns without position shown only in detail panel */
    position?: ColumnPosition;
    /** Data type for formatting and sorting */
    type?: 'string' | 'number' | 'date';
    /** Optional color for the text (Mantine color like 'blue', 'green', 'dimmed') */
    color?: string;
}
/**
 * DataSource describes how to fetch the list data
 * This is stored in the block so other users can reproduce the query
 */
interface DataSource {
    /** The DID (Decentralized Identifier) of the oracle that generated this data */
    oracleDid: string;
    /** Human-readable oracle name */
    oracleName?: string;
    /** A standalone query that can be used in a brand new conversation to reproduce this data */
    query: string;
    /** Tool name for programmatic re-fetch (if oracle supports it) */
    toolName?: string;
    /** Parameters for the tool call */
    params?: Record<string, any>;
    /** Human description of what this data represents */
    description?: string;
}
/**
 * Action that can be performed on a dynamic list item
 */
interface DynamicListAction {
    /** Unique identifier for the action */
    id: string;
    /** Display label for the action button */
    label: string;
    /** Optional button color (Mantine color like 'blue', 'green', 'red') */
    color?: string;
}
/**
 * Panel configuration for dynamic list item detail view
 */
interface DynamicListPanelConfig {
    /** Description shown at the top of the panel explaining what items represent */
    panelDescription?: string;
    /** List of actions that can be performed on items */
    actions?: DynamicListAction[];
}

declare function DebugButton({ editor }: {
    editor: IxoEditorType;
}): React__default.JSX.Element;

interface BaseIconPickerProps {
    opened: boolean;
    onClose: () => void;
    onSelectIcon: (iconName: string) => void;
    onUploadClick?: () => void;
    onRemove?: () => void;
    currentIcon?: string;
}
declare function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove, children, currentIcon }: PropsWithChildren<BaseIconPickerProps>): React__default.JSX.Element;

interface PageHeaderMenuItem {
    label: string;
    onClick: () => void;
    icon?: React__default.ReactNode;
    disabled?: boolean;
    divider?: boolean;
}
interface PageHeaderProps {
    title?: string;
    icon?: React__default.ReactNode;
    isPrivate?: boolean;
    onPrivacyChange?: (isPrivate: boolean) => void;
    lastEdited?: string;
    onShare?: () => void;
    onFavorite?: () => void;
    isFavorited?: boolean;
    menuItems?: PageHeaderMenuItem[];
}
/**
 * PageHeader component - A Notion-style page header with title, privacy badge, and actions
 */
declare function PageHeader({ title, icon, isPrivate, onPrivacyChange, lastEdited, onShare, onFavorite, isFavorited, menuItems, }: PageHeaderProps): React__default.ReactElement;

interface PageTitleProps {
    editor: IxoEditorType;
    editable?: boolean;
}
declare function PageTitle({ editor, editable }: PageTitleProps): React__default.ReactElement;

interface PanelState {
    activePanel: string | null;
    registeredPanels: Map<string, React.ReactNode>;
    setActivePanel: (panelId: string | null) => void;
    closePanel: () => void;
    registerPanel: (id: string, content: React.ReactNode) => void;
    unregisterPanel: (id: string) => void;
}
declare const usePanelStore: zustand.UseBoundStore<zustand.StoreApi<PanelState>>;
declare const usePanel: (panelId: string, content: React.ReactNode) => {
    opened: boolean;
    open: () => void;
    close: () => void;
};

/**
 * Reactive hook that subscribes to a single node's runtime state in yDoc.runtime.
 *
 * Usage:
 *   const [runtime, updateRuntime] = useNodeRuntime(editor, block.id);
 *   // runtime.state, runtime.output, runtime.error, etc.
 *   // updateRuntime({ state: 'completed', output: { ... } });
 */
declare function useNodeRuntime(editor: IxoEditorType, nodeId: string): [FlowNodeRuntimeState, (updates: Partial<FlowNodeRuntimeState>) => void];

type CollapseEvent = 'collapse' | 'expand' | 'toggle';
type Listener = (event: CollapseEvent) => void;
interface ListBlocksUIContextValue {
    broadcastCollapse: (event: CollapseEvent) => void;
    subscribe: (listener: Listener) => () => void;
    isMaximized: boolean;
    setMaximized: (maximized: boolean) => void;
    toggleMaximized: () => void;
}
interface ListBlocksUIState extends ListBlocksUIContextValue {
    listeners: Set<Listener>;
}
/**
 * Zustand store for managing list blocks UI state (collapse/expand)
 * Works across multiple React instances (no React Context needed)
 */
declare const useListBlocksUIStore: zustand.UseBoundStore<zustand.StoreApi<ListBlocksUIState>>;
/**
 * Hook to access list blocks UI functionality
 * No provider needed - uses Zustand store directly
 */
declare const useListBlocksUI: () => ListBlocksUIContextValue;

/**
 * Defines a payload field available from a block action
 */
interface PayloadField {
    key: string;
    label: string;
    type: 'string' | 'number' | 'boolean' | 'object';
    description?: string;
    /** For object-type fields: known child fields */
    childFields?: PayloadField[];
}
/**
 * Defines an action that a block can perform and its resulting payload
 */
interface BlockActionDefinition {
    actionId: string;
    label: string;
    description: string;
    payloadSchema: PayloadField[];
    /** Optional: resolve dynamic payload fields (e.g. survey fields) at config time */
    resolveDynamicFields?: (context: {
        handlers: any;
        blockProps: Record<string, any>;
    }) => Promise<PayloadField[]>;
}
/**
 * Configuration field for a hooked action type
 */
interface HookedActionConfigField {
    key: string;
    label: string;
    type: 'string' | 'select' | 'blockSelect' | 'templateSelect';
    required: boolean;
    description?: string;
    placeholder?: string;
    blockTypes?: string[];
}
/**
 * Context provided to hooked action execute functions
 */
interface HookedActionContext {
    handlers: BlocknoteHandlers;
    editor: any;
    sourceBlock: any;
}
/**
 * Defines a type of hooked action (e.g., sendEmail, addLinkedEntity)
 */
interface HookedActionType {
    type: string;
    label: string;
    description: string;
    configSchema: HookedActionConfigField[];
    /**
     * Execute the hooked action
     * @param config - The action configuration from block props
     * @param payload - The payload from the triggering action
     * @param context - Handlers, editor, and source block
     */
    execute: (config: HookedActionInstanceConfig, payload: Record<string, any>, context: HookedActionContext) => Promise<void>;
}
/**
 * Configuration for a single hooked action instance on a block
 */
interface HookedActionInstanceConfig {
    id: string;
    type: string;
    enabled: boolean;
    config: Record<string, any>;
    /**
     * Maps action config fields to payload values
     * e.g., { 'to': '{{payload.agentAddress}}', 'claimId': '{{payload.claimId}}' }
     */
    variableMappings: Record<string, string>;
}
/**
 * Configuration for all hooked actions on a block, organized by action ID
 */
interface HookedActionsConfig {
    [actionId: string]: HookedActionInstanceConfig[];
}
/**
 * Result from executing hooked actions
 */
interface HookedActionsExecutionResult {
    executed: number;
    errors: string[];
}

/**
 * Register a hooked action type
 */
declare function registerHookedActionType(actionType: HookedActionType): void;
/**
 * Get a hooked action type by its type ID
 */
declare function getHookedActionType(type: string): HookedActionType | undefined;
/**
 * Get all registered hooked action types
 */
declare function getAllHookedActionTypes(): HookedActionType[];
/**
 * Register block action definitions for a block type
 */
declare function registerBlockActions(blockType: string, actions: BlockActionDefinition[]): void;
/**
 * Get action definitions for a block type
 */
declare function getBlockActions(blockType: string): BlockActionDefinition[];

interface UseHookedActionsProps {
    block: any;
    editor: any;
}
/**
 * Hook for executing hooked actions on a block
 *
 * @example
 * ```tsx
 * const { executeHookedActions } = useHookedActions({ block, editor });
 *
 * // After main action completes
 * const result = await handleCreate();
 * executeHookedActions('create', {
 *   coreAddress: result.coreAddress,
 *   groupAddress: result.groupAddress,
 *   transactionHash: result.transactionHash,
 * });
 * ```
 */
declare function useHookedActions({ block, editor }: UseHookedActionsProps): {
    executeHookedActions: (actionId: string, payload: Record<string, any>) => void;
    executeHookedActionsWithResults: (actionId: string, payload: Record<string, any>) => Promise<HookedActionsExecutionResult>;
};

/**
 * Register all built-in hooked action types
 * Call this at app initialization
 */
declare function registerBuiltInActionTypes(): void;

/**
 * Initialize the hooked actions system.
 * This registers all built-in action types and block action definitions.
 * Should be called once at app startup.
 */
declare function initializeHookedActions(): void;

interface HookedActionsTabProps {
    editor: any;
    block: any;
    /** Block action definitions - what actions this block exposes */
    blockActions: BlockActionDefinition[];
    /** Current hookedActions JSON string from block props */
    hookedActions: string;
    /** Callback when hookedActions config changes */
    onHookedActionsChange: (value: string) => void;
}

declare const HookedActionsTab: React__default.FC<HookedActionsTabProps>;

/**
 * Extract the homeserver domain from a Matrix user ID.
 * e.g. "@user:matrix.ixo.world" → "matrix.ixo.world"
 */
declare function getHomeserver(matrixClient: MatrixClient): string;
/**
 * Convert a DID to a Matrix user ID.
 * e.g. "did:ixo:abc" → "@did-ixo-abc:matrix.ixo.world"
 *
 * This mirrors the reverse mapping in AssignmentTab:
 *   matrixUserId.split(':')[0].replace('@', '').replace(/-/g, ':')
 */
declare function didToMatrixUserId(did: string, homeserver: string): string;
/**
 * Find an existing DM room with the target user, or create one.
 * Uses the `m.direct` account data to track DM room associations.
 */
declare function findOrCreateDMRoom(matrixClient: MatrixClient, targetUserId: string): Promise<string>;
/**
 * Send a direct message to a user identified by DID.
 * Finds or creates a DM room and sends the message.
 */
declare function sendDirectMessage(matrixClient: MatrixClient, targetDid: string, message: string): Promise<{
    roomId: string;
}>;

interface DMNotificationRecord {
    /** DID of the assigned actor who was notified */
    assignedDid: string;
    /** Unix timestamp (ms) when the notification was sent */
    notifiedAt: number;
    /** Matrix user ID of whoever triggered the notification */
    notifiedBy: string;
}
interface DMNotificationState {
    [blockId: string]: DMNotificationRecord;
}
/**
 * Read the DM notification dedup state from the runtime Y.Map.
 */
declare function getDMNotificationState(runtimeMap: Map$1<any>): DMNotificationState;
/**
 * Write a DM notification record for a block, merging with existing state.
 */
declare function setDMNotificationRecord(runtimeMap: Map$1<any>, blockId: string, record: DMNotificationRecord): void;
/**
 * Check whether a DM notification should be sent for a given block.
 * Returns true if:
 * - No notification was ever sent for this block, OR
 * - The assigned DID has changed since the last notification
 */
declare function shouldNotify(state: DMNotificationState, blockId: string, currentAssignedDid: string): boolean;

export { BaseIconPicker, type BlockActionDefinition, BlocknoteHandlers, type CollapseEvent, type ColumnPosition, type DMNotificationRecord, type DMNotificationState, type DataSource, DebugButton, type DynamicListAction, type DynamicListBlockProps, DynamicListBlockSpec, type DynamicListColumn, type DynamicListPanelConfig, type HookedActionInstanceConfig, type HookedActionType, type HookedActionsConfig, HookedActionsTab, IxoEditorType, type ListBlocksUIContextValue, type Listener, PageHeader, type PageHeaderMenuItem, type PageHeaderProps, PageTitle, type PageTitleProps, type PayloadField, didToMatrixUserId, findOrCreateDMRoom, getAllHookedActionTypes, getBlockActions, getDMNotificationState, getHomeserver, getHookedActionType, initializeHookedActions, registerBlockActions, registerBuiltInActionTypes, registerHookedActionType, sendDirectMessage, setDMNotificationRecord, shouldNotify, useHookedActions, useListBlocksUI, useListBlocksUIStore, useNodeRuntime, usePanel, usePanelStore };
