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.1.tar.gz (5.7 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.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for plane_adk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1b84f5c05e1b7984155b5b4d278698f6d65544e36ee379f9229e554ff823ec01
MD5 be393c51ad78094092fec51b0201dfd2
BLAKE2b-256 da708caecf77a7db28ecdccc2142c4ce74501d1c880e21335698d527968006b7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for plane_adk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d88ed93a5d616fc9369e82ced17869f52f159b5748573877db858ef3b36dd1d
MD5 8f9a6845dfc60ff78ae7064226236fc4
BLAKE2b-256 56b5506ecfd7b360c8ceb52406d2bcd54441e3294b01b81db94b7e84f2a02bbc

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