@promptframe/creation 0.3.14 → 0.3.16
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 +1 -1
- package/dist/cli.mjs +40 -12
- package/docs/development.md +1 -1
- package/docs/install-guidance.json +1 -1
- package/docs/installing.md +4 -4
- package/lib/antigravity-host-session.mjs +1 -1
- package/lib/antigravity-installation.mjs +34 -10
- package/lib/host-context.mjs +5 -1
- package/lib/version.mjs +1 -1
- package/package.json +1 -1
- package/skills/creation-setup/SKILL.md +3 -3
package/README.md
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -8429,7 +8429,7 @@ function createLocalUploadManager({ stateRoot, fetch: fetch2 = globalThis.fetch,
|
|
|
8429
8429
|
}
|
|
8430
8430
|
|
|
8431
8431
|
// lib/version.mjs
|
|
8432
|
-
var CLIENT_VERSION = "0.3.
|
|
8432
|
+
var CLIENT_VERSION = "0.3.16";
|
|
8433
8433
|
var CLIENT_PROTOCOL = "creation-client/v1";
|
|
8434
8434
|
|
|
8435
8435
|
// lib/cli.mjs
|
|
@@ -21729,6 +21729,7 @@ function createHostCallBridge(client, { credentials, host = resolveHostIdentity(
|
|
|
21729
21729
|
const access2 = definition._meta["promptframe.access"], managed = Object.hasOwn(definition.inputSchema.properties ?? {}, "controlVersion");
|
|
21730
21730
|
let params = hostParameters(raw, binding.host, "independent-read");
|
|
21731
21731
|
let effectiveAccess = access2, resolvedControl;
|
|
21732
|
+
let editorIndependentAssetWrite = false;
|
|
21732
21733
|
if (definition._meta["promptframe.resolveAccess"] === "target") {
|
|
21733
21734
|
const { projectId, sessionId: sessionId2, tool, arguments: input } = params.arguments ?? {};
|
|
21734
21735
|
if (typeof tool !== "string" || !input || typeof input !== "object" || Array.isArray(input)) throw new CreationClientError("creation.request_invalid");
|
|
@@ -21743,6 +21744,7 @@ function createHostCallBridge(client, { credentials, host = resolveHostIdentity(
|
|
|
21743
21744
|
params = { ...params, arguments: { ...params.arguments, arguments: normalized } };
|
|
21744
21745
|
effectiveAccess = resolved.access;
|
|
21745
21746
|
resolvedControl = observed.trusted?.control;
|
|
21747
|
+
editorIndependentAssetWrite = resolved.editorIndependentAssetWrite === true && effectiveAccess === "controlled" && tool === "adopt_external_media" && (normalized.action === "adopt" || normalized.action === void 0);
|
|
21746
21748
|
}
|
|
21747
21749
|
hostParameters(raw, binding.host, effectiveAccess);
|
|
21748
21750
|
const local = definition._meta["promptframe.localFileUpload"];
|
|
@@ -21784,7 +21786,8 @@ function createHostCallBridge(client, { credentials, host = resolveHostIdentity(
|
|
|
21784
21786
|
if (denied) return denied;
|
|
21785
21787
|
entry = versions.get(key);
|
|
21786
21788
|
}
|
|
21787
|
-
if (effectiveAccess !== "independent-read" && !entry.owned)
|
|
21789
|
+
if (effectiveAccess !== "independent-read" && !editorIndependentAssetWrite && !entry.owned)
|
|
21790
|
+
throw new CreationClientError("creation.editor_not_current");
|
|
21788
21791
|
outgoing = { ...params, arguments: { ...params.arguments, controlVersion: entry.version } };
|
|
21789
21792
|
}
|
|
21790
21793
|
}
|
|
@@ -21986,7 +21989,7 @@ var TICKET_TTL_MS = 12e4;
|
|
|
21986
21989
|
var SESSION_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
21987
21990
|
var MAX_TICKETS = 256;
|
|
21988
21991
|
var MAX_SESSIONS = 256;
|
|
21989
|
-
var DEFAULT_SERVER = "
|
|
21992
|
+
var DEFAULT_SERVER = "promptframe_pf";
|
|
21990
21993
|
var mcpToolName = /^[A-Za-z0-9_.:-]{1,200}$/;
|
|
21991
21994
|
var error4 = (code) => new CreationClientError("creation." + code);
|
|
21992
21995
|
var canonical3 = (value2) => {
|
|
@@ -27599,7 +27602,10 @@ var fail8 = (code, details) => {
|
|
|
27599
27602
|
throw new AntigravityInstallationError(code, details);
|
|
27600
27603
|
};
|
|
27601
27604
|
var profileFormat = /^[a-z0-9][a-z0-9-]{0,39}$/;
|
|
27602
|
-
var
|
|
27605
|
+
var ANTIGRAVITY_MCP_SERVER_KEY = "pf";
|
|
27606
|
+
var antigravityPluginName = (profile) => "promptframe" + (profile === "default" ? "" : "-" + profile);
|
|
27607
|
+
var legacyAntigravityPluginName = (profile) => "promptframe-creation" + (profile === "default" ? "" : "-" + profile);
|
|
27608
|
+
var antigravityServerName = (profile) => `${antigravityPluginName(profile)}_${ANTIGRAVITY_MCP_SERVER_KEY}`;
|
|
27603
27609
|
var object3 = (value2) => value2 !== null && typeof value2 === "object" && !Array.isArray(value2);
|
|
27604
27610
|
function usesCreationBridge(server, { profile, configFile: configFile2 }) {
|
|
27605
27611
|
if (!object3(server) || typeof server.command !== "string" || !Array.isArray(server.args)) return false;
|
|
@@ -27641,8 +27647,10 @@ async function checkAntigravityMcpConflicts({ profile = "default", configFile: c
|
|
|
27641
27647
|
await file.close();
|
|
27642
27648
|
}
|
|
27643
27649
|
if (!object3(config2) || config2.mcpServers !== void 0 && !object3(config2.mcpServers)) unreadable();
|
|
27650
|
+
const pluginName = antigravityPluginName(profile);
|
|
27651
|
+
const legacyPluginName = legacyAntigravityPluginName(profile);
|
|
27644
27652
|
const serverName = antigravityServerName(profile);
|
|
27645
|
-
const mcpServerNames = Object.entries(config2.mcpServers ?? {}).filter(([name, server]) => name ===
|
|
27653
|
+
const mcpServerNames = Object.entries(config2.mcpServers ?? {}).filter(([name, server]) => name === pluginName || name === serverName || name === legacyPluginName || name === `${legacyPluginName}_${legacyPluginName}` || usesCreationBridge(server, { profile, configFile: configFile2 })).map(([name]) => name);
|
|
27646
27654
|
if (mcpServerNames.length) fail8("legacy_mcp_entry_requires_review", {
|
|
27647
27655
|
mcpConfigFile,
|
|
27648
27656
|
mcpServerNames,
|
|
@@ -27652,7 +27660,7 @@ async function checkAntigravityMcpConflicts({ profile = "default", configFile: c
|
|
|
27652
27660
|
function shellQuote(value2) {
|
|
27653
27661
|
return '"' + String(value2).replace(/(["\\$`])/g, "\\$1") + '"';
|
|
27654
27662
|
}
|
|
27655
|
-
function antigravityPluginManifest({ version: version3, name = "promptframe
|
|
27663
|
+
function antigravityPluginManifest({ version: version3, name = "promptframe", displayName = "PromptFrame Creation" }) {
|
|
27656
27664
|
return {
|
|
27657
27665
|
name,
|
|
27658
27666
|
displayName,
|
|
@@ -27666,10 +27674,10 @@ function antigravityPluginManifest({ version: version3, name = "promptframe-crea
|
|
|
27666
27674
|
]
|
|
27667
27675
|
};
|
|
27668
27676
|
}
|
|
27669
|
-
function antigravityMcpConfig({
|
|
27677
|
+
function antigravityMcpConfig({ serverKey = ANTIGRAVITY_MCP_SERVER_KEY, nodeCommand, runtimeRoot, configFile: configFile2 }) {
|
|
27670
27678
|
return {
|
|
27671
27679
|
mcpServers: {
|
|
27672
|
-
[
|
|
27680
|
+
[serverKey]: {
|
|
27673
27681
|
command: nodeCommand,
|
|
27674
27682
|
args: [path21.join(runtimeRoot, "bin", "promptframe-creation.mjs"), "bridge", "--config", configFile2, "--host", "antigravity"]
|
|
27675
27683
|
}
|
|
@@ -27685,7 +27693,7 @@ function antigravityHooksConfig({ nodeCommand, runtimeRoot, configFile: configFi
|
|
|
27685
27693
|
"--config",
|
|
27686
27694
|
shellQuote(configFile2),
|
|
27687
27695
|
"--mcp-server",
|
|
27688
|
-
shellQuote(
|
|
27696
|
+
shellQuote(serverName)
|
|
27689
27697
|
].join(" ");
|
|
27690
27698
|
return {
|
|
27691
27699
|
"promptframe-host-identity": {
|
|
@@ -27741,6 +27749,21 @@ async function copyPackagePayload(payload, destRoot) {
|
|
|
27741
27749
|
throw e;
|
|
27742
27750
|
}
|
|
27743
27751
|
}
|
|
27752
|
+
async function cleanupLegacyPluginDirectory({ pluginsRoot, profile, configFile: configFile2 }) {
|
|
27753
|
+
const legacyDir = path21.join(pluginsRoot, legacyAntigravityPluginName(profile));
|
|
27754
|
+
let status;
|
|
27755
|
+
try {
|
|
27756
|
+
status = await lstat13(legacyDir);
|
|
27757
|
+
} catch (e) {
|
|
27758
|
+
if (e.code === "ENOENT") return false;
|
|
27759
|
+
throw e;
|
|
27760
|
+
}
|
|
27761
|
+
if (!status.isDirectory() || status.isSymbolicLink()) return false;
|
|
27762
|
+
const legacyMarker = await readJsonOrNull(path21.join(legacyDir, "promptframe-installation.json"));
|
|
27763
|
+
if (!legacyMarker || legacyMarker.host !== "antigravity" || legacyMarker.profile !== profile || legacyMarker.configFile !== configFile2) return false;
|
|
27764
|
+
await rm6(legacyDir, { recursive: true, force: true });
|
|
27765
|
+
return true;
|
|
27766
|
+
}
|
|
27744
27767
|
async function installForAntigravityUser({
|
|
27745
27768
|
sourceRoot,
|
|
27746
27769
|
profile = "default",
|
|
@@ -27754,8 +27777,9 @@ async function installForAntigravityUser({
|
|
|
27754
27777
|
signal?.throwIfAborted();
|
|
27755
27778
|
await checkAntigravityMcpConflicts({ profile, configFile: configFile2, env });
|
|
27756
27779
|
const payload = await inspectRuntimePackage(sourceRoot);
|
|
27780
|
+
const pluginDirName = antigravityPluginName(profile);
|
|
27781
|
+
const serverKey = ANTIGRAVITY_MCP_SERVER_KEY;
|
|
27757
27782
|
const serverName = antigravityServerName(profile);
|
|
27758
|
-
const pluginDirName = serverName;
|
|
27759
27783
|
const dataRoot = path21.resolve(env.XDG_DATA_HOME ?? path21.join(homedir12(), ".local", "share"), "promptframe-creation", profile, "antigravity");
|
|
27760
27784
|
const versionRoot = path21.join(dataRoot, "versions", payload.version);
|
|
27761
27785
|
const pluginsRoot = path21.join(antigravityConfigRoot(env), "plugins");
|
|
@@ -27775,6 +27799,7 @@ async function installForAntigravityUser({
|
|
|
27775
27799
|
if (existing.host !== "antigravity" || existing.profile !== profile || existing.configFile !== configFile2 || typeof existing.version !== "string" || !/^\d+\.\d+\.\d+$/.test(existing.version)) fail8("managed_installation_invalid");
|
|
27776
27800
|
const cmp = compareBridgeVersions(existing.version, payload.version);
|
|
27777
27801
|
if (cmp > 0) {
|
|
27802
|
+
await cleanupLegacyPluginDirectory({ pluginsRoot, profile, configFile: configFile2 });
|
|
27778
27803
|
return {
|
|
27779
27804
|
registered: true,
|
|
27780
27805
|
pluginInstalled: true,
|
|
@@ -27793,7 +27818,8 @@ async function installForAntigravityUser({
|
|
|
27793
27818
|
skills: [{ name: "creation-setup" }, { name: "video-creation" }]
|
|
27794
27819
|
};
|
|
27795
27820
|
}
|
|
27796
|
-
if (cmp === 0 && existing.payloadDigest === payload.payloadDigest && existing.versionRoot === versionRoot) {
|
|
27821
|
+
if (cmp === 0 && existing.payloadDigest === payload.payloadDigest && existing.versionRoot === versionRoot && existing.serverName === serverName) {
|
|
27822
|
+
await cleanupLegacyPluginDirectory({ pluginsRoot, profile, configFile: configFile2 });
|
|
27797
27823
|
return {
|
|
27798
27824
|
registered: true,
|
|
27799
27825
|
pluginInstalled: true,
|
|
@@ -27834,7 +27860,7 @@ async function installForAntigravityUser({
|
|
|
27834
27860
|
name: pluginDirName,
|
|
27835
27861
|
displayName: profile === "default" ? "PromptFrame Creation" : "PromptFrame Creation (" + profile + ")"
|
|
27836
27862
|
}), null, 2) + "\n";
|
|
27837
|
-
const mcpJson = JSON.stringify(antigravityMcpConfig({
|
|
27863
|
+
const mcpJson = JSON.stringify(antigravityMcpConfig({ serverKey, nodeCommand, runtimeRoot: versionRoot, configFile: configFile2 }), null, 2) + "\n";
|
|
27838
27864
|
const hooksJson = JSON.stringify(antigravityHooksConfig({ nodeCommand, runtimeRoot: versionRoot, configFile: configFile2, serverName }), null, 2) + "\n";
|
|
27839
27865
|
await writeFileAtomic(path21.join(pluginDir, "plugin.json"), pluginJson, 420);
|
|
27840
27866
|
await writeFileAtomic(path21.join(pluginDir, "mcp_config.json"), mcpJson, 384);
|
|
@@ -27850,6 +27876,7 @@ async function installForAntigravityUser({
|
|
|
27850
27876
|
profile,
|
|
27851
27877
|
configFile: configFile2,
|
|
27852
27878
|
pluginDirName,
|
|
27879
|
+
serverKey,
|
|
27853
27880
|
serverName,
|
|
27854
27881
|
version: payload.version,
|
|
27855
27882
|
versionRoot,
|
|
@@ -27860,6 +27887,7 @@ async function installForAntigravityUser({
|
|
|
27860
27887
|
installedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
27861
27888
|
};
|
|
27862
27889
|
await writeFileAtomic(markerFile, JSON.stringify(record2, null, 2) + "\n", 384);
|
|
27890
|
+
await cleanupLegacyPluginDirectory({ pluginsRoot, profile, configFile: configFile2 });
|
|
27863
27891
|
return {
|
|
27864
27892
|
registered: true,
|
|
27865
27893
|
pluginInstalled: true,
|
package/docs/development.md
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
## 安装与运行路径
|
|
35
35
|
|
|
36
|
-
当前源码的薄桥从平台目录读取工具分类和协议角色,按固定响应元数据管理作品控制版本。Web
|
|
36
|
+
当前源码的薄桥从平台目录读取工具分类和协议角色,按固定响应元数据管理作品控制版本。Web 或另一聊天编辑时,独立读取仍受项目和素材权限约束;修改作品需要当前聊天编辑权。外部素材入库按已认证平台对准确参数返回的独立素材写入标记执行,仍校验宿主身份、项目及素材写入权限。工具名称、正文中的同名字段和模型传入的分类都不会授予权限。目录版本变化在后续正常交互中发送标准工具目录变更通知,不额外轮询平台或替换活动进程。
|
|
37
37
|
|
|
38
38
|
当前源码按平台握手结果提供标准 resources/prompts 读取。项目公开指引复用平台已验证的创作基线;资源 URI 由平台解析,每次读取重新检查账号和项目权限。带版本的引用遇到正文版本变化会提示重新列取,不静默替换内容。桥保留标准正文和元数据,按序列化 UTF-8 计算单块400000字节、整次2000000字节上限;超限不会重执行业务。后续正常读取观察到版本变化时发送对应目录通知,不启动后台轮询。未声明这些能力的平台仍可通过原工具入口读取入门说明。源码能力、公开包和宿主实际支持分别核实。
|
|
39
39
|
|
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.16 connect --endpoint <Studio提供的API地址>
|
|
10
10
|
```
|
|
11
11
|
<!-- /creation-install-command -->
|
|
12
12
|
|
|
@@ -26,7 +26,7 @@ npx --yes @promptframe/creation@0.3.14 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.16 connect --host claude-code --endpoint <Studio提供的API地址>
|
|
30
30
|
```
|
|
31
31
|
<!-- /creation-install-command -->
|
|
32
32
|
|
|
@@ -44,7 +44,7 @@ CLI 优先使用 PATH 中的 Claude;桌面版远程连接 WSL 时,也识别
|
|
|
44
44
|
|
|
45
45
|
<!-- creation-install-command -->
|
|
46
46
|
```bash
|
|
47
|
-
npx --yes @promptframe/creation@0.3.
|
|
47
|
+
npx --yes @promptframe/creation@0.3.16 connect --host antigravity --endpoint <Studio提供的API地址>
|
|
48
48
|
```
|
|
49
49
|
<!-- /creation-install-command -->
|
|
50
50
|
|
|
@@ -60,7 +60,7 @@ npx --yes @promptframe/creation@0.3.14 connect --host antigravity --endpoint <St
|
|
|
60
60
|
|
|
61
61
|
<!-- creation-install-command -->
|
|
62
62
|
```bash
|
|
63
|
-
npx --yes @promptframe/creation@0.3.
|
|
63
|
+
npx --yes @promptframe/creation@0.3.16 connect --profile work-account --endpoint <另一环境API地址>
|
|
64
64
|
```
|
|
65
65
|
<!-- /creation-install-command -->
|
|
66
66
|
|
|
@@ -12,7 +12,7 @@ const TICKET_TTL_MS=120_000;
|
|
|
12
12
|
const SESSION_TTL_MS=24*60*60*1000;
|
|
13
13
|
const MAX_TICKETS=256;
|
|
14
14
|
const MAX_SESSIONS=256;
|
|
15
|
-
const DEFAULT_SERVER='
|
|
15
|
+
const DEFAULT_SERVER='promptframe_pf';
|
|
16
16
|
const mcpToolName=/^[A-Za-z0-9_.:-]{1,200}$/;
|
|
17
17
|
const error=code=>new CreationClientError('creation.'+code);
|
|
18
18
|
const canonical=value=>{
|
|
@@ -15,7 +15,10 @@ class AntigravityInstallationError extends CreationClientError{
|
|
|
15
15
|
export const antigravityInstallationDetails=error=>error instanceof AntigravityInstallationError?error.details:undefined;
|
|
16
16
|
const fail=(code,details)=>{throw new AntigravityInstallationError(code,details);};
|
|
17
17
|
const profileFormat=/^[a-z0-9][a-z0-9-]{0,39}$/;
|
|
18
|
-
const
|
|
18
|
+
const ANTIGRAVITY_MCP_SERVER_KEY='pf';
|
|
19
|
+
const antigravityPluginName=profile=>'promptframe'+(profile==='default'?'':'-'+profile);
|
|
20
|
+
const legacyAntigravityPluginName=profile=>'promptframe-creation'+(profile==='default'?'':'-'+profile);
|
|
21
|
+
const antigravityServerName=profile=>`${antigravityPluginName(profile)}_${ANTIGRAVITY_MCP_SERVER_KEY}`;
|
|
19
22
|
const object=value=>value!==null&&typeof value==='object'&&!Array.isArray(value);
|
|
20
23
|
|
|
21
24
|
function usesCreationBridge(server,{profile,configFile}){
|
|
@@ -53,10 +56,13 @@ export async function checkAntigravityMcpConflicts({profile='default',configFile
|
|
|
53
56
|
config=JSON.parse(await file.readFile('utf8'));
|
|
54
57
|
}catch{unreadable();}finally{await file.close();}
|
|
55
58
|
if(!object(config)||config.mcpServers!==undefined&&!object(config.mcpServers))unreadable();
|
|
59
|
+
const pluginName=antigravityPluginName(profile);
|
|
60
|
+
const legacyPluginName=legacyAntigravityPluginName(profile);
|
|
56
61
|
const serverName=antigravityServerName(profile);
|
|
57
62
|
const mcpServerNames=Object.entries(config.mcpServers??{})
|
|
58
|
-
.filter(([name,server])=>name===
|
|
59
|
-
||
|
|
63
|
+
.filter(([name,server])=>name===pluginName||name===serverName
|
|
64
|
+
||name===legacyPluginName||name===`${legacyPluginName}_${legacyPluginName}`
|
|
65
|
+
||usesCreationBridge(server,{profile,configFile}))
|
|
60
66
|
.map(([name])=>name);
|
|
61
67
|
if(mcpServerNames.length)fail('legacy_mcp_entry_requires_review',{mcpConfigFile,mcpServerNames,
|
|
62
68
|
action:'In Antigravity MCP settings, review the listed entries and remove the conflicting manual PromptFrame entries, then rerun connect with the existing Token.'});
|
|
@@ -66,7 +72,7 @@ function shellQuote(value){
|
|
|
66
72
|
return '"'+String(value).replace(/(["\\$`])/g,'\\$1')+'"';
|
|
67
73
|
}
|
|
68
74
|
|
|
69
|
-
export function antigravityPluginManifest({version,name='promptframe
|
|
75
|
+
export function antigravityPluginManifest({version,name='promptframe',displayName='PromptFrame Creation'}){
|
|
70
76
|
return {
|
|
71
77
|
name,
|
|
72
78
|
displayName,
|
|
@@ -81,10 +87,10 @@ export function antigravityPluginManifest({version,name='promptframe-creation',d
|
|
|
81
87
|
};
|
|
82
88
|
}
|
|
83
89
|
|
|
84
|
-
export function antigravityMcpConfig({
|
|
90
|
+
export function antigravityMcpConfig({serverKey=ANTIGRAVITY_MCP_SERVER_KEY,nodeCommand,runtimeRoot,configFile}){
|
|
85
91
|
return {
|
|
86
92
|
mcpServers:{
|
|
87
|
-
[
|
|
93
|
+
[serverKey]:{
|
|
88
94
|
command:nodeCommand,
|
|
89
95
|
args:[path.join(runtimeRoot,'bin','promptframe-creation.mjs'),'bridge','--config',configFile,'--host','antigravity'],
|
|
90
96
|
},
|
|
@@ -95,7 +101,7 @@ export function antigravityMcpConfig({serverName,nodeCommand,runtimeRoot,configF
|
|
|
95
101
|
export function antigravityHooksConfig({nodeCommand,runtimeRoot,configFile,serverName}){
|
|
96
102
|
const cliPath=path.join(runtimeRoot,'bin','promptframe-creation.mjs');
|
|
97
103
|
const command=[shellQuote(nodeCommand),shellQuote(cliPath),'antigravity-host-hook','--config',shellQuote(configFile),
|
|
98
|
-
'--mcp-server',shellQuote(
|
|
104
|
+
'--mcp-server',shellQuote(serverName)].join(' ');
|
|
99
105
|
return {
|
|
100
106
|
'promptframe-host-identity':{
|
|
101
107
|
SessionStart:[{type:'command',command:command+' --hook-event SessionStart',timeout:5}],
|
|
@@ -136,6 +142,18 @@ async function copyPackagePayload(payload,destRoot){
|
|
|
136
142
|
}
|
|
137
143
|
}
|
|
138
144
|
|
|
145
|
+
async function cleanupLegacyPluginDirectory({pluginsRoot,profile,configFile}){
|
|
146
|
+
const legacyDir=path.join(pluginsRoot,legacyAntigravityPluginName(profile));
|
|
147
|
+
let status;
|
|
148
|
+
try{status=await lstat(legacyDir);}catch(e){if(e.code==='ENOENT')return false;throw e;}
|
|
149
|
+
if(!status.isDirectory()||status.isSymbolicLink())return false;
|
|
150
|
+
const legacyMarker=await readJsonOrNull(path.join(legacyDir,'promptframe-installation.json'));
|
|
151
|
+
if(!legacyMarker||legacyMarker.host!=='antigravity'||legacyMarker.profile!==profile
|
|
152
|
+
||legacyMarker.configFile!==configFile)return false;
|
|
153
|
+
await rm(legacyDir,{recursive:true,force:true});
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
|
|
139
157
|
/** Install PromptFrame Creation as a native Antigravity plugin once.
|
|
140
158
|
* Subsequent bridge upgrades happen automatically on startup via
|
|
141
159
|
* runtime-bootstrap.mjs without requiring plugin reinstallation. */
|
|
@@ -152,8 +170,9 @@ export async function installForAntigravityUser({
|
|
|
152
170
|
signal?.throwIfAborted();
|
|
153
171
|
await checkAntigravityMcpConflicts({profile,configFile,env});
|
|
154
172
|
const payload=await inspectRuntimePackage(sourceRoot);
|
|
173
|
+
const pluginDirName=antigravityPluginName(profile);
|
|
174
|
+
const serverKey=ANTIGRAVITY_MCP_SERVER_KEY;
|
|
155
175
|
const serverName=antigravityServerName(profile);
|
|
156
|
-
const pluginDirName=serverName;
|
|
157
176
|
const dataRoot=path.resolve(env.XDG_DATA_HOME??path.join(homedir(),'.local','share'),'promptframe-creation',profile,'antigravity');
|
|
158
177
|
const versionRoot=path.join(dataRoot,'versions',payload.version);
|
|
159
178
|
const pluginsRoot=path.join(antigravityConfigRoot(env),'plugins');
|
|
@@ -173,12 +192,15 @@ export async function installForAntigravityUser({
|
|
|
173
192
|
||typeof existing.version!=='string'||!/^\d+\.\d+\.\d+$/.test(existing.version))fail('managed_installation_invalid');
|
|
174
193
|
const cmp=compareBridgeVersions(existing.version,payload.version);
|
|
175
194
|
if(cmp>0){
|
|
195
|
+
await cleanupLegacyPluginDirectory({pluginsRoot,profile,configFile});
|
|
176
196
|
return {registered:true,pluginInstalled:true,pluginEnabled:true,reused:true,host:'antigravity',
|
|
177
197
|
installationMode:'antigravity-plugin',profile,version:existing.version,requestedVersion:payload.version,
|
|
178
198
|
versionStatus:'newer_installed_kept',recordedRuntimeRetained:true,pluginDir,serverName,
|
|
179
199
|
skillsInstalled:true,skills:[{name:'creation-setup'},{name:'video-creation'}]};
|
|
180
200
|
}
|
|
181
|
-
if(cmp===0&&existing.payloadDigest===payload.payloadDigest&&existing.versionRoot===versionRoot
|
|
201
|
+
if(cmp===0&&existing.payloadDigest===payload.payloadDigest&&existing.versionRoot===versionRoot
|
|
202
|
+
&&existing.serverName===serverName){
|
|
203
|
+
await cleanupLegacyPluginDirectory({pluginsRoot,profile,configFile});
|
|
182
204
|
return {registered:true,pluginInstalled:true,pluginEnabled:true,reused:true,host:'antigravity',
|
|
183
205
|
installationMode:'antigravity-plugin',profile,version:payload.version,requestedVersion:payload.version,
|
|
184
206
|
versionStatus:'already_current',recordedRuntimeRetained:false,pluginDir,serverName,
|
|
@@ -203,7 +225,7 @@ export async function installForAntigravityUser({
|
|
|
203
225
|
name:pluginDirName,
|
|
204
226
|
displayName:profile==='default'?'PromptFrame Creation':'PromptFrame Creation ('+profile+')',
|
|
205
227
|
}),null,2)+'\n';
|
|
206
|
-
const mcpJson=JSON.stringify(antigravityMcpConfig({
|
|
228
|
+
const mcpJson=JSON.stringify(antigravityMcpConfig({serverKey,nodeCommand,runtimeRoot:versionRoot,configFile}),null,2)+'\n';
|
|
207
229
|
const hooksJson=JSON.stringify(antigravityHooksConfig({nodeCommand,runtimeRoot:versionRoot,configFile,serverName}),null,2)+'\n';
|
|
208
230
|
|
|
209
231
|
await writeFileAtomic(path.join(pluginDir,'plugin.json'),pluginJson,0o644);
|
|
@@ -222,6 +244,7 @@ export async function installForAntigravityUser({
|
|
|
222
244
|
profile,
|
|
223
245
|
configFile,
|
|
224
246
|
pluginDirName,
|
|
247
|
+
serverKey,
|
|
225
248
|
serverName,
|
|
226
249
|
version:payload.version,
|
|
227
250
|
versionRoot,
|
|
@@ -232,6 +255,7 @@ export async function installForAntigravityUser({
|
|
|
232
255
|
installedAt:new Date().toISOString(),
|
|
233
256
|
};
|
|
234
257
|
await writeFileAtomic(markerFile,JSON.stringify(record,null,2)+'\n',0o600);
|
|
258
|
+
await cleanupLegacyPluginDirectory({pluginsRoot,profile,configFile});
|
|
235
259
|
|
|
236
260
|
return {
|
|
237
261
|
registered:true,
|
package/lib/host-context.mjs
CHANGED
|
@@ -164,6 +164,7 @@ export function createHostCallBridge(client,{credentials,host=resolveHostIdentit
|
|
|
164
164
|
// Resolve parameter-dependent access before requiring a controller. A
|
|
165
165
|
// missing host UUID must not block an independently authorized read.
|
|
166
166
|
let params=hostParameters(raw,binding.host,'independent-read');let effectiveAccess=access,resolvedControl;
|
|
167
|
+
let editorIndependentAssetWrite=false;
|
|
167
168
|
if(definition._meta['promptframe.resolveAccess']==='target'){
|
|
168
169
|
const {projectId,sessionId,tool,arguments:input}=params.arguments??{};
|
|
169
170
|
if(typeof tool!=='string'||!input||typeof input!=='object'||Array.isArray(input))throw new CreationClientError('creation.request_invalid');
|
|
@@ -179,6 +180,8 @@ export function createHostCallBridge(client,{credentials,host=resolveHostIdentit
|
|
|
179
180
|
params={...params,arguments:{...params.arguments,arguments:normalized}};
|
|
180
181
|
effectiveAccess=resolved.access;
|
|
181
182
|
resolvedControl=observed.trusted?.control;
|
|
183
|
+
editorIndependentAssetWrite=resolved.editorIndependentAssetWrite===true&&effectiveAccess==='controlled'
|
|
184
|
+
&&tool==='adopt_external_media'&&(normalized.action==='adopt'||normalized.action===undefined);
|
|
182
185
|
}
|
|
183
186
|
hostParameters(raw,binding.host,effectiveAccess);
|
|
184
187
|
const local=definition._meta['promptframe.localFileUpload'];
|
|
@@ -205,7 +208,8 @@ export function createHostCallBridge(client,{credentials,host=resolveHostIdentit
|
|
|
205
208
|
outgoing={...params,arguments:{...params.arguments,controlVersion:resolvedControl.controlVersion}};
|
|
206
209
|
}else{let entry=versions.get(key);
|
|
207
210
|
if(!entry||entry.needsRead){const denied=await controlRead(params,key,binding);if(denied)return denied;entry=versions.get(key);}
|
|
208
|
-
if(effectiveAccess!=='independent-read'&&!entry.owned)
|
|
211
|
+
if(effectiveAccess!=='independent-read'&&!editorIndependentAssetWrite&&!entry.owned)
|
|
212
|
+
throw new CreationClientError('creation.editor_not_current');
|
|
209
213
|
outgoing={...params,arguments:{...params.arguments,controlVersion:entry.version}};
|
|
210
214
|
}
|
|
211
215
|
}
|
package/lib/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const CLIENT_VERSION = "0.3.
|
|
1
|
+
export const CLIENT_VERSION = "0.3.16";
|
|
2
2
|
export const CLIENT_PROTOCOL = "creation-client/v1";
|
package/package.json
CHANGED
|
@@ -10,15 +10,15 @@ description: 安装、连接或升级 PromptFrame Creation,复用平台创作
|
|
|
10
10
|
先确认使用 Codex、Claude Code 或 Antigravity。各宿主可共用同一 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.16 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.16 connect --host claude-code --endpoint <Studio提供的API地址>`。桌面版远程连接 WSL 时,在该 WSL 执行;保留相同 profile 和有效凭据。
|
|
18
18
|
<!-- /creation-install-command -->
|
|
19
19
|
|
|
20
20
|
<!-- creation-install-command -->
|
|
21
|
-
Antigravity 使用 `npx --yes @promptframe/creation@0.3.
|
|
21
|
+
Antigravity 使用 `npx --yes @promptframe/creation@0.3.16 connect --host antigravity --endpoint <Studio提供的API地址>`。在同一主机核对插件已启用,再打开新对话。
|
|
22
22
|
<!-- /creation-install-command -->
|
|
23
23
|
|
|
24
24
|
命令会复用并验证有效凭据。首次授权或明确更换已失效凭据时,由用户在 Studio 登录并在终端的不回显输入框提供 Token;不要要求用户把 Token 粘进聊天,也不要把它写进命令参数、URL或日志。网络失败不等于授权失效,不自动轮换或覆盖凭据。
|