@lenso/cli 0.1.26 → 0.1.27

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lenso contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -70,7 +70,86 @@ workspace package:
70
70
  lenso module create billing --with-console
71
71
  ```
72
72
 
73
- For a standalone remote package:
73
+ For a standalone service provider:
74
+
75
+ ```sh
76
+ lenso service create support-suite-provider --lang ts --output-dir ../services
77
+ lenso service create support-suite-provider --lang rust --output-dir ../services --port 4110
78
+ ```
79
+
80
+ The generated provider includes a `lenso.service.json` manifest and a minimal
81
+ service process. A service name ending in `-provider` or `-service` provides a
82
+ module named without that suffix, so `support-suite-provider` provides
83
+ `support-suite`.
84
+ `service create` also updates `lenso.workspace.json` unless `--no-workspace` is
85
+ set. That workspace file is the local service plane for development:
86
+
87
+ ```sh
88
+ lenso service workspace list
89
+ lenso service dev
90
+ ```
91
+
92
+ `lenso service dev` starts workspace services first, then starts declared
93
+ installed services from `.lenso/module-services.json`, then runs the host.
94
+ Workspace reads prefer `lenso.workspace.json` and also accept the older
95
+ `.lenso/services.json` path for compatibility.
96
+ Generated TS and Rust services also support `--check-release` to print the
97
+ development module release descriptor before packaging.
98
+ Before handing a service to another app or deployment pipeline, package-check
99
+ the project and then emit a local service artifact:
100
+
101
+ ```sh
102
+ cd ../services/support-suite-provider
103
+ lenso service package --check
104
+ lenso service package --output-dir dist/lenso-service
105
+ ```
106
+
107
+ The package artifact contains the canonical `lenso.service.json`,
108
+ `lenso.service-package.json`, and one
109
+ `modules/<module>/lenso.module.json` plus
110
+ `modules/<module>/lenso.module-release.json` file for each provided module.
111
+ The service package records the provider name, version, and provided module
112
+ names; each module release is the business-module install entrypoint.
113
+ Operators can install a provider directly. For a local package artifact, still
114
+ pass the runtime service base URL:
115
+
116
+ ```sh
117
+ lenso service install dist/lenso-service/support-suite-provider/lenso.service-package.json \
118
+ --base-url http://127.0.0.1:4100/lenso/service/v1
119
+ ```
120
+
121
+ Install a packaged module release with the module command:
122
+
123
+ ```sh
124
+ lenso module release inspect dist/lenso-service/support-suite-provider/modules/support-ticket/lenso.module-release.json
125
+ lenso module release check dist/lenso-service/support-suite-provider/modules/support-ticket/lenso.module-release.json \
126
+ --base-url http://127.0.0.1:4100/lenso/service/v1
127
+ lenso module install dist/lenso-service/support-suite-provider/modules/support-ticket/lenso.module-release.json \
128
+ --base-url http://127.0.0.1:4100/lenso/service/v1
129
+ lenso module enable support-ticket
130
+ lenso module disable support-ticket
131
+ ```
132
+
133
+ `lenso.module-release.v1` is the module release channel. It records the module
134
+ name, version, capabilities, source, and optional provider pointer. V11 keeps
135
+ `lenso module install` as the unified business-capability entrypoint:
136
+
137
+ - `source: service` resolves to a provider service package or service manifest.
138
+ - `source: linked` enables linked Rust code in the host.
139
+ - `source: bundled` enables a host-bundled module.
140
+
141
+ `lenso service install` remains the lower-level provider/process command. It
142
+ connects a service, but it does not mean every module inside that service is
143
+ the user-facing install target.
144
+
145
+ When this command runs from a framework checkout with sibling `lenso` and
146
+ `lenso-runtime-console` repositories, the scaffold uses local path/file
147
+ dependencies so `cargo check` or `pnpm install` can run before the packages are
148
+ published. Outside that checkout it keeps the future-publish version
149
+ dependencies and prints a note to replace them with local paths until
150
+ `lenso-service` and `@lenso/service-kit` are published.
151
+
152
+ The older standalone module package generator is still available as:
74
153
 
75
154
  ```sh
76
155
  lenso module create billing --remote --output-dir ../module-packages
