@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.
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Charging tools — status, start, stop, and set limit.
3
+ *
4
+ * Control and monitor the vehicle's charging state via the tescmd node.
5
+ * Write commands auto-wake the vehicle if it's asleep and invalidate
6
+ * the response cache on success.
7
+ */
8
+
9
+ import { Type } from "@sinclair/typebox";
10
+ import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
11
+
12
+ export function registerChargeTools(api: OpenClawPluginApi): void {
13
+ // -----------------------------------------------------------------
14
+ // tescmd_get_charge_state
15
+ // -----------------------------------------------------------------
16
+ api.registerTool(
17
+ {
18
+ name: "tescmd_get_charge_state",
19
+ label: "Get Charge State",
20
+ description:
21
+ "Get the Tesla vehicle's current charging status. Returns {charge_state} " +
22
+ "as a string: 'Charging', 'Complete', 'Stopped', 'Disconnected', 'Starting', etc. " +
23
+ "\n\nWhen to use: User asks 'is the car charging?', you need to check before " +
24
+ "starting/stopping a charge, or for a full vehicle status report. Pair with " +
25
+ "tescmd_get_battery for a complete charging picture (state + level + range). " +
26
+ "\n\nData source: ChargeState/DetailedChargeState telemetry → Fleet API charge_state.",
27
+ parameters: Type.Object({}),
28
+ async execute(_toolCallId: string, _params: Record<string, unknown>) {
29
+ return {
30
+ content: [
31
+ {
32
+ type: "text" as const,
33
+ text: "Invoking charge_state.get on tescmd node",
34
+ },
35
+ ],
36
+ details: { nodeMethod: "charge_state.get", params: {} },
37
+ };
38
+ },
39
+ },
40
+ { name: "tescmd_get_charge_state" },
41
+ );
42
+
43
+ // -----------------------------------------------------------------
44
+ // tescmd_start_charge
45
+ // -----------------------------------------------------------------
46
+ api.registerTool(
47
+ {
48
+ name: "tescmd_start_charge",
49
+ label: "Start Charging",
50
+ description:
51
+ "Start charging the Tesla vehicle. The charge cable must already be " +
52
+ "connected. Auto-wakes the vehicle if asleep (billable API call). " +
53
+ "Returns {result: true, reason: 'ok'} on success. " +
54
+ "\n\nWhen to use: User says 'start charging', 'plug in and charge', or you've " +
55
+ "checked tescmd_get_charge_state and it shows 'Stopped' or 'Disconnected' while " +
56
+ "the user wants to charge. Check charge_state first to confirm the cable is connected. " +
57
+ "\n\nWorkflow: tescmd_get_charge_state → verify connected → tescmd_start_charge → " +
58
+ "optionally tescmd_set_charge_limit if user specified a target.",
59
+ parameters: Type.Object({}),
60
+ async execute(_toolCallId: string, _params: Record<string, unknown>) {
61
+ return {
62
+ content: [
63
+ {
64
+ type: "text" as const,
65
+ text: "Invoking charge.start on tescmd node",
66
+ },
67
+ ],
68
+ details: { nodeMethod: "charge.start", params: {} },
69
+ };
70
+ },
71
+ },
72
+ { name: "tescmd_start_charge" },
73
+ );
74
+
75
+ // -----------------------------------------------------------------
76
+ // tescmd_stop_charge
77
+ // -----------------------------------------------------------------
78
+ api.registerTool(
79
+ {
80
+ name: "tescmd_stop_charge",
81
+ label: "Stop Charging",
82
+ description:
83
+ "Stop an active charging session on the Tesla vehicle. " +
84
+ "Returns {result: true, reason: 'ok'} on success. " +
85
+ "Has no effect if the vehicle is not currently charging.",
86
+ parameters: Type.Object({}),
87
+ async execute(_toolCallId: string, _params: Record<string, unknown>) {
88
+ return {
89
+ content: [
90
+ {
91
+ type: "text" as const,
92
+ text: "Invoking charge.stop on tescmd node",
93
+ },
94
+ ],
95
+ details: { nodeMethod: "charge.stop", params: {} },
96
+ };
97
+ },
98
+ },
99
+ { name: "tescmd_stop_charge" },
100
+ );
101
+
102
+ // -----------------------------------------------------------------
103
+ // tescmd_set_charge_limit
104
+ // -----------------------------------------------------------------
105
+ api.registerTool(
106
+ {
107
+ name: "tescmd_set_charge_limit",
108
+ label: "Set Charge Limit",
109
+ description:
110
+ "Set the Tesla vehicle's battery charge limit as a percentage (50-100). " +
111
+ "The vehicle will stop charging when it reaches this level. " +
112
+ "Returns {result: true, reason: 'ok'} on success. " +
113
+ "\n\nWhen to use: User says 'charge to 80%', 'set limit to 90 for my trip', " +
114
+ "or as part of a charging workflow. Tesla recommends 80% for daily use and " +
115
+ "100% only before long trips. " +
116
+ "\n\nWorkflow: Often used with tescmd_start_charge — set the limit first, then start.",
117
+ parameters: Type.Object({
118
+ percent: Type.Number({
119
+ description: "Charge limit percentage (50-100)",
120
+ minimum: 50,
121
+ maximum: 100,
122
+ }),
123
+ }),
124
+ async execute(_toolCallId: string, params: Record<string, unknown>) {
125
+ return {
126
+ content: [
127
+ {
128
+ type: "text" as const,
129
+ text: `Invoking charge.set_limit with percent=${params.percent} on tescmd node`,
130
+ },
131
+ ],
132
+ details: {
133
+ nodeMethod: "charge.set_limit",
134
+ params: { percent: params.percent },
135
+ },
136
+ };
137
+ },
138
+ },
139
+ { name: "tescmd_set_charge_limit" },
140
+ );
141
+ }
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Climate control tools — temperature reading, HVAC on/off, and temp setting.
3
+ *
4
+ * Control and monitor the vehicle's climate system via the tescmd node.
5
+ */
6
+
7
+ import { Type } from "@sinclair/typebox";
8
+ import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
9
+
10
+ export function registerClimateTools(api: OpenClawPluginApi): void {
11
+ // -----------------------------------------------------------------
12
+ // tescmd_get_temperature
13
+ // -----------------------------------------------------------------
14
+ api.registerTool(
15
+ {
16
+ name: "tescmd_get_temperature",
17
+ label: "Get Temperature",
18
+ description:
19
+ "Get the Tesla vehicle's inside cabin and outside ambient temperatures " +
20
+ "in Celsius. Returns {inside_temp_c, outside_temp_c}. " +
21
+ "\n\nWhen to use: User asks about temperature, asks 'is the car hot/cold?', " +
22
+ "or you need to decide whether to suggest preconditioning. Check this before " +
23
+ "turning on climate to give the user context ('cabin is currently 95°F, starting climate'). " +
24
+ "\n\nWorkflow: tescmd_get_temperature → decide → tescmd_climate_on + tescmd_set_climate_temp. " +
25
+ "\n\nData source: InsideTemp/OutsideTemp telemetry → Fleet API climate_state.",
26
+ parameters: Type.Object({}),
27
+ async execute(_toolCallId: string, _params: Record<string, unknown>) {
28
+ return {
29
+ content: [
30
+ {
31
+ type: "text" as const,
32
+ text: "Invoking temperature.get on tescmd node",
33
+ },
34
+ ],
35
+ details: { nodeMethod: "temperature.get", params: {} },
36
+ };
37
+ },
38
+ },
39
+ { name: "tescmd_get_temperature" },
40
+ );
41
+
42
+ // -----------------------------------------------------------------
43
+ // tescmd_climate_on
44
+ // -----------------------------------------------------------------
45
+ api.registerTool(
46
+ {
47
+ name: "tescmd_climate_on",
48
+ label: "Turn Climate On",
49
+ description:
50
+ "Turn on the Tesla vehicle's climate control (HVAC). Starts " +
51
+ "auto-conditioning at the previously set temperature. Auto-wakes if asleep. " +
52
+ "\n\nWhen to use: User says 'cool down/warm up the car', 'start climate', " +
53
+ "'precondition the cabin', or temperature check shows uncomfortable temps. " +
54
+ "Often paired with tescmd_set_climate_temp if the user specifies a target. " +
55
+ "\n\nWorkflow: tescmd_get_temperature → tescmd_climate_on → tescmd_set_climate_temp (optional).",
56
+ parameters: Type.Object({}),
57
+ async execute(_toolCallId: string, _params: Record<string, unknown>) {
58
+ return {
59
+ content: [
60
+ {
61
+ type: "text" as const,
62
+ text: "Invoking climate.on on tescmd node",
63
+ },
64
+ ],
65
+ details: { nodeMethod: "climate.on", params: {} },
66
+ };
67
+ },
68
+ },
69
+ { name: "tescmd_climate_on" },
70
+ );
71
+
72
+ // -----------------------------------------------------------------
73
+ // tescmd_climate_off
74
+ // -----------------------------------------------------------------
75
+ api.registerTool(
76
+ {
77
+ name: "tescmd_climate_off",
78
+ label: "Turn Climate Off",
79
+ description:
80
+ "Turn off the Tesla vehicle's climate control (HVAC). Stops " +
81
+ "auto-conditioning. Returns {result: true, reason: 'ok'} on success.",
82
+ parameters: Type.Object({}),
83
+ async execute(_toolCallId: string, _params: Record<string, unknown>) {
84
+ return {
85
+ content: [
86
+ {
87
+ type: "text" as const,
88
+ text: "Invoking climate.off on tescmd node",
89
+ },
90
+ ],
91
+ details: { nodeMethod: "climate.off", params: {} },
92
+ };
93
+ },
94
+ },
95
+ { name: "tescmd_climate_off" },
96
+ );
97
+
98
+ // -----------------------------------------------------------------
99
+ // tescmd_set_climate_temp
100
+ // -----------------------------------------------------------------
101
+ api.registerTool(
102
+ {
103
+ name: "tescmd_set_climate_temp",
104
+ label: "Set Climate Temperature",
105
+ description:
106
+ "Set the Tesla vehicle's cabin temperature for climate control in Fahrenheit. " +
107
+ "Sets both driver and passenger zones to the same temperature. " +
108
+ "Climate must be on (tescmd_climate_on) for the setting to take effect. " +
109
+ "\n\nWhen to use: User says 'set the car to 72 degrees', 'make it warmer/cooler'. " +
110
+ "If climate isn't already on, call tescmd_climate_on first, then set temp. " +
111
+ "\n\nCommon range: 60-85°F. Note: this takes Fahrenheit, not Celsius.",
112
+ parameters: Type.Object({
113
+ temp: Type.Number({
114
+ description: "Desired cabin temperature in Fahrenheit (e.g. 72)",
115
+ }),
116
+ }),
117
+ async execute(_toolCallId: string, params: Record<string, unknown>) {
118
+ return {
119
+ content: [
120
+ {
121
+ type: "text" as const,
122
+ text: `Invoking climate.set_temp with temp=${params.temp}°F on tescmd node`,
123
+ },
124
+ ],
125
+ details: {
126
+ nodeMethod: "climate.set_temp",
127
+ params: { temp: params.temp },
128
+ },
129
+ };
130
+ },
131
+ },
132
+ { name: "tescmd_set_climate_temp" },
133
+ );
134
+ }
@@ -0,0 +1,199 @@
1
+ /**
2
+ * Navigation tools — send destinations, GPS coordinates, and trigger HomeLink.
3
+ *
4
+ * All navigation commands target the vehicle's infotainment system and use
5
+ * signed commands via the Vehicle Command Protocol when available. The
6
+ * vehicle must be awake to receive navigation requests.
7
+ */
8
+
9
+ import { Type } from "@sinclair/typebox";
10
+ import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
11
+
12
+ export function registerNavigationTools(api: OpenClawPluginApi): void {
13
+ // -----------------------------------------------------------------
14
+ // tescmd_nav_send
15
+ // -----------------------------------------------------------------
16
+ api.registerTool(
17
+ {
18
+ name: "tescmd_nav_send",
19
+ label: "Send Destination",
20
+ description:
21
+ "Send a street address or place name to the Tesla vehicle's navigation. " +
22
+ "The destination appears on the vehicle's touchscreen, ready to start routing. " +
23
+ "Auto-wakes the vehicle if asleep. " +
24
+ "\n\nWhen to use: User says 'navigate to [place]', 'send directions to the car', " +
25
+ "or 'set the destination to [address]'. Pass the full address string. " +
26
+ "\n\nAlias: Tesla Fleet API 'share' command.",
27
+ parameters: Type.Object({
28
+ address: Type.String({
29
+ description:
30
+ "Full street address or place name (e.g. '1600 Amphitheatre Parkway, Mountain View, CA')",
31
+ }),
32
+ }),
33
+ async execute(_toolCallId: string, params: Record<string, unknown>) {
34
+ return {
35
+ content: [
36
+ {
37
+ type: "text" as const,
38
+ text: `Sending destination: ${params.address}`,
39
+ },
40
+ ],
41
+ details: {
42
+ nodeMethod: "nav.send",
43
+ params: { address: params.address },
44
+ },
45
+ };
46
+ },
47
+ },
48
+ { name: "tescmd_nav_send" },
49
+ );
50
+
51
+ // -----------------------------------------------------------------
52
+ // tescmd_nav_gps
53
+ // -----------------------------------------------------------------
54
+ api.registerTool(
55
+ {
56
+ name: "tescmd_nav_gps",
57
+ label: "Navigate to GPS Coordinates",
58
+ description:
59
+ "Send GPS coordinates to the Tesla vehicle's navigation. The vehicle will " +
60
+ "display the location and be ready to start routing. Useful when you have " +
61
+ "exact coordinates rather than a street address. Auto-wakes the vehicle. " +
62
+ "\n\nWhen to use: User provides lat/lon coordinates, or you've obtained " +
63
+ "coordinates from a location lookup. Optionally set 'order' for multi-stop trips.",
64
+ parameters: Type.Object({
65
+ lat: Type.Number({ description: "Latitude in decimal degrees" }),
66
+ lon: Type.Number({ description: "Longitude in decimal degrees" }),
67
+ order: Type.Optional(
68
+ Type.Number({
69
+ description: "Waypoint order for multi-stop navigation (0-based)",
70
+ }),
71
+ ),
72
+ }),
73
+ async execute(_toolCallId: string, params: Record<string, unknown>) {
74
+ return {
75
+ content: [
76
+ {
77
+ type: "text" as const,
78
+ text: `Navigating to GPS: ${params.lat}, ${params.lon}`,
79
+ },
80
+ ],
81
+ details: {
82
+ nodeMethod: "nav.gps",
83
+ params: {
84
+ lat: params.lat,
85
+ lon: params.lon,
86
+ ...(params.order != null ? { order: params.order } : {}),
87
+ },
88
+ },
89
+ };
90
+ },
91
+ },
92
+ { name: "tescmd_nav_gps" },
93
+ );
94
+
95
+ // -----------------------------------------------------------------
96
+ // tescmd_nav_supercharger
97
+ // -----------------------------------------------------------------
98
+ api.registerTool(
99
+ {
100
+ name: "tescmd_nav_supercharger",
101
+ label: "Navigate to Supercharger",
102
+ description:
103
+ "Send the vehicle to the nearest Tesla Supercharger. The vehicle's " +
104
+ "navigation will route to the closest available Supercharger station. " +
105
+ "Auto-wakes the vehicle. " +
106
+ "\n\nWhen to use: User says 'find a Supercharger', 'I need to charge', " +
107
+ "or battery is low and no home charger is available. Pair with " +
108
+ "tescmd_get_battery to check if charging is actually needed first.",
109
+ parameters: Type.Object({}),
110
+ async execute(_toolCallId: string, _params: Record<string, unknown>) {
111
+ return {
112
+ content: [
113
+ {
114
+ type: "text" as const,
115
+ text: "Navigating to nearest Supercharger",
116
+ },
117
+ ],
118
+ details: { nodeMethod: "nav.supercharger", params: {} },
119
+ };
120
+ },
121
+ },
122
+ { name: "tescmd_nav_supercharger" },
123
+ );
124
+
125
+ // -----------------------------------------------------------------
126
+ // tescmd_nav_waypoints
127
+ // -----------------------------------------------------------------
128
+ api.registerTool(
129
+ {
130
+ name: "tescmd_nav_waypoints",
131
+ label: "Send Multi-Stop Waypoints",
132
+ description:
133
+ "Send a multi-stop route to the Tesla vehicle using waypoints. " +
134
+ "Waypoints are specified as a comma-separated string of encoded " +
135
+ "reference IDs (Google Place IDs in refId format). The vehicle will " +
136
+ "create a multi-stop route through all waypoints in order. " +
137
+ "\n\nWhen to use: User wants a road trip with multiple stops, " +
138
+ "or needs to plan a route through several destinations.",
139
+ parameters: Type.Object({
140
+ waypoints: Type.String({
141
+ description: "Comma-separated waypoint reference IDs (Google Place IDs in refId format)",
142
+ }),
143
+ }),
144
+ async execute(_toolCallId: string, params: Record<string, unknown>) {
145
+ return {
146
+ content: [
147
+ {
148
+ type: "text" as const,
149
+ text: `Sending waypoints: ${params.waypoints}`,
150
+ },
151
+ ],
152
+ details: {
153
+ nodeMethod: "nav.waypoints",
154
+ params: { waypoints: params.waypoints },
155
+ },
156
+ };
157
+ },
158
+ },
159
+ { name: "tescmd_nav_waypoints" },
160
+ );
161
+
162
+ // -----------------------------------------------------------------
163
+ // tescmd_homelink
164
+ // -----------------------------------------------------------------
165
+ api.registerTool(
166
+ {
167
+ name: "tescmd_homelink",
168
+ label: "Trigger HomeLink",
169
+ description:
170
+ "Trigger the vehicle's HomeLink to open or close a garage door. " +
171
+ "Requires the vehicle's current GPS coordinates (lat/lon) to verify " +
172
+ "the vehicle is within range of the programmed HomeLink device. " +
173
+ "Auto-wakes the vehicle. " +
174
+ "\n\nWhen to use: User says 'open the garage', 'trigger HomeLink', " +
175
+ "or 'open the garage door'. Get the vehicle's location first with " +
176
+ "tescmd_get_location to provide the lat/lon coordinates. " +
177
+ "\n\nWorkflow: tescmd_get_location → extract lat/lon → tescmd_homelink.",
178
+ parameters: Type.Object({
179
+ lat: Type.Number({ description: "Vehicle's current latitude" }),
180
+ lon: Type.Number({ description: "Vehicle's current longitude" }),
181
+ }),
182
+ async execute(_toolCallId: string, params: Record<string, unknown>) {
183
+ return {
184
+ content: [
185
+ {
186
+ type: "text" as const,
187
+ text: "Triggering HomeLink",
188
+ },
189
+ ],
190
+ details: {
191
+ nodeMethod: "homelink.trigger",
192
+ params: { lat: params.lat, lon: params.lon },
193
+ },
194
+ };
195
+ },
196
+ },
197
+ { name: "tescmd_homelink" },
198
+ );
199
+ }
@@ -0,0 +1,207 @@
1
+ /**
2
+ * Security tools — lock state, door lock/unlock, flash, honk, sentry mode.
3
+ *
4
+ * Control and monitor the vehicle's security features via the tescmd node.
5
+ * All write commands auto-wake the vehicle if asleep.
6
+ */
7
+
8
+ import { Type } from "@sinclair/typebox";
9
+ import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
10
+
11
+ export function registerSecurityTools(api: OpenClawPluginApi): void {
12
+ // -----------------------------------------------------------------
13
+ // tescmd_get_security
14
+ // -----------------------------------------------------------------
15
+ api.registerTool(
16
+ {
17
+ name: "tescmd_get_security",
18
+ label: "Get Security Status",
19
+ description:
20
+ "Get the Tesla vehicle's security status: whether doors are locked " +
21
+ "and whether Sentry Mode is active. Returns {locked: boolean, sentry_mode: boolean}. " +
22
+ "\n\nWhen to use: User asks 'is my car locked?', 'is sentry on?', part of a " +
23
+ "'vehicle status' overview, or before deciding whether to lock/enable sentry. " +
24
+ "\n\nData source: Locked/SentryMode telemetry → Fleet API vehicle_state.",
25
+ parameters: Type.Object({}),
26
+ async execute(_toolCallId: string, _params: Record<string, unknown>) {
27
+ return {
28
+ content: [
29
+ {
30
+ type: "text" as const,
31
+ text: "Invoking security.get on tescmd node",
32
+ },
33
+ ],
34
+ details: { nodeMethod: "security.get", params: {} },
35
+ };
36
+ },
37
+ },
38
+ { name: "tescmd_get_security" },
39
+ );
40
+
41
+ // -----------------------------------------------------------------
42
+ // tescmd_lock_doors
43
+ // -----------------------------------------------------------------
44
+ api.registerTool(
45
+ {
46
+ name: "tescmd_lock_doors",
47
+ label: "Lock Doors",
48
+ description:
49
+ "Lock all doors on the Tesla vehicle. Uses the VCSEC (Vehicle " +
50
+ "Security) command domain with signed commands when available. " +
51
+ "Auto-wakes the vehicle if asleep. Returns {result: true, reason: 'ok'}.",
52
+ parameters: Type.Object({}),
53
+ async execute(_toolCallId: string, _params: Record<string, unknown>) {
54
+ return {
55
+ content: [
56
+ {
57
+ type: "text" as const,
58
+ text: "Invoking door.lock on tescmd node",
59
+ },
60
+ ],
61
+ details: { nodeMethod: "door.lock", params: {} },
62
+ };
63
+ },
64
+ },
65
+ { name: "tescmd_lock_doors" },
66
+ );
67
+
68
+ // -----------------------------------------------------------------
69
+ // tescmd_unlock_doors
70
+ // -----------------------------------------------------------------
71
+ api.registerTool(
72
+ {
73
+ name: "tescmd_unlock_doors",
74
+ label: "Unlock Doors",
75
+ description:
76
+ "Unlock all doors on the Tesla vehicle. Uses signed VCSEC commands " +
77
+ "when available. Auto-wakes if asleep. Returns {result: true, reason: 'ok'}. " +
78
+ "\n\nWhen to use: User explicitly asks to unlock. IMPORTANT: This grants " +
79
+ "physical access to the vehicle — always confirm the user's intent before " +
80
+ "unlocking. Never unlock proactively or as part of an automated workflow " +
81
+ "without explicit user confirmation.",
82
+ parameters: Type.Object({}),
83
+ async execute(_toolCallId: string, _params: Record<string, unknown>) {
84
+ return {
85
+ content: [
86
+ {
87
+ type: "text" as const,
88
+ text: "Invoking door.unlock on tescmd node",
89
+ },
90
+ ],
91
+ details: { nodeMethod: "door.unlock", params: {} },
92
+ };
93
+ },
94
+ },
95
+ { name: "tescmd_unlock_doors" },
96
+ );
97
+
98
+ // -----------------------------------------------------------------
99
+ // tescmd_flash_lights
100
+ // -----------------------------------------------------------------
101
+ api.registerTool(
102
+ {
103
+ name: "tescmd_flash_lights",
104
+ label: "Flash Lights",
105
+ description:
106
+ "Flash the Tesla vehicle's headlights briefly. Useful for " +
107
+ "locating the vehicle in a parking lot or signaling. " +
108
+ "Auto-wakes the vehicle if asleep.",
109
+ parameters: Type.Object({}),
110
+ async execute(_toolCallId: string, _params: Record<string, unknown>) {
111
+ return {
112
+ content: [
113
+ {
114
+ type: "text" as const,
115
+ text: "Invoking flash_lights on tescmd node",
116
+ },
117
+ ],
118
+ details: { nodeMethod: "flash_lights", params: {} },
119
+ };
120
+ },
121
+ },
122
+ { name: "tescmd_flash_lights" },
123
+ );
124
+
125
+ // -----------------------------------------------------------------
126
+ // tescmd_honk_horn
127
+ // -----------------------------------------------------------------
128
+ api.registerTool(
129
+ {
130
+ name: "tescmd_honk_horn",
131
+ label: "Honk Horn",
132
+ description:
133
+ "Honk the Tesla vehicle's horn briefly. Useful for locating " +
134
+ "the vehicle or alerting nearby people. Auto-wakes the vehicle if asleep.",
135
+ parameters: Type.Object({}),
136
+ async execute(_toolCallId: string, _params: Record<string, unknown>) {
137
+ return {
138
+ content: [
139
+ {
140
+ type: "text" as const,
141
+ text: "Invoking honk_horn on tescmd node",
142
+ },
143
+ ],
144
+ details: { nodeMethod: "honk_horn", params: {} },
145
+ };
146
+ },
147
+ },
148
+ { name: "tescmd_honk_horn" },
149
+ );
150
+
151
+ // -----------------------------------------------------------------
152
+ // tescmd_sentry_on
153
+ // -----------------------------------------------------------------
154
+ api.registerTool(
155
+ {
156
+ name: "tescmd_sentry_on",
157
+ label: "Enable Sentry Mode",
158
+ description:
159
+ "Enable Sentry Mode on the Tesla vehicle. When active, cameras monitor " +
160
+ "surroundings and record events on potential threats (people approaching, " +
161
+ "door attempts, etc.). Uses ~1-2% battery per hour. " +
162
+ "\n\nWhen to use: User says 'turn on sentry', 'watch the car', or as part of " +
163
+ "a parking security workflow. Consider warning about battery impact if the " +
164
+ "car has low charge. " +
165
+ "\n\nWorkflow: tescmd_lock_doors → tescmd_sentry_on → optionally tescmd_location_trigger (geofence).",
166
+ parameters: Type.Object({}),
167
+ async execute(_toolCallId: string, _params: Record<string, unknown>) {
168
+ return {
169
+ content: [
170
+ {
171
+ type: "text" as const,
172
+ text: "Invoking sentry.on on tescmd node",
173
+ },
174
+ ],
175
+ details: { nodeMethod: "sentry.on", params: {} },
176
+ };
177
+ },
178
+ },
179
+ { name: "tescmd_sentry_on" },
180
+ );
181
+
182
+ // -----------------------------------------------------------------
183
+ // tescmd_sentry_off
184
+ // -----------------------------------------------------------------
185
+ api.registerTool(
186
+ {
187
+ name: "tescmd_sentry_off",
188
+ label: "Disable Sentry Mode",
189
+ description:
190
+ "Disable Sentry Mode on the Tesla vehicle. Stops camera monitoring " +
191
+ "and reduces battery drain. Returns {result: true, reason: 'ok'}.",
192
+ parameters: Type.Object({}),
193
+ async execute(_toolCallId: string, _params: Record<string, unknown>) {
194
+ return {
195
+ content: [
196
+ {
197
+ type: "text" as const,
198
+ text: "Invoking sentry.off on tescmd node",
199
+ },
200
+ ],
201
+ details: { nodeMethod: "sentry.off", params: {} },
202
+ };
203
+ },
204
+ },
205
+ { name: "tescmd_sentry_off" },
206
+ );
207
+ }