Commit Graph

105 Commits

Author SHA1 Message Date
Harry 151bb87094 feat(gmail_trigger): enhance Gmail message event handling with addition and deletion tracking
- Updated the GmailMessageEvent class to handle both added and deleted messages, improving event management.
- Introduced a new `cancelled` field in TriggerInvokeEventResponse to indicate event cancellation.
- Enhanced error handling with EventIgnoreError for cases with no relevant messages.
- Updated YAML documentation to reflect changes in event behavior and output schema.
2025-11-04 18:20:39 +08:00
Harry 39a9a04d64 chore: bump plugin version to 0.6.0b13 and update response field in TriggerDispatchResponse model
- Updated version in pyproject.toml and requirements.txt to 0.6.0b13.
- Changed 'raw_http_response' to 'response' in TriggerDispatchResponse model for clarity.
- Updated GitHub trigger manifest version to 1.3.8.
2025-10-20 12:28:33 +08:00
Yeuoly 77a503422f add payload to 2025-10-18 18:20:35 +08:00
Yeuoly 8fc93f4024 feat: support payload in distaptch_event and _on_event 2025-10-18 18:18:43 +08:00
Harry cad974b207 feat: enhance GitHub trigger plugin with user ID tracking and event updates
- Added user_id field to EventDispatch and TriggerDispatchResponse models to track the user triggering events.
- Updated GitHub trigger provider to include user_id in event dispatching.
- Modified star event parameters in YAML to simplify naming conventions from "star_created" and "star_deleted" to "created" and "deleted".
- Bumped plugin version in manifest.yaml from 1.3.5 to 1.3.6 to reflect these changes.
2025-10-17 20:58:56 +08:00
Harry e526acc498 refactor: enhance subscription handling in PluginExecutor and related classes
- Added subscription handling to the EventRuntime and TriggerInvokeEventRequest classes, improving the management of event subscriptions.
- Updated the PluginExecutor to include subscription details when invoking events, ensuring better integration with subscription-based workflows.
- Modified test cases to reflect the new subscription structure, enhancing test coverage and reliability.

These changes improve the overall functionality and clarity of the subscription system within the plugin.
2025-10-13 18:12:54 +08:00
Harry 8cdd62509d refactor: enhance trigger subscription handling and improve type annotations
- Updated the PluginExecutor and related classes to improve type annotations and clarity, particularly in methods handling OAuth credentials and trigger subscriptions.
- Refactored the PluginRegistration and TriggerFactory classes to streamline the retrieval of trigger providers and event handlers, ensuring better type safety and consistency.
- Adjusted the YAML loader function to specify return types, enhancing code readability and maintainability.

These changes improve the overall structure and usability of the trigger subscription system, making it more robust and easier to understand.
2025-10-11 21:09:12 +08:00
Harry d6fa7bfb7e chore: bump dify_plugin version to 0.6.0b7 and update trigger event handling
- Updated the version in pyproject.toml from 0.6.0b6 to 0.6.0b7.
- Renamed trigger-related methods and classes for clarity, changing invoke_trigger to invoke_trigger_event and updating associated request and response classes.
- Adjusted event handling in the GithubTrigger class to improve event dispatching.

These changes ensure the plugin is up-to-date and enhance the clarity and functionality of event handling.
2025-10-10 19:31:28 +08:00
Harry ec9bb73fbe refactor: streamline trigger imports and enhance plugin registration logic
- Simplified import statements across various files by reordering and consolidating imports for better readability.
- Refactored the PluginRegistration class to improve the clarity of the configuration handling logic, ensuring more concise checks for subscription constructors.

These changes enhance code maintainability and readability throughout the plugin structure.
2025-10-10 14:31:49 +08:00
Harry 656037254e chore: bump dify_plugin version to 0.6.0b6 in pyproject.toml
- Updated the version of dify_plugin from 0.6.0b5 to 0.6.0b6 in pyproject.toml.

