surface

module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 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
desk notes, files, scratch, drafts, browser The core modules.
studio scratch, notes, drafts, browser, builder Adds the Interaction Builder: describe a flow, and the agent arranges windows, modules and reflexes for it and saves that as a layout you can return to.

Run it

Needs Go 1.26.11+ and Node 22+.

npm ci
make desk            # generate, build the page, build bin/desk
./bin/desk           # 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/desk open scratch
./bin/desk call scratch_add '{"text":"todo: try the palette"}'
./bin/desk settings surface.theme light      # live: the open page changes at once
./bin/desk 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

Licensed under the MIT License.

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.
apps
desk command
Command desk is a Surface app: the Surface core plus the modules surface.yaml lists.
Command desk is a Surface app: the Surface core plus the modules surface.yaml lists.
desk/webui
Package webui embeds the app's built page (dist/).
Package webui embeds the app's built page (dist/).
studio command
Command studio is a Surface app: the Surface core plus the modules surface.yaml lists.
Command studio is a Surface app: the Surface core plus the modules surface.yaml lists.
studio/webui
Package webui embeds the app's built page (dist/).
Package webui embeds the app's built page (dist/).
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/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/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/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/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.
Package module is the contract between the Surface core and a module.
Package module is the contract between the Surface core and a module.
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.
modules
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.
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.
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.
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.
Package scratch is the Scratch module: quick notes, to-dos, ideas and follow-ups as small items, kept in the module's own store.

Jump to

Keyboard shortcuts

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