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
Make GitHub installation and local updates use one package
MigenAI09fdf038d473
diff --git a/.github/workflows/release-safety.yml b/.github/workflows/release-safety.ymlindex c289a19..8f49d67 100644--- a/.github/workflows/release-safety.yml+++ b/.github/workflows/release-safety.yml@@ -65,19 +65,23 @@ jobs:python -m playwright install --with-deps chromium- run: npm run test:local-extension- run: npm run package:release+ - run: node tools/prepare-public-release.mjs- run: npm run package:connector- run: npm run test:upgrade- name: Verify extension and connector archivesrun: |PROMPTDIRECTOR_PACKAGE_VERSION="$(node -p 'require("./package.json").version')"unzip -t "dist/PromptDirector-${PROMPTDIRECTOR_PACKAGE_VERSION}.zip"- unzip -t "dist/PromptDirector-${PROMPTDIRECTOR_PACKAGE_VERSION}-FIXED-ID-DEV.zip"+ unzip -t "dist/store/PromptDirector-${PROMPTDIRECTOR_PACKAGE_VERSION}-Chrome-Web-Store.zip"unzip -t "dist/PromptDirector-${PROMPTDIRECTOR_PACKAGE_VERSION}-Agent-Connector.zip"- name: Preserve the exact tested packagesuses: actions/upload-artifact@v7with:name: promptdirector-tested-packages-${{ github.sha }}- path: dist/*.zip+ path: |+ dist/PromptDirector-*.zip+ dist/store/*.zip+ dist/github/**if-no-files-found: errorretention-days: 14@@ -111,7 +115,7 @@ jobs:import json, os, pathlib, subprocess, sys, zipfileversion = json.loads(pathlib.Path('extension/manifest.json').read_text())['version']destination = pathlib.Path(os.environ['RUNNER_TEMP']) / 'PromptDirector'- with zipfile.ZipFile(f'dist/PromptDirector-{version}-FIXED-ID-DEV.zip') as archive:+ with zipfile.ZipFile(f'dist/PromptDirector-{version}.zip') as archive:archive.extractall(destination)env = {**os.environ, 'PROMPTDIRECTOR_E2E_EXTENSION_DIR': str(destination), 'PROMPTDIRECTOR_E2E_BLOCK_EXTERNAL_NETWORK': '1'}for script in ['project_tree_e2e.py', 'library_import_resources_e2e.py', 'library_import_ui_e2e.py', 'library_import_interruption_e2e.py']:diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 996ff36..b5e63c2 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,11 @@了解每个版本带来的功能变化与使用改善。下载请前往 [GitHub Releases](https://github.com/wchao6891/PromptDirector/releases/latest)。+## 1.22.1++- GitHub 安装包统一为 `PromptDirector-版本号.zip`,本地更新直接使用同一安装包。+- 简化安装与更新说明;Agent 连接器提供独立下载入口。+## 1.22.0- 支持导入 DOCX 并阅读正文与内嵌图片;音频、设计源文件和其他 Office 文档可作为原文件收藏。diff --git a/README.md b/README.mdindex 64ed9de..7a807d1 100644--- a/README.md+++ b/README.md@@ -88,20 +88,16 @@ Cases, media, tags and settings are stored in your current browser by default. N## Install and update-**For a local installation, download the `FIXED-ID-DEV` ZIP and load its extracted folder in Chrome or Edge.**+**For a local installation, download `PromptDirector-<version>.zip` and load its extracted folder in Chrome or Edge.**<details><summary>Full installation and in-place update instructions</summary>-1. Open the [latest GitHub release](https://github.com/wchao6891/PromptDirector/releases/latest) and download the ZIP with `FIXED-ID-DEV` in its name.+1. Open the [latest GitHub release](https://github.com/wchao6891/PromptDirector/releases/latest) and download `PromptDirector-<version>.zip`.2. Extract the extension files into a permanent folder named `PromptDirector`, without a version number. `manifest.json` must be at the folder's top level.3. Open Chrome or Edge's extension management page, enable **Developer mode**, select **Load unpacked**, and choose that folder.-The `FIXED-ID-DEV` package keeps the extension's fixed identity. The ZIP without `FIXED-ID-DEV` is for Chrome Web Store submission and omits the manifest key; use the fixed-ID package for local installation. If you previously used a different extension ID, follow the [identity migration guide](docs/EXTENSION_ID_MIGRATION.md).--**Updating an existing local installation:** In Settings, check for updates and select the local upgrade action. On first use, choose and authorize the folder Chrome currently loads. Keep that existing location, even if its name contains an old version. After updating, restart the extension, verify the version in Settings and run the temporary-file cleanup action if shown. Cases and media continue to use the same browser library.--For older versions without the updater, overwrite the program files in the original installation folder with the latest `FIXED-ID-DEV` package, then reload the extension. Keep the existing extension and identity. A routine update does not require uninstalling, exporting or reimporting cases. Source checkouts update through Git.+**Updating an existing local installation:** In Settings, check for updates and select the local upgrade action. On first use, choose and authorize the folder Chrome currently loads. Keep that existing location, even if its name contains an old version. The extension downloads, verifies and installs the update, then restarts automatically. Verify the version in Settings and run the temporary-file cleanup action if shown. Cases and media continue to use the same browser library.You can also install through the [Chrome Web Store](https://chromewebstore.google.com/detail/iahakaahijddcjjldidbclicedibgpjm), which manages subsequent updates.diff --git a/README.zh-CN.md b/README.zh-CN.mdindex f1cb903..4577658 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -88,22 +88,17 @@ AI 分析按需开启,使用你自己的服务;选中的参考可以帮助## 安装与更新-**首次安装:下载 `FIXED-ID-DEV` ZIP,解压后在 Chrome / Edge 的扩展管理页加载。**+**首次安装:下载 `PromptDirector-版本号.zip`,解压后在 Chrome / Edge 的扩展管理页加载。**<details><summary>展开完整安装与原位更新步骤</summary>-从 [GitHub 最新发布页](https://github.com/wchao6891/PromptDirector/releases/latest) 下载名称带 `FIXED-ID-DEV` 的 ZIP。首次安装时,将包内程序文件解压到固定的 `PromptDirector` 文件夹(不带版本号),确保 `manifest.json` 位于该文件夹第一层。在 Chrome 或 Edge 的扩展管理页开启“开发者模式”,选择“加载已解压的扩展程序”,然后选择解压后的目录。这个包保留 Chrome Web Store 分配的固定扩展身份,适合本地开发验证。--不带 `FIXED-ID-DEV` 的同版本 ZIP 仅供维护者上传 Chrome Web Store,清单中按商店要求移除了 `key`,不要把它作为本地解压安装包。同一扩展身份下的常规更新不需要导出或重新导入案例;如曾使用其他扩展 ID,请按[扩展身份迁移说明](docs/EXTENSION_ID_MIGRATION.md)恢复资料。+从 [GitHub 最新发布页](https://github.com/wchao6891/PromptDirector/releases/latest) 下载 `PromptDirector-版本号.zip`。首次安装时,将包内程序文件解压到固定的 `PromptDirector` 文件夹(不带版本号),确保 `manifest.json` 位于该文件夹第一层。在 Chrome 或 Edge 的扩展管理页开启“开发者模式”,选择“加载已解压的扩展程序”,然后选择解压后的目录。### 已安装?在原位置更新-已具备本地升级功能的版本:在“设置”检查更新,点击“升级本地版”,首次选择 Chrome 当前加载的安装文件夹并授权,之后复用这个安装位置;授权失效时再授权。已有文件夹即使带旧版本号也可继续使用,无需重命名、移动或重新安装。程序更新后重启插件,重新打开设置核对版本;如出现“清理升级临时文件”,点击完成清理。案例和媒体继续使用当前浏览器中的原资料库。--旧版本首次接入:下载新版 `FIXED-ID-DEV` ZIP,将包内程序文件覆盖到 Chrome 当前加载的原目录,再到扩展管理页点击重新加载。保持原插件与固定身份,无需卸载,也无需备份再导入案例。源码工作目录通过 Git 更新。-+在“设置”检查更新,点击“升级本地版”,首次选择 Chrome 当前加载的安装文件夹并授权,之后复用这个安装位置;授权失效时再授权。已有文件夹即使带旧版本号也可继续使用,无需重命名、移动或重新安装。插件自动下载、验证并写入新版程序,然后自动重启,重新打开设置核对版本;如出现“清理升级临时文件”,点击完成清理。案例和媒体继续使用当前浏览器中的原资料库。也可通过 [Chrome Web Store](https://chromewebstore.google.com/detail/iahakaahijddcjjldidbclicedibgpjm) 安装,由商店管理后续更新。diff --git a/connector/INSTALL.md b/connector/INSTALL.mdindex c86b7cf..be6fe3c 100644--- a/connector/INSTALL.md+++ b/connector/INSTALL.md@@ -12,7 +12,7 @@官方仓库:https://github.com/wchao6891/PromptDirector-1. 从官方 Releases 选择最新稳定版本中的 `Agent-Connector.zip` 和 `SHA256SUMS.txt`,下载到用户私有的安装暂存目录,核对 SHA-256 后解压。保留包内 `connector` 与 `extension/manifest.json` 的相邻关系。+1. 从 [Agent 连接器下载页](https://github.com/wchao6891/PromptDirector/releases/tag/agent-connector-v0.2.0) 选择连接器 ZIP 和 `SHA256SUMS`,下载到用户私有的安装暂存目录,核对 SHA-256 后解压。保留包内 `connector` 与 `extension/manifest.json` 的相邻关系。2. 核对包中有 `connector/setup.mjs`。如果发布版未包含统一安装入口,应说明需要更新发布包,不能把旧命令当作新功能运行。开发验收可使用用户明确指定的本地源码目录。3. 检查当前 Agent 的 Node.js 运行时是否满足 `connector/package.json` 的 engines 要求。优先使用宿主提供的兼容运行时;否则按 Node.js 官方下载说明为用户当前系统和架构准备运行时,校验官方校验值,不要求用户手动安装 Node.js。保留稳定路径,避免使用即将销毁的沙箱运行时。下载或安装需要宿主审批时按正常流程申请。4. 在解压目录运行 `npm ci --prefix connector --ignore-scripts`。下载失败应说明原因,不修改锁定版本、跳过依赖或执行来源不明的安装脚本。diff --git a/connector/README.md b/connector/README.mdindex b5ba53f..cdfec7b 100644--- a/connector/README.md+++ b/connector/README.md@@ -56,4 +56,4 @@ npm run check## Release 安装包-下载并解压 `PromptDirector-版本号-Agent-Connector.zip`,让 Agent 在解压后的文件夹按 `INSTALL.md` 执行安装与连接检查。包中 `extension/manifest.json` 仅用于校验插件身份;实际扩展请使用同版本 `FIXED-ID-DEV` 包升级。连接器当前为 0.2.0,对应 PromptDirector 1.21.1;安装包不包含 Node.js;Agent 会按统一安装说明检查并准备兼容运行时。+从 [Agent 连接器下载页](https://github.com/wchao6891/PromptDirector/releases/tag/agent-connector-v0.2.0) 下载并解压 `PromptDirector-版本号-Agent-Connector.zip`,让 Agent 在解压后的文件夹按 `INSTALL.md` 执行安装与连接检查。包中 `extension/manifest.json` 仅用于校验插件身份;实际扩展请使用`PromptDirector-版本号.zip`升级。连接器当前为 0.2.0;安装包不包含 Node.js;Agent 会按统一安装说明检查并准备兼容运行时。diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.mdindex 175a85e..96edd6c 100644--- a/docs/DEVELOPMENT.md+++ b/docs/DEVELOPMENT.md@@ -9,7 +9,7 @@ npm run verify:sourcenpm run package```-Load `extension/` in Chrome or Edge for source development, or extract the generated `dist/*-FIXED-ID-DEV.zip` and load that directory for packaged testing. Keep the existing fixed extension identity when switching source locations; do not uninstall the extension or delete browser data.+Load `extension/` in Chrome or Edge for source development, or extract the generated `dist/PromptDirector-<version>.zip` and load that directory for packaged testing. Keep the existing fixed extension identity when switching source locations; do not uninstall the extension or delete browser data.## Repository layoutdiff --git a/extension/local-extension-upgrade.js b/extension/local-extension-upgrade.jsindex 07c7f51..75beef5 100644--- a/extension/local-extension-upgrade.js+++ b/extension/local-extension-upgrade.js@@ -13,7 +13,7 @@ export function isExtensionProgramPath(path) {}export async function extensionIdForKey(key) {- if (typeof key !== "string" || !key.trim()) throw new Error("请选择 FIXED-ID-DEV 本地安装包");+ if (typeof key !== "string" || !key.trim()) throw new Error("请选择官网下载的安装包");const bytes = Uint8Array.from(atob(key.replace(/\s/gu, "")), char => char.charCodeAt(0));const hash = new Uint8Array(await crypto.subtle.digest("SHA-256", bytes));return [...hash.slice(0, 16)].map(byte => String.fromCharCode(97 + (byte >> 4), 97 + (byte & 15))).join("");@@ -32,7 +32,7 @@ export function localReleasePackageUrl(manifest, releaseUrl, version) {if (release.origin + release.pathname !== `${repository}/releases/tag/v${version}`&& release.origin + release.pathname !== `${repository}/releases/tag/${version}`) throw new Error("更新地址与版本不一致");const tag = release.pathname.split("/").at(-1);- return `${repository}/releases/download/${tag}/PromptDirector-${version}-FIXED-ID-DEV.zip`;+ return `${repository}/releases/download/${tag}/PromptDirector-${version}.zip`;}export async function prepareLocalUpgrade(archive, runtime) {diff --git a/extension/manifest.json b/extension/manifest.jsonindex 4fb36fc..e6fc0a7 100644--- a/extension/manifest.json+++ b/extension/manifest.json@@ -1,7 +1,7 @@{"manifest_version": 3,"name": "__MSG_extensionName__",- "version": "1.22.0",+ "version": "1.22.1","key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq2m8W9ACXJTkJqPAd36sPrtzonmHhOYU34uS7c+D7DXX6ggWNMwB4xZapGFJ4ScBQJv71PeG9KfsEnhcXFZ9RoX/X3wY+57evL19hf6woNX1xxhKOe1rtx5QmzWCEYIr99TzW50k/N9U6tS9Ri+2DHKYA85ssXTC8B2yRQ5zUXhsAWZe/HDU18UFuvUKXYt3ZdIUi31c2vIlgFFBfsyKbIUMny9LlxL/smb4vJzU/+A3LwJDjjvOtS/lmQ2vHoQGjHJItO18bYI6h67fIEvmWk+HJKtO08Ca+5RLS8TYhI+K7l7S0RyDVNujyVWtvhAULot1H0BvteYL87fKu3SNywIDAQAB","homepage_url": "https://github.com/wchao6891/PromptDirector","default_locale": "zh_CN",diff --git a/package-lock.json b/package-lock.jsonindex 27701fe..4e72e01 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,12 +1,12 @@{"name": "prompt-case-collector",- "version": "1.22.0",+ "version": "1.22.1","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "prompt-case-collector",- "version": "1.22.0",+ "version": "1.22.1","license": "Apache-2.0","dependencies": {"@jonahschulte/rtf-toolkit": "0.5.0",diff --git a/package.json b/package.jsonindex 89ee78f..8135aad 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "prompt-case-collector",- "version": "1.22.0",+ "version": "1.22.1","private": false,"license": "Apache-2.0","repository": "https://github.com/wchao6891/PromptDirector",@@ -36,7 +36,8 @@"check:hash": "node tools/hash-runtime.mjs --check","build:capture-runtime": "node tools/capture-runtime.mjs","check:capture-runtime": "node tools/capture-runtime.mjs --check",- "package:connector": "node tools/package-connector.mjs"+ "package:connector": "node tools/package-connector.mjs",+ "package:distribution": "npm run package && npm run package:release && node tools/prepare-public-release.mjs"},"dependencies": {"@jonahschulte/rtf-toolkit": "0.5.0",diff --git a/store/DISTRIBUTION.md b/store/DISTRIBUTION.mdindex 755feb2..6fbd92f 100644--- a/store/DISTRIBUTION.md+++ b/store/DISTRIBUTION.md@@ -6,7 +6,7 @@ Public distribution formats and the permissions used by PromptDirector.- 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 upload artifact: `dist/PromptDirector-1.22.0.zip`. The GitHub `FIXED-ID-DEV` artifact is for local installations only.+- Current upload artifact: `dist/store/PromptDirector-1.22.1-Chrome-Web-Store.zip`. Keep this artifact local for Web Store submission. The sole GitHub extension installation package is `PromptDirector-1.22.1.zip`, with stable identity and the local updater.- 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 and excludes the local program installer.## Store listing@@ -87,3 +87,7 @@ Data types handled, including local-only handling:- User-generated content: prompts, notes, cases, projects, tags, Skills, and creative requests.See the privacy policy for the data handled by user-triggered operations.++## Release artifacts++Run `npm run package:distribution` to build both channels. Publish only the versioned directory under `dist/github/`: it contains the user installation ZIP and `SHA256SUMS`. The Web Store upload ZIP stays under `dist/store/` for submission. Agent connector assets use the dedicated `agent-connector-v<connector-version>` release, marked as not latest, and are linked from `connector/INSTALL.md`.diff --git a/test/local-extension-lab.test.js b/test/local-extension-lab.test.jsindex 317de76..dda57a0 100644--- a/test/local-extension-lab.test.js+++ b/test/local-extension-lab.test.js@@ -37,7 +37,7 @@ test("local extension receipt requires model analysis and Composer generation chstartedAt: "2026-08-28T00:00:00.000Z",finishedAt: "2026-08-28T00:01:00.000Z",manifest: { version: "1.19.3" },- archive: { name: "PromptDirector-1.19.3-FIXED-ID-DEV.zip", sha256: "archive", fileCount: 10 },+ archive: { name: "PromptDirector-1.19.3.zip", sha256: "archive", fileCount: 10 },runtimeHash: "runtime",extensionId: "fixed-extension-id",channel: "chromium",diff --git a/test/local-extension-upgrade.test.js b/test/local-extension-upgrade.test.jsindex 92a37b9..5042920 100644--- a/test/local-extension-upgrade.test.js+++ b/test/local-extension-upgrade.test.js@@ -30,7 +30,7 @@ async function packageFor(next = { ...manifest, version: nextVersion }) {test("local package identity and version are validated before directory writes", async () => {const prepared = await prepareLocalUpgrade(await packageFor(), runtime);assert.equal(prepared.manifest.version, nextVersion);- await assert.rejects(prepareLocalUpgrade(await packageFor({ ...manifest, key: undefined, version: nextVersion }), runtime), /FIXED-ID/);+ await assert.rejects(prepareLocalUpgrade(await packageFor({ ...manifest, key: undefined, version: nextVersion }), runtime), /官网下载的安装包/);await assert.rejects(prepareLocalUpgrade(await packageFor(manifest), runtime), /没有高于/);await assert.rejects(prepareLocalUpgrade(await packageFor({ ...manifest, version: nextVersion, permissions: [...manifest.permissions, "management"] }), runtime), /权限/);await assert.rejects(prepareLocalUpgrade(await packageFor(), { ...runtime, id: "different" }), /身份不同/);@@ -40,7 +40,7 @@ test("local package identity and version are validated before directory writes",test("program paths exclude user data and dangerous archive paths", () => {for (const path of ["cases.json", "media/user.mp4", "../extension/background.js", "assets/../../x.js", "C:/x.js", "a\\b.js", ".git/config"]) assert.equal(isExtensionProgramPath(path), false, path);assert.equal(isExtensionProgramPath("vendor/pdfjs/build/pdf.mjs"), true);- assert.equal(localReleasePackageUrl(manifest, `${manifest.homepage_url}/releases/tag/v${nextVersion}`, nextVersion), `${manifest.homepage_url}/releases/download/v${nextVersion}/PromptDirector-${nextVersion}-FIXED-ID-DEV.zip`);+ assert.equal(localReleasePackageUrl(manifest, `${manifest.homepage_url}/releases/tag/v${nextVersion}`, nextVersion), `${manifest.homepage_url}/releases/download/v${nextVersion}/PromptDirector-${nextVersion}.zip`);assert.throws(() => localReleasePackageUrl(manifest, `https://evil.example/releases/tag/v${nextVersion}`, nextVersion), /不一致/);});test("an identical but inactive directory is rejected and the proof file is removed", async t => {diff --git a/test/local_upgrade_native_e2e.py b/test/local_upgrade_native_e2e.pyindex 5826930..1d2a10b 100644--- a/test/local_upgrade_native_e2e.py+++ b/test/local_upgrade_native_e2e.py@@ -75,7 +75,7 @@ def main():setup.locator("#devMode").click()setup.close()release_url = f"{target['homepage_url']}/releases/tag/v{target['version']}"- download_url = f"{target['homepage_url']}/releases/download/v{target['version']}/PromptDirector-{target['version']}-FIXED-ID-DEV.zip"+ download_url = f"{target['homepage_url']}/releases/download/v{target['version']}/PromptDirector-{target['version']}.zip"context.route("https://**/*", lambda route: route.fulfill(status=200, content_type="application/zip", body=package)if route.request.url == download_url else route.abort())worker = context.service_workers[0] if context.service_workers else context.wait_for_event("serviceworker")diff --git a/test/release-gate.test.js b/test/release-gate.test.jsindex c13ffd3..53f6d1f 100644--- a/test/release-gate.test.js+++ b/test/release-gate.test.js@@ -50,5 +50,5 @@ test("GitHub runs source contracts and packaged Chromium journeys before main caassert.match(workflow, /npm run test:upgrade/);assert.match(workflow, /PROMPTDIRECTOR_PACKAGE_VERSION="\$\(node -p 'require\("\.\/package\.json"\)\.version'\)"/);assert.match(workflow, /unzip -t "dist\/PromptDirector-\$\{PROMPTDIRECTOR_PACKAGE_VERSION\}\.zip"/);- assert.match(workflow, /unzip -t "dist\/PromptDirector-\$\{PROMPTDIRECTOR_PACKAGE_VERSION\}-FIXED-ID-DEV\.zip"/);+ assert.match(workflow, /unzip -t "dist\/store\/PromptDirector-\$\{PROMPTDIRECTOR_PACKAGE_VERSION\}-Chrome-Web-Store\.zip"/);});diff --git a/test/release-identity.test.js b/test/release-identity.test.jsindex 0e7e209..64da0de 100644--- a/test/release-identity.test.js+++ b/test/release-identity.test.js@@ -11,18 +11,18 @@ import {const examplePublicKey = Buffer.alloc(128, 7).toString("base64");-test("development packages are visibly marked until the Web Store public key exists", () => {+test("installation packages require a stable extension identity", () => {const manifest = { version: "1.14.0" };assert.equal(hasStableExtensionIdentity(manifest), false);- assert.equal(extensionArchiveName(manifest), "PromptDirector-1.14.0-UNFIXED-ID-DEV.zip");+ assert.throws(() => extensionArchiveName(manifest), /正式安装包已阻止/);assert.throws(() => requireStableExtensionIdentity(manifest), /正式安装包已阻止/);});test("release packages keep the normal name only with a stable manifest public key", () => {const manifest = { version: "1.14.0", key: examplePublicKey };assert.equal(hasStableExtensionIdentity(manifest), true);- assert.equal(extensionArchiveName(manifest), "PromptDirector-1.14.0-FIXED-ID-DEV.zip");- assert.equal(extensionArchiveName(manifest, { release: true }), "PromptDirector-1.14.0.zip");+ assert.equal(extensionArchiveName(manifest), "PromptDirector-1.14.0.zip");+ assert.equal(extensionArchiveName(manifest, { release: true }), "PromptDirector-1.14.0-Chrome-Web-Store.zip");assert.match(extensionIdFromPublicKey(manifest), /^[a-p]{32}$/);});diff --git a/tools/check-store-readiness.mjs b/tools/check-store-readiness.mjsindex a3189d7..f1daddb 100644--- a/tools/check-store-readiness.mjs+++ b/tools/check-store-readiness.mjs@@ -28,7 +28,7 @@ for (const phrase of ["Chrome Web Store User Data Policy", "Limited Use", "不const listingZh = await text("store/LISTING_ZH_CN.md");const listingEn = await text("store/LISTING_EN.md");const submission = await text("store/DISTRIBUTION.md");-requireText(submission, `dist/PromptDirector-${manifest.version}.zip`, "商店提交清单版本与 manifest 不一致");+requireText(submission, `dist/store/PromptDirector-${manifest.version}-Chrome-Web-Store.zip`, "商店提交清单版本与 manifest 不一致");requireText(listingZh, locales.zh_CN.extensionName.message, "中文商店名称与 manifest 不一致");requireText(listingEn, locales.en.extensionName.message, "英文商店名称与 manifest 不一致");for (const permission of [diff --git a/tools/package-extension.mjs b/tools/package-extension.mjsindex 8e54d98..ac8388f 100644--- a/tools/package-extension.mjs+++ b/tools/package-extension.mjs@@ -70,7 +70,9 @@ for (const file of runtimeFilesForDistribution) {if (!isExtensionProgramPath(file.name)) throw new Error(`更新器无法接收发布文件:${file.name}`);}const archive = await createZipBlob(runtimeFilesForDistribution);-const outputPath = join(projectRoot, "dist", extensionArchiveName(sourceManifest, { release }));+const outputDirectory = release ? join(projectRoot, "dist", "store") : join(projectRoot, "dist");+await mkdir(outputDirectory, { recursive: true });+const outputPath = join(outputDirectory, extensionArchiveName(sourceManifest, { release }));await writeFile(outputPath, new Uint8Array(await archive.arrayBuffer()));process.stdout.write(`${outputPath}\n${runtimeFilesForDistribution.length} 个运行文件,${archive.size} 字节\n`);diff --git a/tools/prepare-public-release.mjs b/tools/prepare-public-release.mjsnew file mode 100644index 0000000..0c62df4--- /dev/null+++ b/tools/prepare-public-release.mjs@@ -0,0 +1,23 @@+import { createHash } from "node:crypto";+import { mkdir, readFile, readdir, writeFile } from "node:fs/promises";+import { join } from "node:path";+import { fileURLToPath } from "node:url";+import { extensionArchiveName } from "./release-identity.mjs";+import { readZipBlob } from "../extension/zip.js";++const root = fileURLToPath(new URL("../", import.meta.url));+const manifest = JSON.parse(await readFile(join(root, "extension/manifest.json"), "utf8"));+const name = extensionArchiveName(manifest);+const bytes = await readFile(join(root, "dist", name));+const files = await readZipBlob(new Blob([bytes]));+const packaged = JSON.parse(await files.get("manifest.json").text());+if (packaged.key !== manifest.key || packaged.version !== manifest.version+ || !files.has("local-extension-upgrade.js")) throw new Error("公开安装包缺少固定身份或更新能力");+const directory = join(root, "dist", "github", manifest.version);+await mkdir(directory, { recursive: true });+for (const file of await readdir(directory)) {+ if (![name, "SHA256SUMS"].includes(file)) throw new Error(`公开发布目录包含额外文件:${file}`);+}+await writeFile(join(directory, name), bytes);+await writeFile(join(directory, "SHA256SUMS"), `${createHash("sha256").update(bytes).digest("hex")} ${name}\n`);+process.stdout.write(`${directory}\n`);diff --git a/tools/release-identity.mjs b/tools/release-identity.mjsindex bb7b1e2..370d645 100644--- a/tools/release-identity.mjs+++ b/tools/release-identity.mjs@@ -33,10 +33,6 @@ export function chromeStoreUploadManifest(manifest = {}) {export function extensionArchiveName(manifest = {}, { release = false } = {}) {const version = String(manifest.version ?? "").trim();- if (release) {- requireStableExtensionIdentity(manifest);- return `PromptDirector-${version}.zip`;- }- const suffix = hasStableExtensionIdentity(manifest) ? "-FIXED-ID-DEV" : "-UNFIXED-ID-DEV";- return `PromptDirector-${version}${suffix}.zip`;+ requireStableExtensionIdentity(manifest);+ return release ? `PromptDirector-${version}-Chrome-Web-Store.zip` : `PromptDirector-${version}.zip`;}diff --git a/tools/run-release-upgrade-e2e.mjs b/tools/run-release-upgrade-e2e.mjsindex 7223393..c5b2446 100644--- a/tools/run-release-upgrade-e2e.mjs+++ b/tools/run-release-upgrade-e2e.mjs@@ -1,5 +1,5 @@import { execFileSync } from "node:child_process";-import { access, mkdtemp, mkdir, readFile, rm } from "node:fs/promises";+import { access, mkdtemp, mkdir, readFile, rm, writeFile } from "node:fs/promises";import { tmpdir } from "node:os";import { dirname, join } from "node:path";import { fileURLToPath } from "node:url";@@ -54,7 +54,10 @@ try {});const nativePreviousDirectory = join(temporaryRoot, "native-previous-release");await mkdir(nativePreviousDirectory);- execFileSync(python, ["-m", "zipfile", "-e", previousArchive, nativePreviousDirectory], { stdio: "inherit" });+ // Exercise the shipped updater against a newer version using the exact public+ // package; historical data migration is exercised separately above.+ execFileSync(python, ["-m", "zipfile", "-e", currentArchive, nativePreviousDirectory], { stdio: "inherit" });+ await writeFile(join(nativePreviousDirectory, "manifest.json"), JSON.stringify({ ...manifest, version: baselineTag.slice(1) }));execFileSync(python, [join(projectRoot, "test", "local_upgrade_native_e2e.py"), await sourceExtensionDirectory(nativePreviousDirectory), currentArchive], {cwd: projectRoot,stdio: "inherit",