mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 19:38:28 +00:00
feat(cron): enhance delivery modes and job configuration
- Updated isolated cron jobs to support new delivery modes: `announce` and `none`, improving output management. - Refactored job configuration to remove legacy fields and streamline delivery settings. - Enhanced the `CronJobEditor` UI to reflect changes in delivery options, including a new segmented control for delivery mode selection. - Updated documentation to clarify the new delivery configurations and their implications for job execution. - Improved tests to validate the new delivery behavior and ensure backward compatibility with legacy settings. This update provides users with greater flexibility in managing how isolated jobs deliver their outputs, enhancing overall usability and clarity in job configurations.
This commit is contained in:
committed by
Peter Steinberger
parent
ab9f06f4ff
commit
3f82daefd8
@@ -5,7 +5,7 @@ export const CronScheduleSchema = Type.Union([
|
||||
Type.Object(
|
||||
{
|
||||
kind: Type.Literal("at"),
|
||||
atMs: Type.Integer({ minimum: 0 }),
|
||||
at: NonEmptyString,
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
@@ -77,7 +77,7 @@ export const CronPayloadPatchSchema = Type.Union([
|
||||
|
||||
export const CronDeliverySchema = Type.Object(
|
||||
{
|
||||
mode: Type.Union([Type.Literal("none"), Type.Literal("announce"), Type.Literal("deliver")]),
|
||||
mode: Type.Union([Type.Literal("none"), Type.Literal("announce")]),
|
||||
channel: Type.Optional(Type.Union([Type.Literal("last"), NonEmptyString])),
|
||||
to: Type.Optional(Type.String()),
|
||||
bestEffort: Type.Optional(Type.Boolean()),
|
||||
@@ -87,9 +87,7 @@ export const CronDeliverySchema = Type.Object(
|
||||
|
||||
export const CronDeliveryPatchSchema = Type.Object(
|
||||
{
|
||||
mode: Type.Optional(
|
||||
Type.Union([Type.Literal("none"), Type.Literal("announce"), Type.Literal("deliver")]),
|
||||
),
|
||||
mode: Type.Optional(Type.Union([Type.Literal("none"), Type.Literal("announce")])),
|
||||
channel: Type.Optional(Type.Union([Type.Literal("last"), NonEmptyString])),
|
||||
to: Type.Optional(Type.String()),
|
||||
bestEffort: Type.Optional(Type.Boolean()),
|
||||
@@ -97,15 +95,6 @@ export const CronDeliveryPatchSchema = Type.Object(
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const CronIsolationSchema = Type.Object(
|
||||
{
|
||||
postToMainPrefix: Type.Optional(Type.String()),
|
||||
postToMainMode: Type.Optional(Type.Union([Type.Literal("summary"), Type.Literal("full")])),
|
||||
postToMainMaxChars: Type.Optional(Type.Integer({ minimum: 0 })),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const CronJobStateSchema = Type.Object(
|
||||
{
|
||||
nextRunAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
||||
@@ -135,7 +124,6 @@ export const CronJobSchema = Type.Object(
|
||||
wakeMode: Type.Union([Type.Literal("next-heartbeat"), Type.Literal("now")]),
|
||||
payload: CronPayloadSchema,
|
||||
delivery: Type.Optional(CronDeliverySchema),
|
||||
isolation: Type.Optional(CronIsolationSchema),
|
||||
state: CronJobStateSchema,
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
@@ -162,7 +150,6 @@ export const CronAddParamsSchema = Type.Object(
|
||||
wakeMode: Type.Union([Type.Literal("next-heartbeat"), Type.Literal("now")]),
|
||||
payload: CronPayloadSchema,
|
||||
delivery: Type.Optional(CronDeliverySchema),
|
||||
isolation: Type.Optional(CronIsolationSchema),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
@@ -179,7 +166,6 @@ export const CronJobPatchSchema = Type.Object(
|
||||
wakeMode: Type.Optional(Type.Union([Type.Literal("next-heartbeat"), Type.Literal("now")])),
|
||||
payload: Type.Optional(CronPayloadPatchSchema),
|
||||
delivery: Type.Optional(CronDeliveryPatchSchema),
|
||||
isolation: Type.Optional(CronIsolationSchema),
|
||||
state: Type.Optional(Type.Partial(CronJobStateSchema)),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
|
||||
Reference in New Issue
Block a user