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 CloudWriteAuthorityMode + const DefaultScheduleCatchUp + const DefaultScheduleLookAhead + const DefaultWorkerLease + const MaximumArtifactChunkPlaintextBytes + const MaximumArtifactChunks + const MaximumArtifactEncodedBytes + const MaximumArtifactPlaintextBytes + const MaximumCursorPageBytes + const MaximumExpiredWorkerLeaseRecoveries + const MaximumFunctionBodyBytes + const MaximumLateRoutineRunExpirations + const MaximumScheduleLateness + const MaximumScheduleOccurrences + const MaximumScheduleRoutines + const MaximumWorkerContextCursorBytes + const MaximumWorkerContextPageEncodedBytes + const MaximumWorkerContextPageItems + const ServiceAssertionHeader + const WorkerAccountHeader + const WorkerContextArtifactKind + const WorkerContextMessageKind + const WorkerIDHeader + const WorkerMachineHeader + const WorkerOutputMessageRecordType + var ErrAssertionAudience = errors.New("service assertion audience mismatch") + var ErrAssertionConfiguration = errors.New("service assertion configuration invalid") + var ErrAssertionDigest = errors.New("service assertion request digest mismatch") + var ErrAssertionExpired = errors.New("service assertion expired") + var ErrAssertionInvalid = errors.New("service assertion invalid") + var ErrAssertionNonceStore = errors.New("service assertion nonce store unavailable") + var ErrAssertionNotYetValid = errors.New("service assertion not yet valid") + var ErrAssertionReplay = errors.New("service assertion replayed") + var ErrAssertionRoute = errors.New("service assertion route mismatch") + var ErrAssertionSignature = errors.New("service assertion signature invalid") + var ErrNoEligibleAgentOption = errors.New("no approved eligible Agent option") + var ErrScheduleClockNotMonotonic = errors.New("schedule tick clock is not monotonic") + var ErrScheduleTickBoundExceeded = errors.New("schedule tick bound exceeded") + var ErrWorkerArtifactIncomplete = errors.New("worker artifact is incomplete") + var ErrWorkerContextPageLimit = errors.New("worker context page exceeds payload limit") + var ErrWorkerIdempotencyConflict = errors.New("worker idempotency key conflicts") + var ErrWorkerNoCompatibleTarget = errors.New("worker target is not compatible") + var ErrWorkerNotFound = errors.New("worker not found") + var ErrWorkerRequestInvalid = errors.New("worker request is invalid") + var ErrWorkerRevoked = errors.New("worker credential revoked") + var ErrWorkerStaleLease = errors.New("worker lease or fence is stale") + func AccountIDFromContext(ctx context.Context) (string, bool) + func AgentCanonicalConversationHandler(repository AgentConversationReader) http.Handler + func AgentConversationCreateHandler(repository AgentConversationCreateRepository, clock func() time.Time) http.Handler + func AgentConversationMutationHandler(repository AgentConversationMutationRepository, clock func() time.Time) http.Handler + func AgentConversationProjectionHandler(repository ReadAgentConversationRepository) http.Handler + func AgentConversationTurnsHandler(repository SendAgentTurnRepository, clock func() time.Time) http.Handler + func AgentConversationsHandler(repository AgentConversationReader) http.Handler + func AgentCreateHandler(repository AgentCreateRepository, resolver AgentOptionResolver, ...) http.Handler + func AgentDetailHandler(repository AgentReader) http.Handler + func AgentMutationHandler(repository AgentMutationRepository, clock func() time.Time) http.Handler + func AgentRebindHandler(repository AgentRebindRepository, resolver AgentOptionResolver, ...) http.Handler + func AgentTargetCancelHandler(repository CancelAgentTargetRepository, clock func() time.Time) http.Handler + func AgentTargetRetryHandler(repository RetryAgentTargetRepository, clock func() time.Time) http.Handler + func AgentsHandler(repository AgentLister) http.Handler + func CloudWriteAuthorityActive(getenv func(string) string) bool + func CronHandler(config CronHandlerConfig, provider ScheduleTickerProvider) http.Handler + func CursorHandler(reader CursorReader) http.Handler + func GroupCreateHandler(repository GroupCreateRepository, clock func() time.Time) http.Handler + func GroupDetailHandler(repository GroupDetailRepository) http.Handler + func GroupMembersHandler(repository GroupMembersRepository, clock func() time.Time) http.Handler + func GroupMutationHandler(repository GroupMutationRepository, clock func() time.Time) http.Handler + func GroupTurnsHandler(repository GroupTurnRepository, clock func() time.Time) http.Handler + func GroupsHandler(repository GroupLister) http.Handler + func HandoffCancelHandler(repository HandoffCancelRepository, clock func() time.Time) http.Handler + func HandoffCreateHandler(repository HandoffCreateRepository, clock func() time.Time) http.Handler + func HandoffDetailHandler(repository HandoffDetailRepository) http.Handler + func HandoffsHandler(repository HandoffListRepository) http.Handler + func HealthHandler(info BuildInfo) http.Handler + func IssueServiceAssertion(key []byte, assertion ServiceAssertion) (string, error) + func RequireServiceAssertion(verifier ServiceAssertionVerifier, routeClass string, next http.Handler) http.Handler + func RoutineMutationHandler(repository RoutineOwnerRepository, clock func() time.Time) http.Handler + func RoutineRunsHandler(repository RoutineOwnerRepository) http.Handler + func RoutineTestHandler(repository RoutineOwnerRepository, clock func() time.Time) http.Handler + func RoutinesHandler(repository RoutineOwnerRepository, clock func() time.Time) http.Handler + func WorkerHandler(repository WorkerRepository, clock func() time.Time) http.Handler + func WorkerOutputMessageRecordID(targetID, executionAttemptID string, fenceToken int64) string + type AgentConversationCreateRepository interface + CreateSecondaryConversation func(context.Context, ledger.CreateSecondaryConversationCommand) (ledger.AgentConversationRecord, error) + type AgentConversationMutationRepository interface + RenameAgentConversation func(context.Context, ledger.RenameAgentConversationCommand) (ledger.AgentConversationRecord, error) + SetAgentConversationPin func(context.Context, ledger.SetAgentConversationPinCommand) (ledger.AgentConversationRecord, error) + SetAgentConversationState func(context.Context, ledger.SetAgentConversationStateCommand) (ledger.AgentConversationRecord, error) + type AgentConversationReader interface + ListAgentConversations func(context.Context, string, string) ([]ledger.AgentConversationRecord, error) + type AgentCreateRepository interface + CreateAgent func(context.Context, ledger.CreateAgentCommand) (ledger.AgentRecord, error) + type AgentDirectChatRepository interface + type AgentLifecycleCommandRepository interface + type AgentLister interface + ListAgents func(context.Context, string, conversation.AgentState) ([]ledger.AgentRecord, error) + type AgentMutationRepository interface + AppendAgentBehavior func(context.Context, ledger.AppendAgentBehaviorCommand) (ledger.AgentBindingAdvanceResult, error) + AppendAgentProfile func(context.Context, ledger.AppendAgentProfileCommand) (ledger.AgentRecord, error) + GetAgent func(context.Context, string, string) (ledger.AgentRecord, error) + type AgentOptionResolver interface + ResolveEligibleAgentOption func(context.Context, string, string) (EligibleAgentOption, error) + func NoEligibleAgentOptions() AgentOptionResolver + type AgentReader interface + GetAgent func(context.Context, string, string) (ledger.AgentRecord, error) + type AgentRebindRepository interface + AcceptAgentRebind func(context.Context, ledger.AcceptAgentRebindCommand) (ledger.AgentBindingAdvanceResult, error) + GetAgent func(context.Context, string, string) (ledger.AgentRecord, error) + PreviewAgentRebind func(context.Context, ledger.PreviewAgentRebindCommand) (ledger.AgentRebindPreview, error) + type BuildInfo struct + APIMaxVersion int + APIMinVersion int + AuthorityEpoch int64 + AuthorityMode string + Commit string + SchemaVersion string + type CancelAgentTargetRepository interface + CancelAgentTarget func(ctx context.Context, command ledger.CancelAgentTargetCommand) (ledger.AgentConversationTarget, error) + type CronHandlerConfig struct + AccountID string + AuthorityMode string + SchedulerID string + Secret string + type CursorEvent struct + Cursor string + Data any + Kind string + type CursorPage struct + Events []CursorEvent + NextCursor string + type CursorReader interface + ReadCursorPage func(context.Context, string, string) (CursorPage, error) + type EligibleAgentOption struct + AuthorityEvidence []string + Binding conversation.AgentBindingRevision + ExecutionSource conversation.ExecutionSource + ID string + NonTransferableResources []ledger.RebindResource + ReadinessEvidence []string + SourceAgent conversation.SourceAgent + type EncryptedEnvelope struct + Ciphertext []byte + Digest string + KeyID string + Nonce []byte + PlaintextLength int + type GroupCreateRepository interface + CreateGroup func(context.Context, ledger.CreateGroupCommand) (ledger.GroupRecord, error) + GetAgent func(context.Context, string, string) (ledger.AgentRecord, error) + type GroupDetailRepository interface + GetGroup func(context.Context, string, string) (ledger.GroupRecord, error) + ListGroupMessages func(context.Context, string, string) ([]ledger.AgentConversationMessage, error) + ListGroupTurns func(context.Context, string, string) ([]ledger.GroupTurnRecord, error) + type GroupLister interface + ListGroups func(context.Context, string, conversation.ConversationState) ([]ledger.GroupRecord, error) + type GroupMembersRepository interface + GetAgent func(context.Context, string, string) (ledger.AgentRecord, error) + GetGroup func(context.Context, string, string) (ledger.GroupRecord, error) + ReplaceGroupMembers func(context.Context, ledger.ReplaceGroupMembersCommand) (ledger.GroupRecord, error) + type GroupMutationRepository interface + RenameGroup func(context.Context, ledger.RenameGroupCommand) (ledger.GroupRecord, error) + SetGroupState func(context.Context, ledger.SetGroupStateCommand) (ledger.GroupRecord, error) + type GroupTurnRepository interface + GetAgent func(context.Context, string, string) (ledger.AgentRecord, error) + GetGroup func(context.Context, string, string) (ledger.GroupRecord, error) + SendGroupTurn func(context.Context, ledger.SendGroupTurnCommand) (ledger.GroupTurnRecord, error) + type HandoffCancelRepository interface + CancelHandoff func(context.Context, ledger.CancelHandoffCommand) (ledger.HandoffRecord, error) + type HandoffCreateRepository interface + CreateHumanHandoff func(context.Context, ledger.CreateHumanHandoffCommand) (ledger.HandoffRecord, error) + type HandoffDetailRepository interface + GetHandoff func(context.Context, string, string) (ledger.HandoffRecord, error) + type HandoffListRepository interface + ListHandoffs func(context.Context, string) ([]ledger.HandoffRecord, error) + type HumanHandoffRepository interface + type MachineCredential struct + AccountID string + MachineID string + State MachineCredentialState + TokenHash string + WorkerID string + type MachineCredentialState string + const MachineCredentialEnrolled + const MachineCredentialOffline + const MachineCredentialRevoked + type NonceClaimer interface + Claim func(context.Context, string, string, string, time.Time) (bool, error) + type ReadAgentConversationRepository interface + ReadAgentConversation func(ctx context.Context, accountID, agentID, conversationID string) (ledger.AgentConversationProjection, error) + type RebindAcceptanceGrant struct + AccountID string + AgentID string + Audience string + ExpiresAt time.Time + IssuedAt time.Time + OptionID string + Preview ledger.AgentRebindPreview + Route string + type RebindAcceptanceTokens interface + Issue func(RebindAcceptanceGrant) (string, time.Time, error) + Verify func(string, time.Time) (RebindAcceptanceGrant, error) + func HMACRebindAcceptanceTokensFromEnvironment(getenv func(string) string) (RebindAcceptanceTokens, error) + func NewHMACRebindAcceptanceTokens(key []byte, ttl time.Duration) (RebindAcceptanceTokens, error) + type RetryAgentTargetRepository interface + RetryAgentTarget func(ctx context.Context, command ledger.RetryAgentTargetCommand) (ledger.AgentConversationTarget, error) + type RoutineOccurrence struct + IdempotencyKey string + OccurrenceID string + RecordedAt time.Time + RoutineID string + RoutineRevisionID string + ScheduledFor time.Time + State RoutineOccurrenceState + type RoutineOccurrenceState string + const OccurrenceMissedNeedsAttention + const OccurrenceQueued + const OccurrenceScheduled + type RoutineOwnerRepository interface + CreateRoutine func(context.Context, ledger.CreateRoutineCommand) (ledger.RoutineRecord, error) + EnqueueRoutineOccurrence func(context.Context, ledger.EnqueueRoutineOccurrenceCommand) (ledger.RoutineRunRecord, error) + GetRoutine func(context.Context, string, string) (ledger.RoutineRecord, error) + ListRoutineRuns func(context.Context, string, string) ([]ledger.RoutineRunRecord, error) + ListRoutines func(context.Context, string, string) ([]ledger.RoutineRecord, error) + RevalidateRoutine func(context.Context, ledger.RevalidateRoutineCommand) (ledger.RoutineRecord, error) + type RoutineSchedule struct + Expression string + RoutineID string + RoutineRevisionID string + StartsAt time.Time + Timezone string + type ScheduleRepository interface + WithScheduleTick func(context.Context, string, string, func(ScheduleTickTransaction) error) (acquired bool, err error) + type ScheduleTickResult struct + ExpiredLeasesRecovered int + InvalidRoutinesSkipped int + LateRoutineRunsExpired int + OccurrencesChanged int + Status string + TickID string + Watermark time.Time + type ScheduleTickService struct + Clock func() time.Time + Repository ScheduleRepository + TickIDs func() string + func (service ScheduleTickService) Tick(ctx context.Context, accountID, schedulerID string) (ScheduleTickResult, error) + type ScheduleTickTransaction interface + ActiveRoutineSchedules func(context.Context, int) ([]RoutineSchedule, error) + ApplyOccurrence func(context.Context, RoutineOccurrence) (bool, error) + ExpireLateRoutineRuns func(context.Context, time.Time, int) (int, error) + RecoverExpiredWorkerLeases func(context.Context, time.Time, int) (int, error) + SaveWatermark func(context.Context, string, string, time.Time) error + Watermark func(context.Context, string) (time.Time, bool, error) + type ScheduleTicker interface + Tick func(context.Context, string, string) (ScheduleTickResult, error) + type ScheduleTickerProvider func(context.Context) (ScheduleTicker, error) + type SendAgentTurnRepository interface + SendAgentTurn func(ctx context.Context, command ledger.SendAgentTurnCommand) (ledger.AgentTurnDispatch, error) + type ServiceAssertion struct + AccountID string + Audience string + ExpiresAt time.Time + IssuedAt time.Time + KeyID string + Nonce string + RequestDigest string + RouteClass string + type ServiceAssertionVerifier struct + Audience string + Clock func() time.Time + ClockSkew time.Duration + Keys map[string][]byte + MaxTTL time.Duration + Nonces NonceClaimer + func ServiceAssertionVerifierFromEnvironment(getenv func(string) string, nonces NonceClaimer) (ServiceAssertionVerifier, error) + func (verifier ServiceAssertionVerifier) Verify(ctx context.Context, token string, routeClass string, requestDigest string) (ServiceAssertion, error) + type WorkerArtifact struct + ArtifactID string + Chunks []WorkerArtifactChunk + Created bool + CreatedAt time.Time + EncryptionKeyID string + ExecutionAttemptID string + ExpectedChunkCount int + ExpectedEncodedLength int64 + ExpectedPlaintextLength int64 + FinalizedAt *time.Time + Kind string + LogicalDigest string + State string + type WorkerArtifactChunk struct + ArtifactID string + AuthenticatedDigest string + ChunkIndex int + Created bool + CreatedAt time.Time + EncodedLength int + EncryptionKeyID string + PlaintextLength int + type WorkerArtifactChunkCommand struct + AccountID string + ArtifactID string + AuthenticatedDigest string + ChunkIndex int + Ciphertext []byte + CreatedAt time.Time + EncodedLength int + EncryptionKeyID string + ExecutionAttemptID string + FenceToken int64 + IdempotencyKey string + LeaseID string + MachineID string + Nonce []byte + Plaintext []byte + PlaintextDigest string + PlaintextLength int + TargetID string + WorkerID string + type WorkerArtifactCreateCommand struct + AccountID string + ArtifactID string + CreatedAt time.Time + EncryptionKeyID string + ExecutionAttemptID string + ExpectedChunkCount int + ExpectedEncodedLength int64 + ExpectedPlaintextLength int64 + FenceToken int64 + IdempotencyKey string + LeaseID string + LogicalDigest string + MachineID string + TargetID string + WorkerID string + type WorkerArtifactFinalizeCommand struct + AccountID string + ArtifactID string + ExecutionAttemptID string + FenceToken int64 + FinalizedAt time.Time + IdempotencyKey string + LeaseID string + MachineID string + TargetID string + WorkerID string + type WorkerArtifactStatusCommand struct + AccountID string + ArtifactID string + ExecutionAttemptID string + FenceToken int64 + IdempotencyKey string + LeaseID string + MachineID string + ObservedAt time.Time + TargetID string + WorkerID string + type WorkerAssignment struct + CapabilityRevisionID string + ClaimedAt time.Time + ContextManifestID string + Execution WorkerExecutionBinding + ExecutionAttemptID string + ExpiresAt time.Time + FenceToken int64 + HardDeadline time.Time + InlineOutputPlaintextBytes int64 + LeaseID string + MachineID string + MaximumOutputPlaintextBytes int64 + OriginID string + OutputAuthorAgentID string + OutputConversationID string + OutputMessageKind string + Pins coreworker.ExecutionPins + Prompt string + PromptEnvelope EncryptedEnvelope + TargetID string + TargetKind string + WorkerID string + type WorkerCancellationAck struct + AcknowledgedAt time.Time + AcknowledgementID string + ExecutionAttemptID string + FenceToken int64 + LeaseID string + TargetID string + type WorkerCancellationAckCommand struct + AccountID string + AcknowledgedAt time.Time + AcknowledgementID string + ExecutionAttemptID string + FenceToken int64 + IdempotencyKey string + LeaseID string + MachineID string + TargetID string + WorkerID string + type WorkerClaimCommand struct + AccountID string + CapabilityRevisionID string + ClaimedAt time.Time + ExecutionAttemptID string + ExpiresAt time.Time + IdempotencyKey string + LeaseID string + MachineID string + TargetID string + WorkerID string + type WorkerClaimNextCommand struct + AccountID string + CapabilityRevisionID string + ClaimedAt time.Time + ExecutionAttemptID string + ExpiresAt time.Time + IdempotencyKey string + LeaseID string + MachineID string + WorkerID string + type WorkerContextArtifactReference struct + ArtifactID string + CreatedAt time.Time + ExecutionAttemptID string + ExpectedChunkCount int + ExpectedEncodedLength int64 + ExpectedPlaintextLength int64 + FinalizedAt time.Time + Kind string + LogicalDigest string + type WorkerContextItem struct + Artifact *WorkerContextArtifactReference + Kind string + Message *WorkerContextMessage + Ordinal int + type WorkerContextMessage struct + AuthorAgentID string + AuthorID string + AuthorKind string + Body string + ConversationID string + CreatedAt time.Time + HandoffID string + MessageID int64 + MessageKind string + RoutineRunID string + TargetID string + TurnID string + type WorkerContextPage struct + ContextManifestID string + Items []WorkerContextItem + ManifestDigest string + NextCursor string + type WorkerContextPageCommand struct + AccountID string + Cursor string + ExecutionAttemptID string + FenceToken int64 + IdempotencyKey string + LeaseID string + MachineID string + ObservedAt time.Time + TargetID string + WorkerID string + type WorkerContextRepository interface + ReadWorkerContextPage func(context.Context, WorkerContextPageCommand) (WorkerContextPage, error) + type WorkerExecutionBinding struct + AdapterID string + AdapterRevision string + AuthorityID string + AuthorityRevision string + CapabilityEvidence json.RawMessage + CloudRuntime string + ComputerID string + ExecutionSourceID string + FortProfile string + MemoryBehavior string + OpaqueSourceAgentID string + PolicyID string + PolicyRevision string + Provider string + ReadinessContractID string + ReadinessContractRevision string + RequestedModel string + ResolvedModel string + SessionBehavior string + SourceAgentID string + SourceConfigDigest string + Workdir string + type WorkerLeaseHeartbeatCommand struct + AccountID string + ExecutionAttemptID string + ExtendUntil time.Time + FenceToken int64 + IdempotencyKey string + LeaseID string + MachineID string + ObservedAt time.Time + TargetID string + WorkerID string + type WorkerLeaseHeartbeatResult struct + Directive coreworker.WorkerDirective + ExecutionAttemptID string + ExpiresAt time.Time + FenceToken int64 + LeaseID string + TargetID string + type WorkerOutputReference struct + ArtifactID string + Digest string + type WorkerReadinessCommand struct + AccountID string + CapabilityEvidence json.RawMessage + CapabilityRevisionID string + EvidenceDigest string + IdempotencyKey string + MachineID string + ObservedAt time.Time + Revision int + WorkerID string + type WorkerReadinessResult struct + CapabilityRevisionID string + ObservedAt time.Time + Status string + type WorkerRepository interface + AcknowledgeWorkerCancellation func(context.Context, WorkerCancellationAckCommand) (WorkerCancellationAck, error) + AppendWorkerArtifactChunk func(context.Context, WorkerArtifactChunkCommand) (WorkerArtifactChunk, error) + ClaimNextWorkerTarget func(context.Context, WorkerClaimNextCommand) (WorkerAssignment, error) + ClaimWorkerTarget func(context.Context, WorkerClaimCommand) (WorkerAssignment, error) + CommitWorkerTerminal func(context.Context, WorkerTerminalCommand) (WorkerTerminalResult, error) + CreateWorkerArtifact func(context.Context, WorkerArtifactCreateCommand) (WorkerArtifact, error) + FinalizeWorkerArtifact func(context.Context, WorkerArtifactFinalizeCommand) (WorkerArtifact, error) + GetWorkerArtifactStatus func(context.Context, WorkerArtifactStatusCommand) (WorkerArtifact, error) + HeartbeatWorkerLease func(context.Context, WorkerLeaseHeartbeatCommand) (WorkerLeaseHeartbeatResult, error) + MachineCredential func(context.Context, string, string, string) (MachineCredential, error) + RecordWorkerReadiness func(context.Context, WorkerReadinessCommand) (WorkerReadinessResult, error) + type WorkerTerminalCommand struct + AccountID string + CommittedAt time.Time + ExecutionAttemptID string + FenceToken int64 + IdempotencyKey string + LeaseID string + MachineID string + Output WorkerOutputReference + OutputMessage *EncryptedEnvelope + OutputMessagePlaintext *string + Receipt EncryptedEnvelope + ReceiptPlaintext json.RawMessage + Status coreworker.TerminalStatus + TargetID string + TerminalReceiptID string + WorkerID string + type WorkerTerminalResult struct + CommittedAt time.Time + Created bool + ExecutionAttemptID string + FenceToken int64 + LeaseID string + MessageID int64 + Output WorkerOutputReference + Status coreworker.TerminalStatus + TargetID string + TerminalReceiptID string