@mean-weasel/lineage 0.1.9 → 0.1.11

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,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.11
4
+
5
+ - Add `--asset-root` / `LINEAGE_ASSET_ROOT` so installed Lineage packages can use external project catalogs and local media independently from the SQLite path.
6
+ - Show the active asset root in CLI startup, `db info`, and Settings alongside the active SQLite identity.
7
+ - Extend the packed-tarball smoke to prove an unrelated npm consumer can start Lineage and export a real external-project selection packet.
8
+
9
+ ## 0.1.10
10
+
11
+ - Fix `lineage db info` so installed CLI checks use the same stable/dev runtime SQLite defaults as `lineage start`.
12
+
3
13
  ## 0.1.9
4
14
 
5
15
  - Add runtime identity diagnostics in Settings so operators can see the active channel, version, Git SHA when available, SQLite path, and database counts.
package/README.md CHANGED
@@ -38,9 +38,16 @@ lineage-dev start
38
38
  By default, `lineage start` listens on `lineage.localhost:5197` and stores SQLite state in a stable Lineage runtime directory. `lineage-dev start` listens on `lineage-dev.localhost:5198` and uses a separate development SQLite file. Override those defaults with `--port`, `--host`, `--db`, or `LINEAGE_HOME`:
39
39
 
40
40
  ```bash
41
- lineage start --port 6123 --db ~/.lineage/lineage.sqlite
41
+ lineage start --port 6123 --db ~/.lineage/lineage.sqlite --asset-root /absolute/path/to/asset-repo
42
42
  ```
43
43
 
44
+ `--db` selects the SQLite state file. `--asset-root` (or
45
+ `LINEAGE_ASSET_ROOT`) independently selects the external repository root that
46
+ contains `<project>/assets/catalog.json` and `.asset-scratch` media. Keep these
47
+ arguments explicit when Lineage is installed as a dependency of another repo;
48
+ the installed package directory remains responsible only for bundled code,
49
+ web assets, and public demo fixtures.
50
+
44
51
  ## Runtime Channels and SQLite
45
52
 
46
53
  Lineage treats app code channels and local SQLite data as separate concerns:
@@ -89,7 +96,9 @@ Agents can also export the current active workspace selection as a durable JSON
89
96
  packet for downstream tools such as GrowthOps:
90
97
 
91
98
  ```bash
92
- lineage selection packet --project demo-project --channel linkedin --campaign 2026-07-launch --out ./lineage-selection-packet.json --json
99
+ lineage selection packet --project demo-project --channel linkedin --campaign 2026-07-launch \
100
+ --db /absolute/path/to/lineage.sqlite --asset-root /absolute/path/to/asset-repo \
101
+ --out ./lineage-selection-packet.json --json
93
102
  ```
94
103
 
95
104
  The packet is schema-versioned as `lineage.selection_packet.v1` and includes the
@@ -289,7 +289,7 @@ function isPackageRoot(path) {
289
289
  return false;
290
290
  }
291
291
  }
