New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@arsenstorm/olos

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arsenstorm/olos

Open Live Object Streaming protocol primitives.

latest
Source
npmnpm
Version
0.6.0
Version published
Maintainers
1
Created
Source

OLOS

Socket OpenSSF Scorecard

Open Live Object Streaming protocol primitives. A generic live object streaming protocol: a low-latency append-only stream log over plain object storage (S3, R2, GCS), with CMAF/LL-HLS as its first profile.

Install

npm install @arsenstorm/olos

Imports

import { OLOS_PROTOCOL_NAME, OLOS_WIRE_VERSION } from "@arsenstorm/olos";
import type { Session } from "@arsenstorm/olos/types";
SubpathUse for
@arsenstorm/olos/runtimeSession routes, publisher loops, HLS serving.
@arsenstorm/olos/s3S3 upload grants, observation, events, recovery, retention. Needs @aws-sdk/client-s3 and @aws-sdk/s3-request-presigner installed by the consumer (optional peer dependencies).
@arsenstorm/olos/mediaCMAF/LL-HLS profile: media session/track/object profiles, validators, schemas, publisher pacing.
@arsenstorm/olos/hlsHLS rendering and blocking-reload helpers.
@arsenstorm/olos/protocolCoordinator stores and adapter conformance.
@arsenstorm/olos/stateLower-level state transitions and policies.
@arsenstorm/olos/schemaJSON Schemas for wire objects.
@arsenstorm/olos/validationRuntime payload validators.
@arsenstorm/olos/typesPublic protocol data types.
@arsenstorm/olos/configProtocol constants and policy defaults.
@arsenstorm/olos/conformanceAssertion metadata and store checks.

Quick start

A complete OLOS endpoint with S3-backed live media (the CMAF/LL-HLS profile):

import {
  createMemorySerializedCoordinatorStoreBackend,
  createSerializedCoordinatorStore,
} from "@arsenstorm/olos/protocol";
import { createStoredS3CoordinatorRuntimeHandler } from "@arsenstorm/olos/s3";
import { S3Client } from "@aws-sdk/client-s3";

const store = createSerializedCoordinatorStore(
  createMemorySerializedCoordinatorStoreBackend()
);

const s3 = new S3Client({ region: "us-east-1" });

const handleOlos = createStoredS3CoordinatorRuntimeHandler({
  allowedDeliveryOrigins: ["https://media.example.com"],
  bucket: "olos-media",
  client: s3,
  expiresInSeconds: 5,
  providerId: "s3_primary",
  store,
});

export default { fetch: (req: Request) => handleOlos(req) };

Publishers create a session, then loop: get a presigned slot, PUT media bytes to S3, post a commit. Viewers GET HLS manifests. The handler covers it.

A session declares the profile it runs under and a profile per track. Core treats profile objects as opaque; @arsenstorm/olos/media defines and validates the CMAF/LL-HLS ones:

import { CMAF_LLHLS_PROFILE_ID } from "@arsenstorm/olos/media";

await fetch("https://olos.example.com/sessions", {
  body: JSON.stringify({
    deliveryBaseUrl: "https://media.example.com",
    session: {
      createdAt: new Date().toISOString(),
      epoch: 1,
      olos: "1.0",
      profile: { id: CMAF_LLHLS_PROFILE_ID, partTarget: 0.5, segmentTarget: 2 },
      sessionId: "session_1",
      state: "live",
      tracks: [
        {
          profile: { bitrate: 5_000_000, codec: "avc1.640028", kind: "video" },
          trackId: "v1080",
        },
      ],
    },
  }),
  headers: { "content-type": "application/json" },
  method: "POST",
});

Slot requests and commits carry the same kind of opaque profile object (for LL-HLS: { duration, independent, programDateTime }).

Working setups:

  • examples/api — Cloudflare Worker + Durable Object + R2.
  • examples/streamer — OBS-to-OLOS bridge using ffmpeg micro-segments.
  • examples/player — LL-HLS player at the PART-HOLD-BACK spec floor.

Routes

The handler mounts:

MethodPathPurpose
POST/sessionsCreate a session.
POST/sessions/:id/s3/slotsIssue a presigned upload slot.
POST/sessions/:id/s3/commitsObserve and commit an upload.
POST/sessions/:id/s3/eventsAccept S3 object-created events.
POST/sessions/:id/s3/reconcile-planList in-flight slots for recovery.
POST/sessions/:id/s3/reconcileRecover slots after missed events.
POST/sessions/:id/s3/retentionPrune retired state and delete retired media.
POST/sessions/:id/upload-slots/:slotId/completePublisher completion hint (alternative to waiting for events).
POST/sessions/:id/transitionAdvance session state.
POST/sessions/:id/heartbeatPublisher liveness ping.
GET/sessions/:id/healthLive / starting / stale summary.
GET/v1/live/:id/master.m3u8Master playlist (variants, audio groups).
GET/v1/live/:id/.../media.m3u8LL-HLS playlist with _HLS_msn blocking reload.

The /sessions and /v1/live prefixes are the defaults. The handler's sessionPath and livePath options configure them. Error responses always carry error.code from the registered OLOS_ERROR_CODES set, next to error.message.

Layers

OLOS is layered. Core defines the commit semantics. Above it are a profile (the CMAF/LL-HLS profile ships in @arsenstorm/olos/media and @arsenstorm/olos/hls), a storage binding (@arsenstorm/olos/s3), a delivery mapping, the direct-public deployment profile, and runtime guidance. Spec Section 2 defines the layers and the split between what OLOS owns and what your app owns.

Further reading

Release check

bun --filter '@arsenstorm/olos' publish:check

FAQs

Package last updated on 22 Aug 2026

Related posts