@@ -82,11 +161,33 @@ The Runtime Console package generator is available directly as:
82
161
  lenso console package create billing
83
162
  ```
84
163
 
164
+ ### Runtime Console package development
165
+
166
+ Preview a console package while editing it:
167
+
168
+ ```sh
169
+ lenso console dev --package packages/auth-console
170
+ ```
171
+
172
+ From a module repository root, discover every local console package:
173
+
174
+ ```sh
175
+ lenso module dev --console
176
+ ```
177
+
178
+ Both commands default to standalone mock mode. Add `--host` to proxy real Lenso
179
+ host APIs while still loading the local package bundle:
180
+
181
+ ```sh
182
+ lenso module dev --console --host http://localhost:3000
183
+ ```
184
+
185
+ Set `LENSO_RUNTIME_CONSOLE_ROOT=/path/to/lenso-runtime-console` when the Runtime
186
+ Console checkout is not a sibling of the current repository.
187
+
85
188
  ## Install a module
86
189
 
87
190
  ```sh
88
- lenso module install https://example.com/lenso/module/v1/manifest
89
- lenso module install ./lenso.module.json
90
191
  lenso module install auth
91
192
  lenso module install auth-password
92
193
  lenso module install auth-oidc
@@ -94,12 +195,42 @@ lenso module install auth-device
94
195
  ```
95
196
 
96
197
  `module install` reads `source` from the module descriptor when one is present.
97
- Remote modules update `REMOTE_MODULES`, copy declared Runtime Console bundles to
198
+ When the reference is a module name, the CLI resolves it from the official
199
+ catalog at `https://catalog.lenso.dev/v1/modules.json` unless `--catalog-url`
200
+ points at another registry. For V5 service-backed modules, `module install
201
+ <name>` is the business-capability entrypoint: the catalog resolves the provider
202
+ service, installs it when needed, then enables the requested module.
203
+ For module releases, `module install <module-release.json>` resolves the
204
+ release by source, then records `moduleRelease` provenance in
205
+ `.lenso/module-installs.json` where the source supports a receipt.
206
+
207
+ Install a service directly when you have a workspace service name or manifest
208
+ reference:
209
+
210
+ ```sh
211
+ lenso service install support-suite-provider
212
+ lenso service install https://example.com/lenso/service/v1/manifest
213
+ lenso service install ./lenso.service.json --repo-root ../my-lenso-host
214
+ ```
215
+
216
+ When the first argument matches a service in `lenso.workspace.json` or
217
+ `.lenso/services.json`, the CLI resolves its manifest and infers `--base-url`
218
+ from the service `readyUrl`. Local source manifests registered in the workspace
219
+ also infer `--base-url`; package artifacts outside that workspace still need
220
+ `--base-url` so the host records the runtime service endpoint rather than the
221
+ file path.
222
+
223
+ Service installs update `REMOTE_MODULES`, copy declared Runtime Console bundles to
98
224
  `.lenso/console/extensions`, update `.lenso/console/extensions/registry.json`,
99
225
  and record `.lenso/module-installs.json` in one step. Linked modules update the
100
226
  host `Cargo.toml`, `src/lib.rs`, `.env` toggle, and the same install receipt
101
227
  from the descriptor's `linked` section. `module add` remains a compatibility
102
- alias for remote installs.
228
+ alias for service installs.
229
+
230
+ Legacy `lenso module install <manifest-url>` still works for one compatibility
231
+ window, but prints a deprecation warning. Use `lenso service install <manifest>`
232
+ for process manifests and `lenso module install <module-name>` for business
233
+ modules.
103
234
 
104
235
  Install descriptor profiles let a module expose optional setup without baking
105
236
  module-specific choices into the CLI. For Redis-backed auth sessions:
@@ -130,36 +261,97 @@ builtin module entry.
130
261
  Use `--no-console-extension` when you want to skip Runtime Console extension
131
262
  registration.
132
263
 
133
- Remote manifests may also declare `install.env` values and `install.commands`.
134
- Env values are written to `.env`; commands are run only when you pass:
264
+ Service module manifests may also declare `install.env` values and
265
+ `install.commands`. Env values are written to `.env`; commands are run only when
266
+ you pass:
135
267
 
