Lists all ten registered tools incl. task_update, names TASKD_HOME (TASKDIR still accepted) and the XDG default, the git history of the store, and the curl dependency of tasksd-http.
109 lines
3.6 KiB
Markdown
109 lines
3.6 KiB
Markdown
# tasksd
|
|
|
|
Central task store for the agent fleet, C99/POSIX.
|
|
|
|
Code: https://git.kropa.tech/hiddenbox/tasksd
|
|
|
|
Tasks are JSON files, one file per task (`t0001.json`), readable and
|
|
diffable, never a database. Every task carries a free-form `scope`, a
|
|
mandatory goal, and can be paused and resumed.
|
|
|
|
One binary, two modes:
|
|
|
|
```sh
|
|
tasksd # MCP over stdio
|
|
tasksd --http :8781 # central instance for the fleet, POST /mcp
|
|
```
|
|
|
|
`tasks-mcp-bridge` is the stdio shim that forwards to a central `tasksd`
|
|
(`TASKSD_URL`).
|
|
|
|
```sh
|
|
make
|
|
make test
|
|
```
|
|
|
|
## Storage
|
|
|
|
The task directory is `$TASKD_HOME`; `$TASKDIR` is the old name and is still
|
|
accepted. Without either, it is `$XDG_DATA_HOME/tasksd`, else
|
|
`~/.local/share/tasksd`.
|
|
|
|
If `git` is installed, the directory becomes a git repository on the first
|
|
write and every change is committed; without git, tasksd works the same,
|
|
without history.
|
|
|
|
## Scopes and states
|
|
|
|
A scope is a string the caller chooses (`makronix`, `fleet/console`). It
|
|
matches itself and everything below it: `task_next` with `scope=fleet` also
|
|
claims `fleet/console` work.
|
|
|
|
States: `pending`, `running`, `paused`, `done`, `dropped`.
|
|
|
|
## MCP tools
|
|
|
|
| Tool | Arguments | Effect |
|
|
|---|---|---|
|
|
| `task_create` | `title`, `goal`, `scope`, `priority`, `tags` | new pending task; title, goal, scope required |
|
|
| `task_update` | `id`, `title`, `goal`, `scope`, `priority`, `tags` | correct the given fields; `tags=""` clears |
|
|
| `task_next` | `scope` | claim the highest-priority pending task, mark it running |
|
|
| `task_scopes` | -- | every scope with pending/running/paused/done/dropped counts |
|
|
| `task_list` | `scope`, `state`, `limit` (default 50) | list tasks |
|
|
| `task_get` | `id` | one task with timestamps and result |
|
|
| `task_pause` | `id`, `note` | set to paused; the note is kept for the next agent |
|
|
| `task_resume` | `id`, `note` | paused -> running; refuses otherwise |
|
|
| `task_done` | `id`, `result` | close as done |
|
|
| `task_drop` | `id`, `result` | close as dropped |
|
|
|
|
## Dependency: libmcp
|
|
|
|
`vendor/libmcp/mcp.h` is a copy of the header from the `libmcp` repository, so
|
|
this repository builds and tests on its own. Refresh it after a libmcp change:
|
|
|
|
```sh
|
|
cp ../libmcp/mcp.h vendor/libmcp/mcp.h
|
|
```
|
|
|
|
`make` uses `LIBDIR=vendor/libmcp` by default; override it to build against a
|
|
checkout elsewhere: `make LIBDIR=../libmcp`.
|
|
|
|
## Web UI (CGI)
|
|
|
|
`tasksd-http` is a C99 CGI program: HTML 4.01, no JavaScript, no auth. Every list, read,
|
|
create, edit and state change is a `tools/call` against tasksd (`TASKSD_URL`, default
|
|
`http://127.0.0.1:8781/mcp`) made with `curl`, which must be installed; the CGI never
|
|
touches the task files.
|
|
|
|
| Address | Effect |
|
|
|---|---|
|
|
| `/` | tasks, filter with `?state=…&scope=…` |
|
|
| `/scopes` | scopes with pending/running/paused/done/dropped counts |
|
|
| `/new` | create a task |
|
|
| `/t/<id>` | one task with controls |
|
|
| `/t/<id>/edit` | title, goal, scope, priority, tags (`task_update`) |
|
|
| `/t/<id>/pause` | POST, note optional |
|
|
| `/t/<id>/resume` | POST, note optional |
|
|
| `/t/<id>/done` | POST, result optional |
|
|
| `/t/<id>/drop` | POST, result optional |
|
|
|
|
`task_update` exists for the edit form: state changes stay with pause/resume/done/drop,
|
|
while a wrong title, an incomplete goal or a moved scope can be corrected.
|
|
|
|
```sh
|
|
make # tasksd and tasksd-http
|
|
sudo make install # /usr/local/bin/tasksd, /usr/local/lib/cgi-bin/tasksd-http
|
|
```
|
|
|
|
With busybox httpd:
|
|
|
|
```sh
|
|
install -d /srv/www/cgi-bin
|
|
install -m 0755 tasksd-http /srv/www/cgi-bin/
|
|
TASKSD_URL=http://127.0.0.1:8781/mcp \
|
|
busybox httpd -f -p 0.0.0.0:8798 -h /srv/www
|
|
```
|
|
|
|
`vendor/cgi/cgi.h` is the shared CGI helper (one copy each in wikid, memoryd, skilld and
|
|
tasksd).
|