Skip to main content

Plane Agent Development Kit

Project description

plane-adk

A Python SDK for building intelligent agents that integrate with Plane.so workspace management platform. This package provides tools to create automated workflows, handle webhooks, and respond to workspace events.

Installation

pip install plane-adk

Usage

Basic Setup

First, set up your environment variables for Plane OAuth:

export PLANE_CLIENT_ID="your_client_id"
export PLANE_CLIENT_SECRET="your_client_secret"
export PLANE_REDIRECT_URI="your_redirect_uri"
export PLANE_BASE_URL="https://api.plane.so"  # Optional, defaults to this

Creating a PlaneAgent

from plane_adk.agent import PlaneAgent, Credentials

# Create credentials
credentials = Credentials(
    client_id="your_client_id",
    client_secret="your_client_secret",
    app_installation_id="your_app_installation_id",
    base_url="https://api.plane.so",  # Optional
    redirect_uri="your_redirect_uri"
)

# Initialize the agent
agent = PlaneAgent(credentials)

Handling Events

The PlaneAgent supports various events that you can listen to:

def assigned_callback(handler, context):
    """Called when an issue is assigned to the bot"""
    handler.progress("I've been assigned to this issue!")

    # Access issue details
    issue_id = context.issue_id
    issue_payload = context.issue_payload

    # Add a comment to the issue
    handler.progress("Starting work on this issue...")

def mentioned_callback(handler, context):
    """Called when the bot is mentioned in an issue comment"""
    handler.progress("Thanks for mentioning me!")

    # You can access the comment data
    comment_data = context.event.data

    # Respond to the mention
    handler.progress("I'm here to help with this issue!")

# Register event handlers
agent.issue.on("assigned", assigned_callback)
agent.issue.on("mentioned", mentioned_callback)

# Process incoming webhooks
agent.process_webhook(webhook_data)

Examples

For more detailed examples, check out the example/ folder which includes:

  • FastAPI Integration: Complete webhook server setup with OAuth handling
  • AI Task Breakdown: Advanced example using AI to automatically break down issues into actionable tasks

Supported Events

  • assigned: Triggered when an issue is assigned to the bot
  • mentioned: Triggered when the bot is mentioned in an issue comment
  • unassigned: Triggered when the bot is unassigned from an issue

Context Object

The context object passed to event handlers contains:

  • issue_id: The ID of the issue
  • workspace_id: The workspace ID
  • workspace_slug: The workspace slug
  • project_id: The project ID (if applicable)
  • issue_payload: Full issue data from Plane API
  • event: The original webhook event data
  • entity_name: Type of entity ("issue" or "comment")
  • entity_id: ID of the entity

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plane_adk-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plane_adk-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file plane_adk-0.1.0.tar.gz.

File metadata

  • Download URL: plane_adk-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for plane_adk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 088206767cc17fe7347832e9b22c207f01b015f1c2fdf24d7133961a8e4bee7a
MD5 68adbc1143ca060551381be2f913c104
BLAKE2b-256 9056ac283f0d88eb2edc79d66f11f1995ea45d5a37422f71279306f1abdf0569

See more details on using hashes here.

File details

Details for the file plane_adk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: plane_adk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for plane_adk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d156828555b1749e7a35146349aa5a9ebd3e389d276da2b8b251f224dc8bd515
MD5 ea42afb87d5c769dae1e5ba44c21fd82
BLAKE2b-256 2ffac8cacfa6f73f328dba4c4b44c864fa147fb98d8ed6316a65ad14ca7a2084

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page