@lenso/cli 0.2.17 → 0.4.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
@@ -10,22 +10,42 @@ npm install -g @lenso/cli
10
10
  cargo install lenso-cli
11
11
  ```
12
12
 
13
- ## Scaffold a host application
13
+ ## Application lifecycle
14
14
 
15
15
  ```sh
16
- lenso host init my-app
17
- cd my-app
18
- cp .env.example .env
19
- lenso serve
16
+ lenso app compose ./support-desk \
17
+ --blueprint support-desk \
18
+ --implementation support-api=linked \
19
+ --apply
20
+ cd support-desk
21
+ lenso system dev
20
22
  ```
21
23
 
22
- The package name defaults to the target directory name and can be overridden with
23
- `--name`. Pass `--force` to scaffold into a non-empty directory.
24
+ `lenso app compose` writes the exact `lenso.app.json` App Composition and lock.
25
+ Its `--apply` flag atomically materializes that composition in the same command;
26
+ it is not a separate lifecycle stage and does not create a plan artifact. The
27
+ public application path is Compose, Run locally, Connect, and Status. Connect
28
+ and Status happen in Lenso Console through a signed enrollment exchange. The
29
+ CLI does not select an environment, deploy the application, release it, or
30
+ connect it to Console.
31
+
32
+ `lenso system check` remains a contract-validation command. `lenso host init`
33
+ and `lenso serve` remain lower-level host development tools, not alternative
34
+ application lifecycle stages.
35
+
36
+ The former App Plan, Apply, Verify, Diff, Repair, Next, Upgrade, and Explain
37
+ commands and the former System Init, AddService, AddModule, Plan, Diff, Apply,
38
+ Doctor, Release, Runbook, and Graph commands are no longer public entrypoints.
39
+ `lenso app compose` also no longer accepts `--write-plan`, `--explain`, or
40
+ `--addon`. Its surviving `--apply` option is only the atomic materialization
41
+ flag described above, not an Apply stage.
24
42
 
25
- ## Install Lenso Console
43
+ ## Provision Lenso Console independently
26
44
 
27
45
  Lenso Console is installed as an independent Service, not embedded into a
28
- business Service. Obtain an official GitHub-attested Console Release Manifest,
46
+ business Service. Provisioning Console is separate from connecting an
47
+ application and does not grant Console production deployment or release
48
+ authority. Obtain an official GitHub-attested Console Release Manifest,
29
49
  review the deterministic plan, and then approve that exact plan digest:
30
50
 
31
51
  ```sh
@@ -198,6 +218,36 @@ existing identity with `--identifier` or `--user-id`. Restart the Console API
198
218
  and Worker after bootstrapping. Business Service users and Auth state are never
199
219
  modified.
200
220
 
221
+ After upgrading the CLI, reconcile an existing Operator with the current
222
+ minimum scopes idempotently:
223
+
224
+ ```sh
225
+ lenso console operator configure \
226
+ --console-root ../lenso-console \
227
+ --identifier admin@example.com
228
+ ```
229
+
230
+ This preserves unrelated operators and explicit extra scopes while adding the
231
+ System read/connect, artifact reconciliation, Surface Gateway, Auth, and Story
232
+ capabilities required by the current Console workflow.
233
+
234
+ Apply prepared signed connection evidence through one public, idempotent CLI
235
+ entrypoint instead of a sequence of custom HTTP calls:
236
+
237
+ ```sh
238
+ LENSO_CONSOLE_TOKEN='<operator-session-token>' \
239
+ lenso console connect \
240
+ --console-url http://127.0.0.1:3030 \
241
+ --bundle .lenso/console-connect.json
242
+ ```
243
+
244
+ The `lenso.console-connect.v1` bundle contains signed enrollment receipts, an
245
+ optional exact `console_composition` artifact effect, and the digest-bound
246
+ System Connection request. The command reuses existing enrollments, reconciles
247
+ artifacts, connects the System, and fails unless Console returns `connected`.
248
+ Use `--token-file` with a private regular file for non-interactive operation;
249
+ tokens and signing material are never printed or stored in the bundle.
250
+
201
251
  The generated host depends on the crates.io `lenso` crate with the `host`
202
252
  feature, which is the current narrow host API for booting API, worker, and
203
253
  migration entrypoints. See
@@ -216,8 +266,8 @@ running until Ctrl-C. New hosts run them in one local process; pass
216
266
  lenso module create billing
217
267
  ```
218
268
 
219
- Add `--with-console-ui` when the Module Release should also contain its isolated
220
- Console UI artifact:
269
+ Add `--with-console-ui` when the Module Release should also contain its verified
270
+ same-realm ESM Console UI artifact:
221
271
 
222
272
  ```sh
223
273
  lenso module create billing --with-console-ui
@@ -257,6 +307,47 @@ lenso system dev --scenario deadline-timeout --json
257
307
  lenso system dev --cleanup
