File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 */
44import {
55 optionalFiniteNumberSchema ,
6- optionalNonNegativeIntegerSchema ,
76 optionalPositiveIntegerSchema ,
87 stringEnum ,
98} from "openclaw/plugin-sdk/channel-actions" ;
@@ -40,7 +39,6 @@ export const CanvasToolSchema = Type.Object({
4039 outputFormat : Type . Optional ( stringEnum ( CANVAS_SNAPSHOT_FORMATS ) ) ,
4140 maxWidth : optionalPositiveIntegerSchema ( ) ,
4241 quality : optionalFiniteNumberSchema ( { minimum : 0 , maximum : 1 } ) ,
43- delayMs : optionalNonNegativeIntegerSchema ( ) ,
4442 jsonl : Type . Optional ( Type . String ( ) ) ,
4543 jsonlPath : Type . Optional ( Type . String ( ) ) ,
4644} ) ;
Original file line number Diff line number Diff line change @@ -377,4 +377,18 @@ describe("Canvas tool", () => {
377377 ) ;
378378 expect ( mocks . imageResultFromFile ) . not . toHaveBeenCalled ( ) ;
379379 } ) ;
380+
381+ it ( "advertises only snapshot controls supported by Canvas nodes" , ( ) => {
382+ const schema = createCanvasTool ( ) . parameters as {
383+ properties ?: Record < string , unknown > ;
384+ } ;
385+
386+ expect ( schema . properties ?. outputFormat ) . toMatchObject ( {
387+ type : "string" ,
388+ enum : [ "png" , "jpg" , "jpeg" ] ,
389+ } ) ;
390+ expect ( schema . properties ?. maxWidth ) . toMatchObject ( { type : "integer" , minimum : 1 } ) ;
391+ expect ( schema . properties ?. quality ) . toMatchObject ( { type : "number" , minimum : 0 , maximum : 1 } ) ;
392+ expect ( schema . properties ) . not . toHaveProperty ( "delayMs" ) ;
393+ } ) ;
380394} ) ;
You can’t perform that action at this time.
0 commit comments