| 37 | this.request({ |
| 38 | case: "askMachineReq", |
| 39 | value: { |
| 40 | machineId, |
| 41 | prompt, |
| 42 | options: { |
| 43 | pin: options.pin, |
| 44 | session: options.session, |
| 45 | attachmentIds, |
| 46 | engine: options.engine, |
| 47 | workingDir: options.workingDir, |
| 48 | projectRootId: options.projectRootId, |
| 49 | model: options.model, |
| 50 | }, |
| 51 | }, |
| 52 | }), |
| 53 | ); |
| 54 | } |
| 55 | |
| 56 | async messages(machineId: string, options: MessageOptions = {}): Promise<MachineMessageList> { |
| 57 | if (options.limit !== undefined && (options.limit < 1 || options.limit > 500)) { |
| 58 | throw new Error("limit must be between 1 and 500"); |
| 59 | } |
| 60 | const response = await this.unary( |
| 61 | this.request({ |
| 62 | case: "listMachineMessagesReq", |
| 63 | value: { machineId, session: options.session, limit: options.limit }, |
| 64 | }), |
| 65 | ); |
| 66 | if (response.payload.case !== "machineMessageList") { |
| 67 | throw new Error("cmdop-core returned the wrong messages response arm"); |
| 68 | } |
| 69 | return response.payload.value; |
| 70 | } |
| 71 | } |
nothing calls this directly
no outgoing calls
no test coverage detected