| export type TurnId = string; |
| export type StepId = string; |
| export type FrameId = string; |
| export type MarkerId = string; |
| export type TaskRefId = string; |
| export type TaskId = string; |
| export type AgentId = string; |
| export type InteractionId = string; |
| export type AttachmentId = string; |
| export type TodoId = string; |
| export type PromptId = string; |
| export type ItemId = string; |
|
|
| export function turnId(ordinal: number): TurnId { |
| return `t${ordinal}`; |
| } |
|
|
| export function stepId(turn: TurnId, ordinal: number): StepId { |
| return `${turn}.${ordinal}`; |
| } |
|
|
| export function frameId(step: StepId, ordinal: number): FrameId { |
| return `${step}.f${ordinal}`; |
| } |
|
|
| export function compareTurnIds(a: TurnId, b: TurnId): number { |
| return turnOrdinal(a) - turnOrdinal(b); |
| } |
|
|
| export function turnOrdinal(id: TurnId): number { |
| const n = Number(id.slice(1)); |
| return Number.isFinite(n) ? n : 0; |
| } |
|
|