Shared data types
A shared data type is the shape of a common thing, such as a task or a comment, that any app, agent or person in a World can read and write. Mod ships a few. Packages add more. Because every app works on the same records, a task is one task wherever it appears.
How it works
A record is a document with a type. Its type names its fields, and the document holds their values. It syncs, merges and keeps its history like any other document, and every change names who made it.
Apps are views over records, not owners of them. A board, a weekly plan and a review can all show the same task, and ticking it in one ticks it everywhere. An agent changes a record the same way a person does, by writing to it, so there is no separate API to keep in step with the screen.
Two types ship with Mod.
Tasks. A task is work to be done, with a title, a status and the sessions that worked on it. Because the sessions are on the task, the next agent to pick it up can read what the last one did. Plan with whatever suits you: a task list, a weekly plan, RFC slices or a board.
Comments. A comment is a thread attached to the exact thing it is about: a passage in a document, a line in a diff or a message in a session. It moves with what it is attached to. An agent answers in the thread, not in a side channel, and you decide when an agent should answer and when it should only read.
Using it as you build
Write a record from the command line by naming its type:
mod-next docs create <projectId> plan/reset-screen \
--dataType launchplan --data '{"work":"Reset screen v3","owner":"Sam"}'
Agents use tools for the built-in types: create_task, update_task and complete_task for tasks, and comment to start, answer or resolve a thread.
To add your own type, declare it in a package. The package also says which existing types it reads and writes, and gets access to only those:
"mod": {
"name": "Launch plan",
"dataType": "launchplan",
"reads": ["tasks"],
"writes": ["tasks"]
}
See packages for the rest of the manifest, and apps for drawing a type.
Limits
- A shared list of types, published for every package to build on, is still forming. soon