This change ensures that the project dependencies are aligned with the latest plugin version.
2025-10-10 13:10:44 +08:00
Harry aba2f88492 refactor: update event handling and parameter types in GitHub trigger
- Introduced new event mappings for issue comments in the GithubTrigger class, enhancing event handling capabilities.
- Updated the TriggerSubscribeRequest to allow for optional selected_events.
- Modified the YAML configuration to change the 'triggers' parameter to 'events' and added options for issue comments.

These changes improve the flexibility and clarity of event handling in the GitHub trigger implementation.
2025-10-09 17:44:44 +08:00
Harry 3fe764c6d2 refactor: update terminology in PluginExecutor and TriggerDispatchResponse
- Renamed the 'triggers' attribute to 'events' in TriggerDispatchResponse for consistency with event terminology.
- Updated method signatures in IssueOpenedEvent to use Mapping instead of dict for better type clarity.

These changes enhance the coherence of the codebase and align with the recent terminology updates across the project.
2025-10-09 14:48:44 +08:00
Harry a9b6abf9fc refactor: update trigger and event terminology across the codebase
- Renamed classes and methods related to triggers to use "Event" terminology for consistency and clarity.
- Updated the PluginExecutor, PluginRegistration, and TriggerFactory to reflect the new event handling structure.
- Adjusted YAML configurations and example implementations to align with the new event definitions.
- Enhanced the .gitignore file to include .DS_Store and ensure cleaner project management.

These changes improve the overall coherence of the codebase and enhance the clarity of event-driven functionality.
2025-09-30 20:10:16 +08:00
Yeuoly 420b2b6db1 refactor: improve code readability and organization
- Adjusted import order in request.py for consistency.
- Enhanced the description formatting in trigger.py for better clarity.
- Streamlined exception handling and method signatures in github.py for improved readability.
- Simplified dictionary construction in message_delivered.py to enhance clarity.
- Consolidated return statements in test_trigger_factory.py for better organization.

These changes contribute to a cleaner and more maintainable codebase, improving overall readability and consistency across the project.
2025-09-26 23:23:38 +08:00
Yeuoly 1881a22494 refactor: streamline trigger factory and enhance plugin registration
- Consolidated logic in PluginRegistration for determining subscription constructor classes.
- Simplified method signatures in TriggerFactory for better readability.
- Updated import paths in providers.py to reflect the new module structure.
- Introduced comprehensive tests for the TriggerFactory to ensure robust functionality.

These changes improve code clarity and maintainability while enhancing the overall structure of the trigger management system.
2025-09-26 23:14:03 +08:00
Yeuoly fac16a49d2 feat: enhance trigger subscription management and introduce new runtime classes
- Added TriggerSubscriptionConstructorRuntime for managing subscription credentials and session data.
- Refactored PluginExecutor to utilize the new trigger subscription constructor for improved event handling.
- Updated PluginRegistration to support the new trigger subscription constructor interface.
- Introduced example-lark-trigger dependency in pyproject.toml for enhanced functionality.
- Cleaned up and standardized trigger-related classes and interfaces for better maintainability.

These changes improve the overall structure and functionality of the trigger subscription system, ensuring a more robust and flexible event handling process.
2025-09-26 22:20:23 +08:00
Harry d3708859c7 refactor: remove DatasourceProviderMapping class from plugin_registration.py
- Eliminated the DatasourceProviderMapping class to streamline the codebase.
- This change enhances maintainability by reducing complexity in the plugin registration module.
2025-09-26 14:37:46 +08:00
Harry 5976f6ec1f refactor: format PluginAccessAction for improved readability
- Reformatted the definition of PluginAccessAction to enhance code clarity.
- Removed an unnecessary blank line in the TriggerInvokeRequest class.

