MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / validateAgentExecutionStartParams

Function validateAgentExecutionStartParams

projects/runtime-node/src/agents.ts:242–254  ·  view source on GitHub ↗
(params: unknown)

Source from the content-addressed store, hash-verified

240}
241
242function 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
256const providerParams = { validateParams: validateStringParams("providerId") }
257const executionIdParams = { validateParams: validateStringParams("executionId") }

Callers

nothing calls this directly

Calls 2

validateRecordParamsFunction · 0.70
paramsErrorFunction · 0.70

Tested by

no test coverage detected