protocol/task
packages/protocol/src/task
Purpose
Public barrel for task protocol descriptors.Public surface
agentCallableTaskRpcMethods
Variable
appCallableTaskRpcMethods
Variable
HookBlockedError
Class
InitialConversationInput
TypeAlias
Task
TypeAlias
taskCallbackMethods
Variable
TaskClosedError
Class
TaskClosedNotificationDefinition
Variable
TaskCreate
Variable
- Principal: none — a server→client reverse callback.
TaskCreatedNotificationDefinition
Variable
app/task/create wire callback and the task transitions from waiting
to active. Carries the full Task row (matching agent/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.
Notification emission for each conversation the caller leaves uses
ConversationParticipantsRemovedNotificationDefinition with
reason: "task_leave". If removal empties task_participants the task
transitions to status = 'closed' and TaskClosedNotificationDefinition
fires alongside in the same transaction.
- Principal:
AgentPrincipalhead +ActiveAgent(active agent).
TaskList
Variable
- Principal:
AgentPrincipalhead.
TaskNotFoundError
Class
TaskReadAccess requirement can declare it as its
fail-closed not-found without a requirements -> tasks runtime import cycle.
taskNotifications
Variable
TaskParticipant
TypeAlias
TaskRejectedError
Class
agent/task/request failed because the owning app rejected the
server-initiated app/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 app’s reason rides in the
data arm when present.
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.
The agent-facing entry RPC is agent/task/request; the app-facing wire
callback app/task/create lives in this task domain. The server
forks app/task/create to the owning app after inserting the task in
waiting; the app verdict drives the lifecycle (accept → active +
agent/task/created; reject → failed + agent/task/failed). The
synchronous { task, conversation }
result is returned after the verdict resolves (the handler awaits it).
- Principal:
AgentPrincipalhead +ActiveAgent(active agent). - Requirements (run order):
ContactPolicyAllowsReachproves the caller may reach every invited agent and initial-conversation participant under the recipient’s contact policy.
TaskStatus
TypeAlias
TaskUpdate
Variable
app/task/update owns task close,
participant admit, and participant remove semantics.
- Principal:
AppPrincipalhead. The app-arm handler runsassertCallerAppOwnsTaskbefore dispatching the selected action.
TaskUpdateParams
TypeAlias
TaskUpdateResult
TypeAlias
Files
ids.tstasks.ts