@promptframe/creation 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +8 -6
- package/dist/cli.mjs +26 -3
- package/docs/development.md +8 -6
- package/docs/installing.md +11 -3
- package/docs/releases/0.2.5.md +6 -6
- package/docs/releases/0.2.6.md +7 -0
- package/docs/releases/0.2.7.md +5 -0
- package/docs/releasing.md +4 -2
- package/lib/host-context.mjs +1 -1
- package/lib/user-installation.mjs +19 -2
- package/lib/version.mjs +1 -1
- package/package.json +1 -1
- package/skills/creation-setup/SKILL.md +3 -1
package/README.md
CHANGED
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
需要 Node.js 20+ 及支持插件的 Codex(最低0.160.0)。在 Studio 的“连接与授权”复制当前环境 API 地址,然后在本机终端执行:
|
|
8
8
|
|
|
9
|
+
<!-- creation-install-command -->
|
|
9
10
|
```bash
|
|
10
|
-
npx --yes @promptframe/creation@0.2.
|
|
11
|
+
npx --yes @promptframe/creation@0.2.7 connect --endpoint <Studio提供的API地址>
|
|
11
12
|
```
|
|
13
|
+
<!-- /creation-install-command -->
|
|
12
14
|
|
|
13
15
|
每次从 Studio 获取当前固定推荐版本;入口比较已安装版本,较新版本保留,不后台追踪 latest。入口检查环境、准备用户级版本、注册并核回 Codex 插件,复用有效凭据;首次 Token 在终端隐藏输入,不粘进聊天。完成后在同一主机开一个 **Local 新聊天**(CLI 开新 session),确认 `creation-setup`、`video-creation` 与 MCP 工具一起加载。可以选择独立的非 Git 创作目录,不需要产品源码或 Worktree;不必重新安装或获取 Token。安装本身不接管作品、不启动付费制作。`npx` 单独运行或目录连通不等于当前聊天已加载插件。
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
[0.2.7](docs/releases/0.2.7.md)支持在 Studio 或另一聊天编辑作品时读取平台用量;[0.2.6](docs/releases/0.2.6.md)统一安装指令的版本和固定 Git 来源诊断;[0.2.5](docs/releases/0.2.5.md)新增项目只读入门和 Skill 说明读取。安装版本以 Studio 的固定推荐为准,已安装的较新版本不会降级。0.2.4 的安装发现、登记异常处理和新聊天指引见[版本说明](docs/releases/0.2.4.md)。
|
|
16
18
|
|
|
17
19
|
API 使用 Studio 实际可达 origin 和 `/api` 或 `/api/mcp`,没有内置生产/私有地址。远程客户端不要改成自己的 localhost。另一个环境或账号显式使用 `--profile <名称>`;新旧桥各固定凭据路径,不热切环境。有效 Token 不因升级、新作品或接管轮换。详细安装、升级保旧、卸载和排障见[安装说明](docs/installing.md)。Linux、WSL、macOS 使用0700目录/0600凭据;原生Windows ACL尚未验证。
|
|
18
20
|
|
|
@@ -58,10 +60,10 @@ npm test
|
|
|
58
60
|
|
|
59
61
|
## 创作与宿主身份
|
|
60
62
|
|
|
61
|
-
video-creation Skill
|
|
63
|
+
video-creation Skill 通过平台目录和 schema 发现可用能力,访问当前账号有权使用的作品。编辑已有作品前,需要在 Studio 确认编辑权;只有用户要求时才新建作品。已受理的异步任务会继续运行,客户端停止等待不会取消任务。暂时无法确认结果时,可通过任务 ID 查询状态,避免重复生成。
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
受支持的 Codex 会在 MCP 元数据中提供 threadId。桥与平台结合环境、账号、安装和聊天身份区分编辑者;身份不完整时,不能新建或编辑作品,已受理任务的状态查询仍可使用。桥管理聊天的 controlVersion,作品修改使用 expectedRevision 检查并发冲突。受支持的只读工具使用平台返回的作品控制版本,并由服务端工具注册表和白名单共同验证;读取权限不会授予编辑权。
|
|
64
66
|
|
|
65
|
-
Token是独立创作授权,不是codex mcp login
|
|
67
|
+
Token是独立创作授权,不是codex mcp login。已有有效文件会复用;网络失败不自动替换。平台历史与用量记录覆盖经平台接收的请求;外部聊天、本地文件和本地推理不会自动计入。原生 Windows 的文件权限及其它宿主兼容性仍需单独验证。
|
|
66
68
|
|
|
67
|
-
GitHub Actions沿独立版本和既有OIDC流程发行;普通main只跑CI。包/lock/plugin版本一致,正式新版本用新的creation-v
|
|
69
|
+
GitHub Actions沿独立版本和既有OIDC流程发行;普通main只跑CI。包/lock/plugin版本一致,正式新版本用新的creation-v标签,已发布的版本和标签保持不变。详见[发布手册](docs/releasing.md)。
|
package/dist/cli.mjs
CHANGED
|
@@ -7301,7 +7301,7 @@ var require_content_type = __commonJS({
|
|
|
7301
7301
|
});
|
|
7302
7302
|
|
|
7303
7303
|
// lib/version.mjs
|
|
7304
|
-
var CLIENT_VERSION = "0.2.
|
|
7304
|
+
var CLIENT_VERSION = "0.2.7";
|
|
7305
7305
|
var CLIENT_PROTOCOL = "creation-client/v1";
|
|
7306
7306
|
|
|
7307
7307
|
// lib/cli.mjs
|
|
@@ -19751,6 +19751,7 @@ var independentReads = /* @__PURE__ */ new Set([
|
|
|
19751
19751
|
"read_creative_plan",
|
|
19752
19752
|
"get_creative_plan",
|
|
19753
19753
|
"list_assets",
|
|
19754
|
+
"read_creation_consumption",
|
|
19754
19755
|
"skills_list",
|
|
19755
19756
|
"read_skill"
|
|
19756
19757
|
]);
|
|
@@ -20640,6 +20641,18 @@ function compareVersions(a, b) {
|
|
|
20640
20641
|
}
|
|
20641
20642
|
return 0;
|
|
20642
20643
|
}
|
|
20644
|
+
function pinnedGitSource(source) {
|
|
20645
|
+
if (typeof source === "string") {
|
|
20646
|
+
const match = source.match(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+@([A-Za-z0-9_./-]{1,160})$/);
|
|
20647
|
+
if (!match) return null;
|
|
20648
|
+
source = { source: "git", ref: match[1] };
|
|
20649
|
+
}
|
|
20650
|
+
if (!source || !["git"].includes(source.source ?? source.type)) return null;
|
|
20651
|
+
const ref = source.refName ?? source.ref;
|
|
20652
|
+
if (typeof ref !== "string") return null;
|
|
20653
|
+
const refKind = /^[a-f0-9]{40}$/i.test(ref) ? "commit" : /^(?:refs\/tags\/)?creation-v\d+\.\d+\.\d+$/.test(ref) ? "tag" : null;
|
|
20654
|
+
return refKind ? { refName: ref, refKind } : null;
|
|
20655
|
+
}
|
|
20643
20656
|
var entries = ["package.json", "README.md", "LICENSE", "bin", "dist", "lib", "skills", "docs", ".codex-plugin", ".mcp.json"];
|
|
20644
20657
|
var json = async (file) => JSON.parse(await readFile2(file, "utf8"));
|
|
20645
20658
|
var pause = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
@@ -20828,7 +20841,7 @@ async function codexJSON(runCodex, args2) {
|
|
|
20828
20841
|
}
|
|
20829
20842
|
}
|
|
20830
20843
|
async function relatedPlugins(runCodex, pluginName, env) {
|
|
20831
|
-
const related = /* @__PURE__ */ new Set(), registered = /* @__PURE__ */ new Set(), config2 = path2.join(path2.resolve(env.CODEX_HOME ?? path2.join(homedir2(), ".codex")), "config.toml");
|
|
20844
|
+
const related = /* @__PURE__ */ new Set(), registered = /* @__PURE__ */ new Set(), pinnedMarketplaces = /* @__PURE__ */ new Map(), config2 = path2.join(path2.resolve(env.CODEX_HOME ?? path2.join(homedir2(), ".codex")), "config.toml");
|
|
20832
20845
|
try {
|
|
20833
20846
|
const s = await info(config2);
|
|
20834
20847
|
if (s) {
|
|
@@ -20857,6 +20870,8 @@ async function relatedPlugins(runCodex, pluginName, env) {
|
|
|
20857
20870
|
}
|
|
20858
20871
|
if (!Array.isArray(catalog?.plugins) || catalog.plugins.length > 1024) fail("local_catalog_unconfirmed");
|
|
20859
20872
|
if (catalog.plugins.some((p) => p?.name === pluginName)) related.add(market.name);
|
|
20873
|
+
const pinned = pinnedGitSource(market.marketplaceSource);
|
|
20874
|
+
if (pinned) pinnedMarketplaces.set(market.name, pinned);
|
|
20860
20875
|
}
|
|
20861
20876
|
const installed = [];
|
|
20862
20877
|
for (const market of related) {
|
|
@@ -20866,7 +20881,7 @@ async function relatedPlugins(runCodex, pluginName, env) {
|
|
|
20866
20881
|
if (typeof p?.pluginId !== "string" || typeof p.enabled !== "boolean") fail("local_registration_unconfirmed");
|
|
20867
20882
|
if (p?.pluginId !== pluginName + "@" + market) continue;
|
|
20868
20883
|
if (p.marketplaceName !== void 0 && p.marketplaceName !== market) fail("local_registration_unconfirmed");
|
|
20869
|
-
installed.push(p);
|
|
20884
|
+
installed.push({ ...p, ...pinnedMarketplaces.has(market) ? { pinnedMarketplace: pinnedMarketplaces.get(market) } : {} });
|
|
20870
20885
|
}
|
|
20871
20886
|
}
|
|
20872
20887
|
if (new Set(installed.map((p) => p.pluginId)).size !== installed.length) fail("local_registration_unconfirmed");
|
|
@@ -20955,6 +20970,14 @@ async function installForUser({
|
|
|
20955
20970
|
await atomicJSON(currentFile, pending);
|
|
20956
20971
|
await rm(pendingFile);
|
|
20957
20972
|
}
|
|
20973
|
+
const pinned = state.installed.map((p) => ({ plugin: p, source: pinnedGitSource(p.source) ?? p.pinnedMarketplace })).find((p) => p.source);
|
|
20974
|
+
if (pinned) fail("pinned_git_plugin_upgrade_required", {
|
|
20975
|
+
...pinned.source,
|
|
20976
|
+
sourceType: "git",
|
|
20977
|
+
localRegistrationState: "present",
|
|
20978
|
+
action: "review_pinned_source_in_original_host",
|
|
20979
|
+
next: "\u8BE5\u63D2\u4EF6\u6765\u6E90\u56FA\u5B9A\u5728 Git \u6807\u7B7E\u6216\u63D0\u4EA4\u3002\u5148\u5B8C\u6210\u4F7F\u7528\u65E7\u6865\u7684\u804A\u5929\uFF0C\u518D\u901A\u8FC7\u539F\u5BBF\u4E3B\u7684\u63D2\u4EF6\u6765\u6E90\u8BBE\u7F6E\u9009\u62E9\u76EE\u6807\u7248\u672C\uFF1Bmarketplace upgrade \u53EA\u5237\u65B0\u5DF2\u914D\u7F6E\u7684 ref\uFF0C\u4E0D\u4F1A\u628A\u56FA\u5B9A\u63D0\u4EA4\u5207\u5230\u65B0\u7248\u3002\u7528 plugin marketplace list \u548C\u539F\u76EE\u5F55\u7684 plugin list \u6838\u7248\u672C\u540E\uFF0C\u518D\u8FD0\u884C connect\u3002\u51ED\u636E\u548C\u5F53\u524D\u63D2\u4EF6\u4FDD\u6301\u4E0D\u53D8\u3002"
|
|
20980
|
+
});
|
|
20958
20981
|
const official = await officialNpmInstallation(state.installed ?? [], servers, env, profile, configFile2);
|
|
20959
20982
|
if (official) {
|
|
20960
20983
|
if (installed || previous) fail("existing_registration_requires_review");
|
package/docs/development.md
CHANGED
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
| 插件目录索引 | `.agents/plugins/marketplace.json` |
|
|
18
18
|
| 发行内容、版本约束与同包核验 | `scripts/package-release.mjs`、`.github/workflows/ci.yml`、`.github/workflows/publish.yml` |
|
|
19
19
|
|
|
20
|
+
打包、版本检查和发行步骤见[发布手册](releasing.md)。
|
|
21
|
+
|
|
20
22
|
## 三种版本分别核实
|
|
21
23
|
|
|
22
24
|
1. 当前工作分支的源码 ref 和未提交差额。
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
|
|
28
30
|
## 安装与运行路径
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
宿主桥为受支持的业务只读和 Skill 说明工具附加平台返回的作品控制版本。Web 或另一聊天正在编辑时,仍可按读取权限查询。`skill_view` 的 usage 省略或为 view/none 时读取说明,为 use 时需要编辑和执行权限。读取的控制版本不会授予编辑权;服务端同时检查工具注册表的只读属性和白名单,写操作仍需当前聊天的编辑权。项目入门 `platform_read_onboarding` 不依赖作品或编辑控制,由 Token 和项目 ACL 验证访问权限。此能力已随 npm 0.2.5 发行,0.2.4 不包含;平台服务也需要支持对应工具合同。
|
|
31
33
|
|
|
32
34
|
源码经 GitHub Actions 打包发行到 npm;插件目录记录包名/版本或源码位置。安装后,Codex 加载本地副本并按配置启动 Node 桥;桥通过 stdio 接收调用,读取独立安全配置,再通过 HTTPS MCP 连接所选平台。GitHub、npm 与目录索引负责获取版本,不进入正常工具调用链。Token 不进入源码、插件包或命令参数。
|
|
33
35
|
|
|
@@ -38,15 +40,15 @@
|
|
|
38
40
|
- 普通源码检查使用本仓 `npm ci --ignore-scripts`、`npm test` 和[发布手册](releasing.md)的 pack/smoke;测试使用临时配置目录。
|
|
39
41
|
- 修改宿主接线时核实际宿主元数据、缺失身份和多聊天隔离,不要求模型记忆身份字段;源码控制与真实宿主旅程分别记录。
|
|
40
42
|
- 修改插件内容或安装流程时,从无既有依赖/凭据污染的目标环境核 manifest、Skill、桥启动和平台连接;保持现有有效凭据,升级不默认轮换 Token。
|
|
41
|
-
- 普通打包/文档检查不调用真实平台 setup
|
|
42
|
-
-
|
|
43
|
+
- 普通打包/文档检查不调用真实平台 setup、生成媒体或模型。接入和创作测试使用独立测试账号,并遵守平台的项目权限与用量限制。
|
|
44
|
+
- 文档调整无需单独增加包版本。分别记录包检查、发行、宿主安装和创作测试结果。
|
|
43
45
|
|
|
44
46
|
## 公开范围
|
|
45
47
|
|
|
46
|
-
使用说明保持公开且可移植。平台私有配置、真实端点默认值、用户样本、Token
|
|
48
|
+
使用说明保持公开且可移植。平台私有配置、真实端点默认值、用户样本、Token、内部资料和业务权限实现不进入本仓。组件创作需要的工具按 README 指向独立 authoring 仓;不在本仓维护第二套组件 CLI 参数手册或四包发行流程。
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
安装器比较 connect 的固定目标版本与已安装版本:同版复用、较新版不降级,受管旧版使用独立目录升级。官方 npm 插件为旧版时,会提示升级;Codex 0.160 升级时会删除旧缓存,因此安装器不会自动执行该操作。两种安装方式都会检查启动 Node 和包版本。安装结果包含 requestedVersion/versionStatus;错误信息仅包含版本、动作和处理指引,不输出宿主原始错误、环境或凭据。
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
安装发现使用 `$CODEX_HOME/config.toml` 的结构化插件登记 ID、`codex plugin marketplace list --json` 的本地根索引、有界目录 JSON 和 `plugin list --marketplace <name> --json`。TOML 使用随运行文件打包的成熟解析器,只保留相关插件身份;目录条目删除后仍查询原登记,读面无法解析该登记就保持 unknown。覆盖全部相关入口,不把不可读目录当未安装,也不调用必需全量远端插件查询。注册前持久保存 pending 登记;注册请求未确认时先查询该登记状态,确认前不重复 add 或回退旧登记。测试从 pack 的实际 npx/connect 入口核隔离配置、两个 profile、并发和失 ACK,不读个人配置。
|
|
51
53
|
|
|
52
54
|
宿主插件已安装/启用、平台连接验证与聊天加载分别报告。外部安装器不接私有 app-server 生产刷新通道;当前使用官方新聊天/新 session 路径,选择 Local 和独立非 Git 目录即可。候选包、公共 registry 固定包和真实宿主新聊天工具/两个 Skill 的验收分开记录。
|
package/docs/installing.md
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
从 Studio 的“连接与授权”复制当前环境的指引。在本机终端执行:
|
|
6
6
|
|
|
7
|
+
<!-- creation-install-command -->
|
|
7
8
|
```bash
|
|
8
|
-
npx --yes @promptframe/creation@0.2.
|
|
9
|
+
npx --yes @promptframe/creation@0.2.7 connect --endpoint <Studio提供的API地址>
|
|
9
10
|
```
|
|
11
|
+
<!-- /creation-install-command -->
|
|
10
12
|
|
|
11
13
|
`/api` 会规范化到 `/api/mcp`;也可直接提供 `/api/mcp`。保留 Studio 实际可达的 HTTPS origin,包括私有网络域名,不把远程地址替换成本机 localhost。`0.1.1` 是历史基础包;它不支持此用户级插件引导。新版本是否已发行,以 registry 的实际版本和对应固定标签为准。
|
|
12
14
|
|
|
@@ -24,9 +26,11 @@ npx --yes @promptframe/creation@0.2.3 connect --endpoint <Studio提供的API地
|
|
|
24
26
|
|
|
25
27
|
另一个环境或账号应由用户选择不同名称:
|
|
26
28
|
|
|
29
|
+
<!-- creation-install-command -->
|
|
27
30
|
```bash
|
|
28
|
-
npx --yes @promptframe/creation@0.2.
|
|
31
|
+
npx --yes @promptframe/creation@0.2.7 connect --profile work-account --endpoint <另一环境API地址>
|
|
29
32
|
```
|
|
33
|
+
<!-- /creation-install-command -->
|
|
30
34
|
|
|
31
35
|
命名 profile 使用独立凭据和独立插件名;新桥配置固定具体凭据文件。已有文件绑定另一 endpoint 时拒绝覆盖,运行中的桥也不会热切环境。相同 endpoint 的不同账号同样用不同 profile;不要尝试从 Token 或作品名猜账号。`--config <安全文件>` 可指定已存在的私有配置,但不得把不同环境指向同一文件。
|
|
32
36
|
|
|
@@ -38,7 +42,7 @@ npx --yes @promptframe/creation@0.2.3 connect --profile work-account --endpoint
|
|
|
38
42
|
|
|
39
43
|
更新失败保留旧默认、旧文件及 Token。`registration_unconfirmed_keep_existing` 表示宿主写命令结果未确认;先核 Codex 当前插件状态,不根据错误盲重发或删除缓存。安装器在写前保存该 profile 的 `registration-pending.json`;再次 connect 只观察同一插件和版本。确认已登记则正常完成,否则保留待核状态,不自动第二次 add 或用旧版 add 作补偿。只有原宿主登记责任核清后才安排后续处理。只在确认本工具 `install.lock/owner.json` 的进程已退出后,才手动移除该精确安装锁并重试;活动或无法确认的进程不清锁。安装锁不决定平台编辑权。
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
安装核验读取宿主结构化本地 marketplace 索引和有界目录文件,再仅查询全部相关 marketplace;无关远端目录不进入安装必需路径。目录不可读、JSON/输出超限、查询超时不代表“未安装”。错误只报告阶段、命令种类、耗时、期限、退出码/信号及下一动作,不透传子进程 stdout/stderr、环境或凭据。安装器不使用全量远端插件列表作为安装前提。
|
|
42
46
|
|
|
43
47
|
从旧手工 `codex mcp add promptframe` 迁移时,若发现同名定义,引导会停止并给出 `legacy_mcp_entry_requires_review`,不会删除不明配置。确认它是旧的 PromptFrame 手工入口后可用 `codex mcp remove promptframe` 移除定义,再重复 connect。移除定义不取消已接受平台任务、不撤销 Token;在途桥及原结果应沿原 task 观察。
|
|
44
48
|
|
|
@@ -62,3 +66,7 @@ Codex CLI 0.160.0 的 `plugin add` 升级 npm 插件会移除旧缓存,当前
|
|
|
62
66
|
4. 确认目录中的版本是目标版本后,执行 `codex plugin add <原插件ID> --json`。再次 `codex plugin list --marketplace <原准确目录名> --json` 核目标版本已启用,再运行 Studio 的 `connect` 指令并开 Local 新聊天。目录未提供目标版或升级失败时保持待升级,不循环卸载重装。
|
|
63
67
|
|
|
64
68
|
受管入口按原安装记录核身份,不以当前 Node 路径认领。每次复用会实际运行已记录的 Node 和该版本 `--version`(各最多10秒,无平台调用),缺失、低于20或无法启动时返回 `installation.recorded_node_unavailable`。可恢复原 Node.js 20+ 路径,或运行 Studio 提供的较新版本 connect:新的受管版本使用当前 Node,保留旧代码及原凭据。相同版本不会偷偷重写旧启动配置。官方 npm 插件的 `node` 按当前宿主环境的 PATH 检查;Desktop 重载后的真实 MCP 启动仍须单独确认。
|
|
69
|
+
|
|
70
|
+
## 固定 Git 来源
|
|
71
|
+
|
|
72
|
+
`installation.pinned_git_plugin_upgrade_required` 表示现有插件或其 marketplace 固定到提交 SHA 或版本标签。`codex plugin marketplace upgrade <原目录名> --json` 只刷新已经配置的 ref,不会选择另一个版本。先完成使用旧桥的聊天,通过原宿主支持的来源配置选择目标 ref,再用 `codex plugin marketplace list --json` 与 `codex plugin list --marketplace <原目录名> --json` 核对同一插件。当前宿主没有来源修改入口时,保留现有安装并处理该来源配置;不要连续 add、删除活动缓存或更换 Token。参见[Codex 插件命令](https://learn.chatgpt.com/docs/developer-commands#codex-plugin-marketplace)。
|
package/docs/releases/0.2.5.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# 0.2.5
|
|
1
|
+
# 0.2.5 项目入门与公开说明
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
本版已从固定 `creation-v0.2.5` / `6d23a4689d777464f42fe0e0f95e31f4f5df01d0` 沿既有 GitHub Actions OIDC 流程发行,官方 registry 版本及 latest 均为0.2.5。公开 tgz 与同一受检 CI artifact 字节一致;既有0.2.4包和标签保留。Studio 安装指引仍以对应平台版本实际提供的固定推荐为准,不自动追踪 latest。
|
|
4
4
|
|
|
5
5
|
- 创作 Skill 在创建作品前先发现项目只读入门,由平台返回当前公开基线、版本摘要和既有组件作者工具链导航;不复制基线正文。
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
6
|
+
- 宿主桥支持 Skill 目录和说明读取,使用服务端控制版本并检查作品读取权限。显式 use 需要编辑和执行权限。
|
|
7
|
+
- 创建、读取和交接作品时,提供平台返回的 studioUrl;可以按用户要求打开链接,不会自动启动导演或接管作品。
|
|
8
|
+
- 继续复用安全凭据,支持独立 profile。安装后在同一主机打开 Local 新聊天,检查两个 Skill 与 MCP 是否加载。
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
受影响桥接、版本绑定、同一 tgz 的隔离 npm 与纯解包运行,以及公共固定包入口已分别核验。项目入门和说明读取需要相容的平台服务;安装后在同一主机的新聊天中检查插件加载状态。
|
package/docs/releasing.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
本仓独立发布 `@promptframe/creation`,不与组件作者四包绑定版本。源码和文档在 GitHub;npm 包提供版本化安装入口。基础版范围见[0.1.0 说明](releases/0.1.0.md),首次 OIDC 后继版本见[0.1.1 说明](releases/0.1.1.md)。如果包被设为 `private: true`,CI仍可检查安装包,正式发布会明确拒绝;工作流不会自动删除这个字段。
|
|
4
4
|
|
|
5
|
+
相关测试、打包检查和版本验收通过后,发布相应版本。发布使用同一受检包,通过 GitHub Actions OIDC 完成,并核对官方 registry 的版本、integrity 和 provenance。既有版本和 tag 不覆盖;文档调整无需单独增加包版本。
|
|
6
|
+
|
|
5
7
|
## 日常检查
|
|
6
8
|
|
|
7
9
|
`.github/workflows/ci.yml` 在 PR、main 更新或手工运行时检查 Node 20/24:锁文件安装、测试、npm 包内容和隔离安装。它不会调用真实平台 setup、模型或媒体服务。以下命令由维护者在源码仓执行:
|
|
@@ -36,7 +38,7 @@ GitHub 仓库创建 Environment `npm-production`,部署规则只允许 `creati
|
|
|
36
38
|
|
|
37
39
|
首次包初始化需要账号持有者完成 npm 要求的身份验证;登录或 2FA 提示由本人处理。不要将密码、OTP、恢复码或 Token 写进仓库/聊天。npm 新建的信任配置需在两天内完成首次成功发布,因此应在可审核版本就绪时配置。
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
本仓首次初始化采用:账号持有者人工发布基础版 0.1.0 → 等官方 registry 确认包可读 → 配置并回读 Trusted Publisher → 用 GitHub OIDC 发布后继 0.1.1。0.1.0采用人工首发,0.1.1起采用 OIDC,后续发行不再使用该登录凭据。
|
|
40
42
|
|
|
41
43
|
官方也支持新包 staged publishing,但不能把 stage、trust 或 reject 的单条成功回执当成包身份与信任会持续存在的保证。本仓初始化时在暂存阶段创建信任后,拒绝唯一候选,随后包与信任读取均返回404;因此不采用“拒绝暂存后直接推标签”的初始化步骤。待审版本与正式版本仍共享版本唯一约束,不可竞争发布同一版本;任何候选撤除后都要重新核包和信任,确认可用再进入自动发行。
|
|
42
44
|
|
|
@@ -52,7 +54,7 @@ GitHub 仓库创建 Environment `npm-production`,部署规则只允许 `creati
|
|
|
52
54
|
|
|
53
55
|
## 维护与故障
|
|
54
56
|
|
|
55
|
-
- `package_not_ready_private_must_be_false
|
|
57
|
+
- `package_not_ready_private_must_be_false`:package.json 仍设为 private,检查包的公开范围和版本配置。
|
|
56
58
|
- `release_tag_mismatch` / `version_mismatch`:核正常源码版本与标签,不移动已发布标签或覆盖旧版本。
|
|
57
59
|
- npm认证失败:核 npm Trusted Publisher 的四个字段、直接publish权限、GitHub-hosted runner和对应Environment;无需新增长期Token。
|
|
58
60
|
- `artifact_integrity_mismatch` / `registry_integrity_conflict`:停止该次发行,核同一个artifact与原版本,不重传不同字节冒充同版。
|
package/lib/host-context.mjs
CHANGED
|
@@ -24,7 +24,7 @@ const controlled = new Set([
|
|
|
24
24
|
// Candidates only: the platform still checks its current registry isReadOnly
|
|
25
25
|
// flag and built-in allowlist. A model-supplied readOnly flag grants nothing.
|
|
26
26
|
const independentReads = new Set([
|
|
27
|
-
"read_spec", "read_creative_plan", "get_creative_plan", "list_assets",
|
|
27
|
+
"read_spec", "read_creative_plan", "get_creative_plan", "list_assets", "read_creation_consumption",
|
|
28
28
|
"skills_list", "read_skill",
|
|
29
29
|
]);
|
|
30
30
|
const isIndependentRead = (params) => independentReads.has(params.arguments.tool)
|
|
@@ -19,6 +19,18 @@ function compareVersions(a,b){
|
|
|
19
19
|
const left=a.split('.').map(BigInt),right=b.split('.').map(BigInt);
|
|
20
20
|
for(let i=0;i<3;i++){if(left[i]>right[i])return 1;if(left[i]<right[i])return -1;}return 0;
|
|
21
21
|
}
|
|
22
|
+
function pinnedGitSource(source){
|
|
23
|
+
if(typeof source==='string'){
|
|
24
|
+
// The supported marketplace shorthand can explicitly pin a tag or SHA.
|
|
25
|
+
const match=source.match(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+@([A-Za-z0-9_./-]{1,160})$/);
|
|
26
|
+
if(!match)return null;source={source:'git',ref:match[1]};
|
|
27
|
+
}
|
|
28
|
+
if(!source||!['git'].includes(source.source??source.type))return null;
|
|
29
|
+
const ref=source.refName??source.ref;
|
|
30
|
+
if(typeof ref!=='string')return null;
|
|
31
|
+
const refKind=/^[a-f0-9]{40}$/i.test(ref)?'commit':/^(?:refs\/tags\/)?creation-v\d+\.\d+\.\d+$/.test(ref)?'tag':null;
|
|
32
|
+
return refKind?{refName:ref,refKind}:null;
|
|
33
|
+
}
|
|
22
34
|
|
|
23
35
|
const entries=['package.json','README.md','LICENSE','bin','dist','lib','skills','docs','.codex-plugin','.mcp.json'];
|
|
24
36
|
const json=async file=>JSON.parse(await readFile(file,'utf8'));
|
|
@@ -163,7 +175,7 @@ async function codexJSON(runCodex,args){
|
|
|
163
175
|
// their bounded catalogs, then ask the supported CLI about every related entry.
|
|
164
176
|
// An unreadable catalog is unknown, never evidence that no plugin is installed.
|
|
165
177
|
async function relatedPlugins(runCodex,pluginName,env){
|
|
166
|
-
const related=new Set(),registered=new Set(),config=path.join(path.resolve(env.CODEX_HOME??path.join(homedir(),'.codex')),'config.toml');
|
|
178
|
+
const related=new Set(),registered=new Set(),pinnedMarketplaces=new Map(),config=path.join(path.resolve(env.CODEX_HOME??path.join(homedir(),'.codex')),'config.toml');
|
|
167
179
|
try{
|
|
168
180
|
const s=await info(config);
|
|
169
181
|
if(s){
|
|
@@ -187,6 +199,7 @@ async function relatedPlugins(runCodex,pluginName,env){
|
|
|
187
199
|
catch{fail('local_catalog_unconfirmed',{phase:'local_check',commandKind:'marketplace_read',localRegistrationState:'unknown',action:'restore_local_marketplace_catalog'});}
|
|
188
200
|
if(!Array.isArray(catalog?.plugins)||catalog.plugins.length>1024)fail('local_catalog_unconfirmed');
|
|
189
201
|
if(catalog.plugins.some(p=>p?.name===pluginName))related.add(market.name);
|
|
202
|
+
const pinned=pinnedGitSource(market.marketplaceSource);if(pinned)pinnedMarketplaces.set(market.name,pinned);
|
|
190
203
|
}
|
|
191
204
|
const installed=[];
|
|
192
205
|
for(const market of related){
|
|
@@ -196,7 +209,7 @@ async function relatedPlugins(runCodex,pluginName,env){
|
|
|
196
209
|
if(typeof p?.pluginId!=='string'||typeof p.enabled!=='boolean')fail('local_registration_unconfirmed');
|
|
197
210
|
if(p?.pluginId!==pluginName+'@'+market)continue;
|
|
198
211
|
if(p.marketplaceName!==undefined&&p.marketplaceName!==market)fail('local_registration_unconfirmed');
|
|
199
|
-
installed.push(p);
|
|
212
|
+
installed.push({...p,...(pinnedMarketplaces.has(market)?{pinnedMarketplace:pinnedMarketplaces.get(market)}:{})});
|
|
200
213
|
}
|
|
201
214
|
}
|
|
202
215
|
if(new Set(installed.map(p=>p.pluginId)).size!==installed.length)fail('local_registration_unconfirmed');
|
|
@@ -265,6 +278,10 @@ export async function installForUser({sourceRoot,profile='default',env=process.e
|
|
|
265
278
|
if(ready?.payloadDigest!==pending.payloadDigest)fail('installed_files_invalid');
|
|
266
279
|
previous=pending;await atomicJSON(currentFile,pending);await rm(pendingFile);
|
|
267
280
|
}
|
|
281
|
+
const pinned=state.installed.map(p=>({plugin:p,source:pinnedGitSource(p.source)??p.pinnedMarketplace})).find(p=>p.source);
|
|
282
|
+
if(pinned)fail('pinned_git_plugin_upgrade_required',{...pinned.source,sourceType:'git',
|
|
283
|
+
localRegistrationState:'present',action:'review_pinned_source_in_original_host',
|
|
284
|
+
next:'该插件来源固定在 Git 标签或提交。先完成使用旧桥的聊天,再通过原宿主的插件来源设置选择目标版本;marketplace upgrade 只刷新已配置的 ref,不会把固定提交切到新版。用 plugin marketplace list 和原目录的 plugin list 核版本后,再运行 connect。凭据和当前插件保持不变。'});
|
|
268
285
|
const official=await officialNpmInstallation(state.installed??[],servers,env,profile,configFile);
|
|
269
286
|
if(official){
|
|
270
287
|
if(installed||previous)fail('existing_registration_requires_review');
|
package/lib/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const CLIENT_VERSION = "0.2.
|
|
1
|
+
export const CLIENT_VERSION = "0.2.7";
|
|
2
2
|
export const CLIENT_PROTOCOL = "creation-client/v1";
|
package/package.json
CHANGED
|
@@ -7,7 +7,9 @@ description: 安装、连接或升级 PromptFrame Creation 的 Codex 插件,
|
|
|
7
7
|
|
|
8
8
|
使用 Studio“连接与授权”提供的完整 API 地址及公开安装入口。保留用户当前环境的 origin 和 `/api`,不替换成 localhost,不从旧聊天猜另一账号或环境。
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
<!-- creation-install-command -->
|
|
11
|
+
在用户本机终端运行 `npx --yes @promptframe/creation@0.2.7 connect --endpoint <Studio提供的API地址>`。需要隔离另一个环境或账号时显式加 `--profile <用户选择的名称>`;正在运行的桥不会切换。此命令管理用户级版本和 Codex 插件,不向当前项目安装依赖。优先使用 Studio 当前提供的固定推荐版本;每次重新进入此入口比较已安装版本,不后台追踪 latest,也不把旧聊天里的命令当最新版本。已安装更新版不默认降级。
|
|
12
|
+
<!-- /creation-install-command -->
|
|
11
13
|
|
|
12
14
|
命令会复用并验证有效凭据。首次授权或明确更换已失效凭据时,由用户在 Studio 登录并在终端的不回显输入框提供 Token;不要要求用户把 Token 粘进聊天,也不要把它写进命令参数、URL或日志。网络失败不等于授权失效,不自动轮换或覆盖凭据。
|
|
13
15
|
|