refactor(schema): apply session review decisions (#35793)

This commit is contained in:
Kit Langton 2026-07-07 22:10:11 -04:00 committed by GitHub
commit ed6ad272ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
142 changed files with 4239 additions and 3174 deletions

View file

@ -9,34 +9,31 @@ import { DateTimeUtcFromMillis, optional, RelativePath } from "./schema.js"
import { SessionEvent } from "./session-event.js"
import { SessionID } from "./session-id.js"
import { SessionMessage } from "./session-message.js"
import { Revert } from "./revert.js"
import { Money } from "./money.js"
import { TokenUsage } from "./token-usage.js"
import { Revert } from "./session-revert.js"
export const ID = SessionID
export type ID = SessionID
export const Event = SessionEvent
export { Revert }
export interface Info extends Schema.Schema.Type<typeof Info> {}
export const Info = Schema.Struct({
id: ID,
parentID: ID.pipe(optional),
fork: Schema.Struct({
sessionID: ID,
/** Messages before this exclusive boundary are copied into the fork. */
messageID: SessionMessage.ID.pipe(optional),
}).pipe(optional),
projectID: Project.ID,
agent: Agent.ID.pipe(optional),
model: Model.Ref.pipe(optional),
cost: Schema.Finite,
tokens: Schema.Struct({
input: Schema.Finite,
output: Schema.Finite,
reasoning: Schema.Finite,
cache: Schema.Struct({
read: Schema.Finite,
write: Schema.Finite,
}),
}),
cost: Money.USD,
tokens: TokenUsage.Info,
time: Schema.Struct({
created: DateTimeUtcFromMillis,
updated: DateTimeUtcFromMillis,
@ -45,8 +42,8 @@ export const Info = Schema.Struct({
title: Schema.String,
location: Location.Ref,
subpath: RelativePath.pipe(optional),
revert: Revert.State.pipe(optional),
}).annotate({ identifier: "SessionV2.Info" })
revert: Revert.pipe(optional),
}).annotate({ identifier: "Session.Info" })
export const ListAnchor = Schema.Struct({
id: ID,