mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-19 11:26:02 +00:00
* feat(share): extract shared review kernel for local hosts * fix: recover completed shares and integrate kernel checks * fix: terminate ffprobe options before share media input * fix: verify executable imports without matching JSDoc types * build: budget the published sharing package * fix: publish NodeNext-compatible sharing declarations * fix: invalidate shared renders when linked media changes * fix: reserve share progress before awaiting upload lock * fix: copy share build inputs before image dependency install * fix(share): preserve Desktop snapshots and support portable locks * fix(share): restrict video uploads to trusted origins * fix(share): preserve review state across recovery and uploads * fix(share): preserve review title and feedback attribution * fix(share): accept legacy review records safely * build(share): update measured package size budget * fix(share): preserve feedback cutoff across export retries * docs(share): describe only the storage origins the signer uses Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
939 B
JavaScript
28 lines
939 B
JavaScript
// @ts-check
|
|
|
|
/** @typedef {{ read: (dir: string) => Promise<"yes" | "no" | null>,
|
|
* published: (dir: string, since: number) => Promise<void>, now: () => number }} FromReview */
|
|
|
|
/** @param {FromReview} host @param {string} dir */
|
|
export async function readFromReview(host, dir) {
|
|
const since = host.now();
|
|
try {
|
|
const value = await host.read(dir);
|
|
return { since, ...(value && { value }) };
|
|
} catch (error) {
|
|
console.error("[share] review mark not read:", error);
|
|
return { since };
|
|
}
|
|
}
|
|
|
|
/** Clear activity through the start of the successful share, keeping anything recorded later.
|
|
* @param {FromReview | null} host @param {string} dir @param {number | undefined} since */
|
|
export async function sharedFromReview(host, dir, since) {
|
|
if (!host || since === undefined) return;
|
|
try {
|
|
await host.published(dir, since);
|
|
} catch (error) {
|
|
console.error("[share] review mark not cleared:", error);
|
|
}
|
|
}
|