protocol-chaos

v0.2.3
protocol-chaos Checked 1 day ago Published 1 month ago

Protocol Chaos: an open protocol for the matters a person holds, shared by every AI assistant they use.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

event_note

Record the user's words on an Event, or start a new Event with them. Changes nothing else (it gives a title only to an Event that has none). With eventId the words are appended; without it a new Event starts in state emerging, optionally titled and placed under parentEventId. Check the directory first so one matter does not become two. Verbatim rule: text is the user's actual words, trimmed and otherwise unchanged, never a summary or a third-person paraphrase such as "The user confirmed…"; when a message covers several Events, pass the part about this Event, still in the user's words. Interp…

ParameterTypeDescription
actor *objectWho is writing: your own identity, e.g. {"kind": "agent", "id": "laptop"}. Never the owner or another writer.
text *stringThe user's actual words, verbatim. Never a summary or a third-person paraphrase.
accountSourcestringWhose words they are: user (default), agent_response (your own sentence, such as an inference) or authorized_external (relayed from an application the user authorized).
eventIdstringAn Event id from the directory or a receipt.
parentEventIdstringFor a new Event only: the larger Event it is part of.
titlestringFor a new Event, or an Event without a title: a name that identifies it on its own.
viastringWhere the words came from when they were not said in this conversation, e.g. "example-export".

event_record_expression

Record words together with the changes they support, atomically: set any of title, state, progress, facts (goal, constraint, plan), refs and metadata. To fold words recorded earlier into fields, pass that Account's accountId and its exact text instead of appending new words. Each supplied field replaces the stored one, so supply its complete current content and carry over what still holds; null removes a field. Mark your own inferences inside the fact text with their basis. Verbatim rule: text is the user's actual words, trimmed and otherwise unchanged, never a summary or a third-person paraph…

ParameterTypeDescription
actor *objectWho is writing: your own identity, e.g. {"kind": "agent", "id": "laptop"}. Never the owner or another writer.
eventId *stringAn Event id from the directory or a receipt.
text *stringThe user's actual words, verbatim. Never a summary or a third-person paraphrase.
accountIdstringAn existing Account of this Event to ground the changes on.
accountSourcestringWhose words they are: user (default), agent_response (your own sentence, such as an inference) or authorized_external (relayed from an application the user authorized).
expectedVersionintegerThe Event's version from your last read or receipt. On VERSION_CONFLICT, read again and reconsider.
setobjectFields to replace, each with its complete current content; null removes a field. Inside facts, each supplied key replaces that fact and the others are unchanged.
viastringWhere the words came from when they were not said in this conversation, e.g. "example-export".

event_add_parent

Link an Event (child) as part of a larger Event (parent). Link only when it is plainly part of it or a step toward it; two separate trips are siblings. Ground the link on Accounts of the child or of the parent. Adding an existing link changes nothing; a link that would close a cycle fails with PART_OF_CYCLE. Returns {eventId, version, parents} for the child.

ParameterTypeDescription
actor *objectWho is writing: your own identity, e.g. {"kind": "agent", "id": "laptop"}. Never the owner or another writer.
childEventId *stringAn Event id from the directory or a receipt.
parentEventId *stringAn Event id from the directory or a receipt.
sourceAccountIds *arrayAt least one Account of the child or of the parent that the link rests on.
expectedVersionintegerThe child's version.

event_remove_parent

Remove the link "child is part of parent", grounded on Accounts of the child or of the parent. Removing a link that does not exist fails with NOT_FOUND. Returns {eventId, version, parents} for the child.

ParameterTypeDescription
actor *objectWho is writing: your own identity, e.g. {"kind": "agent", "id": "laptop"}. Never the owner or another writer.
childEventId *stringAn Event id from the directory or a receipt.
parentEventId *stringAn Event id from the directory or a receipt.
sourceAccountIds *arrayAt least one Account of the child or of the parent that the link rests on.
expectedVersionintegerThe child's version.

event_get_protocol

Read one Event: {event, accounts, entities?}, the document, its most recent Accounts (default 20, or "all"), oldest first, and, when its refs name Entities, those Entities as {id, kind, name}. History is read with event_get_revisions.

ParameterTypeDescription
eventId *stringAn Event id from the directory or a receipt.
accounts

context_pack

The directory: every Event in brief, {id, title?, state, parents, progress?, updatedAt}, most recently updated first, from which you decide what to read. Pass sinceVersion (the version you cached) to learn whether anything changed; filter by state (a state, "open" or "closed"); page with limit and cursor (pass next).

