Nodes: advertise canvas invoke commands
This commit is contained in:
@@ -8,21 +8,3 @@ public enum ClawdisCanvasCommand: String, Codable, Sendable {
|
||||
case evalJS = "canvas.eval"
|
||||
case snapshot = "canvas.snapshot"
|
||||
}
|
||||
|
||||
public enum ClawdisInvokeCommandAliases {
|
||||
public static func canonicalizeCanvasToScreen(_ command: String) -> String {
|
||||
if command.hasPrefix(ClawdisCanvasCommand.namespacePrefix) {
|
||||
return ClawdisScreenCommand.namespacePrefix +
|
||||
command.dropFirst(ClawdisCanvasCommand.namespacePrefix.count)
|
||||
}
|
||||
return command
|
||||
}
|
||||
}
|
||||
|
||||
extension ClawdisCanvasCommand {
|
||||
public static var namespacePrefix: String { "canvas." }
|
||||
}
|
||||
|
||||
extension ClawdisScreenCommand {
|
||||
public static var namespacePrefix: String { "screen." }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user