From 7e845133346d20b29058093a2553395c71a875e1 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 03:00:16 +0100 Subject: [PATCH] refactor: trim cron helper exports --- src/cron/delivery-field-schemas.ts | 4 ++-- src/cron/heartbeat-policy.ts | 2 +- src/cron/schedule-identity.ts | 4 +--- src/cron/service-contract.ts | 4 +--- src/cron/service.ts | 14 ++------------ 5 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/cron/delivery-field-schemas.ts b/src/cron/delivery-field-schemas.ts index 8c9f4f7b14b..301d2d8342b 100644 --- a/src/cron/delivery-field-schemas.ts +++ b/src/cron/delivery-field-schemas.ts @@ -6,7 +6,7 @@ const trimStringPreprocess = (value: unknown) => (typeof value === "string" ? va const trimLowercaseStringPreprocess = (value: unknown) => normalizeOptionalLowercaseString(value) ?? value; -export const DeliveryModeFieldSchema = z +const DeliveryModeFieldSchema = z .preprocess(trimLowercaseStringPreprocess, z.enum(["deliver", "announce", "none", "webhook"])) .transform((value) => (value === "deliver" ? "announce" : value)); @@ -30,7 +30,7 @@ export const TimeoutSecondsFieldSchema = z .finite() .transform((value) => Math.max(0, value)); -export type ParsedDeliveryInput = { +type ParsedDeliveryInput = { mode?: "announce" | "none" | "webhook"; channel?: string; to?: string; diff --git a/src/cron/heartbeat-policy.ts b/src/cron/heartbeat-policy.ts index f95f9dd8422..ddbe22d5032 100644 --- a/src/cron/heartbeat-policy.ts +++ b/src/cron/heartbeat-policy.ts @@ -1,7 +1,7 @@ import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload"; import { stripHeartbeatToken } from "../auto-reply/heartbeat.js"; -export type HeartbeatDeliveryPayload = { +type HeartbeatDeliveryPayload = { text?: string; mediaUrl?: string; mediaUrls?: string[]; diff --git a/src/cron/schedule-identity.ts b/src/cron/schedule-identity.ts index 519f21f8ade..99c6f6fa2bc 100644 --- a/src/cron/schedule-identity.ts +++ b/src/cron/schedule-identity.ts @@ -61,9 +61,7 @@ function resolveSchedulePayload( return schedulePayloadFromRecord(job); } -export function cronScheduleIdentity( - job: Pick & { enabled?: boolean }, -): string { +function cronScheduleIdentity(job: Pick & { enabled?: boolean }): string { const schedule = resolveSchedulePayload(job as unknown as Record); if (!schedule) { throw new Error("Unsupported cron schedule kind"); diff --git a/src/cron/service-contract.ts b/src/cron/service-contract.ts index 4b96ded1c70..437a9829844 100644 --- a/src/cron/service-contract.ts +++ b/src/cron/service-contract.ts @@ -13,9 +13,7 @@ import type { } from "./service/state.js"; import type { CronJob } from "./types.js"; -export type { CronListPageOptions, CronListPageResult } from "./service/list-page-types.js"; - -export type CronWakeResult = { ok: true } | { ok: false }; +type CronWakeResult = { ok: true } | { ok: false }; export type CronServiceRunResult = CronRunResult | { ok: true; ran: false; reason: "invalid-spec" }; diff --git a/src/cron/service.ts b/src/cron/service.ts index 00ee049d005..14f43661a33 100644 --- a/src/cron/service.ts +++ b/src/cron/service.ts @@ -1,20 +1,10 @@ -import type { - CronListPageOptions, - CronServiceContract, - CronServiceRunResult, -} from "./service-contract.js"; +import type { CronServiceContract, CronServiceRunResult } from "./service-contract.js"; +import type { CronListPageOptions } from "./service/list-page-types.js"; import * as ops from "./service/ops.js"; import { type CronServiceDeps, createCronServiceState } from "./service/state.js"; import type { CronJob, CronJobCreate, CronJobPatch } from "./types.js"; export type { CronEvent, CronServiceDeps } from "./service/state.js"; -export type { - CronListPageOptions, - CronListPageResult, - CronServiceContract, - CronServiceRunResult, - CronWakeResult, -} from "./service-contract.js"; export class CronService implements CronServiceContract { private readonly state;