Files
openclaw/extensions/canvas/src/tool-schema.ts
Peter Steinberger ae55a4090c refactor(canvas): make the panel a widget presenter (#126030)
* refactor(canvas): retire legacy host and commands

* refactor(apple): narrow shared Canvas contracts

* refactor(macos): keep Canvas as widget presenter

* refactor(ios): remove Canvas client

* refactor(android): remove Canvas client

* refactor(linux): remove Canvas client

* fix(ci): isolate native locale artifacts

* fix(linux): regenerate companion lockfile

* fix(canvas): refresh native tool display metadata

* test(canvas): align coverage with presenter surface

* test(canvas): remove obsolete asset root seam

* test(canvas): stabilize retirement CI coverage

* refactor(swift): remove orphaned resource wrapper

* test(ios): remove retired canvas layout assertion

* fix(macos): reserve retired canvas command namespace

* refactor(macos): isolate canvas command policy

* fix(canvas): select only eligible macOS panels

* fix(canvas): keep panel selection plugin-owned
2026-08-19 08:21:07 -07:00

28 lines
919 B
TypeScript

/**
* Agent-facing Canvas tool schema and allowed action/format enums.
*/
import {
optionalFiniteNumberSchema,
optionalPositiveIntegerSchema,
stringEnum,
} from "openclaw/plugin-sdk/channel-actions";
import { Type } from "typebox";
/** Agent tool actions supported by the Canvas plugin. */
const CANVAS_ACTIONS = ["present", "hide", "navigate"] as const;
/** TypeBox schema for the model-facing Canvas tool arguments. */
export const CanvasToolSchema = Type.Object({
action: stringEnum(CANVAS_ACTIONS),
gatewayUrl: Type.Optional(Type.String()),
gatewayToken: Type.Optional(Type.String()),
timeoutMs: optionalPositiveIntegerSchema(),
node: Type.Optional(Type.String()),
target: Type.Optional(Type.String()),
x: optionalFiniteNumberSchema(),
y: optionalFiniteNumberSchema(),
width: optionalFiniteNumberSchema(),
height: optionalFiniteNumberSchema(),
url: Type.Optional(Type.String()),
});