surface

module
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: MIT

README

Surface

A framework for agent development environments (ADEs): apps where a person and agents work together over the same windows, documents and data. A Surface app surfaces what the owner needs to know or decide, gives a shared place to design and iterate, and shapes how an agent approaches the work through context, reflexes, rules and nudges. Plain chat cannot do those things.

Surface is a Hollis Labs tool, a sibling of Substrate, which it is built on. It is interface only: it reaches data and services through MCP, CLI, API or connectors and depends on none in particular.

Status: early. The core, six modules and two apps exist and run. APIs, the module contract and the manifest may change. Basalisk is the prototype its design draws on.

Shape

Surface app (a generated binary)  =  Surface core  +  modules
  • Core — what makes it an ADE: the window manager (tile and float, saved layouts), the command palette, the agent panel, contexts and context slots, the router and reflexes, collaboration marks, and live settings.
  • Module — primitives plus data plus AI. A module brings views, commands and agent tools, and may declare a local store, live settings and context slots. Modules are compiled in and kept apart from the core: the only package a module imports is module.
  • App — a surface.yaml naming the modules. surface generate writes the wiring; surface build builds the page and the binary.
App Modules
demo (examples/demo) every module in this repository A preset for CI and local development, not a product. Apps live in their own repositories and pick the modules they use: Basalisk (hollis-skunkworks/basalisk), Exo (hollis-labs/exo).

Run it

Needs Go 1.26.11+ and Node 22+.

npm ci
make demo            # generate, build the page, build bin/demo
./bin/demo           # serves http://127.0.0.1:8190

Data lives under $XDG_DATA_HOME/surface/<app> (or <APP>_DATA_DIR); the address is <APP>_ADDR. The embedded agent needs a model gateway: see docs/agent.md. Without one the app runs and the panel says what to set.

The same binary drives a running app from a shell, and any MCP client can connect to /mcp:

./bin/demo open scratch
./bin/demo call scratch_add '{"text":"todo: try the palette"}'
./bin/demo settings surface.theme light      # live: the open page changes at once
./bin/demo layouts

Write a module

modules/scratch is the smallest complete one. See docs/writing-a-module.md.

func init() { module.Register(&mod{}) }

func (m *mod) Manifest() module.Manifest {
	return module.Manifest{
		ID: "scratch", Title: "Scratch",
		Views:    []module.View{{ID: "scratch", Title: "Scratch", Menu: true, Render: module.Component("scratch/main")}},
		Commands: []module.Command{{ID: "scratch.add", Title: "Scratch: jot something down", Run: m.add}},
		Tools:    []module.Tool{{Name: "scratch_list", Level: module.LevelRead, Run: m.list /* … */}},
		Store:    &module.Store{Migrations: migrations, Dir: "migrations"},
		Slots:    []module.Slot{{Name: "scratch", Views: []string{"scratch"}, Tools: []string{"scratch_list"}}},
	}
}

Docs

  • docs/taste.md — the Surface Taste & Design System: workflow-first philosophy, Evolved Blade Runner visual language, spatial window rules, Cite & Object Actions patterns, and golden workflow archetypes.
  • docs/ade-framework.md — architecture in one page and the complete feature inventory across core, modules, agent, cards, and UI.
  • docs/architecture.md — layout, the seam, the server-authoritative desk, data, config.
  • docs/writing-a-module.md — the contract, with the page's side.
  • docs/gui.md — how the interface is built, how to change a look or add a component so it reaches every app, and the extension points.
  • docs/agent.md — the embedded agent, context slots, the router and reflexes.
  • docs/substrate.md — what Substrate supplies and where Surface goes its own way.
  • docs/status.md — what is done, how it is checked, and what is not there yet.
  • AGENTS.md, CONTRIBUTING.md, SECURITY.md.

Licensed under the MIT License.

Choosing embedded chat or a Tether seat

Nanite is the default embedded runner and keeps its approval panel (docs/agent.md). SURFACE_AGENT_RUNNER=nanite selects it explicitly; scripted is available for tests. To attach the same chat page to a statically app-bound Tether CLI seat instead, add this to the app's agent.json (or the file SURFACE_AGENT_CONFIG names):

{
  "tether": {
    "url": "http://127.0.0.1:9030/chat/v1",
    "seat": "surface-seat",
    "key_file": "~/.config/my-app/tether-token"
  }
}

SURFACE_TETHER_URL, SURFACE_TETHER_SEAT, and SURFACE_TETHER_KEY_FILE override these fields. Omit key_file only for an endpoint that needs no bearer token. The credential must have chat access to the named seat. It stays on the Surface server and is reread per request. Tether configuration takes precedence over SURFACE_AGENT_RUNNER; remove it to return to embedded chat.

