Skip to content

Commit

Permalink
add start stop script
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Jun 22, 2024
1 parent bf636c7 commit 2adc07a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/core/src/server/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import {
ContainerStartResponse,
ContainerStart,
ContainerRemove,
PromptScriptRunOptions,
PromptScriptStart,
PromptScriptAbort,
} from "./messages"

export class WebSocketClient
Expand Down Expand Up @@ -195,6 +198,29 @@ export class WebSocketClient
return res.response
}

async startScript(
script: string,
files: string[],
options: PromptScriptRunOptions
): Promise<PromptScriptTestRunResponse> {
const res = await this.queue<PromptScriptStart>({
type: "script.start",
script,
files,
options,
})
return res.response
}

async abortScript(runId: string, reason?: string): Promise<ResponseStatus> {
const res = await this.queue<PromptScriptAbort>({
type: "script.abort",
runId,
reason,
})
return res.response
}

async runTest(
script: PromptScript,
options?: PromptScriptTestRunOptions
Expand Down

0 comments on commit 2adc07a

Please sign in to comment.