{
  "schema": "leumas.docs.page/1",
  "id": "pkg:@leumas/revenue",
  "slug": "packages/revenue",
  "kind": "capabilities",
  "bucket": "package",
  "title": "@leumas/revenue",
  "name": "@leumas/revenue",
  "eyebrow": null,
  "chip": null,
  "summary": "Primitive-first revenue factories, settlement sources, offers, channels, and workflow recipes.",
  "keywords": [
    "revenue",
    "primitive-first",
    "factories",
    "recipes",
    "revenue workflows",
    "revenue api",
    "leumas revenue",
    "how to use revenue"
  ],
  "audience": "both",
  "funnel": {
    "product": null,
    "cta": null
  },
  "body": "# `@leumas/revenue`\n\nPrimitive-first revenue definitions for Leumas. The package describes who settles money, what is\nsold, what is delivered, where an output goes, and how a factory creates repeatable clones. It does\nnot replace `@leumas/workflows`, `@leumas/triggers`, `@leumas/jobs`, connectors, PassNode, or product\nengines; it composes them through small declarative recipes.\n\nPublic surface: primitive definitions, the 32 stream manifests (also available as namespace-style\n`streamModules.youtubeChannels`), clone helpers, recipe compilation, and a registry. External I/O is\ninjected by the caller so Studio, Admin, API, MCP, and tests can use the same definitions.\n\nThe planned per-stream SDK and Workflow-tab contract is documented in\n`INDEX/revenue/workflow-hook-contracts.md`. Stream packages should depend on this package rather than\nreimplementing offers, factories, workflows, connectors, approvals, metering, or audit behavior.\n\n## The binding table\n\n`streams.js` names ~160 business verbs. None of them is an action id, and until `bindings.js` existed\nevery revenue run died on step one with \"Revenue action is not bound\". A verb is a business name;\n`bindings.js` is where it meets a real callable — an `@leumas/invoke` executor descriptor, resolved\nagainst the shared adapter, connector and action registries rather than against ~160 new actions\nnobody could have named without collisions (`publishListing` means four different things in four\nstreams).\n\n**An absent row is an answer.** Arbitrage execution, patent filing and the supplier adapters have no\nrail in this repo, and every stream file in `INDEX/revenue` says so in its own `Gap:` clause. Those\nsteps answer with a receipt naming what they *would* have called. That is why all 32 streams can be\nrun and scheduled today, and why a stream reports its own tier instead of pretending.\n\n**Preview is the default.** A preview run completes, produces a full trace, calls nothing and writes\nno ledger rows. `mode: 'execute'` is a separate decision, and it still stops at every `publish`,\n`money` or `destructive` gate — the gate is a node in the compiled graph, so it survives being saved,\nreopened and reached from anywhere.\n\n`pnpm smoke:revenue` compiles all 32 streams × 4 recipes, resolves every bound reference against the\nreal registries, previews every stream, resumes a gated run from a stored state, and prints per-stream\ncoverage.\n",
  "source": {
    "path": "shared/packages/revenue/README.md",
    "blobSha": "",
    "commit": "",
    "committedAt": "",
    "provenance": "no-git",
    "bytes": 2588,
    "hash": "067110ca9c6a3968e5e3914150f6f0bfd52271da"
  },
  "urls": {
    "html": "/p/packages/revenue",
    "json": "/docs/packages/revenue.json",
    "md": "/docs/packages/revenue.md"
  },
  "links": {
    "composes": [
      "pkg:@leumas/actions"
    ],
    "usedBy": [],
    "product": [],
    "howTo": [],
    "skills": []
  },
  "exports": {
    "total": 35,
    "component": 7,
    "hook": 0,
    "helper": 28,
    "names": [
      {
        "n": "BINDINGS",
        "k": "component"
      },
      {
        "n": "GATED_RISKS",
        "k": "component"
      },
      {
        "n": "LEDGER_ACTIONS",
        "k": "component"
      },
      {
        "n": "REVENUE_CLONES",
        "k": "component"
      },
      {
        "n": "REVENUE_EVENTS",
        "k": "component"
      },
      {
        "n": "REVENUE_FACTORIES",
        "k": "component"
      },
      {
        "n": "RISK_LEVELS",
        "k": "component"
      },
      {
        "n": "bindingFor",
        "k": "helper"
      },
      {
        "n": "bindingReport",
        "k": "helper"
      },
      {
        "n": "cloneFactory",
        "k": "helper"
      },
      {
        "n": "compileRecipe",
        "k": "helper"
      },
      {
        "n": "compileStreamRecipe",
        "k": "helper"
      },
      {
        "n": "contributionMargin",
        "k": "helper"
      },
      {
        "n": "createRevenueRegistry",
        "k": "helper"
      },
      {
        "n": "createRevenueRouter",
        "k": "helper"
      },
      {
        "n": "defineChannel",
        "k": "helper"
      },
      {
        "n": "defineFactory",
        "k": "helper"
      },
      {
        "n": "defineFulfillment",
        "k": "helper"
      },
      {
        "n": "defineOffer",
        "k": "helper"
      },
      {
        "n": "defineProduct",
        "k": "helper"
      },
      {
        "n": "defineRoute",
        "k": "helper"
      },
      {
        "n": "defineSettlementSource",
        "k": "helper"
      },
      {
        "n": "listRevenueStreams",
        "k": "helper"
      },
      {
        "n": "reconcile",
        "k": "helper"
      },
      {
        "n": "recordCost",
        "k": "helper"
      },
      {
        "n": "recordPayout",
        "k": "helper"
      },
      {
        "n": "recordRevenue",
        "k": "helper"
      },
      {
        "n": "revenueActions",
        "k": "helper"
      },
      {
        "n": "revenueWorkflowCatalog",
        "k": "helper"
      },
      {
        "n": "runCompiledRecipe",
        "k": "helper"
      },
      {
        "n": "streamById",
        "k": "helper"
      },
      {
        "n": "streamIdOf",
        "k": "helper"
      },
      {
        "n": "streamModules",
        "k": "helper"
      },
      {
        "n": "streams",
        "k": "helper"
      },
      {
        "n": "workflowIdFor",
        "k": "helper"
      }
    ]
  }
}
