@promptframe/creation 0.3.5 → 0.3.6
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 +3 -1
- package/dist/cli.mjs +22 -4
- package/docs/install-guidance.json +1 -1
- package/docs/installing.md +3 -3
- package/docs/releases/0.3.6.md +5 -0
- package/lib/local-upload.mjs +19 -4
- 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.6 connect --endpoint <Studio提供的API地址>
|
|
12
12
|
```
|
|
13
13
|
<!-- /creation-install-command -->
|
|
14
14
|
|
|
@@ -24,6 +24,8 @@ API 使用 Studio 实际可达 origin 和 `/api` 或 `/api/mcp`,没有内置
|
|
|
24
24
|
|
|
25
25
|
文件必须在桥所在机器可读;远程WSL或SSH中的桥不会自动获得桌面路径。返回结果说明实际文件宿主、原上传ID和幂等键。中断后保留同一键查询或显式恢复;取消同一会话,不另建替代上传。上传、内容校验和素材ready分别显示,ready后可在同一Studio项目使用。
|
|
26
26
|
|
|
27
|
+
0.3.6在校验或衍生处理失败时,查询仍可成功返回,并保留有界的业务错误码;无法确认的原因使用通用错误码,不返回供应商原异常。已终结上传的提示不会建议恢复传输或无限查询。查询、恢复或取消不会重新执行已经完成的上传和衍生任务。
|
|
28
|
+
|
|
27
29
|
## 源码、包和宿主范围
|
|
28
30
|
|
|
29
31
|
[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接入)。
|
package/dist/cli.mjs
CHANGED
|
@@ -7886,6 +7886,14 @@ var typeByExtension = {
|
|
|
7886
7886
|
".pdf": ["document", "application/pdf"]
|
|
7887
7887
|
};
|
|
7888
7888
|
var terminal = /* @__PURE__ */ new Set(["ready", "aborted", "expired", "rejected"]);
|
|
7889
|
+
var terminalNext = {
|
|
7890
|
+
ready: "Use this asset in the same Studio project.",
|
|
7891
|
+
derivation_failed: "This finalized upload has no remaining transfer action. Review the failure in Studio. Do not create a replacement upload automatically.",
|
|
7892
|
+
aborted: "This upload was canceled. There is no remaining transfer action. Do not create a replacement upload automatically.",
|
|
7893
|
+
expired: "This upload expired. There is no remaining transfer action. Do not create a replacement upload automatically.",
|
|
7894
|
+
rejected: "This upload was rejected. Review the rejection in Studio. There is no remaining transfer action."
|
|
7895
|
+
};
|
|
7896
|
+
var safeDerivationErrorCode = (value2) => typeof value2 === "string" && value2.length <= 160 && /^[a-z][a-z0-9_]*(?:\.[a-z0-9_]+){1,8}$/u.test(value2) ? value2 : "creation.local_upload.derivation_failed";
|
|
7889
7897
|
var sessionCheck = (session, state) => {
|
|
7890
7898
|
if (!session || session.uploadId !== state.uploadId || session.assetId !== state.assetId || session.sizeBytes !== state.file.sizeBytes || session.expectedChecksum !== state.file.checksum || session.originalName !== state.file.name || session.scope?.projectId !== state.projectId || session.scope?.sessionId !== state.sessionId) fail3("session_identity_unconfirmed");
|
|
7891
7899
|
return session;
|
|
@@ -7930,7 +7938,7 @@ function createLocalUploadManager({ stateRoot, fetch: fetch2 = globalThis.fetch,
|
|
|
7930
7938
|
...state.errorCode ? { errorCode: state.errorCode } : {},
|
|
7931
7939
|
...state.result ? { result: state.result } : {},
|
|
7932
7940
|
automaticReplayAllowed: false,
|
|
7933
|
-
next: job ? "Read status using this same key." : state.phase
|
|
7941
|
+
next: job ? "Read status using this same key." : terminalNext[state.phase] ?? (state.phase === "derivatives_pending" ? "Read status for the original asset validation and derivatives." : "Observe status or explicitly resume/cancel this same key. Do not create a replacement upload.")
|
|
7934
7942
|
});
|
|
7935
7943
|
async function rpc(send, transfer2, options) {
|
|
7936
7944
|
const response = await send(transfer2, options);
|
|
@@ -7977,9 +7985,19 @@ function createLocalUploadManager({ stateRoot, fetch: fetch2 = globalThis.fetch,
|
|
|
7977
7985
|
}
|
|
7978
7986
|
if (result.isError) fail3("control_unconfirmed");
|
|
7979
7987
|
if (body?.success === true && body.uploadId === state.uploadId && body.assetId === state.assetId) {
|
|
7988
|
+
if (!["ready", "failed", "processing", "derivatives_pending"].includes(body.status)) fail3("control_unconfirmed");
|
|
7980
7989
|
state.phase = body.status === "ready" ? "ready" : body.status === "failed" ? "derivation_failed" : "derivatives_pending";
|
|
7981
|
-
|
|
7982
|
-
|
|
7990
|
+
const errorCode = body.status === "failed" ? safeDerivationErrorCode(body.errorCode) : void 0;
|
|
7991
|
+
state.result = {
|
|
7992
|
+
success: true,
|
|
7993
|
+
status: body.status,
|
|
7994
|
+
uploadId: state.uploadId,
|
|
7995
|
+
assetId: state.assetId,
|
|
7996
|
+
jobId: state.jobId,
|
|
7997
|
+
...errorCode ? { errorCode } : {}
|
|
7998
|
+
};
|
|
7999
|
+
if (errorCode) state.errorCode = errorCode;
|
|
8000
|
+
else delete state.errorCode;
|
|
7983
8001
|
} else if (body?.errorCode === "media_derivation.job_not_found") {
|
|
7984
8002
|
state.phase = "completion_unconfirmed";
|
|
7985
8003
|
state.errorCode = "creation.local_upload.completion_unconfirmed";
|
|
@@ -8258,7 +8276,7 @@ function createLocalUploadManager({ stateRoot, fetch: fetch2 = globalThis.fetch,
|
|
|
8258
8276
|
}
|
|
8259
8277
|
|
|
8260
8278
|
// lib/version.mjs
|
|
8261
|
-
var CLIENT_VERSION = "0.3.
|
|
8279
|
+
var CLIENT_VERSION = "0.3.6";
|
|
8262
8280
|
var CLIENT_PROTOCOL = "creation-client/v1";
|
|
8263
8281
|
|
|
8264
8282
|
// lib/cli.mjs
|
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.6 connect --endpoint <Studio提供的API地址>
|
|
10
10
|
```
|
|
11
11
|
<!-- /creation-install-command -->
|
|
12
12
|
|
|
@@ -26,7 +26,7 @@ npx --yes @promptframe/creation@0.3.5 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.6 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.6 connect --profile work-account --endpoint <另一环境API地址>
|
|
50
50
|
```
|
|
51
51
|
<!-- /creation-install-command -->
|
|
52
52
|
|
package/lib/local-upload.mjs
CHANGED
|
@@ -16,6 +16,18 @@ const typeByExtension={'.png':['image','image/png'],'.jpg':['image','image/jpeg'
|
|
|
16
16
|
'.m4a':['audio','audio/mp4'],'.flac':['audio','audio/flac'],'.mp4':['video','video/mp4'],'.mov':['video','video/quicktime'],
|
|
17
17
|
'.webm':['video','video/webm'],'.pdf':['document','application/pdf']};
|
|
18
18
|
const terminal=new Set(['ready','aborted','expired','rejected']);
|
|
19
|
+
const terminalNext={
|
|
20
|
+
ready:'Use this asset in the same Studio project.',
|
|
21
|
+
derivation_failed:'This finalized upload has no remaining transfer action. Review the failure in Studio. Do not create a replacement upload automatically.',
|
|
22
|
+
aborted:'This upload was canceled. There is no remaining transfer action. Do not create a replacement upload automatically.',
|
|
23
|
+
expired:'This upload expired. There is no remaining transfer action. Do not create a replacement upload automatically.',
|
|
24
|
+
rejected:'This upload was rejected. Review the rejection in Studio. There is no remaining transfer action.',
|
|
25
|
+
};
|
|
26
|
+
// Only the authenticated, identity-checked platform result supplies a cause.
|
|
27
|
+
// Preserve bounded machine codes, never arbitrary upstream error text.
|
|
28
|
+
const safeDerivationErrorCode=value=>typeof value==='string'&&value.length<=160
|
|
29
|
+
&&/^[a-z][a-z0-9_]*(?:\.[a-z0-9_]+){1,8}$/u.test(value)
|
|
30
|
+
?value:'creation.local_upload.derivation_failed';
|
|
19
31
|
const sessionCheck=(session,state)=>{
|
|
20
32
|
if(!session||session.uploadId!==state.uploadId||session.assetId!==state.assetId
|
|
21
33
|
||session.sizeBytes!==state.file.sizeBytes||session.expectedChecksum!==state.file.checksum
|
|
@@ -61,9 +73,9 @@ export function createLocalUploadManager({stateRoot,fetch=globalThis.fetch,now=D
|
|
|
61
73
|
...(state.jobId?{jobId:state.jobId}:{}),...(state.pendingPart?{unconfirmedPart:state.pendingPart}:{}),...(state.errorCode?{errorCode:state.errorCode}:{}),
|
|
62
74
|
...(state.result?{result:state.result}:{}),
|
|
63
75
|
automaticReplayAllowed:false,
|
|
64
|
-
next:job?'Read status using this same key.':state.phase
|
|
76
|
+
next:job?'Read status using this same key.':terminalNext[state.phase]??(
|
|
65
77
|
state.phase==='derivatives_pending'?'Read status for the original asset validation and derivatives.':
|
|
66
|
-
'Observe status or explicitly resume/cancel this same key. Do not create a replacement upload.'});
|
|
78
|
+
'Observe status or explicitly resume/cancel this same key. Do not create a replacement upload.')});
|
|
67
79
|
async function rpc(send,transfer,options){
|
|
68
80
|
const response=await send(transfer,options);
|
|
69
81
|
const result=response?.result??response;
|
|
@@ -90,9 +102,12 @@ export function createLocalUploadManager({stateRoot,fetch=globalThis.fetch,now=D
|
|
|
90
102
|
let body;try{body=result.structuredContent??JSON.parse(result.content?.find(block=>block.type==='text')?.text);}catch{fail('control_unconfirmed');}
|
|
91
103
|
if(result.isError)fail('control_unconfirmed');
|
|
92
104
|
if(body?.success===true&&body.uploadId===state.uploadId&&body.assetId===state.assetId){
|
|
105
|
+
if(!['ready','failed','processing','derivatives_pending'].includes(body.status))fail('control_unconfirmed');
|
|
93
106
|
state.phase=body.status==='ready'?'ready':body.status==='failed'?'derivation_failed':'derivatives_pending';
|
|
94
|
-
|
|
95
|
-
|
|
107
|
+
const errorCode=body.status==='failed'?safeDerivationErrorCode(body.errorCode):undefined;
|
|
108
|
+
state.result={success:true,status:body.status,uploadId:state.uploadId,assetId:state.assetId,jobId:state.jobId,
|
|
109
|
+
...(errorCode?{errorCode}:{})};
|
|
110
|
+
if(errorCode)state.errorCode=errorCode;else delete state.errorCode;
|
|
96
111
|
}else if(body?.errorCode==='media_derivation.job_not_found'){
|
|
97
112
|
state.phase='completion_unconfirmed';state.errorCode='creation.local_upload.completion_unconfirmed';
|
|
98
113
|
}else fail('session_identity_unconfirmed');
|
package/lib/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const CLIENT_VERSION = "0.3.
|
|
1
|
+
export const CLIENT_VERSION = "0.3.6";
|
|
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.6 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.6 connect --host claude-code --endpoint <Studio提供的API地址>`。桌面版远程连接 WSL 时,在该 WSL 执行;保留相同 profile 和有效凭据。
|
|
18
18
|
<!-- /creation-install-command -->
|
|
19
19
|
|
|
20
20
|
命令会复用并验证有效凭据。首次授权或明确更换已失效凭据时,由用户在 Studio 登录并在终端的不回显输入框提供 Token;不要要求用户把 Token 粘进聊天,也不要把它写进命令参数、URL或日志。网络失败不等于授权失效,不自动轮换或覆盖凭据。
|