diff options
| author | Dax Raad <[email protected]> | 2025-05-18 22:30:41 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-05-26 12:40:17 -0400 |
| commit | 99af6146d5def31c59993636d60eb75a483a283b (patch) | |
| tree | eb57ed227c15cf9be54bc9f231c83895d812f881 /js/src/session | |
| parent | 020e0ca039287b73fa33041fbd1bb214e6ccb396 (diff) | |
| download | opencode-99af6146d5def31c59993636d60eb75a483a283b.tar.gz opencode-99af6146d5def31c59993636d60eb75a483a283b.zip | |
openapi
Diffstat (limited to 'js/src/session')
| -rw-r--r-- | js/src/session/session.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/js/src/session/session.ts b/js/src/session/session.ts index fb45f0e59..e86048b1c 100644 --- a/js/src/session/session.ts +++ b/js/src/session/session.ts @@ -1,5 +1,4 @@ import path from "path"; -import { z } from "zod/v3"; import { App } from "../app/"; import { Identifier } from "../id/id"; import { LLM } from "../llm/llm"; @@ -8,26 +7,27 @@ import { Log } from "../util/log"; import { convertToModelMessages, streamText, - tool, type TextUIPart, type ToolInvocationUIPart, type UIDataTypes, type UIMessage, type UIMessagePart, } from "ai"; +import { z } from "zod"; export namespace Session { const log = Log.create({ service: "session" }); - export interface Info { - id: string; - title: string; - tokens: { - input: number; - output: number; - reasoning: number; - }; - } + export const Info = z.object({ + id: Identifier.schema("session"), + title: z.string(), + tokens: z.object({ + input: z.number(), + output: z.number(), + reasoning: z.number(), + }), + }); + export type Info = z.output<typeof Info>; export type Message = UIMessage<{ sessionID: string }>; |