258
308
  ```
259
309
 
310
+ For a new product-shaped application, materialize one exact App Composition
311
+ instead of layering generated state. The blueprint and implementation overrides
312
+ are composition inputs; `lenso.app.json` is the only application composition
313
+ and lock, with immutable Module release digests, implementation bindings,
314
+ resolved dependency selections, and an optimistic revision:
315
+
316
+ ```sh
317
+ lenso app compose ./support-desk --blueprint support-desk --apply
318
+ lenso app compose --repo-root ./support-desk \
319
+ --implementation support-api=linked \
320
+ --observed-revision 1 --apply
321
+ lenso system dev --system-file ./support-desk/lenso.app.json --dry-run --json
322
+ lenso system dev --system-file ./support-desk/lenso.app.json
323
+ ```
324
+
325
+ `lenso system dev` realizes service-backed bindings through a persistent Local
326
+ Control Adapter. The coordinator may exit after reporting workload identities;
327
+ the adapter and its explicitly started local workloads remain active. Use
328
+ `lenso system dev --system-file ./support-desk/lenso.app.json --cleanup` to
329
+ stop only the adapter-owned workloads. This path does not create a second App
330
+ lock or copy process commands into `lenso.app.json`.
331
+
332
+ The adapter state under `.lenso/local-control-adapter/<appId>/state.json`
333
+ advertises its `adapterId`, exact `adapterWorkload`, loopback `endpoint`,
334
+ `workloadControlProtocol`, `workloadControlSchemaDigest`, and exact
335
+ `capabilities`. Without a server-side
336
+ `LENSO_WORKLOAD_CONTROL_TOKEN` override, startup creates an owner-only local
337
+ credential file and records only its `credentialFile` reference; the bearer
338
+ token is never serialized into adapter state or HTTP responses.
339
+
340
+ The Local Control Adapter advertises and accepts only `suspend` and `resume`.
341
+ Each accepted mutation returns an asynchronous Operation Record identified by
342
+ `operationId`; callers poll that handle for the Adapter's final result.
343
+
344
+ Until the Workload Control contract from
345
+ [LioRael/lenso#530](https://github.com/LioRael/lenso/pull/530) is published,
346
+ the CLI keeps a private, frozen mirror of its wire DTOs and constants. The
347
+ advertised schema digest and protocol conformance tests pin that bounded mirror
348
+ to the reviewed contract without adding an unpublished dependency to the CLI
349
+ package.
350
+
260
351
  The System graph remains in `lenso.system.json`. Local-only executable details
261
352
  live beside it in `lenso.system-sandbox.json`:
262
353
 
@@ -359,10 +450,34 @@ Workloads, move data, or change authority. Use `--repo-root` and
359
450
  `--modules-root` when the Module sources are not under the current repository's
360
451
  default `modules/` directory.
361
452
 
362
- Generated TS and Rust services also support `--check-release` to print the
363
- development module release descriptor before packaging.
364
- Before handing a service to another app or deployment pipeline, package-check
365
- the project and then emit a local service artifact:
453
+ Generated TypeScript services expose the current Provider contract directly:
454
+
455
+ ```sh
456
+ pnpm check
457
+ pnpm module:release > lenso.module-release.json
458
+ pnpm start
459
+ ```
460
+
461
+ `pnpm start` serves the exact `lenso.provider.v1` descriptor, invocation,
462
+ recovery, and acknowledgement endpoints. The descriptor digests are the same
463
+ ones emitted in `lenso.module-release.json`.
464
+
465
+ Install that release into the Host runtime inputs with the Provider URL, not
466
+ the legacy Service discovery URL:
467
+
468
+ ```sh
469
+ lenso module install ./lenso.module-release.json \
470
+ --base-url http://127.0.0.1:4100/lenso/provider/v1 \
471
+ --repo-root ../my-lenso-host
472
+ ```
473
+
474
+ This writes `lenso.modules.json`, `lenso.modules.lock.json`, the Module Planning
475
+ Context, and the local Service Installation Set consumed by Host startup. It
476
+ does not write `SERVICE_MODULES` or treat an old install ledger as runtime
477
+ truth.
478
+
479
+ Before handing a legacy Service manifest to another app or deployment
480
+ pipeline, package-check the project and emit a compatibility package:
366
481
 
367
482
  ```sh
368
483
  cd ../services/support-suite-provider
@@ -376,31 +491,29 @@ The package artifact contains the canonical `lenso.service.json`,
376
491
  `modules/<module>/lenso.module-release.json` file for each provided module.
377
492
  The service package records the provider name, version, and provided module
378
493
  names; each module release is the business-module install entrypoint.
379
- Operators can install a provider directly. For a local package artifact, still
380
- pass the runtime service base URL:
494
+ Compatibility packages remain available for older Service discovery consumers:
381
495
 
382
496
  ```sh
383
497
  lenso service install dist/lenso-service/support-suite-provider/lenso.service-package.json \
384
498
  --base-url http://127.0.0.1:4100/lenso/service/v1
385
499
  ```
386
500
 
387
- Install and manage a Module through the stable lifecycle commands:
501
+ Install current Provider Modules from an exact release. The endpoint must end
502
+ in `/lenso/provider/v1`:
388
503
 
