@promptframe/creation 0.3.1 → 0.3.2
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +2 -2
- package/dist/cli.mjs +11 -5
- package/docs/development.md +1 -1
- package/docs/install-guidance.json +1 -1
- package/docs/installing.md +3 -3
- package/docs/releases/0.3.2.md +5 -0
- package/lib/claude-installation.mjs +3 -2
- package/lib/host-context.mjs +8 -2
- package/lib/version.mjs +1 -1
- package/package.json +1 -1
- package/skills/creation-setup/SKILL.md +2 -2
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<!-- creation-install-command -->
|
|
10
10
|
```bash
|
|
11
|
-
npx --yes @promptframe/creation@0.3.
|
|
11
|
+
npx --yes @promptframe/creation@0.3.2 connect --endpoint <Studio提供的API地址>
|
|
12
12
|
```
|
|
13
13
|
<!-- /creation-install-command -->
|
|
14
14
|
|
|
@@ -20,7 +20,7 @@ API 使用 Studio 实际可达 origin 和 `/api` 或 `/api/mcp`,没有内置
|
|
|
20
20
|
|
|
21
21
|
## 源码、包和宿主范围
|
|
22
22
|
|
|
23
|
-
[0.3.1](docs/releases/0.3.1.md)修复 Claude 会话身份更新;[0.3.0](docs/releases/0.3.0.md)增加 Claude Code 接入、平台动态工具发现、标准内容与版本化指引,以及新会话的兼容版本选择。已有0.2.x插件保持其安装来源;升级和新会话加载见[安装说明](docs/installing.md#claude-code接入)。
|
|
23
|
+
[0.3.2](docs/releases/0.3.2.md)改善本地目录插件升级的版本识别。[0.3.1](docs/releases/0.3.1.md)修复 Claude 会话身份更新;[0.3.0](docs/releases/0.3.0.md)增加 Claude Code 接入、平台动态工具发现、标准内容与版本化指引,以及新会话的兼容版本选择。已有0.2.x插件保持其安装来源;升级和新会话加载见[安装说明](docs/installing.md#claude-code接入)。
|
|
24
24
|
|
|
25
25
|
| 版本或层次 | 适用范围 |
|
|
26
26
|
| --- | --- |
|
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.3.
|
|
7304
|
+
var CLIENT_VERSION = "0.3.2";
|
|
7305
7305
|
var CLIENT_PROTOCOL = "creation-client/v1";
|
|
7306
7306
|
|
|
7307
7307
|
// lib/cli.mjs
|
|
@@ -20255,7 +20255,7 @@ function createHostCallBridge(client, { credentials, host = resolveHostIdentity(
|
|
|
20255
20255
|
const definition = directory.tools.get(raw.name);
|
|
20256
20256
|
if (!definition) throw new CreationClientError("creation.tool_unavailable");
|
|
20257
20257
|
const access2 = definition._meta["promptframe.access"], managed = Object.hasOwn(definition.inputSchema.properties ?? {}, "controlVersion");
|
|
20258
|
-
|
|
20258
|
+
let params = hostParameters(raw, binding.host, "independent-read");
|
|
20259
20259
|
let effectiveAccess = access2, resolvedControl;
|
|
20260
20260
|
if (definition._meta["promptframe.resolveAccess"] === "target") {
|
|
20261
20261
|
const { projectId, sessionId, tool, arguments: input } = params.arguments ?? {};
|
|
@@ -20263,7 +20263,12 @@ function createHostCallBridge(client, { credentials, host = resolveHostIdentity(
|
|
|
20263
20263
|
const observed = await send({ name: role("describe-target"), _meta: params._meta, arguments: { projectId, sessionId, tool, arguments: input } }, binding);
|
|
20264
20264
|
if (observed.result.isError) return observed.result;
|
|
20265
20265
|
const resolved = observed.trusted?.resolvedAccess;
|
|
20266
|
-
|
|
20266
|
+
const defaults = resolved?.scopeDefaults ?? {};
|
|
20267
|
+
if (!defaults || typeof defaults !== "object" || Array.isArray(defaults) || Object.entries(defaults).some(([key2, value2]) => !["projectId", "sessionId"].includes(key2) || value2 !== params.arguments[key2] || Object.hasOwn(input, key2)))
|
|
20268
|
+
throw new CreationClientError("creation.access_unverified");
|
|
20269
|
+
const normalized = { ...input, ...defaults };
|
|
20270
|
+
if (resolved?.tool !== tool || resolved.argumentsDigest !== argumentsDigest(normalized) || !accesses.has(resolved.access)) throw new CreationClientError("creation.access_unverified");
|
|
20271
|
+
params = { ...params, arguments: { ...params.arguments, arguments: normalized } };
|
|
20267
20272
|
effectiveAccess = resolved.access;
|
|
20268
20273
|
resolvedControl = observed.trusted?.control;
|
|
20269
20274
|
}
|
|
@@ -25440,6 +25445,7 @@ async function installClaudeMcpFallback({
|
|
|
25440
25445
|
// lib/claude-installation.mjs
|
|
25441
25446
|
var { info: info4, privateDirectory: privateDirectory6, privateRead: privateRead5, atomicJSON: atomicJSON4, acquire: acquire4, runNode: runNode2, checkInstalledRuntime: checkInstalledRuntime2, compareVersions: compareVersions3, validProfile: validProfile2 } = installationFiles;
|
|
25442
25447
|
var effectiveRoot = (plugin) => plugin.readFromFolder ?? plugin.installPath;
|
|
25448
|
+
var effectiveVersion = (plugin) => plugin.readFromFolder !== void 0 ? plugin.folderVersion : plugin.version;
|
|
25443
25449
|
var ClaudeInstallationError = class extends CreationClientError {
|
|
25444
25450
|
constructor(code, details) {
|
|
25445
25451
|
super("installation." + code);
|
|
@@ -25470,7 +25476,7 @@ async function registrations(run, pluginName, marketplace, root) {
|
|
|
25470
25476
|
if (plugins.some((p2) => !p2 || typeof p2.id !== "string" || !p2.id || p2.id.length > 256 || typeof p2.scope !== "string" || typeof p2.version !== "string" || typeof p2.enabled !== "boolean" || typeof p2.installPath !== "string") || markets.some((p2) => !p2 || typeof p2.name !== "string" || !p2.name || typeof p2.source !== "string"))
|
|
25471
25477
|
fail4("claude_local_registration_unconfirmed");
|
|
25472
25478
|
const related = plugins.filter((p2) => typeof p2?.id === "string" && p2.id.startsWith(pluginName + "@"));
|
|
25473
|
-
if (related.length > 1 || related.some((p2) => p2.id !== pluginName + "@" + marketplace || p2.scope !== "user" || typeof p2.enabled !== "boolean" || !/^\d+\.\d+\.\d+$/.test(p2.version ?? "") || !path12.isAbsolute(p2.installPath ?? "") || p2.readFromFolder !== void 0 && (!path12.isAbsolute(p2.readFromFolder) || p2.folderVersion
|
|
25479
|
+
if (related.length > 1 || related.some((p2) => p2.id !== pluginName + "@" + marketplace || p2.scope !== "user" || typeof p2.enabled !== "boolean" || !/^\d+\.\d+\.\d+$/.test(p2.version ?? "") || !path12.isAbsolute(p2.installPath ?? "") || p2.readFromFolder !== void 0 && (!path12.isAbsolute(p2.readFromFolder) || !/^\d+\.\d+\.\d+$/.test(p2.folderVersion ?? ""))))
|
|
25474
25480
|
fail4("claude_existing_registration_requires_review");
|
|
25475
25481
|
const found = markets.filter((p2) => p2?.name === marketplace);
|
|
25476
25482
|
if (found.length > 1 || found.some((p2) => p2.source !== "directory" || p2.path !== root || p2.installLocation !== root))
|
|
@@ -25570,7 +25576,7 @@ async function installClaudeUserLocked({
|
|
|
25570
25576
|
checkBinding(pending);
|
|
25571
25577
|
const runtimeCommands = /* @__PURE__ */ new Map();
|
|
25572
25578
|
const observed = async (record2) => {
|
|
25573
|
-
if (!state.market || !state.plugin || state.plugin.enabled !== true || state.plugin
|
|
25579
|
+
if (!state.market || !state.plugin || state.plugin.enabled !== true || effectiveVersion(state.plugin) !== record2.version || effectiveRoot(state.plugin) !== record2.versionRoot) return false;
|
|
25574
25580
|
const ready = await verifyVersion2(record2.versionRoot, { ...record2, pluginName, serverName });
|
|
25575
25581
|
runtimeCommands.set(record2.versionRoot, ready.runtimeCommand);
|
|
25576
25582
|
return true;
|
package/docs/development.md
CHANGED
|
@@ -70,4 +70,4 @@ PreToolUse hook不替用户批准工具。Claude的auto模式可能先审核hook
|
|
|
70
70
|
|
|
71
71
|
宿主插件已安装/启用、平台连接验证与聊天加载分别报告。外部安装器不接私有 app-server 生产刷新通道;当前使用官方新聊天/新 session 路径,选择 Local 和独立非 Git 目录即可。候选包、公共 registry 固定包和真实宿主新聊天工具/两个 Skill 的验收分开记录。
|
|
72
72
|
|
|
73
|
-
Claude Code 使用官方 `plugin list --json` 与 `plugin marketplace list --json` 读取登记,不调用会健康检查 MCP 的 `mcp list/get`。本地 marketplace 的 `readFromFolder/folderVersion`
|
|
73
|
+
Claude Code 使用官方 `plugin list --json` 与 `plugin marketplace list --json` 读取登记,不调用会健康检查 MCP 的 `mcp list/get`。本地 marketplace 的 `readFromFolder/folderVersion` 表示实际读取目录,其folderVersion与安装记录的缓存版本可不同;按实际目录版本和完整性核对;版本目录及两份 MCP 定义均验证摘要。每个登记写前保存阶段,回程未知后只观察原身份。隔离 CLI 安装不等于桌面模型会话加载。
|
package/docs/installing.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<!-- creation-install-command -->
|
|
8
8
|
```bash
|
|
9
|
-
npx --yes @promptframe/creation@0.3.
|
|
9
|
+
npx --yes @promptframe/creation@0.3.2 connect --endpoint <Studio提供的API地址>
|
|
10
10
|
```
|
|
11
11
|
<!-- /creation-install-command -->
|
|
12
12
|
|
|
@@ -26,7 +26,7 @@ npx --yes @promptframe/creation@0.3.1 connect --endpoint <Studio提供的API地
|
|
|
26
26
|
|
|
27
27
|
<!-- creation-install-command -->
|
|
28
28
|
```bash
|
|
29
|
-
npx --yes @promptframe/creation@0.3.
|
|
29
|
+
npx --yes @promptframe/creation@0.3.2 connect --host claude-code --endpoint <Studio提供的API地址>
|
|
30
30
|
```
|
|
31
31
|
<!-- /creation-install-command -->
|
|
32
32
|
|
|
@@ -46,7 +46,7 @@ CLI 优先使用 PATH 中的 Claude;桌面版远程连接 WSL 时,也识别
|
|
|
46
46
|
|
|
47
47
|
<!-- creation-install-command -->
|
|
48
48
|
```bash
|
|
49
|
-
npx --yes @promptframe/creation@0.3.
|
|
49
|
+
npx --yes @promptframe/creation@0.3.2 connect --profile work-account --endpoint <另一环境API地址>
|
|
50
50
|
```
|
|
51
51
|
<!-- /creation-install-command -->
|
|
52
52
|
|
|
@@ -13,6 +13,7 @@ import {installClaudeMcpFallback} from './claude-mcp-installation.mjs';
|
|
|
13
13
|
const {info,privateDirectory,privateRead,atomicJSON,acquire,runNode,checkInstalledRuntime,compareVersions,validProfile}=installationFiles;
|
|
14
14
|
const hash=b=>createHash('sha256').update(b).digest('hex');
|
|
15
15
|
const effectiveRoot=plugin=>plugin.readFromFolder??plugin.installPath;
|
|
16
|
+
const effectiveVersion=plugin=>plugin.readFromFolder!==undefined?plugin.folderVersion:plugin.version;
|
|
16
17
|
class ClaudeInstallationError extends CreationClientError{
|
|
17
18
|
constructor(code,details){super('installation.'+code);this.details=details;}
|
|
18
19
|
}
|
|
@@ -33,7 +34,7 @@ async function registrations(run,pluginName,marketplace,root){
|
|
|
33
34
|
const related=plugins.filter(p=>typeof p?.id==='string'&&p.id.startsWith(pluginName+'@'));
|
|
34
35
|
if(related.length>1||related.some(p=>p.id!==pluginName+'@'+marketplace||p.scope!=='user'
|
|
35
36
|
||typeof p.enabled!=='boolean'||!/^\d+\.\d+\.\d+$/.test(p.version??'')||!path.isAbsolute(p.installPath??'')
|
|
36
|
-
||p.readFromFolder!==undefined&&(!path.isAbsolute(p.readFromFolder)
|
|
37
|
+
||p.readFromFolder!==undefined&&(!path.isAbsolute(p.readFromFolder)||!/^\d+\.\d+\.\d+$/.test(p.folderVersion??''))))
|
|
37
38
|
fail('claude_existing_registration_requires_review');
|
|
38
39
|
const found=markets.filter(p=>p?.name===marketplace);
|
|
39
40
|
if(found.length>1||found.some(p=>p.source!=='directory'||p.path!==root||p.installLocation!==root))
|
|
@@ -127,7 +128,7 @@ async function installClaudeUserLocked({sourceRoot,profile='default',env=process
|
|
|
127
128
|
checkBinding(previous);checkBinding(pending);
|
|
128
129
|
const runtimeCommands=new Map();
|
|
129
130
|
const observed=async record=>{
|
|
130
|
-
if(!state.market||!state.plugin||state.plugin.enabled!==true||state.plugin
|
|
131
|
+
if(!state.market||!state.plugin||state.plugin.enabled!==true||effectiveVersion(state.plugin)!==record.version||effectiveRoot(state.plugin)!==record.versionRoot)return false;
|
|
131
132
|
const ready=await verifyVersion(record.versionRoot,{...record,pluginName,serverName});
|
|
132
133
|
runtimeCommands.set(record.versionRoot,ready.runtimeCommand);return true;
|
|
133
134
|
};
|
package/lib/host-context.mjs
CHANGED
|
@@ -145,14 +145,20 @@ export function createHostCallBridge(client,{credentials,host=resolveHostIdentit
|
|
|
145
145
|
const access=definition._meta['promptframe.access'],managed=Object.hasOwn(definition.inputSchema.properties??{},'controlVersion');
|
|
146
146
|
// Resolve parameter-dependent access before requiring a controller. A
|
|
147
147
|
// missing host UUID must not block an independently authorized read.
|
|
148
|
-
|
|
148
|
+
let params=hostParameters(raw,binding.host,'independent-read');let effectiveAccess=access,resolvedControl;
|
|
149
149
|
if(definition._meta['promptframe.resolveAccess']==='target'){
|
|
150
150
|
const {projectId,sessionId,tool,arguments:input}=params.arguments??{};
|
|
151
151
|
if(typeof tool!=='string'||!input||typeof input!=='object'||Array.isArray(input))throw new CreationClientError('creation.request_invalid');
|
|
152
152
|
const observed=await send({name:role('describe-target'),_meta:params._meta,arguments:{projectId,sessionId,tool,arguments:input}},binding);
|
|
153
153
|
if(observed.result.isError)return observed.result;
|
|
154
154
|
const resolved=observed.trusted?.resolvedAccess;
|
|
155
|
-
|
|
155
|
+
const defaults=resolved?.scopeDefaults??{};
|
|
156
|
+
if(!defaults||typeof defaults!=='object'||Array.isArray(defaults)||Object.entries(defaults).some(([key,value])=>
|
|
157
|
+
!['projectId','sessionId'].includes(key)||value!==params.arguments[key]||Object.hasOwn(input,key)))
|
|
158
|
+
throw new CreationClientError('creation.access_unverified');
|
|
159
|
+
const normalized={...input,...defaults};
|
|
160
|
+
if(resolved?.tool!==tool||resolved.argumentsDigest!==argumentsDigest(normalized)||!accesses.has(resolved.access))throw new CreationClientError('creation.access_unverified');
|
|
161
|
+
params={...params,arguments:{...params.arguments,arguments:normalized}};
|
|
156
162
|
effectiveAccess=resolved.access;
|
|
157
163
|
resolvedControl=observed.trusted?.control;
|
|
158
164
|
}
|
package/lib/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const CLIENT_VERSION = "0.3.
|
|
1
|
+
export const CLIENT_VERSION = "0.3.2";
|
|
2
2
|
export const CLIENT_PROTOCOL = "creation-client/v1";
|
package/package.json
CHANGED
|
@@ -10,11 +10,11 @@ description: 安装、连接或升级 PromptFrame Creation,复用平台创作
|
|
|
10
10
|
先确认使用 Codex 还是 Claude Code。Claude 接入使用 `connect --host claude-code`,两种宿主可共用同一 profile 凭据,插件登记分别核实。使用 Studio 对当前环境提供的固定版本;旧版入口不会因平台更新自动改变。Claude 桌面版远程连接 WSL 时,在同一 WSL 安装;没有终端命令时可通过 `--claude-bin <实际可执行文件>` 指定桌面版提供的入口,不固定桌面构建文件名。
|
|
11
11
|
|
|
12
12
|
<!-- creation-install-command -->
|
|
13
|
-
在用户本机终端运行 `npx --yes @promptframe/creation@0.3.
|
|
13
|
+
在用户本机终端运行 `npx --yes @promptframe/creation@0.3.2 connect --endpoint <Studio提供的API地址>`。需要隔离另一个环境或账号时显式加 `--profile <用户选择的名称>`;正在运行的桥不会切换。此命令管理用户级版本和 Codex 插件,不向当前项目安装依赖。优先使用 Studio 当前提供的固定推荐版本;每次重新进入此入口比较已安装版本,不后台追踪 latest,也不把旧聊天里的命令当最新版本。已安装更新版不默认降级。
|
|
14
14
|
<!-- /creation-install-command -->
|
|
15
15
|
|
|
16
16
|
<!-- creation-install-command -->
|
|
17
|
-
Claude Code 使用 `npx --yes @promptframe/creation@0.3.
|
|
17
|
+
Claude Code 使用 `npx --yes @promptframe/creation@0.3.2 connect --host claude-code --endpoint <Studio提供的API地址>`。桌面版远程连接 WSL 时,在该 WSL 执行;保留相同 profile 和有效凭据。
|
|
18
18
|
<!-- /creation-install-command -->
|
|
19
19
|
|
|
20
20
|
命令会复用并验证有效凭据。首次授权或明确更换已失效凭据时,由用户在 Studio 登录并在终端的不回显输入框提供 Token;不要要求用户把 Token 粘进聊天,也不要把它写进命令参数、URL或日志。网络失败不等于授权失效,不自动轮换或覆盖凭据。
|