Enable the chat wire on the target Tether daemon and configure that seat's static MCP servers to include this Surface app's http://127.0.0.1:PORT/mcp endpoint. The endpoint must be reachable from the CLI agent's host. See Tether's app-bound seats for launch configuration. Attaching a page does not inject MCP servers into an already running agent.

The page uses packages/chat through Surface's same-origin /api/agent/tether route, which forwards to /chat/v1. Streams, attachment leases, detach/reattach, and replay cursors use the same conversation protocol. Surface adds its current slot/window context and configured system instructions to each submitted turn; Tether keeps that context out of the conversation event log. The Tether path assembles context but does not run the embedded runner's routing/reflex or approval hooks. The local context panel remains available.

MCP serves read and act tools to every client. A client that names itself with the X-Surface-Agent header (a seat host sends its seat) also gets write and confirm tools, which ask the owner first with a card naming the caller and wait up to ten minutes for the answer. An anonymous client sees and calls read and act tools only. A write tool offers "Allow once", "Always allow … for " (kept in the core database until revoked: GET/DELETE /api/mcp/grants) and "Deny"; a confirm tool asks with an approval card every time.

Project scaffolding

The Surface preset pack owns new-project templates and their conformance checks. Load it explicitly with Substrate’s Folio generator. It is independent of the running app and root framework build.

Directories

