mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-15 00:52:35 +00:00
chore: generate
This commit is contained in:
@@ -14,8 +14,9 @@ export const WorkspaceInfo = Schema.Struct({
|
||||
}).annotate({ identifier: "Workspace" })
|
||||
export type WorkspaceInfo = DeepMutable<Schema.Schema.Type<typeof WorkspaceInfo>>
|
||||
|
||||
export const WorkspaceListedInfo = Schema.Struct(Struct.omit(WorkspaceInfo.fields, ["id"]))
|
||||
.annotate({ identifier: "WorkspaceListedInfo" })
|
||||
export const WorkspaceListedInfo = Schema.Struct(Struct.omit(WorkspaceInfo.fields, ["id"])).annotate({
|
||||
identifier: "WorkspaceListedInfo",
|
||||
})
|
||||
export type WorkspaceListedInfo = DeepMutable<Schema.Schema.Type<typeof WorkspaceListedInfo>>
|
||||
|
||||
export const WorkspaceAdapterEntry = Schema.Struct({
|
||||
|
||||
@@ -8,7 +8,6 @@ import { waitGlobalBusEventPromise } from "./global-bus"
|
||||
|
||||
void Log.init({ print: false })
|
||||
|
||||
|
||||
function app() {
|
||||
return Server.Default().app
|
||||
}
|
||||
|
||||
@@ -41,8 +41,7 @@ export function coverageResult(scenario: Scenario): Result {
|
||||
|
||||
export function parseOptions(args: string[]): Options {
|
||||
const mode = option(args, "--mode") ?? "effect"
|
||||
if (mode !== "effect" && mode !== "coverage" && mode !== "auth")
|
||||
throw new Error(`invalid --mode ${mode}`)
|
||||
if (mode !== "effect" && mode !== "coverage" && mode !== "auth") throw new Error(`invalid --mode ${mode}`)
|
||||
return {
|
||||
mode,
|
||||
include: option(args, "--include"),
|
||||
|
||||
@@ -8,15 +8,7 @@ import { MessageID, PartID } from "../../../src/session/schema"
|
||||
import { call, callAuthProbe } from "./backend"
|
||||
import { original } from "./environment"
|
||||
import { runtime } from "./runtime"
|
||||
import type {
|
||||
ActiveScenario,
|
||||
Options,
|
||||
ProjectOptions,
|
||||
Result,
|
||||
Scenario,
|
||||
ScenarioContext,
|
||||
SeededContext,
|
||||
} from "./types"
|
||||
import type { ActiveScenario, Options, ProjectOptions, Result, Scenario, ScenarioContext, SeededContext } from "./types"
|
||||
|
||||
export function runScenario(options: Options) {
|
||||
return (scenario: Scenario) => {
|
||||
|
||||
@@ -12,7 +12,6 @@ import * as Log from "@opencode-ai/core/util/log"
|
||||
|
||||
void Log.init({ print: false })
|
||||
|
||||
|
||||
function app(input: { password?: string; username?: string }) {
|
||||
const handler = HttpRouter.toWebHandler(
|
||||
ExperimentalHttpApiServer.routes.pipe(
|
||||
|
||||
@@ -421,9 +421,9 @@ describe("session HttpApi", () => {
|
||||
directory: currentDir,
|
||||
})
|
||||
const headers = { "x-opencode-directory": tmp.path }
|
||||
const sessions = (yield* json<Session.Info[]>(yield* request(`${SessionPaths.list}?${query}`, { headers }))).map(
|
||||
(item) => item.id,
|
||||
)
|
||||
const sessions = (yield* json<Session.Info[]>(
|
||||
yield* request(`${SessionPaths.list}?${query}`, { headers }),
|
||||
)).map((item) => item.id)
|
||||
|
||||
expect(sessions).toContain(pathSession.id)
|
||||
expect(sessions).not.toContain(pathlessSession.id)
|
||||
|
||||
@@ -287,7 +287,6 @@ describe("HttpApi UI fallback", () => {
|
||||
})
|
||||
|
||||
test("keeps matched API routes ahead of the UI fallback", async () => {
|
||||
|
||||
const response = await Server.Default().app.request("/session/nope")
|
||||
|
||||
expect(response.status).toBe(404)
|
||||
@@ -344,7 +343,6 @@ describe("HttpApi UI fallback", () => {
|
||||
})
|
||||
|
||||
test("allows web UI preflight without auth", async () => {
|
||||
|
||||
const response = await app({ password: "secret", username: "opencode" }).request("/", {
|
||||
method: "OPTIONS",
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user