acryldev / acryl-todo
ACRYL (Agent Context Relay Yielding Lifecycles) is a platform for agentic apps: build them with any coding agent inside, run them as desktop, web, cli-tui or deploy to cloud, share them as Blends. Every feature is a swappable plugin. Each app is a Blend of swappable plugins with coding agents built in.
About this plugin
Written by the registry from verified metadata, not from the README.
acryl-todo is a DSH plugin published from the examples/acryl-todo package in the acryldev/acryl repository.
Capabilities and topics
acryl-todo
The reference app of the ACRYL Framework: a todo list in one plugin (about 90 lines in src/index.ts plus a 30-line page). It uses only router and state.
export const inject = ['router', 'state']
export function apply(ctx: Context, config: { file?: string } = {}): void {
const todos = ctx.state.cell('todo.list', load(config.file)) // the list is a cell
const api = new Acryl()
.use(loopbackOnly({ inProcess: 'allow' }), bodyLimit({ maxSize: MAX_BODY_BYTES }))
.post('/api', schemaValidator('json', NewTodo), c => { /* ... */ }) // validated body
.get('/events', c => streamSSE(c, async stream => { /* writeSSE on every change until the stream aborts */ }))
ctx.router.route('/todo', api)
ctx.inject(['routerHttp'], inner => { inner.routerHttp.mount('/todo') })
}
GET /todothe page (GET /todo/answers 301 to it:trimTrailingSlash, see the framework's routing page),GET/POST /todo/api,PATCH/DELETE /todo/api/:id,GET /todo/events(server-sent events). AlsoGET /api/state/todo.listthroughacryl-state.- Pass
config.fileto keep the list across restarts (atomic write on every change); without it the list lives in memory. A missing file is a new list; a corrupt or unreadable one stops the plugin with an error naming the file and is never overwritten. - Tests (
tests/todo.spec.ts) run it with no socket and prove the restart: a second context on the same file sees the list.
Try it with curl (no Origin header needed; a browser page from another origin is refused):
curl -X POST -H 'content-type: application/json' -d '{"title":"hello"}' http://127.0.0.1:<port>/todo/api
Badge
Listed here? Link back with this badge — paste the snippet into your repository README.
[](https://dsh-plugin.com/plugins/acryldev/acryl/examples/acryl-todo)