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

Function actionSourceParam

projects/openade-module/src/module.ts:338–353  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

336}
337
338function actionSourceParam(value: unknown): OpenADEActionEventCreateRequest["source"] {
339 const source = asRecord(value)
340 if (
341 source.type !== "plan" &&
342 source.type !== "revise" &&
343 source.type !== "run_plan" &&
344 source.type !== "do" &&
345 source.type !== "ask" &&
346 source.type !== "hyperplan" &&
347 source.type !== "review"
348 ) {
349 throw new Error("source.type is invalid")
350 }
351 if (typeof source.userLabel !== "string" || source.userLabel.length < 1) throw new Error("source.userLabel is invalid")
352 return source as OpenADEActionEventCreateRequest["source"]
353}
354
355function createActionEventParams(params: unknown): OpenADEActionEventCreateRequest {
356 const record = asRecord(params)

Callers 1

createActionEventParamsFunction · 0.85

Calls 1

asRecordFunction · 0.70

Tested by

no test coverage detected