These changes contribute to better code organization and maintainability.
2025-09-26 14:31:49 +08:00
Harry 27fca1f2fe feat: add DatasourceActions to PluginAccessAction and clean up code
- Included DatasourceActions in the merged PluginAccessAction for enhanced access control.
- Added a blank line for improved readability in the TriggerInvokeRequest class.

These changes improve the structure and functionality of the plugin request handling.
2025-09-26 14:21:33 +08:00
Harry 26b1324c59 Merge remote-tracking branch 'origin/main' into feat/trigger
# Conflicts:
#	python/dify_plugin/core/entities/message.py
#	python/dify_plugin/core/entities/plugin/request.py
#	python/dify_plugin/core/entities/plugin/setup.py
#	python/dify_plugin/core/plugin_registration.py
#	python/dify_plugin/plugin.py
#	python/examples/github/tools/github_repositories.yaml
#	python/pyproject.toml
2025-09-26 14:18:06 +08:00
Harry ebe4c89bea feat(github_trigger): enhance GitHub trigger functionality and update configurations
- Updated type hints in `setup.py` and `__init__.py` for better clarity and compatibility with newer Python versions.
- Improved descriptions in `trigger.py` for better understanding of output variables.
- Added new dynamic options fetching for repositories in `github.py`, enhancing user experience.
- Updated `manifest.yaml` to reflect the new version 100.1.1 and included additional localization for Japanese.
- Cleaned up and standardized code in various files for improved readability and maintainability.

These changes enhance the overall functionality and usability of the GitHub trigger integration, ensuring a more robust event handling process.
2025-09-25 17:20:16 +08:00
Harry 64d1f8fdde refactor: update type hints and improve error handling in datasource examples 2025-09-24 14:48:36 +08:00
Harry b182fd2668 feat(trigger): enhance GitHub trigger event handling and update version
- Refactored `TriggerInvokeResponse` to use `Mapping[str, Any]` for event representation.
- Renamed `properties` to `variables` in the `Event` class for clarity and updated the description accordingly.
- Expanded the event options in the GitHub trigger configuration to allow selection of all events.
- Removed the deprecated `issue_comment` trigger implementation and its associated files.
- Bumped version in `manifest.yaml` to 0.0.9 to reflect these changes.

