/** * Operator hint for optional Hyperbee2-style P2P indexes (Holepunch hyperbee2). * Guests do not open Hyperbee by default; extensions on a capable host may dynamic-import. */ /** * @param {Record | null | undefined} env */ export function buildBareOsHyperbeeGuestHint(env) { const on = env?.BARE_OS_HYPERBEE_GUEST_INDEX === '1' || env?.BARE_OS_HYPERBEE_GUEST_INDEX === 'true' return { schema: 2, enabled: on, optionalNpmPackage: 'hyperbee2', hyperbee2ReadSurface: { schema: 1, typicalOps: ['get', 'peek', 'createReadStream', 'find'], guestProcOnly: true, note: 'Read-only hint for operators; matches common **hyperbee2** APIs. Guests do not auto-open indexes.' }, code: on ? 'host_extension_may_import' : 'ENOTSUP', note: 'When enabled, operators may attach hyperbee2-backed indexes from host Pear/Bare context; stock guest kernel stays file/Hyperdrive-shaped. No central authority: indexes replicate with their Hypercore backing store.', atMs: Date.now() } }