ParameterTypeDescription
cursorstring
limitinteger
sinceVersionstring
statestring

event_get_revisions

Read the history of an Event: its Revisions in commit order. Page with limit and after (pass next).

ParameterTypeDescription
eventId *stringAn Event id from the directory or a receipt.
afterstring
limitinteger

event_words_since

The words recorded since a moment, for folding them into fields later or refreshing a cache. Returns {version, checkpoint, remaining, events}: each Event that gained Accounts after since, with its current title, state, facts, refs, progress and parents, and words, its new Accounts, oldest first. Pass checkpoint as the next since to continue; remaining counts the Accounts not yet returned. limit is the number of Events per batch (a batch never ends between two Accounts with the same createdAt). Going over the same words twice changes nothing, because each field write carries the complete curren…

ParameterTypeDescription
since *stringA timestamp such as 2026-03-14T09:30:00.000Z: the checkpoint of your previous call, or an early time to read every word.
limitintegerThe number of Events per batch.

event_undo_revision

Undo the latest change of an Event that has not been undone: a field.changed, parent.added or parent.removed Revision (words recorded since do not count). Events and words are never removed, so event.created and account.added cannot be undone, nor can an undo. Anything else fails with REVISION_NOT_REVERSIBLE, for example after another writer changed the Event: read it again and reconsider. Records a revision.reverted Revision and returns it; call again on the next change to walk further back.

ParameterTypeDescription
actor *objectWho is writing: your own identity, e.g. {"kind": "agent", "id": "laptop"}. Never the owner or another writer.
revisionId *stringThe Revision to undo, from event_get_revisions.

entity_get

Read one Entity. entityId is an Entity id or "current_user" (the user's own Entity). view "summary" returns {entity, summary}: the short list of Statements meant to be loaded into every conversation (never sensitive ones). view "full" (default) returns {entity, statements}: the Statements that are not outdated, by topic, then by creation. includeHistory adds history (the outdated ones); includeEvents adds referencedBy (the Events whose refs name it); topics restricts the Statements returned.

ParameterTypeDescription
entityId *stringAn Entity id, or "current_user" for the owner.
includeEventsboolean
includeHistoryboolean
topicsarray
viewstring

entity_create

Create an Entity: one specific person, animal, thing or place that recurs across Events or applications and has user-specific information to accumulate (otherwise use a {criteria} ref on the Event). Search first (entity_search). accountText holds the words it rests on; statements are its first facts, one fact each, 1 to 200 characters, with absolute dates. owner: true only for the user's own Entity (at most one). Verbatim rule: the words (text, accountText) are the user's actual words, trimmed and otherwise unchanged, never a summary or a third-person paraphrase; pass the part about this Entit…

ParameterTypeDescription
accountText *stringThe user's actual words this Entity rests on, verbatim.
actor *objectWho is writing: your own identity, e.g. {"kind": "agent", "id": "laptop"}. Never the owner or another writer.
kind *stringperson, animal, thing or place.
name *stringWhat the user calls it.
accountSourcestringWhose words they are: user (default), agent_response (your own sentence, such as an inference) or authorized_external (relayed from an application the user authorized).
aliasesarrayOther names; not the name itself, each once.
ownerbooleantrue only for the user's own Entity.
statementsarray
viastringWhere the words came from when they were not said in this conversation, e.g. "example-export".

entity_record

Record words about an Entity together with what they change: name, aliases (the complete new list), add (new Statements; may supersede or conflict with existing ones), update (status, reason, sensitivity, inSummary of existing Statements) and support (existing Statements these words also support). Saying the same thing again is merged into the existing Statement as more evidence. A Statement resting on the user's words can be superseded, or its status changed, only by the user's own words (USER_WORDS_PROTECTED): add your version with conflictsWith instead. A disputed Statement becomes current…

ParameterTypeDescription
actor *objectWho is writing: your own identity, e.g. {"kind": "agent", "id": "laptop"}. Never the owner or another writer.
entityId *stringAn Entity id, or "current_user" for the owner.
text *stringThe user's actual words, verbatim. Never a summary or a third-person paraphrase.
accountSourcestringWhose words they are: user (default), agent_response (your own sentence, such as an inference) or authorized_external (relayed from an application the user authorized).
addarray
aliasesarrayThe complete new list of aliases.
expectedVersionintegerThe Entity's version from your last read or write.
namestring
supportarrayExisting Statements these words also support.
updatearray
viastringWhere the words came from when they were not said in this conversation, e.g. "example-export".