292
- function resolveRepoRoot() {
292
+ function resolvePackageRoot() {
293
293
  const moduleDir = dirname2(fileURLToPath(import.meta.url));
294
294
  const candidates = [
295
295
  process.env.LINEAGE_REPO_ROOT,
@@ -301,7 +301,12 @@ function resolveRepoRoot() {
301
301
  if (!root) throw new Error("Unable to locate Lineage package root");
302
302
  return root;
303
303
  }
304
- var repoRoot = resolveRepoRoot();
304
+ var packageRoot = resolvePackageRoot();
305
+ var repoRoot = resolve2(process.env.LINEAGE_ASSET_ROOT || packageRoot);
306
+ function setLineageAssetRoot(path) {
307
+ repoRoot = resolve2(path || packageRoot);
308
+ return repoRoot;
309
+ }
305
310
  var defaultProject = "demo-project";
306
311
  var defaultProduct = process.env.LINEAGE_DEFAULT_PRODUCT || defaultProject;
307
312
  var publicFallbackBucket = "lineage-demo-assets";
@@ -326,7 +331,7 @@ function catalogPath(project = defaultProject) {
326
331
  return join3(repoRoot, cleanProject(project), "assets", "catalog.json");
327
332
  }
328
333
  function fixtureCatalogPath(project = defaultProject) {
329
- return join3(repoRoot, "fixtures", cleanProject(project), "assets", "catalog.json");
334
+ return join3(packageRoot, "fixtures", cleanProject(project), "assets", "catalog.json");
330
335
  }
331
336
  function resolvedCatalogPath(project = defaultProject) {
332
337
  const path = catalogPath(project);
@@ -588,7 +593,7 @@ function nowIso() {
588
593
  return (/* @__PURE__ */ new Date()).toISOString();
589
594
  }
590
595
  function lineageDbPath() {
591
- return process.env.LINEAGE_DB || join4(repoRoot, ".lineage", "asset-lineage.sqlite");
596
+ return process.env.LINEAGE_DB || join4(packageRoot, ".lineage", "asset-lineage.sqlite");
592
597
  }
593
598
  function lineageDb() {
594
599
  mkdirSync3(join4(lineageDbPath(), ".."), { recursive: true });
@@ -3601,7 +3606,7 @@ import { join as join6 } from "node:path";
3601
3606
  var require3 = createRequire2(import.meta.url);
3602
3607
  function packageInfo() {
3603
3608
  try {
3604
- const info = JSON.parse(readFileSync3(join6(repoRoot, "package.json"), "utf8"));
3609
+ const info = JSON.parse(readFileSync3(join6(packageRoot, "package.json"), "utf8"));
3605
3610
  return { name: info.name || "@mean-weasel/lineage", version: info.version || "0.0.0" };
3606
3611
  } catch {
3607
3612
  return { name: "@mean-weasel/lineage", version: "0.0.0" };
@@ -3617,8 +3622,8 @@ function normalizeRuntimeChannel(value) {
3617
3622
  function gitSha() {
3618
3623
  const envSha = process.env.LINEAGE_GIT_SHA || process.env.GITHUB_SHA;
3619
3624
  if (envSha) return envSha.slice(0, 40);
3620
- if (!existsSync6(join6(repoRoot, ".git"))) return void 0;
3621
- const result = spawnSync2("git", ["rev-parse", "--short=12", "HEAD"], { cwd: repoRoot, encoding: "utf8" });
3625
+ if (!existsSync6(join6(packageRoot, ".git"))) return void 0;
3626
+ const result = spawnSync2("git", ["rev-parse", "--short=12", "HEAD"], { cwd: packageRoot, encoding: "utf8" });
3622
3627
  return result.status === 0 ? result.stdout.trim() || void 0 : void 0;
3623
3628
  }
3624
3629
  function tableExists(database, table) {
@@ -3651,6 +3656,7 @@ function getLineageRuntimeInfo(options = {}) {
3651
3656
  }
3652
3657
  }
3653
3658
  return {
3659
+ asset_root: repoRoot,
3654
3660
  channel: normalizeRuntimeChannel(options.channel || process.env.LINEAGE_CHANNEL || process.env.LINEAGE_RELEASE_CHANNEL),
3655
3661
  database: databaseInfo,
3656
3662
  fetchedAt: nowIso(),
@@ -3666,12 +3672,12 @@ var signalExitCodes = {
3666
3672
  SIGINT: 130,
3667
3673
  SIGTERM: 143
3668
3674
  };
3669
- function packageRoot() {
3675
+ function packageRoot2() {
3670
3676
  return resolve5(dirname3(fileURLToPath2(import.meta.url)), "..", "..");
3671
3677
  }
3672
3678
  function packageVersion() {
3673
3679
  try {
3674
- const packageInfo2 = JSON.parse(readFileSync4(join7(packageRoot(), "package.json"), "utf8"));
3680
+ const packageInfo2 = JSON.parse(readFileSync4(join7(packageRoot2(), "package.json"), "utf8"));
3675
3681
  return packageInfo2.version || "0.0.0";
3676
3682
  } catch {
3677
3683
  return "0.0.0";
@@ -3705,25 +3711,36 @@ function readOptions(args, name) {
3705
3711
  return values;
3706
3712
  }
3707
3713
  function resolveStartOptions(config, args) {
3708
- const runtimeDir = dataRoot(config.displayName);
3709
3714
  const rawPort = readOption(args, "--port") || process.env.PORT || String(config.defaultPort);
3710
3715
  const port = Number(rawPort);
3711
3716
  if (!Number.isInteger(port) || port < 1 || port > 65535) {
3712
3717
  throw new Error(`Invalid port: ${rawPort}`);
3713
3718
  }
3714
3719
  return {
3715
- dbPath: readOption(args, "--db") || process.env.LINEAGE_DB || join7(runtimeDir, `${config.binName}.sqlite`),
3720
+ assetRoot: resolveCliAssetRoot(args),
3721
+ dbPath: resolveCliDbPath(config, args),
3716
3722
  host: readOption(args, "--host") || process.env.HOST || config.defaultHost,
3717
3723
  json: args.includes("--json"),
3718
3724
  open: args.includes("--open"),
3719
3725
  port
3720
3726
  };
3721
3727
  }
3728
+ function resolveCliAssetRoot(args) {
3729
+ return resolve5(readOption(args, "--asset-root") || process.env.LINEAGE_ASSET_ROOT || packageRoot);
3730
+ }
3731
+ function configureCliAssetRoot(args) {
3732
+ const assetRoot = resolveCliAssetRoot(args);
3733
+ process.env.LINEAGE_ASSET_ROOT = assetRoot;
3734
+ return setLineageAssetRoot(assetRoot);
3735
+ }
3736
+ function resolveCliDbPath(config, args) {
3737
+ return readOption(args, "--db") || process.env.LINEAGE_DB || join7(dataRoot(config.displayName), `${config.binName}.sqlite`);
3738
+ }
3722
3739
  function formatLineageHelp(config) {
3723
3740
  return `${config.binName} ${packageVersion()}
3724
3741
 
3725
3742
  Usage:
3726
- ${config.binName} start [--port <port>] [--host <host>] [--db <path>] [--open] [--json]
3743
+ ${config.binName} start [--port <port>] [--host <host>] [--db <path>] [--asset-root <path>] [--open] [--json]
3727
3744
  ${config.binName} next [--project <project>] [--root <asset-id>] [--db <path>] [--json]
3728
3745
  ${config.binName} brief [--project <project>] [--root <asset-id>] [--db <path>] [--json]
3729
3746
  ${config.binName} inspect --asset-id <asset-id> [--project <project>] [--db <path>] [--json]
@@ -3756,6 +3773,9 @@ Usage:
3756
3773
 
3757
3774
  ${config.displayName} runs the bundled Lineage server for the ${config.channel} channel.
3758
3775
 
3776
+ Asset catalogs and local media default to the installed package root. Pass
3777
+ --asset-root <path> or LINEAGE_ASSET_ROOT to use an external project root.
3778
+
3759
3779
  Variation vs re-roll:
3760
3780
  link-child creates a new visible child variation edge.
3761
3781
  reroll mark -> reroll plan -> reroll import updates the same node with a new attempt.`;
@@ -3782,6 +3802,7 @@ function positionalArgs(args) {
3782
3802
  return values;
3783
3803
  }
3784
3804
  function resolveDataCommandOptions(args) {
3805
+ configureCliAssetRoot(args);
3785
3806
  const positions = positionalArgs(args);
3786
3807
  const options = {
3787
3808
  assetId: readOption(args, "--asset-id") || positions[0],
@@ -4028,8 +4049,9 @@ function printDataResult(command, result, json) {
4028
4049
  console.log(String(result));
4029
4050
  }
4030
4051
  function runLineageDbCommand(config, command, args) {
4031
- const dbPath = readOption(args, "--db");
4032
- if (dbPath) process.env.LINEAGE_DB = dbPath;
4052
+ configureCliAssetRoot(args);
4053
+ const dbPath = resolveCliDbPath(config, args);
4054
+ process.env.LINEAGE_DB = dbPath;
4033
4055
  if (command === "info") return getLineageRuntimeInfo({ channel: config.channel, dbPath });
4034
4056
  throw new Error(`Unknown db command: ${command}`);
4035
4057
  }
@@ -4044,6 +4066,7 @@ function printDbResult(command, result, json) {
4044
4066
  console.log(`Version: ${runtime.version}`);
4045
4067
  if (runtime.git_sha) console.log(`Git: ${runtime.git_sha}`);
4046
4068
  if (runtime.node_env) console.log(`Node env: ${runtime.node_env}`);
4069
+ console.log(`Assets: ${runtime.asset_root}`);
4047
4070
  console.log(`SQLite: ${runtime.database.path}`);
4048
4071
  console.log(`Exists: ${runtime.database.exists ? "yes" : "no"}`);
4049
4072
  if (runtime.database.size_bytes !== void 0) console.log(`Size: ${runtime.database.size_bytes} bytes`);
@@ -4056,6 +4079,7 @@ function printDbResult(command, result, json) {
4056
4079
  console.log(String(result));
4057
4080
  }
4058
4081
  function runLineageAgentCommand(command, args) {
4082
+ configureCliAssetRoot(args);
4059
4083
  const dbPath = readOption(args, "--db");
4060
4084
  if (dbPath) process.env.LINEAGE_DB = dbPath;
4061
4085
  const project = readOption(args, "--project") || process.env.LINEAGE_DEFAULT_PRODUCT || defaultProduct;
@@ -4181,7 +4205,7 @@ function start(config, args) {
4181
4205
  else console.error(`${config.binName}: ${message}`);
4182
4206
  process.exit(1);
4183
4207
  }
4184
- const serverPath = join7(packageRoot(), "dist", "server.js");
4208
+ const serverPath = join7(packageRoot2(), "dist", "server.js");
4185
4209
  if (!existsSync7(serverPath)) {
4186
4210
  const message = `Missing bundled server at ${serverPath}. Run npm run build before using ${config.binName} start from a source checkout.`;
4187
4211
  if (options.json) console.error(JSON.stringify({ ok: false, error: message }, null, 2));
@@ -4191,16 +4215,18 @@ function start(config, args) {
4191
4215
  mkdirSync4(dirname3(options.dbPath), { recursive: true });
4192
4216
  const url = `http://${options.host}:${options.port}`;
4193
4217
  if (options.json) {
4194
- console.log(JSON.stringify({ channel: config.channel, dbPath: options.dbPath, host: options.host, port: options.port, status: "starting", url }, null, 2));
4218
+ console.log(JSON.stringify({ assetRoot: options.assetRoot, channel: config.channel, dbPath: options.dbPath, host: options.host, port: options.port, status: "starting", url }, null, 2));
4195
4219
  } else {
4196
4220
  console.log(`${config.displayName} starting at ${url}`);
4197
4221
  console.log(`SQLite: ${options.dbPath}`);
4222
+ console.log(`Assets: ${options.assetRoot}`);
4198
4223
  }
4199
4224
  if (options.open) openBrowser(url);
4200
4225
  const child = spawn(process.execPath, [serverPath], {
4201
4226
  env: {
4202
4227
  ...process.env,
4203
4228
  HOST: options.host,
4229
+ LINEAGE_ASSET_ROOT: options.assetRoot,
4204
4230
  LINEAGE_CHANNEL: config.channel,
4205
4231
  LINEAGE_DB: options.dbPath,
4206
4232
  NODE_ENV: "production",