feat(pear-platform): deepen runtime, link, and bundle APIs

Add merge/remove hints, link cache helpers, applink flags and validation,
import-map merge/remove, runtime configure, deep-link peek, OTA rollback,
and bundle unregister for manual pear-platform expansion.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-21 02:25:06 -04:00
co-authored by Cursor
parent 26ca05031a
commit ed7f0ab34f
11 changed files with 189 additions and 0 deletions
@@ -62,6 +62,27 @@ class HyperBareImportMap extends EventEmitter {
return Object.prototype.hasOwnProperty.call(this._imports, specifier)
}
remove (specifier) {
const k = String(specifier)
const had = Object.prototype.hasOwnProperty.call(this._imports, k)
if (had) delete this._imports[k]
return had
}
keys () {
return Object.keys(this._imports)
}
mergeImports (extra) {
if (!extra || typeof extra !== 'object') throw new Error('extra imports object required')
let n = 0
for (const [k, v] of Object.entries(extra)) {
if (!Object.prototype.hasOwnProperty.call(this._imports, k)) n++
this._imports[k] = v
}
return n
}
getStats () {
return platformStats(this._stats, PROTOCOL, { entries: Object.keys(this._imports).length })
}