Spot it. Save it. Free, local-first Chrome extension for images, videos and prompts. Explore 2,000+ curated cases and connect your library to AI Agents via MCP. 提示词导演
JavaScript ai-artai-videochrome-extensionclaude-codecodexhiggsfieldjimenglocal-firstmcpmidjourneymoodboardprompt-engineeringprompt-libraryprompt-managerreference-libraryseedancevisual-bookmarksweb-clipper
补齐 1.19.2 发布前的数据保真与本地视频语义
MigenAI9bdf06b68360
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 94534b3..b421151 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,15 @@# Changelog+## 1.19.2++- 历史分享包统一经过 v1–v5 迁移后再导入,兼容 `jpeg/jpg` 等同族格式;无效 AI 标签会被丢弃并记录,不再阻断仍可恢复的案例。+- 分享 ZIP 按案例和媒体隔离失败:单个缺失、损坏、类型不符或描述不安全的文件会被跳过,其他正确案例继续导入;导入确认会明确列出保留、跳过和丢弃数量。+- 导入写入改为可重复确认的事务流程,网络回执丢失不会造成重复案例或孤立媒体;完全相同的案例与媒体只跳过精确副本,不自动合并用户主动保存的相似内容。+- 完整资料夹备份升级为可换电脑恢复:包含回收站案例和项目,并把仍可读取的本机链接原件复制进备份;写完后会回读自检,任一核心素材不可读时不写完成标记。+- 修复项目删除与恢复关系、历史标签树在回收站中的迁移,以及坏 AI 标签随回收站案例或媒体复活的问题。+- 创作台可复用带有效画面描述的旧版图片分析;图片分析改为可观察的后台任务,关闭窗口只断开本页,显式停止与再次分析分别处理,并让交互任务优先于后台导入分析。+- 历史迁移继续保留分析请求次数和规范化诊断;无法由 Chrome 预览的本地 MPEG-4 视频在案例墙明确显示为本地文件,不再伪装成外部“视频来源”。+## 1.19.1- 修复项目侧栏与案例管理两处批量画面分析入口:选择范围、开始按钮、运行中进度、暂停与失败数量都会即时显示,旧任务也不会再用过期模型覆盖当前设置。diff --git a/README.md b/README.mdindex 20c2f42..123da91 100644--- a/README.md+++ b/README.md@@ -14,7 +14,7 @@ PromptDirector 是一个免费、开源、本地优先的 Chrome 扩展。它把- 把案例提炼成可复用的创作 Skill,在创作台组合案例、Skill 和临时附件;- 生成可编辑的图片或视频提示词,也可以连接自己的服务直接生成媒体;- 使用可选的文字分析或画面分析,让资料更容易检索;-- 创建完整资料夹备份,或通过加密同步文件夹在自己的设备间恢复资料。+- 创建可换电脑恢复的完整资料夹备份(包含回收站,并在备份时复制可读取的本机链接原件),或通过加密同步文件夹在自己的设备间恢复资料。## 隐私与数据diff --git a/docs/EXTENSION_ID_MIGRATION.md b/docs/EXTENSION_ID_MIGRATION.mdindex d6aba6c..5506015 100644--- a/docs/EXTENSION_ID_MIGRATION.md+++ b/docs/EXTENSION_ID_MIGRATION.md@@ -6,10 +6,12 @@ Chrome 会把扩展资料绑定到浏览器配置和扩展 ID。更换为另一1. 保持旧扩展已安装,不要先卸载。2. 在旧扩展的“更多 → 备份与同步”创建完整资料夹备份。-3. 打开备份目录,确认包含完成标记和媒体文件,并记录资料库显示的案例数量。+3. 打开备份目录,确认包含完成标记和媒体文件,并记录资料库显示的案例数量。1.19.2 及之后创建的新备份还会包含回收站案例和项目,并把可读取的本机链接原件复制成可恢复文件。4. 安装新扩展,在“备份与同步”中选择刚才的完整资料夹备份恢复。5. 随机打开多个案例,核对文字、媒体和项目关系;确认无误后再移除旧扩展。+完整资料夹备份只有在全部核心素材写入、回读和完整性检查通过后才会生成完成标记。任一本机链接或本地媒体无法读取时,本次资料夹不会被视为有效备份;请重新授权或重新定位对应文件后再创建备份。+如果旧扩展已经卸载且没有完整资料夹备份、同步目录或完整浏览器配置备份,Chrome 可能已经清除了旧数据,无法由新扩展恢复。正式发布包必须使用 Chrome Web Store 为该项目分配的稳定身份。`npm run package:release` 会在缺失时停止发布;普通 `npm run package` 仅用于开发验证。diff --git a/docs/KNOWN_LIMITATIONS.md b/docs/KNOWN_LIMITATIONS.mdindex 81f46dc..e678179 100644--- a/docs/KNOWN_LIMITATIONS.md+++ b/docs/KNOWN_LIMITATIONS.md@@ -5,3 +5,9 @@PromptDirector 目前依赖 Chrome 的原生媒体解码能力。遇到浏览器无法解码、但系统播放器可以播放的 MPEG-4 文件时,案例仍会保留原文件和来源信息,并提供使用系统播放器打开的路径;当前版本不在扩展内置软件解码器。后续如实施软件解码,至少需要同时满足以下验收条件:不改变原文件、不会把解码失败误报为导入成功、能中止长时间任务、限制内存与临时存储占用,并在发布包体积与浏览器安全策略检查通过后再启用。++## 超大分享 ZIP 的导出前容量预检++分享 ZIP 导入会按文件数量、单文件大小、总大小和元数据大小执行安全校验;当前导出流程还没有在写包前复用全部同一套估算,因此极大资料集可能在接收方导入时才发现超过边界。完整资料库迁移请使用完整资料夹备份,不要把单个超大分享 ZIP 当作灾难恢复备份。++后续增强应让导出与导入共享同一容量计划,在开始生成前列出超限项并阻止产生无法导回的包;不能只放宽限制或在导入端静默丢弃内容。diff --git a/i18n.js b/i18n.jsindex f615de9..eda4d0a 100644--- a/i18n.js+++ b/i18n.js@@ -85,6 +85,9 @@ const EN = Object.freeze({"播放器正在加载…": "Loading player…","无媒体": "No media","无法解码时用系统播放器打开": "Open in the system player if decoding fails",+ "本地视频": "Local video",+ "打开查看本地视频": "Open to view the local video",+ "浏览器无法预览,打开详情可用系统播放器": "The browser cannot preview this video. Open its details to use the system player.","时间点笔记": "Timestamp notes","更多记录选项": "More note options","更新为 V2 提示词": "Update to V2 prompt",diff --git a/library.js b/library.jsindex ec3c369..b82307c 100644--- a/library.js+++ b/library.js@@ -1359,7 +1359,9 @@ function createCaseCard(entry) {bindVideoHoverPreview(wrap, { loadBlob: () => getMediaBlob(mainVisual.id) });}card.append(wrap);- } else card.append(createVideoLinkCover(entry, mainVisual));+ } else card.append(mainVisual.storageMode === "managed"+ ? createLocalVideoCaseCover(entry, mainVisual)+ : createVideoLinkCover(entry, mainVisual));} else if (mainVisual?.kind === "document") {card.append(mainVisual.mimeType === "application/pdf" ? createPdfCaseCover(entry, mainVisual) : createTextCaseCover(entry, mainVisual));} else if (mainVisual?.kind === "audio") {@@ -1483,6 +1485,19 @@ function mediaMetadataText(asset) {.filter(Boolean).join(" · ");}+function createLocalVideoCaseCover(entry, asset) {+ const cover = el("div", "case-asset-cover case-local-video-cover");+ cover.append(+ rawTextEl("span", "case-text-kind", `${t("本地视频")} · ${assetFormatLabel(asset)}`),+ rawTextEl("strong", "case-text-title", asset.sourceTitle || entry.title || t("本地视频")),+ rawTextEl("p", "case-asset-meta", mediaMetadataText(asset)),+ rawTextEl("p", "case-text-excerpt", t(asset.playbackCapability === "external"+ ? "浏览器无法预览,打开详情可用系统播放器"+ : "打开查看本地视频"))+ );+ return cover;+}+async function mediaObjectUrl(assetId) {if (originalUrls.has(assetId)) return originalUrls.get(assetId);const blob = await getMediaBlob(assetId);diff --git a/migration.js b/migration.jsindex c26e5b3..c287c40 100644--- a/migration.js+++ b/migration.js@@ -228,6 +228,20 @@ function normalizeAnalysisMeta(value) {? Object.fromEntries(["promptTokens", "completionTokens", "totalTokens", "cacheHitTokens", "cacheMissTokens"].map((key) => [key, Math.max(0, Number(value.usage[key]) || 0)])): undefined;+ const normalizationDiagnostics = (Array.isArray(value.normalizationDiagnostics) ? value.normalizationDiagnostics : [])+ .map((item) => ({+ field: String(item?.field ?? "").trim(),+ ...(String(item?.message ?? "").trim() ? { message: String(item.message).trim() } : {}),+ ...(String(item?.code ?? "").trim() ? { code: String(item.code).trim() } : {}),+ ...(Number(item?.count) > 0 ? { count: Number(item.count) } : {})+ }))+ .filter((item) => item.field);+ const attempts = value.attempts && typeof value.attempts === "object"+ ? {+ serviceRequests: Math.max(0, Number(value.attempts.serviceRequests) || 0),+ outputCorrectionRequests: Math.max(0, Number(value.attempts.outputCorrectionRequests) || 0)+ }+ : undefined;return {...(textFingerprint ? { textFingerprint } : {}),textRevision,@@ -235,7 +249,9 @@ function normalizeAnalysisMeta(value) {model: String(value.model ?? "").trim(),analyzedAt: String(value.analyzedAt ?? "").trim(),profileFingerprint: String(value.profileFingerprint ?? "").trim(),- ...(usage ? { usage } : {})+ ...(usage ? { usage } : {}),+ ...(normalizationDiagnostics.length ? { normalizationDiagnostics } : {}),+ ...(attempts ? { attempts } : {})};}diff --git a/store/CHROME_WEB_STORE_SUBMISSION.md b/store/CHROME_WEB_STORE_SUBMISSION.mdindex 1ea8750..3b45446 100644--- a/store/CHROME_WEB_STORE_SUBMISSION.md+++ b/store/CHROME_WEB_STORE_SUBMISSION.md@@ -7,8 +7,8 @@ This file is the source-of-truth worksheet for the current PromptDirector manife- Chrome Web Store item public key: stored in the source `manifest.json` for local identity verification only; `package:release` removes `key` from the upload manifest.- Expected extension ID: `iahakaahijddcjjldidbclicedibgpjm`.- Current release candidate: `dist/PromptDirector-1.19.2.zip`.-- Candidate size: `8,628,576` bytes.-- Candidate SHA-256: `75ac89066fa94aa2b21876796de9986173b6f3f8020bda9ef07d27e610ec12dd`.+- Candidate size: `8,742,944` bytes.+- Candidate SHA-256: `4f1f6be2fb40a01d35773293cdaa506e5806105e88aba08a917535d6adcd1a1b`.- Generate a candidate only with `npm run package:release`; the command verifies the source public key against the expected identity, then removes `key` from the Web Store upload manifest.## Store listingdiff --git a/test/media-ui.test.js b/test/media-ui.test.jsindex d444725..0542608 100644--- a/test/media-ui.test.js+++ b/test/media-ui.test.js@@ -91,6 +91,11 @@ test("video cards resolve a saved local poster and referenced video details stayconst card = source.slice(source.indexOf("function createCaseCard"), source.indexOf("function renderProjectFilters"));assert.match(card, /posterAssetForVideo/);assert.match(card, /dataset\.visualId/);+ assert.match(card, /mainVisual\.storageMode === "managed"\s*\? createLocalVideoCaseCover\(entry, mainVisual\)/);+ const localVideoCover = source.slice(source.indexOf("function createLocalVideoCaseCover"), source.indexOf("function createVideoLinkCover"));+ assert.match(localVideoCover, /本地视频/);+ assert.match(localVideoCover, /浏览器无法预览,打开详情可用系统播放器/);+ assert.doesNotMatch(localVideoCover, /视频来源|reference/);assert.match(source, /is-video-reference/);assert.match(source, /releaseDetailControllers/);assert.match(source, /removeEventListener\("message", onMessage\)/);diff --git a/test/migration.test.js b/test/migration.test.jsindex d9cf107..9ab8060 100644--- a/test/migration.test.js+++ b/test/migration.test.js@@ -91,6 +91,41 @@ test("fixed-tree upgrade keeps mapped DeepSeek labels usable until an explicit rassert.equal(entry.analyzedAt, "2026-08-02T00:00:00.000Z");});+test("schema upgrade preserves sanitized analysis diagnostics and paid-attempt counts", () => {+ const stored = {+ schemaVersion: 24,+ taxonomy: createDefaultTaxonomy(),+ facetCatalog: { version: 2, revision: 1, facets: [], nodes: [] },+ organizerState: { collections: [] },+ compoundCases: [],+ entries: [{+ id: "analyzed-with-diagnostics",+ schemaVersion: 24,+ title: "保留分析诊断",+ text: "cinematic portrait",+ savedAt: "2026-08-02T00:00:00.000Z",+ classification: { pathIds: [CONTENT_IDS.promptImage], status: "confirmed", source: "manual" },+ facetAssignments: [], analysisCandidates: [], analysisBreakdown: [], customLabels: [],+ analysisMeta: {+ textRevision: 2,+ promptVersion: 7,+ model: "previous",+ normalizationDiagnostics: [+ { field: "tags", message: "丢弃未知标签", code: "unknown_tag", count: 2, secret: "drop" },+ { message: "缺少字段名" }+ ],+ attempts: { serviceRequests: 3, outputCorrectionRequests: 1, secret: 99 }+ }+ }]+ };++ const meta = migrateLibraryState(stored).state.entries[0].analysisMeta;+ assert.deepEqual(meta.normalizationDiagnostics, [{+ field: "tags", message: "丢弃未知标签", code: "unknown_tag", count: 2+ }]);+ assert.deepEqual(meta.attempts, { serviceRequests: 3, outputCorrectionRequests: 1 });+});+test("schema upgrade separates verified importer metadata without moving user labels", () => {const common = {schemaVersion: 23,diff --git a/test/video_detail_layout_e2e.py b/test/video_detail_layout_e2e.pyindex d8c1867..697e375 100644--- a/test/video_detail_layout_e2e.py+++ b/test/video_detail_layout_e2e.py@@ -12,9 +12,13 @@ def video_asset(asset_id: str, captured_at: str) -> dict:"usage": "content","storageMode": "managed","mimeType": "video/mp4",+ "sourceTitle": f"{asset_id}.mp4",+ "sourceFormat": "mp4",+ "byteSize": 4,"width": 720,"height": 1280,"durationMs": 10_000,+ "playbackCapability": "external","capturedAt": captured_at,"reviewStatus": "verified",}@@ -85,6 +89,9 @@ def main() -> None:library = session.open_page("library.html", wait_until="networkidle")expect(library.locator(".case-card")).to_have_count(1)+ expect(library.locator(".case-local-video-cover")).to_contain_text("本地视频 · MP4")+ expect(library.locator(".case-local-video-cover")).to_contain_text("浏览器无法预览,打开详情可用系统播放器")+ expect(library.locator(".case-video-link-cover")).to_have_count(0)library.locator(".case-card").click()expect(library.locator(".detail-visual-thumb")).to_have_count(2)library.locator(".detail-visual-thumb").nth(1).click()