@promptframe/creation 0.3.0 → 0.3.1
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 +52 -2
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +3 -3
- package/dist/cli.mjs +1052 -644
- package/docs/development.md +6 -2
- package/docs/install-guidance.json +3 -3
- package/docs/installing.md +4 -4
- package/docs/releases/0.3.1.md +7 -0
- package/lib/claude-hook-definition.mjs +11 -0
- package/lib/claude-hook-registration.mjs +66 -0
- package/lib/claude-host-process.mjs +48 -0
- package/lib/claude-host-session.mjs +150 -0
- package/lib/claude-installation.mjs +5 -1
- package/lib/claude-mcp-installation.mjs +3 -0
- package/lib/cli.mjs +8 -3
- package/lib/host-context.mjs +43 -16
- package/lib/host-identity.mjs +5 -6
- package/lib/runtime-launch.mjs +1 -1
- package/lib/version.mjs +1 -1
- package/package.json +1 -1
- package/skills/creation-setup/SKILL.md +2 -2
package/lib/host-identity.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {randomUUID} from 'node:crypto';
|
|
2
1
|
import {CreationClientError} from './credentials.mjs';
|
|
3
2
|
|
|
4
3
|
export function hostClientName(savedName,host){
|
|
@@ -8,14 +7,13 @@ export function hostClientName(savedName,host){
|
|
|
8
7
|
|
|
9
8
|
export const threadFormat=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
10
9
|
|
|
11
|
-
//
|
|
12
|
-
|
|
10
|
+
// Select the transport kind, not a controller. Claude's startup environment
|
|
11
|
+
// can remain stale after /clear; only a current host-hook call binds its UUID.
|
|
12
|
+
export function resolveHostIdentity({host,env=process.env}={}){
|
|
13
13
|
const kind=host??(env.CLAUDECODE==='1'?'claude-code':'codex');
|
|
14
14
|
if(!['codex','claude-code'].includes(kind))throw new CreationClientError('creation.host_unsupported');
|
|
15
15
|
if(kind==='codex')return Object.freeze({kind});
|
|
16
|
-
|
|
17
|
-
if(typeof threadId!=='string'||!threadFormat.test(threadId))throw new CreationClientError('creation.host_identity_invalid');
|
|
18
|
-
return Object.freeze({kind,threadId:threadId.toLowerCase()});
|
|
16
|
+
return Object.freeze({kind});
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
export function hostParameters(params,host,access){
|
|
@@ -24,6 +22,7 @@ export function hostParameters(params,host,access){
|
|
|
24
22
|
throw new CreationClientError('creation.transport_authority_managed_by_bridge');
|
|
25
23
|
if(host.kind==='claude-code'){
|
|
26
24
|
if(Object.hasOwn(meta,'threadId'))throw new CreationClientError('creation.transport_authority_managed_by_bridge');
|
|
25
|
+
if(!host.threadId){if(access==='independent-read')return params;throw new CreationClientError('creation.host_identity_unavailable');}
|
|
27
26
|
return {...params,_meta:{...meta,threadId:host.threadId}};
|
|
28
27
|
}
|
|
29
28
|
if(meta.threadId===undefined){
|
package/lib/runtime-launch.mjs
CHANGED
|
@@ -12,7 +12,7 @@ export async function launchSelectedBridge(selection,{host,configFile,spawnImpl=
|
|
|
12
12
|
try{child=spawnImpl(process.execPath,[path.join(selection.root,'bin/promptframe-creation.mjs'),'bridge',
|
|
13
13
|
'--config',configFile,'--host',host.kind,selection.locked?'--bridge-version':'--resolved-runtime-version',selection.version],
|
|
14
14
|
{stdio:'inherit',windowsHide:true,env:{...env,PROMPTFRAME_CREATION_CONFIG:configFile,
|
|
15
|
-
...(host.kind==='claude-code'?{CLAUDECODE:'1'
|
|
15
|
+
...(host.kind==='claude-code'?{CLAUDECODE:'1'}:{})}});}
|
|
16
16
|
catch{throw new CreationClientError('creation.runtime_start_unconfirmed');}
|
|
17
17
|
let signaled=false;
|
|
18
18
|
const forward=signal=>{if(!signaled){signaled=true;child.kill(signal);}};
|
package/lib/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const CLIENT_VERSION = "0.3.
|
|
1
|
+
export const CLIENT_VERSION = "0.3.1";
|
|
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.1 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.1 connect --host claude-code --endpoint <Studio提供的API地址>`。桌面版远程连接 WSL 时,在该 WSL 执行;保留相同 profile 和有效凭据。
|
|
18
18
|
<!-- /creation-install-command -->
|
|
19
19
|
|
|
20
20
|
命令会复用并验证有效凭据。首次授权或明确更换已失效凭据时,由用户在 Studio 登录并在终端的不回显输入框提供 Token;不要要求用户把 Token 粘进聊天,也不要把它写进命令参数、URL或日志。网络失败不等于授权失效,不自动轮换或覆盖凭据。
|