These updates improve the flexibility and clarity of the GitHub trigger integration, allowing for a broader range of event handling.
2025-09-17 13:46:04 +08:00
Yeuoly d53cea4093 Merge branch 'main' into feat/datasource 2025-09-09 16:50:29 +08:00
Maries 4ba92c11f9 Merge branch 'main' into feat/trigger 2025-09-08 23:50:30 +08:00
QuantumGhost 005d05bc36 feat(python): relaxing version verification (#202)
Relaxing the verification for `PluginConfiguration.version`
and `PluginConfiguration.Meta.minimum_dify_version`.

SDK part of langgenius/dify#25160
2025-09-08 15:25:00 +08:00
Harry 826a6df1a8 feat(trigger): enhance trigger validation and HTTP handling
- Updated `PluginExecutor` to return a result upon validating provider credentials.
- Renamed `ValidateProviderCredentials` to `ValidateTriggerCredentials` for consistency in trigger actions.
- Improved the `PluginRegistration` class to return OAuth schemas for registered providers.
- Added new error classes for better handling of trigger provider credential validation and OAuth errors.
- Refactored HTTP request and response serialization/deserialization for improved clarity and functionality.
- Enhanced GitHub provider to utilize new error handling and validation mechanisms.

This commit improves the overall structure and error management of the trigger system, ensuring better integration and usability.
2025-09-04 16:52:20 +08:00
Harry 6b58e7f924 feat(trigger): enhance GitHub trigger and parameter handling
- Updated the GitHub trigger provider to include dynamic parameter options for user selection.
- Refactored the subscription schema to improve parameter definitions and added support for new credential types.
- Enhanced logging for installed triggers to provide clearer information.
- Adjusted the manifest versioning and naming conventions for better clarity and consistency.
2025-09-03 13:45:29 +08:00
Harry e9df3cbd4a feat(trigger): enhance trigger execution and response handling
- Introduced new response entities for trigger operations: TriggerInvokeResponse, TriggerDispatchResponse, TriggerSubscriptionResponse, TriggerUnsubscribeResponse, and TriggerRefreshResponse.
- Updated PluginExecutor methods to utilize the new response structures, improving clarity and consistency in trigger handling.
- Enhanced HTTP request parsing and response conversion utilities for better integration with various content types.
- Refactored GitHub provider to align with the updated trigger dispatch and subscription handling mechanisms.
2025-08-30 19:36:24 +08:00
Harry 3a66fc061b refactor(trigger): remove resubscribe functionality and update subscription handling
- Removed the resubscribe_trigger method and its associated request entity.
- Updated subscription parameters to streamline the subscribe and unsubscribe processes.
- Enhanced the trigger provider interface to utilize the new subscription schema.
- Adjusted GitHub provider implementation to align with the updated subscription structure.
2025-08-29 15:07:26 +08:00
Harry aa417a750f feat(trigger): refactor trigger system with enhanced provider capabilities
- Update trigger provider interface with subscribe/unsubscribe actions
- Implement GitHub issue comment trigger example
- Enhance plugin executor to support trigger operations
- Improve request entity structure for trigger handling
- Remove deprecated push trigger implementation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-27 21:42:48 +08:00
Harry ff61d5f204 feat(trigger): add subscribe and unsubscribe functionality to trigger provider 2025-08-27 14:37:19 +08:00
Harry f05cbce8f8 feat(trigger): implement trigger provider functionality and actions 2025-08-26 20:52:57 +08:00
Harry 56db20fc40 Merge branch 'main' into feat/datasource
# Conflicts:
#	python/dify_plugin/core/plugin_executor.py
#	python/dify_plugin/core/runtime.py
#	python/dify_plugin/entities/__init__.py
#	python/dify_plugin/entities/agent.py
#	python/dify_plugin/entities/tool.py
#	python/dify_plugin/errors/tool.py
#	python/dify_plugin/integration/run.py
#	python/dify_plugin/interfaces/tool/__init__.py
#	python/dify_plugin/plugin.py
#	python/examples/github/manifest.yaml
#	python/examples/github/provider/github.py
#	python/examples/github/provider/github.yaml
#	python/examples/github/requirements.txt
#	python/examples/github/tools/github_repositories.py
#	python/examples/github/tools/github_repository_readme.py
#	python/pyproject.toml
2025-07-29 18:44:38 +08:00
Maries c6f83a63e1 feat[0.4.2]: Tool OAuth (#179)
* chore: fix ruff issue

* feat(oauth): implement OAuth

* feat(invoke-message): refactor message handling and introduce InvokeMessage class

* feat(plugin-oauth): add credential_id and credential_type to tool parameters

* feat(plugin-oauth): add credential_id and credential_type to tool parameters

* chore: update dify_plugin version to 0.5.0b4 and clean up github.yaml

* chore: update plugin version to 0.1.2 in manifest.yaml

* feat(session): session context and tool backwards invocation credential support

* feat(oauth): session context and tool backwards invocation credential support

* feat: update README and requirements for OAuth support in version 0.4.2

* feat: add .gitignore to exclude IDE files and secret keys

* chore: apply ruff

* feat: bump version to 0.4.2b1

* feat: update GitHub plugin configuration for OAuth support and improve credential handling

* feat: update .gitignore to exclude dify plugin files and public keys

* feat: fix credential validation for GitHub API and bump version to 0.2.1

* feat: update GitHub plugin to support multiple access tokens and bump version to 0.2.5

* chore: apply ruff

* feat: add ToolProviderOAuthError for improved OAuth error handling in GitHub plugin

* chore: apply ruff

* chore: bump version to 0.4.2

* chore: update examples sdk version to 0.4.2

* fix: thread deadlock in PluginRunner when running tests without gevent monkey patching

* feat: add support for refreshing OAuth credentials in Plugin and GitHub provider

* feat: refactor OAuth credential handling to return structured OAuthCredentials object

* apply ruff

* feat: refactor OAuth credential handling to use ToolOAuthCredentials for improved structure

* feat: reorganize imports in __init__.py for improved clarity and structure

* feat: add Microsoft To Do plugin for refresh token example

* chore: apply ruff

* fix: update author in GitHub configuration and clean up Microsoft To Do schema

* chore: bump version to 0.4.2b2 in pyproject.toml

* feat: update Microsoft To Do plugin to handle OAuth token encoding and version bump

* feat:remove inelegant example

* chore: update dify_plugin version to 0.4.2

* chore: bump version to 0.4.2 in pyproject.toml

---------

Co-authored-by: Yeuoly <admin@srmxy.cn>
2025-07-23 13:49:01 +08:00
Harry 6bf1431954 feat: enhance type hints and improve error handling in Notion datasource 2025-07-18 20:04:46 +08:00
Maries f55014d757 Merge branch 'main' into feat/datasource 2025-07-18 19:53:48 +08:00
Harry 1915391a14 Merge branch 'feat/plugin-oauth' into feat/datasource 2025-07-14 11:01:08 +08:00
Harry 3f1899a1dd feat(session): session context and tool backwards invocation credential support 2025-07-13 01:33:41 +08:00
Yeuoly d27bbddc02 feat: dark icon (#173)
* docs: update README.md to include support for `dark-icon` field in manifest versioning

* feat: add dark mode icon fields to Tool and SimpleProviderEntity models

- Introduced `icon_dark` field in ToolProviderIdentity for dark mode support.
- Added `icon_small_dark` and `icon_large_dark` fields in SimpleProviderEntity for dark mode icons.
2025-07-09 16:06:20 +08:00
Harry 68abb06abf feat: clean up imports in agent.py, github_repositories.py, and request.py 2025-07-07 17:50:42 +08:00
Harry f4c32abecc Merge branch 'feat/plugin-oauth' into feat/datasource
# Conflicts:
#	python/dify_plugin/core/entities/plugin/request.py
#	python/dify_plugin/core/plugin_executor.py
#	python/dify_plugin/entities/__init__.py
#	python/dify_plugin/entities/agent.py
#	python/dify_plugin/entities/tool.py
#	python/examples/github/tools/github_repositories.py
2025-07-07 17:44:05 +08:00
Harry 0ec96aea2a feat(oauth): implement OAuth 2025-07-07 15:16:56 +08:00
Harry 2aedda0652 chore: fix ruff issue 2025-07-06 16:37:04 +08:00
Harry f2e9190d2d feat: add CredentialType enum and integrate into ToolRuntime and update examples 2025-07-04 19:12:09 +08:00
Harry a844db7a68 refactor: streamline code by improving import order and simplifying function definitions 2025-07-02 16:32:20 +08:00
Harry e8cc4760cb refactor: update type hints to use union syntax and improve import order 2025-07-02 16:15:28 +08:00
Harry e59d246115 Merge remote-tracking branch 'origin/main' into feat/oauth-datasource
# Conflicts:
#	python/dify_plugin/core/entities/plugin/request.py
#	python/dify_plugin/core/plugin_executor.py
#	python/dify_plugin/entities/__init__.py
#	python/dify_plugin/entities/tool.py
#	python/dify_plugin/interfaces/tool/__init__.py
#	python/dify_plugin/plugin.py
#	python/pyproject.toml
2025-07-02 14:08:12 +08:00
Harry ab07c664d9 feat: rename online driver to online drive and update related classes and methods :) 2025-06-27 20:13:00 +08:00
Harry 7b06a2ac23 feat: add online driver datasource 2025-06-27 16:33:44 +08:00