libraryPackage manifestv5.1.4

lib.communication-runtime

Backend-neutral CommunicationOS runtime, governance, lifecycle, state, ingestion, records, and replay helpers.

@lssm-tech/lib.communication-runtime
Source, release and verification context

Source snapshot bcc79fcc · Declared package version 5.1.4. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.

Package source ↗ Manifest ↗
servernode
EXPLORE THE PACKAGE

See where this package fits.

Follow a declared connection, inspect an import, then open the source guide when you need the detail.

THIS PACKAGElib.communication-runtimedomains

Arrows point from a package to its direct dependency. Each count is derived from the captured manifests.

7 declarations · first 6 shownSELECT TO INSPECT

@lssm-tech/lib.communication-runtime

CommunicationOS capability migration

The v3 capability namespace migration keeps the append-only journal immutable. reconcileLegacyCommunicationCapabilities appends canonical membership and authority-grant events for the latest aggregates with an idempotent migration key. Read projections canonicalize legacy evidence immediately, so a valid persisted comms.room.write grant does not lose send authority while the reconciliation sweep completes.

Backend-neutral CommunicationOS runtime for lifecycle validation, governance decisions, in-memory state, ingestion normalization, records, and replay-oriented helpers.

Typed provider ingestion can retain validated non-message events as immutable communication.provider.<eventKind> journal entries without fabricating message events. Discord identity helpers correlate the same stable provider ID across guilds while preserving guild-local roles; different-account merges require explicit reviewed evidence.

The v2 ecosystem runtime adds a scope-isolated append-only journal, deterministic projections, personal/organization encryption policy evaluation, and immediate send-authority checks for human, agent, and system principals. The default remains legacy_draft_only; hosts explicitly choose membership_grants only after they can provide current room membership and auditable, revocable grants.

createCommunicationMessagingRuntime exposes typed listSpaces and listRooms projections rebuilt from the selected space journal. Historical room events that predate roomKind remain readable as group rooms; the projection never scans a sibling space or creates a parallel mutable catalog.

createCommunicationGovernedWorkRuntime adapts the existing CommunicationOS identity, draft, action, handoff, escalation, agent, consent, retention, and policy operations to the same append-only journal. Creates and decisions are idempotent, projected only inside the selected scope, and permit exactly one terminal transition from pending.

createCommunicationOAuthCoordinator provides the adapter-free provider onboarding control plane. It binds encrypted opaque state and PKCE to the exact principal, scope, network, optional provider key, placement, and safe return path; consumes replay state before exchange; and accepts only credential references from provider ports. Multiple providers may share one network; provider-less email onboarding deterministically retains the first registered provider while an explicit key is pinned through callback completion.

Authenticated provider invalidations use the same journal idempotency domain as cursor sync. They append communication.connection.sync.invalidated without fabricating a message, and duplicate callbacks reuse the durable evidence.

The runtime also exposes persistAgentCommunicationCommand, a provider-free domain-command persistence helper. It turns named CommunicationOS commands (for example communication.reply.send) into immutable in-memory runtime events with read_persisted, draft_persisted, or approval_packet_persisted status. The helper records the command plan and approval violations only; it does not send messages, call providers, open database connections, or mutate external systems.

createCommunicationCommandInboxItem projects message-originated commands into a command inbox item with canExecute: false, AIP control refs, persisted event evidence, and optional CompanyOS bridge review state. Production-send and high-impact CompanyOS bypass signals fail closed as blocked; approval-gated commands remain evidence packets until an external human/policy path acts.

Unified delivery preparation

prepareCommunicationDeliveryV1 resolves the sealed preference hierarchy, creates an exact no-authority delivery intent, evaluates every candidate route, and selects the first eligible route. Missing eligibility evidence fails closed. External routes always require consent. WhatsApp service windows/templates, Telegram first contact, workspace membership, suppression/opt-out, push-device, and calendar-permission constraints are explicit inputs. The fallback path stops after an ambiguous attempt until exact reconciliation proves failure.

reconciliation_pending is a non-claimable outbox state. Moving a leased record into it requires the exact lease plus the Runtime Node work-order digest and evidence refs; replay with substituted custody data fails closed. resolveCommunicationOutboxReconciliation can later resolve that custody only from a digest-bound provider observation for the same work order. Accepted evidence records the provider delivery ID; definitive-failure evidence records the error without creating a delivery receipt. Neither path redispatches.

./delivery-routing.fixture is a deterministic, provider-free integration fixture. The runtime contains no provider SDK, database adapter, secret, or send authority.

