Documentation
¶
Index ¶
- type Config
- type IDGenerator
- type Option
- type Service
- func (s *Service) Cancel(ctx context.Context, sessionID string, entryID string) (store.SessionInputQueueEntry, error)
- func (s *Service) ClaimNext(ctx context.Context, sessionID string) (store.SessionInputQueueEntry, bool, error)
- func (s *Service) CurrentGeneration(ctx context.Context, sessionID string) (int64, error)
- func (s *Service) Enqueue(ctx context.Context, sessionID string, text string, generation int64, ...) (store.SessionInputQueueEntry, int, error)
- func (s *Service) EnqueueAdmitted(ctx context.Context, admission store.SessionPromptAdmissionRequest, ...) (store.SessionPromptAdmission, store.SessionInputQueueEntry, int, bool, error)
- func (s *Service) EnqueueAdmittedInterrupt(ctx context.Context, admission store.SessionPromptAdmissionRequest, ...) (store.SessionPromptAdmission, store.SessionInputQueueEntry, bool, error)
- func (s *Service) EnqueueInterrupt(ctx context.Context, sessionID string, text string, targetTurnID string, ...) (store.SessionInputQueueEntry, int, error)
- func (s *Service) Get(ctx context.Context, sessionID string, entryID string) (store.SessionInputQueueEntry, error)
- func (s *Service) List(ctx context.Context, sessionID string) ([]store.SessionInputQueueEntry, error)
- func (s *Service) MarkFailed(ctx context.Context, sessionID string, entryID string, summary string) error
- func (s *Service) MarkSent(ctx context.Context, sessionID string, entryID string) error
- func (s *Service) PeekNext(ctx context.Context, sessionID string) (store.SessionInputQueueEntry, bool, error)
- func (s *Service) PromoteToSteer(ctx context.Context, sessionID string, entryID string, text string, ...) (store.SessionInputQueueEntry, bool, error)
- func (s *Service) Release(ctx context.Context, sessionID string, entryID string) error
- func (s *Service) Replace(ctx context.Context, sessionID string, entryID string, text string, ...) (store.SessionInputQueueEntry, bool, error)
- func (s *Service) ReplayPromotion(ctx context.Context, sessionID string, entryID string, text string, ...) (store.SessionInputQueueEntry, bool, error)
- func (s *Service) StageAdmittedSteer(ctx context.Context, admission store.SessionPromptAdmissionRequest, ...) (store.SessionPromptAdmission, store.SessionInputQueueEntry, bool, error)
- func (s *Service) StageSteer(ctx context.Context, sessionID string, text string, targetTurnID string, ...) (store.SessionInputQueueEntry, error)
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IDGenerator ¶
IDGenerator returns a stable queue entry ID or the entropy failure that prevented allocation.
type Option ¶
type Option func(*Service)
Option customizes a Service.
func WithIDGenerator ¶
func WithIDGenerator(generator IDGenerator) Option
WithIDGenerator injects deterministic queue ids.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service owns validation and admission policy for session busy input.
func (*Service) Cancel ¶
func (s *Service) Cancel(ctx context.Context, sessionID string, entryID string) (store.SessionInputQueueEntry, error)
Cancel cancels one pending queue entry.
func (*Service) ClaimNext ¶
func (s *Service) ClaimNext( ctx context.Context, sessionID string, ) (store.SessionInputQueueEntry, bool, error)
ClaimNext leases the next input eligible for dispatch.
func (*Service) CurrentGeneration ¶
CurrentGeneration reads the current persisted generation for queue fencing.
func (*Service) Enqueue ¶
func (s *Service) Enqueue( ctx context.Context, sessionID string, text string, generation int64, runtime store.SessionInputRuntime, skillInvocations []commandpkg.Invocation, ) (store.SessionInputQueueEntry, int, error)
Enqueue appends operator input behind the active prompt turn.
func (*Service) EnqueueAdmitted ¶
func (s *Service) EnqueueAdmitted( ctx context.Context, admission store.SessionPromptAdmissionRequest, generation int64, ) (store.SessionPromptAdmission, store.SessionInputQueueEntry, int, bool, error)
EnqueueAdmitted atomically persists one external command receipt and its queue entry.
func (*Service) EnqueueAdmittedInterrupt ¶
func (s *Service) EnqueueAdmittedInterrupt( ctx context.Context, admission store.SessionPromptAdmissionRequest, targetTurnID string, ) (store.SessionPromptAdmission, store.SessionInputQueueEntry, bool, error)
EnqueueAdmittedInterrupt atomically persists a replacement command receipt and queue entry.
func (*Service) EnqueueInterrupt ¶
func (s *Service) EnqueueInterrupt( ctx context.Context, sessionID string, text string, targetTurnID string, runtime store.SessionInputRuntime, skillInvocations []commandpkg.Invocation, ) (store.SessionInputQueueEntry, int, error)
EnqueueInterrupt persists replacement input before the active turn is canceled.
func (*Service) Get ¶
func (s *Service) Get( ctx context.Context, sessionID string, entryID string, ) (store.SessionInputQueueEntry, error)
Get returns one exact durable queue entry.
func (*Service) List ¶
func (s *Service) List( ctx context.Context, sessionID string, ) ([]store.SessionInputQueueEntry, error)
List returns current pending operator inputs in dispatch order.
func (*Service) MarkFailed ¶
func (s *Service) MarkFailed(ctx context.Context, sessionID string, entryID string, summary string) error
MarkFailed records failed dispatch.
func (*Service) PeekNext ¶
func (s *Service) PeekNext( ctx context.Context, sessionID string, ) (store.SessionInputQueueEntry, bool, error)
PeekNext returns the next eligible input without mutating its queue state.
func (*Service) PromoteToSteer ¶
func (s *Service) PromoteToSteer( ctx context.Context, sessionID string, entryID string, text string, targetTurnID string, messageID string, idempotencyKey string, skillInvocations []commandpkg.Invocation, ) (store.SessionInputQueueEntry, bool, error)
PromoteToSteer atomically replaces one queued input with priority steering input.
func (*Service) Replace ¶
func (s *Service) Replace( ctx context.Context, sessionID string, entryID string, text string, messageID string, idempotencyKey string, skillInvocations []commandpkg.Invocation, ) (store.SessionInputQueueEntry, bool, error)
Replace atomically replaces one queued input with a new queue identity.
func (*Service) ReplayPromotion ¶
func (s *Service) ReplayPromotion( ctx context.Context, sessionID string, entryID string, text string, targetTurnID string, messageID string, idempotencyKey string, skillInvocations []commandpkg.Invocation, ) (store.SessionInputQueueEntry, bool, error)
ReplayPromotion returns an exact prior queue-to-steer mutation without changing queue state.
func (*Service) StageAdmittedSteer ¶
func (s *Service) StageAdmittedSteer( ctx context.Context, admission store.SessionPromptAdmissionRequest, targetTurnID string, generation int64, ) (store.SessionPromptAdmission, store.SessionInputQueueEntry, bool, error)
StageAdmittedSteer atomically persists one external receipt and its steering entry.
func (*Service) StageSteer ¶
func (s *Service) StageSteer( ctx context.Context, sessionID string, text string, targetTurnID string, generation int64, runtime store.SessionInputRuntime, skillInvocations []commandpkg.Invocation, ) (store.SessionInputQueueEntry, error)
StageSteer persists replacement steering guidance while a turn is active.
type Store ¶
type Store interface {
store.SessionInputQueueStore
}
Store is the persistence boundary for busy input.