|
|
@@ -11,7 +11,7 @@
|
|
|
* so this must never point at a developer's real session database.
|
|
|
*
|
|
|
* DSL shape:
|
|
|
- * - `http.get/post/...` starts a scenario for one OpenAPI route key.
|
|
|
+ * - `http.protected.get/post/...` starts a scenario for one OpenAPI route key.
|
|
|
* - `.seeded(...)` creates typed per-scenario state using Effect helpers on `ctx`.
|
|
|
* - `.at(...)` builds the request from that typed state.
|
|
|
* - `.json(...)` / `.jsonEffect(...)` assert response shape and optional side effects.
|
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
exerciseGlobalRoot,
|
|
|
} from "./environment"
|
|
|
import { color, printHeader, printResults } from "./report"
|
|
|
-import { coverageResult, matches, parseOptions, routeKey, routeKeys } from "./routing"
|
|
|
+import { coverageResult, parseOptions, routeKey, routeKeys, selectedScenarios } from "./routing"
|
|
|
import { runScenario } from "./runner"
|
|
|
import { runtime } from "./runtime"
|
|
|
import { type Scenario } from "./types"
|
|
|
@@ -40,14 +40,14 @@ import { type Scenario } from "./types"
|
|
|
void (await import("@opencode-ai/core/util/log")).init({ print: false })
|
|
|
|
|
|
const scenarios: Scenario[] = [
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/global/health", "global.health")
|
|
|
.global()
|
|
|
.json(200, (body) => {
|
|
|
object(body)
|
|
|
check(body.healthy === true, "server should report healthy")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/global/event", "global.event")
|
|
|
.global()
|
|
|
.stream()
|
|
|
@@ -60,8 +60,8 @@ const scenarios: Scenario[] = [
|
|
|
}),
|
|
|
"status",
|
|
|
),
|
|
|
- http.get("/global/config", "global.config.get").global().json(),
|
|
|
- http
|
|
|
+ http.protected.get("/global/config", "global.config.get").global().json(),
|
|
|
+ http.protected
|
|
|
.patch("/global/config", "global.config.update")
|
|
|
.global()
|
|
|
.seeded(() =>
|
|
|
@@ -86,7 +86,7 @@ const scenarios: Scenario[] = [
|
|
|
}),
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/global/dispose", "global.dispose")
|
|
|
.global()
|
|
|
.mutating()
|
|
|
@@ -97,23 +97,37 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http.get("/path", "path.get").json(200, (body, ctx) => {
|
|
|
+ http.protected.get("/path", "path.get").json(200, (body, ctx) => {
|
|
|
object(body)
|
|
|
check(body.directory === ctx.directory, "directory should resolve from x-opencode-directory")
|
|
|
check(body.worktree === ctx.directory, "worktree should resolve from x-opencode-directory")
|
|
|
}),
|
|
|
- http.get("/vcs", "vcs.get").json(),
|
|
|
- http
|
|
|
+ http.protected.get("/vcs", "vcs.get").json(),
|
|
|
+ http.protected.get("/vcs/status", "vcs.status").json(200, array),
|
|
|
+ http.protected
|
|
|
.get("/vcs/diff", "vcs.diff")
|
|
|
.at((ctx) => ({ path: "/vcs/diff?mode=git", headers: ctx.headers() }))
|
|
|
.json(200, array),
|
|
|
- http.get("/command", "command.list").json(200, array, "status"),
|
|
|
- http.get("/agent", "app.agents").json(200, array, "status"),
|
|
|
- http.get("/skill", "app.skills").json(200, array, "status"),
|
|
|
- http.get("/lsp", "lsp.status").json(200, array),
|
|
|
- http.get("/formatter", "formatter.status").json(200, array),
|
|
|
- http.get("/config", "config.get").json(200, undefined, "status"),
|
|
|
- http
|
|
|
+ http.protected.get("/vcs/diff/raw", "vcs.diff.raw").status(
|
|
|
+ 200,
|
|
|
+ (_ctx, result) =>
|
|
|
+ Effect.sync(() => {
|
|
|
+ check(typeof result.text === "string", "raw VCS diff should return text")
|
|
|
+ }),
|
|
|
+ "status",
|
|
|
+ ),
|
|
|
+ http.protected
|
|
|
+ .post("/vcs/apply", "vcs.apply")
|
|
|
+ .inProject({ git: false })
|
|
|
+ .at((ctx) => ({ path: "/vcs/apply", headers: ctx.headers(), body: { patch: "" } }))
|
|
|
+ .status(400, undefined, "status"),
|
|
|
+ http.protected.get("/command", "command.list").json(200, array, "status"),
|
|
|
+ http.protected.get("/agent", "app.agents").json(200, array, "status"),
|
|
|
+ http.protected.get("/skill", "app.skills").json(200, array, "status"),
|
|
|
+ http.protected.get("/lsp", "lsp.status").json(200, array),
|
|
|
+ http.protected.get("/formatter", "formatter.status").json(200, array),
|
|
|
+ http.protected.get("/config", "config.get").json(200, undefined, "status"),
|
|
|
+ http.protected
|
|
|
.patch("/config", "config.update")
|
|
|
.mutating()
|
|
|
.at((ctx) => ({ path: "/config", headers: ctx.headers(), body: { username: "httpapi-local" } }))
|
|
|
@@ -125,13 +139,13 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.patch("/config", "config.update.invalid")
|
|
|
.at((ctx) => ({ path: "/config", headers: ctx.headers(), body: { username: 1 } }))
|
|
|
.status(400),
|
|
|
- http.get("/config/providers", "config.providers").json(),
|
|
|
- http.get("/project", "project.list").json(200, array, "status"),
|
|
|
- http.get("/project/current", "project.current").json(
|
|
|
+ http.protected.get("/config/providers", "config.providers").json(),
|
|
|
+ http.protected.get("/project", "project.list").json(200, array, "status"),
|
|
|
+ http.protected.get("/project/current", "project.current").json(
|
|
|
200,
|
|
|
(body, ctx) => {
|
|
|
object(body)
|
|
|
@@ -139,7 +153,7 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.patch("/project/{projectID}", "project.update")
|
|
|
.mutating()
|
|
|
.seeded((ctx) => ctx.project())
|
|
|
@@ -160,7 +174,7 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/project/git/init", "project.initGit")
|
|
|
.mutating()
|
|
|
.inProject({ git: false })
|
|
|
@@ -173,9 +187,9 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http.get("/provider", "provider.list").json(),
|
|
|
- http.get("/provider/auth", "provider.auth").json(),
|
|
|
- http
|
|
|
+ http.protected.get("/provider", "provider.list").json(),
|
|
|
+ http.protected.get("/provider/auth", "provider.auth").json(),
|
|
|
+ http.protected
|
|
|
.post("/provider/{providerID}/oauth/authorize", "provider.oauth.authorize")
|
|
|
.at((ctx) => ({
|
|
|
path: route("/provider/{providerID}/oauth/authorize", { providerID: "httpapi" }),
|
|
|
@@ -183,7 +197,7 @@ const scenarios: Scenario[] = [
|
|
|
body: { method: "bad" },
|
|
|
}))
|
|
|
.status(400),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/provider/{providerID}/oauth/callback", "provider.oauth.callback")
|
|
|
.at((ctx) => ({
|
|
|
path: route("/provider/{providerID}/oauth/callback", { providerID: "httpapi" }),
|
|
|
@@ -191,8 +205,8 @@ const scenarios: Scenario[] = [
|
|
|
body: { method: "bad" },
|
|
|
}))
|
|
|
.status(400),
|
|
|
- http.get("/permission", "permission.list").json(200, array),
|
|
|
- http
|
|
|
+ http.protected.get("/permission", "permission.list").json(200, array),
|
|
|
+ http.protected
|
|
|
.post("/permission/{requestID}/reply", "permission.reply.invalid")
|
|
|
.at((ctx) => ({
|
|
|
path: route("/permission/{requestID}/reply", { requestID: "per_httpapi" }),
|
|
|
@@ -200,7 +214,7 @@ const scenarios: Scenario[] = [
|
|
|
body: { reply: "bad" },
|
|
|
}))
|
|
|
.status(400),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/permission/{requestID}/reply", "permission.reply")
|
|
|
.at((ctx) => ({
|
|
|
path: route("/permission/{requestID}/reply", { requestID: "per_httpapi" }),
|
|
|
@@ -210,8 +224,8 @@ const scenarios: Scenario[] = [
|
|
|
.json(200, (body) => {
|
|
|
check(body === true, "permission reply should return true even when request is no longer pending")
|
|
|
}),
|
|
|
- http.get("/question", "question.list").json(200, array),
|
|
|
- http
|
|
|
+ http.protected.get("/question", "question.list").json(200, array),
|
|
|
+ http.protected
|
|
|
.post("/question/{requestID}/reply", "question.reply.invalid")
|
|
|
.at((ctx) => ({
|
|
|
path: route("/question/{requestID}/reply", { requestID: "que_httpapi_reply" }),
|
|
|
@@ -219,7 +233,7 @@ const scenarios: Scenario[] = [
|
|
|
body: { answers: "Yes" },
|
|
|
}))
|
|
|
.status(400),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/question/{requestID}/reply", "question.reply")
|
|
|
.at((ctx) => ({
|
|
|
path: route("/question/{requestID}/reply", { requestID: "que_httpapi_reply" }),
|
|
|
@@ -229,7 +243,7 @@ const scenarios: Scenario[] = [
|
|
|
.json(200, (body) => {
|
|
|
check(body === true, "question reply should return true even when request is no longer pending")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/question/{requestID}/reject", "question.reject")
|
|
|
.at((ctx) => ({
|
|
|
path: route("/question/{requestID}/reject", { requestID: "que_httpapi_reject" }),
|
|
|
@@ -238,12 +252,12 @@ const scenarios: Scenario[] = [
|
|
|
.json(200, (body) => {
|
|
|
check(body === true, "question reject should return true even when request is no longer pending")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/file", "file.list")
|
|
|
.seeded((ctx) => ctx.file("hello.txt", "hello\n"))
|
|
|
.at((ctx) => ({ path: `/file?${new URLSearchParams({ path: "." })}`, headers: ctx.headers() }))
|
|
|
.json(200, array),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/file/content", "file.read")
|
|
|
.seeded((ctx) => ctx.file("hello.txt", "hello\n"))
|
|
|
.at((ctx) => ({ path: `/file/content?${new URLSearchParams({ path: "hello.txt" })}`, headers: ctx.headers() }))
|
|
|
@@ -251,20 +265,20 @@ const scenarios: Scenario[] = [
|
|
|
object(body)
|
|
|
check(body.content === "hello", `content should match seeded file: ${JSON.stringify(body)}`)
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/file/content", "file.read.missing")
|
|
|
.at((ctx) => ({ path: `/file/content?${new URLSearchParams({ path: "missing.txt" })}`, headers: ctx.headers() }))
|
|
|
.json(200, (body) => {
|
|
|
object(body)
|
|
|
check(body.type === "text" && body.content === "", "missing file content should return an empty text result")
|
|
|
}),
|
|
|
- http.get("/file/status", "file.status").json(200, array),
|
|
|
- http
|
|
|
+ http.protected.get("/file/status", "file.status").json(200, array),
|
|
|
+ http.protected
|
|
|
.get("/find", "find.text")
|
|
|
.seeded((ctx) => ctx.file("hello.txt", "hello\n"))
|
|
|
.at((ctx) => ({ path: `/find?${new URLSearchParams({ pattern: "hello" })}`, headers: ctx.headers() }))
|
|
|
.json(200, array),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/find/file", "find.files")
|
|
|
.seeded((ctx) => ctx.file("hello.txt", "hello\n"))
|
|
|
.at((ctx) => ({
|
|
|
@@ -272,12 +286,12 @@ const scenarios: Scenario[] = [
|
|
|
headers: ctx.headers(),
|
|
|
}))
|
|
|
.json(200, array),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/find/symbol", "find.symbols")
|
|
|
.seeded((ctx) => ctx.file("hello.ts", "export const hello = 1\n"))
|
|
|
.at((ctx) => ({ path: `/find/symbol?${new URLSearchParams({ query: "hello" })}`, headers: ctx.headers() }))
|
|
|
.json(200, array),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/event", "event.stream")
|
|
|
.stream()
|
|
|
.status(
|
|
|
@@ -289,8 +303,8 @@ const scenarios: Scenario[] = [
|
|
|
}),
|
|
|
"status",
|
|
|
),
|
|
|
- http.get("/mcp", "mcp.status").json(),
|
|
|
- http
|
|
|
+ http.protected.get("/mcp", "mcp.status").json(),
|
|
|
+ http.protected
|
|
|
.post("/mcp", "mcp.add")
|
|
|
.mutating()
|
|
|
.at((ctx) => ({
|
|
|
@@ -307,7 +321,7 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/mcp", "mcp.add.invalid")
|
|
|
.at((ctx) => ({
|
|
|
path: "/mcp",
|
|
|
@@ -315,7 +329,7 @@ const scenarios: Scenario[] = [
|
|
|
body: { name: "httpapi-invalid", config: { type: "invalid" } },
|
|
|
}))
|
|
|
.status(400),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/mcp/{name}/auth", "mcp.auth.start")
|
|
|
.at((ctx) => ({ path: route("/mcp/{name}/auth", { name: "httpapi-missing" }), headers: ctx.headers() }))
|
|
|
.json(
|
|
|
@@ -326,7 +340,7 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.delete("/mcp/{name}/auth", "mcp.auth.remove")
|
|
|
.mutating()
|
|
|
.at((ctx) => ({ path: route("/mcp/{name}/auth", { name: "httpapi-missing" }), headers: ctx.headers() }))
|
|
|
@@ -334,7 +348,7 @@ const scenarios: Scenario[] = [
|
|
|
object(body)
|
|
|
check(body.success === true, "MCP auth removal should return success")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/mcp/{name}/auth/authenticate", "mcp.auth.authenticate")
|
|
|
.at((ctx) => ({
|
|
|
path: route("/mcp/{name}/auth/authenticate", { name: "httpapi-missing" }),
|
|
|
@@ -348,7 +362,7 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/mcp/{name}/auth/callback", "mcp.auth.callback")
|
|
|
.at((ctx) => ({
|
|
|
path: route("/mcp/{name}/auth/callback", { name: "httpapi-missing" }),
|
|
|
@@ -356,23 +370,23 @@ const scenarios: Scenario[] = [
|
|
|
body: { code: 1 },
|
|
|
}))
|
|
|
.status(400),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/mcp/{name}/connect", "mcp.connect")
|
|
|
.mutating()
|
|
|
.at((ctx) => ({ path: route("/mcp/{name}/connect", { name: "httpapi-missing" }), headers: ctx.headers() }))
|
|
|
.json(200, (body) => {
|
|
|
check(body === true, "missing MCP connect should remain a no-op success")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/mcp/{name}/disconnect", "mcp.disconnect")
|
|
|
.mutating()
|
|
|
.at((ctx) => ({ path: route("/mcp/{name}/disconnect", { name: "httpapi-missing" }), headers: ctx.headers() }))
|
|
|
.json(200, (body) => {
|
|
|
check(body === true, "missing MCP disconnect should remain a no-op success")
|
|
|
}),
|
|
|
- http.get("/pty/shells", "pty.shells").json(200, array),
|
|
|
- http.get("/pty", "pty.list").json(200, array),
|
|
|
- http
|
|
|
+ http.protected.get("/pty/shells", "pty.shells").json(200, array),
|
|
|
+ http.protected.get("/pty", "pty.list").json(200, array),
|
|
|
+ http.protected
|
|
|
.post("/pty", "pty.create")
|
|
|
.mutating()
|
|
|
.at((ctx) => ({ path: "/pty", headers: ctx.headers(), body: controlledPtyInput("HTTP API PTY") }))
|
|
|
@@ -386,15 +400,22 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/pty", "pty.create.invalid")
|
|
|
.at((ctx) => ({ path: "/pty", headers: ctx.headers(), body: { command: 1 } }))
|
|
|
.status(400),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
+ .post("/pty/{ptyID}/connect-token", "pty.connectToken.invalid")
|
|
|
+ .at((ctx) => ({
|
|
|
+ path: route("/pty/{ptyID}/connect-token", { ptyID: "pty_httpapi_missing" }),
|
|
|
+ headers: ctx.headers(),
|
|
|
+ }))
|
|
|
+ .status(403, undefined, "status"),
|
|
|
+ http.protected
|
|
|
.get("/pty/{ptyID}", "pty.get")
|
|
|
.at((ctx) => ({ path: route("/pty/{ptyID}", { ptyID: "pty_httpapi_missing" }), headers: ctx.headers() }))
|
|
|
.status(404),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.put("/pty/{ptyID}", "pty.update")
|
|
|
.mutating()
|
|
|
.at((ctx) => ({
|
|
|
@@ -403,20 +424,20 @@ const scenarios: Scenario[] = [
|
|
|
body: { size: { rows: 0, cols: 0 } },
|
|
|
}))
|
|
|
.status(400),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.delete("/pty/{ptyID}", "pty.remove")
|
|
|
.mutating()
|
|
|
.at((ctx) => ({ path: route("/pty/{ptyID}", { ptyID: "pty_httpapi_missing" }), headers: ctx.headers() }))
|
|
|
.json(200, (body) => {
|
|
|
check(body === true, "PTY remove should return true")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/pty/{ptyID}/connect", "pty.connect")
|
|
|
.at((ctx) => ({ path: route("/pty/{ptyID}/connect", { ptyID: "pty_httpapi_missing" }), headers: ctx.headers() }))
|
|
|
.status(404, undefined, "none"),
|
|
|
- http.get("/experimental/console", "experimental.console.get").json(),
|
|
|
- http.get("/experimental/console/orgs", "experimental.console.listOrgs").json(),
|
|
|
- http
|
|
|
+ http.protected.get("/experimental/console", "experimental.console.get").json(),
|
|
|
+ http.protected.get("/experimental/console/orgs", "experimental.console.listOrgs").json(),
|
|
|
+ http.protected
|
|
|
.post("/experimental/console/switch", "experimental.console.switchOrg")
|
|
|
.at((ctx) => ({
|
|
|
path: "/experimental/console/switch",
|
|
|
@@ -424,14 +445,17 @@ const scenarios: Scenario[] = [
|
|
|
body: { accountID: "httpapi-account", orgID: "httpapi-org" },
|
|
|
}))
|
|
|
.status(400, undefined, "none"),
|
|
|
- http.get("/experimental/workspace/adapter", "experimental.workspace.adapter.list").json(200, array),
|
|
|
- http.get("/experimental/workspace", "experimental.workspace.list").json(200, array),
|
|
|
- http.get("/experimental/workspace/status", "experimental.workspace.status").json(200, array),
|
|
|
- http
|
|
|
+ http.protected.get("/experimental/workspace/adapter", "experimental.workspace.adapter.list").json(200, array),
|
|
|
+ http.protected.get("/experimental/workspace", "experimental.workspace.list").json(200, array),
|
|
|
+ http.protected.get("/experimental/workspace/status", "experimental.workspace.status").json(200, array),
|
|
|
+ http.protected
|
|
|
.post("/experimental/workspace", "experimental.workspace.create")
|
|
|
.at((ctx) => ({ path: "/experimental/workspace", headers: ctx.headers(), body: {} }))
|
|
|
.status(400),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
+ .post("/experimental/workspace/sync-list", "experimental.workspace.syncList")
|
|
|
+ .status(204, undefined, "status"),
|
|
|
+ http.protected
|
|
|
.delete("/experimental/workspace/{id}", "experimental.workspace.remove")
|
|
|
.mutating()
|
|
|
.at((ctx) => ({
|
|
|
@@ -439,7 +463,7 @@ const scenarios: Scenario[] = [
|
|
|
headers: ctx.headers(),
|
|
|
}))
|
|
|
.status(200),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/experimental/workspace/warp", "experimental.workspace.warp")
|
|
|
.at((ctx) => ({
|
|
|
path: "/experimental/workspace/warp",
|
|
|
@@ -447,16 +471,16 @@ const scenarios: Scenario[] = [
|
|
|
body: {},
|
|
|
}))
|
|
|
.status(400),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/experimental/tool", "tool.list")
|
|
|
.at((ctx) => ({
|
|
|
path: `/experimental/tool?${new URLSearchParams({ provider: "opencode", model: "test" })}`,
|
|
|
headers: ctx.headers(),
|
|
|
}))
|
|
|
.json(200, array, "status"),
|
|
|
- http.get("/experimental/tool/ids", "tool.ids").json(200, array),
|
|
|
- http.get("/experimental/worktree", "worktree.list").json(200, array),
|
|
|
- http
|
|
|
+ http.protected.get("/experimental/tool/ids", "tool.ids").json(200, array),
|
|
|
+ http.protected.get("/experimental/worktree", "worktree.list").json(200, array),
|
|
|
+ http.protected
|
|
|
.post("/experimental/worktree", "worktree.create")
|
|
|
.mutating()
|
|
|
.at((ctx) => ({ path: "/experimental/worktree", headers: ctx.headers(), body: { name: "api-dsl" } }))
|
|
|
@@ -470,11 +494,11 @@ const scenarios: Scenario[] = [
|
|
|
}),
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/experimental/worktree", "worktree.create.invalid")
|
|
|
.at((ctx) => ({ path: "/experimental/worktree", headers: ctx.headers(), body: { name: 1 } }))
|
|
|
.status(400),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.delete("/experimental/worktree", "worktree.remove")
|
|
|
.mutating()
|
|
|
.seeded((ctx) => ctx.worktree({ name: "api-remove" }))
|
|
|
@@ -482,7 +506,7 @@ const scenarios: Scenario[] = [
|
|
|
.json(200, (body) => {
|
|
|
check(body === true, "worktree remove should return true")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/experimental/worktree/reset", "worktree.reset")
|
|
|
.mutating()
|
|
|
.seeded((ctx) => ctx.worktree({ name: "api-reset" }))
|
|
|
@@ -497,37 +521,41 @@ const scenarios: Scenario[] = [
|
|
|
yield* ctx.worktreeRemove(ctx.state.directory)
|
|
|
}),
|
|
|
),
|
|
|
- http.get("/experimental/session", "experimental.session.list").json(200, array),
|
|
|
- http.get("/experimental/resource", "experimental.resource.list").json(),
|
|
|
- http
|
|
|
+ http.protected.get("/experimental/session", "experimental.session.list").json(200, array),
|
|
|
+ http.protected.get("/experimental/resource", "experimental.resource.list").json(),
|
|
|
+ http.protected
|
|
|
.post("/sync/history", "sync.history.list")
|
|
|
.at((ctx) => ({ path: "/sync/history", headers: ctx.headers(), body: {} }))
|
|
|
.json(200, array),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/sync/replay", "sync.replay")
|
|
|
.at((ctx) => ({ path: "/sync/replay", headers: ctx.headers(), body: { directory: ctx.directory, events: [] } }))
|
|
|
.status(400),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
+ .post("/sync/steal", "sync.steal.invalid")
|
|
|
+ .at((ctx) => ({ path: "/sync/steal", headers: ctx.headers(), body: {} }))
|
|
|
+ .status(400, undefined, "status"),
|
|
|
+ http.protected
|
|
|
.post("/sync/start", "sync.start")
|
|
|
.mutating()
|
|
|
.preserveDatabase()
|
|
|
.json(200, (body) => {
|
|
|
check(body === true, "sync start should return true when no workspace sessions exist")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/instance/dispose", "instance.dispose")
|
|
|
.mutating()
|
|
|
.json(200, (body) => {
|
|
|
check(body === true, "instance dispose should return true")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/log", "app.log")
|
|
|
.global()
|
|
|
.at(() => ({ path: "/log", body: { service: "httpapi-exercise", level: "info", message: "route coverage" } }))
|
|
|
.json(200, (body) => {
|
|
|
check(body === true, "log route should return true")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.put("/auth/{providerID}", "auth.set")
|
|
|
.global()
|
|
|
.at(() => ({ path: route("/auth/{providerID}", { providerID: "test" }), body: { type: "api", key: "test-key" } }))
|
|
|
@@ -539,7 +567,7 @@ const scenarios: Scenario[] = [
|
|
|
check(isRecord(auth.test) && auth.test.key === "test-key", "auth set should write isolated auth file")
|
|
|
}),
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.delete("/auth/{providerID}", "auth.remove")
|
|
|
.global()
|
|
|
.seeded(() =>
|
|
|
@@ -559,7 +587,63 @@ const scenarios: Scenario[] = [
|
|
|
check(auth.test === undefined, "auth remove should delete provider from isolated auth file")
|
|
|
}),
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
+ .get("/api/session", "v2.session.list")
|
|
|
+ .at((ctx) => ({ path: "/api/session?roots=true", headers: ctx.headers() }))
|
|
|
+ .json(
|
|
|
+ 200,
|
|
|
+ (body) => {
|
|
|
+ object(body)
|
|
|
+ array(body.items)
|
|
|
+ object(body.cursor)
|
|
|
+ },
|
|
|
+ "none",
|
|
|
+ ),
|
|
|
+ http.protected
|
|
|
+ .get("/api/session/{sessionID}/context", "v2.session.context")
|
|
|
+ .at((ctx) => ({
|
|
|
+ path: route("/api/session/{sessionID}/context", { sessionID: "ses_httpapi_missing" }),
|
|
|
+ headers: ctx.headers(),
|
|
|
+ }))
|
|
|
+ .json(200, array, "none"),
|
|
|
+ http.protected
|
|
|
+ .get("/api/session/{sessionID}/message", "v2.session.messages")
|
|
|
+ .at((ctx) => ({
|
|
|
+ path: route("/api/session/{sessionID}/message", { sessionID: "ses_httpapi_missing" }),
|
|
|
+ headers: ctx.headers(),
|
|
|
+ }))
|
|
|
+ .json(
|
|
|
+ 200,
|
|
|
+ (body) => {
|
|
|
+ object(body)
|
|
|
+ array(body.items)
|
|
|
+ object(body.cursor)
|
|
|
+ },
|
|
|
+ "none",
|
|
|
+ ),
|
|
|
+ http.protected
|
|
|
+ .post("/api/session/{sessionID}/prompt", "v2.session.prompt.invalid")
|
|
|
+ .at((ctx) => ({
|
|
|
+ path: route("/api/session/{sessionID}/prompt", { sessionID: "ses_httpapi_missing" }),
|
|
|
+ headers: ctx.headers(),
|
|
|
+ body: {},
|
|
|
+ }))
|
|
|
+ .status(400, undefined, "none"),
|
|
|
+ http.protected
|
|
|
+ .post("/api/session/{sessionID}/compact", "v2.session.compact")
|
|
|
+ .at((ctx) => ({
|
|
|
+ path: route("/api/session/{sessionID}/compact", { sessionID: "ses_httpapi_missing" }),
|
|
|
+ headers: ctx.headers(),
|
|
|
+ }))
|
|
|
+ .status(204, undefined, "none"),
|
|
|
+ http.protected
|
|
|
+ .post("/api/session/{sessionID}/wait", "v2.session.wait")
|
|
|
+ .at((ctx) => ({
|
|
|
+ path: route("/api/session/{sessionID}/wait", { sessionID: "ses_httpapi_missing" }),
|
|
|
+ headers: ctx.headers(),
|
|
|
+ }))
|
|
|
+ .status(204, undefined, "none"),
|
|
|
+ http.protected
|
|
|
.get("/session", "session.list")
|
|
|
.seeded((ctx) => ctx.session({ title: "List me" }))
|
|
|
.at((ctx) => ({ path: "/session?roots=true", headers: ctx.headers() }))
|
|
|
@@ -570,11 +654,11 @@ const scenarios: Scenario[] = [
|
|
|
"seeded session should be listed",
|
|
|
)
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/session/status", "session.status")
|
|
|
.seeded((ctx) => ctx.session({ title: "Status session" }))
|
|
|
.json(200, object),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/session", "session.create")
|
|
|
.mutating()
|
|
|
.at((ctx) => ({ path: "/session", headers: ctx.headers(), body: { title: "Created session" } }))
|
|
|
@@ -587,7 +671,7 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/session/{sessionID}", "session.get")
|
|
|
.seeded((ctx) => ctx.session({ title: "Get me" }))
|
|
|
.at((ctx) => ({ path: route("/session/{sessionID}", { sessionID: ctx.state.id }), headers: ctx.headers() }))
|
|
|
@@ -596,14 +680,14 @@ const scenarios: Scenario[] = [
|
|
|
check(body.id === ctx.state.id, "should return requested session")
|
|
|
check(body.title === "Get me", "should preserve seeded title")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/session/{sessionID}", "session.get.missing")
|
|
|
.at((ctx) => ({
|
|
|
path: route("/session/{sessionID}", { sessionID: "ses_httpapi_missing" }),
|
|
|
headers: ctx.headers(),
|
|
|
}))
|
|
|
.status(404),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.patch("/session/{sessionID}", "session.update")
|
|
|
.mutating()
|
|
|
.seeded((ctx) => ctx.session({ title: "Before rename" }))
|
|
|
@@ -620,7 +704,7 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.patch("/session/{sessionID}", "session.update.invalid")
|
|
|
.mutating()
|
|
|
.at((ctx) => ({
|
|
|
@@ -629,7 +713,7 @@ const scenarios: Scenario[] = [
|
|
|
body: { title: 1 },
|
|
|
}))
|
|
|
.status(400),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.delete("/session/{sessionID}", "session.delete")
|
|
|
.mutating()
|
|
|
.seeded((ctx) => ctx.session({ title: "Delete me" }))
|
|
|
@@ -640,7 +724,7 @@ const scenarios: Scenario[] = [
|
|
|
check((yield* ctx.sessionGet(ctx.state.id)) === undefined, "deleted session should not remain in storage")
|
|
|
}),
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/session/{sessionID}/children", "session.children")
|
|
|
.seeded((ctx) =>
|
|
|
Effect.gen(function* () {
|
|
|
@@ -660,7 +744,7 @@ const scenarios: Scenario[] = [
|
|
|
"children should include seeded child",
|
|
|
)
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/session/{sessionID}/todo", "session.todo")
|
|
|
.seeded((ctx) =>
|
|
|
Effect.gen(function* () {
|
|
|
@@ -677,12 +761,12 @@ const scenarios: Scenario[] = [
|
|
|
.json(200, (body, ctx) => {
|
|
|
check(stable(body) === stable(ctx.state.todos), "todos should match seeded state")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/session/{sessionID}/diff", "session.diff")
|
|
|
.seeded((ctx) => ctx.session({ title: "Diff session" }))
|
|
|
.at((ctx) => ({ path: route("/session/{sessionID}/diff", { sessionID: ctx.state.id }), headers: ctx.headers() }))
|
|
|
.json(200, array),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/session/{sessionID}/message", "session.messages")
|
|
|
.seeded((ctx) => ctx.session({ title: "Messages session" }))
|
|
|
.at((ctx) => ({ path: route("/session/{sessionID}/message", { sessionID: ctx.state.id }), headers: ctx.headers() }))
|
|
|
@@ -690,7 +774,7 @@ const scenarios: Scenario[] = [
|
|
|
array(body)
|
|
|
check(body.length === 0, "new session should have no messages")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/session/{sessionID}/message/{messageID}", "session.message")
|
|
|
.seeded((ctx) =>
|
|
|
Effect.gen(function* () {
|
|
|
@@ -714,7 +798,7 @@ const scenarios: Scenario[] = [
|
|
|
"message should include seeded part",
|
|
|
)
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.patch("/session/{sessionID}/message/{messageID}/part/{partID}", "part.update")
|
|
|
.mutating()
|
|
|
.seeded((ctx) =>
|
|
|
@@ -741,7 +825,7 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.delete("/session/{sessionID}/message/{messageID}/part/{partID}", "part.delete")
|
|
|
.mutating()
|
|
|
.seeded((ctx) =>
|
|
|
@@ -766,7 +850,7 @@ const scenarios: Scenario[] = [
|
|
|
check(messages[0]?.parts.length === 0, "deleted part should not remain on message")
|
|
|
}),
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.delete("/session/{sessionID}/message/{messageID}", "session.deleteMessage")
|
|
|
.mutating()
|
|
|
.seeded((ctx) =>
|
|
|
@@ -789,7 +873,7 @@ const scenarios: Scenario[] = [
|
|
|
check((yield* ctx.messages(ctx.state.session.id)).length === 0, "deleted message should not remain")
|
|
|
}),
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/session/{sessionID}/fork", "session.fork")
|
|
|
.mutating()
|
|
|
.seeded((ctx) => ctx.session({ title: "Fork source" }))
|
|
|
@@ -806,7 +890,7 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/session/{sessionID}/abort", "session.abort")
|
|
|
.mutating()
|
|
|
.seeded((ctx) => ctx.session({ title: "Abort session" }))
|
|
|
@@ -814,7 +898,7 @@ const scenarios: Scenario[] = [
|
|
|
.json(200, (body) => {
|
|
|
check(body === true, "abort should return true")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/session/{sessionID}/abort", "session.abort.missing")
|
|
|
.at((ctx) => ({
|
|
|
path: route("/session/{sessionID}/abort", { sessionID: "ses_httpapi_missing" }),
|
|
|
@@ -823,7 +907,7 @@ const scenarios: Scenario[] = [
|
|
|
.json(200, (body) => {
|
|
|
check(body === true, "missing session abort should remain a no-op success")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/session/{sessionID}/init", "session.init")
|
|
|
.preserveDatabase()
|
|
|
.withLlm()
|
|
|
@@ -847,7 +931,7 @@ const scenarios: Scenario[] = [
|
|
|
yield* ctx.llmWait(1)
|
|
|
}),
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/session/{sessionID}/message", "session.prompt")
|
|
|
.preserveDatabase()
|
|
|
.withLlm()
|
|
|
@@ -882,7 +966,7 @@ const scenarios: Scenario[] = [
|
|
|
}),
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/session/{sessionID}/prompt_async", "session.prompt_async")
|
|
|
.preserveDatabase()
|
|
|
.withLlm()
|
|
|
@@ -908,7 +992,7 @@ const scenarios: Scenario[] = [
|
|
|
yield* ctx.llmWait(1)
|
|
|
}),
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/session/{sessionID}/command", "session.command")
|
|
|
.preserveDatabase()
|
|
|
.withLlm()
|
|
|
@@ -935,7 +1019,7 @@ const scenarios: Scenario[] = [
|
|
|
}),
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/session/{sessionID}/shell", "session.shell")
|
|
|
.preserveDatabase()
|
|
|
.mutating()
|
|
|
@@ -957,7 +1041,7 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/session/{sessionID}/summarize", "session.summarize")
|
|
|
.preserveDatabase()
|
|
|
.withLlm()
|
|
|
@@ -1018,7 +1102,7 @@ const scenarios: Scenario[] = [
|
|
|
}),
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/session/{sessionID}/revert", "session.revert")
|
|
|
.mutating()
|
|
|
.seeded((ctx) =>
|
|
|
@@ -1045,7 +1129,7 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/session/{sessionID}/unrevert", "session.unrevert")
|
|
|
.mutating()
|
|
|
.seeded((ctx) => ctx.session({ title: "Unrevert session" }))
|
|
|
@@ -1061,7 +1145,7 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/session/{sessionID}/permissions/{permissionID}", "permission.respond")
|
|
|
.seeded((ctx) => ctx.session({ title: "Deprecated permission session" }))
|
|
|
.at((ctx) => ({
|
|
|
@@ -1075,7 +1159,7 @@ const scenarios: Scenario[] = [
|
|
|
.json(200, (body) => {
|
|
|
check(body === true, "deprecated permission response should return true")
|
|
|
}),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/session/{sessionID}/share", "session.share")
|
|
|
.mutating()
|
|
|
.seeded((ctx) => ctx.session({ title: "Share session" }))
|
|
|
@@ -1088,7 +1172,7 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.delete("/session/{sessionID}/share", "session.unshare")
|
|
|
.mutating()
|
|
|
.seeded((ctx) => ctx.session({ title: "Unshare session" }))
|
|
|
@@ -1101,25 +1185,25 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/tui/append-prompt", "tui.appendPrompt")
|
|
|
.at((ctx) => ({ path: "/tui/append-prompt", headers: ctx.headers(), body: { text: "hello" } }))
|
|
|
.json(200, boolean, "status"),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/tui/select-session", "tui.selectSession.invalid")
|
|
|
.at((ctx) => ({ path: "/tui/select-session", headers: ctx.headers(), body: { sessionID: "invalid" } }))
|
|
|
.status(400),
|
|
|
- http.post("/tui/open-help", "tui.openHelp").json(200, boolean, "status"),
|
|
|
- http.post("/tui/open-sessions", "tui.openSessions").json(200, boolean, "status"),
|
|
|
- http.post("/tui/open-themes", "tui.openThemes").json(200, boolean, "status"),
|
|
|
- http.post("/tui/open-models", "tui.openModels").json(200, boolean, "status"),
|
|
|
- http.post("/tui/submit-prompt", "tui.submitPrompt").json(200, boolean, "status"),
|
|
|
- http.post("/tui/clear-prompt", "tui.clearPrompt").json(200, boolean, "status"),
|
|
|
- http
|
|
|
+ http.protected.post("/tui/open-help", "tui.openHelp").json(200, boolean, "status"),
|
|
|
+ http.protected.post("/tui/open-sessions", "tui.openSessions").json(200, boolean, "status"),
|
|
|
+ http.protected.post("/tui/open-themes", "tui.openThemes").json(200, boolean, "status"),
|
|
|
+ http.protected.post("/tui/open-models", "tui.openModels").json(200, boolean, "status"),
|
|
|
+ http.protected.post("/tui/submit-prompt", "tui.submitPrompt").json(200, boolean, "status"),
|
|
|
+ http.protected.post("/tui/clear-prompt", "tui.clearPrompt").json(200, boolean, "status"),
|
|
|
+ http.protected
|
|
|
.post("/tui/execute-command", "tui.executeCommand")
|
|
|
.at((ctx) => ({ path: "/tui/execute-command", headers: ctx.headers(), body: { command: "agent_cycle" } }))
|
|
|
.json(200, boolean, "status"),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/tui/show-toast", "tui.showToast")
|
|
|
.at((ctx) => ({
|
|
|
path: "/tui/show-toast",
|
|
|
@@ -1127,7 +1211,7 @@ const scenarios: Scenario[] = [
|
|
|
body: { title: "Exercise", message: "covered", variant: "info", duration: 1000 },
|
|
|
}))
|
|
|
.json(200, boolean, "status"),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/tui/publish", "tui.publish")
|
|
|
.at((ctx) => ({
|
|
|
path: "/tui/publish",
|
|
|
@@ -1135,16 +1219,16 @@ const scenarios: Scenario[] = [
|
|
|
body: { type: "tui.prompt.append", properties: { text: "published" } },
|
|
|
}))
|
|
|
.json(200, boolean, "status"),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/tui/select-session", "tui.selectSession")
|
|
|
.seeded((ctx) => ctx.session({ title: "TUI select" }))
|
|
|
.at((ctx) => ({ path: "/tui/select-session", headers: ctx.headers(), body: { sessionID: ctx.state.id } }))
|
|
|
.json(200, boolean, "status"),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/tui/control/response", "tui.control.response")
|
|
|
.at((ctx) => ({ path: "/tui/control/response", headers: ctx.headers(), body: { ok: true } }))
|
|
|
.json(200, boolean, "status"),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.get("/tui/control/next", "tui.control.next")
|
|
|
.mutating()
|
|
|
.seeded((ctx) => ctx.tuiRequest({ path: "/tui/exercise", body: { text: "queued" } }))
|
|
|
@@ -1158,23 +1242,38 @@ const scenarios: Scenario[] = [
|
|
|
},
|
|
|
"status",
|
|
|
),
|
|
|
- http
|
|
|
+ http.protected
|
|
|
.post("/global/upgrade", "global.upgrade")
|
|
|
.global()
|
|
|
+ .probe({ path: "/global/upgrade", body: { target: 1 } })
|
|
|
.at(() => ({ path: "/global/upgrade", body: { target: 1 } }))
|
|
|
.status(400),
|
|
|
]
|
|
|
|
|
|
+const llmScenarios = new Set([
|
|
|
+ "session.init",
|
|
|
+ "session.prompt",
|
|
|
+ "session.prompt_async",
|
|
|
+ "session.command",
|
|
|
+ "session.summarize",
|
|
|
+])
|
|
|
+
|
|
|
const main = Effect.gen(function* () {
|
|
|
yield* Effect.addFinalizer(() => cleanupExercisePaths)
|
|
|
const options = parseOptions(Bun.argv.slice(2))
|
|
|
const modules = yield* Effect.promise(() => runtime())
|
|
|
const effectRoutes = routeKeys(OpenApi.fromApi(modules.PublicApi))
|
|
|
const honoRoutes = routeKeys(yield* Effect.promise(() => modules.Server.openapiHono()))
|
|
|
- const selected = scenarios.filter((scenario) => matches(options, scenario))
|
|
|
+ const selected = selectedScenarios(options, scenarios)
|
|
|
const missing = effectRoutes.filter((route) => !scenarios.some((scenario) => route === routeKey(scenario)))
|
|
|
const extra = scenarios.filter((scenario) => !effectRoutes.includes(routeKey(scenario)))
|
|
|
|
|
|
+ for (const scenario of scenarios) {
|
|
|
+ if (scenario.kind === "active" && llmScenarios.has(scenario.name) && !scenario.project?.llm) {
|
|
|
+ return yield* Effect.fail(new Error(`${scenario.name} must use TestLLMServer via .withLlm()`))
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
printHeader(options, effectRoutes, honoRoutes, selected, missing, extra, {
|
|
|
database: exerciseDatabasePath,
|
|
|
global: exerciseGlobalRoot,
|
|
|
@@ -1183,7 +1282,15 @@ const main = Effect.gen(function* () {
|
|
|
const results =
|
|
|
options.mode === "coverage"
|
|
|
? selected.map(coverageResult)
|
|
|
- : yield* Effect.forEach(selected, runScenario(options), { concurrency: 1 })
|
|
|
+ : yield* Effect.forEach(
|
|
|
+ selected,
|
|
|
+ (scenario) =>
|
|
|
+ Effect.gen(function* () {
|
|
|
+ if (options.progress) console.log(`${color.dim}RUN ${routeKey(scenario)} ${scenario.name}${color.reset}`)
|
|
|
+ return yield* runScenario(options)(scenario)
|
|
|
+ }),
|
|
|
+ { concurrency: 1 },
|
|
|
+ )
|
|
|
printResults(results, missing, extra)
|
|
|
|
|
|
if (results.some((result) => result.status === "fail"))
|