everything-dev 2.0.0-rc.7 → 2.0.0-rc.9
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/dist/api/auth-middleware.cjs +14 -1
- package/dist/api/auth-middleware.cjs.map +1 -1
- package/dist/api/auth-middleware.d.cts +9 -0
- package/dist/api/auth-middleware.d.mts +9 -0
- package/dist/api/auth-middleware.mjs +14 -1
- package/dist/api/auth-middleware.mjs.map +1 -1
- package/dist/apps/upload/src/client.cjs +7 -1
- package/dist/apps/upload/src/client.cjs.map +1 -1
- package/dist/apps/upload/src/client.mjs +7 -1
- package/dist/apps/upload/src/client.mjs.map +1 -1
- package/dist/auth-login.cjs +24 -1
- package/dist/auth-login.cjs.map +1 -1
- package/dist/auth-login.mjs +24 -1
- package/dist/auth-login.mjs.map +1 -1
- package/dist/auth-session.cjs +4 -2
- package/dist/auth-session.cjs.map +1 -1
- package/dist/auth-session.mjs +4 -2
- package/dist/auth-session.mjs.map +1 -1
- package/dist/cdn-deploy.cjs +11 -7
- package/dist/cdn-deploy.cjs.map +1 -1
- package/dist/cdn-deploy.mjs +11 -7
- package/dist/cdn-deploy.mjs.map +1 -1
- package/dist/cli/import.cjs +1140 -0
- package/dist/cli/import.cjs.map +1 -0
- package/dist/cli/import.mjs +1126 -0
- package/dist/cli/import.mjs.map +1 -0
- package/dist/cli/init.cjs +33 -14
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.d.cts +8 -2
- package/dist/cli/init.d.mts +8 -2
- package/dist/cli/init.mjs +33 -15
- package/dist/cli/init.mjs.map +1 -1
- package/dist/cli.cjs +59 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +59 -3
- package/dist/cli.mjs.map +1 -1
- package/dist/commands/import.cjs +49 -0
- package/dist/commands/import.cjs.map +1 -0
- package/dist/commands/import.mjs +46 -0
- package/dist/commands/import.mjs.map +1 -0
- package/dist/commands/keys.cjs +25 -4
- package/dist/commands/keys.cjs.map +1 -1
- package/dist/commands/keys.mjs +25 -4
- package/dist/commands/keys.mjs.map +1 -1
- package/dist/config.d.cts +1 -0
- package/dist/config.d.mts +1 -0
- package/dist/contract.cjs +89 -0
- package/dist/contract.cjs.map +1 -1
- package/dist/contract.d.cts +190 -1
- package/dist/contract.d.mts +190 -1
- package/dist/contract.meta.cjs +17 -1
- package/dist/contract.meta.cjs.map +1 -1
- package/dist/contract.meta.d.cts +27 -1
- package/dist/contract.meta.d.mts +27 -1
- package/dist/contract.meta.mjs +17 -1
- package/dist/contract.meta.mjs.map +1 -1
- package/dist/contract.mjs +84 -1
- package/dist/contract.mjs.map +1 -1
- package/dist/custody-signer.cjs +70 -0
- package/dist/custody-signer.cjs.map +1 -0
- package/dist/custody-signer.mjs +68 -0
- package/dist/custody-signer.mjs.map +1 -0
- package/dist/db/core.cjs +22 -4
- package/dist/db/core.cjs.map +1 -1
- package/dist/db/core.mjs +22 -4
- package/dist/db/core.mjs.map +1 -1
- package/dist/descriptor/schema.cjs +8 -5
- package/dist/descriptor/schema.cjs.map +1 -1
- package/dist/descriptor/schema.d.cts +1 -0
- package/dist/descriptor/schema.d.mts +1 -0
- package/dist/descriptor/schema.mjs +8 -5
- package/dist/descriptor/schema.mjs.map +1 -1
- package/dist/descriptor/serialize.cjs +1 -1
- package/dist/descriptor/serialize.cjs.map +1 -1
- package/dist/descriptor/serialize.mjs +1 -1
- package/dist/descriptor/serialize.mjs.map +1 -1
- package/dist/http-client.cjs +14 -4
- package/dist/http-client.cjs.map +1 -1
- package/dist/http-client.mjs +14 -4
- package/dist/http-client.mjs.map +1 -1
- package/dist/index.cjs +6 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/infra/planner.cjs +6 -2
- package/dist/infra/planner.cjs.map +1 -1
- package/dist/infra/planner.mjs +6 -2
- package/dist/infra/planner.mjs.map +1 -1
- package/dist/outlayer-login.cjs +54 -0
- package/dist/outlayer-login.cjs.map +1 -0
- package/dist/outlayer-login.mjs +54 -0
- package/dist/outlayer-login.mjs.map +1 -0
- package/dist/plugin.cjs +2 -0
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +74 -0
- package/dist/plugin.d.mts +74 -0
- package/dist/plugin.mjs +2 -0
- package/dist/plugin.mjs.map +1 -1
- package/dist/publish.cjs +145 -22
- package/dist/publish.cjs.map +1 -1
- package/dist/publish.mjs +147 -24
- package/dist/publish.mjs.map +1 -1
- package/dist/source-archive.cjs +51 -0
- package/dist/source-archive.cjs.map +1 -0
- package/dist/source-archive.mjs +50 -0
- package/dist/source-archive.mjs.map +1 -0
- package/dist/storage-upload.cjs +6 -1
- package/dist/storage-upload.cjs.map +1 -1
- package/dist/storage-upload.mjs +6 -1
- package/dist/storage-upload.mjs.map +1 -1
- package/dist/types.cjs +5 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +2 -0
- package/dist/types.d.mts +2 -0
- package/dist/types.mjs +5 -1
- package/dist/types.mjs.map +1 -1
- package/dist/ui/auth.d.cts +217 -123
- package/dist/ui/auth.d.mts +217 -123
- package/dist/ui/router-client.cjs +2 -1
- package/dist/ui/router-client.cjs.map +1 -1
- package/dist/ui/router-client.mjs +2 -1
- package/dist/ui/router-client.mjs.map +1 -1
- package/dist/utils/workspace-subtree.cjs +37 -0
- package/dist/utils/workspace-subtree.cjs.map +1 -0
- package/dist/utils/workspace-subtree.mjs +36 -0
- package/dist/utils/workspace-subtree.mjs.map +1 -0
- package/dist/version-manifest-deploy.cjs +4 -2
- package/dist/version-manifest-deploy.cjs.map +1 -1
- package/dist/version-manifest-deploy.mjs +4 -2
- package/dist/version-manifest-deploy.mjs.map +1 -1
- package/dist/version-manifest-resolve.cjs +2 -1
- package/dist/version-manifest-resolve.cjs.map +1 -1
- package/dist/version-manifest-resolve.d.cts +3 -0
- package/dist/version-manifest-resolve.d.mts +3 -0
- package/dist/version-manifest-resolve.mjs +2 -1
- package/dist/version-manifest-resolve.mjs.map +1 -1
- package/package.json +11 -10
- package/skills/api-and-auth/SKILL.md +12 -9
- package/skills/api-and-auth/references/middleware.md +38 -0
- package/skills/cli-reference/SKILL.md +38 -6
- package/skills/init-upgrade/SKILL.md +76 -3
- package/skills/talk-to-the-app/SKILL.md +32 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outlayer-login.cjs","names":[],"sources":["../src/outlayer-login.ts"],"sourcesContent":["import { execa } from \"execa\";\nimport type { CustodyWalletRecord } from \"./auth-session\";\n\nexport interface OutlayerCliResult {\n status: \"linked\" | \"cli-missing\" | \"error\";\n network: \"mainnet\" | \"testnet\";\n detail?: string;\n}\n\nexport async function loginOutlayerCli(\n custodyWallet: CustodyWalletRecord,\n env: NodeJS.ProcessEnv = process.env,\n): Promise<OutlayerCliResult> {\n try {\n await execa(\"outlayer\", [\"--version\"], { env, stdio: \"pipe\" });\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") {\n return { status: \"cli-missing\", network: custodyWallet.network };\n }\n return {\n status: \"error\",\n network: custodyWallet.network,\n detail: error instanceof Error ? error.message : \"Unknown error\",\n };\n }\n\n const args =\n custodyWallet.network === \"testnet\"\n ? [\"login\", \"testnet\", \"--wallet-key\", custodyWallet.apiKey]\n : [\"login\", \"--wallet-key\", custodyWallet.apiKey];\n const login = await execa(\"outlayer\", args, { env, stdio: \"pipe\", reject: false });\n if (login.failed) {\n return {\n status: \"error\",\n network: custodyWallet.network,\n detail:\n [login.stderr, login.stdout].filter(Boolean).join(\"\\n\").trim() ||\n \"OutLayer CLI login failed\",\n };\n }\n\n const whoami = await execa(\"outlayer\", [\"whoami\"], { env, stdio: \"pipe\" }).catch(() => null);\n return {\n status: \"linked\",\n network: custodyWallet.network,\n detail: whoami?.stdout.trim(),\n };\n}\n"],"mappings":";;;AASA,eAAsB,iBACpB,eACA,MAAyB,QAAQ,KACL;CAC5B,IAAI;EACF,UAAM,aAAM,YAAY,CAAC,WAAW,GAAG;GAAE;GAAK,OAAO;EAAO,CAAC;CAC/D,SAAS,OAAO;EACd,IAAK,MAAgC,SAAS,UAC5C,OAAO;GAAE,QAAQ;GAAe,SAAS,cAAc;EAAQ;EAEjE,OAAO;GACL,QAAQ;GACR,SAAS,cAAc;GACvB,QAAQ,iBAAiB,QAAQ,MAAM,UAAU;EACnD;CACF;CAEA,MAAM,OACJ,cAAc,YAAY,YACtB;EAAC;EAAS;EAAW;EAAgB,cAAc;CAAM,IACzD;EAAC;EAAS;EAAgB,cAAc;CAAM;CACpD,MAAM,QAAQ,UAAM,aAAM,YAAY,MAAM;EAAE;EAAK,OAAO;EAAQ,QAAQ;CAAM,CAAC;CACjF,IAAI,MAAM,QACR,OAAO;EACL,QAAQ;EACR,SAAS,cAAc;EACvB,QACE,CAAC,MAAM,QAAQ,MAAM,MAAM,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,KAC7D;CACJ;CAGF,MAAM,SAAS,UAAM,aAAM,YAAY,CAAC,QAAQ,GAAG;EAAE;EAAK,OAAO;CAAO,CAAC,CAAC,CAAC,YAAY,IAAI;CAC3F,OAAO;EACL,QAAQ;EACR,SAAS,cAAc;EACvB,QAAQ,QAAQ,OAAO,KAAK;CAC9B;AACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { execa } from "execa";
|
|
2
|
+
|
|
3
|
+
//#region src/outlayer-login.ts
|
|
4
|
+
async function loginOutlayerCli(custodyWallet, env = process.env) {
|
|
5
|
+
try {
|
|
6
|
+
await execa("outlayer", ["--version"], {
|
|
7
|
+
env,
|
|
8
|
+
stdio: "pipe"
|
|
9
|
+
});
|
|
10
|
+
} catch (error) {
|
|
11
|
+
if (error.code === "ENOENT") return {
|
|
12
|
+
status: "cli-missing",
|
|
13
|
+
network: custodyWallet.network
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
status: "error",
|
|
17
|
+
network: custodyWallet.network,
|
|
18
|
+
detail: error instanceof Error ? error.message : "Unknown error"
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const args = custodyWallet.network === "testnet" ? [
|
|
22
|
+
"login",
|
|
23
|
+
"testnet",
|
|
24
|
+
"--wallet-key",
|
|
25
|
+
custodyWallet.apiKey
|
|
26
|
+
] : [
|
|
27
|
+
"login",
|
|
28
|
+
"--wallet-key",
|
|
29
|
+
custodyWallet.apiKey
|
|
30
|
+
];
|
|
31
|
+
const login = await execa("outlayer", args, {
|
|
32
|
+
env,
|
|
33
|
+
stdio: "pipe",
|
|
34
|
+
reject: false
|
|
35
|
+
});
|
|
36
|
+
if (login.failed) return {
|
|
37
|
+
status: "error",
|
|
38
|
+
network: custodyWallet.network,
|
|
39
|
+
detail: [login.stderr, login.stdout].filter(Boolean).join("\n").trim() || "OutLayer CLI login failed"
|
|
40
|
+
};
|
|
41
|
+
const whoami = await execa("outlayer", ["whoami"], {
|
|
42
|
+
env,
|
|
43
|
+
stdio: "pipe"
|
|
44
|
+
}).catch(() => null);
|
|
45
|
+
return {
|
|
46
|
+
status: "linked",
|
|
47
|
+
network: custodyWallet.network,
|
|
48
|
+
detail: whoami?.stdout.trim()
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
export { loginOutlayerCli };
|
|
54
|
+
//# sourceMappingURL=outlayer-login.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outlayer-login.mjs","names":[],"sources":["../src/outlayer-login.ts"],"sourcesContent":["import { execa } from \"execa\";\nimport type { CustodyWalletRecord } from \"./auth-session\";\n\nexport interface OutlayerCliResult {\n status: \"linked\" | \"cli-missing\" | \"error\";\n network: \"mainnet\" | \"testnet\";\n detail?: string;\n}\n\nexport async function loginOutlayerCli(\n custodyWallet: CustodyWalletRecord,\n env: NodeJS.ProcessEnv = process.env,\n): Promise<OutlayerCliResult> {\n try {\n await execa(\"outlayer\", [\"--version\"], { env, stdio: \"pipe\" });\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") {\n return { status: \"cli-missing\", network: custodyWallet.network };\n }\n return {\n status: \"error\",\n network: custodyWallet.network,\n detail: error instanceof Error ? error.message : \"Unknown error\",\n };\n }\n\n const args =\n custodyWallet.network === \"testnet\"\n ? [\"login\", \"testnet\", \"--wallet-key\", custodyWallet.apiKey]\n : [\"login\", \"--wallet-key\", custodyWallet.apiKey];\n const login = await execa(\"outlayer\", args, { env, stdio: \"pipe\", reject: false });\n if (login.failed) {\n return {\n status: \"error\",\n network: custodyWallet.network,\n detail:\n [login.stderr, login.stdout].filter(Boolean).join(\"\\n\").trim() ||\n \"OutLayer CLI login failed\",\n };\n }\n\n const whoami = await execa(\"outlayer\", [\"whoami\"], { env, stdio: \"pipe\" }).catch(() => null);\n return {\n status: \"linked\",\n network: custodyWallet.network,\n detail: whoami?.stdout.trim(),\n };\n}\n"],"mappings":";;;AASA,eAAsB,iBACpB,eACA,MAAyB,QAAQ,KACL;CAC5B,IAAI;EACF,MAAM,MAAM,YAAY,CAAC,WAAW,GAAG;GAAE;GAAK,OAAO;EAAO,CAAC;CAC/D,SAAS,OAAO;EACd,IAAK,MAAgC,SAAS,UAC5C,OAAO;GAAE,QAAQ;GAAe,SAAS,cAAc;EAAQ;EAEjE,OAAO;GACL,QAAQ;GACR,SAAS,cAAc;GACvB,QAAQ,iBAAiB,QAAQ,MAAM,UAAU;EACnD;CACF;CAEA,MAAM,OACJ,cAAc,YAAY,YACtB;EAAC;EAAS;EAAW;EAAgB,cAAc;CAAM,IACzD;EAAC;EAAS;EAAgB,cAAc;CAAM;CACpD,MAAM,QAAQ,MAAM,MAAM,YAAY,MAAM;EAAE;EAAK,OAAO;EAAQ,QAAQ;CAAM,CAAC;CACjF,IAAI,MAAM,QACR,OAAO;EACL,QAAQ;EACR,SAAS,cAAc;EACvB,QACE,CAAC,MAAM,QAAQ,MAAM,MAAM,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,KAC7D;CACJ;CAGF,MAAM,SAAS,MAAM,MAAM,YAAY,CAAC,QAAQ,GAAG;EAAE;EAAK,OAAO;CAAO,CAAC,CAAC,CAAC,YAAY,IAAI;CAC3F,OAAO;EACL,QAAQ;EACR,SAAS,cAAc;EACvB,QAAQ,QAAQ,OAAO,KAAK;CAC9B;AACF"}
|
package/dist/plugin.cjs
CHANGED
|
@@ -12,6 +12,7 @@ const require_deploy = require('./commands/deploy.cjs');
|
|
|
12
12
|
const require_project_env = require('./env/project-env.cjs');
|
|
13
13
|
const require_progress = require('./progress.cjs');
|
|
14
14
|
const require_dev = require('./commands/dev.cjs');
|
|
15
|
+
const require_import = require('./commands/import.cjs');
|
|
15
16
|
const require_init = require('./commands/init.cjs');
|
|
16
17
|
const require_keys = require('./commands/keys.cjs');
|
|
17
18
|
const require_ops = require('./commands/ops.cjs');
|
|
@@ -62,6 +63,7 @@ var plugin_default = (0, every_plugin.createPlugin)({
|
|
|
62
63
|
...require_smoke.registerSmoke(builder),
|
|
63
64
|
...require_keys.registerKeys(builder),
|
|
64
65
|
...require_init.registerInit(builder),
|
|
66
|
+
...require_import.registerImport(builder),
|
|
65
67
|
...require_upgrade.registerUpgrade(builder),
|
|
66
68
|
...require_db.registerDb(builder),
|
|
67
69
|
...require_ops.registerOps(builder)
|
package/dist/plugin.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs","names":["createPlugin","z","bosContract","Effect","openResolution","buildScoped","ProjectEnv","ProjectEnvLive","process","buildScopedContext","Layer","makeDatabaseBindings","makeDrizzleKitLive","p","BosDepsTag","Context","DatabaseBindings","DrizzleKit","registerConfig","registerPlugins","registerDev","registerBuild","registerDeploy","registerSmoke","registerKeys","registerInit","registerUpgrade","registerDb","registerOps"],"sources":["../src/plugin.ts"],"sourcesContent":["import process from \"node:process\";\nimport * as p from \"@clack/prompts\";\nimport { Context, Effect, Layer } from \"effect\";\nimport { buildScoped, buildScopedContext } from \"every-plugin\";\nimport { registerBuild } from \"./commands/build\";\nimport { registerConfig } from \"./commands/config\";\nimport { registerDb } from \"./commands/db\";\nimport { registerDeploy } from \"./commands/deploy\";\nimport { registerDev } from \"./commands/dev\";\nimport { registerInit } from \"./commands/init\";\nimport { registerKeys } from \"./commands/keys\";\nimport { registerOps } from \"./commands/ops\";\nimport { registerPlugins } from \"./commands/plugins\";\nimport { type BosDeps, BosDepsTag } from \"./commands/shared\";\nimport { registerSmoke } from \"./commands/smoke\";\nimport { registerUpgrade } from \"./commands/upgrade\";\nimport { bosContract } from \"./contract\";\nimport { DatabaseBindings, DrizzleKit, makeDatabaseBindings, makeDrizzleKitLive } from \"./db\";\nimport { ProjectEnv, ProjectEnvLive } from \"./env/project-env\";\nimport { openResolution } from \"./resolution/session\";\nimport { createPlugin, z } from \"./sdk\";\n\nexport { resolveRemoteConfigChain } from \"./commands/config\";\nexport type { DevSessionData, StartSummary } from \"./dev-program\";\nexport { type ProgressEvent, pluginEvents } from \"./progress\";\n\nexport default createPlugin({\n variables: z.object({\n configPath: z.string().optional(),\n // The artifact root (cwd-derived) — decoupled from configPath so an\n // explicit boot config (--config-path fixture) validates and loads\n // without redirecting where the CLI writes generated artifacts.\n configDir: z.string().optional(),\n }),\n secrets: z.object({}),\n contract: bosContract,\n initialize: (config, _plugins) =>\n Effect.gen(function* () {\n const session = yield* Effect.promise(() =>\n openResolution({ path: config.variables.configPath }),\n );\n\n const projectEnv = yield* buildScoped(ProjectEnv, ProjectEnvLive);\n const effectContext = yield* Effect.context();\n\n const configDir = config.variables.configDir ?? session?.root ?? process.cwd();\n\n const services = yield* buildScopedContext(\n Layer.mergeAll(\n makeDatabaseBindings({\n projectDir: configDir,\n loadRuntimeConfig: async () => (await session?.buildRuntime()) ?? null,\n loadEnv: () => Effect.runPromiseWith(effectContext)(projectEnv.load(configDir)),\n }),\n makeDrizzleKitLive({\n projectDir: configDir,\n onLog: (message) => p.log.info(message),\n }),\n ),\n );\n\n return Layer.succeed(BosDepsTag, {\n session,\n databaseBindings: Context.get(services, DatabaseBindings),\n drizzleKit: Context.get(services, DrizzleKit),\n } satisfies BosDeps);\n }),\n createRouter: (builder) => ({\n ...registerConfig(builder),\n ...registerPlugins(builder),\n ...registerDev(builder),\n ...registerBuild(builder),\n ...registerDeploy(builder),\n ...registerSmoke(builder),\n ...registerKeys(builder),\n ...registerInit(builder),\n ...registerUpgrade(builder),\n ...registerDb(builder),\n ...registerOps(builder),\n }),\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.cjs","names":["createPlugin","z","bosContract","Effect","openResolution","buildScoped","ProjectEnv","ProjectEnvLive","process","buildScopedContext","Layer","makeDatabaseBindings","makeDrizzleKitLive","p","BosDepsTag","Context","DatabaseBindings","DrizzleKit","registerConfig","registerPlugins","registerDev","registerBuild","registerDeploy","registerSmoke","registerKeys","registerInit","registerImport","registerUpgrade","registerDb","registerOps"],"sources":["../src/plugin.ts"],"sourcesContent":["import process from \"node:process\";\nimport * as p from \"@clack/prompts\";\nimport { Context, Effect, Layer } from \"effect\";\nimport { buildScoped, buildScopedContext } from \"every-plugin\";\nimport { registerBuild } from \"./commands/build\";\nimport { registerConfig } from \"./commands/config\";\nimport { registerDb } from \"./commands/db\";\nimport { registerDeploy } from \"./commands/deploy\";\nimport { registerDev } from \"./commands/dev\";\nimport { registerImport } from \"./commands/import\";\nimport { registerInit } from \"./commands/init\";\nimport { registerKeys } from \"./commands/keys\";\nimport { registerOps } from \"./commands/ops\";\nimport { registerPlugins } from \"./commands/plugins\";\nimport { type BosDeps, BosDepsTag } from \"./commands/shared\";\nimport { registerSmoke } from \"./commands/smoke\";\nimport { registerUpgrade } from \"./commands/upgrade\";\nimport { bosContract } from \"./contract\";\nimport { DatabaseBindings, DrizzleKit, makeDatabaseBindings, makeDrizzleKitLive } from \"./db\";\nimport { ProjectEnv, ProjectEnvLive } from \"./env/project-env\";\nimport { openResolution } from \"./resolution/session\";\nimport { createPlugin, z } from \"./sdk\";\n\nexport { resolveRemoteConfigChain } from \"./commands/config\";\nexport type { DevSessionData, StartSummary } from \"./dev-program\";\nexport { type ProgressEvent, pluginEvents } from \"./progress\";\n\nexport default createPlugin({\n variables: z.object({\n configPath: z.string().optional(),\n // The artifact root (cwd-derived) — decoupled from configPath so an\n // explicit boot config (--config-path fixture) validates and loads\n // without redirecting where the CLI writes generated artifacts.\n configDir: z.string().optional(),\n }),\n secrets: z.object({}),\n contract: bosContract,\n initialize: (config, _plugins) =>\n Effect.gen(function* () {\n const session = yield* Effect.promise(() =>\n openResolution({ path: config.variables.configPath }),\n );\n\n const projectEnv = yield* buildScoped(ProjectEnv, ProjectEnvLive);\n const effectContext = yield* Effect.context();\n\n const configDir = config.variables.configDir ?? session?.root ?? process.cwd();\n\n const services = yield* buildScopedContext(\n Layer.mergeAll(\n makeDatabaseBindings({\n projectDir: configDir,\n loadRuntimeConfig: async () => (await session?.buildRuntime()) ?? null,\n loadEnv: () => Effect.runPromiseWith(effectContext)(projectEnv.load(configDir)),\n }),\n makeDrizzleKitLive({\n projectDir: configDir,\n onLog: (message) => p.log.info(message),\n }),\n ),\n );\n\n return Layer.succeed(BosDepsTag, {\n session,\n databaseBindings: Context.get(services, DatabaseBindings),\n drizzleKit: Context.get(services, DrizzleKit),\n } satisfies BosDeps);\n }),\n createRouter: (builder) => ({\n ...registerConfig(builder),\n ...registerPlugins(builder),\n ...registerDev(builder),\n ...registerBuild(builder),\n ...registerDeploy(builder),\n ...registerSmoke(builder),\n ...registerKeys(builder),\n ...registerInit(builder),\n ...registerImport(builder),\n ...registerUpgrade(builder),\n ...registerDb(builder),\n ...registerOps(builder),\n }),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,yBAAeA,2BAAa;CAC1B,WAAWC,MAAE,OAAO;EAClB,YAAYA,MAAE,OAAO,CAAC,CAAC,SAAS;EAIhC,WAAWA,MAAE,OAAO,CAAC,CAAC,SAAS;CACjC,CAAC;CACD,SAASA,MAAE,OAAO,CAAC,CAAC;CACpB,UAAUC;CACV,aAAa,QAAQ,aACnBC,cAAO,IAAI,aAAa;EACtB,MAAM,UAAU,OAAOA,cAAO,cAC5BC,0CAAe,EAAE,MAAM,OAAO,UAAU,WAAW,CAAC,CACtD;EAEA,MAAM,aAAa,WAAOC,0BAAYC,gCAAYC,kCAAc;EAChE,MAAM,gBAAgB,OAAOJ,cAAO,QAAQ;EAE5C,MAAM,YAAY,OAAO,UAAU,aAAa,SAAS,QAAQK,qBAAQ,IAAI;EAE7E,MAAM,WAAW,WAAOC,iCACtBC,aAAM,SACJC,sCAAqB;GACnB,YAAY;GACZ,mBAAmB,YAAa,MAAM,SAAS,aAAa,KAAM;GAClE,eAAeR,cAAO,eAAe,aAAa,CAAC,CAAC,WAAW,KAAK,SAAS,CAAC;EAChF,CAAC,GACDS,uCAAmB;GACjB,YAAY;GACZ,QAAQ,YAAYC,eAAE,IAAI,KAAK,OAAO;EACxC,CAAC,CACH,CACF;EAEA,OAAOH,aAAM,QAAQI,2BAAY;GAC/B;GACA,kBAAkBC,eAAQ,IAAI,UAAUC,iCAAgB;GACxD,YAAYD,eAAQ,IAAI,UAAUE,8BAAU;EAC9C,CAAmB;CACrB,CAAC;CACH,eAAe,aAAa;EAC1B,GAAGC,8BAAe,OAAO;EACzB,GAAGC,gCAAgB,OAAO;EAC1B,GAAGC,wBAAY,OAAO;EACtB,GAAGC,4BAAc,OAAO;EACxB,GAAGC,8BAAe,OAAO;EACzB,GAAGC,4BAAc,OAAO;EACxB,GAAGC,0BAAa,OAAO;EACvB,GAAGC,0BAAa,OAAO;EACvB,GAAGC,8BAAe,OAAO;EACzB,GAAGC,gCAAgB,OAAO;EAC1B,GAAGC,sBAAW,OAAO;EACrB,GAAGC,wBAAY,OAAO;CACxB;AACF,CAAC"}
|
package/dist/plugin.d.cts
CHANGED
|
@@ -109,6 +109,7 @@ declare const _default: import("every-plugin").LoadedPluginWithBinding<{
|
|
|
109
109
|
key: "key";
|
|
110
110
|
session: "session";
|
|
111
111
|
}>>;
|
|
112
|
+
sourcePublish: z.ZodOptional<z.ZodBoolean>;
|
|
112
113
|
}, z.core.$strip>>;
|
|
113
114
|
ci: z.ZodOptional<z.ZodObject<{
|
|
114
115
|
image: z.ZodOptional<z.ZodString>;
|
|
@@ -548,6 +549,7 @@ declare const _default: import("every-plugin").LoadedPluginWithBinding<{
|
|
|
548
549
|
}, z.core.$strip>, object>;
|
|
549
550
|
login: import("@orpc/contract").ProcedureContract<z.ZodObject<{
|
|
550
551
|
key: z.ZodDefault<z.ZodBoolean>;
|
|
552
|
+
custody: z.ZodDefault<z.ZodBoolean>;
|
|
551
553
|
site: z.ZodOptional<z.ZodString>;
|
|
552
554
|
expiresIn: z.ZodDefault<z.ZodNumber>;
|
|
553
555
|
device: z.ZodOptional<z.ZodString>;
|
|
@@ -574,6 +576,27 @@ declare const _default: import("every-plugin").LoadedPluginWithBinding<{
|
|
|
574
576
|
contract: z.ZodString;
|
|
575
577
|
exportedTo: z.ZodString;
|
|
576
578
|
}, z.core.$strip>>>;
|
|
579
|
+
custodyWallet: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
580
|
+
walletId: z.ZodString;
|
|
581
|
+
nearAccountId: z.ZodString;
|
|
582
|
+
network: z.ZodEnum<{
|
|
583
|
+
mainnet: "mainnet";
|
|
584
|
+
testnet: "testnet";
|
|
585
|
+
}>;
|
|
586
|
+
handoffUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
587
|
+
}, z.core.$strip>>>;
|
|
588
|
+
outlayerCli: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
589
|
+
status: z.ZodEnum<{
|
|
590
|
+
"cli-missing": "cli-missing";
|
|
591
|
+
error: "error";
|
|
592
|
+
linked: "linked";
|
|
593
|
+
}>;
|
|
594
|
+
network: z.ZodEnum<{
|
|
595
|
+
mainnet: "mainnet";
|
|
596
|
+
testnet: "testnet";
|
|
597
|
+
}>;
|
|
598
|
+
detail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
599
|
+
}, z.core.$strip>>>;
|
|
577
600
|
warning: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
578
601
|
error: z.ZodOptional<z.ZodString>;
|
|
579
602
|
}, z.core.$strip>, object>;
|
|
@@ -653,6 +676,57 @@ declare const _default: import("every-plugin").LoadedPluginWithBinding<{
|
|
|
653
676
|
backupDir: z.ZodOptional<z.ZodString>;
|
|
654
677
|
error: z.ZodOptional<z.ZodString>;
|
|
655
678
|
}, z.core.$strip>, object>;
|
|
679
|
+
import: import("@orpc/contract").ProcedureContract<z.ZodObject<{
|
|
680
|
+
workspace: z.ZodString;
|
|
681
|
+
from: z.ZodOptional<z.ZodString>;
|
|
682
|
+
yes: z.ZodDefault<z.ZodBoolean>;
|
|
683
|
+
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
684
|
+
noInstall: z.ZodDefault<z.ZodBoolean>;
|
|
685
|
+
json: z.ZodDefault<z.ZodBoolean>;
|
|
686
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
687
|
+
status: z.ZodEnum<{
|
|
688
|
+
conflicts: "conflicts";
|
|
689
|
+
"dry-run": "dry-run";
|
|
690
|
+
error: "error";
|
|
691
|
+
imported: "imported";
|
|
692
|
+
}>;
|
|
693
|
+
workspace: z.ZodString;
|
|
694
|
+
from: z.ZodString;
|
|
695
|
+
ref: z.ZodString;
|
|
696
|
+
resolvedSha: z.ZodOptional<z.ZodString>;
|
|
697
|
+
sourceRepository: z.ZodOptional<z.ZodString>;
|
|
698
|
+
warnings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
699
|
+
added: z.ZodArray<z.ZodString>;
|
|
700
|
+
updated: z.ZodArray<z.ZodString>;
|
|
701
|
+
unchanged: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
702
|
+
preservedLocal: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
703
|
+
merged: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
704
|
+
conflicts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
705
|
+
heldBackMigrations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
706
|
+
routeDelta: z.ZodOptional<z.ZodObject<{
|
|
707
|
+
oursOnly: z.ZodArray<z.ZodString>;
|
|
708
|
+
theirsOnly: z.ZodArray<z.ZodString>;
|
|
709
|
+
}, z.core.$strip>>;
|
|
710
|
+
migrationCollisions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
711
|
+
kind: z.ZodLiteral<"tag-mismatch">;
|
|
712
|
+
idx: z.ZodNumber;
|
|
713
|
+
localTag: z.ZodOptional<z.ZodString>;
|
|
714
|
+
upstreamTag: z.ZodOptional<z.ZodString>;
|
|
715
|
+
message: z.ZodString;
|
|
716
|
+
}, z.core.$strip>>>;
|
|
717
|
+
migrationReconciliation: z.ZodOptional<z.ZodObject<{
|
|
718
|
+
kept: z.ZodArray<z.ZodString>;
|
|
719
|
+
appended: z.ZodArray<z.ZodObject<{
|
|
720
|
+
idx: z.ZodNumber;
|
|
721
|
+
fromTag: z.ZodString;
|
|
722
|
+
toTag: z.ZodString;
|
|
723
|
+
}, z.core.$strip>>;
|
|
724
|
+
contentMatched: z.ZodArray<z.ZodString>;
|
|
725
|
+
}, z.core.$strip>>;
|
|
726
|
+
backupDir: z.ZodOptional<z.ZodString>;
|
|
727
|
+
reportPath: z.ZodOptional<z.ZodString>;
|
|
728
|
+
error: z.ZodOptional<z.ZodString>;
|
|
729
|
+
}, z.core.$strip>, object>;
|
|
656
730
|
upgrade: import("@orpc/contract").ProcedureContract<z.ZodObject<{
|
|
657
731
|
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
658
732
|
noInstall: z.ZodDefault<z.ZodBoolean>;
|
package/dist/plugin.d.mts
CHANGED
|
@@ -109,6 +109,7 @@ declare const _default: import("every-plugin").LoadedPluginWithBinding<{
|
|
|
109
109
|
key: "key";
|
|
110
110
|
session: "session";
|
|
111
111
|
}>>;
|
|
112
|
+
sourcePublish: z.ZodOptional<z.ZodBoolean>;
|
|
112
113
|
}, z.core.$strip>>;
|
|
113
114
|
ci: z.ZodOptional<z.ZodObject<{
|
|
114
115
|
image: z.ZodOptional<z.ZodString>;
|
|
@@ -548,6 +549,7 @@ declare const _default: import("every-plugin").LoadedPluginWithBinding<{
|
|
|
548
549
|
}, z.core.$strip>, object>;
|
|
549
550
|
login: import("@orpc/contract").ProcedureContract<z.ZodObject<{
|
|
550
551
|
key: z.ZodDefault<z.ZodBoolean>;
|
|
552
|
+
custody: z.ZodDefault<z.ZodBoolean>;
|
|
551
553
|
site: z.ZodOptional<z.ZodString>;
|
|
552
554
|
expiresIn: z.ZodDefault<z.ZodNumber>;
|
|
553
555
|
device: z.ZodOptional<z.ZodString>;
|
|
@@ -574,6 +576,27 @@ declare const _default: import("every-plugin").LoadedPluginWithBinding<{
|
|
|
574
576
|
contract: z.ZodString;
|
|
575
577
|
exportedTo: z.ZodString;
|
|
576
578
|
}, z.core.$strip>>>;
|
|
579
|
+
custodyWallet: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
580
|
+
walletId: z.ZodString;
|
|
581
|
+
nearAccountId: z.ZodString;
|
|
582
|
+
network: z.ZodEnum<{
|
|
583
|
+
mainnet: "mainnet";
|
|
584
|
+
testnet: "testnet";
|
|
585
|
+
}>;
|
|
586
|
+
handoffUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
587
|
+
}, z.core.$strip>>>;
|
|
588
|
+
outlayerCli: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
589
|
+
status: z.ZodEnum<{
|
|
590
|
+
"cli-missing": "cli-missing";
|
|
591
|
+
error: "error";
|
|
592
|
+
linked: "linked";
|
|
593
|
+
}>;
|
|
594
|
+
network: z.ZodEnum<{
|
|
595
|
+
mainnet: "mainnet";
|
|
596
|
+
testnet: "testnet";
|
|
597
|
+
}>;
|
|
598
|
+
detail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
599
|
+
}, z.core.$strip>>>;
|
|
577
600
|
warning: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
578
601
|
error: z.ZodOptional<z.ZodString>;
|
|
579
602
|
}, z.core.$strip>, object>;
|
|
@@ -653,6 +676,57 @@ declare const _default: import("every-plugin").LoadedPluginWithBinding<{
|
|
|
653
676
|
backupDir: z.ZodOptional<z.ZodString>;
|
|
654
677
|
error: z.ZodOptional<z.ZodString>;
|
|
655
678
|
}, z.core.$strip>, object>;
|
|
679
|
+
import: import("@orpc/contract").ProcedureContract<z.ZodObject<{
|
|
680
|
+
workspace: z.ZodString;
|
|
681
|
+
from: z.ZodOptional<z.ZodString>;
|
|
682
|
+
yes: z.ZodDefault<z.ZodBoolean>;
|
|
683
|
+
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
684
|
+
noInstall: z.ZodDefault<z.ZodBoolean>;
|
|
685
|
+
json: z.ZodDefault<z.ZodBoolean>;
|
|
686
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
687
|
+
status: z.ZodEnum<{
|
|
688
|
+
conflicts: "conflicts";
|
|
689
|
+
"dry-run": "dry-run";
|
|
690
|
+
error: "error";
|
|
691
|
+
imported: "imported";
|
|
692
|
+
}>;
|
|
693
|
+
workspace: z.ZodString;
|
|
694
|
+
from: z.ZodString;
|
|
695
|
+
ref: z.ZodString;
|
|
696
|
+
resolvedSha: z.ZodOptional<z.ZodString>;
|
|
697
|
+
sourceRepository: z.ZodOptional<z.ZodString>;
|
|
698
|
+
warnings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
699
|
+
added: z.ZodArray<z.ZodString>;
|
|
700
|
+
updated: z.ZodArray<z.ZodString>;
|
|
701
|
+
unchanged: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
702
|
+
preservedLocal: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
703
|
+
merged: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
704
|
+
conflicts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
705
|
+
heldBackMigrations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
706
|
+
routeDelta: z.ZodOptional<z.ZodObject<{
|
|
707
|
+
oursOnly: z.ZodArray<z.ZodString>;
|
|
708
|
+
theirsOnly: z.ZodArray<z.ZodString>;
|
|
709
|
+
}, z.core.$strip>>;
|
|
710
|
+
migrationCollisions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
711
|
+
kind: z.ZodLiteral<"tag-mismatch">;
|
|
712
|
+
idx: z.ZodNumber;
|
|
713
|
+
localTag: z.ZodOptional<z.ZodString>;
|
|
714
|
+
upstreamTag: z.ZodOptional<z.ZodString>;
|
|
715
|
+
message: z.ZodString;
|
|
716
|
+
}, z.core.$strip>>>;
|
|
717
|
+
migrationReconciliation: z.ZodOptional<z.ZodObject<{
|
|
718
|
+
kept: z.ZodArray<z.ZodString>;
|
|
719
|
+
appended: z.ZodArray<z.ZodObject<{
|
|
720
|
+
idx: z.ZodNumber;
|
|
721
|
+
fromTag: z.ZodString;
|
|
722
|
+
toTag: z.ZodString;
|
|
723
|
+
}, z.core.$strip>>;
|
|
724
|
+
contentMatched: z.ZodArray<z.ZodString>;
|
|
725
|
+
}, z.core.$strip>>;
|
|
726
|
+
backupDir: z.ZodOptional<z.ZodString>;
|
|
727
|
+
reportPath: z.ZodOptional<z.ZodString>;
|
|
728
|
+
error: z.ZodOptional<z.ZodString>;
|
|
729
|
+
}, z.core.$strip>, object>;
|
|
656
730
|
upgrade: import("@orpc/contract").ProcedureContract<z.ZodObject<{
|
|
657
731
|
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
658
732
|
noInstall: z.ZodDefault<z.ZodBoolean>;
|
package/dist/plugin.mjs
CHANGED
|
@@ -11,6 +11,7 @@ import { registerDeploy } from "./commands/deploy.mjs";
|
|
|
11
11
|
import { ProjectEnv, ProjectEnvLive } from "./env/project-env.mjs";
|
|
12
12
|
import { pluginEvents } from "./progress.mjs";
|
|
13
13
|
import { registerDev } from "./commands/dev.mjs";
|
|
14
|
+
import { registerImport } from "./commands/import.mjs";
|
|
14
15
|
import { registerInit } from "./commands/init.mjs";
|
|
15
16
|
import { registerKeys } from "./commands/keys.mjs";
|
|
16
17
|
import { registerOps } from "./commands/ops.mjs";
|
|
@@ -58,6 +59,7 @@ var plugin_default = createPlugin({
|
|
|
58
59
|
...registerSmoke(builder),
|
|
59
60
|
...registerKeys(builder),
|
|
60
61
|
...registerInit(builder),
|
|
62
|
+
...registerImport(builder),
|
|
61
63
|
...registerUpgrade(builder),
|
|
62
64
|
...registerDb(builder),
|
|
63
65
|
...registerOps(builder)
|
package/dist/plugin.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.mjs","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import process from \"node:process\";\nimport * as p from \"@clack/prompts\";\nimport { Context, Effect, Layer } from \"effect\";\nimport { buildScoped, buildScopedContext } from \"every-plugin\";\nimport { registerBuild } from \"./commands/build\";\nimport { registerConfig } from \"./commands/config\";\nimport { registerDb } from \"./commands/db\";\nimport { registerDeploy } from \"./commands/deploy\";\nimport { registerDev } from \"./commands/dev\";\nimport { registerInit } from \"./commands/init\";\nimport { registerKeys } from \"./commands/keys\";\nimport { registerOps } from \"./commands/ops\";\nimport { registerPlugins } from \"./commands/plugins\";\nimport { type BosDeps, BosDepsTag } from \"./commands/shared\";\nimport { registerSmoke } from \"./commands/smoke\";\nimport { registerUpgrade } from \"./commands/upgrade\";\nimport { bosContract } from \"./contract\";\nimport { DatabaseBindings, DrizzleKit, makeDatabaseBindings, makeDrizzleKitLive } from \"./db\";\nimport { ProjectEnv, ProjectEnvLive } from \"./env/project-env\";\nimport { openResolution } from \"./resolution/session\";\nimport { createPlugin, z } from \"./sdk\";\n\nexport { resolveRemoteConfigChain } from \"./commands/config\";\nexport type { DevSessionData, StartSummary } from \"./dev-program\";\nexport { type ProgressEvent, pluginEvents } from \"./progress\";\n\nexport default createPlugin({\n variables: z.object({\n configPath: z.string().optional(),\n // The artifact root (cwd-derived) — decoupled from configPath so an\n // explicit boot config (--config-path fixture) validates and loads\n // without redirecting where the CLI writes generated artifacts.\n configDir: z.string().optional(),\n }),\n secrets: z.object({}),\n contract: bosContract,\n initialize: (config, _plugins) =>\n Effect.gen(function* () {\n const session = yield* Effect.promise(() =>\n openResolution({ path: config.variables.configPath }),\n );\n\n const projectEnv = yield* buildScoped(ProjectEnv, ProjectEnvLive);\n const effectContext = yield* Effect.context();\n\n const configDir = config.variables.configDir ?? session?.root ?? process.cwd();\n\n const services = yield* buildScopedContext(\n Layer.mergeAll(\n makeDatabaseBindings({\n projectDir: configDir,\n loadRuntimeConfig: async () => (await session?.buildRuntime()) ?? null,\n loadEnv: () => Effect.runPromiseWith(effectContext)(projectEnv.load(configDir)),\n }),\n makeDrizzleKitLive({\n projectDir: configDir,\n onLog: (message) => p.log.info(message),\n }),\n ),\n );\n\n return Layer.succeed(BosDepsTag, {\n session,\n databaseBindings: Context.get(services, DatabaseBindings),\n drizzleKit: Context.get(services, DrizzleKit),\n } satisfies BosDeps);\n }),\n createRouter: (builder) => ({\n ...registerConfig(builder),\n ...registerPlugins(builder),\n ...registerDev(builder),\n ...registerBuild(builder),\n ...registerDeploy(builder),\n ...registerSmoke(builder),\n ...registerKeys(builder),\n ...registerInit(builder),\n ...registerUpgrade(builder),\n ...registerDb(builder),\n ...registerOps(builder),\n }),\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.mjs","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import process from \"node:process\";\nimport * as p from \"@clack/prompts\";\nimport { Context, Effect, Layer } from \"effect\";\nimport { buildScoped, buildScopedContext } from \"every-plugin\";\nimport { registerBuild } from \"./commands/build\";\nimport { registerConfig } from \"./commands/config\";\nimport { registerDb } from \"./commands/db\";\nimport { registerDeploy } from \"./commands/deploy\";\nimport { registerDev } from \"./commands/dev\";\nimport { registerImport } from \"./commands/import\";\nimport { registerInit } from \"./commands/init\";\nimport { registerKeys } from \"./commands/keys\";\nimport { registerOps } from \"./commands/ops\";\nimport { registerPlugins } from \"./commands/plugins\";\nimport { type BosDeps, BosDepsTag } from \"./commands/shared\";\nimport { registerSmoke } from \"./commands/smoke\";\nimport { registerUpgrade } from \"./commands/upgrade\";\nimport { bosContract } from \"./contract\";\nimport { DatabaseBindings, DrizzleKit, makeDatabaseBindings, makeDrizzleKitLive } from \"./db\";\nimport { ProjectEnv, ProjectEnvLive } from \"./env/project-env\";\nimport { openResolution } from \"./resolution/session\";\nimport { createPlugin, z } from \"./sdk\";\n\nexport { resolveRemoteConfigChain } from \"./commands/config\";\nexport type { DevSessionData, StartSummary } from \"./dev-program\";\nexport { type ProgressEvent, pluginEvents } from \"./progress\";\n\nexport default createPlugin({\n variables: z.object({\n configPath: z.string().optional(),\n // The artifact root (cwd-derived) — decoupled from configPath so an\n // explicit boot config (--config-path fixture) validates and loads\n // without redirecting where the CLI writes generated artifacts.\n configDir: z.string().optional(),\n }),\n secrets: z.object({}),\n contract: bosContract,\n initialize: (config, _plugins) =>\n Effect.gen(function* () {\n const session = yield* Effect.promise(() =>\n openResolution({ path: config.variables.configPath }),\n );\n\n const projectEnv = yield* buildScoped(ProjectEnv, ProjectEnvLive);\n const effectContext = yield* Effect.context();\n\n const configDir = config.variables.configDir ?? session?.root ?? process.cwd();\n\n const services = yield* buildScopedContext(\n Layer.mergeAll(\n makeDatabaseBindings({\n projectDir: configDir,\n loadRuntimeConfig: async () => (await session?.buildRuntime()) ?? null,\n loadEnv: () => Effect.runPromiseWith(effectContext)(projectEnv.load(configDir)),\n }),\n makeDrizzleKitLive({\n projectDir: configDir,\n onLog: (message) => p.log.info(message),\n }),\n ),\n );\n\n return Layer.succeed(BosDepsTag, {\n session,\n databaseBindings: Context.get(services, DatabaseBindings),\n drizzleKit: Context.get(services, DrizzleKit),\n } satisfies BosDeps);\n }),\n createRouter: (builder) => ({\n ...registerConfig(builder),\n ...registerPlugins(builder),\n ...registerDev(builder),\n ...registerBuild(builder),\n ...registerDeploy(builder),\n ...registerSmoke(builder),\n ...registerKeys(builder),\n ...registerInit(builder),\n ...registerImport(builder),\n ...registerUpgrade(builder),\n ...registerDb(builder),\n ...registerOps(builder),\n }),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,qBAAe,aAAa;CAC1B,WAAW,EAAE,OAAO;EAClB,YAAY,EAAE,OAAO,CAAC,CAAC,SAAS;EAIhC,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,CAAC;CACD,SAAS,EAAE,OAAO,CAAC,CAAC;CACpB,UAAU;CACV,aAAa,QAAQ,aACnB,OAAO,IAAI,aAAa;EACtB,MAAM,UAAU,OAAO,OAAO,cAC5B,eAAe,EAAE,MAAM,OAAO,UAAU,WAAW,CAAC,CACtD;EAEA,MAAM,aAAa,OAAO,YAAY,YAAY,cAAc;EAChE,MAAM,gBAAgB,OAAO,OAAO,QAAQ;EAE5C,MAAM,YAAY,OAAO,UAAU,aAAa,SAAS,QAAQ,QAAQ,IAAI;EAE7E,MAAM,WAAW,OAAO,mBACtB,MAAM,SACJ,qBAAqB;GACnB,YAAY;GACZ,mBAAmB,YAAa,MAAM,SAAS,aAAa,KAAM;GAClE,eAAe,OAAO,eAAe,aAAa,CAAC,CAAC,WAAW,KAAK,SAAS,CAAC;EAChF,CAAC,GACD,mBAAmB;GACjB,YAAY;GACZ,QAAQ,YAAY,EAAE,IAAI,KAAK,OAAO;EACxC,CAAC,CACH,CACF;EAEA,OAAO,MAAM,QAAQ,YAAY;GAC/B;GACA,kBAAkB,QAAQ,IAAI,UAAU,gBAAgB;GACxD,YAAY,QAAQ,IAAI,UAAU,UAAU;EAC9C,CAAmB;CACrB,CAAC;CACH,eAAe,aAAa;EAC1B,GAAG,eAAe,OAAO;EACzB,GAAG,gBAAgB,OAAO;EAC1B,GAAG,YAAY,OAAO;EACtB,GAAG,cAAc,OAAO;EACxB,GAAG,eAAe,OAAO;EACzB,GAAG,cAAc,OAAO;EACxB,GAAG,aAAa,OAAO;EACvB,GAAG,aAAa,OAAO;EACvB,GAAG,eAAe,OAAO;EACzB,GAAG,gBAAgB,OAAO;EAC1B,GAAG,WAAW,OAAO;EACrB,GAAG,YAAY,OAAO;CACxB;AACF,CAAC"}
|
package/dist/publish.cjs
CHANGED
|
@@ -5,6 +5,7 @@ const require_fastkv = require('./fastkv.cjs');
|
|
|
5
5
|
const require_network = require('./network.cjs');
|
|
6
6
|
const require_version_manifest_resolve = require('./version-manifest-resolve.cjs');
|
|
7
7
|
const require_config = require('./config.cjs');
|
|
8
|
+
const require_run = require('./utils/run.cjs');
|
|
8
9
|
const require_theme = require('./utils/theme.cjs');
|
|
9
10
|
const require_resolution_session = require('./resolution/session.cjs');
|
|
10
11
|
const require_fingerprint = require('./fingerprint.cjs');
|
|
@@ -15,11 +16,13 @@ const require_build = require('./build.cjs');
|
|
|
15
16
|
const require_code_artifacts = require('./code-artifacts.cjs');
|
|
16
17
|
const require_auth_session = require('./auth-session.cjs');
|
|
17
18
|
const require_cdn_deploy = require('./cdn-deploy.cjs');
|
|
19
|
+
const require_custody_signer = require('./custody-signer.cjs');
|
|
18
20
|
const require_delegate_signer = require('./delegate-signer.cjs');
|
|
19
21
|
const require_rollback = require('./rollback.cjs');
|
|
20
22
|
const require_deploy_diff = require('./deploy-diff.cjs');
|
|
21
23
|
const require_near_signer = require('./near-signer.cjs');
|
|
22
24
|
const require_platform_deploy = require('./platform-deploy.cjs');
|
|
25
|
+
const require_source_archive = require('./source-archive.cjs');
|
|
23
26
|
const require_storage_upload = require('./storage-upload.cjs');
|
|
24
27
|
const require_version_manifest_deploy = require('./version-manifest-deploy.cjs');
|
|
25
28
|
let node_fs = require("node:fs");
|
|
@@ -38,7 +41,9 @@ async function pinWorkspaceVersionManifest(input) {
|
|
|
38
41
|
report: input.report,
|
|
39
42
|
ssrReport: input.ssrReport,
|
|
40
43
|
integrityMap: input.integrityMap,
|
|
41
|
-
...input.files ? { files: input.files } : {}
|
|
44
|
+
...input.files ? { files: input.files } : {},
|
|
45
|
+
...input.source ? { source: input.source } : {},
|
|
46
|
+
...input.gitSha ? { gitSha: input.gitSha } : {}
|
|
42
47
|
});
|
|
43
48
|
if (!versionManifest) return void 0;
|
|
44
49
|
const manifestFile = `versions/${versionManifest.version}.json`;
|
|
@@ -63,6 +68,77 @@ async function pinWorkspaceVersionManifest(input) {
|
|
|
63
68
|
};
|
|
64
69
|
}
|
|
65
70
|
/**
|
|
71
|
+
* Best-effort repo HEAD for the version manifest (`gitSha`): non-git
|
|
72
|
+
* contexts (child bundles built outside a repo) omit the field silently —
|
|
73
|
+
* it never fails the deploy.
|
|
74
|
+
*/
|
|
75
|
+
async function resolveGitSha(cwd) {
|
|
76
|
+
try {
|
|
77
|
+
const result = await require_run.run("git", ["rev-parse", "HEAD"], {
|
|
78
|
+
cwd,
|
|
79
|
+
capture: true
|
|
80
|
+
});
|
|
81
|
+
const sha = result?.stdout.trim();
|
|
82
|
+
return result && result.exitCode === 0 && sha ? sha : void 0;
|
|
83
|
+
} catch {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The source-archive leg (publish.sourcePublish, #406): tar the workspace
|
|
89
|
+
* subtree, dedupe against the previous pin's manifest by archive SRI (reuse
|
|
90
|
+
* skips the upload), otherwise upload and take the **server-computed** SRI
|
|
91
|
+
* (MAP decision 6). The temp archive dir is cleaned up on every path — the
|
|
92
|
+
* manifest only carries `{ file, integrity }`, not the bytes.
|
|
93
|
+
*/
|
|
94
|
+
async function resolveSourceReference(input) {
|
|
95
|
+
const outDir = require_source_archive.makeSourceArchiveTempDir();
|
|
96
|
+
try {
|
|
97
|
+
const archive = await require_source_archive.buildSourceArchive({
|
|
98
|
+
repoRoot: input.repoRoot,
|
|
99
|
+
workspace: input.workspaceDir,
|
|
100
|
+
outDir
|
|
101
|
+
});
|
|
102
|
+
if (input.previousPin) try {
|
|
103
|
+
const resolved = await require_version_manifest_resolve.resolveSlotVersion({
|
|
104
|
+
base: input.base,
|
|
105
|
+
pin: input.previousPin
|
|
106
|
+
});
|
|
107
|
+
if (resolved.source?.integrity === archive.integrity) {
|
|
108
|
+
console.log(` ${require_theme.colors.dim(`${require_string.padRight(input.workspace, 28)} source unchanged — reusing ${archive.file}`)}`);
|
|
109
|
+
return { source: {
|
|
110
|
+
file: resolved.source.file,
|
|
111
|
+
integrity: resolved.source.integrity
|
|
112
|
+
} };
|
|
113
|
+
}
|
|
114
|
+
} catch {}
|
|
115
|
+
const upload = await require_storage_upload.uploadBundle({
|
|
116
|
+
origin: input.origin,
|
|
117
|
+
apiKey: input.apiKey,
|
|
118
|
+
account: input.account,
|
|
119
|
+
gateway: input.gateway,
|
|
120
|
+
workspace: input.workspace,
|
|
121
|
+
files: [{
|
|
122
|
+
path: archive.file,
|
|
123
|
+
bytes: new Uint8Array((0, node_fs.readFileSync)(archive.path))
|
|
124
|
+
}]
|
|
125
|
+
});
|
|
126
|
+
if (upload.storage === "memory") return { memory: true };
|
|
127
|
+
const integrity = upload.integrity[archive.file];
|
|
128
|
+
if (!integrity) throw new Error(`[publish] source archive upload for ${input.workspace}: missing server SRI for ${archive.file}`);
|
|
129
|
+
console.log(` ${require_theme.colors.dim(`${require_string.padRight(input.workspace, 28)} source archive ${archive.file}`)}`);
|
|
130
|
+
return { source: {
|
|
131
|
+
file: archive.file,
|
|
132
|
+
integrity
|
|
133
|
+
} };
|
|
134
|
+
} finally {
|
|
135
|
+
(0, node_fs.rmSync)(outDir, {
|
|
136
|
+
recursive: true,
|
|
137
|
+
force: true
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
66
142
|
* One workspace's upload leg with skip-unchanged diffing: resolve the previous
|
|
67
143
|
* manifest's `files` map, hash the local dist, upload only new/changed files,
|
|
68
144
|
* and return the merged per-file SRI map for the version manifest. Any failure
|
|
@@ -206,8 +282,12 @@ async function preflightPublish(input) {
|
|
|
206
282
|
if (!session?.credential) return fail((input.wallet ? "--wallet requires" : "the authored config sets publish.auth = \"session\", but") + " no CLI session is stored in .bos/ for this project. Run bos login to create one.");
|
|
207
283
|
if (session.credential.accountId && session.credential.accountId !== account) return fail(`The CLI session was created for ${session.credential.accountId}, but the configured account is ${account}. Gasless wallet publish relays the FastKV write under the session's NEAR account. Run bos login again under the matching account.`);
|
|
208
284
|
}
|
|
209
|
-
|
|
210
|
-
|
|
285
|
+
const useCustody = publishAuth === "custody" && !input.privateKey && !input.wallet;
|
|
286
|
+
if (useCustody) {
|
|
287
|
+
const custodyWallet = require_auth_session.readSessionHandle(configDir)?.custodyWallet;
|
|
288
|
+
if (!custodyWallet) return fail("the authored config sets publish.auth = \"custody\", but no custody wallet is stored in .bos/. Run `bos login --custody` first.");
|
|
289
|
+
if (custodyWallet.network !== network) return fail(`The custody wallet was registered on ${custodyWallet.network}, but this project publishes on ${network}. Run \`bos login --custody\` from a ${network} account.`);
|
|
290
|
+
if (custodyWallet.nearAccountId !== account) return fail(`publish.auth = "custody" publishes under the custody wallet's account, but the configured account is ${account} and the custody wallet account is ${custodyWallet.nearAccountId}. Set the authored config's account to the custody wallet account.`);
|
|
211
291
|
}
|
|
212
292
|
if (input.dryRun) return {
|
|
213
293
|
kind: "dry-run",
|
|
@@ -239,6 +319,7 @@ async function preflightPublish(input) {
|
|
|
239
319
|
env: node_process.default.env,
|
|
240
320
|
bosConfig,
|
|
241
321
|
session: session?.credential ?? null,
|
|
322
|
+
custodyAccount: useCustody ? session?.custodyWallet?.nearAccountId : void 0,
|
|
242
323
|
account,
|
|
243
324
|
gateway,
|
|
244
325
|
uploadsPlanned: input.build
|
|
@@ -272,6 +353,7 @@ async function preflightPublish(input) {
|
|
|
272
353
|
registryNamespace: require_fastkv.getRegistryNamespaceForNetwork(network, input.registry),
|
|
273
354
|
targets: require_build.selectWorkspaceTargets(input.packages, bosConfig),
|
|
274
355
|
useWallet,
|
|
356
|
+
useCustody,
|
|
275
357
|
strategy,
|
|
276
358
|
cdnOrigin: cdnDeploy.cdnOrigin,
|
|
277
359
|
storageOrigin: cdnDeploy.storageOrigin,
|
|
@@ -301,7 +383,7 @@ async function publishToFastKv(input) {
|
|
|
301
383
|
registryUrl: preflight.registryUrl
|
|
302
384
|
};
|
|
303
385
|
const plan = preflight.plan;
|
|
304
|
-
const { isStaging, account, gateway, network, registryUrl, registryNamespace, targets, useWallet, strategy } = plan;
|
|
386
|
+
const { isStaging, account, gateway, network, registryUrl, registryNamespace, targets, useWallet, useCustody, strategy } = plan;
|
|
305
387
|
const storageOrigin = plan.storageOrigin;
|
|
306
388
|
const storageApiKey = plan.storageApiKey;
|
|
307
389
|
const { configDir } = input;
|
|
@@ -399,6 +481,16 @@ async function publishToFastKv(input) {
|
|
|
399
481
|
};
|
|
400
482
|
console.log();
|
|
401
483
|
console.log(` CDN deploy — uploading workspace dists to ${storageOrigin}...`);
|
|
484
|
+
const sourcePublish = bosConfig.publish?.sourcePublish === true;
|
|
485
|
+
const gitSha = await resolveGitSha(configDir);
|
|
486
|
+
const memoryBackendAbort = () => ({
|
|
487
|
+
status: "error",
|
|
488
|
+
registryUrl,
|
|
489
|
+
built,
|
|
490
|
+
skipped,
|
|
491
|
+
deployResults,
|
|
492
|
+
error: "The receiving instance is serving bundle storage from memory (BOS_STORAGE_* R2 credentials are not configured there) — uploaded bytes would be lost on restart. Aborting before publish."
|
|
493
|
+
});
|
|
402
494
|
for (const key of deployTargets) {
|
|
403
495
|
const ws = require_build.resolveWorkspaceTarget(key, bosConfig, runtimeConfig, configDir);
|
|
404
496
|
if (!ws) continue;
|
|
@@ -431,6 +523,34 @@ async function publishToFastKv(input) {
|
|
|
431
523
|
const ssrReport = require_version_manifest_deploy.readBuildReport((0, node_path.join)(ws.path, "dist", "ssr"));
|
|
432
524
|
const integrity = report ? outcome.fileIntegrity[report.entry] : void 0;
|
|
433
525
|
const ssrIntegrity = ssrReport?.entry ? outcome.fileIntegrity[`ssr/${ssrReport.entry}`] : void 0;
|
|
526
|
+
let sourceRef;
|
|
527
|
+
if (sourcePublish) {
|
|
528
|
+
if (outcome.result.storage === "memory") return memoryBackendAbort();
|
|
529
|
+
try {
|
|
530
|
+
const sourceOutcome = await resolveSourceReference({
|
|
531
|
+
origin: storageOrigin,
|
|
532
|
+
apiKey: storageApiKey,
|
|
533
|
+
account,
|
|
534
|
+
gateway,
|
|
535
|
+
workspace: key,
|
|
536
|
+
base: workspaceBase,
|
|
537
|
+
previousPin: prevPins[key],
|
|
538
|
+
repoRoot: (0, node_path.dirname)(ws.path),
|
|
539
|
+
workspaceDir: (0, node_path.basename)(ws.path)
|
|
540
|
+
});
|
|
541
|
+
if ("memory" in sourceOutcome) return memoryBackendAbort();
|
|
542
|
+
sourceRef = sourceOutcome.source;
|
|
543
|
+
} catch (error) {
|
|
544
|
+
return {
|
|
545
|
+
status: "error",
|
|
546
|
+
registryUrl,
|
|
547
|
+
built,
|
|
548
|
+
skipped,
|
|
549
|
+
deployResults,
|
|
550
|
+
error: error instanceof Error ? error.message : `[publish] source archive for ${key} failed`
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
}
|
|
434
554
|
const manifestPointer = await pinWorkspaceVersionManifest({
|
|
435
555
|
origin: storageOrigin,
|
|
436
556
|
apiKey: storageApiKey,
|
|
@@ -440,7 +560,9 @@ async function publishToFastKv(input) {
|
|
|
440
560
|
report,
|
|
441
561
|
ssrReport,
|
|
442
562
|
integrityMap: outcome.fileIntegrity,
|
|
443
|
-
files: outcome.fileIntegrity
|
|
563
|
+
files: outcome.fileIntegrity,
|
|
564
|
+
...sourceRef ? { source: sourceRef } : {},
|
|
565
|
+
...gitSha ? { gitSha } : {}
|
|
444
566
|
});
|
|
445
567
|
if (!manifestPointer) return {
|
|
446
568
|
status: "error",
|
|
@@ -450,14 +572,7 @@ async function publishToFastKv(input) {
|
|
|
450
572
|
deployResults,
|
|
451
573
|
error: `bundle upload for ${key}: version manifest missing — the dist predates hashed entry names (rebuild required; atomic-deploys hard break)`
|
|
452
574
|
};
|
|
453
|
-
if (outcome.result.storage === "memory" || manifestPointer.storage === "memory") return
|
|
454
|
-
status: "error",
|
|
455
|
-
registryUrl,
|
|
456
|
-
built,
|
|
457
|
-
skipped,
|
|
458
|
-
deployResults,
|
|
459
|
-
error: "The receiving instance is serving bundle storage from memory (BOS_STORAGE_* R2 credentials are not configured there) — uploaded bytes would be lost on restart. Aborting before publish."
|
|
460
|
-
};
|
|
575
|
+
if (outcome.result.storage === "memory" || manifestPointer.storage === "memory") return memoryBackendAbort();
|
|
461
576
|
console.log(` ${require_theme.colors.green(require_theme.icons.ok)} ${require_string.padRight(key, 28)} → ${urlOrigin}/bundles/${account}/${gateway}/${key}/ (${outcome.uploaded} uploaded, ${outcome.skipped} skipped, ${require_timing.formatDuration(Date.now() - startedAt)})`);
|
|
462
577
|
platformEntries.push(...require_platform_deploy.platformUrlDeployEntries({
|
|
463
578
|
origin: urlOrigin,
|
|
@@ -512,14 +627,7 @@ async function publishToFastKv(input) {
|
|
|
512
627
|
deployResults,
|
|
513
628
|
error: `bundle upload for ${key}-ui: version manifest missing — the dist predates hashed entry names (rebuild required; atomic-deploys hard break)`
|
|
514
629
|
};
|
|
515
|
-
if (uiOutcome.result.storage === "memory" || uiManifestPointer.storage === "memory") return
|
|
516
|
-
status: "error",
|
|
517
|
-
registryUrl,
|
|
518
|
-
built,
|
|
519
|
-
skipped,
|
|
520
|
-
deployResults,
|
|
521
|
-
error: "The receiving instance is serving bundle storage from memory (BOS_STORAGE_* R2 credentials are not configured there) — uploaded bytes would be lost on restart. Aborting before publish."
|
|
522
|
-
};
|
|
630
|
+
if (uiOutcome.result.storage === "memory" || uiManifestPointer.storage === "memory") return memoryBackendAbort();
|
|
523
631
|
console.log(` ${require_theme.colors.green(require_theme.icons.ok)} ${require_string.padRight(`${key}-ui`, 28)} → ${urlOrigin}/bundles/${account}/${gateway}/${key}-ui/ (${uiOutcome.uploaded} uploaded, ${uiOutcome.skipped} skipped, ${require_timing.formatDuration(Date.now() - uiStartedAt)})`);
|
|
524
632
|
} else console.log(` ${require_theme.colors.green(require_theme.icons.ok)} ${require_string.padRight(`${key}-ui`, 28)} → ${urlOrigin}/bundles/${account}/${gateway}/${key}-ui/`);
|
|
525
633
|
platformEntries.push(...require_platform_deploy.pluginUiUrlDeployEntries({
|
|
@@ -618,7 +726,22 @@ async function publishToFastKv(input) {
|
|
|
618
726
|
}
|
|
619
727
|
console.log(` Submitting transaction on ${network}...`);
|
|
620
728
|
let result;
|
|
621
|
-
if (
|
|
729
|
+
if (useCustody) {
|
|
730
|
+
const custodyWallet = require_auth_session.readSessionHandle(configDir)?.custodyWallet;
|
|
731
|
+
if (!custodyWallet) return {
|
|
732
|
+
status: "error",
|
|
733
|
+
registryUrl,
|
|
734
|
+
error: "the authored config sets publish.auth = \"custody\", but no custody wallet is stored in .bos/. Run `bos login --custody` first."
|
|
735
|
+
};
|
|
736
|
+
await require_custody_signer.ensureCustodyBalance(custodyWallet);
|
|
737
|
+
console.log(` Signing via ${require_theme.colors.cyan(`OutLayer custody wallet ${custodyWallet.nearAccountId}`)}`);
|
|
738
|
+
result = await require_custody_signer.submitRegistryWriteCustody({
|
|
739
|
+
contract: registryNamespace,
|
|
740
|
+
args: registryEntries,
|
|
741
|
+
custodyWallet,
|
|
742
|
+
idempotencyKey: `bos-publish-${fingerprint}`
|
|
743
|
+
});
|
|
744
|
+
} else if (useWallet) {
|
|
622
745
|
const credential = require_auth_session.readSessionHandle(configDir)?.credential;
|
|
623
746
|
if (!credential || credential.accountId !== account) return {
|
|
624
747
|
status: "error",
|