everything-dev 2.0.0-rc.6 → 2.0.0-rc.7
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/README.md +2 -2
- package/dist/build.cjs +1 -1
- package/dist/build.mjs +1 -1
- package/dist/bundle-cache.cjs +1 -1
- package/dist/bundle-cache.cjs.map +1 -1
- package/dist/bundle-cache.mjs +1 -1
- package/dist/bundle-cache.mjs.map +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/cli.mjs.map +1 -1
- package/dist/commands/deploy.cjs +111 -1
- package/dist/commands/deploy.cjs.map +1 -1
- package/dist/commands/deploy.mjs +112 -2
- package/dist/commands/deploy.mjs.map +1 -1
- package/dist/commands/smoke.cjs +41 -0
- package/dist/commands/smoke.cjs.map +1 -0
- package/dist/commands/smoke.mjs +41 -0
- package/dist/commands/smoke.mjs.map +1 -0
- package/dist/commands/upgrade.cjs +2 -2
- package/dist/commands/upgrade.cjs.map +1 -1
- package/dist/commands/upgrade.mjs +1 -1
- package/dist/commands/upgrade.mjs.map +1 -1
- package/dist/contract.cjs +27 -1
- package/dist/contract.cjs.map +1 -1
- package/dist/contract.d.cts +65 -1
- package/dist/contract.d.mts +65 -1
- package/dist/contract.meta.cjs +13 -1
- package/dist/contract.meta.cjs.map +1 -1
- package/dist/contract.meta.d.cts +23 -1
- package/dist/contract.meta.d.mts +23 -1
- package/dist/contract.meta.mjs +13 -1
- package/dist/contract.meta.mjs.map +1 -1
- package/dist/contract.mjs +26 -2
- package/dist/contract.mjs.map +1 -1
- package/dist/dev-log-pipeline.cjs +6 -0
- package/dist/dev-log-pipeline.cjs.map +1 -1
- package/dist/dev-log-pipeline.mjs +6 -0
- package/dist/dev-log-pipeline.mjs.map +1 -1
- package/dist/dev-program.cjs +20 -3
- package/dist/dev-program.cjs.map +1 -1
- package/dist/dev-program.mjs +20 -4
- package/dist/dev-program.mjs.map +1 -1
- package/dist/dev-session.cjs +1 -0
- package/dist/dev-session.cjs.map +1 -1
- package/dist/dev-session.mjs +1 -0
- package/dist/dev-session.mjs.map +1 -1
- package/dist/fastkv.cjs +21 -3
- package/dist/fastkv.cjs.map +1 -1
- package/dist/fastkv.d.cts +14 -1
- package/dist/fastkv.d.mts +14 -1
- package/dist/fastkv.mjs +21 -5
- package/dist/fastkv.mjs.map +1 -1
- package/dist/{mf.cjs → federation.cjs} +6 -13
- package/dist/federation.cjs.map +1 -0
- package/dist/{mf.d.cts → federation.d.cts} +2 -2
- package/dist/{mf.d.mts → federation.d.mts} +2 -2
- package/dist/{mf.mjs → federation.mjs} +6 -13
- package/dist/federation.mjs.map +1 -0
- package/dist/http-client.cjs +70 -53
- package/dist/http-client.cjs.map +1 -1
- package/dist/http-client.mjs +70 -54
- package/dist/http-client.mjs.map +1 -1
- package/dist/image-deploy.cjs +9 -0
- package/dist/image-deploy.cjs.map +1 -1
- package/dist/image-deploy.mjs +9 -1
- package/dist/image-deploy.mjs.map +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/orchestrator.cjs +39 -35
- package/dist/orchestrator.cjs.map +1 -1
- package/dist/orchestrator.mjs +39 -35
- package/dist/orchestrator.mjs.map +1 -1
- package/dist/plugin.cjs +2 -0
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +24 -0
- package/dist/plugin.d.mts +24 -0
- package/dist/plugin.mjs +2 -0
- package/dist/plugin.mjs.map +1 -1
- package/dist/process-registry.cjs +1 -1
- package/dist/process-registry.mjs +1 -1
- package/dist/publish.cjs +3 -3
- package/dist/publish.cjs.map +1 -1
- package/dist/publish.mjs +4 -4
- package/dist/publish.mjs.map +1 -1
- package/dist/resolver.cjs +293 -0
- package/dist/resolver.cjs.map +1 -0
- package/dist/resolver.d.cts +99 -0
- package/dist/resolver.d.mts +99 -0
- package/dist/resolver.mjs +284 -0
- package/dist/resolver.mjs.map +1 -0
- package/dist/smoke.cjs +262 -0
- package/dist/smoke.cjs.map +1 -0
- package/dist/smoke.mjs +260 -0
- package/dist/smoke.mjs.map +1 -0
- package/dist/version-manifest-resolve.cjs +3 -3
- package/dist/version-manifest-resolve.cjs.map +1 -1
- package/dist/version-manifest-resolve.mjs +1 -1
- package/dist/version-manifest-resolve.mjs.map +1 -1
- package/dist/workspace.cjs +1 -1
- package/dist/workspace.mjs +1 -1
- package/package.json +9 -9
- package/dist/bundle-fs-resolve.cjs +0 -235
- package/dist/bundle-fs-resolve.cjs.map +0 -1
- package/dist/bundle-fs-resolve.d.cts +0 -82
- package/dist/bundle-fs-resolve.d.mts +0 -82
- package/dist/bundle-fs-resolve.mjs +0 -228
- package/dist/bundle-fs-resolve.mjs.map +0 -1
- package/dist/bundle-path.cjs +0 -48
- package/dist/bundle-path.cjs.map +0 -1
- package/dist/bundle-path.mjs +0 -45
- package/dist/bundle-path.mjs.map +0 -1
- package/dist/mf.cjs.map +0 -1
- package/dist/mf.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ A consolidated product package for building Module Federation apps with oRPC API
|
|
|
7
7
|
- `everything-dev/types` - Zod schemas and TypeScript types
|
|
8
8
|
- `everything-dev/config` - Config loading and resolution
|
|
9
9
|
- `everything-dev/shared` - Shared dependency policy generation
|
|
10
|
-
- `everything-dev/
|
|
10
|
+
- `everything-dev/federation` - Module Federation runtime utilities
|
|
11
11
|
- `everything-dev/plugin` - Plugin authoring (re-exports from every-plugin)
|
|
12
12
|
- `everything-dev/api` - API plugin loading and router stitching
|
|
13
13
|
- `everything-dev/host` - Host server orchestration
|
|
@@ -42,7 +42,7 @@ everything-dev/shared (generate shared deps policy)
|
|
|
42
42
|
↓
|
|
43
43
|
everything-dev/host (orchestrate)
|
|
44
44
|
├── everything-dev/api (load API plugins via MF)
|
|
45
|
-
└── everything-dev/
|
|
45
|
+
└── everything-dev/federation (load UI remote via MF)
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
## MF Manifest Standard
|
package/dist/build.cjs
CHANGED
|
@@ -6,9 +6,9 @@ const require_timing = require('./cli/timing.cjs');
|
|
|
6
6
|
const require_workspace = require('./workspace.cjs');
|
|
7
7
|
const require_shared_deps = require('./shared-deps.cjs');
|
|
8
8
|
const require_string = require('./utils/string.cjs');
|
|
9
|
+
let node_fs_promises = require("node:fs/promises");
|
|
9
10
|
let node_process = require("node:process");
|
|
10
11
|
node_process = require_runtime.__toESM(node_process, 1);
|
|
11
|
-
let node_fs_promises = require("node:fs/promises");
|
|
12
12
|
|
|
13
13
|
//#region src/build.ts
|
|
14
14
|
const buildCommands = {
|
package/dist/build.mjs
CHANGED
|
@@ -5,8 +5,8 @@ import { formatDuration } from "./cli/timing.mjs";
|
|
|
5
5
|
import { ensureFreshDeps, findWorkspaceRoot } from "./workspace.mjs";
|
|
6
6
|
import { syncResolvedSharedDeps } from "./shared-deps.mjs";
|
|
7
7
|
import { padRight } from "./utils/string.mjs";
|
|
8
|
-
import process from "node:process";
|
|
9
8
|
import { access, readFile } from "node:fs/promises";
|
|
9
|
+
import process from "node:process";
|
|
10
10
|
|
|
11
11
|
//#region src/build.ts
|
|
12
12
|
const buildCommands = {
|
package/dist/bundle-cache.cjs
CHANGED
|
@@ -34,7 +34,7 @@ function bundleCachePath(url, input) {
|
|
|
34
34
|
const match = /^\/bundles\/([^/]+)\/([^/]+)\/(.+)$/.exec(parsed.pathname);
|
|
35
35
|
if (!match) return null;
|
|
36
36
|
const [, account, gateway, rest] = match;
|
|
37
|
-
if (!rest || rest.endsWith("/")) return null;
|
|
37
|
+
if (!account || !gateway || !rest || rest.endsWith("/")) return null;
|
|
38
38
|
let decoded;
|
|
39
39
|
try {
|
|
40
40
|
decoded = decodeURIComponent(rest);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle-cache.cjs","names":["path","readFile","mkdir","createHash","writeFile","rename"],"sources":["../src/bundle-cache.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { mkdir, readFile, rename, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\n/**\n * Bundle disk cache (ADR 0011 amendment — foreign-namespace resilience):\n * the child tier loads base workspaces from foreign origins; this cache\n * keeps the last-known-good bytes so an origin outage degrades to stale\n * serving instead of a hard failure. One cache root, two entrances: the\n * host's `/bundles/*` proxy handler (browser traffic) and the CLI fetch\n * adapter (boot-time outbound). Keyed exactly like the staged layout —\n * `<account>/<gateway>/<rest>` — but a separate root from BOS_BUNDLE_DIR:\n * cached bytes are a resilience artifact, never a deployment (plan 043 —\n * never point a runtime's BOS_BUNDLE_DIR at another runtime's layout).\n */\n\nexport function bundleCacheRoot(input?: { cacheDir?: string }): string {\n return path.resolve(input?.cacheDir ?? process.env.BOS_BUNDLE_CACHE_DIR ?? joinDefault());\n}\n\nfunction joinDefault(): string {\n return path.join(process.cwd(), \".bos\", \"bundle-cache\");\n}\n\nexport function bundleCachePath(url: string, input?: { cacheDir?: string }): string | null {\n let parsed: URL;\n try {\n parsed = new URL(url);\n } catch {\n return null;\n }\n if (parsed.protocol !== \"https:\" && parsed.protocol !== \"http:\") return null;\n const match = /^\\/bundles\\/([^/]+)\\/([^/]+)\\/(.+)$/.exec(parsed.pathname);\n if (!match) return null;\n const [, account, gateway, rest] = match;\n if (!rest || rest.endsWith(\"/\")) return null;\n let decoded: string;\n try {\n decoded = decodeURIComponent(rest);\n } catch {\n return null;\n }\n const root = path.resolve(bundleCacheRoot(input));\n const filePath = path.resolve(root, account, gateway, decoded);\n if (!filePath.startsWith(root + path.sep)) return null;\n return filePath;\n}\n\nexport async function readBundleCache(\n url: string,\n input?: { cacheDir?: string },\n): Promise<Uint8Array | null> {\n const filePath = bundleCachePath(url, input);\n if (!filePath) return null;\n try {\n return new Uint8Array(await readFile(filePath));\n } catch {\n return null;\n }\n}\n\nexport async function writeBundleCache(\n url: string,\n bytes: Uint8Array,\n input?: { cacheDir?: string },\n): Promise<void> {\n const filePath = bundleCachePath(url, input);\n if (!filePath) return;\n try {\n await mkdir(path.dirname(filePath), { recursive: true });\n const tmp = `${filePath}.${process.pid}.${createHash(\"sha256\").update(bytes).digest(\"hex\").slice(0, 8)}.tmp`;\n await writeFile(tmp, bytes);\n await rename(tmp, filePath);\n } catch {\n // cache writes are best-effort — never fail the serving path\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgBA,SAAgB,gBAAgB,OAAuC;CACrE,OAAOA,kBAAK,QAAQ,OAAO,YAAY,QAAQ,IAAI,wBAAwB,YAAY,CAAC;AAC1F;AAEA,SAAS,cAAsB;CAC7B,OAAOA,kBAAK,KAAK,QAAQ,IAAI,GAAG,QAAQ,cAAc;AACxD;AAEA,SAAgB,gBAAgB,KAAa,OAA8C;CACzF,IAAI;CACJ,IAAI;EACF,SAAS,IAAI,IAAI,GAAG;CACtB,QAAQ;EACN,OAAO;CACT;CACA,IAAI,OAAO,aAAa,YAAY,OAAO,aAAa,SAAS,OAAO;CACxE,MAAM,QAAQ,sCAAsC,KAAK,OAAO,QAAQ;CACxE,IAAI,CAAC,OAAO,OAAO;CACnB,MAAM,GAAG,SAAS,SAAS,QAAQ;CACnC,IAAI,CAAC,QAAQ,KAAK,SAAS,GAAG,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"bundle-cache.cjs","names":["path","readFile","mkdir","createHash","writeFile","rename"],"sources":["../src/bundle-cache.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { mkdir, readFile, rename, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\n/**\n * Bundle disk cache (ADR 0011 amendment — foreign-namespace resilience):\n * the child tier loads base workspaces from foreign origins; this cache\n * keeps the last-known-good bytes so an origin outage degrades to stale\n * serving instead of a hard failure. One cache root, two entrances: the\n * host's `/bundles/*` proxy handler (browser traffic) and the CLI fetch\n * adapter (boot-time outbound). Keyed exactly like the staged layout —\n * `<account>/<gateway>/<rest>` — but a separate root from BOS_BUNDLE_DIR:\n * cached bytes are a resilience artifact, never a deployment (plan 043 —\n * never point a runtime's BOS_BUNDLE_DIR at another runtime's layout).\n */\n\nexport function bundleCacheRoot(input?: { cacheDir?: string }): string {\n return path.resolve(input?.cacheDir ?? process.env.BOS_BUNDLE_CACHE_DIR ?? joinDefault());\n}\n\nfunction joinDefault(): string {\n return path.join(process.cwd(), \".bos\", \"bundle-cache\");\n}\n\nexport function bundleCachePath(url: string, input?: { cacheDir?: string }): string | null {\n let parsed: URL;\n try {\n parsed = new URL(url);\n } catch {\n return null;\n }\n if (parsed.protocol !== \"https:\" && parsed.protocol !== \"http:\") return null;\n const match = /^\\/bundles\\/([^/]+)\\/([^/]+)\\/(.+)$/.exec(parsed.pathname);\n if (!match) return null;\n const [, account, gateway, rest] = match;\n if (!account || !gateway || !rest || rest.endsWith(\"/\")) return null;\n let decoded: string;\n try {\n decoded = decodeURIComponent(rest);\n } catch {\n return null;\n }\n const root = path.resolve(bundleCacheRoot(input));\n const filePath = path.resolve(root, account, gateway, decoded);\n if (!filePath.startsWith(root + path.sep)) return null;\n return filePath;\n}\n\nexport async function readBundleCache(\n url: string,\n input?: { cacheDir?: string },\n): Promise<Uint8Array | null> {\n const filePath = bundleCachePath(url, input);\n if (!filePath) return null;\n try {\n return new Uint8Array(await readFile(filePath));\n } catch {\n return null;\n }\n}\n\nexport async function writeBundleCache(\n url: string,\n bytes: Uint8Array,\n input?: { cacheDir?: string },\n): Promise<void> {\n const filePath = bundleCachePath(url, input);\n if (!filePath) return;\n try {\n await mkdir(path.dirname(filePath), { recursive: true });\n const tmp = `${filePath}.${process.pid}.${createHash(\"sha256\").update(bytes).digest(\"hex\").slice(0, 8)}.tmp`;\n await writeFile(tmp, bytes);\n await rename(tmp, filePath);\n } catch {\n // cache writes are best-effort — never fail the serving path\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgBA,SAAgB,gBAAgB,OAAuC;CACrE,OAAOA,kBAAK,QAAQ,OAAO,YAAY,QAAQ,IAAI,w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OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;EACvG,UAAMC,4BAAU,KAAK,KAAK;EAC1B,UAAMC,yBAAO,KAAK,QAAQ;CAC5B,QAAQ,CAER;AACF"}
|
package/dist/bundle-cache.mjs
CHANGED
|
@@ -31,7 +31,7 @@ function bundleCachePath(url, input) {
|
|
|
31
31
|
const match = /^\/bundles\/([^/]+)\/([^/]+)\/(.+)$/.exec(parsed.pathname);
|
|
32
32
|
if (!match) return null;
|
|
33
33
|
const [, account, gateway, rest] = match;
|
|
34
|
-
if (!rest || rest.endsWith("/")) return null;
|
|
34
|
+
if (!account || !gateway || !rest || rest.endsWith("/")) return null;
|
|
35
35
|
let decoded;
|
|
36
36
|
try {
|
|
37
37
|
decoded = decodeURIComponent(rest);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle-cache.mjs","names":[],"sources":["../src/bundle-cache.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { mkdir, readFile, rename, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\n/**\n * Bundle disk cache (ADR 0011 amendment — foreign-namespace resilience):\n * the child tier loads base workspaces from foreign origins; this cache\n * keeps the last-known-good bytes so an origin outage degrades to stale\n * serving instead of a hard failure. One cache root, two entrances: the\n * host's `/bundles/*` proxy handler (browser traffic) and the CLI fetch\n * adapter (boot-time outbound). Keyed exactly like the staged layout —\n * `<account>/<gateway>/<rest>` — but a separate root from BOS_BUNDLE_DIR:\n * cached bytes are a resilience artifact, never a deployment (plan 043 —\n * never point a runtime's BOS_BUNDLE_DIR at another runtime's layout).\n */\n\nexport function bundleCacheRoot(input?: { cacheDir?: string }): string {\n return path.resolve(input?.cacheDir ?? process.env.BOS_BUNDLE_CACHE_DIR ?? joinDefault());\n}\n\nfunction joinDefault(): string {\n return path.join(process.cwd(), \".bos\", \"bundle-cache\");\n}\n\nexport function bundleCachePath(url: string, input?: { cacheDir?: string }): string | null {\n let parsed: URL;\n try {\n parsed = new URL(url);\n } catch {\n return null;\n }\n if (parsed.protocol !== \"https:\" && parsed.protocol !== \"http:\") return null;\n const match = /^\\/bundles\\/([^/]+)\\/([^/]+)\\/(.+)$/.exec(parsed.pathname);\n if (!match) return null;\n const [, account, gateway, rest] = match;\n if (!rest || rest.endsWith(\"/\")) return null;\n let decoded: string;\n try {\n decoded = decodeURIComponent(rest);\n } catch {\n return null;\n }\n const root = path.resolve(bundleCacheRoot(input));\n const filePath = path.resolve(root, account, gateway, decoded);\n if (!filePath.startsWith(root + path.sep)) return null;\n return filePath;\n}\n\nexport async function readBundleCache(\n url: string,\n input?: { cacheDir?: string },\n): Promise<Uint8Array | null> {\n const filePath = bundleCachePath(url, input);\n if (!filePath) return null;\n try {\n return new Uint8Array(await readFile(filePath));\n } catch {\n return null;\n }\n}\n\nexport async function writeBundleCache(\n url: string,\n bytes: Uint8Array,\n input?: { cacheDir?: string },\n): Promise<void> {\n const filePath = bundleCachePath(url, input);\n if (!filePath) return;\n try {\n await mkdir(path.dirname(filePath), { recursive: true });\n const tmp = `${filePath}.${process.pid}.${createHash(\"sha256\").update(bytes).digest(\"hex\").slice(0, 8)}.tmp`;\n await writeFile(tmp, bytes);\n await rename(tmp, filePath);\n } catch {\n // cache writes are best-effort — never fail the serving path\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAgB,gBAAgB,OAAuC;CACrE,OAAO,KAAK,QAAQ,OAAO,YAAY,QAAQ,IAAI,wBAAwB,YAAY,CAAC;AAC1F;AAEA,SAAS,cAAsB;CAC7B,OAAO,KAAK,KAAK,QAAQ,IAAI,GAAG,QAAQ,cAAc;AACxD;AAEA,SAAgB,gBAAgB,KAAa,OAA8C;CACzF,IAAI;CACJ,IAAI;EACF,SAAS,IAAI,IAAI,GAAG;CACtB,QAAQ;EACN,OAAO;CACT;CACA,IAAI,OAAO,aAAa,YAAY,OAAO,aAAa,SAAS,OAAO;CACxE,MAAM,QAAQ,sCAAsC,KAAK,OAAO,QAAQ;CACxE,IAAI,CAAC,OAAO,OAAO;CACnB,MAAM,GAAG,SAAS,SAAS,QAAQ;CACnC,IAAI,CAAC,QAAQ,KAAK,SAAS,GAAG,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"bundle-cache.mjs","names":[],"sources":["../src/bundle-cache.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { mkdir, readFile, rename, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\n/**\n * Bundle disk cache (ADR 0011 amendment — foreign-namespace resilience):\n * the child tier loads base workspaces from foreign origins; this cache\n * keeps the last-known-good bytes so an origin outage degrades to stale\n * serving instead of a hard failure. One cache root, two entrances: the\n * host's `/bundles/*` proxy handler (browser traffic) and the CLI fetch\n * adapter (boot-time outbound). Keyed exactly like the staged layout —\n * `<account>/<gateway>/<rest>` — but a separate root from BOS_BUNDLE_DIR:\n * cached bytes are a resilience artifact, never a deployment (plan 043 —\n * never point a runtime's BOS_BUNDLE_DIR at another runtime's layout).\n */\n\nexport function bundleCacheRoot(input?: { cacheDir?: string }): string {\n return path.resolve(input?.cacheDir ?? process.env.BOS_BUNDLE_CACHE_DIR ?? joinDefault());\n}\n\nfunction joinDefault(): string {\n return path.join(process.cwd(), \".bos\", \"bundle-cache\");\n}\n\nexport function bundleCachePath(url: string, input?: { cacheDir?: string }): string | null {\n let parsed: URL;\n try {\n parsed = new URL(url);\n } catch {\n return null;\n }\n if (parsed.protocol !== \"https:\" && parsed.protocol !== \"http:\") return null;\n const match = /^\\/bundles\\/([^/]+)\\/([^/]+)\\/(.+)$/.exec(parsed.pathname);\n if (!match) return null;\n const [, account, gateway, rest] = match;\n if (!account || !gateway || !rest || rest.endsWith(\"/\")) return null;\n let decoded: string;\n try {\n decoded = decodeURIComponent(rest);\n } catch {\n return null;\n }\n const root = path.resolve(bundleCacheRoot(input));\n const filePath = path.resolve(root, account, gateway, decoded);\n if (!filePath.startsWith(root + path.sep)) return null;\n return filePath;\n}\n\nexport async function readBundleCache(\n url: string,\n input?: { cacheDir?: string },\n): Promise<Uint8Array | null> {\n const filePath = bundleCachePath(url, input);\n if (!filePath) return null;\n try {\n return new Uint8Array(await readFile(filePath));\n } catch {\n return null;\n }\n}\n\nexport async function writeBundleCache(\n url: string,\n bytes: Uint8Array,\n input?: { cacheDir?: string },\n): Promise<void> {\n const filePath = bundleCachePath(url, input);\n if (!filePath) return;\n try {\n await mkdir(path.dirname(filePath), { recursive: true });\n const tmp = `${filePath}.${process.pid}.${createHash(\"sha256\").update(bytes).digest(\"hex\").slice(0, 8)}.tmp`;\n await writeFile(tmp, bytes);\n await rename(tmp, filePath);\n } catch {\n // cache writes are best-effort — never fail the serving path\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAgB,gBAAgB,OAAuC;CACrE,OAAO,KAAK,QAAQ,OAAO,YAAY,QAAQ,IAAI,wBAAwB,YAAY,CAAC;AAC1F;AAEA,SAAS,cAAsB;CAC7B,OAAO,KAAK,KAAK,QAAQ,IAAI,GAAG,QAAQ,cAAc;AACxD;AAEA,SAAgB,gBAAgB,KAAa,OAA8C;CACzF,IAAI;CACJ,IAAI;EACF,SAAS,IAAI,IAAI,GAAG;CACtB,QAAQ;EACN,OAAO;CACT;CACA,IAAI,OAAO,aAAa,YAAY,OAAO,aAAa,SAAS,OAAO;CACxE,MAAM,QAAQ,sCAAsC,KAAK,OAAO,QAAQ;CACxE,IAAI,CAAC,OAAO,OAAO;CACnB,MAAM,GAAG,SAAS,SAAS,QAAQ;CACnC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,QAAQ,KAAK,SAAS,GAAG,GAAG,OAAO;CAChE,IAAI;CACJ,IAAI;EACF,UAAU,mBAAmB,IAAI;CACnC,QAAQ;EACN,OAAO;CACT;CACA,MAAM,OAAO,KAAK,QAAQ,gBAAgB,KAAK,CAAC;CAChD,MAAM,WAAW,KAAK,QAAQ,MAAM,SAAS,SAAS,OAAO;CAC7D,IAAI,CAAC,SAAS,WAAW,OAAO,KAAK,GAAG,GAAG,OAAO;CAClD,OAAO;AACT;AAEA,eAAsB,gBACpB,KACA,OAC4B;CAC5B,MAAM,WAAW,gBAAgB,KAAK,KAAK;CAC3C,IAAI,CAAC,UAAU,OAAO;CACtB,IAAI;EACF,OAAO,IAAI,WAAW,MAAM,SAAS,QAAQ,CAAC;CAChD,QAAQ;EACN,OAAO;CACT;AACF;AAEA,eAAsB,iBACpB,KACA,OACA,OACe;CACf,MAAM,WAAW,gBAAgB,KAAK,KAAK;CAC3C,IAAI,CAAC,UAAU;CACf,IAAI;EACF,MAAM,MAAM,KAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;EACvD,MAAM,MAAM,GAAG,SAAS,GAAG,QAAQ,IAAI,GAAG,WAAW,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;EACvG,MAAM,UAAU,KAAK,KAAK;EAC1B,MAAM,OAAO,KAAK,QAAQ;CAC5B,QAAQ,CAER;AACF"}
|
package/dist/cli.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_fastkv = require('./fastkv.cjs');
|
|
4
4
|
const require_network = require('./network.cjs');
|
|
5
|
+
const require_resolver = require('./resolver.cjs');
|
|
5
6
|
const require_config = require('./config.cjs');
|
|
6
7
|
const require_theme = require('./utils/theme.cjs');
|
|
7
8
|
const require_docker = require('./infra/docker.cjs');
|
|
8
|
-
const require_bundle_fs_resolve = require('./bundle-fs-resolve.cjs');
|
|
9
9
|
const require_timing = require('./cli/timing.cjs');
|
|
10
10
|
const require_near_cli = require('./near-cli.cjs');
|
|
11
11
|
const require_progress = require('./progress.cjs');
|
|
@@ -145,7 +145,7 @@ async function main() {
|
|
|
145
145
|
const bootInput = parsedInput;
|
|
146
146
|
const cwdConfigPath = require_config.findConfigPath();
|
|
147
147
|
const configPath = bootInput.configPath ?? cwdConfigPath;
|
|
148
|
-
|
|
148
|
+
require_resolver.installBundleFetchFromEnv({ configPath });
|
|
149
149
|
const projectDir = cwdConfigPath ? (0, node_path.dirname)(cwdConfigPath) : void 0;
|
|
150
150
|
const edResolved = projectDir ? require_framework_version.resolveFrameworkPackage(projectDir, "everything-dev") : void 0;
|
|
151
151
|
const displayVersion = edResolved?.installedVersion ? `${edResolved.installedVersion}${edResolved.isLinked ? " (linked)" : ""}` : void 0;
|
package/dist/cli.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.cjs","names":["colors","frames","icons","gradients","formatDuration","sumPhaseDurations","compareSemver","findCommandDescriptor","parseCommandInput","findConfigPath","dirname","resolveFrameworkPackage","createPluginRuntime","bosPlugin","p","readAuthoredConfigInput","getNetworkIdForAccount","getRegistryNamespaceForAccount","listPublishKeys","promptInitBasic","fetchInitParent","promptInitOverrides","runDockerComposeUp","MISSING_CONFIG_MESSAGE","existsSync","watch","readFile","resolve"],"sources":["../src/cli.ts"],"sourcesContent":["import { existsSync, watch } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { dirname, resolve } from \"node:path\";\nimport * as p from \"@clack/prompts\";\nimport { installBundleFetchFromEnv } from \"./bundle-fs-resolve\";\nimport { findCommandDescriptor } from \"./cli/catalog\";\nimport { resolveFrameworkPackage } from \"./cli/framework-version\";\nimport { printHelp } from \"./cli/help\";\nimport { runDockerComposeUp } from \"./cli/init\";\nimport { parseCommandInput } from \"./cli/parse\";\nimport { promptInitBasic, promptInitOverrides } from \"./cli/prompts\";\nimport { compareSemver } from \"./cli/status\";\nimport { formatDuration, sumPhaseDurations } from \"./cli/timing\";\nimport { fetchInitParent } from \"./commands/init\";\nimport { findConfigPath, MISSING_CONFIG_MESSAGE, readAuthoredConfigInput } from \"./config\";\nimport type {\n DevOptions,\n DevResult,\n InitOptions,\n InitResult,\n KeyPublishOptions,\n KillOptions,\n KillResult,\n LogsOptions,\n LogsResult,\n OverrideSection,\n PsResult,\n StartOptions,\n StartResult,\n TypecheckWorkspaceResult,\n} from \"./contract\";\nimport type { StartSummary } from \"./dev-program\";\nimport { getRegistryNamespaceForAccount } from \"./fastkv\";\nimport { listPublishKeys } from \"./near-cli\";\nimport { getNetworkIdForAccount } from \"./network\";\nimport bosPlugin from \"./plugin\";\nimport { type ProgressEvent, pluginEvents } from \"./progress\";\nimport { createPluginRuntime } from \"./sdk\";\nimport { printBanner } from \"./utils/banner\";\nimport { colors, frames, gradients, icons } from \"./utils/theme\";\n\nfunction printConfigView(result: {\n account: string;\n domain?: string;\n staging?: { domain: string };\n app?: {\n host: { name?: string; development: string; production?: string };\n ui: { name?: string; development?: string; production?: string; ssr?: string };\n api: { name?: string; development?: string; production?: string; proxy?: string };\n };\n}) {\n console.log();\n console.log(colors.cyan(frames.top(52)));\n console.log(` ${icons.app} ${gradients.cyber(\"CONFIG\")}`);\n console.log(colors.cyan(frames.bottom(52)));\n console.log();\n\n console.log(` ${colors.dim(\"Account\")} ${colors.cyan(result.account)}`);\n console.log(` ${colors.dim(\"Domain\")} ${colors.white(result.domain ?? \"not configured\")}`);\n if (result.staging) {\n console.log(` ${colors.dim(\"Staging\")} ${colors.magenta(result.staging.domain)}`);\n }\n console.log();\n}\n\nfunction formatTimeAgo(isoTimestamp: string): string {\n const now = Date.now();\n const then = new Date(isoTimestamp).getTime();\n const diffMs = now - then;\n const diffMins = Math.floor(diffMs / 60_000);\n if (diffMins < 1) return \"just now\";\n if (diffMins < 60) return `${diffMins} minute${diffMins > 1 ? \"s\" : \"\"} ago`;\n const diffHours = Math.floor(diffMins / 60);\n if (diffHours < 24) return `${diffHours} hour${diffHours > 1 ? \"s\" : \"\"} ago`;\n const diffDays = Math.floor(diffHours / 24);\n if (diffDays < 30) return `${diffDays} day${diffDays > 1 ? \"s\" : \"\"} ago`;\n return isoTimestamp.split(\"T\")[0] ?? isoTimestamp;\n}\n\nconst RETIRED_BOOTSTRAP_STUBS = [\n \"ui/src/entry.ts\",\n \"ui/src/hydrate.tsx\",\n \"ui/src/router.server.tsx\",\n \"ui/src/compose.ts\",\n];\n\n/**\n * Hand-modified bootstrap stubs retire as conflicted (backed up, then\n * deleted) — print the mechanical port into the authored seams (ADR 0023).\n */\nfunction printStubMigrationGuide(retiredConflicted: string[] | undefined) {\n const handModified = (retiredConflicted ?? []).filter((f) => RETIRED_BOOTSTRAP_STUBS.includes(f));\n if (handModified.length === 0) return;\n console.log(` ${colors.yellow(\"Port your stub customizations into the authored seams:\")}`);\n console.log(\n ` ${colors.dim(\"- defaultErrorComponent / defaultPendingComponent / defaultNotFoundComponent\")}`,\n );\n console.log(\n ` ${colors.dim(\" → set them inside the createRouter factory in ui/src/router.tsx (after ...opts)\")}`,\n );\n console.log(\n ` ${colors.dim(\"- apiConnectionError copy + SSR locale config (locales, defaultLocale, cookieName)\")}`,\n );\n console.log(\n ` ${colors.dim(\" → export apiConnectionError / appLocale from ui/src/app.ts (see the scaffold template)\")}`,\n );\n console.log(` ${colors.dim(\" backed-up originals: .bos/sync-backup/<timestamp>/\")}`);\n}\n\nfunction printTimingSummary(timings: Array<{ name: string; durationMs: number }> | undefined) {\n if (!timings || timings.length === 0) return;\n\n console.log(` ${colors.dim(\"Timings:\")}`);\n for (const timing of timings) {\n console.log(` ${colors.dim(timing.name.padEnd(22))} ${formatDuration(timing.durationMs)}`);\n }\n console.log(\n ` ${colors.dim(\"total\".padEnd(22))} ${formatDuration(sumPhaseDurations(timings))}`,\n );\n}\n\nfunction printStartSummary(summary: StartSummary) {\n console.log();\n console.log(` ${colors.dim(\"Config Source:\")} ${summary.configSource}`);\n if (summary.configSourceHttp) {\n console.log(` ${colors.dim(summary.configSourceHttp)}`);\n }\n console.log(` ${colors.dim(\"Account:\")} ${summary.account}`);\n console.log(` ${colors.dim(\"Domain:\")} ${summary.domain ?? \"not configured\"}`);\n console.log();\n console.log(` ${colors.dim(\"Modules:\")}`);\n console.log(` ${colors.dim(\"HOST\")} → ${summary.modules.host ?? \"local\"}`);\n console.log(` ${colors.dim(\"UI\")} → ${summary.modules.ui ?? \"local\"}`);\n console.log(` ${colors.dim(\"API\")} → ${summary.modules.api ?? \"local\"}`);\n if (summary.modules.auth) {\n console.log(` ${colors.dim(\"AUTH\")} → ${summary.modules.auth}`);\n }\n if (summary.warnings.length > 0) {\n console.log();\n for (const w of summary.warnings) {\n console.log(` ${colors.yellow(w)}`);\n }\n }\n console.log();\n}\n\nfunction clearSpinnerStopLine() {\n if (!process.stdout.isTTY) return;\n process.stdout.write(\"\\u001B[1A\\u001B[2K\\u001B[1G\");\n}\n\nasync function warnIfOutdated(client: any, command: string): Promise<void> {\n if (![\"dev\", \"build\", \"start\"].includes(command)) return;\n\n try {\n const status = await client.status();\n if (status.status === \"error\" || !status.packages) return;\n\n const frameworkPackages = [\"everything-dev\", \"every-plugin\"];\n\n const linked = status.packages.filter((p: { isLinked?: boolean }) => p.isLinked);\n const outdated = status.packages.filter(\n (p: { name: string; installed?: string; latest?: string; isLinked?: boolean }) =>\n !p.isLinked &&\n p.installed &&\n p.latest &&\n compareSemver(p.installed, p.latest) < 0 &&\n frameworkPackages.includes(p.name),\n );\n\n if (linked.length > 0) {\n for (const pkg of linked) {\n console.log(colors.dim(` ${pkg.name} is linked locally (v${pkg.installed})`));\n }\n }\n\n if (outdated.length === 0) return;\n\n const warn = (line: string) => {\n if (command === \"dev\" || command === \"start\") process.stderr.write(`${line}\\n`);\n else console.log(line);\n };\n warn(\"\");\n warn(colors.yellow(` ! Outdated packages detected:`));\n for (const pkg of outdated) {\n warn(colors.dim(` ${pkg.name} ${pkg.installed} → ${pkg.latest}`));\n }\n warn(\n colors.dim(\n ` Run ${colors.cyan(\"bos upgrade\")} to update packages and sync template files.`,\n ),\n );\n warn(\"\");\n } catch {\n // silently ignore if status check fails\n }\n}\n\nasync function main() {\n const args = process.argv.slice(2);\n\n if (args.includes(\"--help\") || args.includes(\"-h\")) {\n printHelp();\n return;\n }\n\n const invocationArgs = args.length > 0 ? args : [\"dev\"];\n const command = invocationArgs[0] ?? \"dev\";\n\n const commandMatch = findCommandDescriptor(invocationArgs);\n if (!commandMatch) {\n console.error(`Unknown command: ${command}`);\n process.exit(1);\n }\n\n const { descriptor, consumed } = commandMatch;\n const commandArgs = invocationArgs.slice(consumed);\n\n // Parse before the plugin boot: `start --config-path` steers the whole CLI,\n // not just the stack — the plugin initialize resolves and pin-validates the\n // boot config, so it must be the config the command will actually run.\n let parsedInput: unknown;\n try {\n parsedInput = parseCommandInput(descriptor, commandArgs);\n } catch (error) {\n console.error(`[CLI] ${error instanceof Error ? error.message : String(error)}`);\n process.exit(1);\n }\n const bootInput = parsedInput as { configPath?: string };\n\n const cwdConfigPath = findConfigPath();\n const configPath = bootInput.configPath ?? cwdConfigPath;\n installBundleFetchFromEnv({ configPath });\n\n const projectDir = cwdConfigPath ? dirname(cwdConfigPath) : undefined;\n const edResolved = projectDir ? resolveFrameworkPackage(projectDir, \"everything-dev\") : undefined;\n const displayVersion = edResolved?.installedVersion\n ? `${edResolved.installedVersion}${edResolved.isLinked ? \" (linked)\" : \"\"}`\n : undefined;\n if (!process.env.BOS_NO_BANNER) {\n printBanner(\"everything-dev\", displayVersion);\n }\n\n const runtime = createPluginRuntime({\n registry: {\n bos: { module: bosPlugin },\n },\n secrets: {},\n });\n\n const pluginRuntime: any = runtime;\n const loadPlugin = pluginRuntime.usePlugin.bind(pluginRuntime);\n const plugin = await loadPlugin(\"bos\", {\n variables: {\n configPath: configPath ?? undefined,\n configDir: cwdConfigPath ? dirname(cwdConfigPath) : undefined,\n },\n secrets: {},\n });\n\n const client = plugin.createClient();\n\n const outdatedWarning = warnIfOutdated(client, command);\n\n try {\n const input = parsedInput;\n\n const rollbackInput = input as {\n listOnly?: boolean;\n version?: string;\n previous?: boolean;\n [key: string]: unknown;\n };\n if (\n descriptor.key === \"rollback\" &&\n !rollbackInput.listOnly &&\n !rollbackInput.version &&\n !rollbackInput.previous\n ) {\n const listing = await (client as any).rollback({ ...rollbackInput, listOnly: true });\n if (listing.status !== \"list\" || !listing.history?.length) {\n console.error(listing.error ?? \"No publish history found\");\n process.exit(1);\n }\n console.log();\n const selection = await p.select({\n message: \"Roll back to which publish?\",\n options: listing.history.map(\n (entry: {\n blockHeight: number;\n blockTimestamp: string;\n txHash?: string;\n summary: string;\n }) => ({\n value: String(entry.blockHeight),\n label: `${entry.blockTimestamp} (block ${entry.blockHeight})`,\n hint: entry.summary,\n }),\n ),\n });\n if (p.isCancel(selection)) {\n return;\n }\n rollbackInput.version = selection as string;\n }\n\n if (descriptor.key === \"keyPublish\") {\n const keyPublishInput = input as KeyPublishOptions;\n if (keyPublishInput.removeOldKeys === undefined) {\n if (process.stdin.isTTY) {\n const authored = configPath ? await readAuthoredConfigInput(dirname(configPath)) : null;\n const account =\n keyPublishInput.env === \"staging\"\n ? (authored?.staging?.account ?? authored?.account)\n : authored?.account;\n let listed: string[] | null = null;\n if (account) {\n const network = getNetworkIdForAccount(account);\n const contract = getRegistryNamespaceForAccount(account, keyPublishInput.registry);\n try {\n listed = await listPublishKeys({ account, contract, network });\n } catch {\n listed = null;\n }\n }\n if (listed?.length) {\n const removeOldKeys = await p.confirm({\n message: `Remove ${listed.length} existing publish key${listed.length > 1 ? \"s\" : \"\"}?`,\n initialValue: true,\n });\n if (p.isCancel(removeOldKeys)) {\n return;\n }\n keyPublishInput.removeOldKeys = removeOldKeys;\n } else {\n keyPublishInput.removeOldKeys = true;\n }\n } else {\n keyPublishInput.removeOldKeys = true;\n }\n }\n }\n\n if (descriptor.key === \"dev\") {\n const devSpinner = p.spinner();\n devSpinner.start(\"Starting dev environment\");\n\n const devPhaseLabels: Record<string, string> = {\n \"shared deps\": \"Preparing config...\",\n install: \"Installing dependencies...\",\n build: \"Building...\",\n \"resolve config\": \"Resolving config...\",\n ports: \"Finding available ports...\",\n \"docker compose up\": \"Starting local Postgres...\",\n \"generate artifacts\": \"Generating code artifacts...\",\n };\n\n const onDevProgress = (event: ProgressEvent) => {\n const label = devPhaseLabels[event.phase] ?? event.phase;\n if (event.status === \"running\") {\n devSpinner.message(label);\n }\n };\n pluginEvents.on(\"progress\", onDevProgress);\n\n let result: DevResult;\n try {\n result = await client.dev(input as DevOptions);\n } finally {\n pluginEvents.off(\"progress\", onDevProgress);\n }\n\n if (result.status === \"error\") {\n devSpinner.stop(\"Failed\");\n console.error(`[CLI] ${result.description}`);\n process.exit(1);\n }\n\n devSpinner.stop();\n clearSpinnerStopLine();\n\n const session = result.session;\n void outdatedWarning;\n if (session) {\n const { devApp } = await import(\"./dev-session\");\n devApp(\n projectDir ?? process.cwd(),\n session.orchestrator,\n session.services,\n session.runtimeConfig,\n session.envGenerated,\n session.shellEnv,\n );\n }\n return;\n }\n\n if (descriptor.key === \"start\") {\n const startSpinner = p.spinner();\n startSpinner.start(\"Starting production environment\");\n\n const startPhaseLabels: Record<string, string> = {\n config: \"Preparing config...\",\n \"generate artifacts\": \"Generating code artifacts...\",\n };\n\n const onStartProgress = (event: ProgressEvent) => {\n const label = startPhaseLabels[event.phase] ?? event.phase;\n if (event.status === \"running\") {\n startSpinner.message(label);\n }\n };\n pluginEvents.on(\"progress\", onStartProgress);\n\n let result: StartResult;\n try {\n result = await client.start(input as StartOptions);\n } finally {\n pluginEvents.off(\"progress\", onStartProgress);\n }\n\n if (result.status === \"error\") {\n startSpinner.stop(\"Failed\");\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n\n startSpinner.stop(\"Ready\");\n\n const session = result.session;\n const summary = result.summary;\n void outdatedWarning;\n if (session) {\n if (summary) {\n printStartSummary(summary);\n }\n const { startApp } = await import(\"./dev-session\");\n startApp(\n projectDir ?? process.cwd(),\n session.orchestrator,\n session.services,\n session.runtimeConfig,\n session.envGenerated,\n session.shellEnv,\n );\n }\n return;\n }\n\n if (descriptor.key === \"init\") {\n let initInput: InitOptions = { ...(input as InitOptions) };\n\n if (!initInput.noInteractive) {\n const basic = await promptInitBasic({\n extends: initInput.extends,\n account: initInput.account,\n domain: initInput.domain,\n });\n\n let parentPluginKeys: string[] = [];\n let parentConfig: {\n title?: string;\n description?: string;\n plugins?: Record<string, unknown>;\n } | null = null;\n\n const fetchSpinner = p.spinner();\n fetchSpinner.start(\"Fetching parent config\");\n try {\n const parent = await fetchInitParent(basic.extendsAccount, basic.extendsGateway);\n parentConfig = parent.parentConfig;\n parentPluginKeys = parent.parentPluginKeys;\n } catch {\n fetchSpinner.stop(\"Config not found\");\n console.error(\n `[CLI] No config found at bos://${basic.extendsAccount}/${basic.extendsGateway}`,\n );\n process.exit(1);\n }\n fetchSpinner.stop(\"Config fetched\");\n\n if (\n typeof parentConfig?.title === \"string\" &&\n parentConfig.title.trim() &&\n typeof parentConfig?.description === \"string\" &&\n parentConfig.description.trim()\n ) {\n const shouldContinue = await p.confirm({\n message: `You will be extending ${parentConfig.title} - ${parentConfig.description}. Continue?`,\n initialValue: true,\n });\n\n if (p.isCancel(shouldContinue) || !shouldContinue) {\n process.exit(0);\n }\n }\n\n const overrides = await promptInitOverrides({\n parentPluginKeys,\n plugins: initInput.plugins,\n overrides: initInput.overrides as OverrideSection[] | undefined,\n level: initInput.level,\n });\n\n const directory = initInput.directory || basic.domain || basic.extendsGateway;\n\n initInput = {\n ...initInput,\n extends: `bos://${basic.extendsAccount}/${basic.extendsGateway}`,\n directory,\n account: basic.account,\n domain: basic.domain || undefined,\n plugins: overrides.plugins,\n overrides: overrides.overrides,\n level: overrides.level ?? initInput.level,\n noInteractive: true,\n };\n }\n\n const initSpinner = p.spinner();\n initSpinner.start(\"Initializing project\");\n\n const phaseLabels: Record<string, string> = {\n \"parent config\": \"Fetching parent config...\",\n \"template source\": \"Resolving template source...\",\n \"scaffold project\": \"Creating project scaffold...\",\n \"copy files\": \"Copying template files...\",\n \"personalize config\": \"Personalizing config...\",\n \"write snapshot\": \"Writing snapshot...\",\n \"resolve config\": \"Resolving config...\",\n \"generate env/docker\": \"Generating environment config...\",\n \"create env file\": \"Creating .env file...\",\n \"install dependencies\": \"Installing dependencies...\",\n \"generate types\": \"Generating types...\",\n \"generate migrations\": \"Generating database migrations...\",\n \"generate code artifacts\": \"Generating code artifacts...\",\n };\n\n const onProgress = (event: ProgressEvent) => {\n const label = phaseLabels[event.phase] ?? event.phase;\n if (event.status === \"running\") {\n initSpinner.message(label);\n }\n };\n pluginEvents.on(\"progress\", onProgress);\n\n let result: InitResult;\n try {\n result = await client.init(initInput);\n } finally {\n pluginEvents.off(\"progress\", onProgress);\n }\n\n if (result.status === \"error\") {\n initSpinner.stop(\"Failed\");\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n\n initSpinner.stop(\"Project initialized\");\n\n console.log(` ${colors.dim(\"Extends:\")} ${result.extends}`);\n console.log(` ${colors.dim(\"Directory:\")} ${result.directory}`);\n if (result.account) console.log(` ${colors.dim(\"Account:\")} ${result.account}`);\n if (result.domain) console.log(` ${colors.dim(\"Domain:\")} ${result.domain}`);\n if (result.overrides && result.overrides.length > 0)\n console.log(` ${colors.dim(\"Overrides:\")} ${result.overrides.join(\", \")}`);\n if (result.plugins && result.plugins.length > 0)\n console.log(` ${colors.dim(\"Plugins:\")} ${result.plugins.join(\", \")}`);\n console.log(` ${colors.dim(\"Files copied:\")} ${result.filesCopied}`);\n printTimingSummary(result.timings);\n console.log();\n console.log(colors.dim(\" Next steps:\"));\n console.log(colors.dim(` cd ${result.directory}`));\n if (!initInput.noInstall) {\n console.log(colors.dim(\" pnpm run dev\"));\n } else {\n console.log(colors.dim(\" pnpm install\"));\n console.log(colors.dim(\" pnpm run dev\"));\n }\n console.log();\n\n if (initInput.noInteractive !== true && !initInput.noInstall && result.targetDir) {\n const shouldStartDocker = await p.confirm({\n message: \"Run docker compose up -d --wait?\",\n initialValue: true,\n });\n\n if (shouldStartDocker === true) {\n const dockerSpinner = p.spinner();\n dockerSpinner.start(\"Starting Docker services\");\n const compose = await runDockerComposeUp(result.targetDir);\n if (compose.ok) {\n dockerSpinner.stop(\"Docker services ready\");\n } else {\n dockerSpinner.stop(\"Docker services not started\");\n p.log.warn(\n `docker compose up -d --wait failed${compose.tail ? `:\\n${compose.tail}` : \"\"}`,\n );\n }\n }\n }\n\n return;\n }\n\n const result = await (client as any)[descriptor.key](input);\n\n if (descriptor.key === \"dbStudio\") {\n if (result.status === \"error\") {\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n\n return;\n }\n\n if (descriptor.key === \"dbDoctor\") {\n if (result.status === \"error\") {\n console.error(`[CLI] ${result.error || \"Diagnosis failed\"}`);\n process.exit(1);\n }\n\n const statusIcon = (() => {\n switch (result.diagnosis) {\n case \"healthy\":\n return \"✓\";\n case \"empty\":\n return \"○\";\n case \"unapplied\":\n return \"○\";\n case \"untracked-existing-schema\":\n return \"○\";\n case \"drift-safe-repair\":\n return \"⚠\";\n case \"drift-manual\":\n return \"✗\";\n default:\n return \"?\";\n }\n })();\n\n console.log(`\\n${statusIcon} ${result.plugin}`);\n console.log(` ${colors.dim(`Journal:`)} ${result.journalSchema}.${result.journalTable}`);\n console.log(` ${colors.dim(`Local migrations:`)} ${result.localMigrationCount}`);\n console.log(` ${colors.dim(`Applied hashes:`)} ${result.appliedHashCount}`);\n if (result.expectedTables.length > 0) {\n console.log(` ${colors.dim(`Expected tables:`)} ${result.expectedTables.join(\", \")}`);\n }\n if (result.missingTables.length > 0) {\n console.log(` ${colors.yellow(`Missing tables:`)} ${result.missingTables.join(\", \")}`);\n }\n console.log(` ${colors.dim(`Diagnosis:`)} ${result.diagnosis}`);\n if (result.workspaceDir) {\n console.log(` ${colors.dim(`Workspace:`)} ${result.workspaceDir}`);\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"dbRepair\") {\n if (result.status === \"refused\") {\n console.log(\n `\\n${colors.yellow(\"!\")} Repair refused for ${result.diagnosis?.plugin ?? result.message}`,\n );\n console.log(` ${result.message}`);\n console.log();\n process.exit(0);\n }\n\n if (result.status === \"error\") {\n console.error(`\\n${colors.error(\"✗\")} Repair failed`);\n console.error(` ${result.message}`);\n console.error();\n process.exit(1);\n }\n\n console.log(`\\n${colors.green(\"✓\")} Repair complete`);\n console.log(` ${result.message}`);\n console.log();\n return;\n }\n\n if (descriptor.key === \"config\") {\n if (!result.config) {\n console.error(MISSING_CONFIG_MESSAGE);\n process.exit(1);\n }\n\n printConfigView(result.config);\n process.stdout.write(`${JSON.stringify(result.config, null, 2)}\\n`);\n return;\n }\n\n if (descriptor.key === \"sync\") {\n if ((input as any).json) {\n console.log(JSON.stringify(result, null, 2));\n return;\n }\n console.log();\n if (result.status === \"error\") {\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n if (result.status === \"dry-run\") {\n console.log(colors.cyan(`${icons.ok} Dry run — no files written`));\n } else {\n console.log(colors.green(`${icons.ok} Synced`));\n }\n const hasRetirement =\n (result.retired?.length ?? 0) > 0 || (result.retiredConflicted?.length ?? 0) > 0;\n if (\n result.updated.length > 0 ||\n result.added.length > 0 ||\n result.conflicted.length > 0 ||\n hasRetirement\n ) {\n console.log(\n ` ${colors.dim(\"Sync results:\")} ${result.updated.length} updated, ${result.added.length} added, ${result.conflicted.length} conflicted`,\n );\n if (result.updated.length > 0) {\n for (const f of result.updated) console.log(` ${colors.dim(f)}`);\n }\n if (result.added.length > 0) {\n for (const f of result.added) console.log(` ${colors.dim(f)}`);\n }\n if (result.conflicted.length > 0) {\n console.log(\n ` ${colors.yellow(\"Conflicted\")} (template applied, your changes backed up):`,\n );\n if (result.backupDir) console.log(` ${colors.dim(result.backupDir)}`);\n for (const f of result.conflicted) console.log(` ${colors.dim(f)}`);\n }\n if (hasRetirement) {\n console.log(` ${colors.yellow(\"Retired\")} (replaced by generated stubs — ADR 0023):`);\n if (result.retiredBackupDir) console.log(` ${colors.dim(result.retiredBackupDir)}`);\n for (const f of result.retiredConflicted ?? []) {\n console.log(` ${colors.dim(`${f} (backed up)`)}`);\n }\n for (const f of result.retired ?? []) console.log(` ${colors.dim(f)}`);\n printStubMigrationGuide(result.retiredConflicted);\n }\n }\n if (\n result.updated.length === 0 &&\n result.added.length === 0 &&\n result.conflicted.length === 0 &&\n !hasRetirement\n ) {\n console.log(` ${colors.dim(\"Already up to date\")}`);\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"upgrade\") {\n if ((input as any).json) {\n console.log(JSON.stringify(result, null, 2));\n return;\n }\n console.log();\n if (result.status === \"error\") {\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n if (result.status === \"dry-run\") {\n console.log(colors.cyan(`${icons.ok} Dry run — no changes applied`));\n } else {\n console.log(colors.green(`${icons.ok} Upgrade complete`));\n }\n const mainPkg = result.packages.find(\n (p: { name: string; from?: string; to: string }) => p.name === \"everything-dev\",\n );\n const versionDelta =\n mainPkg?.from && mainPkg.from !== mainPkg.to ? `${mainPkg.from} → ${mainPkg.to}` : null;\n if (versionDelta) {\n console.log(` ${colors.dim(`Upgraded everything-dev ${versionDelta}`)}`);\n }\n for (const pkg of result.packages) {\n if (pkg.name === \"everything-dev\") continue;\n if (pkg.from && pkg.from !== pkg.to) {\n console.log(` ${colors.dim(`${pkg.name} ${pkg.from} → ${pkg.to}`)}`);\n } else if (!pkg.from) {\n console.log(` ${colors.dim(`${pkg.name} ${pkg.to} (new)`)}`);\n } else {\n console.log(` ${colors.dim(`${pkg.name} ${pkg.to} (up to date)`)}`);\n }\n }\n if (result.changelogUrl) {\n console.log(` Changelog: ${result.changelogUrl}`);\n }\n if (result.selectedPlugins && result.selectedPlugins.length > 0) {\n console.log(` Added plugins: ${result.selectedPlugins.join(\", \")}`);\n }\n if (result.sync) {\n const sync = result.sync;\n const hasRetirement =\n (sync.retired?.length ?? 0) > 0 || (sync.retiredConflicted?.length ?? 0) > 0;\n console.log(` ${colors.dim(\"Sync results:\")}`);\n if (\n sync.updated.length > 0 ||\n sync.added.length > 0 ||\n sync.conflicted.length > 0 ||\n hasRetirement\n ) {\n console.log(\n ` ${sync.updated.length} updated, ${sync.added.length} added, ${sync.conflicted.length} conflicted`,\n );\n if (sync.conflicted.length > 0) {\n console.log(\n ` ${colors.yellow(\"Conflicted\")} (template applied, your changes backed up):`,\n );\n if (sync.backupDir) console.log(` ${colors.dim(sync.backupDir)}`);\n for (const f of sync.conflicted) console.log(` ${colors.dim(f)}`);\n }\n if (hasRetirement) {\n console.log(` ${colors.yellow(\"Retired\")} (replaced by generated stubs — ADR 0023):`);\n if (sync.retiredBackupDir) console.log(` ${colors.dim(sync.retiredBackupDir)}`);\n for (const f of sync.retiredConflicted ?? []) {\n console.log(` ${colors.dim(`${f} (backed up)`)}`);\n }\n for (const f of sync.retired ?? []) console.log(` ${colors.dim(f)}`);\n printStubMigrationGuide(sync.retiredConflicted);\n }\n } else {\n console.log(` ${colors.dim(\"Already up to date\")}`);\n }\n }\n if (result.migrated && result.migrated.length > 0) {\n console.log(` Migrated: ${result.migrated.length} file(s)`);\n for (const f of result.migrated) console.log(` ${colors.dim(f)}`);\n }\n if (versionDelta || (result.sync && result.sync.conflicted.length > 0)) {\n console.log();\n console.log(colors.dim(\" For AI agents:\"));\n const parentRepo = \"nearbuilders/everything-dev\";\n const somedelta =\n mainPkg?.from && mainPkg.to\n ? `v${mainPkg.from.replace(/^[\\^~>=v]+/, \"\")}...v${mainPkg.to.replace(/^[\\^~>=v]+/, \"\")}`\n : \"\";\n console.log(\n colors.dim(\n ` This upgrade applied template changes${somedelta ? ` (${somedelta})` : \"\"}.`,\n ),\n );\n if (result.sync && result.sync.conflicted.length > 0) {\n console.log(\n colors.dim(\n ` ${result.sync.conflicted.length} file(s) had local conflicts — template version applied, backups at ${result.sync.backupDir || \".bos/sync-backup/\"}.`,\n ),\n );\n console.log(\n colors.dim(\n ` If local changes should be preserved upstream, open a PR: https://github.com/${parentRepo}${somedelta ? `/compare/${somedelta}` : \"\"}`,\n ),\n );\n }\n console.log(\n colors.dim(\n \" Load matching intent skills: pnpm dlx @tanstack/intent@latest load everything-dev#...\",\n ),\n );\n console.log(colors.dim(\" Review AGENTS.md — local updates may need merging.\"));\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"status\") {\n console.log();\n if (result.status === \"error\") {\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n console.log(colors.cyan(frames.top(52)));\n console.log(` ${icons.app} ${gradients.cyber(\"STATUS\")}`);\n console.log(colors.cyan(frames.bottom(52)));\n console.log();\n if (result.extends) console.log(` ${colors.dim(\"Extends:\")} ${result.extends}`);\n if (result.account) console.log(` ${colors.dim(\"Account:\")} ${result.account}`);\n if (result.domain) console.log(` ${colors.dim(\"Domain:\")} ${result.domain}`);\n console.log();\n console.log(` ${colors.dim(\"Packages:\")}`);\n for (const pkg of result.packages) {\n const hasUpdate =\n pkg.installed && pkg.latest && compareSemver(pkg.installed, pkg.latest) < 0;\n const versionStr = hasUpdate\n ? `${pkg.installed} → ${pkg.latest}`\n : pkg.installed || \"not installed\";\n const label = hasUpdate ? colors.yellow(versionStr) : colors.dim(versionStr);\n console.log(` ${colors.dim(`${pkg.name}`)} ${label}`);\n }\n console.log();\n if (result.lastSync) {\n const ago = formatTimeAgo(result.lastSync);\n console.log(` ${colors.dim(\"Last sync:\")} ${ago}`);\n } else {\n console.log(` ${colors.dim(\"Last sync:\")} never`);\n }\n const envLabel =\n result.envFile === \"found\"\n ? colors.green(\"found\")\n : result.envFile === \"example-only\"\n ? colors.yellow(\"missing (only .env.example found)\")\n : colors.error(\"missing\");\n console.log(` ${colors.dim(\".env:\")} ${envLabel}`);\n if (result.parentReachable !== undefined) {\n const parentLabel = result.parentReachable\n ? colors.green(\"reachable\")\n : colors.error(\"unreachable\");\n console.log(` ${colors.dim(\"Parent:\")} ${parentLabel}`);\n }\n const hasUpdates = result.packages.some(\n (p: { installed?: string; latest?: string }) =>\n p.installed && p.latest && compareSemver(p.installed, p.latest) < 0,\n );\n if (hasUpdates) {\n console.log();\n console.log(\n colors.dim(\n ` Run ${colors.cyan(\"bos upgrade\")} to update packages and sync template files.`,\n ),\n );\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"ps\") {\n const psResult = result as PsResult;\n console.log();\n if (psResult.status === \"error\") {\n console.error(`[CLI] ${psResult.error || \"Unknown error\"}`);\n process.exit(1);\n }\n const entries = psResult.entries ?? [];\n if (entries.length === 0) {\n console.log(colors.dim(\" No tracked development processes running.\"));\n console.log();\n console.log(\n colors.dim(` Start one with ${colors.cyan(\"bos dev\")} and it will appear here.`),\n );\n console.log();\n return;\n }\n console.log(colors.cyan(frames.top(60)));\n console.log(` ${icons.app} ${gradients.cyber(\"PROCESSES\")}`);\n console.log(colors.cyan(frames.bottom(60)));\n console.log();\n for (const entry of entries) {\n const ageMs = Date.now() - entry.startedAt;\n const ageStr =\n ageMs < 60_000\n ? `${Math.floor(ageMs / 1000)}s`\n : ageMs < 3_600_000\n ? `${Math.floor(ageMs / 60_000)}m`\n : `${Math.floor(ageMs / 3_600_000)}h`;\n const roleTag =\n entry.role === \"workspace-parent\"\n ? colors.magenta(\"parent\")\n : entry.role === \"workspace-child\"\n ? colors.blue(\"child\")\n : colors.dim(\"dev\");\n console.log(` ${colors.green(`pid ${entry.pid}`)} ${roleTag} ${colors.dim(ageStr)}`);\n console.log(` ${colors.dim(\"dir:\")} ${entry.configDir}`);\n if (entry.parentPid !== undefined) {\n console.log(` ${colors.dim(\"parent:\")} ${entry.parentPid}`);\n }\n const portPairs = Object.entries(entry.ports ?? {})\n .filter(([, p]) => typeof p === \"number\")\n .map(([k, v]) => `${k}=${v}`);\n if (portPairs.length > 0) {\n console.log(` ${colors.dim(\"ports:\")} ${portPairs.join(\" \")}`);\n }\n if (entry.budget) {\n console.log(` ${colors.dim(\"budget:\")} [${entry.budget.min}, ${entry.budget.max}]`);\n }\n console.log(` ${colors.dim(\"desc:\")} ${entry.description}`);\n console.log();\n }\n return;\n }\n\n if (descriptor.key === \"logs\") {\n const logsResult = result as LogsResult;\n const opts = input as LogsOptions;\n for (const line of logsResult.lines) {\n console.log(line);\n }\n if (logsResult.lines.length === 0) {\n console.log(colors.dim(` No matching log lines in ${logsResult.logFile}.`));\n }\n if (opts.follow) {\n if (logsResult.logFile === \"unknown\" || !existsSync(logsResult.logFile)) {\n console.log(colors.dim(\" No log file to follow — nothing was found on disk.\"));\n } else {\n const filter = opts.service;\n let byteOffset = 0;\n for (const line of logsResult.lines) byteOffset += Buffer.byteLength(line, \"utf8\") + 1;\n const followMatch = (line: string): boolean => {\n if (!filter) return true;\n const source = /\\] \\[([^\\]]+)\\] \\[(?:OUT|ERR)\\] /.exec(line)?.[1];\n return source === filter || source === `plugin:${filter}`;\n };\n const watcher = watch(logsResult.logFile, (event) => {\n if (event !== \"change\") return;\n void readFile(logsResult.logFile, \"utf8\")\n .then((text) => {\n const newLines = text\n .slice(byteOffset)\n .split(\"\\n\")\n .filter((line) => line.length > 0 && followMatch(line));\n byteOffset = Buffer.byteLength(text, \"utf8\");\n for (const line of newLines) {\n console.log(line);\n }\n })\n .catch(() => {\n // the followed file was rotated or deleted — stop following\n watcher.close();\n });\n });\n console.log(colors.dim(\" Following — Ctrl+C to stop.\"));\n process.on(\"SIGINT\", () => {\n watcher.close();\n process.exit(0);\n });\n }\n }\n return;\n }\n\n if (descriptor.key === \"kill\") {\n const killResult = result as KillResult;\n console.log();\n if (killResult.status === \"error\") {\n console.error(`[CLI] ${killResult.error || \"Unknown error\"}`);\n process.exit(1);\n }\n if (killResult.killed.length > 0) {\n console.log(colors.green(`${icons.ok} Sent ${killResult.killed.length} kill signal(s)`));\n for (const k of killResult.killed) {\n console.log(` ${colors.dim(\"pid\")} ${k.pid} ${colors.dim(k.configDir)}`);\n }\n }\n if (killResult.skipped.length > 0) {\n console.log(colors.yellow(`${icons.err} ${killResult.skipped.length} skipped`));\n for (const s of killResult.skipped) {\n console.log(` ${colors.dim(\"pid\")} ${s.pid} ${colors.dim(s.reason)}`);\n }\n }\n if (killResult.killed.length === 0 && killResult.skipped.length === 0) {\n const opts = input as KillOptions;\n if (opts.all) {\n console.log(colors.dim(\" No tracked processes to kill.\"));\n } else {\n const configPath = findConfigPath();\n const dir = opts.configDir ?? (configPath ? resolve(dirname(configPath)) : process.cwd());\n console.log(colors.dim(` No tracked processes for ${dir}`));\n console.log(colors.dim(` Use ${colors.cyan(\"--all\")} to kill across all directories.`));\n }\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"typesGen\") {\n console.log();\n if (result.status === \"error\") {\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n console.log(colors.green(`${icons.ok} Types generated`));\n if (result.generated.length > 0) {\n console.log(` ${colors.dim(\"Written:\")}`);\n for (const f of result.generated) console.log(` ${colors.dim(f)}`);\n }\n if (result.fetched.length > 0 || result.skipped.length > 0 || result.failed.length > 0) {\n console.log(` ${colors.dim(\"Contract sources:\")}`);\n for (const entry of result.fetched) {\n const space = entry.indexOf(\" \");\n const key = space !== -1 ? entry.slice(0, space) : entry;\n const rest = space !== -1 ? entry.slice(space + 1) : \"\";\n const restSpace = rest.indexOf(\" \");\n const detail = restSpace !== -1 ? rest.slice(restSpace + 1) : \"\";\n console.log(\n ` ${key} ${colors.cyan(\"remote\")}${detail ? ` ${colors.dim(detail)}` : \"\"}`,\n );\n }\n for (const entry of result.skipped) {\n const space = entry.indexOf(\" \");\n const key = space !== -1 ? entry.slice(0, space) : entry;\n const rest = space !== -1 ? entry.slice(space + 1) : \"\";\n if (rest === \"no URL resolved\") {\n console.log(` ${key} ${colors.dim(\"no URL resolved\")}`);\n continue;\n }\n const restSpace = rest.indexOf(\" \");\n const detail = restSpace !== -1 ? rest.slice(restSpace + 1) : \"\";\n console.log(` ${key} ${colors.dim(\"local\")}${detail ? ` ${colors.dim(detail)}` : \"\"}`);\n }\n }\n if (result.failed.length > 0) {\n console.log(` ${colors.yellow(\"Failed:\")}`);\n for (const f of result.failed) {\n const colon = f.indexOf(\": \");\n if (colon !== -1) {\n console.log(` ${colors.error(f.slice(0, colon))}${colors.dim(f.slice(colon))}`);\n } else {\n console.log(` ${colors.error(f)}`);\n }\n }\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"typecheck\") {\n console.log();\n if (result.status === \"error\") {\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n const failed = result.results.filter((r: TypecheckWorkspaceResult) => !r.passed);\n const passed = result.results.filter((r: TypecheckWorkspaceResult) => r.passed);\n console.log(colors.cyan(frames.top(52)));\n console.log(` ${icons.app} ${gradients.cyber(\"TYPECHECK\")}`);\n console.log(colors.cyan(frames.bottom(52)));\n console.log();\n for (const r of result.results) {\n const icon = r.passed ? colors.green(\"✓\") : colors.error(\"✗\");\n console.log(` ${icon} ${r.workspace}`);\n }\n if (result.skipped.length > 0) {\n console.log(` ${colors.dim(`Skipped: ${result.skipped.join(\", \")}`)}`);\n }\n console.log();\n if (failed.length > 0) {\n console.log(` ${colors.error(`${failed.length} failed`)}`);\n for (const f of failed) {\n if (f.error) console.log(` ${colors.dim(f.error)}`);\n }\n console.log();\n process.exit(1);\n }\n console.log(` ${colors.green(`${passed.length} passed`)}`);\n console.log();\n return;\n }\n\n if (descriptor.key === \"mfCheck\") {\n console.log();\n console.log(\n ` ${colors.dim(\"Host\")} ${result.hostReachable ? colors.green(\"OK \") : colors.error(\"FAIL\")} ${\n result.hostVersion ?? \"unreachable\"\n }${result.hostReason ? ` (${result.hostReason})` : \"\"}`,\n );\n for (const r of result.remotes) {\n const tag = r.ok ? colors.green(\"OK \") : colors.error(\"FAIL\");\n console.log(\n ` ${colors.dim(r.role.padEnd(10))} ${tag} ${r.url} pluginVersion=${r.pluginVersion ?? \"?\"}${\n r.reason ? ` ↳ ${r.reason}` : \"\"\n }`,\n );\n }\n console.log();\n if (result.status !== \"ok\") {\n console.log(\n colors.error(\n \" mf-compat: ✗ federation manifests NOT compatible — redeploy affected plugin(s) so pluginVersion and shared versions match host\",\n ),\n );\n console.log();\n process.exit(1);\n }\n console.log(colors.green(\" mf-compat: ✓ all federation manifests compatible\"));\n console.log();\n return;\n }\n\n if (result?.status === \"error\" && descriptor.key !== \"publish\" && descriptor.key !== \"deploy\") {\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n\n if (descriptor.key === \"login\") {\n console.log();\n console.log(colors.green(`${icons.ok} Logged in to ${result.siteUrl}`));\n if (result.accountId) console.log(` ${colors.dim(\"Account:\")} ${result.accountId}`);\n if (result.expiresAt) console.log(` ${colors.dim(\"Expires:\")} ${result.expiresAt}`);\n if (result.warning) console.log(` ${colors.yellow(\"⚠\")} ${result.warning}`);\n if (result.publishKey) {\n console.log(\n ` ${colors.dim(\"Publish key:\")} ${result.publishKey.publicKey} ${colors.dim(\n `(${result.publishKey.network}, exported to ${result.publishKey.exportedTo})`,\n )}`,\n );\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"logout\") {\n console.log();\n console.log(colors.green(`${icons.ok} Logged out`));\n if (result.revokedApiKey) console.log(` ${colors.dim(\"Revoked API key\")}`);\n if (result.removedPublishKey) console.log(` ${colors.dim(\"Removed exported publish key\")}`);\n if (result.warning) console.log(` ${colors.yellow(\"⚠\")} ${result.warning}`);\n console.log();\n return;\n }\n\n if (descriptor.key === \"keyPublish\") {\n process.stdout.write(`Generated publish key for ${result.account}\\n`);\n process.stdout.write(` Network: ${result.network}\\n`);\n process.stdout.write(` Allowance: ${result.allowance}\\n`);\n process.stdout.write(`\\n`);\n const secretName = result.env === \"staging\" ? \"NEAR_TESTNET_PRIVATE_KEY\" : \"NEAR_PRIVATE_KEY\";\n if (!process.stdout.isTTY) {\n process.stderr.write(\n ` ⚠ Non-interactive stdout: this private key will be captured in any log or pipe (GitHub Actions logs persist stdout).\\n`,\n );\n }\n process.stdout.write(\n ` Set this as ${secretName} in GitHub Actions or before calling publish:\\n`,\n );\n process.stdout.write(`${secretName}=${result.privateKey}\\n`);\n }\n\n if (descriptor.key === \"pluginAdd\") {\n console.log();\n console.log(colors.green(`${icons.ok} Added plugin ${result.key}`));\n if (result.development) console.log(` ${colors.dim(\"Development:\")} ${result.development}`);\n if (result.production) console.log(` ${colors.dim(\"Production:\")} ${result.production}`);\n console.log();\n return;\n }\n\n if (descriptor.key === \"pluginRemove\") {\n console.log();\n console.log(colors.green(`${icons.ok} Removed plugin ${result.key}`));\n console.log();\n return;\n }\n\n if (descriptor.key === \"pluginList\") {\n console.log();\n console.log(colors.cyan(frames.top(52)));\n console.log(` ${icons.config} ${gradients.cyber(\"PLUGINS\")}`);\n console.log(colors.cyan(frames.bottom(52)));\n console.log();\n if (result.plugins.length === 0) {\n console.log(colors.dim(\" No plugins configured\"));\n } else {\n for (const pluginItem of result.plugins) {\n console.log(` ${colors.cyan(pluginItem.key)}`);\n if (pluginItem.development)\n console.log(` ${colors.dim(\"Development:\")} ${pluginItem.development}`);\n if (pluginItem.production)\n console.log(` ${colors.dim(\"Production:\")} ${pluginItem.production}`);\n }\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"pluginPublish\") {\n console.log();\n console.log(colors.green(`${icons.ok} Published plugin ${result.key}`));\n if (result.path) console.log(` ${colors.dim(\"Path:\")} ${result.path}`);\n if (result.production) console.log(` ${colors.dim(\"Production:\")} ${result.production}`);\n if (result.version) console.log(` ${colors.dim(\"Version:\")} ${result.version}`);\n if (result.fingerprint) console.log(` ${colors.dim(\"Fingerprint:\")} ${result.fingerprint}`);\n console.log();\n return;\n }\n\n if (descriptor.key === \"registryUse\") {\n console.log();\n if (result.status === \"error\") {\n console.error(colors.error(`${icons.err} ${result.error || \"Unknown error\"}`));\n process.exit(1);\n }\n console.log(\n colors.green(\n `${icons.ok} ${result.status === \"dry-run\" ? \"Dry run\" : \"Composed\"} from ${result.from}`,\n ),\n );\n for (const section of result.applied) {\n console.log(` ${colors.green(\"+\")} ${section}`);\n }\n if (result.configPath) {\n console.log(` ${colors.dim(\"Config:\")} ${result.configPath}`);\n }\n if (result.status === \"updated\") {\n console.log(colors.dim(\" Run bos types gen to refresh generated types.\"));\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"publish\") {\n if (result.status === \"dry-run\") {\n console.log();\n console.log(colors.cyan(`${icons.ok} Dry run complete`));\n console.log(` ${colors.dim(\"Registry URL:\")} ${result.registryUrl}`);\n console.log();\n return;\n }\n\n if (result.status === \"error\") {\n console.log();\n console.log(colors.error(`${icons.err} Publish failed`));\n if (result.error) {\n console.log(` ${colors.dim(\"Error:\")} ${result.error}`);\n }\n if (result.deployResults && result.deployResults.length > 0) {\n const failures = result.deployResults.filter((r: any) => !r.success);\n if (failures.length > 0) {\n console.log();\n for (const f of failures) {\n const errorLine = (f.error ?? \"Failed\").split(\"\\n\")[0];\n console.log(` ${colors.error(icons.err)} ${f.key}: ${errorLine}`);\n }\n }\n }\n console.log();\n process.exit(1);\n }\n\n if (result.status === \"published\") {\n console.log();\n console.log(colors.green(`${icons.ok} Published successfully`));\n console.log(` ${colors.dim(\"Registry URL:\")} ${result.registryUrl}`);\n if (result.txHash) {\n console.log(` ${colors.dim(\"Transaction:\")} ${result.txHash}`);\n }\n if (result.built && result.built.length > 0) {\n console.log(` ${colors.dim(\"Built:\")} ${result.built.join(\", \")}`);\n }\n if (result.skipped && result.skipped.length > 0) {\n console.log(` ${colors.dim(\"Skipped:\")} ${result.skipped.join(\", \")}`);\n }\n if (result.deployResults) {\n const warnings = result.deployResults.flatMap((r: any) => r.warnings ?? []);\n if (warnings.length > 0) {\n console.log();\n console.log(` ${colors.yellow(\"⚠\")} Build warnings:`);\n for (const w of warnings) {\n console.log(` ${colors.dim(w)}`);\n }\n }\n }\n console.log();\n return;\n }\n }\n\n if (descriptor.key === \"rollback\") {\n const rollbackResult = result as any;\n if (rollbackResult.status === \"error\") {\n console.log();\n console.log(colors.error(`${icons.err} Roll back failed`));\n if (rollbackResult.error) {\n console.log(` ${colors.dim(\"Error:\")} ${rollbackResult.error}`);\n }\n if (rollbackResult.verification) {\n console.log();\n for (const check of rollbackResult.verification) {\n const mark = check.ok ? colors.green(icons.ok) : colors.error(icons.err);\n const reason = check.reason ? colors.dim(` — ${check.reason}`) : \"\";\n console.log(` ${mark} ${check.slot}${reason}`);\n }\n }\n console.log();\n process.exit(1);\n }\n\n if (rollbackResult.status === \"dry-run\") {\n console.log();\n console.log(colors.cyan(`${icons.ok} Rollback dry run complete`));\n console.log(` ${colors.dim(\"Registry URL:\")} ${rollbackResult.registryUrl}`);\n console.log();\n return;\n }\n\n console.log();\n console.log(colors.green(`${icons.ok} Rolled back`));\n console.log(` ${colors.dim(\"Registry URL:\")} ${rollbackResult.registryUrl}`);\n if (rollbackResult.txHash) {\n console.log(` ${colors.dim(\"Transaction:\")} ${rollbackResult.txHash}`);\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"deploy\") {\n const deployResult = result as any;\n if (deployResult.status === \"list\") {\n console.log();\n console.log(colors.cyan(\"Recent publishes (audit trail)\"));\n for (const entry of deployResult.history ?? []) {\n console.log(\n ` ${entry.blockTimestamp} ${colors.dim(`block ${entry.blockHeight}`)}${entry.publishedAt ? colors.dim(` ${entry.publishedAt}`) : \"\"}`,\n );\n }\n console.log();\n return;\n }\n if (deployResult.fingerprint) {\n console.log(` ${colors.dim(\"Fingerprint:\")} ${deployResult.fingerprint}`);\n }\n if (deployResult.status === \"dry-run\") {\n console.log();\n console.log(colors.cyan(`${icons.ok} Dry run complete`));\n console.log(` ${colors.dim(\"Registry URL:\")} ${deployResult.registryUrl}`);\n console.log();\n return;\n }\n\n if (deployResult.status === \"error\") {\n console.log();\n console.log(colors.error(`${icons.err} Deploy failed`));\n if (deployResult.error) {\n console.log(` ${colors.dim(\"Error:\")} ${deployResult.error}`);\n }\n if (deployResult.deployResults && deployResult.deployResults.length > 0) {\n const failures = deployResult.deployResults.filter((r: any) => !r.success);\n if (failures.length > 0) {\n console.log();\n for (const f of failures) {\n const errorLine = (f.error ?? \"Failed\").split(\"\\n\")[0];\n console.log(` ${colors.error(icons.err)} ${f.key}: ${errorLine}`);\n }\n }\n }\n console.log();\n process.exit(1);\n }\n\n if (deployResult.status === \"deployed\") {\n console.log();\n console.log(colors.green(`${icons.ok} Deployed successfully`));\n console.log(` ${colors.dim(\"Registry URL:\")} ${deployResult.registryUrl}`);\n if (deployResult.txHash) {\n console.log(` ${colors.dim(\"Transaction:\")} ${deployResult.txHash}`);\n }\n if (deployResult.built && deployResult.built.length > 0) {\n console.log(` ${colors.dim(\"Built:\")} ${deployResult.built.join(\", \")}`);\n }\n if (deployResult.skipped && deployResult.skipped.length > 0) {\n console.log(` ${colors.dim(\"Skipped:\")} ${deployResult.skipped.join(\", \")}`);\n }\n if (deployResult.deployResults) {\n const warnings = deployResult.deployResults.flatMap((r: any) => r.warnings ?? []);\n if (warnings.length > 0) {\n console.log();\n console.log(` ${colors.yellow(\"⚠\")} Build warnings:`);\n for (const w of warnings) {\n console.log(` ${colors.dim(w)}`);\n }\n }\n }\n if (deployResult.image) {\n console.log(` ${colors.dim(\"Image:\")} ${deployResult.image}`);\n }\n if (deployResult.service) {\n console.log(` ${colors.dim(\"Railway:\")} deployed ${deployResult.service}`);\n }\n console.log();\n return;\n }\n\n if (deployResult.status === \"published\") {\n console.log();\n console.log(colors.yellow(`${icons.err} Config published, but a deploy leg failed`));\n console.log(` ${colors.dim(\"Registry URL:\")} ${deployResult.registryUrl}`);\n if (deployResult.txHash) {\n console.log(` ${colors.dim(\"Transaction:\")} ${deployResult.txHash}`);\n }\n if (deployResult.error) {\n console.log(` ${colors.dim(\"Error:\")} ${deployResult.error}`);\n }\n console.log();\n process.exit(1);\n }\n }\n\n if (descriptor.key === \"infraExport\") {\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n return;\n }\n } catch (error) {\n console.error(`[CLI] ${error instanceof Error ? error.message : String(error)}`);\n process.exit(1);\n }\n}\n\nvoid main().catch((error) => {\n console.error(\"[CLI] Fatal error:\", error);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,SAAS,gBAAgB,QAStB;CACD,QAAQ,IAAI;CACZ,QAAQ,IAAIA,qBAAO,KAAKC,qB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,MAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG;EAC/E,QAAQ,KAAK,CAAC;CAChB;AACF;AAEK,KAAK,CAAC,CAAC,OAAO,UAAU;CAC3B,QAAQ,MAAM,sBAAsB,KAAK;CACzC,QAAQ,KAAK,CAAC;AAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"cli.cjs","names":["colors","frames","icons","gradients","formatDuration","sumPhaseDurations","compareSemver","findCommandDescriptor","parseCommandInput","findConfigPath","dirname","resolveFrameworkPackage","createPluginRuntime","bosPlugin","p","readAuthoredConfigInput","getNetworkIdForAccount","getRegistryNamespaceForAccount","listPublishKeys","promptInitBasic","fetchInitParent","promptInitOverrides","runDockerComposeUp","MISSING_CONFIG_MESSAGE","existsSync","watch","readFile","resolve"],"sources":["../src/cli.ts"],"sourcesContent":["import { existsSync, watch } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { dirname, resolve } from \"node:path\";\nimport * as p from \"@clack/prompts\";\nimport { findCommandDescriptor } from \"./cli/catalog\";\nimport { resolveFrameworkPackage } from \"./cli/framework-version\";\nimport { printHelp } from \"./cli/help\";\nimport { runDockerComposeUp } from \"./cli/init\";\nimport { parseCommandInput } from \"./cli/parse\";\nimport { promptInitBasic, promptInitOverrides } from \"./cli/prompts\";\nimport { compareSemver } from \"./cli/status\";\nimport { formatDuration, sumPhaseDurations } from \"./cli/timing\";\nimport { fetchInitParent } from \"./commands/init\";\nimport { findConfigPath, MISSING_CONFIG_MESSAGE, readAuthoredConfigInput } from \"./config\";\nimport type {\n DevOptions,\n DevResult,\n InitOptions,\n InitResult,\n KeyPublishOptions,\n KillOptions,\n KillResult,\n LogsOptions,\n LogsResult,\n OverrideSection,\n PsResult,\n StartOptions,\n StartResult,\n TypecheckWorkspaceResult,\n} from \"./contract\";\nimport type { StartSummary } from \"./dev-program\";\nimport { getRegistryNamespaceForAccount } from \"./fastkv\";\nimport { listPublishKeys } from \"./near-cli\";\nimport { getNetworkIdForAccount } from \"./network\";\nimport bosPlugin from \"./plugin\";\nimport { type ProgressEvent, pluginEvents } from \"./progress\";\nimport { installBundleFetchFromEnv } from \"./resolver\";\nimport { createPluginRuntime } from \"./sdk\";\nimport { printBanner } from \"./utils/banner\";\nimport { colors, frames, gradients, icons } from \"./utils/theme\";\n\nfunction printConfigView(result: {\n account: string;\n domain?: string;\n staging?: { domain: string };\n app?: {\n host: { name?: string; development: string; production?: string };\n ui: { name?: string; development?: string; production?: string; ssr?: string };\n api: { name?: string; development?: string; production?: string; proxy?: string };\n };\n}) {\n console.log();\n console.log(colors.cyan(frames.top(52)));\n console.log(` ${icons.app} ${gradients.cyber(\"CONFIG\")}`);\n console.log(colors.cyan(frames.bottom(52)));\n console.log();\n\n console.log(` ${colors.dim(\"Account\")} ${colors.cyan(result.account)}`);\n console.log(` ${colors.dim(\"Domain\")} ${colors.white(result.domain ?? \"not configured\")}`);\n if (result.staging) {\n console.log(` ${colors.dim(\"Staging\")} ${colors.magenta(result.staging.domain)}`);\n }\n console.log();\n}\n\nfunction formatTimeAgo(isoTimestamp: string): string {\n const now = Date.now();\n const then = new Date(isoTimestamp).getTime();\n const diffMs = now - then;\n const diffMins = Math.floor(diffMs / 60_000);\n if (diffMins < 1) return \"just now\";\n if (diffMins < 60) return `${diffMins} minute${diffMins > 1 ? \"s\" : \"\"} ago`;\n const diffHours = Math.floor(diffMins / 60);\n if (diffHours < 24) return `${diffHours} hour${diffHours > 1 ? \"s\" : \"\"} ago`;\n const diffDays = Math.floor(diffHours / 24);\n if (diffDays < 30) return `${diffDays} day${diffDays > 1 ? \"s\" : \"\"} ago`;\n return isoTimestamp.split(\"T\")[0] ?? isoTimestamp;\n}\n\nconst RETIRED_BOOTSTRAP_STUBS = [\n \"ui/src/entry.ts\",\n \"ui/src/hydrate.tsx\",\n \"ui/src/router.server.tsx\",\n \"ui/src/compose.ts\",\n];\n\n/**\n * Hand-modified bootstrap stubs retire as conflicted (backed up, then\n * deleted) — print the mechanical port into the authored seams (ADR 0023).\n */\nfunction printStubMigrationGuide(retiredConflicted: string[] | undefined) {\n const handModified = (retiredConflicted ?? []).filter((f) => RETIRED_BOOTSTRAP_STUBS.includes(f));\n if (handModified.length === 0) return;\n console.log(` ${colors.yellow(\"Port your stub customizations into the authored seams:\")}`);\n console.log(\n ` ${colors.dim(\"- defaultErrorComponent / defaultPendingComponent / defaultNotFoundComponent\")}`,\n );\n console.log(\n ` ${colors.dim(\" → set them inside the createRouter factory in ui/src/router.tsx (after ...opts)\")}`,\n );\n console.log(\n ` ${colors.dim(\"- apiConnectionError copy + SSR locale config (locales, defaultLocale, cookieName)\")}`,\n );\n console.log(\n ` ${colors.dim(\" → export apiConnectionError / appLocale from ui/src/app.ts (see the scaffold template)\")}`,\n );\n console.log(` ${colors.dim(\" backed-up originals: .bos/sync-backup/<timestamp>/\")}`);\n}\n\nfunction printTimingSummary(timings: Array<{ name: string; durationMs: number }> | undefined) {\n if (!timings || timings.length === 0) return;\n\n console.log(` ${colors.dim(\"Timings:\")}`);\n for (const timing of timings) {\n console.log(` ${colors.dim(timing.name.padEnd(22))} ${formatDuration(timing.durationMs)}`);\n }\n console.log(\n ` ${colors.dim(\"total\".padEnd(22))} ${formatDuration(sumPhaseDurations(timings))}`,\n );\n}\n\nfunction printStartSummary(summary: StartSummary) {\n console.log();\n console.log(` ${colors.dim(\"Config Source:\")} ${summary.configSource}`);\n if (summary.configSourceHttp) {\n console.log(` ${colors.dim(summary.configSourceHttp)}`);\n }\n console.log(` ${colors.dim(\"Account:\")} ${summary.account}`);\n console.log(` ${colors.dim(\"Domain:\")} ${summary.domain ?? \"not configured\"}`);\n console.log();\n console.log(` ${colors.dim(\"Modules:\")}`);\n console.log(` ${colors.dim(\"HOST\")} → ${summary.modules.host ?? \"local\"}`);\n console.log(` ${colors.dim(\"UI\")} → ${summary.modules.ui ?? \"local\"}`);\n console.log(` ${colors.dim(\"API\")} → ${summary.modules.api ?? \"local\"}`);\n if (summary.modules.auth) {\n console.log(` ${colors.dim(\"AUTH\")} → ${summary.modules.auth}`);\n }\n if (summary.warnings.length > 0) {\n console.log();\n for (const w of summary.warnings) {\n console.log(` ${colors.yellow(w)}`);\n }\n }\n console.log();\n}\n\nfunction clearSpinnerStopLine() {\n if (!process.stdout.isTTY) return;\n process.stdout.write(\"\\u001B[1A\\u001B[2K\\u001B[1G\");\n}\n\nasync function warnIfOutdated(client: any, command: string): Promise<void> {\n if (![\"dev\", \"build\", \"start\"].includes(command)) return;\n\n try {\n const status = await client.status();\n if (status.status === \"error\" || !status.packages) return;\n\n const frameworkPackages = [\"everything-dev\", \"every-plugin\"];\n\n const linked = status.packages.filter((p: { isLinked?: boolean }) => p.isLinked);\n const outdated = status.packages.filter(\n (p: { name: string; installed?: string; latest?: string; isLinked?: boolean }) =>\n !p.isLinked &&\n p.installed &&\n p.latest &&\n compareSemver(p.installed, p.latest) < 0 &&\n frameworkPackages.includes(p.name),\n );\n\n if (linked.length > 0) {\n for (const pkg of linked) {\n console.log(colors.dim(` ${pkg.name} is linked locally (v${pkg.installed})`));\n }\n }\n\n if (outdated.length === 0) return;\n\n const warn = (line: string) => {\n if (command === \"dev\" || command === \"start\") process.stderr.write(`${line}\\n`);\n else console.log(line);\n };\n warn(\"\");\n warn(colors.yellow(` ! Outdated packages detected:`));\n for (const pkg of outdated) {\n warn(colors.dim(` ${pkg.name} ${pkg.installed} → ${pkg.latest}`));\n }\n warn(\n colors.dim(\n ` Run ${colors.cyan(\"bos upgrade\")} to update packages and sync template files.`,\n ),\n );\n warn(\"\");\n } catch {\n // silently ignore if status check fails\n }\n}\n\nasync function main() {\n const args = process.argv.slice(2);\n\n if (args.includes(\"--help\") || args.includes(\"-h\")) {\n printHelp();\n return;\n }\n\n const invocationArgs = args.length > 0 ? args : [\"dev\"];\n const command = invocationArgs[0] ?? \"dev\";\n\n const commandMatch = findCommandDescriptor(invocationArgs);\n if (!commandMatch) {\n console.error(`Unknown command: ${command}`);\n process.exit(1);\n }\n\n const { descriptor, consumed } = commandMatch;\n const commandArgs = invocationArgs.slice(consumed);\n\n // Parse before the plugin boot: `start --config-path` steers the whole CLI,\n // not just the stack — the plugin initialize resolves and pin-validates the\n // boot config, so it must be the config the command will actually run.\n let parsedInput: unknown;\n try {\n parsedInput = parseCommandInput(descriptor, commandArgs);\n } catch (error) {\n console.error(`[CLI] ${error instanceof Error ? error.message : String(error)}`);\n process.exit(1);\n }\n const bootInput = parsedInput as { configPath?: string };\n\n const cwdConfigPath = findConfigPath();\n const configPath = bootInput.configPath ?? cwdConfigPath;\n installBundleFetchFromEnv({ configPath });\n\n const projectDir = cwdConfigPath ? dirname(cwdConfigPath) : undefined;\n const edResolved = projectDir ? resolveFrameworkPackage(projectDir, \"everything-dev\") : undefined;\n const displayVersion = edResolved?.installedVersion\n ? `${edResolved.installedVersion}${edResolved.isLinked ? \" (linked)\" : \"\"}`\n : undefined;\n if (!process.env.BOS_NO_BANNER) {\n printBanner(\"everything-dev\", displayVersion);\n }\n\n const runtime = createPluginRuntime({\n registry: {\n bos: { module: bosPlugin },\n },\n secrets: {},\n });\n\n const pluginRuntime: any = runtime;\n const loadPlugin = pluginRuntime.usePlugin.bind(pluginRuntime);\n const plugin = await loadPlugin(\"bos\", {\n variables: {\n configPath: configPath ?? undefined,\n configDir: cwdConfigPath ? dirname(cwdConfigPath) : undefined,\n },\n secrets: {},\n });\n\n const client = plugin.createClient();\n\n const outdatedWarning = warnIfOutdated(client, command);\n\n try {\n const input = parsedInput;\n\n const rollbackInput = input as {\n listOnly?: boolean;\n version?: string;\n previous?: boolean;\n [key: string]: unknown;\n };\n if (\n descriptor.key === \"rollback\" &&\n !rollbackInput.listOnly &&\n !rollbackInput.version &&\n !rollbackInput.previous\n ) {\n const listing = await (client as any).rollback({ ...rollbackInput, listOnly: true });\n if (listing.status !== \"list\" || !listing.history?.length) {\n console.error(listing.error ?? \"No publish history found\");\n process.exit(1);\n }\n console.log();\n const selection = await p.select({\n message: \"Roll back to which publish?\",\n options: listing.history.map(\n (entry: {\n blockHeight: number;\n blockTimestamp: string;\n txHash?: string;\n summary: string;\n }) => ({\n value: String(entry.blockHeight),\n label: `${entry.blockTimestamp} (block ${entry.blockHeight})`,\n hint: entry.summary,\n }),\n ),\n });\n if (p.isCancel(selection)) {\n return;\n }\n rollbackInput.version = selection as string;\n }\n\n if (descriptor.key === \"keyPublish\") {\n const keyPublishInput = input as KeyPublishOptions;\n if (keyPublishInput.removeOldKeys === undefined) {\n if (process.stdin.isTTY) {\n const authored = configPath ? await readAuthoredConfigInput(dirname(configPath)) : null;\n const account =\n keyPublishInput.env === \"staging\"\n ? (authored?.staging?.account ?? authored?.account)\n : authored?.account;\n let listed: string[] | null = null;\n if (account) {\n const network = getNetworkIdForAccount(account);\n const contract = getRegistryNamespaceForAccount(account, keyPublishInput.registry);\n try {\n listed = await listPublishKeys({ account, contract, network });\n } catch {\n listed = null;\n }\n }\n if (listed?.length) {\n const removeOldKeys = await p.confirm({\n message: `Remove ${listed.length} existing publish key${listed.length > 1 ? \"s\" : \"\"}?`,\n initialValue: true,\n });\n if (p.isCancel(removeOldKeys)) {\n return;\n }\n keyPublishInput.removeOldKeys = removeOldKeys;\n } else {\n keyPublishInput.removeOldKeys = true;\n }\n } else {\n keyPublishInput.removeOldKeys = true;\n }\n }\n }\n\n if (descriptor.key === \"dev\") {\n const devSpinner = p.spinner();\n devSpinner.start(\"Starting dev environment\");\n\n const devPhaseLabels: Record<string, string> = {\n \"shared deps\": \"Preparing config...\",\n install: \"Installing dependencies...\",\n build: \"Building...\",\n \"resolve config\": \"Resolving config...\",\n ports: \"Finding available ports...\",\n \"docker compose up\": \"Starting local Postgres...\",\n \"generate artifacts\": \"Generating code artifacts...\",\n };\n\n const onDevProgress = (event: ProgressEvent) => {\n const label = devPhaseLabels[event.phase] ?? event.phase;\n if (event.status === \"running\") {\n devSpinner.message(label);\n }\n };\n pluginEvents.on(\"progress\", onDevProgress);\n\n let result: DevResult;\n try {\n result = await client.dev(input as DevOptions);\n } finally {\n pluginEvents.off(\"progress\", onDevProgress);\n }\n\n if (result.status === \"error\") {\n devSpinner.stop(\"Failed\");\n console.error(`[CLI] ${result.description}`);\n process.exit(1);\n }\n\n devSpinner.stop();\n clearSpinnerStopLine();\n\n const session = result.session;\n void outdatedWarning;\n if (session) {\n const { devApp } = await import(\"./dev-session\");\n devApp(\n projectDir ?? process.cwd(),\n session.orchestrator,\n session.services,\n session.runtimeConfig,\n session.envGenerated,\n session.shellEnv,\n );\n }\n return;\n }\n\n if (descriptor.key === \"start\") {\n const startSpinner = p.spinner();\n startSpinner.start(\"Starting production environment\");\n\n const startPhaseLabels: Record<string, string> = {\n config: \"Preparing config...\",\n \"generate artifacts\": \"Generating code artifacts...\",\n };\n\n const onStartProgress = (event: ProgressEvent) => {\n const label = startPhaseLabels[event.phase] ?? event.phase;\n if (event.status === \"running\") {\n startSpinner.message(label);\n }\n };\n pluginEvents.on(\"progress\", onStartProgress);\n\n let result: StartResult;\n try {\n result = await client.start(input as StartOptions);\n } finally {\n pluginEvents.off(\"progress\", onStartProgress);\n }\n\n if (result.status === \"error\") {\n startSpinner.stop(\"Failed\");\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n\n startSpinner.stop(\"Ready\");\n\n const session = result.session;\n const summary = result.summary;\n void outdatedWarning;\n if (session) {\n if (summary) {\n printStartSummary(summary);\n }\n const { startApp } = await import(\"./dev-session\");\n startApp(\n projectDir ?? process.cwd(),\n session.orchestrator,\n session.services,\n session.runtimeConfig,\n session.envGenerated,\n session.shellEnv,\n );\n }\n return;\n }\n\n if (descriptor.key === \"init\") {\n let initInput: InitOptions = { ...(input as InitOptions) };\n\n if (!initInput.noInteractive) {\n const basic = await promptInitBasic({\n extends: initInput.extends,\n account: initInput.account,\n domain: initInput.domain,\n });\n\n let parentPluginKeys: string[] = [];\n let parentConfig: {\n title?: string;\n description?: string;\n plugins?: Record<string, unknown>;\n } | null = null;\n\n const fetchSpinner = p.spinner();\n fetchSpinner.start(\"Fetching parent config\");\n try {\n const parent = await fetchInitParent(basic.extendsAccount, basic.extendsGateway);\n parentConfig = parent.parentConfig;\n parentPluginKeys = parent.parentPluginKeys;\n } catch {\n fetchSpinner.stop(\"Config not found\");\n console.error(\n `[CLI] No config found at bos://${basic.extendsAccount}/${basic.extendsGateway}`,\n );\n process.exit(1);\n }\n fetchSpinner.stop(\"Config fetched\");\n\n if (\n typeof parentConfig?.title === \"string\" &&\n parentConfig.title.trim() &&\n typeof parentConfig?.description === \"string\" &&\n parentConfig.description.trim()\n ) {\n const shouldContinue = await p.confirm({\n message: `You will be extending ${parentConfig.title} - ${parentConfig.description}. Continue?`,\n initialValue: true,\n });\n\n if (p.isCancel(shouldContinue) || !shouldContinue) {\n process.exit(0);\n }\n }\n\n const overrides = await promptInitOverrides({\n parentPluginKeys,\n plugins: initInput.plugins,\n overrides: initInput.overrides as OverrideSection[] | undefined,\n level: initInput.level,\n });\n\n const directory = initInput.directory || basic.domain || basic.extendsGateway;\n\n initInput = {\n ...initInput,\n extends: `bos://${basic.extendsAccount}/${basic.extendsGateway}`,\n directory,\n account: basic.account,\n domain: basic.domain || undefined,\n plugins: overrides.plugins,\n overrides: overrides.overrides,\n level: overrides.level ?? initInput.level,\n noInteractive: true,\n };\n }\n\n const initSpinner = p.spinner();\n initSpinner.start(\"Initializing project\");\n\n const phaseLabels: Record<string, string> = {\n \"parent config\": \"Fetching parent config...\",\n \"template source\": \"Resolving template source...\",\n \"scaffold project\": \"Creating project scaffold...\",\n \"copy files\": \"Copying template files...\",\n \"personalize config\": \"Personalizing config...\",\n \"write snapshot\": \"Writing snapshot...\",\n \"resolve config\": \"Resolving config...\",\n \"generate env/docker\": \"Generating environment config...\",\n \"create env file\": \"Creating .env file...\",\n \"install dependencies\": \"Installing dependencies...\",\n \"generate types\": \"Generating types...\",\n \"generate migrations\": \"Generating database migrations...\",\n \"generate code artifacts\": \"Generating code artifacts...\",\n };\n\n const onProgress = (event: ProgressEvent) => {\n const label = phaseLabels[event.phase] ?? event.phase;\n if (event.status === \"running\") {\n initSpinner.message(label);\n }\n };\n pluginEvents.on(\"progress\", onProgress);\n\n let result: InitResult;\n try {\n result = await client.init(initInput);\n } finally {\n pluginEvents.off(\"progress\", onProgress);\n }\n\n if (result.status === \"error\") {\n initSpinner.stop(\"Failed\");\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n\n initSpinner.stop(\"Project initialized\");\n\n console.log(` ${colors.dim(\"Extends:\")} ${result.extends}`);\n console.log(` ${colors.dim(\"Directory:\")} ${result.directory}`);\n if (result.account) console.log(` ${colors.dim(\"Account:\")} ${result.account}`);\n if (result.domain) console.log(` ${colors.dim(\"Domain:\")} ${result.domain}`);\n if (result.overrides && result.overrides.length > 0)\n console.log(` ${colors.dim(\"Overrides:\")} ${result.overrides.join(\", \")}`);\n if (result.plugins && result.plugins.length > 0)\n console.log(` ${colors.dim(\"Plugins:\")} ${result.plugins.join(\", \")}`);\n console.log(` ${colors.dim(\"Files copied:\")} ${result.filesCopied}`);\n printTimingSummary(result.timings);\n console.log();\n console.log(colors.dim(\" Next steps:\"));\n console.log(colors.dim(` cd ${result.directory}`));\n if (!initInput.noInstall) {\n console.log(colors.dim(\" pnpm run dev\"));\n } else {\n console.log(colors.dim(\" pnpm install\"));\n console.log(colors.dim(\" pnpm run dev\"));\n }\n console.log();\n\n if (initInput.noInteractive !== true && !initInput.noInstall && result.targetDir) {\n const shouldStartDocker = await p.confirm({\n message: \"Run docker compose up -d --wait?\",\n initialValue: true,\n });\n\n if (shouldStartDocker === true) {\n const dockerSpinner = p.spinner();\n dockerSpinner.start(\"Starting Docker services\");\n const compose = await runDockerComposeUp(result.targetDir);\n if (compose.ok) {\n dockerSpinner.stop(\"Docker services ready\");\n } else {\n dockerSpinner.stop(\"Docker services not started\");\n p.log.warn(\n `docker compose up -d --wait failed${compose.tail ? `:\\n${compose.tail}` : \"\"}`,\n );\n }\n }\n }\n\n return;\n }\n\n const result = await (client as any)[descriptor.key](input);\n\n if (descriptor.key === \"dbStudio\") {\n if (result.status === \"error\") {\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n\n return;\n }\n\n if (descriptor.key === \"dbDoctor\") {\n if (result.status === \"error\") {\n console.error(`[CLI] ${result.error || \"Diagnosis failed\"}`);\n process.exit(1);\n }\n\n const statusIcon = (() => {\n switch (result.diagnosis) {\n case \"healthy\":\n return \"✓\";\n case \"empty\":\n return \"○\";\n case \"unapplied\":\n return \"○\";\n case \"untracked-existing-schema\":\n return \"○\";\n case \"drift-safe-repair\":\n return \"⚠\";\n case \"drift-manual\":\n return \"✗\";\n default:\n return \"?\";\n }\n })();\n\n console.log(`\\n${statusIcon} ${result.plugin}`);\n console.log(` ${colors.dim(`Journal:`)} ${result.journalSchema}.${result.journalTable}`);\n console.log(` ${colors.dim(`Local migrations:`)} ${result.localMigrationCount}`);\n console.log(` ${colors.dim(`Applied hashes:`)} ${result.appliedHashCount}`);\n if (result.expectedTables.length > 0) {\n console.log(` ${colors.dim(`Expected tables:`)} ${result.expectedTables.join(\", \")}`);\n }\n if (result.missingTables.length > 0) {\n console.log(` ${colors.yellow(`Missing tables:`)} ${result.missingTables.join(\", \")}`);\n }\n console.log(` ${colors.dim(`Diagnosis:`)} ${result.diagnosis}`);\n if (result.workspaceDir) {\n console.log(` ${colors.dim(`Workspace:`)} ${result.workspaceDir}`);\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"dbRepair\") {\n if (result.status === \"refused\") {\n console.log(\n `\\n${colors.yellow(\"!\")} Repair refused for ${result.diagnosis?.plugin ?? result.message}`,\n );\n console.log(` ${result.message}`);\n console.log();\n process.exit(0);\n }\n\n if (result.status === \"error\") {\n console.error(`\\n${colors.error(\"✗\")} Repair failed`);\n console.error(` ${result.message}`);\n console.error();\n process.exit(1);\n }\n\n console.log(`\\n${colors.green(\"✓\")} Repair complete`);\n console.log(` ${result.message}`);\n console.log();\n return;\n }\n\n if (descriptor.key === \"config\") {\n if (!result.config) {\n console.error(MISSING_CONFIG_MESSAGE);\n process.exit(1);\n }\n\n printConfigView(result.config);\n process.stdout.write(`${JSON.stringify(result.config, null, 2)}\\n`);\n return;\n }\n\n if (descriptor.key === \"sync\") {\n if ((input as any).json) {\n console.log(JSON.stringify(result, null, 2));\n return;\n }\n console.log();\n if (result.status === \"error\") {\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n if (result.status === \"dry-run\") {\n console.log(colors.cyan(`${icons.ok} Dry run — no files written`));\n } else {\n console.log(colors.green(`${icons.ok} Synced`));\n }\n const hasRetirement =\n (result.retired?.length ?? 0) > 0 || (result.retiredConflicted?.length ?? 0) > 0;\n if (\n result.updated.length > 0 ||\n result.added.length > 0 ||\n result.conflicted.length > 0 ||\n hasRetirement\n ) {\n console.log(\n ` ${colors.dim(\"Sync results:\")} ${result.updated.length} updated, ${result.added.length} added, ${result.conflicted.length} conflicted`,\n );\n if (result.updated.length > 0) {\n for (const f of result.updated) console.log(` ${colors.dim(f)}`);\n }\n if (result.added.length > 0) {\n for (const f of result.added) console.log(` ${colors.dim(f)}`);\n }\n if (result.conflicted.length > 0) {\n console.log(\n ` ${colors.yellow(\"Conflicted\")} (template applied, your changes backed up):`,\n );\n if (result.backupDir) console.log(` ${colors.dim(result.backupDir)}`);\n for (const f of result.conflicted) console.log(` ${colors.dim(f)}`);\n }\n if (hasRetirement) {\n console.log(` ${colors.yellow(\"Retired\")} (replaced by generated stubs — ADR 0023):`);\n if (result.retiredBackupDir) console.log(` ${colors.dim(result.retiredBackupDir)}`);\n for (const f of result.retiredConflicted ?? []) {\n console.log(` ${colors.dim(`${f} (backed up)`)}`);\n }\n for (const f of result.retired ?? []) console.log(` ${colors.dim(f)}`);\n printStubMigrationGuide(result.retiredConflicted);\n }\n }\n if (\n result.updated.length === 0 &&\n result.added.length === 0 &&\n result.conflicted.length === 0 &&\n !hasRetirement\n ) {\n console.log(` ${colors.dim(\"Already up to date\")}`);\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"upgrade\") {\n if ((input as any).json) {\n console.log(JSON.stringify(result, null, 2));\n return;\n }\n console.log();\n if (result.status === \"error\") {\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n if (result.status === \"dry-run\") {\n console.log(colors.cyan(`${icons.ok} Dry run — no changes applied`));\n } else {\n console.log(colors.green(`${icons.ok} Upgrade complete`));\n }\n const mainPkg = result.packages.find(\n (p: { name: string; from?: string; to: string }) => p.name === \"everything-dev\",\n );\n const versionDelta =\n mainPkg?.from && mainPkg.from !== mainPkg.to ? `${mainPkg.from} → ${mainPkg.to}` : null;\n if (versionDelta) {\n console.log(` ${colors.dim(`Upgraded everything-dev ${versionDelta}`)}`);\n }\n for (const pkg of result.packages) {\n if (pkg.name === \"everything-dev\") continue;\n if (pkg.from && pkg.from !== pkg.to) {\n console.log(` ${colors.dim(`${pkg.name} ${pkg.from} → ${pkg.to}`)}`);\n } else if (!pkg.from) {\n console.log(` ${colors.dim(`${pkg.name} ${pkg.to} (new)`)}`);\n } else {\n console.log(` ${colors.dim(`${pkg.name} ${pkg.to} (up to date)`)}`);\n }\n }\n if (result.changelogUrl) {\n console.log(` Changelog: ${result.changelogUrl}`);\n }\n if (result.selectedPlugins && result.selectedPlugins.length > 0) {\n console.log(` Added plugins: ${result.selectedPlugins.join(\", \")}`);\n }\n if (result.sync) {\n const sync = result.sync;\n const hasRetirement =\n (sync.retired?.length ?? 0) > 0 || (sync.retiredConflicted?.length ?? 0) > 0;\n console.log(` ${colors.dim(\"Sync results:\")}`);\n if (\n sync.updated.length > 0 ||\n sync.added.length > 0 ||\n sync.conflicted.length > 0 ||\n hasRetirement\n ) {\n console.log(\n ` ${sync.updated.length} updated, ${sync.added.length} added, ${sync.conflicted.length} conflicted`,\n );\n if (sync.conflicted.length > 0) {\n console.log(\n ` ${colors.yellow(\"Conflicted\")} (template applied, your changes backed up):`,\n );\n if (sync.backupDir) console.log(` ${colors.dim(sync.backupDir)}`);\n for (const f of sync.conflicted) console.log(` ${colors.dim(f)}`);\n }\n if (hasRetirement) {\n console.log(` ${colors.yellow(\"Retired\")} (replaced by generated stubs — ADR 0023):`);\n if (sync.retiredBackupDir) console.log(` ${colors.dim(sync.retiredBackupDir)}`);\n for (const f of sync.retiredConflicted ?? []) {\n console.log(` ${colors.dim(`${f} (backed up)`)}`);\n }\n for (const f of sync.retired ?? []) console.log(` ${colors.dim(f)}`);\n printStubMigrationGuide(sync.retiredConflicted);\n }\n } else {\n console.log(` ${colors.dim(\"Already up to date\")}`);\n }\n }\n if (result.migrated && result.migrated.length > 0) {\n console.log(` Migrated: ${result.migrated.length} file(s)`);\n for (const f of result.migrated) console.log(` ${colors.dim(f)}`);\n }\n if (versionDelta || (result.sync && result.sync.conflicted.length > 0)) {\n console.log();\n console.log(colors.dim(\" For AI agents:\"));\n const parentRepo = \"nearbuilders/everything-dev\";\n const somedelta =\n mainPkg?.from && mainPkg.to\n ? `v${mainPkg.from.replace(/^[\\^~>=v]+/, \"\")}...v${mainPkg.to.replace(/^[\\^~>=v]+/, \"\")}`\n : \"\";\n console.log(\n colors.dim(\n ` This upgrade applied template changes${somedelta ? ` (${somedelta})` : \"\"}.`,\n ),\n );\n if (result.sync && result.sync.conflicted.length > 0) {\n console.log(\n colors.dim(\n ` ${result.sync.conflicted.length} file(s) had local conflicts — template version applied, backups at ${result.sync.backupDir || \".bos/sync-backup/\"}.`,\n ),\n );\n console.log(\n colors.dim(\n ` If local changes should be preserved upstream, open a PR: https://github.com/${parentRepo}${somedelta ? `/compare/${somedelta}` : \"\"}`,\n ),\n );\n }\n console.log(\n colors.dim(\n \" Load matching intent skills: pnpm dlx @tanstack/intent@latest load everything-dev#...\",\n ),\n );\n console.log(colors.dim(\" Review AGENTS.md — local updates may need merging.\"));\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"status\") {\n console.log();\n if (result.status === \"error\") {\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n console.log(colors.cyan(frames.top(52)));\n console.log(` ${icons.app} ${gradients.cyber(\"STATUS\")}`);\n console.log(colors.cyan(frames.bottom(52)));\n console.log();\n if (result.extends) console.log(` ${colors.dim(\"Extends:\")} ${result.extends}`);\n if (result.account) console.log(` ${colors.dim(\"Account:\")} ${result.account}`);\n if (result.domain) console.log(` ${colors.dim(\"Domain:\")} ${result.domain}`);\n console.log();\n console.log(` ${colors.dim(\"Packages:\")}`);\n for (const pkg of result.packages) {\n const hasUpdate =\n pkg.installed && pkg.latest && compareSemver(pkg.installed, pkg.latest) < 0;\n const versionStr = hasUpdate\n ? `${pkg.installed} → ${pkg.latest}`\n : pkg.installed || \"not installed\";\n const label = hasUpdate ? colors.yellow(versionStr) : colors.dim(versionStr);\n console.log(` ${colors.dim(`${pkg.name}`)} ${label}`);\n }\n console.log();\n if (result.lastSync) {\n const ago = formatTimeAgo(result.lastSync);\n console.log(` ${colors.dim(\"Last sync:\")} ${ago}`);\n } else {\n console.log(` ${colors.dim(\"Last sync:\")} never`);\n }\n const envLabel =\n result.envFile === \"found\"\n ? colors.green(\"found\")\n : result.envFile === \"example-only\"\n ? colors.yellow(\"missing (only .env.example found)\")\n : colors.error(\"missing\");\n console.log(` ${colors.dim(\".env:\")} ${envLabel}`);\n if (result.parentReachable !== undefined) {\n const parentLabel = result.parentReachable\n ? colors.green(\"reachable\")\n : colors.error(\"unreachable\");\n console.log(` ${colors.dim(\"Parent:\")} ${parentLabel}`);\n }\n const hasUpdates = result.packages.some(\n (p: { installed?: string; latest?: string }) =>\n p.installed && p.latest && compareSemver(p.installed, p.latest) < 0,\n );\n if (hasUpdates) {\n console.log();\n console.log(\n colors.dim(\n ` Run ${colors.cyan(\"bos upgrade\")} to update packages and sync template files.`,\n ),\n );\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"ps\") {\n const psResult = result as PsResult;\n console.log();\n if (psResult.status === \"error\") {\n console.error(`[CLI] ${psResult.error || \"Unknown error\"}`);\n process.exit(1);\n }\n const entries = psResult.entries ?? [];\n if (entries.length === 0) {\n console.log(colors.dim(\" No tracked development processes running.\"));\n console.log();\n console.log(\n colors.dim(` Start one with ${colors.cyan(\"bos dev\")} and it will appear here.`),\n );\n console.log();\n return;\n }\n console.log(colors.cyan(frames.top(60)));\n console.log(` ${icons.app} ${gradients.cyber(\"PROCESSES\")}`);\n console.log(colors.cyan(frames.bottom(60)));\n console.log();\n for (const entry of entries) {\n const ageMs = Date.now() - entry.startedAt;\n const ageStr =\n ageMs < 60_000\n ? `${Math.floor(ageMs / 1000)}s`\n : ageMs < 3_600_000\n ? `${Math.floor(ageMs / 60_000)}m`\n : `${Math.floor(ageMs / 3_600_000)}h`;\n const roleTag =\n entry.role === \"workspace-parent\"\n ? colors.magenta(\"parent\")\n : entry.role === \"workspace-child\"\n ? colors.blue(\"child\")\n : colors.dim(\"dev\");\n console.log(` ${colors.green(`pid ${entry.pid}`)} ${roleTag} ${colors.dim(ageStr)}`);\n console.log(` ${colors.dim(\"dir:\")} ${entry.configDir}`);\n if (entry.parentPid !== undefined) {\n console.log(` ${colors.dim(\"parent:\")} ${entry.parentPid}`);\n }\n const portPairs = Object.entries(entry.ports ?? {})\n .filter(([, p]) => typeof p === \"number\")\n .map(([k, v]) => `${k}=${v}`);\n if (portPairs.length > 0) {\n console.log(` ${colors.dim(\"ports:\")} ${portPairs.join(\" \")}`);\n }\n if (entry.budget) {\n console.log(` ${colors.dim(\"budget:\")} [${entry.budget.min}, ${entry.budget.max}]`);\n }\n console.log(` ${colors.dim(\"desc:\")} ${entry.description}`);\n console.log();\n }\n return;\n }\n\n if (descriptor.key === \"logs\") {\n const logsResult = result as LogsResult;\n const opts = input as LogsOptions;\n for (const line of logsResult.lines) {\n console.log(line);\n }\n if (logsResult.lines.length === 0) {\n console.log(colors.dim(` No matching log lines in ${logsResult.logFile}.`));\n }\n if (opts.follow) {\n if (logsResult.logFile === \"unknown\" || !existsSync(logsResult.logFile)) {\n console.log(colors.dim(\" No log file to follow — nothing was found on disk.\"));\n } else {\n const filter = opts.service;\n let byteOffset = 0;\n for (const line of logsResult.lines) byteOffset += Buffer.byteLength(line, \"utf8\") + 1;\n const followMatch = (line: string): boolean => {\n if (!filter) return true;\n const source = /\\] \\[([^\\]]+)\\] \\[(?:OUT|ERR)\\] /.exec(line)?.[1];\n return source === filter || source === `plugin:${filter}`;\n };\n const watcher = watch(logsResult.logFile, (event) => {\n if (event !== \"change\") return;\n void readFile(logsResult.logFile, \"utf8\")\n .then((text) => {\n const newLines = text\n .slice(byteOffset)\n .split(\"\\n\")\n .filter((line) => line.length > 0 && followMatch(line));\n byteOffset = Buffer.byteLength(text, \"utf8\");\n for (const line of newLines) {\n console.log(line);\n }\n })\n .catch(() => {\n // the followed file was rotated or deleted — stop following\n watcher.close();\n });\n });\n console.log(colors.dim(\" Following — Ctrl+C to stop.\"));\n process.on(\"SIGINT\", () => {\n watcher.close();\n process.exit(0);\n });\n }\n }\n return;\n }\n\n if (descriptor.key === \"kill\") {\n const killResult = result as KillResult;\n console.log();\n if (killResult.status === \"error\") {\n console.error(`[CLI] ${killResult.error || \"Unknown error\"}`);\n process.exit(1);\n }\n if (killResult.killed.length > 0) {\n console.log(colors.green(`${icons.ok} Sent ${killResult.killed.length} kill signal(s)`));\n for (const k of killResult.killed) {\n console.log(` ${colors.dim(\"pid\")} ${k.pid} ${colors.dim(k.configDir)}`);\n }\n }\n if (killResult.skipped.length > 0) {\n console.log(colors.yellow(`${icons.err} ${killResult.skipped.length} skipped`));\n for (const s of killResult.skipped) {\n console.log(` ${colors.dim(\"pid\")} ${s.pid} ${colors.dim(s.reason)}`);\n }\n }\n if (killResult.killed.length === 0 && killResult.skipped.length === 0) {\n const opts = input as KillOptions;\n if (opts.all) {\n console.log(colors.dim(\" No tracked processes to kill.\"));\n } else {\n const configPath = findConfigPath();\n const dir = opts.configDir ?? (configPath ? resolve(dirname(configPath)) : process.cwd());\n console.log(colors.dim(` No tracked processes for ${dir}`));\n console.log(colors.dim(` Use ${colors.cyan(\"--all\")} to kill across all directories.`));\n }\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"typesGen\") {\n console.log();\n if (result.status === \"error\") {\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n console.log(colors.green(`${icons.ok} Types generated`));\n if (result.generated.length > 0) {\n console.log(` ${colors.dim(\"Written:\")}`);\n for (const f of result.generated) console.log(` ${colors.dim(f)}`);\n }\n if (result.fetched.length > 0 || result.skipped.length > 0 || result.failed.length > 0) {\n console.log(` ${colors.dim(\"Contract sources:\")}`);\n for (const entry of result.fetched) {\n const space = entry.indexOf(\" \");\n const key = space !== -1 ? entry.slice(0, space) : entry;\n const rest = space !== -1 ? entry.slice(space + 1) : \"\";\n const restSpace = rest.indexOf(\" \");\n const detail = restSpace !== -1 ? rest.slice(restSpace + 1) : \"\";\n console.log(\n ` ${key} ${colors.cyan(\"remote\")}${detail ? ` ${colors.dim(detail)}` : \"\"}`,\n );\n }\n for (const entry of result.skipped) {\n const space = entry.indexOf(\" \");\n const key = space !== -1 ? entry.slice(0, space) : entry;\n const rest = space !== -1 ? entry.slice(space + 1) : \"\";\n if (rest === \"no URL resolved\") {\n console.log(` ${key} ${colors.dim(\"no URL resolved\")}`);\n continue;\n }\n const restSpace = rest.indexOf(\" \");\n const detail = restSpace !== -1 ? rest.slice(restSpace + 1) : \"\";\n console.log(` ${key} ${colors.dim(\"local\")}${detail ? ` ${colors.dim(detail)}` : \"\"}`);\n }\n }\n if (result.failed.length > 0) {\n console.log(` ${colors.yellow(\"Failed:\")}`);\n for (const f of result.failed) {\n const colon = f.indexOf(\": \");\n if (colon !== -1) {\n console.log(` ${colors.error(f.slice(0, colon))}${colors.dim(f.slice(colon))}`);\n } else {\n console.log(` ${colors.error(f)}`);\n }\n }\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"typecheck\") {\n console.log();\n if (result.status === \"error\") {\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n const failed = result.results.filter((r: TypecheckWorkspaceResult) => !r.passed);\n const passed = result.results.filter((r: TypecheckWorkspaceResult) => r.passed);\n console.log(colors.cyan(frames.top(52)));\n console.log(` ${icons.app} ${gradients.cyber(\"TYPECHECK\")}`);\n console.log(colors.cyan(frames.bottom(52)));\n console.log();\n for (const r of result.results) {\n const icon = r.passed ? colors.green(\"✓\") : colors.error(\"✗\");\n console.log(` ${icon} ${r.workspace}`);\n }\n if (result.skipped.length > 0) {\n console.log(` ${colors.dim(`Skipped: ${result.skipped.join(\", \")}`)}`);\n }\n console.log();\n if (failed.length > 0) {\n console.log(` ${colors.error(`${failed.length} failed`)}`);\n for (const f of failed) {\n if (f.error) console.log(` ${colors.dim(f.error)}`);\n }\n console.log();\n process.exit(1);\n }\n console.log(` ${colors.green(`${passed.length} passed`)}`);\n console.log();\n return;\n }\n\n if (descriptor.key === \"mfCheck\") {\n console.log();\n console.log(\n ` ${colors.dim(\"Host\")} ${result.hostReachable ? colors.green(\"OK \") : colors.error(\"FAIL\")} ${\n result.hostVersion ?? \"unreachable\"\n }${result.hostReason ? ` (${result.hostReason})` : \"\"}`,\n );\n for (const r of result.remotes) {\n const tag = r.ok ? colors.green(\"OK \") : colors.error(\"FAIL\");\n console.log(\n ` ${colors.dim(r.role.padEnd(10))} ${tag} ${r.url} pluginVersion=${r.pluginVersion ?? \"?\"}${\n r.reason ? ` ↳ ${r.reason}` : \"\"\n }`,\n );\n }\n console.log();\n if (result.status !== \"ok\") {\n console.log(\n colors.error(\n \" mf-compat: ✗ federation manifests NOT compatible — redeploy affected plugin(s) so pluginVersion and shared versions match host\",\n ),\n );\n console.log();\n process.exit(1);\n }\n console.log(colors.green(\" mf-compat: ✓ all federation manifests compatible\"));\n console.log();\n return;\n }\n\n if (result?.status === \"error\" && descriptor.key !== \"publish\" && descriptor.key !== \"deploy\") {\n console.error(`[CLI] ${result.error || \"Unknown error\"}`);\n process.exit(1);\n }\n\n if (descriptor.key === \"login\") {\n console.log();\n console.log(colors.green(`${icons.ok} Logged in to ${result.siteUrl}`));\n if (result.accountId) console.log(` ${colors.dim(\"Account:\")} ${result.accountId}`);\n if (result.expiresAt) console.log(` ${colors.dim(\"Expires:\")} ${result.expiresAt}`);\n if (result.warning) console.log(` ${colors.yellow(\"⚠\")} ${result.warning}`);\n if (result.publishKey) {\n console.log(\n ` ${colors.dim(\"Publish key:\")} ${result.publishKey.publicKey} ${colors.dim(\n `(${result.publishKey.network}, exported to ${result.publishKey.exportedTo})`,\n )}`,\n );\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"logout\") {\n console.log();\n console.log(colors.green(`${icons.ok} Logged out`));\n if (result.revokedApiKey) console.log(` ${colors.dim(\"Revoked API key\")}`);\n if (result.removedPublishKey) console.log(` ${colors.dim(\"Removed exported publish key\")}`);\n if (result.warning) console.log(` ${colors.yellow(\"⚠\")} ${result.warning}`);\n console.log();\n return;\n }\n\n if (descriptor.key === \"keyPublish\") {\n process.stdout.write(`Generated publish key for ${result.account}\\n`);\n process.stdout.write(` Network: ${result.network}\\n`);\n process.stdout.write(` Allowance: ${result.allowance}\\n`);\n process.stdout.write(`\\n`);\n const secretName = result.env === \"staging\" ? \"NEAR_TESTNET_PRIVATE_KEY\" : \"NEAR_PRIVATE_KEY\";\n if (!process.stdout.isTTY) {\n process.stderr.write(\n ` ⚠ Non-interactive stdout: this private key will be captured in any log or pipe (GitHub Actions logs persist stdout).\\n`,\n );\n }\n process.stdout.write(\n ` Set this as ${secretName} in GitHub Actions or before calling publish:\\n`,\n );\n process.stdout.write(`${secretName}=${result.privateKey}\\n`);\n }\n\n if (descriptor.key === \"pluginAdd\") {\n console.log();\n console.log(colors.green(`${icons.ok} Added plugin ${result.key}`));\n if (result.development) console.log(` ${colors.dim(\"Development:\")} ${result.development}`);\n if (result.production) console.log(` ${colors.dim(\"Production:\")} ${result.production}`);\n console.log();\n return;\n }\n\n if (descriptor.key === \"pluginRemove\") {\n console.log();\n console.log(colors.green(`${icons.ok} Removed plugin ${result.key}`));\n console.log();\n return;\n }\n\n if (descriptor.key === \"pluginList\") {\n console.log();\n console.log(colors.cyan(frames.top(52)));\n console.log(` ${icons.config} ${gradients.cyber(\"PLUGINS\")}`);\n console.log(colors.cyan(frames.bottom(52)));\n console.log();\n if (result.plugins.length === 0) {\n console.log(colors.dim(\" No plugins configured\"));\n } else {\n for (const pluginItem of result.plugins) {\n console.log(` ${colors.cyan(pluginItem.key)}`);\n if (pluginItem.development)\n console.log(` ${colors.dim(\"Development:\")} ${pluginItem.development}`);\n if (pluginItem.production)\n console.log(` ${colors.dim(\"Production:\")} ${pluginItem.production}`);\n }\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"pluginPublish\") {\n console.log();\n console.log(colors.green(`${icons.ok} Published plugin ${result.key}`));\n if (result.path) console.log(` ${colors.dim(\"Path:\")} ${result.path}`);\n if (result.production) console.log(` ${colors.dim(\"Production:\")} ${result.production}`);\n if (result.version) console.log(` ${colors.dim(\"Version:\")} ${result.version}`);\n if (result.fingerprint) console.log(` ${colors.dim(\"Fingerprint:\")} ${result.fingerprint}`);\n console.log();\n return;\n }\n\n if (descriptor.key === \"registryUse\") {\n console.log();\n if (result.status === \"error\") {\n console.error(colors.error(`${icons.err} ${result.error || \"Unknown error\"}`));\n process.exit(1);\n }\n console.log(\n colors.green(\n `${icons.ok} ${result.status === \"dry-run\" ? \"Dry run\" : \"Composed\"} from ${result.from}`,\n ),\n );\n for (const section of result.applied) {\n console.log(` ${colors.green(\"+\")} ${section}`);\n }\n if (result.configPath) {\n console.log(` ${colors.dim(\"Config:\")} ${result.configPath}`);\n }\n if (result.status === \"updated\") {\n console.log(colors.dim(\" Run bos types gen to refresh generated types.\"));\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"publish\") {\n if (result.status === \"dry-run\") {\n console.log();\n console.log(colors.cyan(`${icons.ok} Dry run complete`));\n console.log(` ${colors.dim(\"Registry URL:\")} ${result.registryUrl}`);\n console.log();\n return;\n }\n\n if (result.status === \"error\") {\n console.log();\n console.log(colors.error(`${icons.err} Publish failed`));\n if (result.error) {\n console.log(` ${colors.dim(\"Error:\")} ${result.error}`);\n }\n if (result.deployResults && result.deployResults.length > 0) {\n const failures = result.deployResults.filter((r: any) => !r.success);\n if (failures.length > 0) {\n console.log();\n for (const f of failures) {\n const errorLine = (f.error ?? \"Failed\").split(\"\\n\")[0];\n console.log(` ${colors.error(icons.err)} ${f.key}: ${errorLine}`);\n }\n }\n }\n console.log();\n process.exit(1);\n }\n\n if (result.status === \"published\") {\n console.log();\n console.log(colors.green(`${icons.ok} Published successfully`));\n console.log(` ${colors.dim(\"Registry URL:\")} ${result.registryUrl}`);\n if (result.txHash) {\n console.log(` ${colors.dim(\"Transaction:\")} ${result.txHash}`);\n }\n if (result.built && result.built.length > 0) {\n console.log(` ${colors.dim(\"Built:\")} ${result.built.join(\", \")}`);\n }\n if (result.skipped && result.skipped.length > 0) {\n console.log(` ${colors.dim(\"Skipped:\")} ${result.skipped.join(\", \")}`);\n }\n if (result.deployResults) {\n const warnings = result.deployResults.flatMap((r: any) => r.warnings ?? []);\n if (warnings.length > 0) {\n console.log();\n console.log(` ${colors.yellow(\"⚠\")} Build warnings:`);\n for (const w of warnings) {\n console.log(` ${colors.dim(w)}`);\n }\n }\n }\n console.log();\n return;\n }\n }\n\n if (descriptor.key === \"rollback\") {\n const rollbackResult = result as any;\n if (rollbackResult.status === \"error\") {\n console.log();\n console.log(colors.error(`${icons.err} Roll back failed`));\n if (rollbackResult.error) {\n console.log(` ${colors.dim(\"Error:\")} ${rollbackResult.error}`);\n }\n if (rollbackResult.verification) {\n console.log();\n for (const check of rollbackResult.verification) {\n const mark = check.ok ? colors.green(icons.ok) : colors.error(icons.err);\n const reason = check.reason ? colors.dim(` — ${check.reason}`) : \"\";\n console.log(` ${mark} ${check.slot}${reason}`);\n }\n }\n console.log();\n process.exit(1);\n }\n\n if (rollbackResult.status === \"dry-run\") {\n console.log();\n console.log(colors.cyan(`${icons.ok} Rollback dry run complete`));\n console.log(` ${colors.dim(\"Registry URL:\")} ${rollbackResult.registryUrl}`);\n console.log();\n return;\n }\n\n console.log();\n console.log(colors.green(`${icons.ok} Rolled back`));\n console.log(` ${colors.dim(\"Registry URL:\")} ${rollbackResult.registryUrl}`);\n if (rollbackResult.txHash) {\n console.log(` ${colors.dim(\"Transaction:\")} ${rollbackResult.txHash}`);\n }\n console.log();\n return;\n }\n\n if (descriptor.key === \"deploy\") {\n const deployResult = result as any;\n if (deployResult.status === \"list\") {\n console.log();\n console.log(colors.cyan(\"Recent publishes (audit trail)\"));\n for (const entry of deployResult.history ?? []) {\n console.log(\n ` ${entry.blockTimestamp} ${colors.dim(`block ${entry.blockHeight}`)}${entry.publishedAt ? colors.dim(` ${entry.publishedAt}`) : \"\"}`,\n );\n }\n console.log();\n return;\n }\n if (deployResult.fingerprint) {\n console.log(` ${colors.dim(\"Fingerprint:\")} ${deployResult.fingerprint}`);\n }\n if (deployResult.status === \"dry-run\") {\n console.log();\n console.log(colors.cyan(`${icons.ok} Dry run complete`));\n console.log(` ${colors.dim(\"Registry URL:\")} ${deployResult.registryUrl}`);\n console.log();\n return;\n }\n\n if (deployResult.status === \"error\") {\n console.log();\n console.log(colors.error(`${icons.err} Deploy failed`));\n if (deployResult.error) {\n console.log(` ${colors.dim(\"Error:\")} ${deployResult.error}`);\n }\n if (deployResult.deployResults && deployResult.deployResults.length > 0) {\n const failures = deployResult.deployResults.filter((r: any) => !r.success);\n if (failures.length > 0) {\n console.log();\n for (const f of failures) {\n const errorLine = (f.error ?? \"Failed\").split(\"\\n\")[0];\n console.log(` ${colors.error(icons.err)} ${f.key}: ${errorLine}`);\n }\n }\n }\n console.log();\n process.exit(1);\n }\n\n if (deployResult.status === \"deployed\") {\n console.log();\n console.log(colors.green(`${icons.ok} Deployed successfully`));\n console.log(` ${colors.dim(\"Registry URL:\")} ${deployResult.registryUrl}`);\n if (deployResult.txHash) {\n console.log(` ${colors.dim(\"Transaction:\")} ${deployResult.txHash}`);\n }\n if (deployResult.built && deployResult.built.length > 0) {\n console.log(` ${colors.dim(\"Built:\")} ${deployResult.built.join(\", \")}`);\n }\n if (deployResult.skipped && deployResult.skipped.length > 0) {\n console.log(` ${colors.dim(\"Skipped:\")} ${deployResult.skipped.join(\", \")}`);\n }\n if (deployResult.deployResults) {\n const warnings = deployResult.deployResults.flatMap((r: any) => r.warnings ?? []);\n if (warnings.length > 0) {\n console.log();\n console.log(` ${colors.yellow(\"⚠\")} Build warnings:`);\n for (const w of warnings) {\n console.log(` ${colors.dim(w)}`);\n }\n }\n }\n if (deployResult.image) {\n console.log(` ${colors.dim(\"Image:\")} ${deployResult.image}`);\n }\n if (deployResult.service) {\n console.log(` ${colors.dim(\"Railway:\")} deployed ${deployResult.service}`);\n }\n console.log();\n return;\n }\n\n if (deployResult.status === \"published\") {\n console.log();\n console.log(colors.yellow(`${icons.err} Config published, but a deploy leg failed`));\n console.log(` ${colors.dim(\"Registry URL:\")} ${deployResult.registryUrl}`);\n if (deployResult.txHash) {\n console.log(` ${colors.dim(\"Transaction:\")} ${deployResult.txHash}`);\n }\n if (deployResult.error) {\n console.log(` ${colors.dim(\"Error:\")} ${deployResult.error}`);\n }\n console.log();\n process.exit(1);\n }\n }\n\n if (descriptor.key === \"infraExport\") {\n process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n return;\n }\n } catch (error) {\n console.error(`[CLI] ${error instanceof Error ? error.message : String(error)}`);\n process.exit(1);\n }\n}\n\nvoid main().catch((error) => {\n console.error(\"[CLI] Fatal error:\", error);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,SAAS,gBAAgB,QAStB;CACD,QAAQ,IAAI;CACZ,QAAQ,IAAIA,qBAAO,KAAKC,qBAAO,IAAI,EAAE,CAAC,CAAC;CACvC,QAAQ,IAAI,KAAKC,oBAAM,IAAI,GAAGC,wBAAU,MAAM,QAAQ,GAAG;CACzD,QAAQ,IAAIH,qBAAO,KAAKC,qBAAO,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Q,MAAM,sBAAsB,KAAK;CACzC,QAAQ,KAAK,CAAC;AAChB,CAAC"}
|
package/dist/cli.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { getRegistryNamespaceForAccount } from "./fastkv.mjs";
|
|
3
3
|
import { getNetworkIdForAccount } from "./network.mjs";
|
|
4
|
+
import { installBundleFetchFromEnv } from "./resolver.mjs";
|
|
4
5
|
import { MISSING_CONFIG_MESSAGE, findConfigPath, readAuthoredConfigInput } from "./config.mjs";
|
|
5
6
|
import { colors, frames, gradients, icons } from "./utils/theme.mjs";
|
|
6
7
|
import { createPluginRuntime } from "./sdk.mjs";
|
|
7
8
|
import { runDockerComposeUp } from "./infra/docker.mjs";
|
|
8
|
-
import { installBundleFetchFromEnv } from "./bundle-fs-resolve.mjs";
|
|
9
9
|
import { formatDuration, sumPhaseDurations } from "./cli/timing.mjs";
|
|
10
10
|
import { listPublishKeys } from "./near-cli.mjs";
|
|
11
11
|
import { pluginEvents } from "./progress.mjs";
|