@mean-weasel/lineage 0.1.13 → 0.1.15

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.15
4
+
5
+ - Add a subtle root marker that makes the starting point of each lineage tree immediately recognizable.
6
+ - Add full-asset previews on node hover and keyboard focus while preserving double-click for full details and attempt history.
7
+ - Add a browser-local setting to disable hover previews, plus refresh-state safeguards that keep dismissed previews closed during background updates.
8
+
9
+ ## 0.1.14
10
+
11
+ - Fix isolated channel installs against npm clients that return registry integrity as a flat `dist.integrity` field, while rejecting missing or conflicting identity metadata.
12
+ - Run promotion claim verification through an exact receipt-bound registry install, named production profile, external asset root, and managed writer.
13
+ - Supersede the `0.1.13` candidate, whose packaged channel installer cannot bootstrap registry installs with the affected npm metadata shape.
14
+
3
15
  ## 0.1.13
4
16
 
5
17
  - Isolate stable, preview, and checkout-only development code into attested channel-specific roots with runtime doctor and tamper detection.
package/README.md CHANGED
@@ -19,7 +19,7 @@ lineage-channel install preview
19
19
 
20
20
  By default the installer writes immutable version/integrity roots beneath
21
21
  `~/Library/Application Support/Lineage/runtimes`, plus channel-qualified
22
- launchers in its `bin` directory. Every launcher is pinned to an absolute
22
+ launchers under `~/.local/bin`. Every launcher is pinned to an absolute
23
23
  package root and install receipt; it does not select code from `PATH` at runtime.
24
24
 
25
25
  The three exact channel meanings are:
@@ -131,6 +131,30 @@ matching legacy identity, but refuses a conflicting identity. An unprofiled
131
131
  CLI or service is `legacy-unbound` and read-only; mutating CLI commands and HTTP
132
132
  methods fail with a profile-required error instead of creating a database.
133
133
 
134
+ Checkout fingerprints intentionally change as tracked or untracked source
135
+ changes. To repin an existing development profile, first stop its managed
136
+ service, then run the guarded checkout-only workflow:
137
+
138
+ ```bash
139
+ make repin-dev LINEAGE_DEV_PROFILE=team-development
140
+ ```
141
+
142
+ The underlying explicit command is:
143
+
144
+ ```bash
145
+ npm run lineage:dev -- profile repin-runtime \
146
+ --profile team-development --checkout-root "$PWD" --confirm-write --json
147
+ ```
148
+
149
+ Repin accepts only a verified dev checkout whose canonical root equals
150
+ `--checkout-root`, an owner-only development manifest already pinned to
151
+ dev/checkout, and an available profile writer lease. It atomically replaces
152
+ only `expected_runtime`; profile/database identity, paths, environment,
153
+ service origin, and migrations stay unchanged. Production, preview, package,
154
+ wrong-root, unsafe-manifest, unconfirmed, and active-service cases fail closed.
155
+ The command may prepare a new structurally valid development manifest before
156
+ its database and asset root are cloned.
157
+
134
158
  To create a realistic preview or development database without copying a live
135
159
  SQLite file directly, define a new non-production target profile whose database
136
160
  does not exist, then run:
@@ -321,8 +345,12 @@ npx @mean-weasel/lineage-plugin-installer install --channel latest
321
345
 
322
346
  The installer verifies the plugin artifact checksum and rejects plugin manifests
323
347
  whose version or `lineage.version` does not exactly match the resolved Lineage
324
- package version. The plugin artifact and installer package are released from
325
- this public repository.
348
+ package version. It then creates a dedicated marketplace under the active
349
+ `CODEX_HOME`, registers that marketplace with supported `codex plugin`
350
+ commands, installs the plugin, and verifies that Codex reports the exact version
351
+ as installed and enabled. Use `--target-dir <path>` for a files-only install or
352
+ `--dry-run` for a non-mutating activation plan. The plugin artifact and installer
353
+ package are released from this public repository.
326
354
 
327
355
  Every Lineage release preflights the current operator skill, packs and checksums
328
356
  the exact matching plugin, installs that artifact into a temporary Codex plugin
@@ -331,6 +359,12 @@ or dist-tag mutation is allowed. Release status reports the local version lock
331
359
  and GitHub assets. The installed skill requires isolated channel launchers,
332
360
  named profiles, managed service identity status, and profile-only writes.
333
361
 
362
+ The checkout also exposes `.agents/plugins/marketplace.json`, which points only
363
+ at the checkout plugin and marks it installed by default for new development
364
+ tasks. That repo marketplace is separate from the installer-managed marketplace
365
+ under `CODEX_HOME`; restart Codex and use a brand-new task when validating either
366
+ activation path.
367
+
334
368
  ## Local Development
335
369
 