389
504
  ```sh
390
- lenso module install dist/lenso-service/support-suite-provider/modules/support-ticket/lenso.module-release.json \
391
- --base-url http://127.0.0.1:4100/lenso/service/v1
392
- lenso module disable support-ticket
393
- lenso module remove support-ticket
394
- lenso module doctor support-ticket
505
+ lenso module install ./lenso.module-release.json \
506
+ --base-url http://127.0.0.1:4100/lenso/provider/v1
395
507
  ```
396
508
 
397
- `lenso.module-release.v1` is the module release channel. It records the module
398
- name, version, capabilities, source, and optional provider pointer. V11 keeps
399
- `lenso module install` as the unified business-capability entrypoint:
509
+ `lenso.module-release.v1` is the current Module release channel. It records a
510
+ fully qualified Module ID, canonical Manifest digest, exact delivery, governing
511
+ contract digests, and optional release-bound `console_ui_esm` artifact.
400
512
 
401
- - `source: service` resolves to a provider service package or service manifest.
402
- - `source: linked` enables linked Rust code in the host.
403
- - `source: bundled` enables a host-bundled module.
513
+ - Service delivery resolves to a locked Provider export and Service Installation.
514
+ - Linked delivery resolves to an immutable crate release and Host binding.
515
+ - A Console Surface exists only when the same exact release carries a
516
+ `console_ui_esm` artifact and Console has reconciled its receipt.
404
517
 
405
518
  `lenso service install` remains the lower-level provider/process command. It
406
519
  connects a service, but it does not mean every module inside that service is
@@ -429,24 +542,13 @@ longer copies packages into a Console checkout or maintains extension registries
429
542
  ## Install a module
430
543
 
431
544
  ```sh
432
- lenso module install auth
433
- lenso module install auth-password
434
- lenso module install auth-oidc
435
- lenso module install auth-device
545
+ lenso module install ./releases/auth/lenso.module-release.json
546
+ lenso module install ./releases/auth-password/lenso.module-release.json
436
547
  ```
437
548
 
438
- `module install` reads `source` from the module descriptor when one is present.
439
- When the reference is a module name, the CLI resolves it from the official
440
- catalog at `https://catalog.lenso.dev/v1/modules.json` unless `--catalog-url`
441
- points at another registry. If the primary official catalog endpoint is
442
- temporarily blocked by edge security, the CLI falls back to the official
443
- workers.dev mirror at `https://lenso-catalog.lenso.workers.dev/v1/modules.json`.
444
- For V5 service-backed modules, `module install <name>` is the business-capability
445
- entrypoint: the catalog resolves the provider service, installs it when needed,
446
- then enables the requested module.
447
- For module releases, `module install <module-release.json>` resolves the
448
- release by source, then records `moduleRelease` provenance in
449
- `.lenso/module-installs.json` where the source supports a receipt.
549
+ Prefer an exact Module Release reference. Name-based catalog entries are accepted
550
+ only as a compatibility path and may describe a legacy linked install; they do
551
+ not prove that a current Console Surface artifact exists.
450
552
 
451
553
  Install a service directly when you have a workspace service name or manifest
452
554
  reference:
@@ -464,12 +566,11 @@ also infer `--base-url`; package artifacts outside that workspace still need
464
566
  `--base-url` so the host records the runtime service endpoint rather than the
465
567
  file path.
466
568
 
467
- Service installs update `SERVICE_MODULES` and record `.lenso/module-installs.json`
468
- in one step. Console UI artifacts remain immutable members of their Module
469
- Release and are bound only by an applied Console Service Composition. Linked modules update the
470
- host `Cargo.toml`, `src/lib.rs`, `.env` toggle, and the same install receipt
471
- from the descriptor's `linked` section. `module add` remains a compatibility
472
- alias for service installs.
569
+ Exact Provider installs update the App Module lock and local Service
570
+ Installation Set in one step. Console UI artifacts remain immutable members of
571
+ their Module Release and are bound only by an applied Console composition.
572
+ Legacy linked descriptors still update host source and their compatibility
573
+ receipt, but that receipt is not an App Composition or a Surface grant.
473
574
 
474
575
  Legacy `lenso module install <manifest-url>` still works for one compatibility
475
576
  window, but prints a deprecation warning. Use `lenso service install <manifest>`
@@ -570,11 +671,9 @@ lenso service doctor billing --json
570
671
  lenso service check billing --json
571
672
  ```
572
673
 
573
- The doctor reads `SERVICE_MODULES`, `.lenso/module-installs.json`, and
574
- `.lenso/module-services.json`. It reports whether the service is
575
- installed, configured, whether an HTTP manifest is reachable, whether managed
576
- service `readyUrl` endpoints are ready, and which stale `.lock`/`.pid` files
577
- may be blocking a host-started service.
674
+ The legacy doctor still reports compatibility Service discovery state. For a
675
+ current Provider, verify `lenso.modules.lock.json`, the local Service
676
+ Installation Set, and the live `/lenso/provider/v1` descriptor at Host startup.
578
677
 
579
678
  Export declared service processes as a Compose fragment when handing the
580
679
  service to deployment tooling:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenso/cli",
3
- "version": "0.2.17",
3
+ "version": "0.4.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