mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
12 lines
409 B
TypeScript
12 lines
409 B
TypeScript
import { Schema } from "effect"
|
|
import { descending } from "./identifier.js"
|
|
import { statics } from "./schema.js"
|
|
|
|
export const SessionID = Schema.String.check(Schema.isStartingWith("ses")).pipe(
|
|
Schema.brand("SessionID"),
|
|
Schema.annotate({ identifier: "Session.ID" }),
|
|
statics((schema) => ({
|
|
create: () => schema.make("ses_" + descending()),
|
|
})),
|
|
)
|
|
export type SessionID = typeof SessionID.Type
|