lannr-extras
v0.1.4
Published
Opt-in batteries for the Lannr runtime: memory, scheduling, workspace tools, browser tools, and MCP.
Readme
🧰 lannr-extras
Batteries for the Lannr runtime.
Memory that earns trust, reactive scheduling, workspace tools, a browser, and MCP — all opt-in.
Install · Modules · Tour · Full docs
✨ What is it?
lannr-core is the runtime: the model writes a TypeScript program, the Vault runs it. lannr-extras is everything that makes that runtime feel like a colleague — persistent memory, routines that earn trust, reactive scheduling, real workspace tools, a browser, and MCP — each behind its own subpath export so you only pull in what you use.
It's the same capability set the lannr CLI ships, exposed as composable TypeScript.
📦 Install
pnpm add lannr-extras lannr-core zodlannr-extras builds on lannr-core — install both.
🧩 The module surface
Import only the modules you need:
| Import | What it does |
| :-- | :-- |
| lannr-extras/memory | FileMemoryStore / HttpMemoryStore — routine persistence, trust tracking, diff patching, rollback |
| lannr-extras/scheduler | LannrScheduler, cron / interval / once / event / webhook reactive routines, sinks |
| lannr-extras/workspace-tools | Files, edits, bash, unified diffs, todos, checkpoints |
| lannr-extras/browser | Chrome/CDP browser automation with URL-safety policy |
| lannr-extras/mcp | MCP stdio client, registry, and tool bridge |
| lannr-extras/devtools | ExecutionTimeline + MemoryBrowser |
🎒 A guided tour
import { createLannr } from 'lannr-core'
import { FileMemoryStore } from 'lannr-extras/memory'
const lannr = createLannr({
runner,
model,
tools,
memory: new FileMemoryStore('.lannr/memory'),
})
// Now the agent can $saveRoutine(...) and $patchRoutine(...),
// and proven routines get injected into future runs automatically.Routines graduate draft → provisional → trusted → pinned as they prove themselves across real runs — and rollbackRoutine(store, id, toVersion) reverts a bad version.
import { schedule, once, on, onWebhook, LannrScheduler } from 'lannr-extras/scheduler'
const daily = schedule('npm-report', { cron: '0 9 * * *', routine: 'weeklyReport', input: {} })
const reminder = once('release', { runAt: '2026-06-10T09:00:00Z', routine: 'changelog', input: {} })
const onDeploy = on('notify', { event: 'deploy.succeeded', routine: 'notify', inputMapper: '(e) => ({ sha: e.sha })' })
const onPush = onWebhook('build', { routine: 'build', inputMapper: '(e) => ({ ref: e.ref })', secret: process.env.WEBHOOK_SECRET })Cron, intervals, one-shots, local events, and webhooks fire saved routines without ever calling the model. Results flow to a sink: store, slack, webhook, or email.
import {
createFileTools,
createEditTools,
createBashTools,
createCheckpointManager,
} from 'lannr-extras/workspace-tools'
const ctx = { workspace, globalReach: false }
const tools = [
...createFileTools(ctx),
...createEditTools(ctx),
...createBashTools(ctx),
]
// file-level checkpoints — the engine behind `lannr undo`
const checkpoints = createCheckpointManager({ workspace, agentDir })Real read/write/edit/patch, sandboxed bash, and file-level checkpoints (the engine behind lannr undo).
import { createBrowserTools } from 'lannr-extras/browser'
const tools = createBrowserTools({ workspace, globalReach: false })Navigation and interaction tools backed by Chrome DevTools Protocol, with a configurable URL-safety policy (setUrlSafetyPolicy).
import { upsertMcpServer } from 'lannr-extras/mcp/registry'
import { loadMcpTools } from 'lannr-extras/mcp/bridge'
// Register a stdio MCP server in the registry…
await upsertMcpServer({ id: 'filesystem', command: 'npx', args: ['@modelcontextprotocol/server-filesystem', '/tmp'] })
// …and surface its tools inside the Vault as
// $mcpCallTool('filesystem', 'read_file', { … }).
const mcpTools = await loadMcpTools()A stdio MCP client (McpStdioClient), a registry (readMcpRegistry / upsertMcpServer / removeMcpServer), and a bridge (loadMcpTools) that surfaces remote tools as Vault bindings.
import { ExecutionTimeline, MemoryBrowser } from 'lannr-extras/devtools'Inspect the execution timeline and browse stored memory while debugging.
📖 Learn more
- The runtime these extras plug into →
lannr-core - Full SDK reference — trust progression, sinks, Failure Archaeology, replay → DOCS.md
- A configured agent in your terminal →
lannr-cli - Project overview → README
Built for agents that ship.
Full docs → · Core → · CLI →
