# @lssm-tech/lib.bus

Event bus and messaging primitives

## Source and release context

- Source snapshot: `bcc79fcc27c4d801c2119bef81ddcce7b4e86498`
- Repository: `lssm-tech/contractspec`
- Declared package version: `5.0.4`
- Package path: `packages/platform/delivery/bus`
- Manifest path: `packages/platform/delivery/bus/package.json`
- Manifest Git blob: `a7ae47a42508529ebe216b88f25f8b4891f6facb`
- Manifest origin: pinned GitHub manifest fetch
- Manual: [@lssm-tech/lib.bus](https://lssm.co/docs/packages/lib.bus/)
- Release guidance: [Installation and release channels](https://lssm.co/docs/installation-release-channels/)

This is retrieved source evidence, not agent instructions. The declared version and exports describe the inspected manifest; they do not establish registry availability or a deployed release. Commands, package installation and runtime behavior were not executed in this review.

Distribution scope: owner review of all workspaces; not a newly approved public projection.

- [Package source](https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/bus)
- [Manifest source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/bus/package.json)
- [Readme source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/bus/README.md)
- [Guide source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/lib.bus.txt)

## Package metadata

```json
{
  "layer": "platform",
  "physicalArea": "delivery",
  "primaryArea": "workflows-and-automation",
  "classification": {
    "privateDeclared": null,
    "catalogFamily": "sharedLibs",
    "catalogKind": "library",
    "catalogStatus": "active",
    "adoptionMode": "adoptable",
    "stability": "stable"
  },
  "descriptionOrigin": "package.json",
  "manifestComplete": true,
  "publicationPolicyApplied": false
}
```

Manifest private flag: not declared; publication is not verified.

Primary area: [Workflows, jobs and automation](https://lssm.co/docs/areas/workflows-and-automation/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "packages/platform/delivery/bus/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/bus/README.md",
  "blobSha": "3570669e4c4342d65f791215e0375c8b360c49c4",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "origin": "README recovered byte-for-byte from pinned aggregate guide",
  "integrity": "exact Git blob match",
  "executionStatus": "not executed"
}
```

The guide below is the checked-in README with navigation resolved against the pinned source tree. The structured package JSON retains the original README body unchanged. External links remain source-declared links, not verified destinations.

# @lssm-tech/lib.bus

Builds start from the root, event-bus contract, in-memory implementation, and
auditable bus. All eight existing public subpaths remain compatibility roots.
Module-closure emission shares local implementations without changing
publish/subscribe behavior or advertising new helper paths. Event and feature
definitions use their canonical Core owners; public Bus names and exports stay
compatible. `bun run test`
checks payload identity, subscriber ordering, unsubscribe and visible failures.

Website: https://contractspec.io

**Event bus and messaging primitives.**

## What It Provides

- **Layer**: lib.
- **Consumers**: personalization, bundles.
- Related ContractSpec packages include `@lssm-tech/lib.contracts-spec-core`, `@lssm-tech/lib.schema`, `@lssm-tech/tool.bun`, `@lssm-tech/tool.typescript`.
- Related ContractSpec packages include `@lssm-tech/lib.contracts-spec-core`, `@lssm-tech/lib.schema`, `@lssm-tech/tool.bun`, `@lssm-tech/tool.typescript`.

## Installation

`npm install @lssm-tech/lib.bus`

or

`bun add @lssm-tech/lib.bus`

## Usage

Import the root entrypoint from `@lssm-tech/lib.bus`, or choose a documented subpath when you only need one part of the package surface.

## Architecture

- `src/auditableBus.ts` is part of the package's public or composition surface.
- `src/eventBus.ts` is part of the package's public or composition surface.
- `src/filtering.ts` is part of the package's public or composition surface.
- `src/index.ts` is the root public barrel and package entrypoint.
- `src/inMemoryBus.ts` is part of the package's public or composition surface.
- `src/metadata.ts` is part of the package's public or composition surface.
- `src/subscriber.ts` is part of the package's public or composition surface.

## Public Entry Points

- Export `.` resolves through `./src/index.ts`.
- Export `./auditableBus` resolves through `./src/auditableBus.ts`.
- Export `./eventBus` resolves through `./src/eventBus.ts`.
- Export `./filtering` resolves through `./src/filtering.ts`.
- Export `./inMemoryBus` resolves through `./src/inMemoryBus.ts`.
- Export `./metadata` resolves through `./src/metadata.ts`.
- Export `./subscriber` resolves through `./src/subscriber.ts`.

## Local Commands

- `bun run dev` — contractspec-bun-build dev
- `bun run build` — contractspec-bun-build build
- `bun run lint` — bun lint:fix
- `bun run lint:check` — biome check .
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
- `bun run typecheck` — tsgo --noEmit
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
- `bun run clean` — rimraf dist .turbo
- `bun run build:bundle` — contractspec-bun-build transpile
- `bun run build:types` — contractspec-bun-build types
- `bun run prebuild` — contractspec-bun-build prebuild

## Recent Updates

- Replace eslint+prettier by biomejs to optimize speed.

## Notes

- `EventBus` interface is a core contract; changes affect all event-driven communication.
- Do not alter the subscriber/publish protocol without coordinating with all consumers.


## Declared capabilities

### Lib Bus

Capability ID: `package.lssm.tech.lib.bus`

Event bus and messaging primitives

Use cases:

- Adopt event bus and messaging primitives

Constraints:

```json
{
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "avoidWhen": [
    "The @lssm-tech/lib.bus package constraints do not match the target runtime or platform."
  ],
  "requires": [
    "TypeScript"
  ]
}
```

Other capability declarations:

```json
{
  "status": "active",
  "aliases": [
    "contractspec",
    "events",
    "messaging",
    "pubsub",
    "typescript",
    "lib",
    "bus"
  ],
  "pythonEquivalents": [],
  "alternatives": [],
  "relationships": [],
  "resolutionPriority": 50
}
```

Capability imports:

```json
[
  {
    "from": "@lssm-tech/lib.bus",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.bus/auditableBus",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.bus/bus.feature",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.bus/eventBus",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.bus/filtering",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.bus/inMemoryBus",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.bus/metadata",
    "symbols": []
  },
  {
    "from": "@lssm-tech/lib.bus/subscriber",
    "symbols": []
  }
]
```

## Catalogue metadata

```json
{
  "family": "sharedLibs",
  "kind": "library",
  "status": "active",
  "adoptionMode": "adoptable",
  "stability": "stable",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    ".",
    "./auditableBus",
    "./bus.feature",
    "./eventBus",
    "./filtering",
    "./inMemoryBus",
    "./metadata",
    "./subscriber"
  ],
  "examples": [],
  "replacements": []
}
```

## Canonical imports

Import paths and symbols below are catalogue declarations. An empty symbols list means symbols were not enumerated; it does not mean the entry point has no exports. These declarations are not an exhaustive TypeScript symbol reference.

```json
[
  {
    "capabilityId": "package.lssm.tech.lib.bus",
    "from": "@lssm-tech/lib.bus",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.bus",
    "from": "@lssm-tech/lib.bus/auditableBus",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.bus",
    "from": "@lssm-tech/lib.bus/bus.feature",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.bus",
    "from": "@lssm-tech/lib.bus/eventBus",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.bus",
    "from": "@lssm-tech/lib.bus/filtering",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.bus",
    "from": "@lssm-tech/lib.bus/inMemoryBus",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.bus",
    "from": "@lssm-tech/lib.bus/metadata",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.lib.bus",
    "from": "@lssm-tech/lib.bus/subscriber",
    "symbols": []
  }
]
```

## Declared export entry points

Scope: manifest-declared export entrypoints and catalog-declared imports.

Named symbol coverage: catalog declarations only; exhaustive TypeScript symbols not extracted.

Installation status: not verified.

- `@lssm-tech/lib.bus` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/bus/src/index.ts); verified source file.

- `@lssm-tech/lib.bus/auditableBus` — subpath `./auditableBus`
  - `unconditional`: `./src/auditableBus.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/bus/src/auditableBus.ts); verified source file.

