Move repository content images to S3-backed media references

This commit is contained in:
2026-10-29 23:03:11 +08:00
parent 906c6985cb
commit 19bba57561
630 changed files with 5666 additions and 391 deletions
+2 -1
View File
@@ -6,7 +6,8 @@ import {createHash} from 'node:crypto';
import annotations from '../contentasset:annotations.json';
import {textMergeTarget,unionBoxes} from '../contentasset:group-text';
import ocr from '../contentasset:ocr-evidence.json';
const root=path.resolve(import.meta.dirname,'..'),target=path.join(root,'contentasset:assets');
const root=path.resolve(import.meta.dirname,'..'),target=path.resolve(process.env.MEDIA_AUTHORING_ROOT||'/tmp/prompt-media-authoring');
if(target===root||target.startsWith(root+path.sep))throw Error('MEDIA_AUTHORING_ROOT must be outside repository');
type Box=[number,number,number,number];
type Element={id:string;kind:'text'|'image'|'decoration';role:string;box:Box;text:string|null;direction:string;reading:'verified'|'unreadable'|'not-text';asset:string;mask?:string;underlay?:string;pixels:number};
function components(mask:Uint8Array,w:number,h:number){