@promptframe/creation 0.3.1 → 0.3.3
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 +22 -9
- package/docs/development.md +3 -1
- package/docs/install-guidance.json +1 -1
- package/docs/installing.md +3 -3
- package/docs/releases/0.3.2.md +5 -0
- package/docs/releases/0.3.3.md +5 -0
- package/lib/bridge-negotiation.mjs +13 -4
- package/lib/claude-installation.mjs +3 -2
- package/lib/cli.mjs +2 -1
- 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.3 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.3";
|
|
7305
7305
|
var CLIENT_PROTOCOL = "creation-client/v1";
|
|
7306
7306
|
|
|
7307
7307
|
// lib/cli.mjs
|
|
@@ -19729,6 +19729,7 @@ function assertMcpResponseBudget(result) {
|
|
|
19729
19729
|
|
|
19730
19730
|
// lib/bridge-negotiation.mjs
|
|
19731
19731
|
var CONTENT_TYPES = Object.freeze(["text", "image", "audio", "resource_link", "resource"]);
|
|
19732
|
+
var STANDARD_CONTENT_TYPES = Object.freeze(["text", "image", "resource"]);
|
|
19732
19733
|
var versionParts = (value2) => {
|
|
19733
19734
|
if (typeof value2 !== "string" || value2.length > 40 || !/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(value2))
|
|
19734
19735
|
throw new CreationClientError("creation.bridge_policy_invalid");
|
|
@@ -19744,7 +19745,7 @@ function compareBridgeVersions(left, right) {
|
|
|
19744
19745
|
function readPlatformBridgePolicy(capabilities) {
|
|
19745
19746
|
const policy = capabilities?.experimental?.["promptframe.creation"];
|
|
19746
19747
|
if (policy === void 0) return null;
|
|
19747
|
-
if (!policy || policy.contractVersion !== "creation-bridge-capabilities/v1" || policy.blockMaxBytes !== MCP_BLOCK_BYTES || policy.responseMaxBytes !== MCP_RESPONSE_BYTES || !Array.isArray(policy.contentTypes) || policy.contentTypes.length > CONTENT_TYPES.length || new Set(policy.contentTypes).size !== policy.contentTypes.length || !policy.contentTypes.includes("text") || policy.contentTypes.some((type) => !CONTENT_TYPES.includes(type)) || compareBridgeVersions(policy.recommendedBridge, policy.minBridge) < 0)
|
|
19748
|
+
if (!policy || policy.contractVersion !== "creation-bridge-capabilities/v1" || policy.blockMaxBytes !== MCP_BLOCK_BYTES || policy.responseMaxBytes !== MCP_RESPONSE_BYTES || !Array.isArray(policy.contentTypes) || policy.contentTypes.length > CONTENT_TYPES.length || new Set(policy.contentTypes).size !== policy.contentTypes.length || !policy.contentTypes.includes("text") || policy.contentTypes.some((type) => !CONTENT_TYPES.includes(type)) || policy.standardContentTypes !== void 0 && (!Array.isArray(policy.standardContentTypes) || policy.standardContentTypes.length !== STANDARD_CONTENT_TYPES.length || STANDARD_CONTENT_TYPES.some((type) => !policy.standardContentTypes.includes(type))) || compareBridgeVersions(policy.recommendedBridge, policy.minBridge) < 0)
|
|
19748
19749
|
throw new CreationClientError("creation.bridge_policy_invalid");
|
|
19749
19750
|
return Object.freeze({
|
|
19750
19751
|
contractVersion: policy.contractVersion,
|
|
@@ -19752,7 +19753,8 @@ function readPlatformBridgePolicy(capabilities) {
|
|
|
19752
19753
|
recommendedBridge: policy.recommendedBridge,
|
|
19753
19754
|
contentTypes: [...policy.contentTypes],
|
|
19754
19755
|
blockMaxBytes: policy.blockMaxBytes,
|
|
19755
|
-
responseMaxBytes: policy.responseMaxBytes
|
|
19756
|
+
responseMaxBytes: policy.responseMaxBytes,
|
|
19757
|
+
...policy.standardContentTypes ? { standardContentTypes: [...STANDARD_CONTENT_TYPES] } : {}
|
|
19756
19758
|
});
|
|
19757
19759
|
}
|
|
19758
19760
|
function assertBridgeCompatible(capabilities, version3) {
|
|
@@ -19773,8 +19775,10 @@ var BridgeCompatibilityError = class extends CreationClientError {
|
|
|
19773
19775
|
}
|
|
19774
19776
|
};
|
|
19775
19777
|
var bridgeErrorDetails = (error4) => error4 instanceof BridgeCompatibilityError ? error4.bridgeFacts : void 0;
|
|
19776
|
-
function declaredHostContentCapabilities(capabilities) {
|
|
19778
|
+
function declaredHostContentCapabilities(capabilities, { initialized = false, standardContent = false } = {}) {
|
|
19777
19779
|
const requested = capabilities?.experimental?.["promptframe.contentTypes"];
|
|
19780
|
+
if (requested === void 0 && initialized && standardContent)
|
|
19781
|
+
return { types: [...STANDARD_CONTENT_TYPES], source: "mcp-protocol" };
|
|
19778
19782
|
if (!Array.isArray(requested) || requested.length > CONTENT_TYPES.length || requested.some((type) => !CONTENT_TYPES.includes(type))) return { types: ["text"], source: "text-fallback" };
|
|
19779
19783
|
return { types: ["text", ...CONTENT_TYPES.filter((type) => type !== "text" && requested.includes(type))], source: "declared" };
|
|
19780
19784
|
}
|
|
@@ -20255,7 +20259,7 @@ function createHostCallBridge(client, { credentials, host = resolveHostIdentity(
|
|
|
20255
20259
|
const definition = directory.tools.get(raw.name);
|
|
20256
20260
|
if (!definition) throw new CreationClientError("creation.tool_unavailable");
|
|
20257
20261
|
const access2 = definition._meta["promptframe.access"], managed = Object.hasOwn(definition.inputSchema.properties ?? {}, "controlVersion");
|
|
20258
|
-
|
|
20262
|
+
let params = hostParameters(raw, binding.host, "independent-read");
|
|
20259
20263
|
let effectiveAccess = access2, resolvedControl;
|
|
20260
20264
|
if (definition._meta["promptframe.resolveAccess"] === "target") {
|
|
20261
20265
|
const { projectId, sessionId, tool, arguments: input } = params.arguments ?? {};
|
|
@@ -20263,7 +20267,12 @@ function createHostCallBridge(client, { credentials, host = resolveHostIdentity(
|
|
|
20263
20267
|
const observed = await send({ name: role("describe-target"), _meta: params._meta, arguments: { projectId, sessionId, tool, arguments: input } }, binding);
|
|
20264
20268
|
if (observed.result.isError) return observed.result;
|
|
20265
20269
|
const resolved = observed.trusted?.resolvedAccess;
|
|
20266
|
-
|
|
20270
|
+
const defaults = resolved?.scopeDefaults ?? {};
|
|
20271
|
+
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)))
|
|
20272
|
+
throw new CreationClientError("creation.access_unverified");
|
|
20273
|
+
const normalized = { ...input, ...defaults };
|
|
20274
|
+
if (resolved?.tool !== tool || resolved.argumentsDigest !== argumentsDigest(normalized) || !accesses.has(resolved.access)) throw new CreationClientError("creation.access_unverified");
|
|
20275
|
+
params = { ...params, arguments: { ...params.arguments, arguments: normalized } };
|
|
20267
20276
|
effectiveAccess = resolved.access;
|
|
20268
20277
|
resolvedControl = observed.trusted?.control;
|
|
20269
20278
|
}
|
|
@@ -25440,6 +25449,7 @@ async function installClaudeMcpFallback({
|
|
|
25440
25449
|
// lib/claude-installation.mjs
|
|
25441
25450
|
var { info: info4, privateDirectory: privateDirectory6, privateRead: privateRead5, atomicJSON: atomicJSON4, acquire: acquire4, runNode: runNode2, checkInstalledRuntime: checkInstalledRuntime2, compareVersions: compareVersions3, validProfile: validProfile2 } = installationFiles;
|
|
25442
25451
|
var effectiveRoot = (plugin) => plugin.readFromFolder ?? plugin.installPath;
|
|
25452
|
+
var effectiveVersion = (plugin) => plugin.readFromFolder !== void 0 ? plugin.folderVersion : plugin.version;
|
|
25443
25453
|
var ClaudeInstallationError = class extends CreationClientError {
|
|
25444
25454
|
constructor(code, details) {
|
|
25445
25455
|
super("installation." + code);
|
|
@@ -25470,7 +25480,7 @@ async function registrations(run, pluginName, marketplace, root) {
|
|
|
25470
25480
|
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
25481
|
fail4("claude_local_registration_unconfirmed");
|
|
25472
25482
|
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
|
|
25483
|
+
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
25484
|
fail4("claude_existing_registration_requires_review");
|
|
25475
25485
|
const found = markets.filter((p2) => p2?.name === marketplace);
|
|
25476
25486
|
if (found.length > 1 || found.some((p2) => p2.source !== "directory" || p2.path !== root || p2.installLocation !== root))
|
|
@@ -25570,7 +25580,7 @@ async function installClaudeUserLocked({
|
|
|
25570
25580
|
checkBinding(pending);
|
|
25571
25581
|
const runtimeCommands = /* @__PURE__ */ new Map();
|
|
25572
25582
|
const observed = async (record2) => {
|
|
25573
|
-
if (!state.market || !state.plugin || state.plugin.enabled !== true || state.plugin
|
|
25583
|
+
if (!state.market || !state.plugin || state.plugin.enabled !== true || effectiveVersion(state.plugin) !== record2.version || effectiveRoot(state.plugin) !== record2.versionRoot) return false;
|
|
25574
25584
|
const ready = await verifyVersion2(record2.versionRoot, { ...record2, pluginName, serverName });
|
|
25575
25585
|
runtimeCommands.set(record2.versionRoot, ready.runtimeCommand);
|
|
25576
25586
|
return true;
|
|
@@ -25873,7 +25883,10 @@ async function bridge() {
|
|
|
25873
25883
|
onKnowledgeChange: (kind) => kind === "resources" ? server.sendResourceListChanged() : server.sendPromptListChanged()
|
|
25874
25884
|
});
|
|
25875
25885
|
server.oninitialized = () => {
|
|
25876
|
-
const declared = declaredHostContentCapabilities(
|
|
25886
|
+
const declared = declaredHostContentCapabilities(
|
|
25887
|
+
server.getClientCapabilities(),
|
|
25888
|
+
{ initialized: true, standardContent: !!policy?.standardContentTypes }
|
|
25889
|
+
);
|
|
25877
25890
|
contentTypes = declared.types;
|
|
25878
25891
|
contentSource = declared.source;
|
|
25879
25892
|
};
|
package/docs/development.md
CHANGED
|
@@ -70,4 +70,6 @@ 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 安装不等于桌面模型会话加载。
|
|
74
|
+
|
|
75
|
+
标准 MCP 初始化后的图片和嵌入资源表示由平台的 `standardContentTypes` 协商启用。缺少该字段的平台继续使用文字降级;显式宿主限制优先。表示选择不改变会话身份、素材权限或业务调用次数。
|
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.3 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.3 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.3 connect --profile work-account --endpoint <另一环境API地址>
|
|
50
50
|
```
|
|
51
51
|
<!-- /creation-install-command -->
|
|
52
52
|
|
|
@@ -2,6 +2,7 @@ import {CreationClientError} from './credentials.mjs';
|
|
|
2
2
|
import {MCP_BLOCK_BYTES,MCP_RESPONSE_BYTES} from './content-budget.mjs';
|
|
3
3
|
|
|
4
4
|
export const CONTENT_TYPES=Object.freeze(['text','image','audio','resource_link','resource']);
|
|
5
|
+
const STANDARD_CONTENT_TYPES=Object.freeze(['text','image','resource']);
|
|
5
6
|
const versionParts=value=>{
|
|
6
7
|
if(typeof value!=='string'||value.length>40||!/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(value))
|
|
7
8
|
throw new CreationClientError('creation.bridge_policy_invalid');
|
|
@@ -22,11 +23,15 @@ export function readPlatformBridgePolicy(capabilities){
|
|
|
22
23
|
||!Array.isArray(policy.contentTypes)||policy.contentTypes.length>CONTENT_TYPES.length
|
|
23
24
|
||new Set(policy.contentTypes).size!==policy.contentTypes.length||!policy.contentTypes.includes('text')
|
|
24
25
|
||policy.contentTypes.some(type=>!CONTENT_TYPES.includes(type))
|
|
26
|
+
||policy.standardContentTypes!==undefined&&(!Array.isArray(policy.standardContentTypes)
|
|
27
|
+
||policy.standardContentTypes.length!==STANDARD_CONTENT_TYPES.length
|
|
28
|
+
||STANDARD_CONTENT_TYPES.some(type=>!policy.standardContentTypes.includes(type)))
|
|
25
29
|
||compareBridgeVersions(policy.recommendedBridge,policy.minBridge)<0)
|
|
26
30
|
throw new CreationClientError('creation.bridge_policy_invalid');
|
|
27
31
|
return Object.freeze({contractVersion:policy.contractVersion,minBridge:policy.minBridge,
|
|
28
32
|
recommendedBridge:policy.recommendedBridge,contentTypes:[...policy.contentTypes],
|
|
29
|
-
blockMaxBytes:policy.blockMaxBytes,responseMaxBytes:policy.responseMaxBytes
|
|
33
|
+
blockMaxBytes:policy.blockMaxBytes,responseMaxBytes:policy.responseMaxBytes,
|
|
34
|
+
...(policy.standardContentTypes?{standardContentTypes:[...STANDARD_CONTENT_TYPES]}:{})});
|
|
30
35
|
}
|
|
31
36
|
export function assertBridgeCompatible(capabilities,version){
|
|
32
37
|
const policy=readPlatformBridgePolicy(capabilities);
|
|
@@ -43,10 +48,14 @@ class BridgeCompatibilityError extends CreationClientError{
|
|
|
43
48
|
}
|
|
44
49
|
export const bridgeErrorDetails=error=>error instanceof BridgeCompatibilityError?error.bridgeFacts:undefined;
|
|
45
50
|
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
|
|
51
|
+
/** Image and embedded-resource results are standard MCP content, including the
|
|
52
|
+
* oldest protocol supported by our SDK. No private capability is required for
|
|
53
|
+
* them after initialization. Audio/resource_link still need explicit support;
|
|
54
|
+
* host/model names and the Studio director version do not establish it. */
|
|
55
|
+
export function declaredHostContentCapabilities(capabilities,{initialized=false,standardContent=false}={}){
|
|
49
56
|
const requested=capabilities?.experimental?.['promptframe.contentTypes'];
|
|
57
|
+
if(requested===undefined&&initialized&&standardContent)
|
|
58
|
+
return{types:[...STANDARD_CONTENT_TYPES],source:'mcp-protocol'};
|
|
50
59
|
if(!Array.isArray(requested)||requested.length>CONTENT_TYPES.length
|
|
51
60
|
||requested.some(type=>!CONTENT_TYPES.includes(type)))return{types:['text'],source:'text-fallback'};
|
|
52
61
|
return{types:['text',...CONTENT_TYPES.filter(type=>type!=='text'&&requested.includes(type))],source:'declared'};
|
|
@@ -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/cli.mjs
CHANGED
|
@@ -201,7 +201,8 @@ async function bridge() {
|
|
|
201
201
|
),
|
|
202
202
|
host=createHostCallBridge(client,{credentials,host:identity,hostSession,onCatalogChange:()=>server.sendToolListChanged(),
|
|
203
203
|
onKnowledgeChange:kind=>kind==='resources'?server.sendResourceListChanged():server.sendPromptListChanged()});
|
|
204
|
-
server.oninitialized=()=>{const declared=declaredHostContentCapabilities(server.getClientCapabilities()
|
|
204
|
+
server.oninitialized=()=>{const declared=declaredHostContentCapabilities(server.getClientCapabilities(),
|
|
205
|
+
{initialized:true,standardContent:!!policy?.standardContentTypes});
|
|
205
206
|
contentTypes=declared.types;contentSource=declared.source;};
|
|
206
207
|
const knowledgeHandler=(schema,method)=>server.setRequestHandler(schema,async request=>{
|
|
207
208
|
try{return await host[method](request.params??{});}catch(error){
|
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.3";
|
|
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.3 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.3 connect --host claude-code --endpoint <Studio提供的API地址>`。桌面版远程连接 WSL 时,在该 WSL 执行;保留相同 profile 和有效凭据。
|
|
18
18
|
<!-- /creation-install-command -->
|
|
19
19
|
|
|
20
20
|
命令会复用并验证有效凭据。首次授权或明确更换已失效凭据时,由用户在 Studio 登录并在终端的不回显输入框提供 Token;不要要求用户把 Token 粘进聊天,也不要把它写进命令参数、URL或日志。网络失败不等于授权失效,不自动轮换或覆盖凭据。
|