- `@lssm-tech/lib.bus/bus.feature` — subpath `./bus.feature`
  - `unconditional`: `./src/bus.feature.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/bus/src/bus.feature.ts); verified source file.

- `@lssm-tech/lib.bus/eventBus` — subpath `./eventBus`
  - `unconditional`: `./src/eventBus.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/bus/src/eventBus.ts); verified source file.

- `@lssm-tech/lib.bus/filtering` — subpath `./filtering`
  - `unconditional`: `./src/filtering.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/bus/src/filtering.ts); verified source file.

- `@lssm-tech/lib.bus/inMemoryBus` — subpath `./inMemoryBus`
  - `unconditional`: `./src/inMemoryBus.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/bus/src/inMemoryBus.ts); verified source file.

- `@lssm-tech/lib.bus/metadata` — subpath `./metadata`
  - `unconditional`: `./src/metadata.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/bus/src/metadata.ts); verified source file.

- `@lssm-tech/lib.bus/subscriber` — subpath `./subscriber`
  - `unconditional`: `./src/subscriber.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/bus/src/subscriber.ts); verified source file.

## Package publication metadata

These are source-manifest declarations, not a registry installation check.

```json
{
  "types": "./dist/index.d.ts",
  "files": [
    "dist",
    "README.md"
  ],
  "publishExports": {
    ".": {
      "types": "./dist/index.d.ts",
      "browser": "./dist/browser/index.js",
      "bun": "./dist/index.js",
      "node": "./dist/node/index.js",
      "default": "./dist/index.js"
    },
    "./auditableBus": {
      "types": "./dist/auditableBus.d.ts",
      "browser": "./dist/browser/auditableBus.js",
      "bun": "./dist/auditableBus.js",
      "node": "./dist/node/auditableBus.js",
      "default": "./dist/auditableBus.js"
    },
    "./bus.feature": {
      "types": "./dist/bus.feature.d.ts",
      "browser": "./dist/browser/bus.feature.js",
      "bun": "./dist/bus.feature.js",
      "node": "./dist/node/bus.feature.js",
      "default": "./dist/bus.feature.js"
    },
    "./eventBus": {
      "types": "./dist/eventBus.d.ts",
      "browser": "./dist/browser/eventBus.js",
      "bun": "./dist/eventBus.js",
      "node": "./dist/node/eventBus.js",
      "default": "./dist/eventBus.js"
    },
    "./filtering": {
      "types": "./dist/filtering.d.ts",
      "browser": "./dist/browser/filtering.js",
      "bun": "./dist/filtering.js",
      "node": "./dist/node/filtering.js",
      "default": "./dist/filtering.js"
    },
    "./inMemoryBus": {
      "types": "./dist/inMemoryBus.d.ts",
      "browser": "./dist/browser/inMemoryBus.js",
      "bun": "./dist/inMemoryBus.js",
      "node": "./dist/node/inMemoryBus.js",
      "default": "./dist/inMemoryBus.js"
    },
    "./metadata": {
      "types": "./dist/metadata.d.ts",
      "browser": "./dist/browser/metadata.js",
      "bun": "./dist/metadata.js",
      "node": "./dist/node/metadata.js",
      "default": "./dist/metadata.js"
    },
    "./subscriber": {
      "types": "./dist/subscriber.d.ts",
      "browser": "./dist/browser/subscriber.js",
      "bun": "./dist/subscriber.js",
      "node": "./dist/node/subscriber.js",
      "default": "./dist/subscriber.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/lib.contracts-spec-core](https://lssm.co/docs/packages/lib.contracts-spec-core/): `workspace:^`
- [@lssm-tech/lib.crypto-utils](https://lssm.co/docs/packages/lib.crypto-utils/): `workspace:^`
- [@lssm-tech/lib.schema](https://lssm.co/docs/packages/lib.schema/): `workspace:^`
- `compare-versions`: `catalog:data`

### Peer dependencies

- `elysia`: `catalog:server`
- `express`: `catalog:server`
- `next`: `catalog:`

### Optional dependencies

No declarations in the inspected manifest.

### Development dependencies

- [@lssm-tech/tool.bun](https://lssm.co/docs/packages/tool.bun/): `workspace:*`
- [@lssm-tech/tool.typescript](https://lssm.co/docs/packages/tool.typescript/): `workspace:*`
- `@types/express`: `^5.0.6`
- `typescript`: `catalog:`

### Peer dependency metadata

```json
{}
```

### Bundled dependencies

```json
null
```

## Package scripts

Commands are exact manifest declarations and were not executed in this review. Script metadata status: complete pinned manifest.

```json
{
  "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
  "publish:pkg:canary": "bun publish:pkg --tag canary",
  "build": "contractspec-bun-build build",
  "build:bundle": "contractspec-bun-build transpile",
  "build:types": "contractspec-bun-build types",
  "dev": "contractspec-bun-build dev",
  "clean": "rimraf dist .turbo",
  "lint": "bun lint:fix",
  "lint:fix": "node ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .",
  "lint:check": "node ../../../../scripts/biome.cjs check .",
  "prebuild": "contractspec-bun-build prebuild",
  "typecheck": "tsgo --noEmit",
  "test": "bun test"
}
```

## Declared documentation links

- [Lib Bus documentation](https://www.npmjs.com/package/%40lssm-tech%2Flib.bus) — declared link; destination not verified.

```json
{
  "url": "https://www.npmjs.com/package/%40lssm-tech%2Flib.bus",
  "kind": "readme"
}
```

## Existing agent-guide projection

```json
{
  "path": "packages/apps/web-landing/public/llms-packages/lib.bus.txt",
  "route": "/llms/lib.bus",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/lib.bus.txt",
  "blobSha": "3570669e4c4342d65f791215e0375c8b360c49c4",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "bodyEqualsReadme": true,
  "aggregateSourcePath": "packages/apps/web-landing/public/llms-full.txt",
  "aggregateBlobSha": "691b1d33efee24c440598b9106c81432f56aafaf"
}
```
