@lenso/cli 0.4.0 → 0.5.0

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 CHANGED
@@ -193,6 +193,23 @@ identity plus the expected `normal` or `restore` mode before committing durable
193
193
  evidence. A healthy process with the wrong workload mode is treated as a failed
194
194
  authority transfer and is fenced again.
195
195
 
196
+ For the complete local development path, start the generated Host, every
197
+ auto-start Service in `lenso.workspace.json`, and a connected Console with one
198
+ command:
199
+
200
+ ```sh
201
+ cd ./my-lenso-host
202
+ lenso dev up --console-root ../lenso-console
203
+ ```
204
+
205
+ The first run securely prompts for the local Operator password. Automation can
206
+ pass `--operator-password-file` with an owner-only regular file. The command
207
+ creates loopback-only enrollment evidence, starts and migrates both Stores,
208
+ builds the Console, configures or reuses the durable Operator, reconciles
209
+ Module-owned UI artifacts, and connects the exact topology. Ctrl-C stops the
210
+ Host, Console, and only the Services started by that invocation. Story is a
211
+ Console-owned linked surface; it does not require a separate Module install.
212
+
196
213
  After installing and starting the independent Lenso Console Service, create its
197
214
  first password user and bootstrap that user as the first Console Operator from
198
215
  outside the Service. In an interactive terminal, the CLI securely prompts for
@@ -227,6 +244,10 @@ lenso console operator configure \
227
244
  --identifier admin@example.com
228
245
  ```
229
246
 
247
+ Both commands persist the user in the Console Access administrator store and
248
+ maintain the compatibility Auth scope configuration. The first administrator
249
+ is the durable Console superadmin; later configured users are administrators.
250
+
230
251
  This preserves unrelated operators and explicit extra scopes while adding the
231
252
  System read/connect, artifact reconciliation, Surface Gateway, Auth, and Story
232
253
  capabilities required by the current Console workflow.
@@ -258,7 +279,9 @@ for the host-facade roadmap.
258
279
  the template Postgres service, runs migrations, then keeps the API and worker
259
280
  running until Ctrl-C. New hosts run them in one local process; pass
260
281
  `--separate-worker` when you want two child processes. Use `--skip-db` or
261
- `--skip-migrate` when you already have those steps covered.
282
+ `--skip-migrate` when you already have those steps covered. `lenso dev up`
283
+ creates a missing private `.env`, choosing free loopback ports when the template
284
+ defaults are occupied; an existing `.env` remains authoritative.
262
285
 
263
286
  ## Scaffold a module
264
287
 
@@ -519,8 +542,9 @@ contract digests, and optional release-bound `console_ui_esm` artifact.
519
542
  connects a service, but it does not mean every module inside that service is
520
543
  the user-facing install target.
521
544
 
522
- The Service scaffold consumes `@lenso/service-kit` from the framework SDK when
523
- used in a sibling checkout. Outside that checkout it uses the published SDK.
545
+ The Service scaffold uses published `@lenso/service-kit` and `lenso-service`
546
+ dependencies by default. Framework contributors can opt into local checkout
547
+ dependencies explicitly with `lenso service create --local-framework-root PATH`.
524
548
 
525
549
  ### Console and Module UI development
526
550
 
@@ -530,6 +554,11 @@ Run the complete local Console Service from its repository:
530
554
  lenso console dev --console-root ../lenso-console
531
555
  ```
532
556
 
557
+ On first run, this command creates `service/.env` with available loopback ports,
558
+ installs missing workspace dependencies, starts an isolated Postgres Compose
559
+ project, applies migrations, and then serves the complete Console. Existing
560
+ `service/.env` files remain authoritative.
561
+
533
562
  Run the Console UI artifact owned by the current Module:
534
563
 
535
564
  ```sh
package/bin/lenso.js CHANGED
@@ -6,8 +6,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.platformTag = platformTag;
8
8
  exports.binaryPath = binaryPath;
9
+ exports.ensureExecutableBinary = ensureExecutableBinary;
9
10
  exports.forwardTerminationSignals = forwardTerminationSignals;
10
11
  const node_child_process_1 = require("node:child_process");
12
+ const node_fs_1 = require("node:fs");
11
13
  const node_path_1 = __importDefault(require("node:path"));
12
14
  const SUPPORTED_PLATFORMS = new Set(["darwin", "linux", "win32"]);
13
15
  const SUPPORTED_ARCHES = new Set(["arm64", "x64"]);
@@ -25,6 +27,15 @@ function binaryPath(baseDir = node_path_1.default.join(__dirname, ".."), platfor
25
27
  const exe = platform === "win32" ? "lenso.exe" : "lenso";
26
28
  return node_path_1.default.join(baseDir, "vendor", tag, exe);
27
29
  }
30
+ function ensureExecutableBinary(executable, platform = process.platform) {
31
+ if (platform === "win32") {
32
+ return;
33
+ }
34
+ const mode = (0, node_fs_1.statSync)(executable).mode;
35
+ if ((mode & 0o111) === 0) {
36
+ (0, node_fs_1.chmodSync)(executable, mode | 0o111);
37
+ }
38
+ }
28
39
  function forwardTerminationSignals(parent, child, signals = ["SIGINT", "SIGTERM"]) {
29
40
  const handlers = new Map(signals.map((signal) => [
30
41
  signal,
@@ -49,6 +60,14 @@ function run() {
49
60
  console.error(`lenso: unsupported platform ${process.platform}/${process.arch}`);
50
61
  process.exit(1);
51
62
  }
63
+ try {
64
+ ensureExecutableBinary(exe);
65
+ }
66
+ catch (error) {
67
+ const message = error instanceof Error ? error.message : String(error);
68
+ console.error(`lenso: bundled binary is not executable: ${message}`);
69
+ process.exit(1);
70
+ }
52
71
  const child = (0, node_child_process_1.spawn)(exe, process.argv.slice(2), { stdio: "inherit" });
53
72
  const stopForwardingSignals = forwardTerminationSignals(process, child);
54
73
  child.on("error", (error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenso/cli",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Lenso command-line interface for scaffolding and operating Lenso backend projects.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/LioRael/lenso-cli",
Binary file
Binary file
Binary file
Binary file