@leumas/revenue
Primitive-first revenue factories, settlement sources, offers, channels, and workflow recipes.
@leumas/revenue
Primitive-first revenue definitions for Leumas. The package describes who settles money, what is sold, what is delivered, where an output goes, and how a factory creates repeatable clones. It does not replace @leumas/workflows, @leumas/triggers, @leumas/jobs, connectors, PassNode, or product engines; it composes them through small declarative recipes.
Public surface: primitive definitions, the 32 stream manifests (also available as namespace-style streamModules.youtubeChannels), clone helpers, recipe compilation, and a registry. External I/O is injected by the caller so Studio, Admin, API, MCP, and tests can use the same definitions.
The planned per-stream SDK and Workflow-tab contract is documented in INDEX/revenue/workflow-hook-contracts.md. Stream packages should depend on this package rather than reimplementing offers, factories, workflows, connectors, approvals, metering, or audit behavior.
The binding table
streams.js names ~160 business verbs. None of them is an action id, and until bindings.js existed every revenue run died on step one with "Revenue action is not bound". A verb is a business name; bindings.js is where it meets a real callable — an @leumas/invoke executor descriptor, resolved against the shared adapter, connector and action registries rather than against ~160 new actions nobody could have named without collisions (publishListing means four different things in four streams).
An absent row is an answer. Arbitrage execution, patent filing and the supplier adapters have no rail in this repo, and every stream file in INDEX/revenue says so in its own Gap: clause. Those steps answer with a receipt naming what they would have called. That is why all 32 streams can be run and scheduled today, and why a stream reports its own tier instead of pretending.
Preview is the default. A preview run completes, produces a full trace, calls nothing and writes no ledger rows. mode: 'execute' is a separate decision, and it still stops at every publish, money or destructive gate — the gate is a node in the compiled graph, so it survives being saved, reopened and reached from anywhere.
pnpm smoke:revenue compiles all 32 streams × 4 recipes, resolves every bound reference against the real registries, previews every stream, resumes a gated run from a stored state, and prints per-stream coverage.
What it exports
35 exports: 7 components, 0 hooks, 28 helpers. Import from @leumas/revenue.
BINDINGSGATED_RISKSLEDGER_ACTIONSREVENUE_CLONESREVENUE_EVENTSREVENUE_FACTORIESRISK_LEVELSbindingForbindingReportcloneFactorycompileRecipecompileStreamRecipecontributionMargincreateRevenueRegistrycreateRevenueRouterdefineChanneldefineFactorydefineFulfillmentdefineOfferdefineProductdefineRoutedefineSettlementSourcelistRevenueStreamsreconcilerecordCostrecordPayoutrecordRevenuerevenueActionsrevenueWorkflowCatalogrunCompiledRecipestreamByIdstreamIdOfstreamModulesstreamsworkflowIdFor