@lenso/cli 0.1.26 → 0.1.28

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,45 @@ 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. If the primary official catalog endpoint is
201
+ temporarily blocked by edge security, the CLI falls back to the official
202
+ workers.dev mirror at `https://lenso-catalog.lenso.workers.dev/v1/modules.json`.
203
+ For V5 service-backed modules, `module install <name>` is the business-capability
204
+ entrypoint: the catalog resolves the provider service, installs it when needed,
205
+ then enables the requested module.
206
+ For module releases, `module install <module-release.json>` resolves the
207
+ release by source, then records `moduleRelease` provenance in
208
+ `.lenso/module-installs.json` where the source supports a receipt.
209
+
210
+ Install a service directly when you have a workspace service name or manifest
211
+ reference:
212
+
213
+ ```sh
214
+ lenso service install support-suite-provider
215
+ lenso service install https://example.com/lenso/service/v1/manifest
216
+ lenso service install ./lenso.service.json --repo-root ../my-lenso-host
217
+ ```
218
+
219
+ When the first argument matches a service in `lenso.workspace.json` or
220
+ `.lenso/services.json`, the CLI resolves its manifest and infers `--base-url`
221
+ from the service `readyUrl`. Local source manifests registered in the workspace
222
+ also infer `--base-url`; package artifacts outside that workspace still need
223
+ `--base-url` so the host records the runtime service endpoint rather than the
224
+ file path.
225
+
226
+ Service installs update `REMOTE_MODULES`, copy declared Runtime Console bundles to
98
227
  `.lenso/console/extensions`, update `.lenso/console/extensions/registry.json`,
99
228
  and record `.lenso/module-installs.json` in one step. Linked modules update the
100
229
  host `Cargo.toml`, `src/lib.rs`, `.env` toggle, and the same install receipt
101
230
  from the descriptor's `linked` section. `module add` remains a compatibility
102
- alias for remote installs.
231
+ alias for service installs.
232
+
233
+ Legacy `lenso module install <manifest-url>` still works for one compatibility
234
+ window, but prints a deprecation warning. Use `lenso service install <manifest>`
235
+ for process manifests and `lenso module install <module-name>` for business
236
+ modules.
103
237
 
104
238
  Install descriptor profiles let a module expose optional setup without baking
105
239
  module-specific choices into the CLI. For Redis-backed auth sessions:
@@ -130,36 +264,97 @@ builtin module entry.
130
264
  Use `--no-console-extension` when you want to skip Runtime Console extension
131
265
  registration.
132
266
 
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:
267
+ Service module manifests may also declare `install.env` values and
268
+ `install.commands`. Env values are written to `.env`; commands are run only when
269
+ you pass:
135
270
 
136
271
  ```sh
137
- lenso module install https://example.com/lenso/module/v1/manifest --run-install-commands
272
+ lenso service install https://example.com/lenso/service/v1/manifest --run-install-commands
138
273
  ```
139
274
 
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
275
+ For long-running service backends, declare `install.services`. These are
276
+ stored in `.lenso/module-services.json` and started before the host loads
277
+ service-provided modules on API/worker startup. Services started by the host are tracked with
143
278
  `.lock`/`.pid` files and stopped when the owning API/worker process exits;
144
279
  services that are already ready before startup are treated as external and are
145
280
  not stopped by the host.
146
281
 
147
- Diagnose installed remote-module service state with:
282
+ During local development, start declared service providers and then the host
283
+ with:
284
+
285
+ ```sh
286
+ lenso service dev
287
+ lenso service dev --skip-db --skip-migrate
288
+ lenso service dev --workspace-file lenso.workspace.json
289
+ ```
290
+
291
+ After the service processes are running, check the workspace from another shell:
292
+
293
+ ```sh
294
+ lenso service workspace check
295
+ lenso service workspace check support-suite-provider --json
296
+ lenso service verify
297
+ lenso service verify support-suite-provider --json
298
+ lenso service verify ./lenso.service.json --env-file .env --json
299
+ ```
300
+
301
+ Use `lenso service dev --no-workspace` when only installed
302
+ `.lenso/module-services.json` providers should start.
303
+
304
+ `lenso service workspace check` verifies that each declared service directory
305
+ exists, its manifest is reachable, and its `readyUrl` is responding before the
306
+ host tries to load the provider.
307
+
308
+ `lenso service verify` is the release-readiness entrypoint. With no argument it
309
+ checks `./lenso.service.json`; with a provider name it reuses the installed
310
+ service doctor checks. Pass `--env-file` to include required/missing service env
311
+ in the verification report.
312
+
313
+ Preview service upgrade impact before writing host-local state:
314
+
315
+ ```sh
316
+ lenso service upgrade-plan billing ./lenso.service.json --json
317
+ lenso service upgrade billing ./lenso.service.json --dry-run
318
+ ```
319
+
320
+ Export workspace services into the host service-start state format when a script
321
+ or deployment handoff should consume the same service declarations:
322
+
323
+ ```sh
324
+ lenso service workspace export --output .lenso/module-services.json
325
+ ```
326
+
327
+ Diagnose installed service state with:
328
+
329
+ ```sh
330
+ lenso service doctor
331
+ lenso service doctor billing
332
+ lenso service doctor billing --json
333
+ lenso service check billing --json
334
+ ```
335
+
336
+ The doctor reads `REMOTE_MODULES`, `.lenso/module-installs.json`, and
337
+ `.lenso/module-services.json`. It reports whether the service is
338
+ installed, configured, whether an HTTP manifest is reachable, whether managed
339
+ service `readyUrl` endpoints are ready, and which stale `.lock`/`.pid` files
340
+ may be blocking a host-started service.
341
+
342
+ Export declared service processes as a Compose fragment when handing the
343
+ service to deployment tooling:
148
344
 
149
345
  ```sh
150
- lenso module doctor
151
- lenso module doctor billing
346
+ lenso service export --module billing --format compose
152
347
  ```
153
348
 
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.
349
+ If a manifest declares incompatible `compatibility` metadata, install stops
350
+ before writing host-local state. Use `--allow-incompatible` only when an
351
+ operator deliberately accepts that override.
157
352
 
158
- Remove the local remote-module source, install receipt, service state, Runtime
353
+ Remove the local service source, install receipt, service state, Runtime
159
354
  Console extension registry entry, and copied bundle files with:
160
355
 
161
356
  ```sh
162
- lenso module uninstall billing
357
+ lenso service uninstall billing-service
163
358
  ```
164
359
 
165
360
  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.28",
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