(params: unknown)
| 240 | } |
| 241 | |
| 242 | function validateAgentExecutionStartParams(params: unknown): RuntimeValidationResult<Record<string, unknown>> { |
| 243 | const record = validateRecordParams(params) |
| 244 | if (!record.ok) return record |
| 245 | if (typeof record.value.executionId !== "string" || record.value.executionId.length < 1) return paramsError("$.executionId", "executionId must be a non-empty string") |
| 246 | if (!("prompt" in record.value)) return paramsError("$.prompt", "prompt is required") |
| 247 | if (typeof record.value.prompt !== "string" && !Array.isArray(record.value.prompt)) return paramsError("$.prompt", "prompt must be a string or array") |
| 248 | const options = record.value.options |
| 249 | if (typeof options !== "object" || options === null || Array.isArray(options)) return paramsError("$.options", "options must be an object") |
| 250 | const optionRecord = options as Record<string, unknown> |
| 251 | if (typeof optionRecord.harnessId !== "string" || optionRecord.harnessId.length < 1) return paramsError("$.options.harnessId", "options.harnessId must be a non-empty string") |
| 252 | if (typeof optionRecord.cwd !== "string" || optionRecord.cwd.length < 1) return paramsError("$.options.cwd", "options.cwd must be a non-empty string") |
| 253 | return record |
| 254 | } |
| 255 | |
| 256 | const providerParams = { validateParams: validateStringParams("providerId") } |
| 257 | const executionIdParams = { validateParams: validateStringParams("executionId") } |
nothing calls this directly
no test coverage detected