Skip to content

Extensions

endurable is built to be extended, and you don’t have to write the extension. You ask an agent, in any thread:

Add a button to endurable that runs this project’s test script in the terminal.

Give me a database browser beside the thread for this project’s SQLite file.

Add a feed reader to the sidebar, and let agents read my feeds.

Start a thread whenever a new alert comes in for the checkout service.

The agent writes a TypeScript file into your extensions folder. endurable loads it without a restart, and the agent checks that it loaded and fixes it if it didn’t. endurable ships a skill that teaches agents its extension API, with working examples, so they don’t need endurable’s source code.

Three things extensions added here: the Run tests button, the query tool with its own table in the transcript, and the Database panel.
  • A model provider, such as a LiteLLM proxy or any OpenAI-compatible server. Its models appear in the model picker beside the built-in ones.
  • Tools for agents, with their own wording in the transcript and, if you like, their own drawing of the result.
  • Commands: buttons in a thread’s header, items in its ⋯ menu, entries in ⌘K, keyboard shortcuts, and /commands in the composer.
  • A tab in the tools panel: a database browser, a dashboard.
  • An app that runs with no thread at all, with its own icon at the foot of the list.
  • Event sources agents can wait on, and code that reacts when a thread’s turn ends or its pull request changes.
  • Threads of its own, started when something arrives from outside: an alert, a chat message, an item on a queue.
An app with no thread: a feed reader. Its Discuss button starts a thread about an item, and agents can read the feeds.

An extension is a TypeScript or JavaScript file that endurable loads and runs. The rest of this page is how they work, for when you want to read or write one yourself.

Your own go in ~/.endurable/extensions/. Settings → Extensions shows the exact path. They apply in every project unless you narrow them.

A project’s go in .endurable/extensions/ in the repository, committed with it so the team shares them. They run only after you turn on Run this project’s extensions on that project’s page in Settings → Projects. They apply only in that project and can’t add model providers or apps. A project’s extensions and a Local sandbox on the same checkout can’t run together, since code in the sandbox could rewrite what runs on your computer.

In either folder, an extension is one of:

  • name.ts, name.js or name.mjs,
  • name/index.ts or name/index.js,
  • name/ with a package.json that names its entry under "endurable": { "server": "./server.ts" }.

Names are lowercase letters, digits and dashes. A file or folder that doesn’t fit is listed in Settings → Extensions with the reason.

This adds a tool agents can call:

import { obj } from "@earendil-works/pi-schema";
import type { ExtensionAPI } from "@endurable/extension";
export default function (endurable: ExtensionAPI) {
endurable.registerTool({
name: "package_scripts",
description: "List the scripts in the thread's package.json",
parameters: obj({}),
words: { running: "Reading the scripts", done: "Read the scripts" },
async execute(_args, context) {
const { scripts = {} } = JSON.parse(await context.thread.readFile("package.json"));
return { output: Object.keys(scripts).join("\n") || "No scripts." };
},
});
}

And this adds a button to every thread’s header, with a shortcut and a slash command:

import type { ExtensionAPI } from "@endurable/extension";
export default function (endurable: ExtensionAPI) {
endurable.registerCommand("run-tests", {
label: "Run tests",
icon: "flask-conical",
places: ["header", "menu", "palette"],
keys: "mod+shift+y",
slash: "test",
async run(context) {
context.runInTerminal("npm test", { run: true });
context.toast("Running npm test");
},
});
}

The file is TypeScript as Node runs it directly, so use only erasable syntax (no enum) and import type for types. @earendil-works/pi-schema (for schemas), @earendil-works/pi-ai and @endurable/extension are provided. For any other package, add a package.json to the extension’s folder and run npm install there.

endurable sets up type definitions in your extensions folder, so an editor checks your code against the API.

Extension folders are watched. Save a file and that extension reloads within a moment. Nothing else restarts. A call that’s already running finishes on the old code.

If a new version fails to load, the last good version keeps running and Settings → Extensions shows the error. A load is all or nothing. It fails if the extension takes more than ten seconds to set itself up, or if it adds a tool whose name is already taken by endurable or another extension.

⌘K → Reload extensions loads every one again and says which didn’t.

Settings → Extensions lists each extension with its status (Loaded, Didn’t load, Off, Not trusted), where it’s from, and what it adds. Each has its own page with:

  • On / Off and Reload.
  • Where it applies: all projects, or only the ones you check. This narrows what an extension adds to threads. Its model providers and apps show everywhere.
  • Its settings, if it declares any. A setting can have a different value per project.
  • The secrets it reads. Extensions never store credentials in settings. They declare the secrets they need by name, and this page shows whether each is set, with a shortcut to add it. An extension’s apps and background jobs run with no thread, so they can read only secrets kept for all projects.
  • The MCP servers it calls, and each one’s state.
  • Its background jobs, when each last ran, and any failure.

A model provider’s API key is added in Settings → Accounts, like any other.

A panel, an app, or the expanded view of a tool call is an HTML page from the extension’s folder. Pages run in a sandboxed frame with no network access and talk to the extension’s server code through a small bridge (endurable.call(command, args)).

Pages are given the current theme’s colors as CSS variables, and plain buttons, inputs and tables are styled to match the app, so a simple page looks native without any CSS of its own.

Each extension has a data folder of its own that survives reloads and restarts. It’s a good place for a SQLite file.

Heavy work, such as fetching, parsing and indexing, belongs in jobs, which run on a worker thread so they can’t stall the rest of endurable. Jobs can be queued, retried on failure, and scheduled to repeat. A run is stopped after fifteen minutes unless the job sets its own limit.

Extensions can talk to threads.

  • A command can send a message as you, when you click its button.
  • An extension can post a note to a thread, which the agent reads on its next turn, or post with a wake, which starts a turn. A wake can carry a daily budget.
  • An extension can start a thread by itself when something arrives, at most 20 a day. The thread’s header says which extension started it.
  • An extension can ask you a question on a thread, with the same cards an agent uses, and take it back if it stops mattering. Your answer goes to the thread’s agent. It can have three questions open on a thread at a time.
  • A command can open a side chat beside the thread, or add words to your draft without sending them.

Messages an extension sends by itself are labeled as coming from the extension, never as yours.

The examples that ship with endurable, which an agent can read and copy from:

Example Shows
litellm.ts A model provider with a setting
run-tests.ts Header, menu and palette commands, a key, a slash command
sqlite/ An agent tool with its own transcript row, a panel, a per-project setting
rss/ An app with no thread, its own data, a background job, search
better.ts A /better command that rewrites your prompt in a side chat
alerts/ Threads started by incoming alerts, which then listen for updates and ask you what to do when one gets worse

An extension runs inside endurable’s server with your full permissions. It isn’t sandboxed. Only what it draws in the app is fenced off. Install only extensions you’ve read or trust, and think before turning on a project’s extensions in a repository other people can push to.