import type { HostedEpmRecord } from './identity'; export type { LocalLlmQueryContext, LocalLlmQueryDraft, LocalLlmQueryRequest } from './llm-query-context'; export declare const BACKEND_MODES: readonly ["desktop-local", "remote-sdn", "browser-node"]; export type SdnBackendMode = (typeof BACKEND_MODES)[number]; export type CapabilityState = 'available' | 'degraded' | 'unavailable' | 'permission-required' | 'remote-only' | 'local-only'; export interface BackendCapability { id: string; state: CapabilityState; reason?: string; } export interface BackendResult { ok: boolean; capability: BackendCapability; data: T | null; } export interface SdnBackendConfig { mode: SdnBackendMode; kuboApiUrl: string | null; gatewayUrl: string | null; desktopProxyUrl: string | null; serverUrl: string | null; } export interface PartialSdnBackendConfig { mode?: string | null; kuboApiUrl?: string | null; gatewayUrl?: string | null; desktopProxyUrl?: string | null; serverUrl?: string | null; } export interface NodeSummary { displayName: string; peerId: string | null; agentVersion: string | null; online: boolean; runtime: SdnBackendMode; } export interface ObservedSdnPeer { id: string; name: string; addrs: string[]; trustLevel: string; agentVersion?: string; protocols?: string[]; artifactPeerAddrs?: string[]; metadata?: Record; } export interface StorageSummary { usedBytes: number | null; pinnedBytes: number | null; cacheBytes: number | null; quotaBytes: number | null; } export interface LocalObjectSummary { id: string; label: string; schema: string | null; source: string | null; sizeBytes: number | null; state: string; cid?: string; } export interface DataSchemaSummary { schemaName: string; count: number; totalBytes: number; } export interface DataSourceSummary { datastoreKey?: string; schemaName: string; providerId: string; sourceName: string; batchId: string; producerPeerId: string; producerPublicKey: string; count: number; totalBytes: number; } export interface DataSummary { totalRecords: number; totalBytes: number; schemas: DataSchemaSummary[]; sources: DataSourceSummary[]; } export interface RawDataQuery { schema: string; datastoreKey?: string; providerId?: string; sourceName?: string; batchId?: string; peerId?: string; cursor?: string; snapshotId?: string; head?: string; queryProfile?: string; syncFilter?: string; limit?: number; offset?: number; } export interface RawDataRecord { schemaName: string; cid: string; peerId: string; providerId?: string; sourceName?: string; batchId?: string; producerPeerId?: string; producerPublicKey?: string; timestamp?: string; sizeBytes: number; dataBytes?: Uint8Array; } export interface RawDataRecordBytes { schemaName: string; cid: string; bytes: Uint8Array; } export type SearchMode = 'local' | 'daemon' | 'live-dht'; export interface SharedSearchRequest { query?: string; schema?: string; providerId?: string; providerPeerId?: string; sourceName?: string; batchId?: string; queryProfile?: string; mode?: SearchMode; limit?: number; } export interface ProviderSearchRow { peerId?: string; displayName?: string; legalName?: string; bitcoinAddress?: string; epmCid?: string; source?: string; updatedAt?: string; schemaName?: string; providerPeerId?: string; providerPublicKey?: string; providerId?: string; sourceName?: string; batchId?: string; queryProfile?: string; localRows?: number; pinnedRows?: number; cachedBytes?: number; pinnedBytes?: number; snapshotId?: string; head?: string; highWaterMark?: string; lastSyncedAt?: string; [key: string]: unknown; } export interface DataSearchRow { schemaName?: string; providerId?: string; sourceName?: string; batchId?: string; queryProfile?: string; providerPeerId?: string; providerPublicKey?: string; localRows?: number; pinnedRows?: number; cachedBytes?: number; pinnedBytes?: number; snapshotId?: string; head?: string; highWaterMark?: string; lastSyncedAt?: string; [key: string]: unknown; } export interface SearchResult { count: number; results: T[]; } export interface ConjunctionScreenRequest { primarySchema: string; secondarySchema: string; encrypted?: boolean; grantId?: string; channelId?: string; resultChannelId?: string; assessorPeerId?: string; primaryProviderId?: string; primarySourceName?: string; primaryPnmCid?: string; primaryQuery?: string; secondaryProviderId?: string; secondarySourceName?: string; secondaryPnmCid?: string; secondaryQuery?: string; moduleId?: string; moduleVersion?: string; includeProvenance?: boolean; limit?: number; } export interface ConjunctionEvent { primaryObject?: string; secondaryObject?: string; tca?: string; missDistanceKm?: number; probability?: number; providerId?: string; sourceName?: string; status?: string; [key: string]: unknown; } export interface ConjunctionScreenResult { workflow: string; mode: string; status?: string; primarySchema: string; secondarySchema: string; encrypted: boolean; grantId?: string; channelId?: string; resultChannelId?: string; assessorPeerId?: string; count: number; events: ConjunctionEvent[]; provenance?: Record; sources?: Array>; } export interface DataScanResult { schema: string; totalCount: number; count: number; limit: number; offset: number; cursor: string; nextCursor: string; snapshotId: string; head: string; highWaterMark: string; scanHash: string; chunkHash: string; queryProfile: string; syncProtocol: string; maxChunkSize: number; transports: string[]; results: RawDataRecord[]; } export interface ChannelListOptions { standardCode?: string; visibility?: string; subject?: string; grantId?: string; } export interface ChannelActionOptions { subject?: string; grantId?: string; visibility?: string; encryptedStreamHeader?: string; encryptedRecordIndex?: number | string; } export interface ChannelSummary { channelId: string; sourceId: string; standardCode: string; feedUuid: string | null; visibility: string; subscribed: boolean; pnmVerified: boolean; dpmVerified: boolean; grantState: string; encryptionState: string; } export interface ChannelMonitor extends ChannelSummary { channelHead: string; providerPeer: string; localRows: number; remoteRows: number; syncedRows: number; missingRows: number; pinnedCount: number; pinnedRows: number; syncedBytes: number; throughputBytesPerSecond: number; wireSpeedUtilization: number | null; timingsMs: ChannelMonitorTimings; lastVerifiedUpdate: string; } export interface ChannelMonitorTimings { discovery: number; grantNegotiation: number; pnmDpmVerification: number; transfer: number; decrypt: number; hashVerification: number; durableImport: number; } export interface ChannelFieldStreamFieldRow { fieldPath: string; fieldIdPath: number[]; state: string; encoding: string; keyId?: string; ciphertextLength: number; valueLength: number; releaseTags: string[]; decision?: string; } export interface ChannelFieldStreamMessage { messageId: string; providerPeerId: string; listingId: string; streamId: string; schemaCode: string; policyId: string; policyVersion: number; keyEpoch?: string; sequence: string; subjectId?: string; fields: ChannelFieldStreamFieldRow[]; } export interface ChannelKeyEnvelopeRequest { recipientKeyId: string; contentKeyId?: string; } export interface ChannelBackend { list(options?: ChannelListOptions): Promise>; get(channelId: string, options?: ChannelActionOptions): Promise>; subscribe(channelId: string, options?: ChannelActionOptions): Promise>>; unsubscribe(channelId: string, options?: ChannelActionOptions): Promise>>; publish(channelId: string, body?: BodyInit | null, options?: ChannelActionOptions): Promise>>; issueGrant(channelId: string, body?: Record, options?: ChannelActionOptions): Promise>>; keyUnwrap(channelId: string, body: ChannelKeyEnvelopeRequest, options?: ChannelActionOptions): Promise>>; openStream(channelId: string, options?: ChannelActionOptions): Promise>; openFieldStream(channelId: string, options?: ChannelActionOptions): Promise>; monitor(channelId: string, options?: ChannelActionOptions): Promise>; } export interface RawDataStreamRequest { schema: string; datastoreKey?: string; scanHash?: string; chunkHash?: string; snapshotId?: string; head?: string; cursor?: string; nextCursor?: string; totalCount?: number; highWaterMark?: string; queryProfile?: string; syncFilter?: string; records: RawDataRecord[]; } export interface SdnHealth { healthy: boolean; details: Record; } export interface NodeAccessUser { xpub: string; name: string; trustLevel: string; signingPubKeyHex: string; source: string; configManaged: boolean; createdAt?: string; lastLogin?: string; } export interface NodeAccessUserInput { xpub: string; name?: string; trustLevel: string; signingPubKeyHex?: string; } export interface SdnBackend { readonly mode: SdnBackendMode; readonly channels: ChannelBackend; connect(): Promise>; getCapabilities(): Promise; getNodeSummary(): Promise>; getHealth(): Promise>; getNodeProfile(): Promise>>; saveNodeProfile(profile: Record): Promise>>; listNodeAccessUsers(): Promise>; saveNodeAccessUser(user: NodeAccessUserInput): Promise>>; revokeNodeAdmin(xpub: string): Promise>>; deleteNodeAccessUser(xpub: string): Promise>>; listHostedEpms(): Promise>; saveHostedEpm(record: HostedEpmRecord): Promise>; importHostedEpm(input: { name: string; bytes?: Uint8Array; text?: string; }): Promise>; deleteHostedEpm(id: string): Promise>>; downloadHostedEpm(id: string, format: 'json' | 'epm' | 'vcard'): Promise>; listObservedPeers(): Promise>; listTrustedPeers(): Promise>; searchDirectory(query: string): Promise>>>; connectPeer(peerId: string): Promise>>; searchListings(query: string): Promise>>>; listOwnedItems(): Promise>>>; requestGrant(listingId: string): Promise>>; installModule(moduleId: string): Promise>>; subscribeDataFeed(feedId: string): Promise>>; getStorageSummary(): Promise>; listObjects(): Promise>; inspectObject(id: string): Promise>>; getDataSummary(): Promise>; searchProviders(request: SharedSearchRequest): Promise>>; searchData(request: SharedSearchRequest): Promise>>; scanRawData(query: RawDataQuery): Promise>; streamRawData(request: RawDataStreamRequest): Promise>; queryRawData(query: RawDataQuery): Promise>; readRawDataRecord(schemaName: string, cid: string): Promise>; screenConjunction(request: ConjunctionScreenRequest): Promise>; pinObject(id: string): Promise>>; unpinObject(id: string): Promise>>; listRulesets(): Promise>>>; saveRuleset(ruleset: Record): Promise>>; runSqlQuery(query: string): Promise>>>; getKuboStatus(): Promise>>; listFiles(path?: string): Promise>>>; resolveCid(cid: string): Promise>; readGatewayUrl(path: string): Promise>; } export declare function isBackendMode(value: string | null | undefined): value is SdnBackendMode; export declare function normalizeBackendConfig(input: PartialSdnBackendConfig): SdnBackendConfig; export declare function createCapability(id: string, state: CapabilityState, reason?: string): BackendCapability; export declare function createAvailableResult(id: string, data: T): BackendResult; export declare function createUnavailableResult(id: string, reason: string): BackendResult; export declare function createDegradedResult(id: string, reason: string, data?: T | null): BackendResult; export declare function createCapabilityResult(id: string, state: CapabilityState, reason: string, data?: T | null): BackendResult; //# sourceMappingURL=sdn-backend.d.ts.map