Skip to main content

Interface: IRunStore

Defined in: packages/agentos/src/io/channels/meetings/stores/types.ts:42

The run's row. An implementation keeps every field of it, the manager's timers (leaveCommandedAt, captureSuspendedAt, aloneSince) among them: the manager keeps nothing about a run in process. An implementation seals meetingUrl and creationContext at rest.

Methods​

findByIdempotencyKey()​

findByIdempotencyKey(ownerRef, key): Promise<MeetingRunRecord | undefined>

Defined in: packages/agentos/src/io/channels/meetings/stores/types.ts:70

The run an owner sent with this idempotency key, if there is one (there is at most one: see insert).

Parameters​

ownerRef​

string

key​

string

Returns​

Promise<MeetingRunRecord | undefined>


forget()?​

optional forget(runId): Promise<void>

Defined in: packages/agentos/src/io/channels/meetings/stores/types.ts:44

Optional whole-run eviction for in-memory hosts after terminal cleanup and the retention grace. Durable stores omit it to retain their records. Call only after producers have stopped; forgetting removes fences too.

Parameters​

runId​

string

Returns​

Promise<void>


get()​

get(runId): Promise<MeetingRunRecord | undefined>

Defined in: packages/agentos/src/io/channels/meetings/stores/types.ts:52

The run, or undefined when there is none.

Parameters​

runId​

string

Returns​

Promise<MeetingRunRecord | undefined>


insert()​

insert(run): Promise<void>

Defined in: packages/agentos/src/io/channels/meetings/stores/types.ts:50

Adds a new run. A run id that exists is an error, and so is an idempotency key the owner already used: that insert stores nothing and rejects with DuplicateIdempotencyKeyError, so of two sends racing with one key only one run is made, and the other finds it with findByIdempotencyKey.

Parameters​

run​

MeetingRunRecord

Returns​

Promise<void>


list()​

list(filter): Promise<MeetingRunRecord[]>

Defined in: packages/agentos/src/io/channels/meetings/stores/types.ts:68

The runs the filter selects, requestedAt descending, then runId ascending. Default limit 500; states: [] applies no state filter.

Parameters​

filter​

RunFilter

Returns​

Promise<MeetingRunRecord[]>


listFundingPending()?​

optional listFundingPending(limit, afterRunId?): Promise<MeetingRunRecord[]>

Defined in: packages/agentos/src/io/channels/meetings/stores/types.ts:72

Bounded keyset scan of unfinished funding cleanup, ordered by run id.

Parameters​

limit​

number

afterRunId?​

string

Returns​

Promise<MeetingRunRecord[]>


replace()​

replace(run): Promise<void>

Defined in: packages/agentos/src/io/channels/meetings/stores/types.ts:66

Rewrites the whole row (the content-free form at the end of a purge).

Parameters​

run​

MeetingRunRecord

Returns​

Promise<void>


update()​

update(runId, patch, expectState?): Promise<MeetingRunRecord | undefined>

Defined in: packages/agentos/src/io/channels/meetings/stores/types.ts:54

Atomically re-reads the row, checks expectState and applies the patch; undefined on a mismatch. Postgres holds the shared run anchor and sets the content fence for a purge in the same transaction. In-memory comparison and update have no await between them.

Parameters​

runId​

string

patch​

Partial<MeetingRunRecord>

expectState?​

MeetingRunState | readonly MeetingRunState[]

Returns​

Promise<MeetingRunRecord | undefined>


updateWith()?​

optional updateWith(runId, patchFor): Promise<MeetingRunRecord | undefined>

Defined in: packages/agentos/src/io/channels/meetings/stores/types.ts:64

Optional. Re-reads the row and applies the patch patchFor makes of it, atomically as update is: the patch is decided on the row as the store holds it when it writes, so a write another caller made since an earlier read is never overwritten by a patch decided on that read. Nothing is written when patchFor answers undefined, and then undefined is answered, as it is for a run that does not exist. patchFor runs while the row is held, so it is synchronous and does no I/O. The manager decides with it a usage report's time and total against the last ones taken, and a silent run's end against the run's last usage, so a manager given usageSilenceMs refuses a run store without it: a read and a later update would let another write slip between them.

Parameters​

runId​

string

patchFor​

(current) => Partial<MeetingRunRecord> | undefined

Returns​

Promise<MeetingRunRecord | undefined>