refactor(protocol): extract server contracts (#33708)
This commit is contained in:
parent
f9dac262ff
commit
56a37c3640
77 changed files with 1070 additions and 878 deletions
18
packages/protocol/test/session-cursor.test.ts
Normal file
18
packages/protocol/test/session-cursor.test.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { describe, expect, test } from "bun:test"
|
||||
import { Effect } from "effect"
|
||||
import { SessionsCursor } from "../src/groups/session"
|
||||
import { Session } from "@opencode-ai/schema/session"
|
||||
|
||||
describe("SessionsCursor", () => {
|
||||
test("round trips without Node globals", async () => {
|
||||
const input = {
|
||||
workspace: undefined,
|
||||
search: "protocol",
|
||||
order: "desc" as const,
|
||||
anchor: { id: Session.ID.make("ses_test"), time: 1, direction: "next" as const },
|
||||
}
|
||||
const cursor = SessionsCursor.make(input)
|
||||
|
||||
expect(await Effect.runPromise(SessionsCursor.parse(cursor))).toEqual(input)
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue