feat(core): implement V2 session.shell (#35183)

This commit is contained in:
James Long
2026-07-03 12:19:09 -04:00
committed by GitHub
parent 5fc4e18b82
commit bd8d858bf7
12 changed files with 414 additions and 152 deletions
+20
View File
@@ -349,6 +349,26 @@ export const makeSessionGroup = <I extends HttpApiMiddleware.AnyId, S>(sessionLo
}),
),
)
.add(
HttpApiEndpoint.post("session.shell", "/api/session/:sessionID/shell", {
params: { sessionID: Session.ID },
payload: Schema.Struct({
id: Event.ID.pipe(Schema.optional),
command: Schema.String,
}),
success: HttpApiSchema.NoContent,
error: SessionNotFoundError,
})
.middleware(sessionLocationMiddleware)
.annotateMerge(
OpenApi.annotations({
identifier: "v2.session.shell",
summary: "Run shell command",
description:
"Execute one shell command in the session's working directory. Emits a shell.started event before execution and a shell.ended event with the merged output after.",
}),
),
)
.add(
HttpApiEndpoint.post("session.compact", "/api/session/:sessionID/compact", {
params: { sessionID: Session.ID },