mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-11 01:01:13 +00:00
fix(cron-tool): add typed properties to job/patch schemas (#55043)
Merged via squash.
Prepared head SHA: 979bb0e8b7
Co-authored-by: brunolorente <127802443+brunolorente@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Type, type TSchema } from "@sinclair/typebox";
|
||||
import { NonEmptyString } from "./primitives.js";
|
||||
|
||||
function cronAgentTurnPayloadSchema(params: { message: TSchema }) {
|
||||
function cronAgentTurnPayloadSchema(params: { message: TSchema; toolsAllow: TSchema }) {
|
||||
return Type.Object(
|
||||
{
|
||||
kind: Type.Literal("agentTurn"),
|
||||
@@ -12,6 +12,7 @@ function cronAgentTurnPayloadSchema(params: { message: TSchema }) {
|
||||
timeoutSeconds: Type.Optional(Type.Integer({ minimum: 0 })),
|
||||
allowUnsafeExternalContent: Type.Optional(Type.Boolean()),
|
||||
lightContext: Type.Optional(Type.Boolean()),
|
||||
toolsAllow: Type.Optional(params.toolsAllow),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
@@ -134,7 +135,10 @@ export const CronPayloadSchema = Type.Union([
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
cronAgentTurnPayloadSchema({ message: NonEmptyString }),
|
||||
cronAgentTurnPayloadSchema({
|
||||
message: NonEmptyString,
|
||||
toolsAllow: Type.Array(Type.String()),
|
||||
}),
|
||||
]);
|
||||
|
||||
export const CronPayloadPatchSchema = Type.Union([
|
||||
@@ -145,7 +149,10 @@ export const CronPayloadPatchSchema = Type.Union([
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
cronAgentTurnPayloadSchema({ message: Type.Optional(NonEmptyString) }),
|
||||
cronAgentTurnPayloadSchema({
|
||||
message: Type.Optional(NonEmptyString),
|
||||
toolsAllow: Type.Union([Type.Array(Type.String()), Type.Null()]),
|
||||
}),
|
||||
]);
|
||||
|
||||
export const CronFailureAlertSchema = Type.Object(
|
||||
|
||||
Reference in New Issue
Block a user