Composable agent infrastructure

Weave coding agents into your application.

Loom.js is a provider-neutral TypeScript library for composing models, tools, workspaces, storage, and execution runtimes—without surrendering control of your application boundary.

Private preview · ESM · TypeScript · Browser and trusted-host primitives

provider leaf Model transport
your authority Project workspace
@mgravey/loom-coding Coding session
isolated adapter Execution runtime

One repository. Two very different things.

The reusable library is the product. The workbench is one deliberately opinionated composition that proves the pieces can cooperate inside a browser.

The library

Infrastructure you assemble

Small packages expose stable contracts for orchestration, models, tools, capabilities, workspaces, credentials, storage, and execution.

  • Replace providers without changing Core
  • Inject exactly the filesystem authority you intend
  • Register application-specific capabilities as plugins
  • Keep browser, extension, and server concerns at the edges
Understand the architecture
The example

A browser coding workbench

A visible reference application combining a coding session, project tools, multiple workspace modes, in-browser JavaScript/Python, and an experimental extension-owned ChatGPT transport.

  • Direct directory, memory, or persistent OPFS projects
  • Folder and ZIP import, editing, diff application, ZIP export
  • QuickJS, WebContainer, and Pyodide adapters
  • Credentials remain outside the page and execution runtimes
Open the example

Start with coding. Compose far beyond it.

Loom’s core knows capabilities and lifecycle—not vendors or interfaces. Use the same foundation for a local coding tool, an embedded product assistant, a review agent, or a controlled automation surface.

Orchestrate

Stateful coding sessions

Stream events, preserve a transcript, accept follow-ups, cancel work, and dispatch runtimes.

Adapt

Bring your own model

Inject a model or secure transport. Provider wire formats remain outside the core contracts.

Authorize

Scope the workspace

Use memory, OPFS, File System Access, or implement the same project interface for another host.

Extend

Register capabilities

Package tools, models, storage, runtimes, memory, platform services, and UI behind typed keys.

Execute

Choose the runtime

Run JavaScript or Python in browser adapters, or inject a trusted-host execution implementation.

Observe

Own every boundary

Events are explicit, configuration is immutable, and ambient credentials are never assumed.

A deliberate path from zero to extension.

Begin with an in-memory project and an injected model. Once the first session works, move each boundary to the adapter that matches your product.

Run the repository

Install, build, and run the deterministic test suite before introducing credentials or live services.

Setup instructions

Create a session

Combine a model, a memory workspace, validated tools, and optional execution runtimes.

First session

Add your capability

Define a typed tool, register it during plugin initialization, then resolve it through its canonical key.

Register a tool

Credentials are not application data.

Loom treats identity and provider networking as trust-boundary concerns. The browser workbench demonstrates one extension-backed solution; your library composition can use a trusted backend instead.

Application side

Prompts, selected project context, provider response events, runtime snapshots, and explicit user actions. Model request content goes only to the disclosed provider when you request a model turn.

No refresh credentials
cross this line

Trusted transport side

Authentication, credential rotation, account routing, provider headers, and cross-origin requests.

Build the smallest useful composition

Start with the mental model.

The onboarding guide explains every public boundary before it asks you to extend one.