@lenso/cli 0.4.0 → 0.6.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 +36 -3
- package/bin/lenso.js +19 -0
- package/package.json +1 -1
- package/vendor/darwin-arm64/lenso +0 -0
- package/vendor/darwin-x64/lenso +0 -0
- package/vendor/linux-x64/lenso +0 -0
- package/vendor/win32-x64/lenso.exe +0 -0
package/README.md
CHANGED
|
@@ -193,6 +193,27 @@ 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, installs every workspace Provider export from its exact
|
|
209
|
+
Module Release, configures or reuses the durable Operator, reconciles
|
|
210
|
+
Module-owned UI artifacts, and connects the exact topology. Provider releases
|
|
211
|
+
and Service Installation state are written before the authoritative Host starts,
|
|
212
|
+
so `connected` and a callable Host business route refer to the same locked
|
|
213
|
+
export. Ctrl-C stops the Host, Console, and only the Services started by that
|
|
214
|
+
invocation. Story is a Console-owned linked surface; it does not require a
|
|
215
|
+
separate Module install.
|
|
216
|
+
|
|
196
217
|
After installing and starting the independent Lenso Console Service, create its
|
|
197
218
|
first password user and bootstrap that user as the first Console Operator from
|
|
198
219
|
outside the Service. In an interactive terminal, the CLI securely prompts for
|
|
@@ -227,6 +248,10 @@ lenso console operator configure \
|
|
|
227
248
|
--identifier admin@example.com
|
|
228
249
|
```
|
|
229
250
|
|
|
251
|
+
Both commands persist the user in the Console Access administrator store and
|
|
252
|
+
maintain the compatibility Auth scope configuration. The first administrator
|
|
253
|
+
is the durable Console superadmin; later configured users are administrators.
|
|
254
|
+
|
|
230
255
|
This preserves unrelated operators and explicit extra scopes while adding the
|
|
231
256
|
System read/connect, artifact reconciliation, Surface Gateway, Auth, and Story
|
|
232
257
|
capabilities required by the current Console workflow.
|
|
@@ -258,7 +283,9 @@ for the host-facade roadmap.
|
|
|
258
283
|
the template Postgres service, runs migrations, then keeps the API and worker
|
|
259
284
|
running until Ctrl-C. New hosts run them in one local process; pass
|
|
260
285
|
`--separate-worker` when you want two child processes. Use `--skip-db` or
|
|
261
|
-
`--skip-migrate` when you already have those steps covered.
|
|
286
|
+
`--skip-migrate` when you already have those steps covered. `lenso dev up`
|
|
287
|
+
creates a missing private `.env`, choosing free loopback ports when the template
|
|
288
|
+
defaults are occupied; an existing `.env` remains authoritative.
|
|
262
289
|
|
|
263
290
|
## Scaffold a module
|
|
264
291
|
|
|
@@ -519,8 +546,9 @@ contract digests, and optional release-bound `console_ui_esm` artifact.
|
|
|
519
546
|
connects a service, but it does not mean every module inside that service is
|
|
520
547
|
the user-facing install target.
|
|
521
548
|
|
|
522
|
-
The Service scaffold
|
|
523
|
-
|
|
549
|
+
The Service scaffold uses published `@lenso/service-kit` and `lenso-service`
|
|
550
|
+
dependencies by default. Framework contributors can opt into local checkout
|
|
551
|
+
dependencies explicitly with `lenso service create --local-framework-root PATH`.
|
|
524
552
|
|
|
525
553
|
### Console and Module UI development
|
|
526
554
|
|
|
@@ -530,6 +558,11 @@ Run the complete local Console Service from its repository:
|
|
|
530
558
|
lenso console dev --console-root ../lenso-console
|
|
531
559
|
```
|
|
532
560
|
|
|
561
|
+
On first run, this command creates `service/.env` with available loopback ports,
|
|
562
|
+
installs missing workspace dependencies, starts an isolated Postgres Compose
|
|
563
|
+
project, applies migrations, and then serves the complete Console. Existing
|
|
564
|
+
`service/.env` files remain authoritative.
|
|
565
|
+
|
|
533
566
|
Run the Console UI artifact owned by the current Module:
|
|
534
567
|
|
|
535
568
|
```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
|
Binary file
|
package/vendor/darwin-x64/lenso
CHANGED
|
Binary file
|
package/vendor/linux-x64/lenso
CHANGED
|
Binary file
|
|
Binary file
|