Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ts/examples/memoryProviders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"tsc": "tsc -b"
},
"dependencies": {
"@elastic/elasticsearch": "^8.17.0",
"@elastic/elasticsearch": "^8.19.1",
"aiclient": "workspace:*",
"better-sqlite3": "12.2.0",
"debug": "^4.4.0",
Expand Down
1 change: 1 addition & 0 deletions ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"@fluidframework/build-tools": "^0.57.0",
"@types/node": "^20.17.28",
"markdown-link-check": "^3.14.2",
"prebuild-install": "^7.1.3",
"prettier": "^3.5.3",
"shx": "^0.4.0"
},
Expand Down
28 changes: 0 additions & 28 deletions ts/packages/agents/calendar/src/calendarSchema.agr
Original file line number Diff line number Diff line change
Expand Up @@ -105,31 +105,3 @@
| (can you)? find what I have scheduled this week -> {
actionName: "findThisWeeksEvents"
}

// Common entity types and patterns

@ <Cardinal> =
$(x:number)
| one -> 1
| two -> 2
| three -> 3
| four -> 4
| five -> 5
| six -> 6
| seven -> 7
| eight -> 8
| nine -> 9
| ten -> 10

@ <Ordinal> =
first -> 1
| second -> 2
| third -> 3
| fourth -> 4
| fifth -> 5
| sixth -> 6
| seventh -> 7
| eighth -> 8
| ninth -> 9
| tenth -> 10

135 changes: 135 additions & 0 deletions ts/packages/agents/playerLocal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Local Music Player TypeAgent

A TypeAgent for playing local audio files without requiring any external service like Spotify.

## Features

- **Play local audio files** - MP3, WAV, OGG, FLAC, M4A, AAC, WMA
- **Queue management** - Add files to queue, show queue, clear queue
- **Playback controls** - Play, pause, resume, stop, next, previous
- **Volume control** - Set volume, mute/unmute
- **Shuffle and repeat** - Shuffle mode, repeat one/all
- **File search** - Search for files in your music folder
- **Cross-platform** - Works on Windows, macOS, and Linux

## Setup

No external API keys required! The agent uses the system's built-in audio capabilities:

- **Windows**: Uses PowerShell with Windows Media Player
- **macOS**: Uses `afplay`
- **Linux**: Uses `mpv` (must be installed separately; for example: Debian/Ubuntu: `sudo apt install mpv`, Fedora: `sudo dnf install mpv`, Arch: `sudo pacman -S mpv`)

## Configuration

Set your music folder using the command:

```
@localPlayer folder set /path/to/music
```

Or use natural language:

```
set music folder to C:\Users\Me\Music
```

## Usage

### Enable the agent

In the shell or interactive mode:

```
@config localPlayer on
```

### Example commands

**Play music:**

```
play some music
play song.mp3
play all songs in the folder
```

**Control playback:**

```
pause
resume
stop
next track
previous track
```

**Volume:**

```
set volume to 50
turn up the volume
mute
```

**Queue management:**

```
show the queue
add rock song to queue
clear the queue
play the third track
```

**Browse files:**

```
list files
search for beethoven
show music folder
```

## Available Actions

| Action | Description |
| ----------------- | ------------------------------------- |
| `playFile` | Play a specific audio file |
| `playFolder` | Play all audio files in a folder |
| `playFromQueue` | Play a track from the queue by number |
| `status` | Show current playback status |
| `pause` | Pause playback |
| `resume` | Resume playback |
| `stop` | Stop playback |
| `next` | Skip to next track |
| `previous` | Go to previous track |
| `shuffle` | Turn shuffle on/off |
| `repeat` | Set repeat mode (off/one/all) |
| `setVolume` | Set volume level (0-100) |
| `changeVolume` | Adjust volume by amount |
| `mute` | Mute audio |
| `unmute` | Unmute audio |
| `listFiles` | List audio files in folder |
| `searchFiles` | Search for files by name |
| `addToQueue` | Add file to playback queue |
| `clearQueue` | Clear the queue |
| `showQueue` | Display the queue |
| `setMusicFolder` | Set default music folder |
| `showMusicFolder` | Show current music folder |

## Supported Audio Formats

- MP3 (.mp3)
- WAV (.wav)
- OGG (.ogg)
- FLAC (.flac)
- M4A (.m4a)
- AAC (.aac)
- WMA (.wma)

## Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
trademarks or logos is subject to and must follow
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.
41 changes: 41 additions & 0 deletions ts/packages/agents/playerLocal/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "music-local",
"version": "0.0.1",
"private": true,
"description": "Local media player agent for TypeAgent",
"homepage": "https://github.com/microsoft/TypeAgent#readme",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/TypeAgent.git",
"directory": "ts/packages/agents/playerLocal"
},
"license": "MIT",
"author": "Microsoft",
"type": "module",
"exports": {
"./agent/manifest": "./src/agent/localPlayerManifest.json",
"./agent/handlers": "./dist/agent/localPlayerHandlers.js"
},
"scripts": {
"agc": "agc -i ./src/agent/localPlayerSchema.agr -o ./dist/agent/localPlayerSchema.ag.json",
"asc": "asc -i ./src/agent/localPlayerSchema.ts -o ./dist/agent/localPlayerSchema.pas.json -t LocalPlayerActions -e LocalPlayerEntities",
"build": "concurrently npm:tsc npm:asc npm:agc",
"clean": "rimraf --glob dist *.tsbuildinfo *.done.build.log",
"tsc": "tsc -p src"
},
"dependencies": {
"@typeagent/agent-sdk": "workspace:*",
"@typeagent/common-utils": "workspace:*",
"chalk": "^5.4.1",
"debug": "^4.4.0",
"play-sound": "^1.1.6"
},
"devDependencies": {
"@typeagent/action-schema-compiler": "workspace:*",
"@types/debug": "^4.1.12",
"action-grammar-compiler": "workspace:*",
"concurrently": "^9.1.2",
"rimraf": "^6.0.1",
"typescript": "~5.4.5"
}
}
Loading