Versions in this module Expand all Collapse all v1 v1.0.5 Aug 22, 2026 v1.0.4 Aug 22, 2026 Changes in this version + const MaxAgentMessageBytes + var ErrAlreadyCompleted = errors.New("ledger resource already has an authoritative completion") + var ErrIdempotencyConflict = errors.New("ledger idempotency key conflicts with an earlier command") + var ErrNotFound = errors.New("ledger resource not found") + var ErrRevisionConflict = errors.New("ledger current revision does not match the expected revision") + var ErrRoutineNeedsRevalidation = errors.New("Routine needs revalidation") + var ErrRoutineRunTerminal = errors.New("Routine run is already terminal") + var ErrSourceDrift = errors.New("ledger execution source no longer matches the accepted binding") + var ErrStateConflict = errors.New("ledger resource is not in a valid state for the command") + type AcceptAgentRebindCommand struct + AcceptedAt time.Time + AcceptedBy string + IdempotencyKey string + Preview AgentRebindPreview + func (c AcceptAgentRebindCommand) Digest() (string, error) + func (c AcceptAgentRebindCommand) Validate() error + type AcceptHandoffCommand struct + Handoff conversation.Handoff + ParticipantID string + ProjectionConversationIDs []string + RequireCurrentRecipient bool + TargetID string + func (c AcceptHandoffCommand) Digest() (string, error) + func (c AcceptHandoffCommand) Validate() error + type AdvanceRoutineRunCommand struct + AccountID string + Activity string + AttemptID string + FailureCode string + FromState conversation.RoutineRunState + IdempotencyKey string + LeaseExpiresAt time.Time + LeaseID string + NextAction string + NormalizedResult string + OccurredAt time.Time + RunID string + ToState conversation.RoutineRunState + func (c AdvanceRoutineRunCommand) Digest() (string, error) + func (c AdvanceRoutineRunCommand) Validate() error + type AgentBindingAdvanceResult struct + Agent AgentRecord + Transition AgentBindingTransition + type AgentBindingTransition struct + AcceptedAt time.Time + AcceptedBy string + AccountID string + AgentID string + AuthorityEvidence []string + Kind BindingTransitionKind + NonTransferableResources []RebindResource + PreviewDigest string + PreviousBehaviorRevisionID string + PreviousBindingRevisionID string + ReadinessEvidence []string + SuccessorBehaviorRevisionID string + SuccessorBindingRevisionID string + type AgentContextManifest struct + ConversationID string + CreatedAt time.Time + Digest string + ID string + MessageIDs []int64 + ThroughMessageID int64 + type AgentConversationMessage struct + AuthorAgentID string + AuthorID string + AuthorKind conversation.AuthorKind + Body string + ConversationID string + CreatedAt time.Time + ID int64 + TargetID string + TurnID string + type AgentConversationProjection struct + Conversation AgentConversationRecord + Messages []AgentConversationMessage + Targets []AgentConversationTarget + Turns []AgentConversationTurn + type AgentConversationRecord struct + Conversation conversation.Conversation + Link conversation.AgentConversation + Pinned bool + PinnedAt time.Time + type AgentConversationTarget struct + AgentID string + AttemptCount int + BehaviorRevisionID string + BindingRevisionID string + ConversationID string + CreatedAt time.Time + ID string + ParticipantID string + RunID string + State string + TurnID string + UpdatedAt time.Time + type AgentConversationTurn struct + ClientTurnID string + ContextManifestID string + ConversationID string + CreatedAt time.Time + ID string + MembershipRevisionID string + PromptMessageID int64 + State string + ThroughMessageID int64 + type AgentDirectChatRepository interface + CancelAgentTarget func(context.Context, CancelAgentTargetCommand) (AgentConversationTarget, error) + ReadAgentConversation func(context.Context, string, string, string) (AgentConversationProjection, error) + RetryAgentTarget func(context.Context, RetryAgentTargetCommand) (AgentConversationTarget, error) + SendAgentTurn func(context.Context, SendAgentTurnCommand) (AgentTurnDispatch, error) + type AgentLifecycleRepository interface + AcceptAgentRebind func(context.Context, AcceptAgentRebindCommand) (AgentBindingAdvanceResult, error) + AppendAgentBehavior func(context.Context, AppendAgentBehaviorCommand) (AgentBindingAdvanceResult, error) + AppendAgentProfile func(context.Context, AppendAgentProfileCommand) (AgentRecord, error) + CreateSecondaryConversation func(context.Context, CreateSecondaryConversationCommand) (AgentConversationRecord, error) + ListAgentConversations func(context.Context, string, string) ([]AgentConversationRecord, error) + PreviewAgentRebind func(context.Context, PreviewAgentRebindCommand) (AgentRebindPreview, error) + RenameAgentConversation func(context.Context, RenameAgentConversationCommand) (AgentConversationRecord, error) + SetAgentConversationPin func(context.Context, SetAgentConversationPinCommand) (AgentConversationRecord, error) + SetAgentConversationState func(context.Context, SetAgentConversationStateCommand) (AgentConversationRecord, error) + type AgentRebindPreview struct + AccountID string + AgentID string + AuthorityEvidence []string + CurrentBinding conversation.AgentBindingRevision + CurrentExecutionSource conversation.ExecutionSource + CurrentSourceAgent conversation.SourceAgent + Digest string + GeneratedAt time.Time + NonTransferableResources []RebindResource + Participant conversation.Participant + ProposedBinding conversation.AgentBindingRevision + ProposedExecutionSource conversation.ExecutionSource + ProposedSourceAgent conversation.SourceAgent + ReadinessEvidence []string + func (p AgentRebindPreview) CalculateDigest() (string, error) + func (p AgentRebindPreview) Validate() error + type AgentRecord struct + Agent conversation.Agent + Behavior conversation.AgentBehaviorRevision + Binding conversation.AgentBindingRevision + ExecutionSource conversation.ExecutionSource + Home conversation.Conversation + Link conversation.AgentConversation + Participant conversation.Participant + Profile conversation.AgentProfileRevision + SourceAgent conversation.SourceAgent + type AgentRepository interface + Close func() error + CreateAgent func(context.Context, CreateAgentCommand) (AgentRecord, error) + GetAgent func(context.Context, string, string) (AgentRecord, error) + ListAgents func(context.Context, string, conversation.AgentState) ([]AgentRecord, error) + type AgentTurnDispatch struct + Context AgentContextManifest + Created bool + Message AgentConversationMessage + Target AgentConversationTarget + Turn AgentConversationTurn + type AppendAgentBehaviorCommand struct + AcceptedAt time.Time + AcceptedBy string + AccountID string + AgentID string + AuthorityEvidence []string + Behavior conversation.AgentBehaviorRevision + Binding conversation.AgentBindingRevision + ExpectedBehaviorRevisionID string + ExpectedBindingRevisionID string + IdempotencyKey string + Participant conversation.Participant + ReadinessEvidence []string + func (c AppendAgentBehaviorCommand) Digest() (string, error) + func (c AppendAgentBehaviorCommand) Validate() error + type AppendAgentProfileCommand struct + AcceptedBy string + AccountID string + AgentID string + ExpectedProfileRevisionID string + IdempotencyKey string + Revision conversation.AgentProfileRevision + func (c AppendAgentProfileCommand) Digest() (string, error) + func (c AppendAgentProfileCommand) Validate() error + type BindingTransitionKind string + const BindingTransitionBehavior + const BindingTransitionRebind + type CancelAgentTargetCommand struct + AccountID string + AgentID string + CanceledAt time.Time + CanceledBy string + ConversationID string + IdempotencyKey string + TargetID string + func (command CancelAgentTargetCommand) Digest() (string, error) + func (command CancelAgentTargetCommand) Validate() error + type CancelHandoffCommand struct + AccountID string + CanceledAt time.Time + CanceledBy string + HandoffID string + IdempotencyKey string + func (c CancelHandoffCommand) Digest() (string, error) + func (c CancelHandoffCommand) Validate() error + type CollaborationRepository interface + AcceptHandoff func(context.Context, AcceptHandoffCommand) (HandoffRecord, error) + CancelHandoff func(context.Context, CancelHandoffCommand) (HandoffRecord, error) + CompleteHandoff func(context.Context, CompleteHandoffCommand) (HandoffRecord, error) + CreateGroup func(context.Context, CreateGroupCommand) (GroupRecord, error) + CreateHumanHandoff func(context.Context, CreateHumanHandoffCommand) (HandoffRecord, error) + GetGroup func(context.Context, string, string) (GroupRecord, error) + GetHandoff func(context.Context, string, string) (HandoffRecord, error) + ListGroupTurns func(context.Context, string, string) ([]GroupTurnRecord, error) + ListGroups func(context.Context, string, conversation.ConversationState) ([]GroupRecord, error) + ListHandoffs func(context.Context, string) ([]HandoffRecord, error) + RenameGroup func(context.Context, RenameGroupCommand) (GroupRecord, error) + ReplaceGroupMembers func(context.Context, ReplaceGroupMembersCommand) (GroupRecord, error) + SendGroupTurn func(context.Context, SendGroupTurnCommand) (GroupTurnRecord, error) + SetGroupState func(context.Context, SetGroupStateCommand) (GroupRecord, error) + StartHandoff func(context.Context, StartHandoffCommand) (HandoffRecord, error) + type CompleteHandoffCommand struct + AccountID string + AttemptID string + AuthorAgentID string + Body string + CreatedAt time.Time + FenceToken string + HandoffID string + IdempotencyKey string + LeaseID string + TerminalReceiptID string + func (c CompleteHandoffCommand) Digest() (string, error) + func (c CompleteHandoffCommand) Validate() error + type CreateAgentCommand struct + Agent conversation.Agent + Behavior conversation.AgentBehaviorRevision + Binding conversation.AgentBindingRevision + ExecutionSource conversation.ExecutionSource + Home conversation.Conversation + IdempotencyKey string + Link conversation.AgentConversation + Participant conversation.Participant + Profile conversation.AgentProfileRevision + SourceAgent conversation.SourceAgent + func (c CreateAgentCommand) Digest() (string, error) + func (c CreateAgentCommand) Validate() error + type CreateGroupCommand struct + Conversation conversation.Conversation + Group conversation.GroupConversation + IdempotencyKey string + MemberBindings []conversation.GroupRecipient + Membership conversation.GroupMembershipRevision + func (c CreateGroupCommand) Digest() (string, error) + func (c CreateGroupCommand) Validate() error + type CreateHumanHandoffCommand struct + AccountID string + ContextMessageIDs []string + CreatedAt time.Time + CreatedByID string + HandoffID string + HardDeadline time.Time + IdempotencyKey string + RecipientAgentID string + ReplyToMessageID string + RequestedResult string + RootDelegationGrantID string + SourceConversationID string + SourceMessageID string + TargetID string + func (c CreateHumanHandoffCommand) Digest() (string, error) + func (c CreateHumanHandoffCommand) Validate() error + type CreateRoutineCommand struct + IdempotencyKey string + Revision conversation.RoutineRevision + Routine conversation.Routine + func (c CreateRoutineCommand) Digest() (string, error) + func (c CreateRoutineCommand) Validate() error + type CreateSecondaryConversationCommand struct + AccountID string + AgentID string + Conversation conversation.Conversation + CreatedBy string + IdempotencyKey string + Link conversation.AgentConversation + func (c CreateSecondaryConversationCommand) Digest() (string, error) + func (c CreateSecondaryConversationCommand) Validate() error + type EnqueueRoutineOccurrenceCommand struct + AccountID string + ApprovalEvidenceID string + CreatedAt time.Time + IdempotencyKey string + Kind conversation.RoutineRunKind + OccurrenceID string + RoutineID string + RoutineRevisionID string + RunID string + ScheduledFor time.Time + func (c EnqueueRoutineOccurrenceCommand) Digest() (string, error) + func (c EnqueueRoutineOccurrenceCommand) Validate() error + type ExecutionSourceConfigObservation struct + AccountID string + ExecutionSourceID string + ID string + ObservedAt time.Time + ObservedBy string + Sequence int64 + SourceConfigDigest string + type ExecutionSourceConfigObservationRepository interface + LatestExecutionSourceConfigObservation func(context.Context, string, string) (ExecutionSourceConfigObservation, error) + ObserveExecutionSourceConfig func(context.Context, ObserveExecutionSourceConfigCommand) (ExecutionSourceConfigObservation, error) + type GroupRecord struct + Conversation conversation.Conversation + Group conversation.GroupConversation + MemberBindings []conversation.GroupRecipient + Membership conversation.GroupMembershipRevision + type GroupTurnRecord struct + Envelope conversation.GroupTurnEnvelope + InitialTargets []InitialTargetRecord + Message conversation.Message + Recipients []conversation.GroupRecipient + type HandoffAttemptRecord struct + CompletedAt time.Time + FenceToken string + HandoffID string + ID string + LeaseExpiresAt time.Time + LeaseID string + MachineID string + StartedAt time.Time + State HandoffAttemptState + TerminalReceiptID string + type HandoffAttemptState string + const HandoffAttemptCanceled + const HandoffAttemptCompleted + const HandoffAttemptFailed + const HandoffAttemptWorking + type HandoffCancellationRecord struct + AgentID string + BehaviorRevisionID string + BindingRevisionID string + HandoffID string + ParticipantID string + RequestedAt time.Time + RequestedBy string + State HandoffCancellationState + TargetID string + type HandoffCancellationState string + const HandoffCancellationCanceled + const HandoffCancellationRequested + type HandoffRecord struct + Attempt *HandoffAttemptRecord + Cancellation *HandoffCancellationRecord + Handoff conversation.Handoff + Projections []conversation.HandoffProjection + Result *conversation.HandoffResult + Target HandoffTargetRecord + type HandoffTargetRecord struct + AgentID string + BehaviorRevisionID string + BindingRevisionID string + ConversationID string + CreatedAt time.Time + HandoffID string + ID string + ParticipantID string + State conversation.TargetState + type ImportRoutineCommand struct + Create CreateRoutineCommand + Receipt RoutineImportReceipt + func (c ImportRoutineCommand) Digest() (string, error) + func (c ImportRoutineCommand) Validate(projection SourceRoutineProjection) error + type InitialTargetRecord struct + CreatedAt time.Time + ID string + State conversation.TargetState + type ObserveExecutionSourceConfigCommand struct + AccountID string + ExecutionSourceID string + IdempotencyKey string + ObservationID string + ObservedAt time.Time + ObservedBy string + SourceConfigDigest string + func (command ObserveExecutionSourceConfigCommand) Digest() (string, error) + func (command ObserveExecutionSourceConfigCommand) Validate() error + type PreviewAgentRebindCommand struct + AccountID string + AgentID string + AuthorityEvidence []string + Binding conversation.AgentBindingRevision + ExecutionSource conversation.ExecutionSource + ExpectedBindingRevisionID string + GeneratedAt time.Time + NonTransferableResources []RebindResource + Participant conversation.Participant + ReadinessEvidence []string + SourceAgent conversation.SourceAgent + func (c PreviewAgentRebindCommand) Validate() error + type RebindResource string + const RebindResourceFiles + const RebindResourceSessions + const RebindResourceSkills + const RebindResourceSourceMemory + const RebindResourceToolState + type RenameAgentConversationCommand struct + AccountID string + AgentID string + ChangedAt time.Time + ChangedBy string + ConversationID string + ExpectedTitle string + IdempotencyKey string + Title string + func (c RenameAgentConversationCommand) Digest() (string, error) + func (c RenameAgentConversationCommand) Validate() error + type RenameGroupCommand struct + AccountID string + ChangedAt time.Time + ChangedBy string + ExpectedTitle string + GroupID string + IdempotencyKey string + Title string + func (c RenameGroupCommand) Digest() (string, error) + func (c RenameGroupCommand) Validate() error + type ReplaceGroupMembersCommand struct + AccountID string + ChangedAt time.Time + ChangedBy string + ExpectedMembershipRevisionID string + GroupID string + IdempotencyKey string + MemberBindings []conversation.GroupRecipient + Membership conversation.GroupMembershipRevision + func (c ReplaceGroupMembersCommand) Digest() (string, error) + func (c ReplaceGroupMembersCommand) Validate() error + type RetryAgentTargetCommand struct + AccountID string + AgentID string + ConversationID string + IdempotencyKey string + RetriedAt time.Time + RetriedBy string + TargetID string + func (command RetryAgentTargetCommand) Digest() (string, error) + func (command RetryAgentTargetCommand) Validate() error + type RevalidateRoutineCommand struct + AccountID string + IdempotencyKey string + Revision conversation.RoutineRevision + RoutineID string + func (c RevalidateRoutineCommand) Digest() (string, error) + func (c RevalidateRoutineCommand) Validate(record RoutineRecord) error + type RoutineImportReceipt struct + AccountID string + ExactLastSourceOccurrenceAt time.Time + ExactNextSourceOccurrenceAt time.Time + FencingReceiptCiphertext []byte + FencingReceiptDigest string + FencingReceiptKeyID string + FencingReceiptNonce []byte + ID string + ImportedAt time.Time + RoutineID string + RoutineRevisionID string + SourceDisabledAt time.Time + SourceRoutineProjectionID string + func (r RoutineImportReceipt) Validate() error + type RoutineOccurrence struct + AccountID string + ApprovalEvidenceID string + CreatedAt time.Time + ID string + IdempotencyKey string + Kind conversation.RoutineRunKind + RoutineID string + RoutineRevisionID string + ScheduledFor time.Time + State conversation.RoutineRunState + UpdatedAt time.Time + type RoutinePauseReason string + const RoutinePauseNeedsRevalidation + type RoutineRecord struct + CurrentRevision conversation.RoutineRevision + ImportReceipt *RoutineImportReceipt + PauseReason RoutinePauseReason + Routine conversation.Routine + type RoutineRepository interface + AdvanceRoutineRun func(context.Context, AdvanceRoutineRunCommand) (RoutineRunRecord, error) + CreateRoutine func(context.Context, CreateRoutineCommand) (RoutineRecord, error) + EnqueueRoutineOccurrence func(context.Context, EnqueueRoutineOccurrenceCommand) (RoutineRunRecord, error) + GetRoutine func(context.Context, string, string) (RoutineRecord, error) + GetRoutineRun func(context.Context, string, string) (RoutineRunRecord, error) + ImportSourceRoutine func(context.Context, ImportRoutineCommand) (RoutineRecord, error) + ListRoutineRuns func(context.Context, string, string) ([]RoutineRunRecord, error) + ListRoutines func(context.Context, string, string) ([]RoutineRecord, error) + ListSourceRoutineProjections func(context.Context, string, string) ([]SourceRoutineProjection, error) + RecordSourceRoutineProjection func(context.Context, SourceRoutineProjection) (SourceRoutineProjection, error) + RevalidateRoutine func(context.Context, RevalidateRoutineCommand) (RoutineRecord, error) + type RoutineRunActivity struct + Activity string + AttemptID string + CreatedAt time.Time + FailureCode string + LeaseExpiresAt time.Time + LeaseID string + NextAction string + Sequence int64 + State conversation.RoutineRunState + type RoutineRunRecord struct + Activities []RoutineRunActivity + AttemptID string + FailureCode string + LeaseExpiresAt time.Time + LeaseID string + NextAction string + Occurrence RoutineOccurrence + ResultConversationID string + Run conversation.RoutineRun + type SendAgentTurnCommand struct + AccountID string + AgentID string + Body string + ClientTurnID string + ContextManifestID string + ConversationID string + CreatedAt time.Time + CreatedBy string + DelegationGrantID string + HardDeadline time.Time + HumanID string + IdempotencyKey string + RunID string + TargetID string + TurnID string + func (command SendAgentTurnCommand) Digest() (string, error) + func (command SendAgentTurnCommand) Validate() error + type SendGroupTurnCommand struct + AccountID string + Body string + Envelope conversation.GroupTurnEnvelope + HumanID string + TargetIDs []string + func (c SendGroupTurnCommand) Digest() (string, error) + func (c SendGroupTurnCommand) Validate(group conversation.GroupConversation, ...) error + type SetAgentConversationPinCommand struct + AccountID string + AgentID string + ChangedAt time.Time + ChangedBy string + ConversationID string + ExpectedPinned bool + IdempotencyKey string + Pinned bool + func (c SetAgentConversationPinCommand) Digest() (string, error) + func (c SetAgentConversationPinCommand) Validate() error + type SetAgentConversationStateCommand struct + AccountID string + AgentID string + ChangedAt time.Time + ChangedBy string + ConversationID string + ExpectedState conversation.ConversationState + IdempotencyKey string + State conversation.ConversationState + func (c SetAgentConversationStateCommand) Digest() (string, error) + func (c SetAgentConversationStateCommand) Validate() error + type SetGroupStateCommand struct + AccountID string + ChangedAt time.Time + ChangedBy string + ExpectedState conversation.ConversationState + GroupID string + IdempotencyKey string + State conversation.ConversationState + func (c SetGroupStateCommand) Digest() (string, error) + func (c SetGroupStateCommand) Validate() error + type SourceRoutineProjection struct + AccountID string + ExecutionSourceID string + ID string + LastOccurrenceAt time.Time + NextOccurrenceAt time.Time + ObservedAt time.Time + OpaqueSourceRoutineID string + ProjectionDigest string + ProjectionRevision int + ScheduleSnapshot json.RawMessage + func (p SourceRoutineProjection) Validate() error + type StartHandoffCommand struct + AccountID string + AttemptID string + FenceToken string + HandoffID string + IdempotencyKey string + LeaseExpiresAt time.Time + LeaseID string + MachineID string + StartedAt time.Time + func (c StartHandoffCommand) Digest() (string, error) + func (c StartHandoffCommand) Validate() error