is_docking_station_api 0.5.0
is_docking_station_api: ^0.5.0 copied to clipboard
The docking station's contract: what other parts of intersyntactic import to speak with it. The events a module translates for it, the decisions it records, and how both are encoded in the logbook.
is_docking_station_api #
The docking station's contract: what other parts of intersyntactic import to speak with the docking station, and nothing of how it decides.
Formerly is_admission_vocabulary; its 0.3.0 and this package's 0.3.0 are
the same code. Move a dependency by changing the package name in
pubspec.yaml and package:is_admission_vocabulary/is_admission_vocabulary.dart
to package:is_docking_station_api/is_docking_station_api.dart in imports.
The docking station reads events from the logbook in order and decides, for each, whether it comes into a mission and on which trajectory. Two sides need its words without needing its engine:
- A module, such as the Teams module, describes each event its relay
recorded. It implements
TranslatesRelayedEvents, which turns eachRelayedEventinto aTranslatedEventin the docking station's terms. - A reader of the logbook, such as loop_launcher, agent_loop or the airlock, reads the decisions the docking station recorded.
So this package holds exactly those words and their encoding in the logbook.
How the docking station decides (decide, what it has decided so far, its
rules, and the loop that runs it) lives in the docking station service,
which nothing else imports.
Translated events in #
For each event a module's translator names the address it belongs to, what that
address sits within (the channel a thread is in, or nothing), who it comes
from, the bot it was sent to as the external system verified it
(addressedTo), its event key (what "never decided twice" compares), and
what it is:
| Case | What it is |
|---|---|
MessageSaid |
Something said, with the UserSaid node the trajectory appends |
MessageChanged |
An edit, delete or restore of an earlier message |
ActorsJoinedAddress |
People or the agent joined an address |
ShownMessageJudged |
A person's verdict on something the agent showed them |
PersonAskedToCloseTrajectory |
A person asked to close the trajectory at an address |
NothingToAdmit |
Anything the module doesn't carry |
encodeTranslatedEvent and decodeTranslatedEvent write and read a
translated event as the decision entries carry it, under translatedEvent,
strictly.
Decisions out #
The docking station records one entry per event, each of a kind in
DecisionEntryKind. An operator's close is the one decision at no event:
| Entry kind | Decision |
|---|---|
event-admitted-to-mission |
EventAdmittedToMission: on a trajectory, starting one, or into a mission |
event-not-admitted-to-mission |
One of EventNotAdmittedToMission's cases; why says which |
trajectory-closed |
One of TrajectoryClosed's cases: a person at the address asked (TrajectoryClosedBecausePersonAsked), or an operator closed it from outside the conversation (TrajectoryClosedByOperator) |
mission-ended |
MissionEnded: a mission is over |
decodeDecision reads any of them back, strictly: an entry it doesn't
recognise, an extra field included, is null.
For the airlock: path_start.dart #
package:is_docking_station_api/path_start.dart reads an
event-admitted-to-mission entry only for the trajectory it starts and that
trajectory's rules. It never decodes the translated event, which is what
strangers sent, and a test walks its import graph to hold that.
Versions #
Each release is tagged docking_station_api-vX.Y.Z on the commit it is
published from; see CHANGELOG.md.