Public Entry Points

  • . resolves through ./src/index.ts
  • ./governance resolves through ./src/governance/index.ts
  • ./ingestion resolves through ./src/ingestion/index.ts
  • ./lifecycle resolves through ./src/lifecycle/index.ts
  • ./records resolves through ./src/records/index.ts
  • ./replay resolves through ./src/replay/index.ts
  • ./state resolves through ./src/state/index.ts
  • ./runtime includes domain-command planning and persistence helpers
  • ./command-inbox exposes the fail-closed command inbox projection helper
  • ./delivery-routing exposes deterministic preference, eligibility, intent, and fallback preparation; ./delivery-routing.fixture exposes its sealed test fixture
  • the root export includes createInMemoryCommunicationJournal, projectCommunicationJournal, evaluateCommunicationContentPolicy, and evaluateMessagingSendAuthority
  • ./ecosystem-oauth exposes the provider-neutral OAuth coordinator, state codec/replay ports, provider port, and deterministic test store
  • ./ecosystem-governed-work exposes persisted work projections and lifecycle commands without importing example or application packages
  • ./ecosystem-conversation-references records authenticated provider conversation addresses in the scoped journal and resolves only active, non-revoked references for later delivery admission
  • ./ecosystem-messaging-service resolves opaque, scope-bound attachment IDs before appending public-safe file metadata to the immutable message event
  • ./support-internal-notes validates private Support note commands, protects content before persistence, and returns body-free evidence projections
  • ./agent-lifecycle-projection validates immutable, digest-bound progress and help projections before an injected canonical-conversation sink is called; the projection grants no effect authority
  • ./canonical-agent-conversation validates and resolves exact scoped conversation/session bindings
  • ./ingress-admission persists the authenticated receipt before context compilation, applies deterministic admission, and resumes an already durable decision through an idempotent normalized-ingress reference
  • ./agent-surface-control claims a conversation/run-bound control once and delegates execution to an injected authority; duplicate or indeterminate claims reconcile rather than calling authority again
  • ./ecosystem-subscription-coordinator journals a provider subscription request before one injected effect authority call, reuses active state until the renewal lead, honours the retry window, and settles completed, rejected or indeterminate outcomes; it never performs the provider effect itself
  • ./ecosystem-connection-sync journals adapter health changes, gates on the sync capability, reads one provider page from the stored cursor, ingests it through bound rooms, and advances the cursor last. The adapter, resolver and failure mapping are injected ports, so hosts keep credential-backed adapters and their transport error type
  • ./ecosystem-delivery-dispatcher is the outbound delivery gate behind the outbox (createCommunicationDeliveryDispatcher, CommunicationDeliveryError and the context/adapter resolver ports). It requires a valid payload identity, a matching resolved context, host target verification (verifyTarget), adapter placement and send support, a healthy connection, and an unchanged context after the health check; provider ambiguity becomes a reconciliation-required error. It implements the delivery port that integration.communication-os-runtime CommunicationOsOutboxAgentHostProviderV1 consumes; adapters are structural
  • ./discord-community-installations owns the Discord guild installation lifecycle for community intelligence (createCommunicationCommunityIntelligenceRuntime): verifier-evidence-bound authorization, policy update and revocation with tenant/workspace-scoped identifiers and an order-independent request digest (WebCrypto SHA-256, base64url), plus public projections that never expose credential references. Persistence and the Discord verifier are injected ports typed on lib.communication-spec discord-community models

Boundary

Source checks and artifact declarations

typecheck uses tsconfig.json and checks all source tests without emitting declarations. Its TypeScript incremental state stays in .cache/ so a package artifact rebuild does not discard source-check progress. Unit tests remain a separate required acceptance check.

Artifact builds use tsconfig.build.json to emit production declarations. Test, spec, story and test-support files are excluded as compiler roots; files referenced by production signatures remain reachable and are still checked and emitted. The public delivery-routing.fixture entry is retained. This scope separates artifact generation from test verification: a successful package build does not replace the full source typecheck and unit tests.

