mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-10 05:18:29 +00:00
chore: generate
This commit is contained in:
parent
65210f2d97
commit
20f47fec7a
4 changed files with 263 additions and 1062 deletions
|
|
@ -1,16 +1,7 @@
|
|||
import { expect, test } from "bun:test"
|
||||
import { DateTime, Effect, Stream } from "effect"
|
||||
import { HttpClient, HttpClientResponse } from "effect/unstable/http"
|
||||
import {
|
||||
AbsolutePath,
|
||||
Agent,
|
||||
Location,
|
||||
Model,
|
||||
OpenCode,
|
||||
Prompt,
|
||||
Session,
|
||||
SessionMessage,
|
||||
} from "../src/effect"
|
||||
import { AbsolutePath, Agent, Location, Model, OpenCode, Prompt, Session, SessionMessage } from "../src/effect"
|
||||
|
||||
test("sessions.get returns the decoded Effect projection", async () => {
|
||||
const httpClient = HttpClient.make((request) =>
|
||||
|
|
@ -46,9 +37,7 @@ test("session methods retain decoded Effect inputs and outputs", async () => {
|
|||
HttpClientResponse.fromWeb(
|
||||
request,
|
||||
Response.json(
|
||||
historyPage === 1
|
||||
? { data: [modelSwitchedEvent], hasMore: true }
|
||||
: { data: [], hasMore: false },
|
||||
historyPage === 1 ? { data: [modelSwitchedEvent], hasMore: true } : { data: [], hasMore: false },
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -33,9 +33,7 @@ test("session methods use the public HTTP contract", async () => {
|
|||
if (url.includes("/history")) {
|
||||
historyPage++
|
||||
return Response.json(
|
||||
historyPage === 1
|
||||
? { data: [modelSwitchedEvent], hasMore: true }
|
||||
: { data: [], hasMore: false },
|
||||
historyPage === 1 ? { data: [modelSwitchedEvent], hasMore: true } : { data: [], hasMore: false },
|
||||
)
|
||||
}
|
||||
if (url.includes("/prompt")) return Response.json(admission)
|
||||
|
|
|
|||
|
|
@ -136,10 +136,7 @@ export interface Interface {
|
|||
sessionID: SessionSchema.ID
|
||||
after?: number
|
||||
limit: number
|
||||
}) => Effect.Effect<
|
||||
{ events: ReadonlyArray<SessionEvent.DurableEvent>; hasMore: boolean },
|
||||
NotFoundError
|
||||
>
|
||||
}) => Effect.Effect<{ events: ReadonlyArray<SessionEvent.DurableEvent>; hasMore: boolean }, NotFoundError>
|
||||
readonly switchAgent: (input: { sessionID: SessionSchema.ID; agent: string }) => Effect.Effect<void, NotFoundError>
|
||||
readonly switchModel: (input: {
|
||||
sessionID: SessionSchema.ID
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue