Caldera docs
calderaapp.io

Knowledge sources

Covers: how the catalog's agents read and write pages (instructions, documentation, notes) in the same way on every tool, which tools there are, and how you point an agent at your own pages. For: people who install an agent with a source and people who write drivers.

One contract, a driver per tool

A source is a tree of pages with Markdown bodies. Whatever the tool, an agent can do the same six things with it:

Command What it does
read <page> The page's title, its body as Markdown, and its version.
children [<page>] The pages directly under a page, or under the root.
tree [<page>] The pages under a page, three levels down, for a table of contents.
search "<words>" Pages that match, best first.
write <page> <version> Replace the page's body (on stdin). The version is the one read gave: a page that changed since is refused and nothing is written.
create <parent> "<title>" A new page under a page, or under the root.

A source also has databases. Four more commands read and write their rows:

Command What it does
fields <database> The database's fields in order: name, kind, the options of a select, whether it can be written.
rows <database> Every row with its id, title and values, keyed by the field's name.
create-row <database> "<title>" A new row; its values as a JSON object on stdin, keyed by field name.
update-row <database> <row> Set values on a row (a JSON object on stdin); null clears a field, the others stay.

Values are plain on every tool: text, a number, true or false, a select's option label, a list of labels, a date as YYYY-MM-DD (or an ISO time), a person as the tool's user id, a relation as row ids. A write that names a field the database does not have, an option it does not offer, a value of the wrong kind or a field the tool computes (formula, relation) writes nothing and says why. Writing a row never adds fields or options. Notion gives at most 25 people or related rows per value; a longer list is read short.

The run calls them through the runtime, as python3 caldera.pyz source …, and gets JSON back. A blueprint's own code uses the same package. Nothing else of the tool is reachable: an agent never calls its API itself.

The drivers

Tool Version of a page Credentials
The suite's document product Its ETag; a write carries it as If-Match. The install's binding, or the secret BASALT_TOKEN.
Notion A hash of the body as read; a write reads the page again first. The secret NOTION_TOKEN, from an integration the pages are shared with.

The suite's document product. A page's body is its canonical Markdown. The root is a page or a collection; for a collection, its pages are those at its top. The binding's data sources decide what the agent may read and where it may write.

Notion. A body is read from paragraphs, three heading levels, bullet, numbered and to-do items, quotes, code and dividers, with links, bold, italic and inline code inside them. A child page is not part of the body: a write keeps it. A page that holds anything else (an image, a toggle, a table, nested items) can be read but not written: the driver refuses rather than lose it. Keep the pages an agent writes plain. The integration sees only the pages shared with it in Notion.

Settings

Setting Meaning
Source tool Which driver. Empty: no source.
Source address Only for the suite's document product: the address of the instance. Empty takes the install's binding.
Source workspace Only for the suite's document product: the workspace id. Empty takes the install's binding.
Source root page The page the agent works in. A page or collection id, or for Notion a page id or its link. Empty for the suite's document product: the documentation area you gave the agent on its page.

Credentials are never settings. The run is told its source and the commands beside its duties.

A blueprint made for one project

Most agents need none. A team's rules or a tone are the agent's added instruction (a setting), and a code project's knowledge is in its repository's .caldera/STACK.md and .caldera/setup.sh (Operating). Derive a blueprint only for code the catalog's blueprint does not have yet.

A blueprint built for one project (a repository, a person) takes the shared parts of the catalog unchanged: the board and source standards, the duties, the review. It keeps the catalog's tool caldera/tools/derive.py as scripts/derive.py and names in a derive.json which catalog blueprint it comes from and which files it shares. python3 scripts/derive.py check lists what differs, sync takes it over; a build should refuse while anything differs. With "manifest": "settings" in derive.json, check also verifies that the blueprint's own manifest declares every setting of the catalog blueprint with the same key, type and options; other defaults, extra settings and extra manifest fields are allowed. A change to a shared file goes into the catalog first.