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