Lands epic #1007 part 2(c): the app-side reference converter, the `audioUrl` removal, and the `DSL_VERSION` bump as one delivery unit. `convertDocumentAssetRefs` walks a loaded document (slide canvases, whiteboards, video-manifest keys, speech actions) and rewrites legacy handles to allocated pool ids: placeholders and `audioId`s with local bytes are ingested, a co-present `audioUrl`/`audioId` pair collapses to one asset, a definitively dead URL converts to an emptied reference, and a transient failure keeps both handles for a later retry. Unavailable bytes leave the document untouched for a later open, and a converted document returns by identity with no writes. Conversion runs lazily on document open and at fetch time for server-generated classrooms, with conversion and the first document save sharing the per-stage document lock: once the document commits it owns every allocation, and every failure exit rolls its pass ledger back. Legacy URL probes are bounded by a per-probe timeout and a shared 60-second pass budget. `SpeechAction.audioUrl` is removed from the DSL and every consumer reads the converted shape; the server classroom generator keeps its derived-id + serving-URL pair as an explicitly typed pre-conversion transport, consumed before persistence. `DSL_VERSION` becomes 0.2.0 with the first real ladder entry, and `@openmaic/dsl` goes to 0.9.0 per the release rule. Deferred follow-ups are tracked in #1129: production principal derivation with document/asset ownership aligned, conditional document writes, and hoisting the aggregate probe budget into the export and video-timeline paths. Refs #1007
121 lines
3.1 KiB
JSON
121 lines
3.1 KiB
JSON
{
|
|
"name": "@openmaic/storage",
|
|
"version": "0.4.0",
|
|
"description": "The MAIC pluggable persistence layer: document / runtime / KV / asset primitives with browser and HTTP backends, depending only on @openmaic/dsl.",
|
|
"type": "module",
|
|
"main": "./dist/index.js",
|
|
"module": "./dist/index.js",
|
|
"types": "./dist/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"import": "./dist/index.js"
|
|
},
|
|
"./runtime/http": {
|
|
"types": "./dist/runtime/http.d.ts",
|
|
"import": "./dist/runtime/http.js"
|
|
},
|
|
"./document/http": {
|
|
"types": "./dist/document/http.d.ts",
|
|
"import": "./dist/document/http.js"
|
|
},
|
|
"./kv/http": {
|
|
"types": "./dist/kv/http.d.ts",
|
|
"import": "./dist/kv/http.js"
|
|
},
|
|
"./asset/http": {
|
|
"types": "./dist/asset/http.d.ts",
|
|
"import": "./dist/asset/http.js"
|
|
},
|
|
"./document/pg": {
|
|
"types": "./dist/document/pg.d.ts",
|
|
"import": "./dist/document/pg.js"
|
|
},
|
|
"./runtime/pg": {
|
|
"types": "./dist/runtime/pg.d.ts",
|
|
"import": "./dist/runtime/pg.js"
|
|
},
|
|
"./asset/pg": {
|
|
"types": "./dist/asset/pg.d.ts",
|
|
"import": "./dist/asset/pg.js"
|
|
},
|
|
"./asset/pg-bytes": {
|
|
"types": "./dist/asset/pg-bytes.d.ts",
|
|
"import": "./dist/asset/pg-bytes.js"
|
|
},
|
|
"./asset/s3-bytes": {
|
|
"types": "./dist/asset/s3-bytes.d.ts",
|
|
"import": "./dist/asset/s3-bytes.js"
|
|
},
|
|
"./asset/collector": {
|
|
"types": "./dist/asset/collector.d.ts",
|
|
"import": "./dist/asset/collector.js"
|
|
},
|
|
"./server": {
|
|
"types": "./dist/server/index.d.ts",
|
|
"import": "./dist/server/index.js"
|
|
},
|
|
"./server/reference": {
|
|
"types": "./dist/server/reference.d.ts",
|
|
"import": "./dist/server/reference.js"
|
|
}
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"README.md",
|
|
"LICENSE"
|
|
],
|
|
"sideEffects": false,
|
|
"scripts": {
|
|
"clean": "rm -rf dist",
|
|
"build": "rm -rf dist && tsc -p tsconfig.json",
|
|
"dev": "tsc -p tsconfig.json --watch",
|
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"prepublishOnly": "pnpm run build"
|
|
},
|
|
"keywords": [
|
|
"maic",
|
|
"storage",
|
|
"persistence",
|
|
"kv",
|
|
"indexeddb"
|
|
],
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/THU-MAIC/OpenMAIC",
|
|
"directory": "packages/@openmaic/storage"
|
|
},
|
|
"publishConfig": {
|
|
"registry": "https://registry.npmjs.org",
|
|
"access": "public"
|
|
},
|
|
"dependencies": {
|
|
"@openmaic/dsl": "workspace:^"
|
|
},
|
|
"peerDependencies": {
|
|
"@aws-sdk/client-s3": "^3.0.0",
|
|
"@aws-sdk/s3-request-presigner": "^3.0.0"
|
|
},
|
|
"peerDependenciesMeta": {
|
|
"@aws-sdk/client-s3": {
|
|
"optional": true
|
|
},
|
|
"@aws-sdk/s3-request-presigner": {
|
|
"optional": true
|
|
}
|
|
},
|
|
"devDependencies": {
|
|
"@aws-sdk/client-s3": "^3.1048.0",
|
|
"@aws-sdk/s3-request-presigner": "^3.1048.0",
|
|
"@electric-sql/pglite": "^0.3.14",
|
|
"@types/pg": "^8.15.5",
|
|
"fake-indexeddb": "^6.0.0",
|
|
"pg": "^8.16.3",
|
|
"typescript": "^5",
|
|
"vitest": "^4.1.8"
|
|
}
|
|
}
|