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
commit bd8d858bf7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 412 additions and 150 deletions

View file

@ -323,6 +323,24 @@ export const SessionHandler = HttpApiBuilder.group(Api, "server.session", (handl
return HttpApiSchema.NoContent.make()
}),
)
.handle(
"session.shell",
Effect.fn(function* (ctx) {
yield* session
.shell({ sessionID: ctx.params.sessionID, id: ctx.payload.id, command: ctx.payload.command })
.pipe(
Effect.catchTag("Session.NotFoundError", (error) =>
Effect.fail(
new SessionNotFoundError({
sessionID: error.sessionID,
message: `Session not found: ${error.sessionID}`,
}),
),
),
)
return HttpApiSchema.NoContent.make()
}),
)
.handle(
"session.compact",
Effect.fn(function* (ctx) {