Path Synopsis
Package app is the main of a generated Surface binary: it starts Substrate (config, logging, health, the HTTP host, the database), hands the core what Substrate opened, and serves.
Package app is the main of a generated Surface binary: it starts Substrate (config, logging, health, the HTTP host, the database), hands the core what Substrate opened, and serves.
cmd
surface command
Command surface generates and builds Surface apps.
Command surface generates and builds Surface apps.
Package core assembles a Surface app: the kernel (desk, commands, settings, marks, events), the selected modules and the embedded agent, behind one HTTP handler.
Package core assembles a Surface app: the kernel (desk, commands, settings, marks, events), the selected modules and the embedded agent, behind one HTTP handler.
internal/ade
Package ade lets the agent show the owner things on the desk: point at a window or at a part of one (an anchor its view declared), spotlight it, draw an arrow between two, and walk the owner through a short guide.
Package ade lets the agent show the owner things on the desk: point at a window or at a part of one (an anchor its view declared), spotlight it, draw an arrow between two, and walk the owner through a short guide.
internal/agent
Package agent is the embedded agent of a Surface app: one agent the owner talks to in the agent panel, with every tool in the app, whose context changes with what is in front.
Package agent is the embedded agent of a Surface app: one agent the owner talks to in the agent panel, with every tool in the app, whose context changes with what is in front.
internal/agent/profile
Package profile reads, checks and stages module agent profiles.
Package profile reads, checks and stages module agent profiles.
internal/api
Package api is the core's HTTP surface: what the page draws from and what an outside client (a CLI, a script, another agent) drives the app through.
Package api is the core's HTTP surface: what the page draws from and what an outside client (a CLI, a script, another agent) drives the app through.
internal/attend
Package attend keeps what needs the owner, or has not been seen by them yet, in one place with one vocabulary, so the desk can say "this is waiting for you" the same way wherever it comes from (docs/attention.md).
Package attend keeps what needs the owner, or has not been seen by them yet, in one place with one vocabulary, so the desk can say "this is waiting for you" the same way wherever it comes from (docs/attention.md).
internal/cards
Package cards keeps the cards: what the app shows the user outside a window (a notice, a question, a request to approve, progress) and what they answered.
Package cards keeps the cards: what the app shows the user outside a window (a notice, a question, a request to approve, progress) and what they answered.
internal/classifier
Package classifier labels the owner's messages to the embedded agent: what the message asks for (the act facet: command, question, task, correction, approval, chat) and which slot it belongs to (the slot facet: the app's slots and general).
Package classifier labels the owner's messages to the embedded agent: what the message asks for (the act facet: command, question, task, correction, approval, chat) and which slot it belongs to (the slot facet: the app's slots and general).
internal/config
Package config is the app's live settings: declared by the core and by modules, kept in the app's database, and read at the moment of use.
Package config is the app's live settings: declared by the core and by modules, kept in the app's database, and read at the moment of use.
internal/desk
Package desk is the window manager: which windows are open, which is in front, how they are laid out, and the layouts the user saved.
Package desk is the window manager: which windows are open, which is in front, how they are laid out, and the layouts the user saved.
internal/events
Package events is the app's event bus: in-process publish and subscribe by topic prefix.
Package events is the app's event bus: in-process publish and subscribe by topic prefix.
internal/genui
Package genui is Surface's host for generated UI: the reviewed GenUI contract and gateway from Substrate, given this app's storage, policy and effects.
Package genui is Surface's host for generated UI: the reviewed GenUI contract and gateway from Substrate, given this app's storage, policy and effects.
internal/kernel
Package kernel is what the core's own services (the agent, slots, the router) are given: the app's shared state, already assembled.
Package kernel is what the core's own services (the agent, slots, the router) are given: the app's shared state, already assembled.
internal/marks
Package marks keeps the collaboration marks: notes pinned to a part of something, by the owner or the agent, with replies, until resolved.
Package marks keeps the collaboration marks: notes pinned to a part of something, by the owner or the agent, with replies, until resolved.
internal/reflex
Package reflex holds the agent's reflexes: standing rules that watch the conversation and the app, and act when their trigger fires.
Package reflex holds the agent's reflexes: standing rules that watch the conversation and the app, and act when their trigger fires.
internal/router
Package router stands in front of the agent.
Package router stands in front of the agent.
internal/script
Package script runs one walk-through three ways (docs/scripts.md):
Package script runs one walk-through three ways (docs/scripts.md):
internal/slots
Package slots decides what the embedded agent has in mind for a turn.
Package slots decides what the embedded agent has in mind for a turn.
internal/storage
Package storage opens SQLite databases and moves their schema forward.
Package storage opens SQLite databases and moves their schema forward.
internal/wardentoken
Package wardentoken mints short-lived bearer tokens for one audience from a Warden parent credential kept in a file, and hands them to HTTP clients.
Package wardentoken mints short-lived bearer tokens for one audience from a Warden parent credential kept in a file, and hands them to HTTP clients.
examples
demo command
Command demo is a Surface app: the Surface core plus the modules surface.yaml lists.
Command demo is a Surface app: the Surface core plus the modules surface.yaml lists.
demo/webui
Package webui embeds the app's built page (dist/).
Package webui embeds the app's built page (dist/).
Package module is the contract between the Surface core and a module.
Package module is the contract between the Surface core and a module.
collab
Package collab is Caster's "collab" namespace as Basalisk keeps it (contract collab/v1): what the owner and the agent work on together, drafts (code, content, plans), artifacts under review and diagrams.
Package collab is Caster's "collab" namespace as Basalisk keeps it (contract collab/v1): what the owner and the agent work on together, drafts (code, content, plans), artifacts under review and diagrams.
collab/collabtest
Package collabtest is an in-memory Caster for tests of code that reads and writes Caster through module/tetherlink (module/collab, a module's own Caster sync).
Package collabtest is an in-memory Caster for tests of code that reads and writes Caster through module/tetherlink (module/collab, a module's own Caster sync).
moduletest
Package moduletest runs one Surface module in a test, without the core: a Host with an in-memory desk, live settings, an event bus and marks, and a temporary SQLite store with the module's migrations applied.
Package moduletest runs one Surface module in a test, without the core: a Host with an in-memory desk, live settings, an event bus and marks, and a temporary SQLite store with the module's migrations applied.
tetherlink
Package tetherlink calls Tether's tools over MCP for a module: a stdio command (the local bridge, one process per call) or MCP's streamable HTTP.
Package tetherlink calls Tether's tools over MCP for a module: a stdio command (the local bridge, one process per call) or MCP's streamable HTTP.
modules
align
Package align is the Visual Alignment & Drop Pad module: architecture flow proposals, bucket triage boards, phased timelines, and drag-and-drop file/ref Drop Pads shared between the owner and the agent.
Package align is the Visual Alignment & Drop Pad module: architecture flow proposals, bucket triage boards, phased timelines, and drag-and-drop file/ref Drop Pads shared between the owner and the agent.
approvals
Package approvals is the Approvals module: Gatecrasher's approvals in front of the owner, as cards, decided where they are shown.
Package approvals is the Approvals module: Gatecrasher's approvals in front of the owner, as cards, decided where they are shown.
assist
Package assist is the owner's mail assistant: the agent reads what agents send the owner, answers and routes it in the owner's name, and brings the owner only what needs them.
Package assist is the owner's mail assistant: the agent reads what agents send the owner, answers and routes it in the owner's name, and brings the owner only what needs them.
browser
Package browser is the Browser module: web pages in windows, for the owner and the agent.
Package browser is the Browser module: web pages in windows, for the owner and the agent.
builder
Package builder is the Interaction Builder: the owner describes a flow ("triage my inbox", "write an article") and the agent sets the app up for it.
Package builder is the Interaction Builder: the owner describes a flow ("triage my inbox", "write an article") and the agent sets the app up for it.
chat
Package chat is the agent chat module: chat with the seats a seat host runs (hollis-skunkworks/seat-host).
Package chat is the agent chat module: chat with the seats a seat host runs (hollis-skunkworks/seat-host).
design
Package design is the Design module: design work handed to a design team and reviewed live.
Package design is the Design module: design work handed to a design team and reviewed live.
diagram
Package diagram is the Diagram module: architecture and flow drawings the owner and the agent keep together.
Package diagram is the Diagram module: architecture and flow drawings the owner and the agent keep together.
drafts
Package drafts is the Drafts module: documents (prose, code, plans) the owner and the agent work on together.
Package drafts is the Drafts module: documents (prose, code, plans) the owner and the agent work on together.
files
Package files is the Files module: a file browser over a small set of named places (root directories on this machine), for the owner and for the agent.
Package files is the Files module: a file browser over a small set of named places (root directories on this machine), for the owner and for the agent.
frag
Package frag is the Frag module: quick capture into a Fragments Engine (FE).
Package frag is the Frag module: quick capture into a Fragments Engine (FE).
inbox
Package inbox is the Inbox module: the owner's Tether mail, read through Tether's own message tools (tether_message_list and the rest), so nothing is consumed by reading: a message stays in its mailbox, read or unread, for every other reader too.
Package inbox is the Inbox module: the owner's Tether mail, read through Tether's own message tools (tether_message_list and the rest), so nothing is consumed by reading: a message stays in its mailbox, read or unread, for every other reader too.
notes
Package notes is the Notes module: Markdown files in a folder, written by the owner and the agent, linked with [[wiki links]] and marked up with the core's marks.
Package notes is the Notes module: Markdown files in a folder, written by the owner and the agent, linked with [[wiki links]] and marked up with the core's marks.
ops
Package ops is Operations: the owner's workstream board.
Package ops is Operations: the owner's workstream board.
projects
Package projects is the owner's projects for the agent.
Package projects is the owner's projects for the agent.
reader
Package reader is the Reader module: RSS and Atom feeds the owner follows, read in a window of their own.
Package reader is the Reader module: RSS and Atom feeds the owner follows, read in a window of their own.
registry
Package registry is the Registry module: a read-only browser for the Registry, the records of what exists (projects, tools, agents, skills, documents...) and how they relate.
Package registry is the Registry module: a read-only browser for the Registry, the records of what exists (projects, tools, agents, skills, documents...) and how they relate.
scratch
Package scratch is the Scratch module: quick notes, to-dos, ideas and follow-ups as small items, kept in the module's own store and, with caster_sync on, in Caster as Basalisk keeps them (caster://scratch/<id>, sync.go).
Package scratch is the Scratch module: quick notes, to-dos, ideas and follow-ups as small items, kept in the module's own store and, with caster_sync on, in Caster as Basalisk keeps them (caster://scratch/<id>, sync.go).
terminal
Package terminal is the Terminal module: local shells in pseudo-terminals, drawn by xterm.js in a window of tabs.
Package terminal is the Terminal module: local shells in pseudo-terminals, drawn by xterm.js in a window of tabs.
terminal/shell
Package shell runs local shells in pseudo-terminals and lets browser terminals attach to them.
Package shell runs local shells in pseudo-terminals and lets browser terminals attach to them.
tether
Package tether is the Tether module: the owner's work systems for the agent, through the Tether gateway.
Package tether is the Tether module: the owner's work systems for the agent, through the Tether gateway.
trackers
Package trackers is the Native Trackers module: categorized work lists, taxonomy tags, lifecycles, and custom metadata/extras for tracking projects, checklists, and queues.
Package trackers is the Native Trackers module: categorized work lists, taxonomy tags, lifecycles, and custom metadata/extras for tracking projects, checklists, and queues.
usage
Package usage is the Usage Monitor module: a four-view operational cockpit (Now, Trends, Intelligence, Sources) over the Station Usage Monitor v1 API, enforcing strict separation of cost_kind buckets, unknown values as nil (never 0), parent-blocked quota window shading, and server-side key isolation.
Package usage is the Usage Monitor module: a four-view operational cockpit (Now, Trends, Intelligence, Sources) over the Station Usage Monitor v1 API, enforcing strict separation of cost_kind buckets, unknown values as nil (never 0), parent-blocked quota window shading, and server-side key isolation.
viewer
Package viewer is the Viewer module: look at an artifact (a picture, a video, a recording, a PDF, an HTML mock) and point at what you mean.
Package viewer is the Viewer module: look at an artifact (a picture, a video, a recording, a PDF, an HTML mock) and point at what you mean.
work
Package work is the Work module: the Work engine (README.md) of typed items, links and saved views kept in Caster under the contract work/v1, with three apps as presets over it (Content, Planner, Writer).
Package work is the Work module: the Work engine (README.md) of typed items, links and saved views kept in Caster under the contract work/v1, with three apps as presets over it (Content, Planner, Writer).
workbench
Package workbench is the Agent Workbench: a Surface module for making and improving Nanite agents.
Package workbench is the Agent Workbench: a Surface module for making and improving Nanite agents.
workflows
Package workflows hosts the workflow designer and keeps reviewable module briefs.
Package workflows hosts the workflow designer and keeps reviewable module briefs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL