Runnable examples for Lenso module authors.
This repository uses published packages for released contracts where available:
lenso@lenso/remote-module-kitfor the gRPC legacy transport example
The V8 proofs currently have two temporary sibling-repository dependencies until the matching contracts are published:
- TypeScript service examples resolve
@lenso/service-kitand the V8@lenso/remote-module-kitbuild from../lenso-runtime-console. examples/rust-servicepoints at the sibling../lensocrate.
For local V8 verification, clone the matching V8 branches next to each other:
git clone --branch chore/open-source-hygiene https://github.com/LioRael/lenso-examples.git
git clone --branch chore/open-source-hygiene https://github.com/LioRael/lenso-runtime-console.git
git clone --branch chore/open-source-hygiene https://github.com/LioRael/lenso.git
pnpm --dir lenso-runtime-console install
pnpm --dir lenso-runtime-console --filter @lenso/remote-module-kit build
pnpm --dir lenso-runtime-console --filter @lenso/service-kit build
cd lenso-examples
pnpm installInstall dependencies and run the full example smoke:
pnpm install
pnpm smokeUse the standalone CLI when you want a blank Rust host before installing services:
cargo install lenso-cli
lenso host init ../my-lenso-host
cd ../my-lenso-host
cp .env.example .env
lenso serveThe starter serves GET /v1/app/status, GET/POST /v1/app/items,
/openapi.json, and the admin APIs.
Keep this repository for runnable module examples; the host starter template is
owned by the standalone lenso-cli repository.
examples/rust-manifest is a minimal Rust package using the published
lenso facade. It declares a schema-admin manifest, runs manifest lints, and
prints the manifest JSON:
pnpm rust-manifestexamples/rust-service is a standalone Axum service provider. It exposes the
rust-audit-log module through a service manifest, status endpoint, module
manifest endpoint, and a direct HTTP route:
pnpm start:rust-serviceInstall its manifest into a local Lenso host:
lenso service install http://127.0.0.1:4130/lenso/service/v1/manifestPrint the manifest without starting the server:
pnpm rust-service:checkWith the service running, emit a service package plus module release artifacts from its manifest URL:
pnpm service-package:rust-serviceThen install the package artifact:
lenso service install dist/lenso-service/rust-audit-service/lenso.service-package.json \
--base-url http://127.0.0.1:4130/lenso/service/v1The example README includes the matching lenso service check, install, diff,
upgrade preview, rollback preview, and deployment export commands.
The Rust and TypeScript examples intentionally expose the same service contract
shape: a service process provides one or more independently installed modules,
while the Host owns auth, runtime queues, retries, outbox, and observability.
V12 adds lenso.workspace.json at the repo root so the examples can also be
treated as one local service workspace:
lenso service workspace list --workspace-file lenso.workspace.json
lenso service dev --workspace-file ../lenso-examples/lenso.workspace.jsonUse the second command from a generated host repo when you want the host and
example services to start together. After the services are running,
workspace check verifies each example service directory, manifest, and status
endpoint:
lenso service workspace check --workspace-file lenso.workspace.jsonFrom a generated host repo, install a workspace provider by name:
lenso service install support-suite-provider --workspace-file ../lenso-examples/lenso.workspace.jsonOr export the whole example workspace into the host service-start state shape:
lenso service workspace export \
--workspace-file ../lenso-examples/lenso.workspace.json \
--output .lenso/module-services.jsonV11 examples keep lenso.module.v1 module contracts next to
lenso.module-release.v1 release artifacts so module install remains the
business-capability entrypoint and service install remains the provider/process
entrypoint.
The V8 proof path uses service operation metadata and checks across both TS
services and the Rust Axum provider, including safe HTTP probes and runtime
function declarations.
examples/hello-action is a starter service provider. It exposes:
- a service manifest at
/lenso/service/v1/manifest; - service status at
/lenso/service/v1/status; - the
hello-actionmodule below/lenso/service/v1/modules/hello-action; - two HTTP routes,
GET /hello/{name}andPOST /greetings; - two runtime functions,
hello-action.say-hello.v1andhello-action.record-greeting.v1; - one declarative admin surface with a
seed_greetingaction and a fallbackgreetingsschema-admin entity.
Start the module from the repository root:
pnpm start:hello-actionOr work inside the example package directly:
cd examples/hello-action
pnpm dev
pnpm smokeChange the module by editing:
src/module.tsfor the manifest, handlers, and seed data;src/server.tsfor local startup behavior;src/smoke.tsfor executable expectations as the module grows;catalog-entry.jsonfor optional discovery metadata.
The server prints a manifest URL like:
http://127.0.0.1:4100/lenso/service/v1/manifest
Use that URL with a local Lenso host checkout:
lenso service install http://127.0.0.1:4100/lenso/service/v1/manifestThe example does not ship a Runtime Console package, so there is no frontend package install step for this module.
The server reads PORT from the shell environment. The optional discovery
record lives at examples/hello-action/catalog-entry.json and matches the
default PORT=4100 documented in examples/hello-action/.env.example.
To verify the host-side install path without mutating a real Lenso checkout, run the integration smoke from this repository root:
pnpm host-smokeIt starts the service examples, creates temporary host repos, runs the real
lenso module catalog add and lenso service install commands, and checks the
generated .lenso/module-catalog.json, .env, and install receipts.
To run the example through a real host API and call its remote HTTP route via
/modules/hello-action/http/greetings, follow
docs/hello-action-host-run.md.
examples/account-profile keeps product profile data outside the first-party
auth anchor. The service provider is account-profile-service; it provides the
account-profile module with an auth dependency, profile records,
organizations, memberships, HTTP routes, an admin action, and schema-admin
pages.
Start it from the repository root:
pnpm start:account-profileSmoke the module directly:
pnpm smoke:account-profileInstall its manifest into a local Lenso host:
lenso service install http://127.0.0.1:4120/lenso/service/v1/manifestexamples/grpc-notes is the native gRPC compatibility example for the older
remote-module transport. It exposes a module manifest over gRPC, schema-admin
notes, GET /notes through the host proxy, and grpc-notes.summarize.v1
through the runtime function lane. The V5 HTTP service manifest path is shown
by the HTTP examples above.
Start it from the repository root:
pnpm start:grpc-notesVerify the gRPC protocol path:
pnpm smoke:grpc-notesInstall it into a local host with the checked-in manifest and a gRPC base URL:
lenso module catalog add ../lenso-examples/examples/grpc-notes/lenso.module.json --base-url grpc://127.0.0.1:50051 --summary "Native gRPC notes module"
lenso module add ../lenso-examples/examples/grpc-notes/lenso.module.json --base-url grpc://127.0.0.1:50051
lenso console package apply-planexamples/support-ticket is the agent-ready service demo. It turns a concrete
business prompt into an independently running service that provides the
support-ticket module with tickets data, HTTP routes, an admin action, a
runtime escalation function, and Console-visible metadata:
Build a support ticket module for a Lenso app.
Run it from the repository root:
pnpm start:support-ticketSmoke the module directly:
pnpm smoke:support-ticketWith the service running, emit a V9 service package artifact from its manifest URL:
pnpm service-package:support-ticketThen install the package artifact:
lenso service install dist/lenso-service/support-suite-provider/lenso.service-package.json \
--base-url http://127.0.0.1:4110/lenso/service/v1Install the business module through the generated V10 module release artifact:
lenso module release inspect dist/lenso-service/support-suite-provider/modules/support-ticket/lenso.module-release.json
lenso module release check dist/lenso-service/support-suite-provider/modules/support-ticket/lenso.module-release.json \
--base-url http://127.0.0.1:4110/lenso/service/v1
lenso module install dist/lenso-service/support-suite-provider/modules/support-ticket/lenso.module-release.json \
--base-url http://127.0.0.1:4110/lenso/service/v1Or add that release to the local catalog and install by module name:
lenso module catalog add dist/lenso-service/support-suite-provider/modules/support-ticket/lenso.module-release.json \
--base-url http://127.0.0.1:4110/lenso/service/v1
lenso module install support-ticketRun the full service host path:
pnpm host-api-smoke:support-ticketThat starts the service, installs it into a temporary host, exercises the host-owned HTTP proxy and runtime path for its module, and verifies Runtime Story evidence. For the manual walkthrough, see docs/support-ticket-service-module-run.md.
- Backend framework: https://github.com/LioRael/lenso
- Runtime Console and service kit: https://github.com/LioRael/lenso-runtime-console