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

Function reviewStartParams

projects/openade-module/src/module.ts:316–336  ·  view source on GitHub ↗
(params: unknown)

Source from the content-addressed store, hash-verified

314}
315
316function reviewStartParams(params: unknown): OpenADEReviewStartRequest {
317 const record = asRecord(params)
318 const repoId = record.repoId
319 const taskId = record.taskId
320 const harnessId = record.harnessId
321 const modelId = record.modelId
322 if (typeof repoId !== "string" || repoId.length < 1) throw new Error("repoId is invalid")
323 if (typeof taskId !== "string" || taskId.length < 1) throw new Error("taskId is invalid")
324 if (record.reviewType !== "plan" && record.reviewType !== "work") throw new Error("reviewType is invalid")
325 if (typeof harnessId !== "string" || harnessId.length < 1) throw new Error("harnessId is invalid")
326 if (typeof modelId !== "string" || modelId.length < 1) throw new Error("modelId is invalid")
327 return {
328 repoId,
329 taskId,
330 reviewType: record.reviewType,
331 harnessId,
332 modelId,
333 customInstructions: typeof record.customInstructions === "string" ? record.customInstructions : undefined,
334 clientRequestId: typeof record.clientRequestId === "string" ? record.clientRequestId : undefined,
335 }
336}
337
338function actionSourceParam(value: unknown): OpenADEActionEventCreateRequest["source"] {
339 const source = asRecord(value)

Callers 1

registerFunction · 0.85

Calls 1

asRecordFunction · 0.70

Tested by

no test coverage detected