@oceanswave/openclaw-tescmd 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +183 -0
- package/commands/cli.ts +74 -0
- package/commands/slash.ts +160 -0
- package/config.ts +39 -0
- package/index.ts +107 -0
- package/openclaw.plugin.json +22 -0
- package/package.json +46 -0
- package/platform.ts +361 -0
- package/skill.md +737 -0
- package/telemetry.ts +245 -0
- package/tools/capabilities.ts +341 -0
- package/tools/charge.ts +141 -0
- package/tools/climate.ts +134 -0
- package/tools/navigation.ts +199 -0
- package/tools/security.ts +207 -0
- package/tools/status.ts +47 -0
- package/tools/system.ts +67 -0
- package/tools/triggers.ts +311 -0
- package/tools/trunk.ts +67 -0
- package/tools/vehicle.ts +115 -0
- package/types/openclaw.d.ts +108 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type declarations for the OpenClaw Plugin SDK.
|
|
3
|
+
*
|
|
4
|
+
* These mirror the runtime API surface provided to plugins via the
|
|
5
|
+
* `register(api)` lifecycle method.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
declare module "openclaw/plugin-sdk" {
|
|
9
|
+
import type { TSchema } from "@sinclair/typebox";
|
|
10
|
+
|
|
11
|
+
/** Logger interface provided to plugins. */
|
|
12
|
+
interface PluginLogger {
|
|
13
|
+
info(message: string, ...args: unknown[]): void;
|
|
14
|
+
warn(message: string, ...args: unknown[]): void;
|
|
15
|
+
error(message: string, ...args: unknown[]): void;
|
|
16
|
+
debug(message: string, ...args: unknown[]): void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Tool execution result returned to the agent. */
|
|
20
|
+
interface ToolResult {
|
|
21
|
+
content: Array<{ type: "text"; text: string }>;
|
|
22
|
+
details?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Tool definition registered with the API. */
|
|
26
|
+
interface ToolDefinition {
|
|
27
|
+
name: string;
|
|
28
|
+
label: string;
|
|
29
|
+
description: string;
|
|
30
|
+
parameters: TSchema;
|
|
31
|
+
execute(toolCallId: string, params: Record<string, unknown>): Promise<ToolResult>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Tool registration options. */
|
|
35
|
+
interface ToolOptions {
|
|
36
|
+
name: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Platform definition for node registration. */
|
|
40
|
+
interface PlatformDefinition {
|
|
41
|
+
id: string;
|
|
42
|
+
label: string;
|
|
43
|
+
description: string;
|
|
44
|
+
nodeRole: string;
|
|
45
|
+
scopes: string[];
|
|
46
|
+
commands: PlatformCommand[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** A whitelisted command for a platform. */
|
|
50
|
+
interface PlatformCommand {
|
|
51
|
+
method: string;
|
|
52
|
+
label: string;
|
|
53
|
+
description: string;
|
|
54
|
+
direction: "read" | "write";
|
|
55
|
+
parameters?: TSchema;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Slash command definition. */
|
|
59
|
+
interface CommandDefinition {
|
|
60
|
+
name: string;
|
|
61
|
+
description: string;
|
|
62
|
+
acceptsArgs?: boolean;
|
|
63
|
+
requireAuth?: boolean;
|
|
64
|
+
handler(ctx: CommandContext): Promise<{ text: string }>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Slash command handler context. */
|
|
68
|
+
interface CommandContext {
|
|
69
|
+
senderId: string;
|
|
70
|
+
channel: string;
|
|
71
|
+
isAuthorizedSender: boolean;
|
|
72
|
+
args: string;
|
|
73
|
+
commandBody: string;
|
|
74
|
+
config: Record<string, unknown>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Service lifecycle. */
|
|
78
|
+
interface ServiceDefinition {
|
|
79
|
+
id: string;
|
|
80
|
+
start(): void | Promise<void>;
|
|
81
|
+
stop(): void | Promise<void>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Gateway RPC method handler. */
|
|
85
|
+
interface GatewayMethodContext {
|
|
86
|
+
respond(ok: boolean, payload: Record<string, unknown>): void;
|
|
87
|
+
params: Record<string, unknown>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** The main plugin API surface. */
|
|
91
|
+
interface OpenClawPluginApi {
|
|
92
|
+
pluginConfig: unknown;
|
|
93
|
+
logger: PluginLogger;
|
|
94
|
+
registerTool(tool: ToolDefinition, options: ToolOptions): void;
|
|
95
|
+
registerCommand(command: CommandDefinition): void;
|
|
96
|
+
registerCli(
|
|
97
|
+
handler: (ctx: { program: unknown }) => void,
|
|
98
|
+
options?: { commands: string[] },
|
|
99
|
+
): void;
|
|
100
|
+
registerService(service: ServiceDefinition): void;
|
|
101
|
+
registerPlatform(platform: PlatformDefinition): void;
|
|
102
|
+
registerGatewayMethod(method: string, handler: (ctx: GatewayMethodContext) => void): void;
|
|
103
|
+
on(event: string, handler: (...args: unknown[]) => unknown): void;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Helper to create TypeBox-compatible string enums. */
|
|
107
|
+
function stringEnum<T extends string>(values: readonly T[]): TSchema;
|
|
108
|
+
}
|