import { type SerializableRecord, type VersionRange } from './primitives.js'; /** Canonical built-in capability identifiers. Third-party identifiers remain open namespaced strings. */ export declare const BUILT_IN_FEATURE_IDS: Readonly<{ discoveryContinuousScan: "discovery:continuous-scan"; discoverySystemChooser: "discovery:system-chooser"; discoveryAdvertisementWatch: "discovery:advertisement-watch"; scanPlatformOptions: "scan:platform-options"; peerResolveReference: "peer:resolve-reference"; /** * The backend can target a peer by an out-of-band radio address: the `addresses` scan * clause and the address form of `connect()`. Only public/static addresses are * addressable; peers using resolvable private addresses need a durable `PeerReference`. */ peerAddressTargeting: "peer:address-targeting"; peerKnown: "peer:known"; peerSystemConnected: "peer:system-connected"; peerBonded: "peer:bonded"; peerOriginAuthorized: "peer:origin-authorized"; peerRestored: "peer:restored"; connectionDirect: "connection:direct"; connectionWhenAvailable: "connection:when-available"; connectionRssi: "connection:rssi"; connectionEffectiveMtu: "connection:effective-mtu"; connectionRequestMtu: "connection:request-mtu"; connectionPriority: "connection:priority"; connectionParameters: "connection:parameters"; connectionPhy: "connection:phy"; connectionSubrate: "connection:subrate"; securityState: "security:state"; securityPair: "security:pair"; securityCancelPairing: "security:cancel-pairing"; securityUnpair: "security:unpair"; securityCustomCeremony: "security:custom-ceremony"; /** * The backend can select the LE pairing generation for a pairing - `PairOptions * .secureConnections` `'require'` (Secure Connections only) or `'disallow'` (LE * Legacy only), for peripherals that accept exactly one of them. * * No radio exposes this unprivileged. Where a backend reports it supported, a * host has supplied a privileged operation explicitly; where it does not, the * two directed values fail closed rather than bonding at a generation the * caller forbade. */ securityPairingGeneration: "security:pairing-generation"; gattDescriptors: "gatt:descriptors"; gattIndications: "gatt:indications"; gattServiceChanged: "gatt:service-changed"; maximumWriteLength: "gatt:maximum-write-length"; longWrite: "gatt:long-write"; reliableWrite: "gatt:reliable-write"; writeWithoutResponseReadiness: "gatt:write-without-response-readiness"; highThroughputAcquire: "gatt:high-throughput-acquire"; backgroundAppleRestoration: "background:apple-restoration"; backgroundAndroidConnectedDeviceService: "background:android-connected-device-service"; backgroundDesktopMaintainConnection: "background:desktop-maintain-connection"; lifecyclePagePersistence: "lifecycle:page-persistence"; }>; export type BuiltInFeatureId = (typeof BUILT_IN_FEATURE_IDS)[keyof typeof BUILT_IN_FEATURE_IDS]; export interface BuiltInFeatureCatalogEntry { readonly id: BuiltInFeatureId; readonly catalogVersion: 2; readonly requiredTckSuiteId: 'capability.catalog-v2'; readonly documentationAnchor: string; } /** One metadata authority for built-in capability documentation and TCK binding. */ export declare const BUILT_IN_FEATURE_CATALOG: readonly BuiltInFeatureCatalogEntry[]; /** The backend-observed per-connection limit used to plan a chunked write. */ export interface MaximumWriteLengthFeatureInput extends SerializableRecord { readonly connectionId: string; readonly connectionGeneration: string; readonly mode: 'with-response' | 'without-response'; } /** Serializable maximum-write-length observation returned by a registered backend implementation. */ export interface MaximumWriteLengthFeatureOutput extends SerializableRecord { readonly connectionId: string; readonly connectionGeneration: string; readonly mode: 'with-response' | 'without-response'; readonly maximumWriteLength: number; readonly observedAtMonotonicMs: number; } /** Typed registration implementation for the built-in maximum-write-length capability. */ export type MaximumWriteLengthFeatureImplementation = FeatureImplementation; /** The core-owned chunking policy is identified separately from native reliable-write support. */ export interface LongWriteFeatureInput extends SerializableRecord { readonly connectionId: string; readonly connectionGeneration: string; readonly mode: 'with-response' | 'without-response'; readonly byteLength: number; readonly maximumWriteLength: number; } export interface LongWriteFeatureOutput extends SerializableRecord { readonly totalChunks: number; readonly maximumWriteLength: number; } /** Typed registration implementation for the core-emulated long-write planner. */ export type LongWriteFeatureImplementation = FeatureImplementation; export type FeatureState = 'supported' | 'limited' | 'unsupported' | 'unavailable'; export type EvidenceLevel = 'blocked' | 'deterministic' | 'live-preview' | 'supported' | 'reliability-qualified'; export type FeatureId = `${Namespace}:${Name}`; export interface Limitation { readonly code: string; readonly explanation: string; readonly affectedGuarantee: string; } export interface EvidenceReceipt { readonly receiptId: string; readonly evidenceLevel: EvidenceLevel; readonly implementationVersion: string; readonly sourceDigest: string; readonly scenarioIds: readonly string[]; readonly limitations: readonly Limitation[]; } export interface FeatureImplementation { invoke(input: Input): Promise; } /** A bounded operating limit with a unit that remains meaningful after serialization. */ export interface CapabilityLimit { readonly maximum: number; readonly minimum: number | null; readonly unit: string; } /** * Feature-specific limits are deliberately an open record: registered third-party features do * not need a central union, while every value still has a bounded, machine-readable shape. */ export type CapabilityLimits = Readonly>; export interface TckBinding { readonly suiteId: string; readonly requiredScenarioIds: readonly string[]; readonly contractRange: VersionRange<'capability-schema'>; } export interface FeatureRegistration> { readonly id: Id; readonly state: FeatureState; readonly selectedSchemaRange: VersionRange<'capability-schema'>; readonly implementationOrigin: 'backend-native' | 'core-emulated'; readonly implementation: Implementation; readonly tck: TckBinding; readonly evidence: EvidenceReceipt; readonly limitations: readonly Limitation[]; readonly limits: CapabilityLimits; } /** Serializable capability truth. Typed implementations are intentionally excluded. */ export interface CapabilityDescriptor { readonly id: FeatureId; readonly state: FeatureState; readonly selectedSchemaRange: VersionRange<'capability-schema'>; readonly implementationOrigin: 'backend-native' | 'core-emulated'; readonly tck: TckBinding; readonly evidence: EvidenceReceipt; readonly limitations: readonly Limitation[]; readonly limits: CapabilityLimits; } export interface CapabilitySnapshot { readonly schemaVersion: 2; readonly backendGeneration: string; readonly descriptors: readonly CapabilityDescriptor[]; } export interface FeatureRegistry { readonly registrations: readonly FeatureRegistration>[]; readonly descriptors: readonly CapabilityDescriptor[]; } export interface BackendOperationCapabilityOptions { readonly id?: BuiltInFeatureId; readonly implementationVersion: string; readonly sourceDigest: string; readonly tckSuiteId: string; readonly requiredScenarioIds: readonly string[]; readonly limitations?: readonly Limitation[]; readonly operation?: string; } /** Creates a truthful marker for an operation implemented by a concrete backend seam. */ export declare function createBackendOperationCapabilityRegistration(options: BackendOperationCapabilityOptions): FeatureRegistry['registrations'][number]; /** Validates the data-only capability projection used by every host boundary. */ export declare function validateCapabilityDescriptor(descriptor: CapabilityDescriptor): CapabilityDescriptor; /** Deep-copies a validated descriptor while excluding no data-only fields. */ export declare function snapshotCapabilityDescriptor(descriptor: CapabilityDescriptor): CapabilityDescriptor; export declare function snapshotCapabilityDescriptors(descriptors: readonly CapabilityDescriptor[], backendGeneration: string): CapabilitySnapshot; export declare function validateCapabilitySnapshot(snapshot: CapabilitySnapshot, expectedBackendGeneration: string, requireCatalogComplete?: boolean): CapabilitySnapshot; export declare function validateFeatureRegistration>(registration: FeatureRegistration): FeatureRegistration; export declare function createFeatureRegistry(registrations: readonly FeatureRegistration>[]): FeatureRegistry; /** Returns the frozen descriptive projection suitable for capability handshakes and IPC. */ export declare function describeFeatureRegistry(registry: FeatureRegistry): readonly CapabilityDescriptor[]; //# sourceMappingURL=capabilities.d.ts.map