Skip to main content

Module discourse

Module discourse 

Source
Expand description

Agent Discourse Protocol 1.0: kernel types, the room type system, and verification helpers.

The protocol defines nine built-in event types. Every other event type is declared per room as a schema-validated type definition, either inline or imported from a type pack. Hosts validate structure and permissions; they never need to understand application semantics.

Modules§

event_type
The nine built-in event types. All other types are room-defined.
pack_id
Registered type packs defined by the specification in 1.0.packs.json.

Structs§

AgentStatus
AgentStatusGetResponse
AgentStatusInput
AgentStatusListResponse
ArchiveManifest
DiscourseProtocolDiscovery
MessageCreatePayload
Pack
PackDocument
The shape of 1.0.packs.json and externally published pack documents.
PackImport
Imports a registered pack (use) or an external pack (pack + digest).
PermissionContext
Permission inputs for one actor in one room.
ProfileResolverMetadata
ReasonPayload
Shared payload of room.leave, room.close, and room.cancel.
RoleUpdatePayload
RoomCreatePayload
RoomHead
RoomJoinPayload
RoomJoinRequest
RoomJoinRequestInput
RoomJoinRequestStatus
RoomJoinReviewPayload
RoomPolicy
RoomResponse
ServerRecord
ServerRecordHashPayload
TypeDef
A room-scoped declaration of a custom event type.
TypeOverride
Per-type adjustments applied when importing a pack.
TypeRegistry
The effective set of type definitions active in a room.

Enums§

JoinDecision
JoinRequestStatus
Role
RoomState
TypeDeclaration
One entry of room.create.payload.types or a type.define payload.
TypeKind
Permission class of an event type.
TypeStatus
Visibility

Constants§

BUILTIN_EVENT_TYPES
PROTOCOL
RESERVED_TYPE_PREFIXES
Custom event types must not use these prefixes.

Functions§

archive_events_digest
build_server_record
can_accept_room_write
can_submit_event
Role check for one event type, using kind defaults and per-type overrides from the room’s type registry. State checks are separate.
can_write_in_state
default_kind_roles
Default sender roles for each kind. The creator passes every role check.
discourse_event
event_requires_room_id
is_builtin_event_type
pack_map
Indexes the packs of a document by pack id for registry materialization.
room_create_event
server_record_hash
server_record_hash_payload
type_define_event
validate_custom_event_type_name
Checks the shape of a custom event type name: lowercase dot-separated, at least two segments, not built-in, not under a reserved prefix.
validate_discourse_envelope
validate_event_against_registry
Validates an event payload: built-in payloads are accepted as-is (use the typed validators for them); custom payloads must satisfy the registry.
validate_message_create_payload
validate_pack_import
validate_room_create_payload
validate_room_join_payload
validate_room_path
validate_room_write
validate_type_declaration
validate_type_def
verify_pack_digest
Verifies a <algorithm>:<base64url-digest> content digest over raw bytes. Supports sha256 and sha3-256.
verify_server_record
verify_server_record_chain

Type Aliases§

RoomCancelPayload
RoomClosePayload
RoomLeavePayload