machinaos 0.0.12 → 0.0.13
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/client/package.json +1 -1
- package/client/src/components/OutputPanel.tsx +3 -2
- package/client/src/components/parameterPanel/InputSection.tsx +4 -3
- package/package.json +1 -1
- package/server/routers/websocket.py +5 -5
- package/server/services/ai.py +38 -13
- package/server/services/deployment/manager.py +14 -0
- package/server/services/execution/executor.py +2 -0
- package/server/services/execution/models.py +8 -0
- package/server/services/handlers/ai.py +71 -23
- package/server/services/handlers/tools.py +103 -6
- package/server/skills/android_agent/app-launcher-skill/SKILL.md +137 -0
- package/server/skills/android_agent/app-list-skill/SKILL.md +148 -0
- package/server/skills/android_agent/audio-skill/SKILL.md +169 -0
- package/server/skills/android_agent/battery-skill/SKILL.md +114 -0
- package/server/skills/android_agent/bluetooth-skill/SKILL.md +151 -0
- package/server/skills/android_agent/camera-skill/SKILL.md +148 -0
- package/server/skills/android_agent/environmental-skill/SKILL.md +140 -0
- package/server/skills/android_agent/location-skill/SKILL.md +163 -0
- package/server/skills/android_agent/motion-skill/SKILL.md +141 -0
- package/server/skills/android_agent/screen-control-skill/SKILL.md +164 -0
- package/server/skills/android_agent/wifi-skill/SKILL.md +182 -0
- package/server/skills/assistant/subagent-skill/SKILL.md +62 -30
- package/server/skills/coding_agent/javascript-skill/SKILL.md +196 -0
- package/server/skills/coding_agent/python-skill/SKILL.md +165 -0
- package/server/skills/social_agent/whatsapp-db-skill/SKILL.md +284 -0
- package/server/skills/social_agent/whatsapp-send-skill/SKILL.md +180 -0
- package/server/skills/task_agent/cron-scheduler-skill/SKILL.md +215 -0
- package/server/skills/task_agent/task-manager-skill/SKILL.md +251 -0
- package/server/skills/task_agent/timer-skill/SKILL.md +168 -0
- package/server/skills/travel_agent/geocoding-skill/SKILL.md +186 -0
- package/server/skills/travel_agent/nearby-places-skill/SKILL.md +234 -0
- package/server/skills/web_agent/http-request-skill/SKILL.md +211 -0
- package/server/skills/android/skill/SKILL.md +0 -84
- package/server/skills/assistant/code-skill/SKILL.md +0 -176
- package/server/skills/assistant/http-skill/SKILL.md +0 -163
- package/server/skills/assistant/maps-skill/SKILL.md +0 -172
- package/server/skills/assistant/scheduler-skill/SKILL.md +0 -86
- package/server/skills/assistant/whatsapp-skill/SKILL.md +0 -285
- /package/server/skills/{android → android_agent}/personality/SKILL.md +0 -0
- /package/server/skills/{assistant → web_agent}/web-search-skill/SKILL.md +0 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: screen-control-skill
|
|
3
|
+
description: Control Android screen - brightness, wake screen, auto-brightness toggle, and screen timeout settings.
|
|
4
|
+
allowed-tools: screen_control_automation
|
|
5
|
+
metadata:
|
|
6
|
+
author: machina
|
|
7
|
+
version: "1.0"
|
|
8
|
+
category: android
|
|
9
|
+
icon: "💡"
|
|
10
|
+
color: "#EAB308"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Screen Control Tool
|
|
14
|
+
|
|
15
|
+
Control screen settings on Android device.
|
|
16
|
+
|
|
17
|
+
## How It Works
|
|
18
|
+
|
|
19
|
+
This skill provides instructions for the **Screen Control Automation** tool node. Connect the **Screen Control Automation** node to Zeenie's `input-tools` handle to enable screen control.
|
|
20
|
+
|
|
21
|
+
## screen_control Tool
|
|
22
|
+
|
|
23
|
+
Control screen brightness and display settings.
|
|
24
|
+
|
|
25
|
+
### Schema Fields
|
|
26
|
+
|
|
27
|
+
| Field | Type | Required | Description |
|
|
28
|
+
|-------|------|----------|-------------|
|
|
29
|
+
| action | string | Yes | Action to perform (see below) |
|
|
30
|
+
| parameters | object | No | Additional parameters for set actions |
|
|
31
|
+
|
|
32
|
+
### Actions
|
|
33
|
+
|
|
34
|
+
| Action | Description |
|
|
35
|
+
|--------|-------------|
|
|
36
|
+
| `status` | Get current screen settings |
|
|
37
|
+
| `set_brightness` | Set screen brightness level |
|
|
38
|
+
| `wake` | Wake the screen |
|
|
39
|
+
| `auto_brightness_on` | Enable auto-brightness |
|
|
40
|
+
| `auto_brightness_off` | Disable auto-brightness |
|
|
41
|
+
|
|
42
|
+
### Examples
|
|
43
|
+
|
|
44
|
+
**Get screen status:**
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"action": "status"
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Set brightness to 50%:**
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"action": "set_brightness",
|
|
55
|
+
"parameters": {
|
|
56
|
+
"level": 50
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Wake the screen:**
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"action": "wake"
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Enable auto-brightness:**
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"action": "auto_brightness_on"
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Disable auto-brightness:**
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"action": "auto_brightness_off"
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Response Formats
|
|
83
|
+
|
|
84
|
+
**Status response:**
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"success": true,
|
|
88
|
+
"service": "screen_control",
|
|
89
|
+
"action": "status",
|
|
90
|
+
"data": {
|
|
91
|
+
"brightness": 75,
|
|
92
|
+
"auto_brightness": true,
|
|
93
|
+
"screen_on": true,
|
|
94
|
+
"screen_timeout": 30000
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Set brightness response:**
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"success": true,
|
|
103
|
+
"service": "screen_control",
|
|
104
|
+
"action": "set_brightness",
|
|
105
|
+
"data": {
|
|
106
|
+
"previous_brightness": 100,
|
|
107
|
+
"new_brightness": 50
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Response Fields
|
|
113
|
+
|
|
114
|
+
| Field | Type | Description |
|
|
115
|
+
|-------|------|-------------|
|
|
116
|
+
| brightness | int | Current brightness (0-100) |
|
|
117
|
+
| auto_brightness | boolean | Auto-brightness enabled |
|
|
118
|
+
| screen_on | boolean | Screen is currently on |
|
|
119
|
+
| screen_timeout | int | Timeout in milliseconds |
|
|
120
|
+
|
|
121
|
+
## Use Cases
|
|
122
|
+
|
|
123
|
+
| Use Case | Action | Description |
|
|
124
|
+
|----------|--------|-------------|
|
|
125
|
+
| Check display | status | Get current settings |
|
|
126
|
+
| Lower brightness | set_brightness | Reduce for battery/eyes |
|
|
127
|
+
| Wake device | wake | Turn on screen |
|
|
128
|
+
| Enable adaptive | auto_brightness_on | Let system adjust |
|
|
129
|
+
| Fixed brightness | auto_brightness_off | Manual control |
|
|
130
|
+
|
|
131
|
+
## Common Workflows
|
|
132
|
+
|
|
133
|
+
### Battery saving
|
|
134
|
+
|
|
135
|
+
1. Disable auto-brightness
|
|
136
|
+
2. Set brightness to 30%
|
|
137
|
+
3. Reduce screen timeout
|
|
138
|
+
|
|
139
|
+
### Night mode
|
|
140
|
+
|
|
141
|
+
1. Disable auto-brightness
|
|
142
|
+
2. Set brightness to 10-20%
|
|
143
|
+
3. Enable blue light filter (if available)
|
|
144
|
+
|
|
145
|
+
### Presentation mode
|
|
146
|
+
|
|
147
|
+
1. Disable auto-brightness
|
|
148
|
+
2. Set brightness to 100%
|
|
149
|
+
3. Increase screen timeout
|
|
150
|
+
|
|
151
|
+
## Brightness Guidelines
|
|
152
|
+
|
|
153
|
+
| Level | Use Case |
|
|
154
|
+
|-------|----------|
|
|
155
|
+
| 0-20% | Night/dark room |
|
|
156
|
+
| 20-50% | Indoor use |
|
|
157
|
+
| 50-80% | Normal use |
|
|
158
|
+
| 80-100% | Bright conditions/outdoor |
|
|
159
|
+
|
|
160
|
+
## Setup Requirements
|
|
161
|
+
|
|
162
|
+
1. Connect the **Screen Control Automation** node to Zeenie's `input-tools` handle
|
|
163
|
+
2. Android device must be paired
|
|
164
|
+
3. System settings permission may be required
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wifi-skill
|
|
3
|
+
description: Control Android WiFi - enable, disable, get status, scan for networks, and get current connection info.
|
|
4
|
+
allowed-tools: wifi_automation
|
|
5
|
+
metadata:
|
|
6
|
+
author: machina
|
|
7
|
+
version: "1.0"
|
|
8
|
+
category: android
|
|
9
|
+
icon: "📶"
|
|
10
|
+
color: "#3B82F6"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# WiFi Automation Tool
|
|
14
|
+
|
|
15
|
+
Control WiFi on Android devices.
|
|
16
|
+
|
|
17
|
+
## How It Works
|
|
18
|
+
|
|
19
|
+
This skill provides instructions for the **WiFi Automation** tool node. Connect the **WiFi Automation** node to Zeenie's `input-tools` handle to enable WiFi control.
|
|
20
|
+
|
|
21
|
+
## wifi_automation Tool
|
|
22
|
+
|
|
23
|
+
Control WiFi settings and get network information.
|
|
24
|
+
|
|
25
|
+
### Schema Fields
|
|
26
|
+
|
|
27
|
+
| Field | Type | Required | Description |
|
|
28
|
+
|-------|------|----------|-------------|
|
|
29
|
+
| action | string | Yes | Action to perform (see below) |
|
|
30
|
+
| parameters | object | No | Additional parameters for certain actions |
|
|
31
|
+
|
|
32
|
+
### Actions
|
|
33
|
+
|
|
34
|
+
| Action | Description | Parameters |
|
|
35
|
+
|--------|-------------|------------|
|
|
36
|
+
| `status` | Get WiFi status and connection info | None |
|
|
37
|
+
| `enable` | Turn WiFi on | None |
|
|
38
|
+
| `disable` | Turn WiFi off | None |
|
|
39
|
+
| `scan` | Scan for available networks | None |
|
|
40
|
+
|
|
41
|
+
### Examples
|
|
42
|
+
|
|
43
|
+
**Get WiFi status:**
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"action": "status"
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Enable WiFi:**
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"action": "enable"
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Disable WiFi:**
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"action": "disable"
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Scan for networks:**
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"action": "scan"
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Response Formats
|
|
72
|
+
|
|
73
|
+
**Status response:**
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"success": true,
|
|
77
|
+
"service": "wifi_automation",
|
|
78
|
+
"action": "status",
|
|
79
|
+
"data": {
|
|
80
|
+
"enabled": true,
|
|
81
|
+
"connected": true,
|
|
82
|
+
"ssid": "MyHomeNetwork",
|
|
83
|
+
"bssid": "aa:bb:cc:dd:ee:ff",
|
|
84
|
+
"ip_address": "192.168.1.100",
|
|
85
|
+
"link_speed": 72,
|
|
86
|
+
"rssi": -45,
|
|
87
|
+
"frequency": 2437
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Scan response:**
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"success": true,
|
|
96
|
+
"service": "wifi_automation",
|
|
97
|
+
"action": "scan",
|
|
98
|
+
"data": {
|
|
99
|
+
"networks": [
|
|
100
|
+
{
|
|
101
|
+
"ssid": "MyHomeNetwork",
|
|
102
|
+
"bssid": "aa:bb:cc:dd:ee:ff",
|
|
103
|
+
"rssi": -45,
|
|
104
|
+
"frequency": 2437,
|
|
105
|
+
"security": "WPA2"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"ssid": "Neighbor_WiFi",
|
|
109
|
+
"bssid": "11:22:33:44:55:66",
|
|
110
|
+
"rssi": -70,
|
|
111
|
+
"frequency": 5180,
|
|
112
|
+
"security": "WPA3"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Enable/Disable response:**
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"success": true,
|
|
123
|
+
"service": "wifi_automation",
|
|
124
|
+
"action": "enable",
|
|
125
|
+
"data": {
|
|
126
|
+
"message": "WiFi enabled successfully"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Response Fields
|
|
132
|
+
|
|
133
|
+
| Field | Description |
|
|
134
|
+
|-------|-------------|
|
|
135
|
+
| enabled | WiFi radio is on |
|
|
136
|
+
| connected | Connected to a network |
|
|
137
|
+
| ssid | Network name |
|
|
138
|
+
| bssid | Access point MAC address |
|
|
139
|
+
| ip_address | Device IP on network |
|
|
140
|
+
| link_speed | Connection speed in Mbps |
|
|
141
|
+
| rssi | Signal strength (dBm, closer to 0 is stronger) |
|
|
142
|
+
| frequency | Channel frequency in MHz |
|
|
143
|
+
|
|
144
|
+
## Use Cases
|
|
145
|
+
|
|
146
|
+
| Use Case | Action | Description |
|
|
147
|
+
|----------|--------|-------------|
|
|
148
|
+
| Check connection | status | Verify WiFi is connected |
|
|
149
|
+
| Toggle WiFi | enable/disable | Control WiFi radio |
|
|
150
|
+
| Find networks | scan | List available networks |
|
|
151
|
+
| Signal strength | status | Check connection quality |
|
|
152
|
+
|
|
153
|
+
## Common Workflows
|
|
154
|
+
|
|
155
|
+
### Auto-connect workflow
|
|
156
|
+
|
|
157
|
+
1. Check WiFi status
|
|
158
|
+
2. If not enabled, enable it
|
|
159
|
+
3. Scan for networks
|
|
160
|
+
4. Report available options
|
|
161
|
+
|
|
162
|
+
### Battery saving
|
|
163
|
+
|
|
164
|
+
1. Check if on mobile data
|
|
165
|
+
2. If not using WiFi, disable it
|
|
166
|
+
3. Re-enable when needed
|
|
167
|
+
|
|
168
|
+
## Signal Strength Guide
|
|
169
|
+
|
|
170
|
+
| RSSI (dBm) | Quality |
|
|
171
|
+
|------------|---------|
|
|
172
|
+
| > -50 | Excellent |
|
|
173
|
+
| -50 to -60 | Good |
|
|
174
|
+
| -60 to -70 | Fair |
|
|
175
|
+
| -70 to -80 | Weak |
|
|
176
|
+
| < -80 | Poor |
|
|
177
|
+
|
|
178
|
+
## Setup Requirements
|
|
179
|
+
|
|
180
|
+
1. Connect the **WiFi Automation** node to Zeenie's `input-tools` handle
|
|
181
|
+
2. Android device must be paired
|
|
182
|
+
3. Location permission may be required for scanning
|
|
@@ -3,7 +3,7 @@ name: subagent-skill
|
|
|
3
3
|
description: Manage sub-agent delegation, handle task completion events, and coordinate multi-agent workflows.
|
|
4
4
|
metadata:
|
|
5
5
|
author: machina
|
|
6
|
-
version: "
|
|
6
|
+
version: "2.0"
|
|
7
7
|
category: assistant
|
|
8
8
|
icon: "🤖"
|
|
9
9
|
color: "#8B5CF6"
|
|
@@ -13,6 +13,30 @@ metadata:
|
|
|
13
13
|
|
|
14
14
|
You are a parent agent that can delegate tasks to specialized sub-agents. This skill helps you understand, delegate to, and handle results from sub-agents effectively.
|
|
15
15
|
|
|
16
|
+
## CRITICAL: Always Check Sub-Agents First
|
|
17
|
+
|
|
18
|
+
**NEVER say "I don't have that tool" or "I can't do that" without first checking your connected sub-agents.**
|
|
19
|
+
|
|
20
|
+
When a user requests something you don't have a direct tool for:
|
|
21
|
+
|
|
22
|
+
1. **Check your connected sub-agents** - Look at what agents are available in your tools
|
|
23
|
+
2. **Delegate to the appropriate sub-agent** - They have their own tools and capabilities
|
|
24
|
+
3. **Only say you can't** if NO sub-agent can handle it
|
|
25
|
+
|
|
26
|
+
**Wrong approach:**
|
|
27
|
+
```
|
|
28
|
+
User: "Check my phone battery"
|
|
29
|
+
You: "I don't have access to Android tools, so I can't check your battery."
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Correct approach:**
|
|
33
|
+
```
|
|
34
|
+
User: "Check my phone battery"
|
|
35
|
+
You: [Check if Android Control Agent is connected]
|
|
36
|
+
You: [Delegate to Android Control Agent: "Get battery status"]
|
|
37
|
+
You: "Let me check that for you..." [waits for result]
|
|
38
|
+
```
|
|
39
|
+
|
|
16
40
|
## Available Sub-Agent Types
|
|
17
41
|
|
|
18
42
|
You can delegate tasks to these specialized agents (when connected to your tools):
|
|
@@ -42,6 +66,26 @@ You can delegate tasks to these specialized agents (when connected to your tools
|
|
|
42
66
|
| **Payments Agent** | 💳 | Payment processing | Payment workflows, invoices, financial operations |
|
|
43
67
|
| **Consumer Agent** | 🛒 | Consumer support | Customer service, product recommendations, order management |
|
|
44
68
|
|
|
69
|
+
## How to Check Sub-Agent Capabilities
|
|
70
|
+
|
|
71
|
+
Before responding "I can't do that":
|
|
72
|
+
|
|
73
|
+
1. **List your available tools** - Sub-agents appear as delegation tools
|
|
74
|
+
2. **Match the request to an agent specialty** - Use the table above
|
|
75
|
+
3. **Delegate if a match exists** - The sub-agent has its own tools
|
|
76
|
+
4. **Only decline if truly impossible** - No matching agent connected
|
|
77
|
+
|
|
78
|
+
### Capability Matching Examples
|
|
79
|
+
|
|
80
|
+
| User Request | Check For | Delegate To |
|
|
81
|
+
|--------------|-----------|-------------|
|
|
82
|
+
| "Check my battery" | Android Control Agent | `delegate_to_android_agent` |
|
|
83
|
+
| "Send a WhatsApp" | Social Media Agent | `delegate_to_social_agent` |
|
|
84
|
+
| "Calculate this" | Coding Agent | `delegate_to_coding_agent` |
|
|
85
|
+
| "Find restaurants nearby" | Travel Agent | `delegate_to_travel_agent` |
|
|
86
|
+
| "Make an HTTP request" | Web Control Agent | `delegate_to_web_agent` |
|
|
87
|
+
| "Set a reminder" | Task Management Agent | `delegate_to_task_agent` |
|
|
88
|
+
|
|
45
89
|
## How Delegation Works
|
|
46
90
|
|
|
47
91
|
### Fire-and-Forget Pattern
|
|
@@ -60,15 +104,15 @@ When you delegate a task:
|
|
|
60
104
|
## Delegation Best Practices
|
|
61
105
|
|
|
62
106
|
### When to Delegate
|
|
63
|
-
-
|
|
107
|
+
- User requests something outside your direct tools
|
|
108
|
+
- Task requires specialized capabilities (Android, WhatsApp, code execution, etc.)
|
|
64
109
|
- Task is time-consuming and can run in background
|
|
65
110
|
- Task matches a sub-agent's specialty area
|
|
66
|
-
- User explicitly asks for a specific capability
|
|
67
111
|
|
|
68
112
|
### When NOT to Delegate
|
|
69
|
-
- Simple questions you can answer directly
|
|
70
|
-
- Tasks that need immediate response
|
|
71
|
-
- When
|
|
113
|
+
- Simple questions you can answer directly from knowledge
|
|
114
|
+
- Tasks that need immediate response AND you have the direct tool
|
|
115
|
+
- When the same task is already running (avoid duplicates)
|
|
72
116
|
|
|
73
117
|
### Delegation Format
|
|
74
118
|
When delegating, provide clear instructions:
|
|
@@ -101,19 +145,6 @@ When a delegated task fails:
|
|
|
101
145
|
**Example Response:**
|
|
102
146
|
"I wasn't able to send the WhatsApp message because the contact wasn't found. Could you verify the phone number? Alternatively, I can try searching for the contact by name."
|
|
103
147
|
|
|
104
|
-
## Task Tracking
|
|
105
|
-
|
|
106
|
-
If you have the Task Manager tool connected, use it to:
|
|
107
|
-
- **List tasks**: See all active and completed delegated tasks
|
|
108
|
-
- **Check status**: Get details on a specific task
|
|
109
|
-
- **Mark done**: Clean up completed task tracking
|
|
110
|
-
|
|
111
|
-
### Checking Task Status
|
|
112
|
-
Before re-delegating similar work:
|
|
113
|
-
1. Use Task Manager to list recent tasks
|
|
114
|
-
2. Check if the same task is already running
|
|
115
|
-
3. Avoid duplicate delegations
|
|
116
|
-
|
|
117
148
|
## Multi-Agent Coordination
|
|
118
149
|
|
|
119
150
|
### Sequential Delegation
|
|
@@ -131,17 +162,17 @@ For independent tasks:
|
|
|
131
162
|
|
|
132
163
|
## Critical Rules
|
|
133
164
|
|
|
134
|
-
1. **
|
|
135
|
-
2. **NEVER
|
|
136
|
-
3. **
|
|
137
|
-
4. **ALWAYS
|
|
138
|
-
5. **
|
|
165
|
+
1. **ALWAYS check sub-agents before saying "I can't"** - They extend your capabilities
|
|
166
|
+
2. **NEVER re-delegate after receiving a result** - Report it instead
|
|
167
|
+
3. **NEVER retry failed tasks automatically** - Ask user first
|
|
168
|
+
4. **ALWAYS acknowledge task completion** to the user
|
|
169
|
+
5. **ALWAYS match task to agent specialty** for best results
|
|
139
170
|
|
|
140
171
|
## Error Handling
|
|
141
172
|
|
|
142
173
|
| Error Type | Action |
|
|
143
174
|
|------------|--------|
|
|
144
|
-
| Agent not
|
|
175
|
+
| Agent not connected | Inform user which agent is needed and how to connect it |
|
|
145
176
|
| Task timeout | Report to user, suggest retry |
|
|
146
177
|
| Invalid parameters | Clarify requirements with user |
|
|
147
178
|
| Agent error | Report error details, suggest alternatives |
|
|
@@ -151,6 +182,7 @@ For independent tasks:
|
|
|
151
182
|
### Battery Check Workflow
|
|
152
183
|
```
|
|
153
184
|
User: "Check my phone battery"
|
|
185
|
+
You: [See Android Control Agent in tools]
|
|
154
186
|
You: Delegate to Android Control Agent with task "Get battery status"
|
|
155
187
|
Agent: Returns {status: 'completed', result: 'Battery at 78%, charging'}
|
|
156
188
|
You: "Your phone battery is at 78% and currently charging."
|
|
@@ -159,15 +191,15 @@ You: "Your phone battery is at 78% and currently charging."
|
|
|
159
191
|
### Message Sending Workflow
|
|
160
192
|
```
|
|
161
193
|
User: "Send a WhatsApp to John saying I'll be late"
|
|
194
|
+
You: [See Social Media Agent in tools]
|
|
162
195
|
You: Delegate to Social Media Agent with message details
|
|
163
196
|
Agent: Returns {status: 'completed', result: 'Message sent to John'}
|
|
164
197
|
You: "Done! I've sent the message to John letting him know you'll be late."
|
|
165
198
|
```
|
|
166
199
|
|
|
167
|
-
###
|
|
200
|
+
### No Agent Available
|
|
168
201
|
```
|
|
169
|
-
User: "
|
|
170
|
-
You:
|
|
171
|
-
|
|
172
|
-
You: "I couldn't run that script - the file wasn't found at /scripts/analyze.py. Could you verify the path is correct?"
|
|
202
|
+
User: "Check my phone battery"
|
|
203
|
+
You: [No Android Control Agent in tools]
|
|
204
|
+
You: "I don't have an Android Control Agent connected right now. To check your battery, please connect an Android Control Agent to my tools input, then ask again."
|
|
173
205
|
```
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: javascript-skill
|
|
3
|
+
description: Execute JavaScript code for calculations, data processing, and JSON manipulation. Full ES6+ support with Node.js runtime.
|
|
4
|
+
allowed-tools: javascript_code
|
|
5
|
+
metadata:
|
|
6
|
+
author: machina
|
|
7
|
+
version: "1.0"
|
|
8
|
+
category: code
|
|
9
|
+
icon: "📜"
|
|
10
|
+
color: "#F7DF1E"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# JavaScript Code Execution Tool
|
|
14
|
+
|
|
15
|
+
Execute JavaScript code for calculations, data processing, and JSON manipulation.
|
|
16
|
+
|
|
17
|
+
## How It Works
|
|
18
|
+
|
|
19
|
+
This skill provides instructions for the **JavaScript Executor** tool node. Connect the **JavaScript Executor** node to Zeenie's `input-tools` handle to enable JavaScript code execution.
|
|
20
|
+
|
|
21
|
+
## javascript_code Tool
|
|
22
|
+
|
|
23
|
+
Execute JavaScript code and return results.
|
|
24
|
+
|
|
25
|
+
### Schema Fields
|
|
26
|
+
|
|
27
|
+
| Field | Type | Required | Description |
|
|
28
|
+
|-------|------|----------|-------------|
|
|
29
|
+
| code | string | Yes | JavaScript code to execute |
|
|
30
|
+
|
|
31
|
+
### Available Features
|
|
32
|
+
|
|
33
|
+
| Feature | Description |
|
|
34
|
+
|---------|-------------|
|
|
35
|
+
| ES6+ syntax | Arrow functions, destructuring, spread operator |
|
|
36
|
+
| `JSON` | JSON.parse() and JSON.stringify() |
|
|
37
|
+
| `Math` | Mathematical operations |
|
|
38
|
+
| `Date` | Date and time manipulation |
|
|
39
|
+
| `Array` methods | map, filter, reduce, sort, etc. |
|
|
40
|
+
| `Object` methods | keys, values, entries, assign |
|
|
41
|
+
| `String` methods | All standard string methods |
|
|
42
|
+
|
|
43
|
+
### Built-in Variables
|
|
44
|
+
|
|
45
|
+
| Variable | Description |
|
|
46
|
+
|----------|-------------|
|
|
47
|
+
| `input_data` | Data from connected workflow nodes (object) |
|
|
48
|
+
| `output` | Set this to return a result |
|
|
49
|
+
|
|
50
|
+
### Output Methods
|
|
51
|
+
|
|
52
|
+
1. **Set `output` variable**: Returns structured data to the workflow
|
|
53
|
+
2. **Use `console.log()`**: Captured as console output
|
|
54
|
+
|
|
55
|
+
### Examples
|
|
56
|
+
|
|
57
|
+
**Basic calculation:**
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"code": "const result = 25 * 4 + 10;\nconsole.log(`Result: ${result}`);\noutput = result;"
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Array processing:**
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"code": "const numbers = input_data.numbers || [1, 2, 3, 4, 5];\nconst total = numbers.reduce((a, b) => a + b, 0);\nconst average = total / numbers.length;\nconsole.log(`Total: ${total}, Average: ${average}`);\noutput = { total, average };"
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Filter array:**
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"code": "const numbers = input_data.numbers || [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\nconst evens = numbers.filter(n => n % 2 === 0);\nconsole.log(`Even numbers: ${evens}`);\noutput = evens;"
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Transform data:**
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"code": "const users = input_data.users || [{name: 'John', age: 30}, {name: 'Jane', age: 25}];\nconst names = users.map(u => u.name);\nconsole.log(`Names: ${names.join(', ')}`);\noutput = names;"
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**JSON manipulation:**
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"code": "const data = { name: 'John', age: 30, city: 'NYC' };\nconst json = JSON.stringify(data, null, 2);\nconsole.log(json);\noutput = data;"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Object operations:**
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"code": "const obj = { a: 1, b: 2, c: 3 };\nconst keys = Object.keys(obj);\nconst values = Object.values(obj);\nconst sum = values.reduce((a, b) => a + b, 0);\nconsole.log(`Sum of values: ${sum}`);\noutput = { keys, values, sum };"
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Date operations:**
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"code": "const now = new Date();\nconst tomorrow = new Date(now.getTime() + 24 * 60 * 60 * 1000);\nconst formatted = tomorrow.toISOString().split('T')[0];\nconsole.log(`Tomorrow: ${formatted}`);\noutput = formatted;"
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Sort array:**
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"code": "const items = input_data.items || ['banana', 'apple', 'cherry'];\nconst sorted = [...items].sort();\nconsole.log(`Sorted: ${sorted}`);\noutput = sorted;"
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**String processing:**
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"code": "const text = 'Hello World, Hello JavaScript';\nconst words = text.split(' ');\nconst unique = [...new Set(words)];\nconsole.log(`Unique words: ${unique}`);\noutput = unique;"
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Destructuring and spread:**
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"code": "const { name, age } = input_data.user || { name: 'John', age: 30 };\nconst profile = { name, age, active: true };\nconst extended = { ...profile, role: 'admin' };\nconsole.log(JSON.stringify(extended));\noutput = extended;"
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Response Format
|
|
128
|
+
|
|
129
|
+
**Success:**
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"success": true,
|
|
133
|
+
"result": { "total": 15, "average": 3 },
|
|
134
|
+
"output": "Total: 15, Average: 3"
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Error:**
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"error": "ReferenceError: undefinedVar is not defined"
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Use Cases
|
|
146
|
+
|
|
147
|
+
| Use Case | Approach |
|
|
148
|
+
|----------|----------|
|
|
149
|
+
| Array manipulation | Use map, filter, reduce |
|
|
150
|
+
| JSON processing | Use JSON.parse, JSON.stringify |
|
|
151
|
+
| Object operations | Use Object.keys, values, entries |
|
|
152
|
+
| String processing | Use split, join, replace |
|
|
153
|
+
| Math calculations | Use Math methods |
|
|
154
|
+
| Date operations | Use Date object |
|
|
155
|
+
| Data transformation | Use spread and destructuring |
|
|
156
|
+
|
|
157
|
+
## Guidelines
|
|
158
|
+
|
|
159
|
+
1. **Always set `output`**: This returns data to the workflow
|
|
160
|
+
2. **Use `console.log()` for debugging**: Output is captured and returned
|
|
161
|
+
3. **Use ES6+ features**: Arrow functions, destructuring, spread
|
|
162
|
+
4. **Handle undefined**: Use `|| defaultValue` pattern
|
|
163
|
+
5. **Keep code focused**: One task per execution
|
|
164
|
+
6. **No network access**: Use http-skill for web requests
|
|
165
|
+
7. **Timeout**: Default 30 seconds max execution time
|
|
166
|
+
|
|
167
|
+
## Security Restrictions
|
|
168
|
+
|
|
169
|
+
- No network/fetch operations
|
|
170
|
+
- No file system access (no require('fs'))
|
|
171
|
+
- No child processes
|
|
172
|
+
- Limited execution time (30 seconds)
|
|
173
|
+
- Sandboxed environment
|
|
174
|
+
|
|
175
|
+
## Common Patterns
|
|
176
|
+
|
|
177
|
+
**Default values:**
|
|
178
|
+
```javascript
|
|
179
|
+
const data = input_data.value || 'default';
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**Null-safe access:**
|
|
183
|
+
```javascript
|
|
184
|
+
const name = input_data?.user?.name || 'Unknown';
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Array to object:**
|
|
188
|
+
```javascript
|
|
189
|
+
const arr = [{id: 1, name: 'A'}, {id: 2, name: 'B'}];
|
|
190
|
+
const obj = Object.fromEntries(arr.map(x => [x.id, x.name]));
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Setup Requirements
|
|
194
|
+
|
|
195
|
+
1. Connect the **JavaScript Executor** node to Zeenie's `input-tools` handle
|
|
196
|
+
2. Node.js must be installed on the server
|