refactor: kilo compat for v1.15.9
This commit is contained in:
@@ -177,6 +177,15 @@ const scenarios: Scenario[] = [
|
||||
},
|
||||
"status",
|
||||
),
|
||||
http.protected
|
||||
.patch("/project/{projectID}", "project.update.missing")
|
||||
.mutating()
|
||||
.at((ctx) => ({
|
||||
path: route("/project/{projectID}", { projectID: "project_httpapi_missing" }),
|
||||
headers: ctx.headers(),
|
||||
body: { name: "Missing Project" },
|
||||
}))
|
||||
.json(404, object, "status"),
|
||||
http.protected
|
||||
.post("/project/git/init", "project.initGit")
|
||||
.mutating()
|
||||
@@ -224,9 +233,7 @@ const scenarios: Scenario[] = [
|
||||
headers: ctx.headers(),
|
||||
body: { reply: "once" },
|
||||
}))
|
||||
.json(200, (body) => {
|
||||
check(body === true, "permission reply should return true even when request is no longer pending")
|
||||
}),
|
||||
.json(404, object, "status"),
|
||||
http.protected.get("/question", "question.list").json(200, array),
|
||||
http.protected
|
||||
.post("/question/{requestID}/reply", "question.reply.invalid")
|
||||
@@ -243,18 +250,14 @@ const scenarios: Scenario[] = [
|
||||
headers: ctx.headers(),
|
||||
body: { answers: [["Yes"]] },
|
||||
}))
|
||||
.json(200, (body) => {
|
||||
check(body === true, "question reply should return true even when request is no longer pending")
|
||||
}),
|
||||
.json(404, object, "status"),
|
||||
http.protected
|
||||
.post("/question/{requestID}/reject", "question.reject")
|
||||
.at((ctx) => ({
|
||||
path: route("/question/{requestID}/reject", { requestID: "que_httpapi_reject" }),
|
||||
headers: ctx.headers(),
|
||||
}))
|
||||
.json(200, (body) => {
|
||||
check(body === true, "question reject should return true even when request is no longer pending")
|
||||
}),
|
||||
.json(404, object, "status"),
|
||||
http.protected
|
||||
.get("/file", "file.list")
|
||||
.seeded((ctx) => ctx.file("hello.txt", "hello\n"))
|
||||
@@ -335,58 +338,37 @@ const scenarios: Scenario[] = [
|
||||
http.protected
|
||||
.post("/mcp/{name}/auth", "mcp.auth.start")
|
||||
.at((ctx) => ({ path: route("/mcp/{name}/auth", { name: "httpapi-missing" }), headers: ctx.headers() }))
|
||||
.json(
|
||||
400,
|
||||
(body) => {
|
||||
object(body)
|
||||
check(typeof body.error === "string", "unsupported MCP OAuth response should include error")
|
||||
},
|
||||
"status",
|
||||
),
|
||||
.json(404, object, "status"),
|
||||
http.protected
|
||||
.delete("/mcp/{name}/auth", "mcp.auth.remove")
|
||||
.mutating()
|
||||
.at((ctx) => ({ path: route("/mcp/{name}/auth", { name: "httpapi-missing" }), headers: ctx.headers() }))
|
||||
.json(200, (body) => {
|
||||
object(body)
|
||||
check(body.success === true, "MCP auth removal should return success")
|
||||
}),
|
||||
.json(404, object, "status"),
|
||||
http.protected
|
||||
.post("/mcp/{name}/auth/authenticate", "mcp.auth.authenticate")
|
||||
.at((ctx) => ({
|
||||
path: route("/mcp/{name}/auth/authenticate", { name: "httpapi-missing" }),
|
||||
headers: ctx.headers(),
|
||||
}))
|
||||
.json(
|
||||
400,
|
||||
(body) => {
|
||||
object(body)
|
||||
check(typeof body.error === "string", "unsupported MCP OAuth authenticate response should include error")
|
||||
},
|
||||
"status",
|
||||
),
|
||||
.json(404, object, "status"),
|
||||
http.protected
|
||||
.post("/mcp/{name}/auth/callback", "mcp.auth.callback")
|
||||
.at((ctx) => ({
|
||||
path: route("/mcp/{name}/auth/callback", { name: "httpapi-missing" }),
|
||||
headers: ctx.headers(),
|
||||
body: { code: 1 },
|
||||
body: { code: "code" },
|
||||
}))
|
||||
.status(400),
|
||||
.json(404, object, "status"),
|
||||
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")
|
||||
}),
|
||||
.json(404, object, "status"),
|
||||
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")
|
||||
}),
|
||||
.json(404, object, "status"),
|
||||
http.protected.get("/pty/shells", "pty.shells").json(200, array),
|
||||
http.protected.get("/pty", "pty.list").json(200, array),
|
||||
http.protected
|
||||
@@ -431,9 +413,7 @@ const scenarios: Scenario[] = [
|
||||
.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")
|
||||
}),
|
||||
.json(404, object, "status"),
|
||||
http.protected
|
||||
.get("/pty/{ptyID}/connect", "pty.connect")
|
||||
.at((ctx) => ({ path: route("/pty/{ptyID}/connect", { ptyID: "pty_httpapi_missing" }), headers: ctx.headers() }))
|
||||
@@ -675,22 +655,14 @@ const scenarios: Scenario[] = [
|
||||
path: route("/api/session/{sessionID}/context", { sessionID: "ses_httpapi_missing" }),
|
||||
headers: ctx.headers(),
|
||||
}))
|
||||
.json(200, array, "none"),
|
||||
.json(404, object, "status"),
|
||||
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",
|
||||
),
|
||||
.json(404, object, "status"),
|
||||
http.protected
|
||||
.get("/api/session/{sessionID}/message", "v2.session.messages.params")
|
||||
.at((ctx) => ({
|
||||
@@ -700,15 +672,7 @@ const scenarios: Scenario[] = [
|
||||
})}`,
|
||||
headers: ctx.headers(),
|
||||
}))
|
||||
.json(
|
||||
200,
|
||||
(body) => {
|
||||
object(body)
|
||||
array(body.items)
|
||||
object(body.cursor)
|
||||
},
|
||||
"none",
|
||||
),
|
||||
.json(404, object, "status"),
|
||||
http.protected
|
||||
.get("/api/session/{sessionID}/message", "v2.session.messages.cursor")
|
||||
.at((ctx) => ({
|
||||
@@ -719,15 +683,7 @@ const scenarios: Scenario[] = [
|
||||
})}`,
|
||||
headers: ctx.headers(),
|
||||
}))
|
||||
.json(
|
||||
200,
|
||||
(body) => {
|
||||
object(body)
|
||||
array(body.items)
|
||||
object(body.cursor)
|
||||
},
|
||||
"none",
|
||||
),
|
||||
.json(404, object, "status"),
|
||||
http.protected
|
||||
.get("/api/session/{sessionID}/message", "v2.session.messages.cursor.invalid")
|
||||
.at((ctx) => ({
|
||||
@@ -752,14 +708,14 @@ const scenarios: Scenario[] = [
|
||||
path: route("/api/session/{sessionID}/compact", { sessionID: "ses_httpapi_missing" }),
|
||||
headers: ctx.headers(),
|
||||
}))
|
||||
.status(204, undefined, "none"),
|
||||
.status(404, undefined, "status"),
|
||||
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"),
|
||||
.status(404, undefined, "status"),
|
||||
http.protected
|
||||
.get("/session", "session.list")
|
||||
.seeded((ctx) => ctx.session({ title: "List me" }))
|
||||
@@ -1273,9 +1229,7 @@ const scenarios: Scenario[] = [
|
||||
headers: ctx.headers(),
|
||||
body: { response: "once" },
|
||||
}))
|
||||
.json(200, (body) => {
|
||||
check(body === true, "deprecated permission response should return true")
|
||||
}),
|
||||
.json(404, object, "status"),
|
||||
http.protected
|
||||
.post("/session/{sessionID}/share", "session.share")
|
||||
.mutating()
|
||||
|
||||
Reference in New Issue
Block a user