Ask
Documentation

Every page, by package

Grouped by package and by what you need: a tutorial to learn, a how-to to get something done, reference for facts, explanation to understand. Or just ask on the home page.

Overview

Overview

  • inbrowser

    The inbrowser monorepo: a resumable job engine, an inference relay, an agent runtime, and an on-device model engine.

Agent Context

@inbrowser/agent

Overview

  • @inbrowser/agent

    Agent runtime plus an agent-friendly CLI: AgentSession, AgentStrategy, ToolRegistry, ModelClient, and an `agent` binary.

Tutorial

How-To

Reference

  • Library Reference

    The public library surface of `@inbrowser/agent`, exposed across three import subpaths.

  • CLI Reference

    The `agent` binary, derived from CLI_SPEC, the single source of truth the parser and the schema/describe commands surface verbatim.

  • Event Reference

    The three discriminated-union event streams in `@inbrowser/agent`, each a typed AsyncIterable consumed at a different layer.

Explanation

Agent Context

Skill

@inbrowser/workspace

Overview

  • @inbrowser/workspace

    Browser-native workspace runtime: OPFS/memory files, esbuild preview compilation, jailed browser shell, isomorphic-git, package import maps, and optional agent tool adapters.

Tutorial

How-To

Reference

  • API Reference

    The public surface of @inbrowser/workspace: workspace creation, file systems, preview, shell, git, packages, and agent tools.

Explanation

  • Why This Is Not Browser Node

    Why the workspace runtime chooses compile-and-mount preview, host modules, structured shell/git/package services, and explicit limits over a partial browser Node illusion.

@inbrowser/sandbox

Overview

  • @inbrowser/sandbox

    Sandbox orchestration above @inbrowser/workspace: runtime events, standard agent tools, checkpoints, and a workspace adapter for browser-native app builders.

How-To

Reference

  • API Reference

    The public surface of @inbrowser/sandbox: sandbox contracts, workspace adapter, standard tools, checkpoints, events, and the agent bridge.

Explanation

  • Sandbox Architecture Overview

    How @inbrowser/sandbox absorbs Piebox-shaped orchestration into the inbrowser package suite while keeping runtime substrate, workspace services, and agent loops separate.

  • Remote Container Bridge

    How Apple container, WSL containers, and similar remote Linux runtimes fit into the sandbox boundary while the browser renders results.

  • Why Sandbox Tools And Agent Tools Are Separate

    Why sandbox side effects stay on the sandbox, agent policy stays in @inbrowser/agent, and createSandboxAgentTools adapts between them.

Agent Context

@inbrowser/relay

Overview

  • @inbrowser/relay

    Resumable LLM inference relay: a pure transport that serves ModelClient factories from @inbrowser/model over HTTP, plus a reconnecting browser client.

Tutorial

How-To

Reference

  • API Reference

    createRelay, NormalizedRequest, the re-exported ModelEvent/ModelClient contract types, ModelClientFactory, the handlers, adapters, SSE helpers, and the client.

Explanation

  • How The Relay Works

    The job lifecycle, why providers and adapters are separate, what is stored, and offset-based replay.

@inbrowser/resumable

Overview

  • @inbrowser/resumable

    Resumable streaming-job engine: a pluggable JobStore plus a JobEngine that streams events into a durable, tailable log.

Tutorial

How-To

Reference

  • API Reference

    createJobEngine, the producer surface, subscription events, the JobStore contract, memory + RTDB stores, and sweeps.

Explanation

  • How Resumable Jobs Work

    Engine and store, sequence numbers as the resume contract, terminal state vs events, and TTL retention.

@inbrowser/model

Overview

  • @inbrowser/model

    The model layer: the lightweight ModelClient contract at the root, cloud providers under @inbrowser/model/providers/<name>, and an opt-in on-device LLM engine under @inbrowser/model/local.

Tutorial

How-To

Reference

  • Engine Reference

    The @inbrowser/model/local export: the engine factory, the Engine surface, the event vocabulary, and the stream transformers.

  • Presets Reference

    The @inbrowser/model/local export: the bundled ModelPreset values and the static types they carry.

  • Worker Reference

    The worker helpers in @inbrowser/model/local that host an Engine in a Web Worker and connect to it behind the same Engine surface.

  • Gateway Provider Reference

    OpenRouter and Requesty configuration, attribution headers, reasoning controls, usage telemetry, and shared OpenAI tool encoding.

Explanation

  • Why The Engine Is Shaped This Way

    The load-bearing decisions behind the small Engine surface and the trade-offs each one accepts.

  • On-Device Inference

    The stack that makes running an LLM in a browser tab possible, the constraints it imposes, and why you would choose it over the cloud.

Agent Context