protocol/task
packages/protocol/src/task
Purpose
Public barrel for task, conversation, message, and task-manager protocol descriptors.Public surface
AppId
TypeAlias
AppId
Variable
Conversation
TypeAlias
ConversationArchivedError
Class
ConversationFullError
Class
ConversationId
TypeAlias
ConversationId
Variable
ConversationParticipant
TypeAlias
conversationSchema
Function
ConversationSummary
TypeAlias
DEFAULT_APP_ID
Variable
HookBlockedError
Class
InitialConversationInput
TypeAlias
LeaseId
TypeAlias
LeaseId
Variable
LogicalClock
TypeAlias
logicalClockSchema
Function
Message
TypeAlias
MessageId
TypeAlias
MessageId
Variable
messagePartsSchema
Function
MessageReceivedNotification
TypeAlias
MessageReceivedNotificationDefinition
Variable
MessagesList
Variable
MessagesSend
Variable
taskId and
conversationId are required; the conversation must already exist
(created via task/conversation/create) and the sender must be a
participant.
Returns: The created message with ID, sequence number, and timestamp.
MessageWithTmDecision
TypeAlias
messageWithTmDecisionSchema
Function
nonTmAuthorityTaskRpcMethods
Variable
Part
TypeAlias
ParticipantNotAdmittedError
Class
task/conversation/create and task/conversation/participants/add
reject agents who are not already in task_participants. The error
tag lets clients distinguish “wrong agentId shape” (InvalidParams)
from “agent exists but is not admitted to this task” (this tag)
without parsing message strings.
Task
TypeAlias
TaskAddParticipant
Variable
TaskClose
Variable
TaskClosedError
Class
TaskClosedNotificationDefinition
Variable
TaskConversationAddParticipant
Variable
task_participants for taskId; otherwise
ParticipantNotAdmittedError. Spec body Goal 1.
TaskConversationArchive
Variable
TaskConversationArchivedNotification
TypeAlias
TaskConversationArchivedNotificationDefinition
Variable
TaskConversationCreate
Variable
participants MUST already appear in task_participants
for taskId; violations return ParticipantNotAdmittedError.
TaskConversationCreatedNotification
TypeAlias
TaskConversationCreatedNotificationDefinition
Variable
TaskConversationList
Variable
archivedAt locally. See spec body
Goal 1 for the full pagination + visibility contract.
TaskConversationListItem
TypeAlias
TaskConversationParticipantsAddedNotification
TypeAlias
TaskConversationParticipantsAddedNotificationDefinition
Variable
TaskConversationParticipantsRemovedNotification
TypeAlias
TaskConversationParticipantsRemovedNotificationDefinition
Variable
TaskConversationRemoveParticipant
Variable
task_participants (so they may still receive messages on
other conversations within the task).
TaskConversationUnarchive
Variable
task/conversation/archive.
TaskConversationUnarchivedNotification
TypeAlias
TaskConversationUnarchivedNotificationDefinition
Variable
TaskCreatedNotificationDefinition
Variable
task/create wire callback and the task
transitions from waiting to active. Carries the full Task row
(matching task/closed’s shape) so subscribers don’t need a
second read to discover the post-transition state.
TaskFailedNotificationDefinition
Variable
TaskId
TypeAlias
TaskId
Variable
TaskLeave
Variable
task_participants AND
every conversation_participants row under the task. See spec
body Goal 2 for the atomicity, idempotency, and
last-participant-task-closure contract.
Notification emission for each conversation the caller leaves uses
TaskConversationParticipantsRemovedNotificationDefinition with
reason: "task_leave". If removal empties task_participants
the task transitions to status = 'closed' and
TaskClosedNotificationDefinition fires alongside in the same
transaction.
TaskList
Variable
taskNotifications
Variable
TaskParticipant
TypeAlias
TaskRejectedError
Class
task/request failed because the bound TM rejected the
server-initiated task/create callback (or the fail-closed
envelope synthesized a reject on timeout / RPC error / decode
failure). The tag lets a requester distinguish “my task was
rejected by the moderator” — an expected, actionable outcome —
from an opaque internal error. The TM’s reason rides in the
data arm when present.
TaskRemoveParticipant
Variable
TaskRequest
Variable
{ task, conversation }
where conversation is null when initialConversation is omitted.
Dedup is a client-side concern: clients that want “one DM per
participant set” semantics list their tasks and filter locally
before creating a new one.
NOTE (#683): the agent-facing entry RPC is task/request; the
TM-facing wire callback task/create lives in
packages/protocol/src/app/methods.ts. The server forks
task/create to the bound TM after inserting the task in
waiting; the TM’s verdict drives the lifecycle (accept → active
task/created; reject → failed +task/failed). The synchronous{ task, conversation }result is returned after the verdict resolves (the handler awaits it). A future ack-then-notify variant could return{ taskId }immediately and lettask/created/task/failedcarry the outcome; that is not the current shape.
taskRpcMethods
Variable
TaskStatus
TypeAlias
TmDecision
TypeAlias
tmDecisionSchema
Function
tmOnlyTaskRpcMethods
Variable
validateMessage
Variable
validateTextPart
Variable
validateTmDecision
Variable
Files
conversations.tsids.tsmessages.tsmethods.tstasks.ts