2026-07-01 17:33:59 +00:00
|
|
|
export * as Session from "./session.js"
|
2026-06-24 02:31:06 +00:00
|
|
|
|
|
|
|
|
import { Schema } from "effect"
|
2026-07-01 17:33:59 +00:00
|
|
|
import { Agent } from "./agent.js"
|
|
|
|
|
import { Location } from "./location.js"
|
|
|
|
|
import { Model } from "./model.js"
|
|
|
|
|
import { Project } from "./project.js"
|
|
|
|
|
import { DateTimeUtcFromMillis, optional, RelativePath } from "./schema.js"
|
|
|
|
|
import { SessionEvent } from "./session-event.js"
|
|
|
|
|
import { SessionID } from "./session-id.js"
|
|
|
|
|
import { Revert } from "./revert.js"
|
2026-06-24 02:31:06 +00:00
|
|
|
|
2026-06-24 20:43:17 +00:00
|
|
|
export const ID = SessionID
|
|
|
|
|
export type ID = SessionID
|
|
|
|
|
|
|
|
|
|
export const Event = SessionEvent
|
2026-06-24 02:31:06 +00:00
|
|
|
|
|
|
|
|
export interface Info extends Schema.Schema.Type<typeof Info> {}
|
|
|
|
|
export const Info = Schema.Struct({
|
|
|
|
|
id: ID,
|
2026-06-25 15:42:22 +00:00
|
|
|
parentID: ID.pipe(optional),
|
2026-06-24 02:31:06 +00:00
|
|
|
projectID: Project.ID,
|
2026-06-25 17:10:23 +00:00
|
|
|
agent: Agent.ID.pipe(optional),
|
|
|
|
|
model: Model.Ref.pipe(optional),
|
2026-06-24 02:31:06 +00:00
|
|
|
cost: Schema.Finite,
|
|
|
|
|
tokens: Schema.Struct({
|
|
|
|
|
input: Schema.Finite,
|
|
|
|
|
output: Schema.Finite,
|
|
|
|
|
reasoning: Schema.Finite,
|
|
|
|
|
cache: Schema.Struct({
|
|
|
|
|
read: Schema.Finite,
|
|
|
|
|
write: Schema.Finite,
|
|
|
|
|
}),
|
|
|
|
|
}),
|
|
|
|
|
time: Schema.Struct({
|
|
|
|
|
created: DateTimeUtcFromMillis,
|
|
|
|
|
updated: DateTimeUtcFromMillis,
|
2026-06-25 17:10:23 +00:00
|
|
|
archived: DateTimeUtcFromMillis.pipe(optional),
|
2026-06-24 02:31:06 +00:00
|
|
|
}),
|
|
|
|
|
title: Schema.String,
|
|
|
|
|
location: Location.Ref,
|
2026-06-25 17:10:23 +00:00
|
|
|
subpath: RelativePath.pipe(optional),
|
|
|
|
|
revert: Revert.State.pipe(optional),
|
2026-06-24 02:31:06 +00:00
|
|
|
}).annotate({ identifier: "SessionV2.Info" })
|
|
|
|
|
|
|
|
|
|
export const ListAnchor = Schema.Struct({
|
|
|
|
|
id: ID,
|
|
|
|
|
time: Schema.Finite,
|
|
|
|
|
direction: Schema.Literals(["previous", "next"]),
|
2026-06-25 17:10:23 +00:00
|
|
|
}).annotate({ identifier: "Session.ListAnchor" })
|
|
|
|
|
export interface ListAnchor extends Schema.Schema.Type<typeof ListAnchor> {}
|