136
268
  ```sh
137
- lenso module install https://example.com/lenso/module/v1/manifest --run-install-commands
269
+ lenso service install https://example.com/lenso/service/v1/manifest --run-install-commands
138
270
  ```
139
271
 
140
- For long-running remote module backends, declare `install.services`. These are
141
- stored in `.lenso/module-services.json` and started before the host loads remote
142
- modules on API/worker startup. Services started by the host are tracked with
272
+ For long-running service backends, declare `install.services`. These are
273
+ stored in `.lenso/module-services.json` and started before the host loads
274
+ service-provided modules on API/worker startup. Services started by the host are tracked with
143
275
  `.lock`/`.pid` files and stopped when the owning API/worker process exits;
144
276
  services that are already ready before startup are treated as external and are
145
277
  not stopped by the host.
146
278
 
147
- Diagnose installed remote-module service state with:
279
+ During local development, start declared service providers and then the host
280
+ with:
281
+
282
+ ```sh
283
+ lenso service dev
284
+ lenso service dev --skip-db --skip-migrate
285
+ lenso service dev --workspace-file lenso.workspace.json
286
+ ```
287
+
288
+ After the service processes are running, check the workspace from another shell:
289
+
290
+ ```sh
291
+ lenso service workspace check
292
+ lenso service workspace check support-suite-provider --json
293
+ lenso service verify
294
+ lenso service verify support-suite-provider --json
295
+ lenso service verify ./lenso.service.json --env-file .env --json
296
+ ```
297
+
298
+ Use `lenso service dev --no-workspace` when only installed
299
+ `.lenso/module-services.json` providers should start.
300
+
301
+ `lenso service workspace check` verifies that each declared service directory
302
+ exists, its manifest is reachable, and its `readyUrl` is responding before the
303
+ host tries to load the provider.
304
+
305
+ `lenso service verify` is the release-readiness entrypoint. With no argument it
306
+ checks `./lenso.service.json`; with a provider name it reuses the installed
307
+ service doctor checks. Pass `--env-file` to include required/missing service env
308
+ in the verification report.
309
+
310
+ Preview service upgrade impact before writing host-local state:
311
+
312
+ ```sh
313
+ lenso service upgrade-plan billing ./lenso.service.json --json
314
+ lenso service upgrade billing ./lenso.service.json --dry-run
315
+ ```
316
+
317
+ Export workspace services into the host service-start state format when a script
318
+ or deployment handoff should consume the same service declarations:
319
+
320
+ ```sh
321
+ lenso service workspace export --output .lenso/module-services.json
322
+ ```
323
+
324
+ Diagnose installed service state with:
325
+
326
+ ```sh
327
+ lenso service doctor
328
+ lenso service doctor billing
329
+ lenso service doctor billing --json
330
+ lenso service check billing --json
331
+ ```
332
+
333
+ The doctor reads `REMOTE_MODULES`, `.lenso/module-installs.json`, and
334
+ `.lenso/module-services.json`. It reports whether the service is
335
+ installed, configured, whether an HTTP manifest is reachable, whether managed
336
+ service `readyUrl` endpoints are ready, and which stale `.lock`/`.pid` files
337
+ may be blocking a host-started service.
338
+
339
+ Export declared service processes as a Compose fragment when handing the
340
+ service to deployment tooling:
148
341
 
149
342
  ```sh
150
- lenso module doctor
151
- lenso module doctor billing
343
+ lenso service export --module billing --format compose
152
344
  ```
153
345
 
154
- The doctor reads `REMOTE_MODULES` and `.lenso/module-services.json`, checks
155
- service `readyUrl` endpoints, and points to stale `.lock`/`.pid` files when a
156
- host-started service did not become ready.
346
+ If a manifest declares incompatible `compatibility` metadata, install stops
347
+ before writing host-local state. Use `--allow-incompatible` only when an
348
+ operator deliberately accepts that override.
157
349
 
158
- Remove the local remote-module source, install receipt, service state, Runtime
350
+ Remove the local service source, install receipt, service state, Runtime
159
351
  Console extension registry entry, and copied bundle files with:
160
352
 
161
353
  ```sh
162
- lenso module uninstall billing
354
+ lenso service uninstall billing-service
163
355
  ```
164
356
 
165
357
  Use `--source linked` only when you need to force the loading source. Prefer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenso/cli",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
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