Playbooks Debugger extension for Visual Studio Code
A Visual Studio Code extension that supports debugging Playbooks programs. Playbooks Debugger provides a seamless debugging experience by allowing you to set breakpoints, step through code, inspect variables, and perform other essential debugging tasks.
Playbooks Language Support for Visual Studio Code
This extension provides comprehensive language support for Playbooks, including syntax highlighting, IntelliSense, debugging, and preview capabilities.
Usage
Once installed in Visual Studio Code, vscode-playbooks will be automatically activated when you open a Playbooks file (.pb or .pbasm). While .pb files are written in Playbooks language, .pbasm files are compiled Playbooks programs in the Playbooks Assembly Language format.
Debug Configurations
Launch Mode
Launch mode starts a new playbooks process with debugging enabled:
{
"type": "playbooks",
"request": "launch",
"name": "Launch Playbook",
"program": "/path/to/your/playbook.pb" or "${file}" to debug file in editor,
"pythonPath": "python",
"application": "playbooks.applications.agent_chat",
"console": "integratedTerminal",
"stopOnEntry": false,
"cwd": "${fileDirname}",
"args": [],
"env": {}
}
Configuration Options:
program
: Path to the Playbooks file to debug (.pb or .pbasm)
pythonPath
: Path to Python interpreter (defaults to "python")
application
: Playbooks application module to use (defaults to "playbooks.applications.agent_chat")
console
: Where to run the process:
"integratedTerminal"
: VS Code integrated terminal (default)
"externalTerminal"
: External terminal window
"internalConsole"
: VS Code debug console
stopOnEntry
: Whether to stop at the first line (default: false)
cwd
: Working directory for the process
args
: Additional command line arguments
env
: Environment variables
Playbooks Assembly Language files (.pbasm)
When a set of Playbooks files are compiled, the output is a Playbooks Assembly Language Program (.pbasm file) in the Playbooks Assembly Language format. When launching .pbasm
files, the compilation step is skipped.
Attach Mode
Attach mode connects to an already running playbooks debug server. To start a playbooks program and playbooks debug server, run the following command:
python -m playbooks run your_playbook.pb --debug --debug-port 7529 --wait-for-client
Then, in VS Code, go to Run and Debug view and select "Attach to Playbooks Server".
{
"type": "playbooks",
"request": "attach",
"name": "Attach to Playbooks Server",
"port": 7529,
"host": "127.0.0.1"
}
Configuration Options:
port
: Port number of the debug server (default: 7529)
host
: Host address of the debug server (default: "127.0.0.1")
connect
: Alternative connection object with host
and port
properties
Requirements
- VS Code 1.74.0 or higher
- Python 3.10 or higher
- Playbooks package version 0.3.2 or higher
Plugin Development
To deploy a new version of the extension, run the following command:
vsce login playbooks-ai
vsce package
vsce publish
Release Notes
0.1.5
- Rename Playbooks Common Language Specification (CLS) files (.pbc) to Playbooks Assembly Language files (.pbasm) to better reflect the language
0.1.4
- Use Python interpreter path to launch Playbooks programs
- Add ANTHROPIC_API_KEY environment variable in launch and attach configurations
- Improved launch and attach configurations
- Don't close temporary .pb editor when opening compiled .pbasm
0.1.3
- Include node_modules in the extension package
0.1.2
- Preview provider for Playbooks programs (.pb and .pbasm files)
0.1.1
- Fix bug in launch mode when using ${file} to debug file in editor
0.1.0
- Initial release of Playbooks Debugger extension for VS Code