MCPcopy
hub / github.com/ValueCell-ai/ClawX / buildCronUpdatePatch

Function buildCronUpdatePatch

electron/services/cron-api.ts:342–354  ·  view source on GitHub ↗
(input: Record<string, unknown>)

Source from the content-addressed store, hash-verified

340}
341
342function buildCronUpdatePatch(input: Record<string, unknown>): Record<string, unknown> {
343 const patch = { ...input };
344 if ('schedule' in patch && patch.schedule !== undefined) patch.schedule = normalizeScheduleInput(patch.schedule);
345 if (typeof patch.message === 'string') {
346 patch.payload = { kind: 'agentTurn', message: patch.message };
347 delete patch.message;
348 }
349 if ('delivery' in patch) patch.delivery = normalizeCronDeliveryPatch(patch.delivery);
350 if ('agentId' in patch) {
351 patch.agentId = typeof patch.agentId === 'string' && patch.agentId.trim() ? patch.agentId.trim() : 'main';
352 }
353 return patch;
354}
355
356function transformCronJob(job: GatewayCronJob): CronJob {
357 const message = job.payload?.message || job.payload?.text || '';

Callers 1

createCronApiFunction · 0.85

Calls 2

normalizeScheduleInputFunction · 0.85

Tested by

no test coverage detected