Interface: TicketStore
Defined in: packages/orchestration/src/types.ts:231
Where tickets live. Every implementation passes the shared contract suite
(ticketStoreContract from @baleybots/orchestration/testing).
Methods
claim()
claim(
id,expected,changes):Promise<Ticket|null>
Defined in: packages/orchestration/src/types.ts:244
Apply changes only while the ticket is still in expected (its status
and active run), atomically, and return the updated ticket, or null when
it moved. Every run starts and settles through it, so two instances that
both saw a ticket queued cannot both run it.
Parameters
id
string
expected
Pick<Ticket, "status" | "activeRunId">
changes
Partial<Ticket>
Returns
Promise<Ticket | null>
compareAndSwapQuestions()
compareAndSwapQuestions(
id,expected,questions,changes?,expectedState?):Promise<Ticket|null>
Defined in: packages/orchestration/src/types.ts:237
Compare the persisted questions with expected (and, when given, the
ticket's status and active run with expectedState) and, in one atomic
write, replace them with questions plus changes. Null on a mismatch.
Parameters
id
string
expected
questions
changes?
Partial<Ticket>
expectedState?
Pick<Ticket, "status" | "activeRunId">
Returns
Promise<Ticket | null>
create()
create(
config):Promise<Ticket>
Defined in: packages/orchestration/src/types.ts:245
Parameters
config
Returns
Promise<Ticket>
delete()
delete(
id):Promise<void>
Defined in: packages/orchestration/src/types.ts:249
Parameters
id
string
Returns
Promise<void>
get()
get(
id):Promise<Ticket|null>
Defined in: packages/orchestration/src/types.ts:246
Parameters
id
string
Returns
Promise<Ticket | null>
list()
list(
filter?):Promise<Ticket[]>
Defined in: packages/orchestration/src/types.ts:248
Parameters
filter?
assignee?
string
status?
("needs_input" | "backlog" | "queued" | "in_progress" | "review" | "done" | "failed" | "cancelled")[]
tags?
string[]
Returns
Promise<Ticket[]>
update()
update(
id,changes):Promise<Ticket>
Defined in: packages/orchestration/src/types.ts:247
Parameters
id
string
changes
Partial<Ticket>
Returns
Promise<Ticket>