336
370
  ```bash
@@ -11,6 +11,7 @@ import {
11
11
  readFileSync,
12
12
  readdirSync,
13
13
  readlinkSync,
14
+ realpathSync,
14
15
  renameSync,
15
16
  rmSync,
16
17
  writeFileSync
@@ -29,11 +30,11 @@ var packageInfo = JSON.parse(readFileSync(join(packageRoot, "package.json"), "ut
29
30
  function sha256(value) {
30
31
  return createHash("sha256").update(value).digest("hex");
31
32
  }
32
- function readOption(args2, name) {
33
- const inline = args2.find((arg) => arg.startsWith(`${name}=`));
33
+ function readOption(args, name) {
34
+ const inline = args.find((arg) => arg.startsWith(`${name}=`));
34
35
  if (inline) return inline.slice(name.length + 1);
35
- const index = args2.indexOf(name);
36
- return index >= 0 ? args2[index + 1] : void 0;
36
+ const index = args.indexOf(name);
37
+ return index >= 0 ? args[index + 1] : void 0;
37
38
  }
38
39
  function runtimeRoot() {
39
40
  if (process.env.LINEAGE_RUNTIME_ROOT) return resolve(process.env.LINEAGE_RUNTIME_ROOT);
@@ -92,6 +93,22 @@ function validateBuild(root, installed) {
92
93
  if (build.source_dirty) throw new Error("Refusing stable/preview installation of a dirty-source build");
93
94
  return build;
94
95
  }
96
+ function parseRegistryPackageMetadata(value) {
97
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
98
+ throw new Error("npm metadata was not a JSON object");
99
+ }
100
+ const metadata = value;
101
+ const nestedIntegrity = metadata.dist?.integrity;
102
+ const flatIntegrity = metadata["dist.integrity"];
103
+ if (typeof nestedIntegrity === "string" && typeof flatIntegrity === "string" && nestedIntegrity !== flatIntegrity) {
104
+ throw new Error("npm metadata returned conflicting integrity values");
105
+ }
106
+ const integrity = typeof nestedIntegrity === "string" ? nestedIntegrity : flatIntegrity;
107
+ if (typeof metadata.version !== "string" || !metadata.version || typeof integrity !== "string" || !integrity) {
108
+ throw new Error("npm metadata did not include exact version and integrity");
109
+ }
110
+ return { integrity, version: metadata.version };
111
+ }
95
112
  function resolveSpec(spec, allowLocalPackage) {
96
113
  const localPath = resolve(spec.replace(/^file:/, ""));
97
114
  if (existsSync(localPath)) {
@@ -105,12 +122,16 @@ function resolveSpec(spec, allowLocalPackage) {
105
122
  source: "local"
106
123
  };
107
124
  }
108
- const metadata = JSON.parse(execFileSync("npm", ["view", spec, "version", "dist.integrity", "--json"], { encoding: "utf8" }));
109
- if (!metadata.version || !metadata.dist?.integrity) throw new Error(`npm metadata for ${spec} did not include exact version and integrity`);
125
+ let metadata;
126
+ try {
127
+ metadata = parseRegistryPackageMetadata(JSON.parse(execFileSync("npm", ["view", spec, "version", "dist.integrity", "--json"], { encoding: "utf8" })));
128
+ } catch (error) {
129
+ throw new Error(`npm metadata for ${spec} did not include exact version and integrity`, { cause: error });
130
+ }
110
131
  const name = spec.startsWith("@") ? spec.slice(0, spec.indexOf("@", 1)) : spec.split("@")[0];
111
132
  return {
112
133
  installSpec: `${name}@${metadata.version}`,
113
- integrity: metadata.dist.integrity,
134
+ integrity: metadata.integrity,
114
135
  expectedVersion: metadata.version,
115
136
  requestedSpec: spec,
116
137
  source: "registry"
@@ -141,11 +162,11 @@ function validateExistingReceipt(receiptPath, channel, expected) {
141
162
  }
142
163
  return receipt;
143
164
  }
144
- function install(channel, args2) {
145
- const root = resolve(readOption(args2, "--root") || runtimeRoot());
146
- const shimDir = resolve(readOption(args2, "--shim-dir") || join(root, "bin"));
147
- const requestedSpec = readOption(args2, "--package") || `${packageInfo.name}@${channel === "stable" ? "latest" : "next"}`;
148
- const resolvedSpec = resolveSpec(requestedSpec, args2.includes("--allow-local-package"));
165
+ function install(channel, args) {
166
+ const root = resolve(readOption(args, "--root") || runtimeRoot());
167
+ const shimDir = resolve(readOption(args, "--shim-dir") || join(root, "bin"));
168
+ const requestedSpec = readOption(args, "--package") || `${packageInfo.name}@${channel === "stable" ? "latest" : "next"}`;
169
+ const resolvedSpec = resolveSpec(requestedSpec, args.includes("--allow-local-package"));
149
170
  const channelRoot = join(root, "installs", channel);
150
171
  mkdirSync(channelRoot, { recursive: true });
151
172
  const stagingRoot = mkdtempSync(join(channelRoot, ".staging-"));
@@ -217,8 +238,8 @@ function install(channel, args2) {
217
238
  if (!keepStaging) rmSync(stagingRoot, { force: true, recursive: true });
218
239
  }
219
240
  }
220
- function status(args2) {
221
- const root = resolve(readOption(args2, "--root") || runtimeRoot());
241
+ function status(args) {
242
+ const root = resolve(readOption(args, "--root") || runtimeRoot());
222
243
  return Object.fromEntries(["stable", "preview"].map((channel) => {
223
244
  const pointerPath = join(root, "channels", `${channel}.json`);
224
245
  if (!existsSync(pointerPath)) return [channel, { installed: false }];
@@ -244,8 +265,8 @@ Stable and preview are installed into separate content-addressed roots. Dev is
244
265
  checkout-only and is started with npm run lineage:dev -- <command>. Local
245
266
  tarballs are refused unless --allow-local-package is supplied explicitly.`;
246
267
  }
247
- function print(value, json2) {
248
- if (json2) console.log(JSON.stringify(value, null, 2));
268
+ function print(value, json) {
269
+ if (json) console.log(JSON.stringify(value, null, 2));
249
270
  else if (value && typeof value === "object" && "shim" in value) {
250
271
  const installed = value;
251
272
  console.log(`Installed Lineage ${installed.channel} ${installed.package_version}`);
@@ -253,24 +274,30 @@ function print(value, json2) {
253
274
  console.log(`Service manager: ${installed.service_shim}`);
254
275
  } else console.log(JSON.stringify(value, null, 2));
255
276
  }
256
- var args = process.argv.slice(2);
257
- var json = args.includes("--json");
258
- try {
259
- if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
260
- console.log(usage());
261
- } else if (args.includes("--version") || args.includes("-v")) {
262
- console.log(packageInfo.version);
263
- } else if (args[0] === "install") {
264
- print(install(parseChannel(args[1] || readOption(args, "--channel")), args.slice(2)), json);
265
- } else if (args[0] === "status") {
266
- print(status(args.slice(1)), json);
267
- } else {
268
- throw new Error(`Unknown lineage-channel command: ${args[0]}`);
277
+ function runLineageChannel(args = process.argv.slice(2)) {
278
+ const json = args.includes("--json");
279
+ try {
280
+ if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
281
+ console.log(usage());
282
+ } else if (args.includes("--version") || args.includes("-v")) {
283
+ console.log(packageInfo.version);
284
+ } else if (args[0] === "install") {
285
+ print(install(parseChannel(args[1] || readOption(args, "--channel")), args.slice(2)), json);
286
+ } else if (args[0] === "status") {
287
+ print(status(args.slice(1)), json);
288
+ } else {
289
+ throw new Error(`Unknown lineage-channel command: ${args[0]}`);
290
+ }
291
+ } catch (error) {
292
+ const message = error instanceof Error ? error.message : String(error);
293
+ if (json) console.error(JSON.stringify({ error: message, ok: false }, null, 2));
294
+ else console.error(`lineage-channel: ${message}`);
295
+ process.exitCode = 1;
269
296
  }
270
- } catch (error) {
271
- const message = error instanceof Error ? error.message : String(error);
272
- if (json) console.error(JSON.stringify({ error: message, ok: false }, null, 2));
273
- else console.error(`lineage-channel: ${message}`);
274
- process.exitCode = 1;
275
297
  }
298
+ if (process.argv[1] && realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url))) runLineageChannel();
299
+ export {
300
+ parseRegistryPackageMetadata,
301
+ runLineageChannel
302
+ };
276
303
  //# sourceMappingURL=lineage-channel.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/cli/lineage-channel.ts", "../../src/shared/runtimeInfoTypes.ts"],
