add pipeline task system, agentic music tasks, copy buttons, and pi-bridge cleanup
- Pipeline mode: new task mode that chains agentic tasks sequentially with foreach/subdirectory iteration and skip_if conditions - Pipeline executor backend (WebSocket at /api/tasks/pipeline/ws) with support for both Pi and Claude Code models - Frontend PipelineRunner component with step progress, streaming output, and aggregate cost tracking - New agentic tasks: prepare-discography, fetch-album-info, build-discography (pipeline combining both) - Seed parser extended to handle pipeline steps in frontmatter config - CopyButton component added to assistant bubbles, error bubbles, and tool input/output sections - Removed obsolete SearXNG/Apify/browser relay code from pi-bridge Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
---
|
||||
name: Build Discography
|
||||
description: Identify all albums in an artist folder, rename directories, fetch detailed info and cover art for each.
|
||||
version: 1
|
||||
mode: pipeline
|
||||
triggers:
|
||||
- type: directory
|
||||
inputs:
|
||||
artist_name:
|
||||
type: string
|
||||
description: Artist / band name
|
||||
autofill: entry_name
|
||||
steps:
|
||||
- task: prepare-discography
|
||||
inputs:
|
||||
artist_name: ${artist_name}
|
||||
- task: fetch-album-info
|
||||
foreach: subdirectory
|
||||
skip_if: album-info.md
|
||||
inputs:
|
||||
artist_name: ${artist_name}
|
||||
album_name: ${folder_name}
|
||||
---
|
||||
@@ -0,0 +1,97 @@
|
||||
---
|
||||
name: Fetch Album Info
|
||||
description: Search the web for album information and save a detailed info file.
|
||||
version: 1
|
||||
mode: agentic
|
||||
triggers:
|
||||
- type: directory
|
||||
inputs:
|
||||
artist_name:
|
||||
type: string
|
||||
description: Artist name
|
||||
autofill: entry_name
|
||||
album_name:
|
||||
type: string
|
||||
description: Album name
|
||||
autofill: entry_name
|
||||
---
|
||||
|
||||
# Fetch Album Info
|
||||
|
||||
You are given an artist name and album name. Your job is to find comprehensive information about this album from the web.
|
||||
|
||||
## Process
|
||||
|
||||
1. **Search** for the album using `web_search` with queries like `"<artist> <album> wikipedia"`, `"<artist> <album> musicbrainz"`, `"<artist> <album> allmusic"`.
|
||||
2. **Fetch** the most relevant pages using `web_fetch` to extract detailed information.
|
||||
3. **Cross-reference** multiple sources to get the most accurate and complete data.
|
||||
4. **Download** the front cover image and save it as `cover.{ext}` (matching the image format, e.g. `cover.jpg`) in the target directory. Overwrite if it already exists.
|
||||
5. **Save** the result as an `album-info.md` file in the target directory (provided in Context).
|
||||
|
||||
## Information to collect
|
||||
|
||||
- **Artist** name (canonical/correct spelling)
|
||||
- **Album** title (canonical/correct spelling)
|
||||
- **Release year** (original release)
|
||||
- **Genre(s)** and subgenres
|
||||
- **Label** / record company
|
||||
- **Tracklist** — for each track: number, title, duration. For multi-disc releases, organize by disc.
|
||||
- **Total duration**
|
||||
- **Front cover image URL** — find the highest quality cover art URL available (Wikipedia, MusicBrainz cover art archive)
|
||||
- **Credits** — producer, engineer, notable musicians (if available)
|
||||
- **Additional notes** — compilation info, remaster details, notable facts
|
||||
|
||||
## Output format
|
||||
|
||||
Write a markdown file named `album-info.md` in the **target directory** (from Context) with this structure:
|
||||
|
||||
```markdown
|
||||
# Artist — Album Title
|
||||
|
||||

|
||||
|
||||
| Field | Value |
|
||||
|-------|-------|
|
||||
| Artist | ... |
|
||||
| Album | ... |
|
||||
| Year | ... |
|
||||
| Genre | ... |
|
||||
| Label | ... |
|
||||
| Duration | ... |
|
||||
|
||||
## Tracklist
|
||||
|
||||
### Disc 1
|
||||
| # | Title | Duration |
|
||||
|---|-------|----------|
|
||||
| 1 | ... | 0:00 |
|
||||
|
||||
### Disc 2
|
||||
...
|
||||
|
||||
## Credits
|
||||
- Producer: ...
|
||||
- ...
|
||||
|
||||
## Notes
|
||||
...
|
||||
```
|
||||
|
||||
If there is only one disc, omit the "Disc 1" heading and just use a flat tracklist.
|
||||
|
||||
## Cover art download
|
||||
|
||||
Once you have a cover image URL, download it to the target directory using curl:
|
||||
```
|
||||
curl -sL -o "<target_dir>/cover.<ext>" "<image_url>"
|
||||
```
|
||||
Use the correct extension based on the image format (jpg, png, etc.). Overwrite any existing file.
|
||||
In the `album-info.md`, keep the original remote URL in the image tag: ``.
|
||||
|
||||
## Important
|
||||
|
||||
- Prefer Wikipedia for context, genre classification, credits, and tracklist data.
|
||||
- Use MusicBrainz / Cover Art Archive for high-quality cover image URLs and precise edition identification.
|
||||
- Use AllMusic as an additional source for credits and reviews.
|
||||
- If information conflicts between sources, prefer Wikipedia for metadata and MusicBrainz for tracklist data.
|
||||
- Do NOT make up information. If something is not found, omit it.
|
||||
@@ -0,0 +1,117 @@
|
||||
---
|
||||
name: Prepare Discography
|
||||
description: Scan an artist's album folders, identify exact release editions, and produce a discography summary.
|
||||
version: 1
|
||||
mode: agentic
|
||||
triggers:
|
||||
- type: directory
|
||||
inputs:
|
||||
artist_name:
|
||||
type: string
|
||||
description: Artist / band name
|
||||
autofill: entry_name
|
||||
---
|
||||
|
||||
# Prepare Discography
|
||||
|
||||
You are given an artist/band directory containing one subfolder per album. Your job is to identify the **exact release edition** of each album and produce a `discography.md` summary file.
|
||||
|
||||
## Why this matters
|
||||
|
||||
Album folders often contain special editions, anniversary reissues, deluxe multi-disc sets, etc. A naive search for "The Doors 1967" returns the original 11-track release, but the folder might contain a 50th Anniversary 3CD edition with 30+ tracks. You must identify the **specific edition** the user has.
|
||||
|
||||
## Process
|
||||
|
||||
For each album subfolder in the artist directory:
|
||||
|
||||
### 1. Analyze local signals
|
||||
|
||||
Gather as much information as possible from the folder itself **before** searching the web:
|
||||
|
||||
- **Folder name**: often contains year and album title, sometimes edition hints like `(3CD)`, `(Deluxe)`, `(Remaster)`
|
||||
- **Disc structure**: count `CD1/`, `CD2/`, etc. subdirectories — this tells you how many discs the release has
|
||||
- **Track count per disc**: list audio files in each disc folder (or root if single-disc)
|
||||
- **Track names**: the filenames often contain track titles (e.g. `01 - Break on Through.flac`)
|
||||
- **Audio tags**: use the `mutagen` tool with `action: read` on 1-2 representative tracks per disc to get tagged metadata (artist, album, year, genre, label, etc.)
|
||||
- **Existing files**: check for `album-info.md`, `Front.jpg`, `cover.jpg`, or `Scans/` — these provide additional context
|
||||
|
||||
### 2. Build a search profile
|
||||
|
||||
From the local signals, construct a profile:
|
||||
- Artist name (from tags or folder name)
|
||||
- Album title (from tags or folder name)
|
||||
- Release year (from tags or folder name)
|
||||
- Number of discs
|
||||
- Track count per disc
|
||||
- Any edition keywords (deluxe, remaster, anniversary, etc.)
|
||||
|
||||
### 3. Search for the exact release
|
||||
|
||||
Use `web_search` to find the specific edition:
|
||||
- Search Wikipedia first: `"<artist> <album> wikipedia"` — Wikipedia often has edition/reissue details
|
||||
- Search MusicBrainz: `"<artist> <album> musicbrainz"` — MusicBrainz catalogs every pressing and edition
|
||||
- If the disc/track count doesn't match the first result, refine: `"<artist> <album> deluxe 3CD"` or similar
|
||||
- Use `web_fetch` on the most relevant pages to confirm the tracklist matches your local files
|
||||
|
||||
### 4. Confirm the match
|
||||
|
||||
Compare the web result against local signals:
|
||||
- Does the disc count match?
|
||||
- Does the track count per disc match (approximately)?
|
||||
- Do track names align?
|
||||
- If there's a mismatch, search for alternative editions until you find the best match
|
||||
|
||||
### 5. Rename the album folder
|
||||
|
||||
Once you have confidently identified the release, rename the album folder to the standardized format:
|
||||
|
||||
```
|
||||
[YYYY] Album Title (Edition Marker)
|
||||
```
|
||||
|
||||
- **YYYY** = original release year (NOT the reissue/special edition year)
|
||||
- **Album Title** = canonical album name
|
||||
- **Edition Marker** = only if it's not the standard original release. Examples: `50th Anniversary 3CD Deluxe Edition`, `2017 Remaster`, `Deluxe Edition`
|
||||
- If it IS the plain original release, omit the parenthetical: `[1967] The Doors`
|
||||
|
||||
Use `mv` via Bash to rename. Do this **before** writing discography.md so the file references the new folder names.
|
||||
|
||||
## Output
|
||||
|
||||
Write a `discography.md` file in the **artist directory** (the target directory from Context) with this structure:
|
||||
|
||||
```markdown
|
||||
# Artist Name — Discography
|
||||
|
||||
## Albums
|
||||
|
||||
### [YYYY] Album Title (Edition Marker)
|
||||
- **Folder**: `[YYYY] Album Title (Edition Marker)/`
|
||||
- **Format**: FLAC / MP3 / Mixed
|
||||
- **Discs**: N
|
||||
- **Tracks**: N (or N per disc: D1: X, D2: Y, ...)
|
||||
- **Year**: YYYY (original release) / YYYY (this edition)
|
||||
- **Label**: ...
|
||||
- **Genre**: ...
|
||||
- **Edition**: 50th Anniversary Deluxe Edition / Original / Remaster / etc.
|
||||
- **Wikipedia**: https://en.wikipedia.org/wiki/... (if found)
|
||||
- **MusicBrainz**: https://musicbrainz.org/release/... (if found)
|
||||
- **Notes**: ...
|
||||
|
||||
### [YYYY] Another Album
|
||||
...
|
||||
```
|
||||
|
||||
Sort albums chronologically by original release year.
|
||||
|
||||
Include **direct URLs** to the sources used (Discogs release page, Wikipedia article, MusicBrainz release) — these will be used by downstream tasks to avoid redundant searching.
|
||||
|
||||
## Important
|
||||
|
||||
- **Accuracy over speed**: it's better to correctly identify 3 out of 4 albums than to guess all 4 wrong
|
||||
- **Wikipedia and MusicBrainz are your primary sources** for edition identification
|
||||
- **Use mutagen sparingly**: read 1-2 tracks per disc, not every file
|
||||
- **Track count is the strongest signal** for distinguishing editions — a 3CD set with 10+12+8 tracks is very different from a single-disc 11-track original
|
||||
- **Folder name hints**: `(3CD)`, `(2LP)`, `(Deluxe)`, `(Remaster)`, `(Anniversary)` in the folder name are strong clues
|
||||
- **Do NOT make up information**. If you cannot confidently identify an edition, note what you found and flag the uncertainty
|
||||
- The artist name in the folder may be formatted as `Last, First` or `Name, The` — normalize it when searching (e.g. `Doors, the` → `The Doors`)
|
||||
@@ -20,6 +20,17 @@ All task inputs defined in the TASK.md frontmatter are available to the script i
|
||||
|
||||
Inputs provided by context (e.g. `file_path` from the file browser) are auto-filled and hidden from the form.
|
||||
|
||||
### Autofill
|
||||
|
||||
Inputs can declare `autofill` to pre-fill from the trigger context. Available context values:
|
||||
|
||||
| Value | Source |
|
||||
|-------|--------|
|
||||
| `entry_name` | Name of the file or directory that triggered the task |
|
||||
| `entry_path` | Full path of the file or directory |
|
||||
|
||||
Autofilled inputs are visible and editable (unlike `file_path` which is hidden).
|
||||
|
||||
## Templates
|
||||
|
||||
### 1. File Processor
|
||||
@@ -180,6 +191,7 @@ inputs:
|
||||
type: string # string, number, boolean
|
||||
description: What this input is
|
||||
default: value # optional — default value
|
||||
autofill: entry_name # optional — pre-fill from context (entry_name or entry_path)
|
||||
options: # optional — renders as selectable pills in UI
|
||||
- option1
|
||||
- option2
|
||||
|
||||
Reference in New Issue
Block a user