remove seed directory, clean up provisioning and sync modules
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,131 +0,0 @@
|
||||
# Tasks
|
||||
|
||||
A task is a set of instructions to accomplish an atomic goal. Each task lives in its own directory under `tasks/` and is defined by a `TASK.md` file.
|
||||
|
||||
## File Structure
|
||||
|
||||
```
|
||||
tasks/
|
||||
<task-slug>/
|
||||
TASK.md
|
||||
```
|
||||
|
||||
## TASK.md Format
|
||||
|
||||
A task file has two parts: **frontmatter** (YAML metadata) and **body** (Markdown instructions).
|
||||
|
||||
### Frontmatter
|
||||
|
||||
```yaml
|
||||
---
|
||||
name: Task Name
|
||||
description: A short description of what the task does.
|
||||
version: 1
|
||||
author: pastilhas
|
||||
tags:
|
||||
- tag1
|
||||
- tag2
|
||||
skills:
|
||||
- skill-name
|
||||
trigger:
|
||||
- type: file
|
||||
extensions:
|
||||
- ext1
|
||||
- ext2
|
||||
- type: directory
|
||||
inputs:
|
||||
- name: input_name
|
||||
description: What this input is.
|
||||
type: string
|
||||
required: true
|
||||
- name: count
|
||||
description: How many items to process.
|
||||
type: number
|
||||
default: 10
|
||||
required: false
|
||||
- name: verbose
|
||||
description: Enable verbose output.
|
||||
type: boolean
|
||||
default: false
|
||||
required: false
|
||||
- name: format
|
||||
description: Output format.
|
||||
type: select
|
||||
default: json
|
||||
required: false
|
||||
options:
|
||||
- value: json
|
||||
label: JSON
|
||||
- value: csv
|
||||
label: CSV
|
||||
- value: md
|
||||
label: Markdown
|
||||
---
|
||||
```
|
||||
|
||||
#### Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| `name` | string | yes | Human-readable name of the task. |
|
||||
| `description` | string | yes | Short description of what the task does. |
|
||||
| `version` | integer | no | Version number of the task definition. |
|
||||
| `author` | string | no | Author of the task. |
|
||||
| `tags` | string[] | no | Tags for categorization. |
|
||||
| `skills` | string[] | no | Skills required to execute the task. |
|
||||
| `trigger` | object[] | no | List of triggers that define when this task is applicable. |
|
||||
| `trigger[].type` | string | yes | What the trigger applies to (`file` or `directory`). |
|
||||
| `trigger[].extensions` | string[] | no | File extensions that match this trigger. Only applicable when `type` is `file`. |
|
||||
| `inputs` | object[] | no | Inputs the task expects. |
|
||||
| `inputs[].name` | string | yes | Name of the input parameter. |
|
||||
| `inputs[].description` | string | yes | Description of the input. |
|
||||
| `inputs[].type` | string | no | Input type. Determines how a task runner renders the input. One of: `string`, `number`, `boolean`, `select`. Defaults to `string`. |
|
||||
| `inputs[].default` | any | no | Default value for the input. |
|
||||
| `inputs[].required` | boolean | no | Whether the input is required. |
|
||||
| `inputs[].options` | object[] | no | Available choices when `type` is `select`. Each option has a `value` and a `label`. |
|
||||
| `inputs[].options[].value` | string | yes | The value passed to the task. |
|
||||
| `inputs[].options[].label` | string | yes | Human-readable label displayed in the UI. |
|
||||
|
||||
### Body
|
||||
|
||||
The body contains:
|
||||
|
||||
1. **Title** — `# Task Name`, matching the frontmatter `name`.
|
||||
2. **Description** — A one-line summary, matching the frontmatter `description`.
|
||||
3. **Steps** — An ordered list under `## Steps` describing the instructions to accomplish the task.
|
||||
|
||||
### Example
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: Transcribe Audio File
|
||||
description: Transcribe an audio file to text using whisper.cpp.
|
||||
version: 1
|
||||
author: pastilhas
|
||||
tags:
|
||||
- audio
|
||||
- transcription
|
||||
skills:
|
||||
- whisper.cpp
|
||||
trigger:
|
||||
- type: file
|
||||
extensions:
|
||||
- mp3
|
||||
- wav
|
||||
- m4a
|
||||
inputs:
|
||||
- name: file_path
|
||||
description: Path to the audio file to transcribe.
|
||||
required: true
|
||||
---
|
||||
|
||||
# Transcribe Audio File
|
||||
|
||||
Transcribe an audio file to text using whisper.cpp.
|
||||
|
||||
## Steps
|
||||
|
||||
1. First step.
|
||||
2. Second step.
|
||||
3. Third step.
|
||||
```
|
||||
@@ -1,50 +0,0 @@
|
||||
---
|
||||
name: Convert To MP3
|
||||
description: Convert audio files to MP3 320kbps, preserving metadata.
|
||||
version: 3
|
||||
author: pastilhas
|
||||
tags:
|
||||
- audio
|
||||
- conversion
|
||||
skills:
|
||||
- convert-audio-to-mp3
|
||||
tools:
|
||||
- convert_audio_to_mp3
|
||||
trigger:
|
||||
- type: file
|
||||
extensions:
|
||||
- flac
|
||||
- wav
|
||||
- ogg
|
||||
- wma
|
||||
- aac
|
||||
- m4a
|
||||
- opus
|
||||
- aiff
|
||||
- aif
|
||||
- ape
|
||||
- wv
|
||||
- alac
|
||||
- dsf
|
||||
- dff
|
||||
- type: directory
|
||||
inputs:
|
||||
- name: file_path
|
||||
description: Path to an audio file or an artist directory to convert.
|
||||
required: true
|
||||
---
|
||||
|
||||
# Convert To MP3
|
||||
|
||||
Convert audio files to MP3 320kbps, preserving metadata.
|
||||
|
||||
## Important
|
||||
|
||||
- Do NOT explore, list, or inspect the target path before converting. The tool handles everything internally — file discovery, format detection, and error reporting.
|
||||
- Do NOT use bash, ls, or any other tool. Only use `convert_audio_to_mp3`.
|
||||
- Call the tool exactly once, then report the result. Nothing else.
|
||||
|
||||
## Steps
|
||||
|
||||
1. If `file_path` has an audio extension (flac, wav, ogg, etc.), call `convert_audio_to_mp3(mode="single", path=file_path)`. Otherwise call `convert_audio_to_mp3(mode="batch", path=file_path)`.
|
||||
2. Print the tool's output as the final report. Do not add extra commentary.
|
||||
@@ -1,28 +0,0 @@
|
||||
---
|
||||
name: Sync Gmail Inbox
|
||||
description: Download all emails from the user's Gmail account and save them as files.
|
||||
version: 1
|
||||
author: pastilhas
|
||||
tags:
|
||||
- email
|
||||
- gmail
|
||||
- sync
|
||||
tools:
|
||||
- gmail
|
||||
inputs: []
|
||||
---
|
||||
|
||||
# Sync Gmail Inbox
|
||||
|
||||
Download all emails from the user's Gmail account and save each one as an `.eml` file in `$OFFICER_USER_ROOT/Gmail/emails/`.
|
||||
|
||||
## Steps
|
||||
|
||||
1. Create the `$OFFICER_USER_ROOT/Gmail/emails` directory if it doesn't already exist.
|
||||
2. Call `gmail` with `action=get_profile` to confirm the account is connected and note the total message count.
|
||||
3. Determine the current year and month.
|
||||
4. Loop **month by month**, starting from the current month and going backwards:
|
||||
- Call `gmail` with `action=sync_inbox`, `output_dir=$OFFICER_USER_ROOT/Gmail/emails`, and `query=after:YYYY/MM/01 before:YYYY/MM+1/01` (adjust the dates for each month).
|
||||
- Report the result for that month (e.g. "February 2026: saved 47 emails").
|
||||
- If **3 consecutive months** return 0 saved emails and 0 already existing, stop — you've likely reached the beginning of the account.
|
||||
5. When finished, count the total `.eml` files in `$OFFICER_USER_ROOT/Gmail/emails` and report the final total.
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
name: Test Sync Gmail Inbox
|
||||
description: Test task — download only 2026 emails from Gmail.
|
||||
version: 1
|
||||
author: pastilhas
|
||||
tags:
|
||||
- email
|
||||
- gmail
|
||||
- sync
|
||||
- test
|
||||
tools:
|
||||
- gmail
|
||||
inputs: []
|
||||
---
|
||||
|
||||
# Test Sync Gmail Inbox
|
||||
|
||||
Download emails from 2026 only and save each one as an `.eml` file in `$OFFICER_USER_ROOT/Gmail/emails/`.
|
||||
|
||||
## Steps
|
||||
|
||||
1. Create the `$OFFICER_USER_ROOT/Gmail/emails` directory if it doesn't already exist.
|
||||
2. Call `gmail` with `action=get_profile` to confirm the account is connected.
|
||||
3. Loop **month by month**, starting from the current month down to January 2026:
|
||||
- Call `gmail` with `action=sync_inbox`, `output_dir=$OFFICER_USER_ROOT/Gmail/emails`, and `query=after:YYYY/MM/01 before:YYYY/MM+1/01`.
|
||||
- Report the result for that month (e.g. "February 2026: saved 47 emails").
|
||||
4. When finished, count the total `.eml` files in `$OFFICER_USER_ROOT/Gmail/emails` and report the final total.
|
||||
@@ -1,251 +0,0 @@
|
||||
---
|
||||
name: TikTok Trends
|
||||
description: Fetch top trending TikTok videos for a given country and generate an engagement report with optional video downloads.
|
||||
version: 4
|
||||
author: pastilhas
|
||||
tags:
|
||||
- social-media
|
||||
- tiktok
|
||||
- trends
|
||||
- apify
|
||||
- content-analysis
|
||||
tools:
|
||||
- apify
|
||||
dependencies:
|
||||
- name: yt-dlp
|
||||
description: Required only when download option is enabled. Downloads TikTok videos.
|
||||
check_command: yt-dlp --version
|
||||
optional: true
|
||||
inputs:
|
||||
- name: country
|
||||
description: Country code to fetch trending videos for.
|
||||
type: select
|
||||
default: PT
|
||||
required: false
|
||||
options:
|
||||
- value: PT
|
||||
label: Portugal
|
||||
- value: US
|
||||
label: United States
|
||||
- value: BR
|
||||
label: Brazil
|
||||
- value: GB
|
||||
label: United Kingdom
|
||||
- value: ES
|
||||
label: Spain
|
||||
- value: FR
|
||||
label: France
|
||||
- value: DE
|
||||
label: Germany
|
||||
- value: IT
|
||||
label: Italy
|
||||
- value: NL
|
||||
label: Netherlands
|
||||
- value: BE
|
||||
label: Belgium
|
||||
- value: PL
|
||||
label: Poland
|
||||
- value: RO
|
||||
label: Romania
|
||||
- value: SE
|
||||
label: Sweden
|
||||
- value: AT
|
||||
label: Austria
|
||||
- value: CH
|
||||
label: Switzerland
|
||||
- value: IE
|
||||
label: Ireland
|
||||
- value: CA
|
||||
label: Canada
|
||||
- value: AU
|
||||
label: Australia
|
||||
- value: MX
|
||||
label: Mexico
|
||||
- value: AR
|
||||
label: Argentina
|
||||
- value: CO
|
||||
label: Colombia
|
||||
- value: CL
|
||||
label: Chile
|
||||
- value: JP
|
||||
label: Japan
|
||||
- value: KR
|
||||
label: South Korea
|
||||
- value: IN
|
||||
label: India
|
||||
- value: TR
|
||||
label: Turkey
|
||||
- value: SA
|
||||
label: Saudi Arabia
|
||||
- value: AE
|
||||
label: United Arab Emirates
|
||||
- value: ZA
|
||||
label: South Africa
|
||||
- value: NG
|
||||
label: Nigeria
|
||||
- name: limit
|
||||
description: Number of trending videos to fetch (1-100).
|
||||
type: number
|
||||
default: 20
|
||||
min: 1
|
||||
max: 100
|
||||
required: false
|
||||
- name: download
|
||||
description: Download video files using yt-dlp (requires yt-dlp to be installed).
|
||||
type: boolean
|
||||
default: false
|
||||
required: false
|
||||
outputs:
|
||||
- name: engagement_report
|
||||
description: Markdown report with trending videos analysis, engagement metrics, top hashtags, sounds, and creators.
|
||||
path: tiktok_trends_<country>_<timestamp>/report.md
|
||||
- name: raw_data
|
||||
description: Raw JSON data from Apify actor containing all video metadata.
|
||||
path: tiktok_trends_<country>_<timestamp>/raw.json
|
||||
- name: videos
|
||||
description: Downloaded video files (only present if download option was enabled).
|
||||
path: tiktok_trends_<country>_<timestamp>/videos/
|
||||
optional: true
|
||||
config:
|
||||
timeout: 600
|
||||
retry_count: 0
|
||||
---
|
||||
|
||||
# TikTok Trends
|
||||
|
||||
Fetch top trending TikTok videos for a given country and generate a comprehensive engagement report.
|
||||
|
||||
## Important
|
||||
|
||||
- Use the `apify` tool to fetch data. Do NOT call the Apify REST API directly via curl or fetch.
|
||||
- Do NOT explore or list files before starting. Create the output directory, call the tool, process results.
|
||||
- If `download` is false (default), do NOT attempt to download any videos.
|
||||
- Large data files (like `raw.json`) exceed the 50KB read limit. Never try to read them directly. Instead, write a Node.js script to process and transform the data, execute it, then delete the script.
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Setup output directory
|
||||
|
||||
Create a timestamped output directory:
|
||||
```
|
||||
$HOME/tiktok-trends/tiktok_trends_<country>_<YYYYMMDD_HHMMSS>/
|
||||
```
|
||||
|
||||
### 2. Fetch trending videos
|
||||
|
||||
Call the `apify` tool with `output_path` pointing to `raw.json` in the output directory:
|
||||
```
|
||||
apify(
|
||||
actor_id: "clockworks~tiktok-trends-scraper",
|
||||
input: { "adsCountryCode": "<country>", "resultsPerPage": <limit> },
|
||||
output_path: "<output_dir>/raw.json"
|
||||
)
|
||||
```
|
||||
|
||||
The tool saves the full dataset to `raw.json` and returns a summary (item count). If it returns an error or 0 items, report the error and stop.
|
||||
|
||||
### 3. Generate engagement report
|
||||
|
||||
**Important:** The raw JSON file is too large to read directly (exceeds the 50KB read limit). Instead, write a Node.js script (e.g. `generate-report.js`) in the output directory that reads `raw.json`, processes the data, and writes `report.md`. Then execute it with `node generate-report.js`. Delete the script after it runs successfully.
|
||||
|
||||
The script should read `raw.json`, parse the JSON (it may be an array directly or an object with items nested inside), and write `report.md` with the following sections. Adapt field names based on the actual data structure (see Data Shape Reference):
|
||||
|
||||
#### Header
|
||||
```markdown
|
||||
# TikTok Trending Report — <COUNTRY> — YYYY-MM-DD
|
||||
|
||||
Total videos analyzed: <count>
|
||||
```
|
||||
|
||||
#### Engagement Summary
|
||||
|
||||
Build a table from each video's statistics (views/plays, likes/diggs, shares, comments):
|
||||
|
||||
| Metric | Total | Avg per video |
|
||||
|--------|------:|-------------:|
|
||||
| Views | ... | ... |
|
||||
| Likes | ... | ... |
|
||||
| Shares | ... | ... |
|
||||
| Comments | ... | ... |
|
||||
|
||||
#### Top Hashtags (up to 20)
|
||||
|
||||
Extract hashtags from the data (dedicated hashtag field or parse `#tags` from description). Count occurrences, sort descending.
|
||||
|
||||
| Hashtag | Count |
|
||||
|---------|------:|
|
||||
|
||||
#### Top Sounds (up to 10)
|
||||
|
||||
From each video's music/sound metadata, format as `title — author`. Count occurrences, sort descending.
|
||||
|
||||
| Sound | Count |
|
||||
|-------|------:|
|
||||
|
||||
#### Creators Appearing in Trending (up to 10)
|
||||
|
||||
From each video's author/creator field. Count occurrences, sort descending.
|
||||
|
||||
| Creator | Videos |
|
||||
|---------|-------:|
|
||||
|
||||
#### Video List
|
||||
|
||||
Full table of all videos, sorted by position:
|
||||
|
||||
| # | Creator | Description | Views | Likes | URL |
|
||||
|--:|---------|-------------|------:|------:|-----|
|
||||
|
||||
- Creator: `@username` from the author field
|
||||
- Description: first 60 chars, pipe and newline characters replaced, with `...` if truncated
|
||||
- URL: the video's share/web URL
|
||||
- Format numbers with locale separators (e.g. `1,234,567`)
|
||||
|
||||
### 4. Download videos (only if `download` is true)
|
||||
|
||||
If `download` is false, skip this step entirely.
|
||||
|
||||
If `download` is true:
|
||||
1. Check that `yt-dlp` is installed
|
||||
2. Create a `videos/` subdirectory in the output directory
|
||||
3. Write all `share_url` values to a `urls.txt` file
|
||||
4. Run: `yt-dlp -a urls.txt -o "videos/%(id)s.%(ext)s" --write-info-json --no-overwrites`
|
||||
5. Report how many videos were downloaded. Partial failures are acceptable — do not fail the task if some downloads fail.
|
||||
|
||||
### 5. Report results
|
||||
|
||||
Print a summary to the user:
|
||||
- Country and date
|
||||
- Number of videos fetched
|
||||
- Top video: `@creator` — views count — URL
|
||||
- Top hashtag and count
|
||||
- Output directory path
|
||||
- Files created and their sizes
|
||||
|
||||
## Data Shape Reference
|
||||
|
||||
The actor output format may vary between versions. Before writing the report generation script, inspect the first item of the dataset to discover the actual field names. Write the script to handle the fields it finds. Common field patterns across TikTok scraper actors:
|
||||
|
||||
- **Video ID**: `aweme_id`, `id`, or `videoId`
|
||||
- **Description**: `desc`, `description`, or `title`
|
||||
- **Video URL**: `share_url`, `url`, `videoUrl`, or `webVideoUrl`
|
||||
- **Author**: `author.unique_id`, `author.uniqueId`, `authorMeta.name`, or `nickname`
|
||||
- **Statistics**: Look for objects with keys like `play_count`/`playCount`, `digg_count`/`diggCount`/`likes`, `share_count`/`shareCount`/`shares`, `comment_count`/`commentCount`/`comments`
|
||||
- **Music/Sound**: `music.title`, `musicMeta.musicName`, or similar
|
||||
- **Hashtags**: `text_extra[].hashtag_name`, `hashtags[]`, or parse `#tags` from description
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Action |
|
||||
|----------|--------|
|
||||
| Apify tool returns error | Report the error message. Common causes: invalid token, no credits, rate limits |
|
||||
| Empty results | Report "No trending videos found for <country>" and stop |
|
||||
| Partial results (fewer than requested) | Proceed normally, note the discrepancy in the summary |
|
||||
| yt-dlp not installed when download=true | Report that yt-dlp is required and skip downloads |
|
||||
| Download failures | Report which videos failed but do not fail the task |
|
||||
|
||||
## Notes
|
||||
|
||||
- The Apify actor may take 1-3 minutes depending on the limit
|
||||
- Pricing: $0.005 per start + $0.003 per result — monitor at https://console.apify.com/billing
|
||||
- Not all countries have sufficient trending data; some may return fewer results than requested
|
||||
@@ -1,35 +0,0 @@
|
||||
---
|
||||
name: Transcribe Audio File
|
||||
description: Transcribe an audio file to text using whisper.cpp.
|
||||
version: 1
|
||||
author: pastilhas
|
||||
tags:
|
||||
- audio
|
||||
- transcription
|
||||
skills:
|
||||
- whisper.cpp
|
||||
trigger:
|
||||
- type: file
|
||||
extensions:
|
||||
- mp3
|
||||
- wav
|
||||
- m4a
|
||||
inputs:
|
||||
- name: file_path
|
||||
description: Path to the audio file to transcribe.
|
||||
required: true
|
||||
---
|
||||
|
||||
# Transcribe Audio File
|
||||
|
||||
Transcribe an audio file to text using whisper.cpp.
|
||||
|
||||
## Steps
|
||||
|
||||
1. Starting from the directory containing the audio file, walk up parent by parent until you find a directory whose name is an email address. This is the user's root directory. Read `settings.json` from it and extract the `languages` section.
|
||||
2. Detect the language of the audio file using the whisper.cpp skill with `detect_language=true` and `response_format=verbose_json`.
|
||||
3. Compare the detected language against the user's `languages.spoken` list. If the detected language is in the list, skip translation. Otherwise, set `translate=true`.
|
||||
4. Use the whisper.cpp skill to transcribe the audio file at `file_path`, passing the detected language as the `language` parameter and the `translate` flag from the previous step.
|
||||
5. Read the transcription and generate a short, descriptive title based on its contents.
|
||||
6. Create a directory alongside the original audio file named `<date>_<slug>`, where `<date>` is the current date in `YYYYMMDD` format and `<slug>` is a slug derived from the generated title.
|
||||
7. Move the original audio file and save the transcription as a Markdown file (`.md`) into the new directory, using the same base name for the `.md` file.
|
||||
Reference in New Issue
Block a user