4
- "sourcesContent": ["#!/usr/bin/env node\n\nimport { createHash } from 'node:crypto';\nimport { execFileSync } from 'node:child_process';\nimport {\n chmodSync,\n existsSync,\n mkdirSync,\n mkdtempSync,\n readFileSync,\n readdirSync,\n readlinkSync,\n renameSync,\n rmSync,\n writeFileSync,\n} from 'node:fs';\nimport { homedir, platform } from 'node:os';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport {\n lineageRuntimeBuildSchemaVersion,\n lineageRuntimeInstallSchemaVersion,\n type LineageRuntimeBuildIdentity,\n type LineageRuntimeInstallReceipt,\n} from '../shared/runtimeInfoTypes';\n\ntype PublishedChannel = 'stable' | 'preview';\ninterface ResolvedPackageSpec {\n expectedVersion?: string;\n installSpec: string;\n integrity: string;\n requestedSpec: string;\n source: LineageRuntimeInstallReceipt['package_source'];\n}\n\nconst packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..', '..');\nconst packageInfo = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8')) as { name: string; version: string };\n\nfunction sha256(value: string | Buffer): string {\n return createHash('sha256').update(value).digest('hex');\n}\n\nfunction readOption(args: string[], name: string): string | undefined {\n const inline = args.find(arg => arg.startsWith(`${name}=`));\n if (inline) return inline.slice(name.length + 1);\n const index = args.indexOf(name);\n return index >= 0 ? args[index + 1] : undefined;\n}\n\nfunction runtimeRoot(): string {\n if (process.env.LINEAGE_RUNTIME_ROOT) return resolve(process.env.LINEAGE_RUNTIME_ROOT);\n if (platform() === 'darwin') return join(homedir(), 'Library', 'Application Support', 'Lineage', 'runtimes');\n if (platform() === 'win32') return join(process.env.LOCALAPPDATA || join(homedir(), 'AppData', 'Local'), 'Lineage', 'runtimes');\n return join(process.env.XDG_DATA_HOME || join(homedir(), '.local', 'share'), 'lineage', 'runtimes');\n}\n\nfunction parseChannel(value?: string): PublishedChannel {\n if (value === 'stable' || value === 'preview') return value;\n throw new Error('Channel must be stable or preview; dev is checkout-only');\n}\n\nfunction packageTreeSha256(root: string): string {\n const hash = createHash('sha256');\n const visit = (directory: string, relativeDirectory = '') => {\n for (const entry of readdirSync(directory, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {\n const relativePath = relativeDirectory ? join(relativeDirectory, entry.name) : entry.name;\n const path = join(directory, entry.name);\n hash.update(relativePath.replaceAll('\\\\', '/'));\n hash.update('\\0');\n if (entry.isDirectory()) {\n hash.update('directory\\0');\n visit(path, relativePath);\n } else if (entry.isSymbolicLink()) {\n hash.update('symlink\\0');\n hash.update(readlinkSync(path));\n } else if (entry.isFile()) {\n hash.update('file\\0');\n hash.update(readFileSync(path));\n } else {\n hash.update('other\\0');\n }\n hash.update('\\0');\n }\n };\n visit(root);\n return hash.digest('hex');\n}\n\nfunction expectedBuildFingerprint(build: Omit<LineageRuntimeBuildIdentity, 'build_fingerprint'>): string {\n return sha256(JSON.stringify({\n package_name: build.package_name,\n package_version: build.package_version,\n schema_version: build.schema_version,\n source_dirty: build.source_dirty,\n source_fingerprint: build.source_fingerprint,\n source_git_sha: build.source_git_sha,\n }));\n}\n\nfunction validateBuild(root: string, installed: { name: string; version: string }): LineageRuntimeBuildIdentity {\n const path = join(root, 'dist', 'runtime-build.json');\n const build = JSON.parse(readFileSync(path, 'utf8')) as LineageRuntimeBuildIdentity;\n if (build.schema_version !== lineageRuntimeBuildSchemaVersion) throw new Error(`Unsupported build identity schema in ${path}`);\n if (build.package_name !== installed.name || build.package_version !== installed.version) throw new Error('Embedded build identity does not match installed package.json');\n if (!/^[a-f0-9]{40}$/i.test(build.source_git_sha)) throw new Error('Embedded build Git revision is invalid');\n if (!/^[a-f0-9]{64}$/i.test(build.source_fingerprint)) throw new Error('Embedded source fingerprint is invalid');\n if (build.build_fingerprint !== expectedBuildFingerprint(build)) throw new Error('Embedded build fingerprint does not match its contents');\n if (build.source_dirty) throw new Error('Refusing stable/preview installation of a dirty-source build');\n return build;\n}\n\nfunction resolveSpec(spec: string, allowLocalPackage: boolean): ResolvedPackageSpec {\n const localPath = resolve(spec.replace(/^file:/, ''));\n if (existsSync(localPath)) {\n if (!allowLocalPackage) {\n throw new Error('Local package paths require --allow-local-package; normal stable/preview installs must resolve from the npm registry');\n }\n return {\n installSpec: localPath,\n integrity: `sha512-${createHash('sha512').update(readFileSync(localPath)).digest('base64')}`,\n requestedSpec: spec,\n source: 'local',\n };\n }\n const metadata = JSON.parse(execFileSync('npm', ['view', spec, 'version', 'dist.integrity', '--json'], { encoding: 'utf8' })) as {\n dist?: { integrity?: string };\n version?: string;\n };\n if (!metadata.version || !metadata.dist?.integrity) throw new Error(`npm metadata for ${spec} did not include exact version and integrity`);\n const name = spec.startsWith('@') ? spec.slice(0, spec.indexOf('@', 1)) : spec.split('@')[0];\n return {\n installSpec: `${name}@${metadata.version}`,\n integrity: metadata.dist.integrity,\n expectedVersion: metadata.version,\n requestedSpec: spec,\n source: 'registry',\n };\n}\n\nfunction shellQuote(value: string): string {\n return `'${value.replaceAll(\"'\", \"'\\\\''\")}'`;\n}\n\nfunction writeShim(path: string, channel: PublishedChannel, receiptPath: string, entrypoint: string): void {\n const tempPath = `${path}.tmp-${process.pid}`;\n const script = `#!/bin/sh\\nLINEAGE_RUNTIME_RECEIPT=${shellQuote(receiptPath)} LINEAGE_RELEASE_CHANNEL=${shellQuote(channel)} exec ${shellQuote(process.execPath)} ${shellQuote(entrypoint)} \"$@\"\\n`;\n writeFileSync(tempPath, script, { mode: 0o755 });\n chmodSync(tempPath, 0o755);\n renameSync(tempPath, path);\n}\n\nfunction validateExistingReceipt(\n receiptPath: string,\n channel: PublishedChannel,\n expected?: { build: LineageRuntimeBuildIdentity; integrity: string; packageRoot: string; source: ResolvedPackageSpec['source']; version: string },\n): LineageRuntimeInstallReceipt {\n const receipt = JSON.parse(readFileSync(receiptPath, 'utf8')) as LineageRuntimeInstallReceipt;\n if (receipt.schema_version !== lineageRuntimeInstallSchemaVersion || receipt.channel !== channel) throw new Error(`Invalid existing ${channel} runtime receipt`);\n const installed = JSON.parse(readFileSync(join(receipt.package_root, 'package.json'), 'utf8')) as { name: string; version: string };\n const build = validateBuild(receipt.package_root, installed);\n if (receipt.package_name !== installed.name || receipt.package_version !== installed.version) throw new Error(`Existing ${channel} receipt does not match package.json`);\n if (receipt.build_fingerprint !== build.build_fingerprint) throw new Error(`Existing ${channel} receipt does not match embedded build identity`);\n if (packageTreeSha256(receipt.package_root) !== receipt.package_tree_sha256) throw new Error(`Existing ${channel} runtime package tree has changed`);\n if (expected && (\n receipt.package_integrity !== expected.integrity\n || receipt.package_root !== expected.packageRoot\n || receipt.package_source !== expected.source\n || receipt.package_version !== expected.version\n || receipt.build_fingerprint !== expected.build.build_fingerprint\n )) {\n throw new Error(`Existing ${channel} runtime receipt does not match the freshly resolved package`);\n }\n return receipt;\n}\n\nfunction install(channel: PublishedChannel, args: string[]): LineageRuntimeInstallReceipt & { receipt_path: string; service_shim: string; shim: string } {\n const root = resolve(readOption(args, '--root') || runtimeRoot());\n const shimDir = resolve(readOption(args, '--shim-dir') || join(root, 'bin'));\n const requestedSpec = readOption(args, '--package') || `${packageInfo.name}@${channel === 'stable' ? 'latest' : 'next'}`;\n const resolvedSpec = resolveSpec(requestedSpec, args.includes('--allow-local-package'));\n const channelRoot = join(root, 'installs', channel);\n mkdirSync(channelRoot, { recursive: true });\n const stagingRoot = mkdtempSync(join(channelRoot, '.staging-'));\n let keepStaging = false;\n try {\n execFileSync('npm', [\n 'install', '--prefix', stagingRoot, '--ignore-scripts', '--no-audit', '--no-fund', '--package-lock=false', resolvedSpec.installSpec,\n ], { stdio: 'ignore' });\n const stagingPackageRoot = join(stagingRoot, 'node_modules', ...packageInfo.name.split('/'));\n const installed = JSON.parse(readFileSync(join(stagingPackageRoot, 'package.json'), 'utf8')) as { name: string; version: string };\n if (installed.name !== packageInfo.name) throw new Error(`Installed unexpected package ${installed.name}`);\n if (resolvedSpec.expectedVersion && installed.version !== resolvedSpec.expectedVersion) throw new Error(`Installed ${installed.version}, expected ${resolvedSpec.expectedVersion}`);\n const build = validateBuild(stagingPackageRoot, installed);\n const installId = `${installed.version}-${sha256(resolvedSpec.integrity).slice(0, 16)}`;\n const finalRoot = join(channelRoot, installId);\n const finalPackageRoot = join(finalRoot, 'node_modules', ...packageInfo.name.split('/'));\n const receiptPath = join(finalRoot, 'lineage-runtime-receipt.json');\n let receipt: LineageRuntimeInstallReceipt;\n if (existsSync(finalRoot)) {\n receipt = validateExistingReceipt(receiptPath, channel, {\n build,\n integrity: resolvedSpec.integrity,\n packageRoot: finalPackageRoot,\n source: resolvedSpec.source,\n version: installed.version,\n });\n } else {\n const packageTree = packageTreeSha256(stagingPackageRoot);\n renameSync(stagingRoot, finalRoot);\n keepStaging = true;\n receipt = {\n build_fingerprint: build.build_fingerprint,\n channel,\n installed_at: new Date().toISOString(),\n package_integrity: resolvedSpec.integrity,\n package_name: installed.name,\n package_root: finalPackageRoot,\n package_source: resolvedSpec.source,\n package_spec: resolvedSpec.requestedSpec,\n package_tree_sha256: packageTree,\n package_version: installed.version,\n schema_version: lineageRuntimeInstallSchemaVersion,\n };\n writeFileSync(receiptPath, `${JSON.stringify(receipt, null, 2)}\\n`, { mode: 0o600 });\n }\n mkdirSync(shimDir, { recursive: true });\n const shim = join(shimDir, channel === 'stable' ? 'lineage-stable' : 'lineage-preview');\n const entrypoint = join(finalPackageRoot, 'dist', 'cli', channel === 'stable' ? 'lineage.js' : 'lineage-preview.js');\n if (!existsSync(entrypoint)) throw new Error(`Installed package is missing ${entrypoint}`);\n writeShim(shim, channel, receiptPath, entrypoint);\n const serviceShim = join(shimDir, channel === 'stable' ? 'lineage-stable-service' : 'lineage-preview-service');\n const serviceEntrypoint = join(finalPackageRoot, 'dist', 'cli', 'managed-service.js');\n if (!existsSync(serviceEntrypoint)) throw new Error(`Installed package is missing ${serviceEntrypoint}`);\n writeShim(serviceShim, channel, receiptPath, serviceEntrypoint);\n const pointerDir = join(root, 'channels');\n mkdirSync(pointerDir, { recursive: true });\n writeFileSync(join(pointerDir, `${channel}.json`), `${JSON.stringify({ channel, receipt_path: receiptPath, service_shim: serviceShim, shim }, null, 2)}\\n`, { mode: 0o600 });\n return { ...receipt, receipt_path: receiptPath, service_shim: serviceShim, shim };\n } finally {\n if (!keepStaging) rmSync(stagingRoot, { force: true, recursive: true });\n }\n}\n\nfunction status(args: string[]): unknown {\n const root = resolve(readOption(args, '--root') || runtimeRoot());\n return Object.fromEntries((['stable', 'preview'] as const).map(channel => {\n const pointerPath = join(root, 'channels', `${channel}.json`);\n if (!existsSync(pointerPath)) return [channel, { installed: false }];\n try {\n const pointer = JSON.parse(readFileSync(pointerPath, 'utf8')) as { receipt_path: string; service_shim: string; shim: string };\n const receipt = validateExistingReceipt(pointer.receipt_path, channel);\n if (!existsSync(pointer.shim) || !existsSync(pointer.service_shim)) throw new Error(`Existing ${channel} runtime shims are missing`);\n return [channel, { installed: true, receipt, receipt_path: pointer.receipt_path, service_shim: pointer.service_shim, shim: pointer.shim }];\n } catch (error) {\n return [channel, { error: error instanceof Error ? error.message : String(error), installed: false }];\n }\n }));\n}\n\nfunction usage(): string {\n return `lineage-channel ${packageInfo.version}\n\nUsage:\n lineage-channel install stable [--root <path>] [--shim-dir <path>] [--package <npm-spec>] [--json]\n lineage-channel install preview [--root <path>] [--shim-dir <path>] [--package <npm-spec>] [--json]\n lineage-channel status [--root <path>] [--json]\n\nStable and preview are installed into separate content-addressed roots. Dev is\ncheckout-only and is started with npm run lineage:dev -- <command>. Local\ntarballs are refused unless --allow-local-package is supplied explicitly.`;\n}\n\nfunction print(value: unknown, json: boolean): void {\n if (json) console.log(JSON.stringify(value, null, 2));\n else if (value && typeof value === 'object' && 'shim' in value) {\n const installed = value as { channel: string; package_version: string; service_shim: string; shim: string };\n console.log(`Installed Lineage ${installed.channel} ${installed.package_version}`);\n console.log(`Launcher: ${installed.shim}`);\n console.log(`Service manager: ${installed.service_shim}`);\n } else console.log(JSON.stringify(value, null, 2));\n}\n\nconst args = process.argv.slice(2);\nconst json = args.includes('--json');\ntry {\n if (args.length === 0 || args.includes('--help') || args.includes('-h')) {\n console.log(usage());\n } else if (args.includes('--version') || args.includes('-v')) {\n console.log(packageInfo.version);\n } else if (args[0] === 'install') {\n print(install(parseChannel(args[1] || readOption(args, '--channel')), args.slice(2)), json);\n } else if (args[0] === 'status') {\n print(status(args.slice(1)), json);\n } else {\n throw new Error(`Unknown lineage-channel command: ${args[0]}`);\n }\n} catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n if (json) console.error(JSON.stringify({ error: message, ok: false }, null, 2));\n else console.error(`lineage-channel: ${message}`);\n process.exitCode = 1;\n}\n", "export type LineageRuntimeChannel = 'stable' | 'preview' | 'dev';\n\nexport const lineageRuntimeBuildSchemaVersion = 'lineage.runtime_build.v1' as const;\nexport const lineageRuntimeInstallSchemaVersion = 'lineage.runtime_install.v1' as const;\n\ntype LineageRuntimeEnvironment = 'production' | 'preview' | 'development';\n\ninterface LineageRuntimeDatabaseInfo {\n error?: string;\n exists: boolean;\n modified_at?: string;\n path: string;\n projects?: number;\n size_bytes?: number;\n workspaces?: number;\n}\n\ninterface LineageRuntimeProfileInfo {\n bound: boolean;\n environment: LineageRuntimeEnvironment;\n fingerprint?: string;\n id: string;\n manifest_path?: string;\n service_origin?: string;\n warning?: string;\n}\n\ninterface LineageRuntimeSchemaInfo {\n migration_keys: string[];\n profile_environment?: LineageRuntimeEnvironment;\n profile_fingerprint?: string;\n profile_id?: string;\n}\n\nexport interface LineageRuntimeBuildIdentity {\n build_fingerprint: string;\n package_name: string;\n package_version: string;\n schema_version: typeof lineageRuntimeBuildSchemaVersion;\n source_dirty: boolean;\n source_fingerprint: string;\n source_git_sha: string;\n}\n\nexport interface LineageRuntimeInstallReceipt {\n build_fingerprint: string;\n channel: Exclude<LineageRuntimeChannel, 'dev'>;\n installed_at: string;\n package_integrity: string;\n package_name: string;\n package_root: string;\n package_source: 'local' | 'registry';\n package_spec: string;\n package_tree_sha256: string;\n package_version: string;\n schema_version: typeof lineageRuntimeInstallSchemaVersion;\n}\n\nexport interface LineageRuntimeCodeIdentity {\n build?: LineageRuntimeBuildIdentity;\n channel: LineageRuntimeChannel;\n dirty?: boolean;\n errors: string[];\n fingerprint: string;\n git_sha?: string;\n install?: LineageRuntimeInstallReceipt & { receipt_path: string };\n origin: 'checkout' | 'package' | 'unknown';\n package_version: string;\n root: string;\n source_fingerprint?: string;\n verified: boolean;\n}\n\nexport interface LineageRuntimeInfo {\n asset_root: string;\n channel: LineageRuntimeChannel;\n code?: LineageRuntimeCodeIdentity;\n database: LineageRuntimeDatabaseInfo;\n fetchedAt: string;\n git_sha?: string;\n node_env?: string;\n package_name: string;\n profile: LineageRuntimeProfileInfo;\n schema: LineageRuntimeSchemaInfo;\n service?: {\n instance_id?: string;\n launcher_pid?: number;\n pid: number;\n started_at: string;\n };\n version: string;\n}\n"],
5
- "mappings": ";;;AAEA,SAAS,kBA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ACnC,OAAO;AACL,UAAM,IAAI,MAAM,oCAAoC,KAAK,CAAC,CAAC,EAAE;AAAA,EAC/D;AACF,SAAS,OAAO;AACd,QAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AACrE,MAAI,KAAM,SAAQ,MAAM,KAAK,UAAU,EAAE,OAAO,SAAS,IAAI,MAAM,GAAG,MAAM,CAAC,CAAC;AAAA,MACzE,SAAQ,MAAM,oBAAoB,OAAO,EAAE;AAChD,UAAQ,WAAW;AACrB;",
6
- "names": ["args", "json"]
4
+ "sourcesContent": ["#!/usr/bin/env node\n\nimport { createHash } from 'node:crypto';\nimport { execFileSync } from 'node:child_process';\nimport {\n chmodSync,\n existsSync,\n mkdirSync,\n mkdtempSync,\n readFileSync,\n readdirSync,\n readlinkSync,\n realpathSync,\n renameSync,\n rmSync,\n writeFileSync,\n} from 'node:fs';\nimport { homedir, platform } from 'node:os';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport {\n lineageRuntimeBuildSchemaVersion,\n lineageRuntimeInstallSchemaVersion,\n type LineageRuntimeBuildIdentity,\n type LineageRuntimeInstallReceipt,\n} from '../shared/runtimeInfoTypes';\n\ntype PublishedChannel = 'stable' | 'preview';\ninterface ResolvedPackageSpec {\n expectedVersion?: string;\n installSpec: string;\n integrity: string;\n requestedSpec: string;\n source: LineageRuntimeInstallReceipt['package_source'];\n}\n\ninterface RegistryPackageMetadata {\n dist?: { integrity?: unknown };\n 'dist.integrity'?: unknown;\n version?: unknown;\n}\n\nconst packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..', '..');\nconst packageInfo = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8')) as { name: string; version: string };\n\nfunction sha256(value: string | Buffer): string {\n return createHash('sha256').update(value).digest('hex');\n}\n\nfunction readOption(args: string[], name: string): string | undefined {\n const inline = args.find(arg => arg.startsWith(`${name}=`));\n if (inline) return inline.slice(name.length + 1);\n const index = args.indexOf(name);\n return index >= 0 ? args[index + 1] : undefined;\n}\n\nfunction runtimeRoot(): string {\n if (process.env.LINEAGE_RUNTIME_ROOT) return resolve(process.env.LINEAGE_RUNTIME_ROOT);\n if (platform() === 'darwin') return join(homedir(), 'Library', 'Application Support', 'Lineage', 'runtimes');\n if (platform() === 'win32') return join(process.env.LOCALAPPDATA || join(homedir(), 'AppData', 'Local'), 'Lineage', 'runtimes');\n return join(process.env.XDG_DATA_HOME || join(homedir(), '.local', 'share'), 'lineage', 'runtimes');\n}\n\nfunction parseChannel(value?: string): PublishedChannel {\n if (value === 'stable' || value === 'preview') return value;\n throw new Error('Channel must be stable or preview; dev is checkout-only');\n}\n\nfunction packageTreeSha256(root: string): string {\n const hash = createHash('sha256');\n const visit = (directory: string, relativeDirectory = '') => {\n for (const entry of readdirSync(directory, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {\n const relativePath = relativeDirectory ? join(relativeDirectory, entry.name) : entry.name;\n const path = join(directory, entry.name);\n hash.update(relativePath.replaceAll('\\\\', '/'));\n hash.update('\\0');\n if (entry.isDirectory()) {\n hash.update('directory\\0');\n visit(path, relativePath);\n } else if (entry.isSymbolicLink()) {\n hash.update('symlink\\0');\n hash.update(readlinkSync(path));\n } else if (entry.isFile()) {\n hash.update('file\\0');\n hash.update(readFileSync(path));\n } else {\n hash.update('other\\0');\n }\n hash.update('\\0');\n }\n };\n visit(root);\n return hash.digest('hex');\n}\n\nfunction expectedBuildFingerprint(build: Omit<LineageRuntimeBuildIdentity, 'build_fingerprint'>): string {\n return sha256(JSON.stringify({\n package_name: build.package_name,\n package_version: build.package_version,\n schema_version: build.schema_version,\n source_dirty: build.source_dirty,\n source_fingerprint: build.source_fingerprint,\n source_git_sha: build.source_git_sha,\n }));\n}\n\nfunction validateBuild(root: string, installed: { name: string; version: string }): LineageRuntimeBuildIdentity {\n const path = join(root, 'dist', 'runtime-build.json');\n const build = JSON.parse(readFileSync(path, 'utf8')) as LineageRuntimeBuildIdentity;\n if (build.schema_version !== lineageRuntimeBuildSchemaVersion) throw new Error(`Unsupported build identity schema in ${path}`);\n if (build.package_name !== installed.name || build.package_version !== installed.version) throw new Error('Embedded build identity does not match installed package.json');\n if (!/^[a-f0-9]{40}$/i.test(build.source_git_sha)) throw new Error('Embedded build Git revision is invalid');\n if (!/^[a-f0-9]{64}$/i.test(build.source_fingerprint)) throw new Error('Embedded source fingerprint is invalid');\n if (build.build_fingerprint !== expectedBuildFingerprint(build)) throw new Error('Embedded build fingerprint does not match its contents');\n if (build.source_dirty) throw new Error('Refusing stable/preview installation of a dirty-source build');\n return build;\n}\n\nexport function parseRegistryPackageMetadata(value: unknown): { integrity: string; version: string } {\n if (!value || typeof value !== 'object' || Array.isArray(value)) {\n throw new Error('npm metadata was not a JSON object');\n }\n const metadata = value as RegistryPackageMetadata;\n const nestedIntegrity = metadata.dist?.integrity;\n const flatIntegrity = metadata['dist.integrity'];\n if (\n typeof nestedIntegrity === 'string'\n && typeof flatIntegrity === 'string'\n && nestedIntegrity !== flatIntegrity\n ) {\n throw new Error('npm metadata returned conflicting integrity values');\n }\n const integrity = typeof nestedIntegrity === 'string' ? nestedIntegrity : flatIntegrity;\n if (typeof metadata.version !== 'string' || !metadata.version || typeof integrity !== 'string' || !integrity) {\n throw new Error('npm metadata did not include exact version and integrity');\n }\n return { integrity, version: metadata.version };\n}\n\nfunction resolveSpec(spec: string, allowLocalPackage: boolean): ResolvedPackageSpec {\n const localPath = resolve(spec.replace(/^file:/, ''));\n if (existsSync(localPath)) {\n if (!allowLocalPackage) {\n throw new Error('Local package paths require --allow-local-package; normal stable/preview installs must resolve from the npm registry');\n }\n return {\n installSpec: localPath,\n integrity: `sha512-${createHash('sha512').update(readFileSync(localPath)).digest('base64')}`,\n requestedSpec: spec,\n source: 'local',\n };\n }\n let metadata: { integrity: string; version: string };\n try {\n metadata = parseRegistryPackageMetadata(JSON.parse(execFileSync('npm', ['view', spec, 'version', 'dist.integrity', '--json'], { encoding: 'utf8' })));\n } catch (error) {\n throw new Error(`npm metadata for ${spec} did not include exact version and integrity`, { cause: error });\n }\n const name = spec.startsWith('@') ? spec.slice(0, spec.indexOf('@', 1)) : spec.split('@')[0];\n return {\n installSpec: `${name}@${metadata.version}`,\n integrity: metadata.integrity,\n expectedVersion: metadata.version,\n requestedSpec: spec,\n source: 'registry',\n };\n}\n\nfunction shellQuote(value: string): string {\n return `'${value.replaceAll(\"'\", \"'\\\\''\")}'`;\n}\n\nfunction writeShim(path: string, channel: PublishedChannel, receiptPath: string, entrypoint: string): void {\n const tempPath = `${path}.tmp-${process.pid}`;\n const script = `#!/bin/sh\\nLINEAGE_RUNTIME_RECEIPT=${shellQuote(receiptPath)} LINEAGE_RELEASE_CHANNEL=${shellQuote(channel)} exec ${shellQuote(process.execPath)} ${shellQuote(entrypoint)} \"$@\"\\n`;\n writeFileSync(tempPath, script, { mode: 0o755 });\n chmodSync(tempPath, 0o755);\n renameSync(tempPath, path);\n}\n\nfunction validateExistingReceipt(\n receiptPath: string,\n channel: PublishedChannel,\n expected?: { build: LineageRuntimeBuildIdentity; integrity: string; packageRoot: string; source: ResolvedPackageSpec['source']; version: string },\n): LineageRuntimeInstallReceipt {\n const receipt = JSON.parse(readFileSync(receiptPath, 'utf8')) as LineageRuntimeInstallReceipt;\n if (receipt.schema_version !== lineageRuntimeInstallSchemaVersion || receipt.channel !== channel) throw new Error(`Invalid existing ${channel} runtime receipt`);\n const installed = JSON.parse(readFileSync(join(receipt.package_root, 'package.json'), 'utf8')) as { name: string; version: string };\n const build = validateBuild(receipt.package_root, installed);\n if (receipt.package_name !== installed.name || receipt.package_version !== installed.version) throw new Error(`Existing ${channel} receipt does not match package.json`);\n if (receipt.build_fingerprint !== build.build_fingerprint) throw new Error(`Existing ${channel} receipt does not match embedded build identity`);\n if (packageTreeSha256(receipt.package_root) !== receipt.package_tree_sha256) throw new Error(`Existing ${channel} runtime package tree has changed`);\n if (expected && (\n receipt.package_integrity !== expected.integrity\n || receipt.package_root !== expected.packageRoot\n || receipt.package_source !== expected.source\n || receipt.package_version !== expected.version\n || receipt.build_fingerprint !== expected.build.build_fingerprint\n )) {\n throw new Error(`Existing ${channel} runtime receipt does not match the freshly resolved package`);\n }\n return receipt;\n}\n\nfunction install(channel: PublishedChannel, args: string[]): LineageRuntimeInstallReceipt & { receipt_path: string; service_shim: string; shim: string } {\n const root = resolve(readOption(args, '--root') || runtimeRoot());\n const shimDir = resolve(readOption(args, '--shim-dir') || join(root, 'bin'));\n const requestedSpec = readOption(args, '--package') || `${packageInfo.name}@${channel === 'stable' ? 'latest' : 'next'}`;\n const resolvedSpec = resolveSpec(requestedSpec, args.includes('--allow-local-package'));\n const channelRoot = join(root, 'installs', channel);\n mkdirSync(channelRoot, { recursive: true });\n const stagingRoot = mkdtempSync(join(channelRoot, '.staging-'));\n let keepStaging = false;\n try {\n execFileSync('npm', [\n 'install', '--prefix', stagingRoot, '--ignore-scripts', '--no-audit', '--no-fund', '--package-lock=false', resolvedSpec.installSpec,\n ], { stdio: 'ignore' });\n const stagingPackageRoot = join(stagingRoot, 'node_modules', ...packageInfo.name.split('/'));\n const installed = JSON.parse(readFileSync(join(stagingPackageRoot, 'package.json'), 'utf8')) as { name: string; version: string };\n if (installed.name !== packageInfo.name) throw new Error(`Installed unexpected package ${installed.name}`);\n if (resolvedSpec.expectedVersion && installed.version !== resolvedSpec.expectedVersion) throw new Error(`Installed ${installed.version}, expected ${resolvedSpec.expectedVersion}`);\n const build = validateBuild(stagingPackageRoot, installed);\n const installId = `${installed.version}-${sha256(resolvedSpec.integrity).slice(0, 16)}`;\n const finalRoot = join(channelRoot, installId);\n const finalPackageRoot = join(finalRoot, 'node_modules', ...packageInfo.name.split('/'));\n const receiptPath = join(finalRoot, 'lineage-runtime-receipt.json');\n let receipt: LineageRuntimeInstallReceipt;\n if (existsSync(finalRoot)) {\n receipt = validateExistingReceipt(receiptPath, channel, {\n build,\n integrity: resolvedSpec.integrity,\n packageRoot: finalPackageRoot,\n source: resolvedSpec.source,\n version: installed.version,\n });\n } else {\n const packageTree = packageTreeSha256(stagingPackageRoot);\n renameSync(stagingRoot, finalRoot);\n keepStaging = true;\n receipt = {\n build_fingerprint: build.build_fingerprint,\n channel,\n installed_at: new Date().toISOString(),\n package_integrity: resolvedSpec.integrity,\n package_name: installed.name,\n package_root: finalPackageRoot,\n package_source: resolvedSpec.source,\n package_spec: resolvedSpec.requestedSpec,\n package_tree_sha256: packageTree,\n package_version: installed.version,\n schema_version: lineageRuntimeInstallSchemaVersion,\n };\n writeFileSync(receiptPath, `${JSON.stringify(receipt, null, 2)}\\n`, { mode: 0o600 });\n }\n mkdirSync(shimDir, { recursive: true });\n const shim = join(shimDir, channel === 'stable' ? 'lineage-stable' : 'lineage-preview');\n const entrypoint = join(finalPackageRoot, 'dist', 'cli', channel === 'stable' ? 'lineage.js' : 'lineage-preview.js');\n if (!existsSync(entrypoint)) throw new Error(`Installed package is missing ${entrypoint}`);\n writeShim(shim, channel, receiptPath, entrypoint);\n const serviceShim = join(shimDir, channel === 'stable' ? 'lineage-stable-service' : 'lineage-preview-service');\n const serviceEntrypoint = join(finalPackageRoot, 'dist', 'cli', 'managed-service.js');\n if (!existsSync(serviceEntrypoint)) throw new Error(`Installed package is missing ${serviceEntrypoint}`);\n writeShim(serviceShim, channel, receiptPath, serviceEntrypoint);\n const pointerDir = join(root, 'channels');\n mkdirSync(pointerDir, { recursive: true });\n writeFileSync(join(pointerDir, `${channel}.json`), `${JSON.stringify({ channel, receipt_path: receiptPath, service_shim: serviceShim, shim }, null, 2)}\\n`, { mode: 0o600 });\n return { ...receipt, receipt_path: receiptPath, service_shim: serviceShim, shim };\n } finally {\n if (!keepStaging) rmSync(stagingRoot, { force: true, recursive: true });\n }\n}\n\nfunction status(args: string[]): unknown {\n const root = resolve(readOption(args, '--root') || runtimeRoot());\n return Object.fromEntries((['stable', 'preview'] as const).map(channel => {\n const pointerPath = join(root, 'channels', `${channel}.json`);\n if (!existsSync(pointerPath)) return [channel, { installed: false }];\n try {\n const pointer = JSON.parse(readFileSync(pointerPath, 'utf8')) as { receipt_path: string; service_shim: string; shim: string };\n const receipt = validateExistingReceipt(pointer.receipt_path, channel);\n if (!existsSync(pointer.shim) || !existsSync(pointer.service_shim)) throw new Error(`Existing ${channel} runtime shims are missing`);\n return [channel, { installed: true, receipt, receipt_path: pointer.receipt_path, service_shim: pointer.service_shim, shim: pointer.shim }];\n } catch (error) {\n return [channel, { error: error instanceof Error ? error.message : String(error), installed: false }];\n }\n }));\n}\n\nfunction usage(): string {\n return `lineage-channel ${packageInfo.version}\n\nUsage:\n lineage-channel install stable [--root <path>] [--shim-dir <path>] [--package <npm-spec>] [--json]\n lineage-channel install preview [--root <path>] [--shim-dir <path>] [--package <npm-spec>] [--json]\n lineage-channel status [--root <path>] [--json]\n\nStable and preview are installed into separate content-addressed roots. Dev is\ncheckout-only and is started with npm run lineage:dev -- <command>. Local\ntarballs are refused unless --allow-local-package is supplied explicitly.`;\n}\n\nfunction print(value: unknown, json: boolean): void {\n if (json) console.log(JSON.stringify(value, null, 2));\n else if (value && typeof value === 'object' && 'shim' in value) {\n const installed = value as { channel: string; package_version: string; service_shim: string; shim: string };\n console.log(`Installed Lineage ${installed.channel} ${installed.package_version}`);\n console.log(`Launcher: ${installed.shim}`);\n console.log(`Service manager: ${installed.service_shim}`);\n } else console.log(JSON.stringify(value, null, 2));\n}\n\nexport function runLineageChannel(args = process.argv.slice(2)): void {\n const json = args.includes('--json');\n try {\n if (args.length === 0 || args.includes('--help') || args.includes('-h')) {\n console.log(usage());\n } else if (args.includes('--version') || args.includes('-v')) {\n console.log(packageInfo.version);\n } else if (args[0] === 'install') {\n print(install(parseChannel(args[1] || readOption(args, '--channel')), args.slice(2)), json);\n } else if (args[0] === 'status') {\n print(status(args.slice(1)), json);\n } else {\n throw new Error(`Unknown lineage-channel command: ${args[0]}`);\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n if (json) console.error(JSON.stringify({ error: message, ok: false }, null, 2));\n else console.error(`lineage-channel: ${message}`);\n process.exitCode = 1;\n }\n}\n\nif (process.argv[1] && realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url))) runLineageChannel();\n", "export type LineageRuntimeChannel = 'stable' | 'preview' | 'dev';\n\nexport const lineageRuntimeBuildSchemaVersion = 'lineage.runtime_build.v1' as const;\nexport const lineageRuntimeInstallSchemaVersion = 'lineage.runtime_install.v1' as const;\n\ntype LineageRuntimeEnvironment = 'production' | 'preview' | 'development';\n\ninterface LineageRuntimeDatabaseInfo {\n error?: string;\n exists: boolean;\n modified_at?: string;\n path: string;\n projects?: number;\n size_bytes?: number;\n workspaces?: number;\n}\n\ninterface LineageRuntimeProfileInfo {\n bound: boolean;\n environment: LineageRuntimeEnvironment;\n fingerprint?: string;\n id: string;\n manifest_path?: string;\n service_origin?: string;\n warning?: string;\n}\n\ninterface LineageRuntimeSchemaInfo {\n migration_keys: string[];\n profile_environment?: LineageRuntimeEnvironment;\n profile_fingerprint?: string;\n profile_id?: string;\n}\n\nexport interface LineageRuntimeBuildIdentity {\n build_fingerprint: string;\n package_name: string;\n package_version: string;\n schema_version: typeof lineageRuntimeBuildSchemaVersion;\n source_dirty: boolean;\n source_fingerprint: string;\n source_git_sha: string;\n}\n\nexport interface LineageRuntimeInstallReceipt {\n build_fingerprint: string;\n channel: Exclude<LineageRuntimeChannel, 'dev'>;\n installed_at: string;\n package_integrity: string;\n package_name: string;\n package_root: string;\n package_source: 'local' | 'registry';\n package_spec: string;\n package_tree_sha256: string;\n package_version: string;\n schema_version: typeof lineageRuntimeInstallSchemaVersion;\n}\n\nexport interface LineageRuntimeCodeIdentity {\n build?: LineageRuntimeBuildIdentity;\n channel: LineageRuntimeChannel;\n dirty?: boolean;\n errors: string[];\n fingerprint: string;\n git_sha?: string;\n install?: LineageRuntimeInstallReceipt & { receipt_path: string };\n origin: 'checkout' | 'package' | 'unknown';\n package_version: string;\n root: string;\n source_fingerprint?: string;\n verified: boolean;\n}\n\nexport interface LineageRuntimeInfo {\n asset_root: string;\n channel: LineageRuntimeChannel;\n code?: LineageRuntimeCodeIdentity;\n database: LineageRuntimeDatabaseInfo;\n fetchedAt: string;\n git_sha?: string;\n node_env?: string;\n package_name: string;\n profile: LineageRuntimeProfileInfo;\n schema: LineageRuntimeSchemaInfo;\n service?: {\n instance_id?: string;\n launcher_pid?: number;\n pid: number;\n started_at: string;\n };\n version: string;\n}\n"],
5
+ "mappings": ";;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,SAAS,gBAAgB;AAClC,SAAS,SAAS,MAAM,eAAe;AACvC,SAAS,qBAAqB;;;ACjBvB,IAAM,mCAAmC;AACzC,IAAM,qCAAqC;;;ADuClD,IAAM,cAAc,QAAQ,QAAQ,cAAc,YAAY,GAAG,CAAC,GAAG,MAAM,IAAI;AAC/E,IAAM,cAAc,KAAK,MAAM,aAAa,KAAK,aAAa,cAAc,GAAG,MAAM,CAAC;AAEtF,SAAS,OAAO,OAAgC;AAC9C,SAAO,WAAW,QAAQ,EAAE,OAAO,KAAK,EAAE,OAAO,KAAK;AACxD;AAEA,SAAS,WAAW,MAAgB,MAAkC;AACpE,QAAM,SAAS,KAAK,KAAK,SAAO,IAAI,WAAW,GAAG,IAAI,GAAG,CAAC;AAC1D,MAAI,OAAQ,QAAO,OAAO,MAAM,KAAK,SAAS,CAAC;AAC/C,QAAM,QAAQ,KAAK,QAAQ,IAAI;AAC/B,SAAO,SAAS,IAAI,KAAK,QAAQ,CAAC,IAAI;AACxC;AAEA,SAAS,cAAsB;AAC7B,MAAI,QAAQ,IAAI,qBAAsB,QAAO,QAAQ,QAAQ,IAAI,oBAAoB;AACrF,MAAI,SAAS,MAAM,SAAU,QAAO,KAAK,QAAQ,GAAG,WAAW,u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