API reference¶
Generated from the TSDoc of everything src/index.ts exports. The intent
behind the design lives in Design decisions; how to use the
library, in the guide; this is the exhaustive surface.
Module |
What it is for |
Exports |
|---|---|---|
An agent is content: a system prompt, a model, a set of tools. It is declared as Markdown + frontmatter, following the pi convention. |
9 |
|
Asking the user a question - the one place a workflow may block on a human. |
6 |
|
When a board has agreed: who voted for what, and whether they all say one thing. |
3 |
|
A place several subagents can leave messages for each other. |
9 |
|
One owner per thing, decided here rather than agreed between members. |
6 |
|
The board as a member reads it: one line per post, and what answers the reader first. |
1 |
|
How a member reaches the board. |
2 |
|
Letting a subagent have subagents of its own. |
4 |
|
The event stream: one core, many reporters. |
6 |
|
The worst case of a checked flow, computed before the first spawn: how many agent turns each node can ask for, and how long it can take when every bounded wait runs to its bound. |
3 |
|
What a flow is checked against, and where it is found on disk. |
5 |
|
The run stage of validation: a checked flow held to the project it is about to run in, still before the first spawn. |
5 |
|
The flow stage of validation: a flow read against the catalogue it runs in, before the first spawn. |
2 |
|
A checked flow: what validation hands the runner, the renderings and the dry run once it found no fault. |
13 |
|
A condition checked whole against the types of what it may read, before the first spawn. |
1 |
|
Why a flow is refused before its first spawn: a stable code, the file, where in it, and one sentence. |
2 |
|
The live view as text: the summary line, then one line per live line, indented under the line that holds it, each cut to the width the caller draws in. |
4 |
|
The live view of a flow run: its plan, filled from the journal and the event stream, folded by the state of each visit. |
4 |
|
A checked flow as a Mermaid |
1 |
|
The plan of a checked flow: one line per node, in the tree the file writes, each saying everything the check resolved about it. |
3 |
|
The one line a flow run collapses to: how it stands, and counts that hide nothing. |
1 |
|
A plan as text: the head line of the flow, then one line per plan line, indented under the line that holds it. |
1 |
|
A dry run’s script: the answers that stand in for each agent turn, each check’s script run, each commit and each question, checked against the flow before the first one is taken. |
2 |
|
|
3 |
|
|
3 |
|
The journal of a run: one JSON line per fact, appended when it happens and never rewritten, which is what a resume and the live view read back. |
3 |
|
|
2 |
|
|
5 |
|
The snapshot of a run: what its validation read, kept in its run directory at the first start with the input and the settings, so that a resume runs the flow the run started with, whatever the disk says by then. |
3 |
|
What the flow stage read to check a flow: its file and the file of every flow it reaches, and each agent it names with the skills that agent’s |
2 |
|
The type of a value a flow passes around: what a schema declares, what a condition is checked against, and what a node’s typed output must match. |
2 |
|
The values a flow’s keys hold, each read to one type or refused. |
1 |
|
The git a run is allowed to do - and nothing else. |
8 |
|
Putting the work of several copies back into one tree. |
3 |
|
The |
2 |
|
A working copy with a lifetime: made for one piece of work, and released when that work is done. |
2 |
|
Working copies, so two agents can write at once without writing over each other. |
6 |
|
The language a subagent answers in: the one it was asked in. |
1 |
|
Running the same work across several models, several times. |
3 |
|
Exporting a run: |
8 |
|
A run that measures itself: the picture it is drawn from, the stream it may keep, and the |
3 |
|
What an experiment leaves behind: one JSON document, one comparison table. |
5 |
|
The mirror: a live subagent’s session, on a unix socket. |
4 |
|
A plain console reporter: one line per event that matters. |
2 |
|
Detection and transport for herdr’s socket API. Nothing else lives here. |
4 |
|
Asking herdr whether it would open a pane, without opening one. |
1 |
|
The herdr reporter: one split per subagent, showing it work. |
3 |
|
Choosing a reporter, so the caller does not have to. |
3 |
|
The picture of a run: the event stream folded, once, into what every reader wants to know - who is alive, under whom, doing what, at what cost. |
6 |
|
The event stream, on disk: one JSON object per line, in the order it happened. |
1 |
|
The no-op reporter. |
1 |
|
A run as a tree: a delegated subagent drawn under the one that asked for it. |
1 |
|
Formatting for the pi TUI, with no pi-tui in sight. |
11 |
|
|
6 |
|
What is left to do, as a list nobody can lose track of. |
2 |
|
|
2 |
|
The whole pi API lives here, and nowhere else. |
10 |
|
The skills an agent may load, and where they are looked up. |
2 |
|
The stop switch of a live run: everything at once, or one subagent of it. |
3 |
|
A subagent: a live session, a memory, a state. |
5 |
|
Reading what a model wrote, and cutting what it is handed: shortening text, and finding the structure in it. |
5 |
|
The constant parts of a tool combo defines: whether an agent asked for it, and the two shapes of answer a model reads. |
3 |
|
Measurements: time and tokens, per subagent. |
6 |
|
Running the code, rather than asking two agents whether they like it. |
4 |
|
|
2 |
|
Running several things at once, but not all of them: a subtask is a session, and N sessions opening together is the bill nobody meant to pay. |
1 |
|
|
4 |
|
|
5 |
|
|
4 |
|
What every combinator shares: the same options, under the same names, with the same defaults. |
4 |
|
|
3 |
|
Reading a plan an agent wrote: the prompt, the parser, the validation. |
5 |
|
The pool: where a workflow’s turns are played. |
3 |
|
|
3 |
|
|
5 |
|
What a swarm tells one member at the top of each turn. |
1 |
|
Several members on one job, for as many rounds as you allow. |
8 |
|
The trail: every result a workflow produced so far, over its own clock. |
1 |