Files
bare-operating-system/packages/bare-os-booter/lib/bare-os-hyperbee-guest-hint.js
T
Raven Scott c15e8fa5be feat(booter): POSIX/P2P roadmap — profile 1.0.14, ctx 1.50.0, docs & tests
- Sync declared POSIX profile, compliance matrix, syscalls examples, dashboard
- Extend holepunch clone sync reporting; bump protomux/hyperswarm lock fixture schema
- Optional shell read builtin (BARE_OS_SHELL_READ_*); host env passthrough
- Expand bareOsGetconfSysconf / getconf; pathconf for acct/union/mirror
- Wasm optional bare_os_monotonic_ms; replication live snapshot hints schema
- Socket bridge SO_RCVBUF/SO_SNDBUF; mq priority + FIFO ordering + tests
- Extract cooperative fcntl lock helpers; FIFO waiter drain tests
- Peer admission audit helpers, rate limit + redaction tests; security_posture schema
- CI: verify-ctx requires CHANGELOG row, d.ts version mention, compatibility matrix
- Warm-cache microbench (vfs suite); boot budget / metrics cohesion (prior work)
- Handbook, KERNEL_CONTRACT, kernel-program, env appendix, README, users-manual, schemas

Kernel bundle + seeder rsync + coreutils build verified via npm test.
2026-04-05 13:50:07 -04:00

30 lines
1.1 KiB
JavaScript

/**
* 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<string, string | undefined> | 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()
}
}