This package depends on @lssm-tech/lib.communication-spec and lower-level libs only. It must not import @lssm-tech/example.communication-os, examples/*, or module packages.

Matrix runtime channel

The runtime recognizes matrix as a backend-neutral channel type with default send capability and human-review expectations for sensitive replies. Matrix SDK behavior belongs in integration provider packages, not in this runtime package.

Authorized send retries

Message retries recheck current membership and connection authority before returning accepted content. Reuse of a request key with a different principal, room, content, subject, reply target, metadata, encryption envelope or attachment list is denied. Object metadata key order does not change semantic identity. Missing or partial attachment resolution fails before acceptance.

The journal/outbox transaction validates a replayed message before enqueueing delivery, and insert-returned journal events preserve their tenant scope. Queued acceptance remains distinct from provider delivery. Source-bound OPA follow-up delivery, full concurrent authority fencing and production qualification remain open.

Provider queue acceptance

An external connection send requires appendForDelivery; journal-only persistence cannot claim provider queue acceptance. The event/outbox transaction validates the accepted message identity, connection and exact persisted delivery scope, command, policy and payload. Conflicting outbox keys roll back instead of silently dropping delivery. Provider delivery keys use delivery:<send idempotency key>; retries cannot substitute another key. Atomic journal replay uses the accepted message ID rather than the discarded candidate ID.

Internal room journal acceptance remains available without a provider adapter. Queued does not imply sent or delivered. Legacy malformed delivery inputs fail closed and require explicit repair; broader cross-scope key migration and OPA follow-up delivery remain separate qualification work.

Declared capabilities.

Lib Communication Runtime

Backend-neutral CommunicationOS runtime, governance, lifecycle, state, ingestion, records, and replay helpers.

Use it to

  • Adopt backend-neutral communicationos runtime, governance, lifecycle, state, ingestion, records, and replay helpers

Requires

  • TypeScript

Choose another boundary when

  • The @lssm-tech/lib.communication-runtime package constraints do not match the target runtime or platform.

@lssm-tech/lib.communication-runtime

@lssm-tech/lib.communication-runtime/command-inbox

@lssm-tech/lib.communication-runtime/ecosystem-authority

@lssm-tech/lib.communication-runtime/ecosystem-bindings

@lssm-tech/lib.communication-runtime/ecosystem-bootstrap

@lssm-tech/lib.communication-runtime/ecosystem-capability-migration

@lssm-tech/lib.communication-runtime/ecosystem-connections

@lssm-tech/lib.communication-runtime/ecosystem-encryption

@lssm-tech/lib.communication-runtime/ecosystem-governed-work

@lssm-tech/lib.communication-runtime/ecosystem-identities

@lssm-tech/lib.communication-runtime/ecosystem-journal

@lssm-tech/lib.communication-runtime/ecosystem-messaging-projections

@lssm-tech/lib.communication-runtime/ecosystem-messaging-service

Imports and export paths.

69 entries

These are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.

69 imports · showing 35

Dependencies and related packages.

Runtime dependencies 7
Development dependencies 4
typescript
catalog:

Package scripts.

Commands declared by this package. Review its setup requirements before running them; no command here was executed by this review.

publish:pkgbun publish --tolerate-republish --ignore-scripts --verbose
publish:pkg:canarybun publish:pkg --tag canary
buildcontractspec-bun-build build
build:bundlecontractspec-bun-build transpile
build:typescontractspec-bun-build types
devcontractspec-bun-build dev
cleanrimraf dist .turbo
lintbun lint:fix
lint:fixnode ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .
lint:checknode ../../../../scripts/biome.cjs check .
testbun test
prebuildcontractspec-bun-build prebuild
typechecktsgo --noEmit --tsBuildInfoFile .cache/typecheck.tsbuildinfo
Your view

Make room for your context.

Shape the presentation around this moment. You can change it whenever you need.

Your context

The different parts of you

Choose a starting point

A useful mix of context, visuals and gentle guidance.

Tune each dimension
Each dimension can change independently. Product permissions and available actions stay unchanged.

Support the way you begin and return

Tune your support

Reading comfort

Choose your language

Interface language changes text only. Markets, prices and workflows keep their own settings.

Translation coverage

Original source

Navigation151
Graph616
Categories378
Portfolio833
Examples2,035
Source preview1,542

More translations will be added as content is reviewed.

This preference is saved on this browser.

Search the website

Useful starting points

No results. Try a shorter phrase, an operation name or another search area.

A LITTLE ROOM TO EXPLORE

Find something to explore.

Open a closer look on this page, try a different perspective, or follow the detail into its own page.

How previews and controls work
01

Look before you leave

Hover a link or focus it with Tab to see a preview. Clicking the original link or pressing Enter always opens its destination.

02

Stay with the context

Move into the preview to explore its sections. Use Alt + ↓ from a focused link to enter it with the keyboard. Escape closes it.

03

Open the possibilities

Disclosure rows, perspective choices and highlighted controls reveal more. Your view changes reading comfort and the context you explore.

A separate button for a closer look

Show small preview buttons beside links where there is room. Tap the eye to inspect, or tap the link to go straight there. This choice stays in this tab.

No browsing history is collected. Reduced motion follows your device and Your view.