@projectpac/exchange
v0.4.1
Published
Part of PAC: @projectpac/exchange.
Downloads
108
Readme
@projectpac/exchange
The exchange engine: the box drive and the negotiation rounds that skills, joint-search, and objects each used to carry a copy of, offered to flows as one service.
A factory rather than an actor. A flow hands over a spec -- its record accessors, its choices, its messages -- and drives what comes back with its own hands: every apply, ask, run, and artifact call goes through closures over the flow's own context, so attribution, policy, and inject gates are exactly what they were when the flows inlined these steps. The engine itself reaches nothing, which is why it injects nothing and runs on any node however bare.
Two pieces, matching the two shapes every exchange-shaped flow repeats:
- The negotiation (
createNegotiation): propose and review revisions of a shared artifact until both sides mark one agreed, within a bounded number of rounds. The flow supplies what to draft and how to judge; the engine supplies the round discipline. - The drive (
createDrive): the box session's state machine -- party, propose, view, approve, submit, fetch -- advanced one durable step at a time, so a restart resumes where the records say it was rather than where a variable hoped it was.
