Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

fix(plugin): keep OpenAI app binding private per install

Rahman014449989409
diff --git a/.env.example b/.env.example
index 6f6c616c..b58fde0c 100644
--- a/.env.example
+++ b/.env.example
@@ -280,6 +280,13 @@ OS_SESSION_SECRET=
# Owner-private Dokploy/Cloudflare/Hostinger connection state. Defaults to the path
# below; normally leave it there so the 0700 directory + 0600 file policy applies.
# OS_INFRA_STORE=~/.mso/private/infra-providers.json
+# Optional selectors for the owner-private OpenAI / ChatGPT App integration used by
+# plugin:link-app. These are connection names only; the registered App ID itself stays
+# inside the 0600 Integrations store and must not be committed or placed in env files.
+# MSO_OPENAI_APP_USER=
+# MSO_OPENAI_APP_CONNECTION=
+# Optional owner-private destination for plugin:stage-private output.
+# MSO_OPENAI_PLUGIN_STAGE=~/.mso/private/plugin-packages/mso
# CLI-only override for `mso skills install`; default ~/.mso/skills. The target is
# the explicit operator-trust root, so point this only at a private directory you own.
# MSO_SKILL_INSTALL_ROOT=~/.mso/skills
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index e7d8510c..9865f441 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -13,6 +13,7 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
**Fixed**
+- `plugin` keep OpenAI app binding private per install
- `security` keep remote-authority test shell path trusted
- `security` keep installer sources strict-semgrep parseable
- `browser` reload viewer after ticket exchange
diff --git a/docs/CHATGPT-PLUGIN.md b/docs/CHATGPT-PLUGIN.md
index 208e4ff3..506b331f 100644
--- a/docs/CHATGPT-PLUGIN.md
+++ b/docs/CHATGPT-PLUGIN.md
@@ -230,3 +230,12 @@ The live diagnostic `GET /mcp` returns both `toolset` (full MSO) and `chatgptToo
- Hidden ChatGPT transcript, private chain-of-thought and credentials are never copied into Local Agent/project MCP messages.
- MSO Block accepts only bounded fields/checks/outputs/actions and never executes a mutation directly; MSO Page never accepts raw HTML/arbitrary URL input, and nested iframe origins are code-reviewed, exact-origin CSP entries revalidated in the widget.
- The authenticated MSO cockpit stays non-frameable, and user-installed HTML/runtime manifests cannot promote themselves into the ChatGPT frame allowlist.
+
+
+### Private per-installation app binding
+
+The source repository intentionally keeps `.app.json` free of maintainer-specific App IDs. Each installation can create an **OpenAI / ChatGPT App** connection in MSO Integrations. The registered App ID is stored only in the owner-private integration store and is redacted from model/tool responses.
+
+To obtain the ID, enable ChatGPT developer mode, register the installation's remote `/mcp` endpoint, complete **Scan Tools** and OAuth, then copy the **App ID** from the registered app details. A browser URL may expose the equivalent technical `plugin_asdk_app_...` identifier; MSO normalizes that to canonical `asdk_app_...`. A Version ID is optional operator metadata and is never used as the plugin binding.
+
+Use `bun run plugin:stage-private` to create an owner-private plugin package at `~/.mso/private/plugin-packages/mso`. Its generated `.app.json` contains the selected installation's binding, while the Git checkout remains portable. `bun run plugin:link-app` without an explicit ID resolves the default private Integrations connection and redacts the ID from stdout. Explicit ID arguments remain only for compatibility/tests and should not be used for personal IDs in shell history.
diff --git a/docs/integrations/CHATGPT-UI.md b/docs/integrations/CHATGPT-UI.md
index 4390f42f..abb9f7e1 100644
--- a/docs/integrations/CHATGPT-UI.md
+++ b/docs/integrations/CHATGPT-UI.md
@@ -105,3 +105,10 @@ Official references:
- [MCP Apps host dimensions](https://apps.extensions.modelcontextprotocol.io/api/interfaces/app.McpUiHostContext.html)
- [MCP Apps specification](https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/draft/apps.mdx)
- [OpenAI plugin reference](https://developers.openai.com/plugins/reference)
+
+
+## Per-installation registered app binding
+
+Native MSO UI must be invoked through the registered ChatGPT MCP App rather than a nested function wrapper. Each MSO installation therefore keeps its registered OpenAI App ID in the owner-private **OpenAI / ChatGPT App** Integrations connection. The public source repository does not contain the maintainer's App ID.
+
+Users get their own ID by enabling ChatGPT developer mode, registering their MSO remote MCP endpoint, completing tool scan/OAuth, and copying the App ID from app details (or the equivalent `plugin_asdk_app_...` technical ID from the browser URL). The private staging command writes canonical `asdk_app_...` only into the owner-private package. Version IDs are not valid substitutes for App IDs.
diff --git a/lib/infra/additional-doctor.ts b/lib/infra/additional-doctor.ts
index 19b7fb6f..f422eb4e 100644
--- a/lib/infra/additional-doctor.ts
+++ b/lib/infra/additional-doctor.ts
@@ -75,6 +75,12 @@ export async function doctorAdditionalProvider(id: string, values: Record<string
if (allowed?.some((name) => !tools.some((tool) => tool.name === name))) throw new Error("MCP allowlist includes a tool unavailable to this token");
return `MCP discovery verified; ${tools.length} advertised tool(s). Identity and resource access remain downstream-token controlled.`;
}
+ case "openai-app": {
+ if (!present(values.appId)) return null;
+ if (!/^asdk_app_[A-Za-z0-9][A-Za-z0-9_-]*$/.test(values.appId)) throw new Error("OpenAI registered App ID format is invalid");
+ if (present(values.versionId) && !/^asdk_app_v_[A-Za-z0-9][A-Za-z0-9_-]*$/.test(values.versionId)) throw new Error("OpenAI Version ID format is invalid");
+ return "private registered-app binding configured; format verified locally; ChatGPT remains authoritative for registration/review status";
+ }
case "github": {
if (!present(values.apiKey)) return null;
const response = await checked("GitHub", "https://api.github.com/user", {
diff --git a/lib/infra/additional-providers.ts b/lib/infra/additional-providers.ts
index ddd36a01..f325d682 100644
--- a/lib/infra/additional-providers.ts
+++ b/lib/infra/additional-providers.ts
@@ -99,6 +99,16 @@ export const ADDITIONAL_PROVIDERS = {
{key:"mcpApiKey",label:"MCP API Key",secret:true,required:false,description:"DOKU-issued MCP API Key. It is distinct from the REST payment HMAC Secret Key."},
{key:"environment",label:"MCP Environment",secret:false,required:false,description:"Exactly sandbox or production. MSO derives the official DOKU MCP endpoint from this value."},
] },
+ "openai-app": {
+ id: "openai-app",
+ title: "OpenAI / ChatGPT App",
+ description: "Privately bind this MSO installation to its registered ChatGPT MCP App without committing the personal App ID to Git.",
+ feature: false,
+ fields: [
+ { key: "appId", label: "Registered App ID", secret: true, required: true, description: "Private per-installation OpenAI App ID used only to generate .app.json for personal/plugin packaging. Canonical form starts with asdk_app_; plugin_asdk_app_ copied from a browser URL is normalized automatically." },
+ { key: "versionId", label: "Version ID", secret: true, required: false, description: "Optional private development-version reference for operator diagnostics. It is never written into .app.json and is not required for MCP Apps UI binding." },
+ ],
+ },
} as const satisfies Record<string, AdditionalProvider>;
export type AdditionalProviderId = keyof typeof ADDITIONAL_PROVIDERS;
@@ -114,4 +124,5 @@ export const ADDITIONAL_GUIDANCE = {
clerk: { url: "https://dashboard.clerk.com", reference: "https://clerk.com/docs/guides/development/api-keys", steps: ["Open the intended Clerk instance in the Clerk dashboard.", "Find its secret key in the API Keys or Developers settings.", "Keep the key server-side and limit access to the intended instance.", "Copy it into this form; this check only confirms Backend API authentication."] },
supabase: { url: "https://supabase.com/dashboard/account/tokens", reference: "https://supabase.com/docs/reference/api/introduction", steps: ["Open Account → Access Tokens in the Supabase dashboard.", "Generate a personal access token for the account that owns the intended projects.", "Give it a clear name and an appropriate expiry.", "Copy it once into this form; project API keys cannot be used as Management API tokens."] },
doku: { url: "https://developers.doku.com/accept-payments/doku-mcp-server", reference: "https://developers.doku.com/accept-payments/doku-mcp-server", steps: ["Open DOKU's official MCP Server guide and choose Sandbox first unless this project is explicitly approved for production payments.", "Obtain the DOKU Client ID and MCP API Key for that environment.", "Enter them only in this private setup form; do not paste them into chat, Baton notes, RR, Git, or project MCP JSON.", "MSO calls the fixed official DOKU MCP endpoint with a read-only MCP initialize request before saving the connection."] },
+ "openai-app": { url: "https://chatgpt.com/", reference: "https://help.openai.com/en/articles/12584461-developer-mode-and-mcp-apps-in-chatgpt", steps: ["Enable ChatGPT developer mode, then create/register the remote MCP app for this MSO installation and complete Scan Tools + OAuth.", "Open the registered app details. Copy the App ID shown there, or copy the technical plugin_asdk_app_… id from the browser URL; do not use the Version ID as the app binding.", "Enter the App ID only in this private Integrations form. MSO normalizes plugin_asdk_app_… to canonical asdk_app_… and never returns the stored value through tool/model responses.", "Use the private plugin staging/link command when packaging. Keep the repository .app.json empty so a maintainer-specific App ID is never committed or distributed to other users."] },
} as const satisfies Record<AdditionalProviderId, { url: string; reference: string; steps: readonly string[] }>;
diff --git a/lib/infra/catalog.ts b/lib/infra/catalog.ts
index a4dae501..9e651718 100644
--- a/lib/infra/catalog.ts
+++ b/lib/infra/catalog.ts
@@ -108,6 +108,14 @@ export function normalizeInfraValues(id: InfraProviderId, raw: Record<string, un
for(const key of ["paymentClientId","mcpClientId"])if(out[key]&&(out[key].length<3||out[key].length>256||/[\s\x00-\x1f\x7f]/.test(out[key])))throw new Error("DOKU Client ID must be an opaque single-line value");
for(const key of ["paymentSecretKey","mcpApiKey"])if(out[key]&&(out[key].length<8||/[\s\x00-\x1f\x7f]/.test(out[key])))throw new Error("DOKU secret/API key must be an opaque single-line value");
}
+ if (id === "openai-app") {
+ if (out.appId) {
+ const normalized = out.appId.startsWith("plugin_asdk_app_") ? out.appId.slice("plugin_".length) : out.appId;
+ if (normalized.startsWith("asdk_app_v_") || !/^asdk_app_[A-Za-z0-9][A-Za-z0-9_-]*$/.test(normalized)) throw new Error("OpenAI App ID must be canonical asdk_app_… or browser URL form plugin_asdk_app_…");
+ out.appId = normalized;
+ }
+ if (out.versionId && !/^asdk_app_v_[A-Za-z0-9][A-Za-z0-9_-]*$/.test(out.versionId)) throw new Error("OpenAI Version ID must start with asdk_app_v_");
+ }
if (id === "hostinger") {
if (out.apiToken && out.apiToken.length < 24) throw new Error("Hostinger API token is too short");
if (out.mailApiToken && out.mailApiToken.length < 24) throw new Error("Hostinger Mail API token is too short");
diff --git a/lib/infra/openai-app-integration.test.ts b/lib/infra/openai-app-integration.test.ts
new file mode 100644
index 00000000..cd2938d6
--- /dev/null
+++ b/lib/infra/openai-app-integration.test.ts
@@ -0,0 +1,26 @@
+import { describe, expect, it } from "vitest";
+import { getInfraProviderDefinition, normalizeInfraValues } from "./catalog";
+import { doctorAdditionalProvider } from "./additional-doctor";
+import { connectionMethods } from "./connection-registry";
+
+describe("OpenAI registered app integration", () => {
+ it("is a private direct Integrations provider", () => {
+ const def=getInfraProviderDefinition("openai-app");
+ expect(def.fields).toEqual(expect.arrayContaining([
+ expect.objectContaining({key:"appId",secret:true,required:true}),
+ expect.objectContaining({key:"versionId",secret:true,required:false}),
+ ]));
+ expect(connectionMethods("openai-app","direct")[0].guidance.steps.join(" ")).toContain("App ID");
+ });
+
+ it("normalizes browser plugin ids and keeps version ids separate", () => {
+ expect(normalizeInfraValues("openai-app",{appId:"plugin_asdk_app_example123",versionId:"asdk_app_v_example456"})).toEqual({
+ appId:"asdk_app_example123",versionId:"asdk_app_v_example456",
+ });
+ expect(()=>normalizeInfraValues("openai-app",{appId:"asdk_app_v_wrong"})).toThrow();
+ });
+
+ it("verifies only local identifier format without claiming remote review state", async () => {
+ await expect(doctorAdditionalProvider("openai-app",{appId:"asdk_app_example123"})).resolves.toContain("ChatGPT remains authoritative");
+ });
+});
diff --git a/lib/infra/types.ts b/lib/infra/types.ts
index 91f93fea..dfc43f9c 100644
--- a/lib/infra/types.ts
+++ b/lib/infra/types.ts
@@ -1,4 +1,4 @@
-export const INFRA_PROVIDER_IDS = ["dokploy", "cloudflare", "hostinger", "composio", "github", "vercel", "convex-cloud", "convex", "resend", "stripe", "clerk", "supabase", "doku", "mcp"] as const;
+export const INFRA_PROVIDER_IDS = ["dokploy", "cloudflare", "hostinger", "composio", "github", "vercel", "convex-cloud", "convex", "resend", "stripe", "clerk", "supabase", "doku", "mcp", "openai-app"] as const;
export type InfraProviderId = (typeof INFRA_PROVIDER_IDS)[number];
export type InfraProviderValues = Record<string, string>;
diff --git a/lib/plugins/openai-app-binding.test.ts b/lib/plugins/openai-app-binding.test.ts
index 180f9d0c..d38777ce 100644
--- a/lib/plugins/openai-app-binding.test.ts
+++ b/lib/plugins/openai-app-binding.test.ts
@@ -3,7 +3,7 @@ import { isOpenAiAppBindingId, validateOpenAiAppManifest } from "./openai-app-bi
describe("OpenAI app binding compatibility", () => {
it.each([
- "asdk_app_6a834fa9d250819197e75b23fe1223da",
+ "asdk_app_private_fixture_123",
"connector_76869538009648d5b282a4bb21c3d157",
"connector_openai_plugin_management",
"templated_apps_example_connector-v2",
@@ -12,7 +12,7 @@ describe("OpenAI app binding compatibility", () => {
});
it.each([
- "plugin_asdk_app_6a834fa9d250819197e75b23fe1223da",
+ "plugin_asdk_app_private_fixture_123",
"unknown_abc123",
"asdk_app_",
"connector_bad value",
diff --git a/package.json b/package.json
index fab8e0b5..6c34c703 100644
--- a/package.json
+++ b/package.json
@@ -27,6 +27,7 @@
"skill:new": "node scripts/create-skill-flow.mjs",
"skill:check": "bun scripts/check-skill-flows.mjs",
"plugin:link-app": "node scripts/link-openai-app.mjs",
+ "plugin:stage-private": "node scripts/stage-openai-plugin.mjs",
"comparison": "node scripts/gen-comparison.mjs",
"bench:cognitive": "bun scripts/bench-cognitive-runtime.mjs",
"bench:memory": "bun scripts/bench-memory-retrieval.mjs",
diff --git a/scripts/link-openai-app.mjs b/scripts/link-openai-app.mjs
index 91d9f253..f1201484 100755
--- a/scripts/link-openai-app.mjs
+++ b/scripts/link-openai-app.mjs
@@ -1,20 +1,61 @@
#!/usr/bin/env node
-import { promises as fs } from "node:fs";
+import { constants, promises as fs } from "node:fs";
+import os from "node:os";
import path from "node:path";
const repo=path.resolve(path.dirname(new URL(import.meta.url).pathname),"..");
-const target=path.join(repo,".app.json");
const args=process.argv.slice(2);
-const fail=(message)=>{console.error(`openai-app: ${message}`);process.exit(2)};
+const fail=(message)=>{console.error("openai-app: "+message);process.exit(2)};
+const normalize=(raw)=>String(raw??"").trim().replace(/^plugin_(?=asdk_app_)/,"");
+const canonicalApp=(raw)=>{
+ const id=normalize(raw);
+ if(!/^asdk_app_[A-Za-z0-9][A-Za-z0-9_-]*$/.test(id)) fail("expected a registered OpenAI app id (asdk_app_… or plugin_asdk_app_… browser form)");
+ return id;
+};
+const canonicalBinding=(raw)=>{
+ const id=normalize(raw);
+ if(!/^(?:asdk_app_|connector_|templated_apps_)[A-Za-z0-9][A-Za-z0-9_-]*$/.test(id)) fail("expected an exact canonical OpenAI app/connector id");
+ return id;
+};
+const option=(name)=>{
+ const i=args.indexOf(name);
+ return i>=0?args[i+1]:undefined;
+};
+const target=path.resolve(option("--output")??path.join(repo,".app.json"));
+const store=path.resolve(process.env.OS_INFRA_STORE??path.join(os.homedir(),".mso","private","infra-providers.json"));
+
+async function privateAppId(){
+ let handle;
+ try{
+ handle=await fs.open(store,constants.O_RDONLY|constants.O_NOFOLLOW);
+ const st=await handle.stat();
+ if(!st.isFile()||st.size<1||st.size>1024*1024||(st.mode&0o077)||(typeof process.getuid==="function"&&st.uid!==process.getuid()))fail("Integrations store is missing or unsafe");
+ const state=JSON.parse(await handle.readFile("utf8"));
+ if(state?.version!==2||!state?.users||typeof state.users!=="object")fail("Integrations store is not v2");
+ const user=option("--user")??process.env.MSO_OPENAI_APP_USER??state.defaultUser;
+ if(!user||!state.users[user])fail("choose an Integrations user with --user or MSO_OPENAI_APP_USER");
+ const rows=state.users[user].connections?.["openai-app"]??{};
+ const connection=option("--connection")??process.env.MSO_OPENAI_APP_CONNECTION??state.users[user].defaults?.["openai-app"]??(Object.keys(rows).length===1?Object.keys(rows)[0]:undefined);
+ if(!connection||!rows[connection])fail("choose an OpenAI App Integrations connection with --connection or MSO_OPENAI_APP_CONNECTION");
+ const appId=rows[connection].values?.appId;
+ if(!appId)fail("selected OpenAI App integration has no stored App ID");
+ return canonicalApp(appId);
+ }catch(error){
+ if(error?.code==="ENOENT")fail("private Integrations store not found; configure OpenAI / ChatGPT App in MSO Integrations first");
+ throw error;
+ }finally{await handle?.close();}
+}
+
if(args.includes("--clear")){
- await fs.writeFile(target,JSON.stringify({apps:{}},null,2)+"\n");
+ await fs.mkdir(path.dirname(target),{recursive:true,mode:0o700});
+ await fs.writeFile(target,JSON.stringify({apps:{}},null,2)+"\n",{mode:0o600});
console.log("openai-app: cleared registered app mapping; live MCP authorization is unchanged");
process.exit(0);
}
-const raw=args[0]?.trim();
-if(!raw) fail("usage: bun run plugin:link-app -- <asdk_app...|connector_...|templated_apps_...> | --clear");
-const id=raw.startsWith("plugin_asdk_app_")?raw.slice("plugin_".length):raw;
-if(!/^(?:asdk_app_|connector_|templated_apps_)[A-Za-z0-9][A-Za-z0-9_-]*$/.test(id))
- fail("expected an exact canonical OpenAI app/connector id; placeholders and URLs are rejected");
-await fs.writeFile(target,JSON.stringify({apps:{mso:{id,required:true}}},null,2)+"\n");
-console.log(`openai-app: linked mso -> ${id}${raw===id?"":" (normalized from plugin URL id)"}`);
+
+const optionValues=new Set([option("--output"),option("--user"),option("--connection")].filter(Boolean));
+const explicit=args.find(v=>!v.startsWith("--")&&!optionValues.has(v));
+const id=explicit?canonicalBinding(explicit):await privateAppId();
+await fs.mkdir(path.dirname(target),{recursive:true,mode:0o700});
+await fs.writeFile(target,JSON.stringify({apps:{mso:{id,required:true}}},null,2)+"\n",{mode:0o600});
+console.log("openai-app: linked mso from "+(explicit?"explicit input":"private Integrations binding")+"; id redacted");
diff --git a/scripts/link-openai-app.test.ts b/scripts/link-openai-app.test.ts
index 208137d3..269ad396 100644
--- a/scripts/link-openai-app.test.ts
+++ b/scripts/link-openai-app.test.ts
@@ -1,5 +1,5 @@
import { afterEach, describe, expect, it } from "vitest";
-import { copyFile, mkdtemp, mkdir, readFile, rm } from "node:fs/promises";
+import { chmod, copyFile, mkdtemp, mkdir, readFile, rm, writeFile } from "node:fs/promises";
import { execFileSync } from "node:child_process";
import os from "node:os";
import path from "node:path";
@@ -50,4 +50,24 @@ describe("link-openai-app", () => {
expect(() => execFileSync(process.execPath, [script, input], { encoding: "utf8", stdio: "pipe" })).toThrow();
},
);
+ it("loads the app id from the owner-private Integrations store without printing it", async () => {
+ const { root, script } = await fixture();
+ const privateRoot = await mkdtemp(path.join(os.tmpdir(), "mso-openai-private-"));
+ roots.push(privateRoot);
+ const store=path.join(privateRoot,"infra-providers.json");
+ const appId="asdk_app_privatefixture123";
+ await writeFile(store, JSON.stringify({
+ version:2, instanceId:"fixture", defaultUser:"alice", bindings:[],
+ users:{alice:{id:"alice",uid:"u",label:"Alice",defaults:{"openai-app":"personal"},connections:{"openai-app":{personal:{
+ id:"personal",uid:"c",label:"Personal",provider:"openai-app",source:"direct",authMethod:"direct",scope:"account",revision:1,
+ values:{appId},createdAt:1,updatedAt:1
+ }}}}}
+ }), {mode:0o600});
+ await chmod(store,0o600);
+ const stdout=execFileSync(process.execPath,[script],{cwd:root,encoding:"utf8",env:{...process.env,OS_INFRA_STORE:store}});
+ expect(await manifest(root)).toEqual({apps:{mso:{id:appId,required:true}}});
+ expect(stdout).not.toContain(appId);
+ expect(stdout).toContain("id redacted");
+ });
+
});
diff --git a/scripts/stage-openai-plugin.mjs b/scripts/stage-openai-plugin.mjs
new file mode 100755
index 00000000..33577496
--- /dev/null
+++ b/scripts/stage-openai-plugin.mjs
@@ -0,0 +1,27 @@
+#!/usr/bin/env node
+import { promises as fs } from "node:fs";
+import os from "node:os";
+import path from "node:path";
+import { spawnSync } from "node:child_process";
+
+const repo=path.resolve(path.dirname(new URL(import.meta.url).pathname),"..");
+const stage=path.resolve(process.env.MSO_OPENAI_PLUGIN_STAGE??path.join(os.homedir(),".mso","private","plugin-packages","mso"));
+const temp=stage+".tmp-"+process.pid;
+await fs.rm(temp,{recursive:true,force:true});
+await fs.mkdir(temp,{recursive:true,mode:0o700});
+for(const entry of [".codex-plugin","claude-skills"]){
+ await fs.cp(path.join(repo,entry),path.join(temp,entry),{recursive:true,errorOnExist:false,force:true});
+}
+const linker=spawnSync(process.execPath,[path.join(repo,"scripts","link-openai-app.mjs"),"--output",path.join(temp,".app.json")],{
+ cwd:repo,stdio:["ignore","pipe","pipe"],encoding:"utf8",env:process.env,
+});
+if(linker.status!==0){
+ await fs.rm(temp,{recursive:true,force:true});
+ process.stderr.write(linker.stderr||"openai-app: private plugin staging failed\n");
+ process.exit(linker.status??2);
+}
+await fs.rm(stage,{recursive:true,force:true});
+await fs.mkdir(path.dirname(stage),{recursive:true,mode:0o700});
+await fs.rename(temp,stage);
+await fs.chmod(stage,0o700);
+console.log("openai-app: private plugin package staged at "+stage+"; App ID is redacted and the source repository was not modified");