Goal: Find a file named "resume.pdf" on your local device from the Sulala dashboard.
Steps:
# JavaScript agent
cd device-agent
npm start
# Or Flutter agent
cd sulala_device_agent
flutter run
echo "Test content" > ~/Documents/test-file.txt
test-file.txtfiles{
"files": [
{
"path": "/Users/yourname/Documents/test-file.txt",
"name": "test-file.txt",
"size": 13,
"modified": "2025-02-20T10:00:00Z"
}
]
}
Chromeapps{
"apps": [
{
"name": "Google Chrome",
"path": "/Applications/Google Chrome.app",
"running": false
}
]
}
systemsystem{
"system": {
"os": "macOS",
"version": "14.0",
"cpu": "Apple M1",
"memory": "16 GB",
"disk": "500 GB"
}
}
echo "Upload test" > ~/Documents/upload-test.txt
upload-test.txtimportant documentfiles{
"results": [
{
"device": { "name": "My Laptop" },
"files": [
{ "path": "/Users/name/Documents/doc1.pdf" }
]
},
{
"device": { "name": "My Desktop" },
"files": [
{ "path": "C:\\Users\\name\\Documents\\doc2.pdf" }
]
}
]
}
// Custom search function in device agent
async function customSearch(query, scope) {
const results = {
files: [],
apps: [],
system: {}
};
if (scope.includes('files')) {
// Custom file search logic
results.files = await searchFiles(query);
}
if (scope.includes('apps')) {
// Custom app search logic
results.apps = await searchApps(query);
}
return results;
}
// Custom search function in Flutter agent
Future<SearchResults> customSearch(String query, List<String> scope) async {
final results = SearchResults();
if (scope.contains('files')) {
results.files = await searchFiles(query);
}
if (scope.contains('apps')) {
results.apps = await searchApps(query);
}
return results;
}
// Change from 30s to 10s
setInterval(pollForSearches, 10000);
{
"scope": ["files"] // Only search files, not apps/system
}
1. Send heartbeat → Verify device online
2. Create search query → Verify pending status
3. Device polls → Verify query received
4. Device searches → Verify local search works
5. Device reports results → Verify results stored
6. Dashboard polls → Verify results displayed
Problem: Device appears offline in dashboard
Debug Steps:
ps aux | grep agentcurl https://sulala.ai/api/healthProblem: Search completes but returns empty results
Debug Steps: