feat(session): support directory moves from slash commands

This commit is contained in:
Dax Raad 2026-07-15 00:33:59 -04:00
commit c1d2d7aba3
23 changed files with 521 additions and 206 deletions

View file

@ -179,6 +179,7 @@ import type {
QuestionReplyErrors,
QuestionReplyResponses,
QuestionV2Reply,
ServiceStopRequestV2,
SessionAbortErrors,
SessionAbortResponses,
SessionChildrenErrors,
@ -291,6 +292,8 @@ import type {
V2GenerateTextResponses,
V2HealthGetErrors,
V2HealthGetResponses,
V2HealthStopErrors,
V2HealthStopResponses,
V2IntegrationAttemptCancelErrors,
V2IntegrationAttemptCancelResponses,
V2IntegrationAttemptCompleteErrors,
@ -5072,7 +5075,7 @@ export class Health extends HeyApiClient {
/**
* Check server health
*
* Check whether the API server is ready to accept requests.
* Report the owning server process and its application status.
*/
public get<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
return (options?.client ?? this.client).get<V2HealthGetResponses, V2HealthGetErrors, ThrowOnError>({
@ -5080,6 +5083,30 @@ export class Health extends HeyApiClient {
...options,
})
}
/**
* Stop the managed server
*
* Request graceful shutdown of one exact managed server instance.
*/
public stop<ThrowOnError extends boolean = false>(
parameters: {
serviceStopRequestV2: ServiceStopRequestV2
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams([parameters], [{ args: [{ key: "serviceStopRequestV2", map: "body" }] }])
return (options?.client ?? this.client).post<V2HealthStopResponses, V2HealthStopErrors, ThrowOnError>({
url: "/api/service/stop",
...options,
...params,
headers: {
"Content-Type": "application/json",
...options?.headers,
...params.headers,
},
})
}
}
export class Server extends HeyApiClient {
@ -6117,10 +6144,7 @@ export class Session3 extends HeyApiClient {
public move<ThrowOnError extends boolean = false>(
parameters: {
sessionID: string
destination?: {
directory: string
}
moveChanges?: boolean | null
locationRefV2: LocationRefV2
},
options?: Options<never, ThrowOnError>,
) {
@ -6130,8 +6154,7 @@ export class Session3 extends HeyApiClient {
{
args: [
{ in: "path", key: "sessionID" },
{ in: "body", key: "destination" },
{ in: "body", key: "moveChanges" },
{ key: "locationRefV2", map: "body" },
],
},
],

View file

@ -598,24 +598,6 @@ export type Part =
| RetryPart
| CompactionPart
export type Shell = {
id: string
status: "running" | "exited" | "timeout" | "killed"
command: string
cwd: string
shell: string
file: string
pid?: number
exit?: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
metadata: {
[key: string]: unknown
}
time: {
started: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
completed?: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
}
}
export type Pty = {
id: string
title: string
@ -803,6 +785,7 @@ export type GlobalEvent = {
properties: {
sessionID: string
location: LocationRef
projectID?: string
subpath?: string
}
}
@ -917,7 +900,7 @@ export type GlobalEvent = {
type: "session.shell.started"
properties: {
sessionID: string
shell: Shell
shell: ShellInfo
}
}
| {
@ -925,7 +908,7 @@ export type GlobalEvent = {
type: "session.shell.ended"
properties: {
sessionID: string
shell: Shell
shell: ShellInfo
output: {
output: string
cursor: number
@ -1358,7 +1341,7 @@ export type GlobalEvent = {
id: string
type: "shell.created"
properties: {
info: Shell
info: ShellInfo
}
}
| {
@ -1366,7 +1349,7 @@ export type GlobalEvent = {
type: "shell.exited"
properties: {
id: string
exit?: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
exit?: number
status: "running" | "exited" | "timeout" | "killed"
}
}
@ -2812,11 +2795,45 @@ export type WorkspaceWarpError = {
}
}
export type ServiceStatus =
| {
type: "starting"
}
| {
type: "ready"
}
| {
type: "stopping"
targetVersion?: string
}
| {
type: "failed"
message: string
action: string
}
export type ServiceHealth = {
healthy: true
version: string
pid: number
instanceID?: string
status?: ServiceStatus
}
export type UnauthorizedError = {
_tag: "UnauthorizedError"
message: string
}
export type ServiceStopRequest = {
instanceID: string
targetVersion?: string
}
export type ServiceStopResponse = {
accepted: boolean
}
export type SessionsResponse = {
data: Array<SessionInfo>
cursor: {
@ -2890,24 +2907,6 @@ export type InstructionEntryValueTooLargeError = {
message: string
}
export type Shell1 = {
id: string
status: "running" | "exited" | "timeout" | "killed"
command: string
cwd: string
shell: string
file: string
pid?: number
exit?: number | "NaN" | "Infinity" | "-Infinity"
metadata: {
[key: string]: unknown
}
time: {
started: number | "NaN" | "Infinity" | "-Infinity"
completed?: number | "NaN" | "Infinity" | "-Infinity"
}
}
export type SessionLogItem = SessionEventDurable | EventLogSynced
export type SessionLogItemStream = string
@ -3154,24 +3153,6 @@ export type EffectHttpApiErrorForbidden = {
_tag: "Forbidden"
}
export type Shell2 = {
id: string
status: "running" | "exited" | "timeout" | "killed"
command: string
cwd: string
shell: string
file: string
pid?: number
exit?: number | "NaN" | "Infinity" | "-Infinity"
metadata: {
[key: string]: unknown
}
time: {
started: number | "NaN" | "Infinity" | "-Infinity"
completed?: number | "NaN" | "Infinity" | "-Infinity"
}
}
export type EventTuiPromptAppend2 = {
id: string
type: "tui.prompt.append"
@ -3398,6 +3379,24 @@ export type SessionStructuredError = {
message: string
}
export type ShellInfo = {
id: string
status: "running" | "exited" | "timeout" | "killed"
command: string
cwd: string
shell: string
file: string
pid?: number
exit?: number
metadata: {
[key: string]: unknown
}
time: {
started: number
completed?: number
}
}
export type SessionMessageProviderState = {
[key: string]: unknown
}
@ -3773,6 +3772,7 @@ export type SyncEventSessionMoved = {
data: {
sessionID: string
location: LocationRef
projectID?: string
subpath?: string
}
}
@ -3962,7 +3962,7 @@ export type SyncEventSessionShellStarted = {
aggregateID: string
data: {
sessionID: string
shell: Shell
shell: ShellInfo
}
}
}
@ -3977,7 +3977,7 @@ export type SyncEventSessionShellEnded = {
aggregateID: string
data: {
sessionID: string
shell: Shell
shell: ShellInfo
output: {
output: string
cursor: number
@ -4828,6 +4828,7 @@ export type SessionMoved = {
data: {
sessionID: string
location: LocationRef
projectID?: string
subpath?: string
}
}
@ -5083,7 +5084,7 @@ export type SessionShellStarted = {
location?: LocationRef
data: {
sessionID: string
shell: Shell1
shell: ShellInfo
}
}
@ -5102,7 +5103,7 @@ export type SessionShellEnded = {
location?: LocationRef
data: {
sessionID: string
shell: Shell1
shell: ShellInfo
output: {
output: string
cursor: number
@ -6461,7 +6462,7 @@ export type ShellCreated = {
type: "shell.created"
location?: LocationRef
data: {
info: Shell1
info: ShellInfo
}
}
@ -6475,7 +6476,7 @@ export type ShellExited = {
location?: LocationRef
data: {
id: string
exit?: number | "NaN" | "Infinity" | "-Infinity"
exit?: number
status: "running" | "exited" | "timeout" | "killed"
}
}
@ -7158,6 +7159,7 @@ export type EventSessionMoved = {
properties: {
sessionID: string
location: LocationRef
projectID?: string
subpath?: string
}
}
@ -7285,7 +7287,7 @@ export type EventSessionShellStarted = {
type: "session.shell.started"
properties: {
sessionID: string
shell: Shell2
shell: ShellInfo
}
}
@ -7294,7 +7296,7 @@ export type EventSessionShellEnded = {
type: "session.shell.ended"
properties: {
sessionID: string
shell: Shell2
shell: ShellInfo
output: {
output: string
cursor: number
@ -7772,7 +7774,7 @@ export type EventShellCreated = {
id: string
type: "shell.created"
properties: {
info: Shell2
info: ShellInfo
}
}
@ -7781,7 +7783,7 @@ export type EventShellExited = {
type: "shell.exited"
properties: {
id: string
exit?: number | "NaN" | "Infinity" | "-Infinity"
exit?: number
status: "running" | "exited" | "timeout" | "killed"
}
}
@ -8139,6 +8141,31 @@ export type BadRequestError = {
}
}
export type ServiceStatusV2 =
| {
type: "starting"
}
| {
type: "ready"
}
| {
type: "stopping"
targetVersion?: string | null
}
| {
type: "failed"
message: string
action: string
}
export type ServiceHealthV2 = {
healthy: true
version: string
pid: number
instanceID?: string | null
status?: ServiceStatusV2
}
export type InvalidRequestErrorV2 = {
_tag: "InvalidRequestError"
message: string
@ -8146,6 +8173,11 @@ export type InvalidRequestErrorV2 = {
field?: string | null
}
export type ServiceStopRequestV2 = {
instanceID: string
targetVersion?: string | null
}
export type SessionsResponseV2 = {
data: Array<SessionInfoV2>
cursor: {
@ -8179,24 +8211,6 @@ export type UnknownErrorV2 = {
ref?: string | null
}
export type ShellV2 = {
id: string
status: "running" | "exited" | "timeout" | "killed"
command: string
cwd: string
shell: string
file: string
pid?: number
exit?: number | "NaN" | "Infinity" | "-Infinity"
metadata: {
[key: string]: unknown
}
time: {
started: number | "NaN" | "Infinity" | "-Infinity"
completed?: number | "NaN" | "Infinity" | "-Infinity"
}
}
export type SessionMessagesResponseV2 = {
data: Array<SessionMessageInfo>
cursor: {
@ -9064,6 +9078,7 @@ export type SessionMovedV2 = {
data: {
sessionID: string
location: LocationRefV2
projectID?: string
subpath?: string
}
}
@ -9333,6 +9348,24 @@ export type SessionSkillActivatedV2 = {
}
}
export type ShellInfoV2 = {
id: string
status: "running" | "exited" | "timeout" | "killed"
command: string
cwd: string
shell: string
file: string
pid?: number
exit?: number
metadata: {
[key: string]: unknown
}
time: {
started: number
completed?: number
}
}
export type SessionShellStartedV2 = {
id: string
created: number
@ -9348,7 +9381,7 @@ export type SessionShellStartedV2 = {
location?: LocationRefV2
data: {
sessionID: string
shell: ShellV2
shell: ShellInfoV2
}
}
@ -9367,7 +9400,7 @@ export type SessionShellEndedV2 = {
location?: LocationRefV2
data: {
sessionID: string
shell: ShellV2
shell: ShellInfoV2
output: {
output: string
cursor: number
@ -10514,7 +10547,7 @@ export type ShellCreatedV2 = {
type: "shell.created"
location?: LocationRefV2
data: {
info: ShellV2
info: ShellInfoV2
}
}
@ -10528,7 +10561,7 @@ export type ShellExitedV2 = {
location?: LocationRefV2
data: {
id: string
exit?: number | "NaN" | "Infinity" | "-Infinity"
exit?: number
status: "running" | "exited" | "timeout" | "killed"
}
}
@ -10986,6 +11019,24 @@ export type PtyTicketConnectTokenV2 = {
expires_in: number
}
export type ShellInfo1 = {
id: string
status: "running" | "exited" | "timeout" | "killed"
command: string
cwd: string
shell: string
file: string
pid?: number
exit?: number
metadata: {
[key: string]: unknown
}
time: {
started: number
completed?: number
}
}
export type QuestionV2RequestV2 = {
id: string
sessionID: string
@ -15124,17 +15175,42 @@ export type V2HealthGetError = V2HealthGetErrors[keyof V2HealthGetErrors]
export type V2HealthGetResponses = {
/**
* Success
* ServiceHealth
*/
200: {
healthy: true
version: string
pid: number
}
200: ServiceHealthV2
}
export type V2HealthGetResponse = V2HealthGetResponses[keyof V2HealthGetResponses]
export type V2HealthStopData = {
body: ServiceStopRequestV2
path?: never
query?: never
url: "/api/service/stop"
}
export type V2HealthStopErrors = {
/**
* InvalidRequestError
*/
400: InvalidRequestErrorV2
/**
* UnauthorizedError
*/
401: UnauthorizedError
}
export type V2HealthStopError = V2HealthStopErrors[keyof V2HealthStopErrors]
export type V2HealthStopResponses = {
/**
* ServiceStopResponse
*/
200: ServiceStopResponse
}
export type V2HealthStopResponse = V2HealthStopResponses[keyof V2HealthStopResponses]
export type V2ServerGetData = {
body?: never
path?: never
@ -15611,12 +15687,7 @@ export type V2SessionRenameResponses = {
export type V2SessionRenameResponse = V2SessionRenameResponses[keyof V2SessionRenameResponses]
export type V2SessionMoveData = {
body: {
destination: {
directory: string
}
moveChanges?: boolean | null
}
body: LocationRefV2
path: {
sessionID: string
}
@ -18318,7 +18389,7 @@ export type V2ShellListResponses = {
*/
200: {
location: LocationInfoV2
data: Array<ShellV2>
data: Array<ShellInfo1>
}
}
@ -18362,7 +18433,7 @@ export type V2ShellCreateResponses = {
*/
200: {
location: LocationInfoV2
data: ShellV2
data: ShellInfo1
}
}
@ -18445,7 +18516,7 @@ export type V2ShellGetResponses = {
*/
200: {
location: LocationInfoV2
data: ShellV2
data: ShellInfo1
}
}
@ -18490,7 +18561,7 @@ export type V2ShellTimeoutResponses = {
*/
200: {
location: LocationInfoV2
data: ShellV2
data: ShellInfo1
}
}