Commit Graph

77 Commits

Author SHA1 Message Date
Joe 9425c82dcb fix: miss max_single_connection_lifetime (#252) 2025-12-26 15:03:40 +08:00
Yeuoly f902504af0 feat: support multimodal embeddings (#237)
* Inline multimodal entities into existing models

* apply ruff

* bump to 0.7.0b1

* fix: remove tenant_id from invoke_multimodal_embedding

* tests: add rerank

* apply ruff

* fix

* fix: typing
2025-12-08 19:40:56 +08:00
Yeuoly c31cb9c3e3 feat: add trigger functionality (#162)
* feat: add trigger functionality and dynamic select parameter support

- Introduced new `Trigger` and `TriggerProvider` classes for handling trigger operations.
- Added `TriggerResponse`, `TriggerRuntime`, and `TriggerParameter` models to manage trigger data.
- Implemented `DynamicSelectProtocol` for dynamic parameter options.
- Updated `ToolParameterOption` to inherit from `ParameterOption`.
- Enhanced `CommonParameterType` with `DYNAMIC_SELECT` option.
- Added tests for `TriggerProvider` and `Trigger` to ensure proper functionality.

* fix: linter

* feat: add dynamic select support

- Introduced ParameterOption class for parameter options with value, label, and optional icon.
- Updated ToolParameterOption to inherit from ParameterOption.
- Added DYNAMIC_SELECT to CommonParameterType enum.
- Implemented fetch_parameter_options method in Tool class for fetching parameter options.
- Created DynamicSelectProtocol for dynamic select functionality.
- Added tests for Tool construction and parameter options fetching.

* feat: implement dynamic parameter fetching functionality

- Added DynamicParameterFetchParameterOptionsRequest class for dynamic parameter requests.
- Introduced DynamicParameterActions enum for action types related to dynamic parameters.
- Enhanced PluginExecutor with methods to handle dynamic parameter fetching.
- Updated Tool interface to include a method for fetching parameter options.
- Documented the DynamicSelectProtocol for clarity on its usage.

* feat: enhance plugin functionality with dynamic parameter options and trigger interface

- Added dynamic parameter fetching capabilities to the Plugin class.
- Introduced TriggerProvider and Trigger classes for managing trigger functionalities.
- Updated Tool interface to enforce implementation of credential validation and OAuth methods.
- Enhanced error messages for NotImplementedError in ToolProvider and Trigger classes.
- Removed deprecated tools and their configurations from the codebase.

* refactor(trigger): update type hints and add dispatch_event to trigger provider

* chore: update .gitignore to exclude Visual Studio Code configuration files

* feat(trigger): implement trigger provider functionality and actions

* feat(trigger): add subscribe and unsubscribe functionality to trigger provider

* 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>

* feat(trigger): enhance provider configuration and validation

* 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.

* 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.

* refactor(plugin): update HTTP request/response handling and improve type hints

- Replaced `parse_raw_request` and `convert_response_to_raw_data` with `deserialize_request` and `serialize_response` for better clarity and functionality.
- Enhanced the `PluginExecutor` methods to utilize the new request and response utilities.
- Updated type hints in the `Subscription` class to use `Mapping` instead of `dict` for improved type safety.
- Refactored HTTP parsing logic to support a wider range of content types and improve overall request handling.

* refactor(trigger): remove unused subscription parameters from Subscription class

- Eliminated the `parameters` field from the `Subscription` class to streamline the subscription model.
- Updated documentation to reflect the changes in subscription creation parameters.

* 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.

* chore: bump version to 0.4.4b1 in pyproject.toml

* refactor(trigger): update trigger error handling and response types

- Renamed `WebhookValidationError` to `TriggerValidationError` for consistency in error handling across trigger operations.
- Updated references to the new `TriggerValidationError` in the GitHub provider and trigger interfaces.
- Enhanced the `TriggerProvider` class to raise the new validation error for webhook signature issues.
- Adjusted the `IssueCommentTrigger` to return the correct event response type.
- Improved type hints and imports in various modules for better clarity and organization.

* test: fix import names after refactoring

- Update TriggerEvent import (was Trigger) in test_construct_trigger.py
- Update http_parser function imports to use new names:
  * serialize_request (was convert_request_to_raw_data)
  * serialize_response (was convert_response_to_raw_data)
  * deserialize_request (was parse_raw_request)
  * deserialize_response (was parse_raw_response)

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

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: update dify_plugin version to 0.4.5b1 in requirements.txt

* 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.

* fix(github): improve payload parsing for GitHub webhooks

- Enhanced the GitHub provider to handle both form-encoded and JSON payloads from webhooks.
- Updated error handling to provide clearer messages for payload parsing issues.
- Ensured compatibility with various content types in incoming requests.

This change improves the robustness of the GitHub trigger integration by accommodating different data formats.

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

* chore: update version to 0.0.3 in manifest.yaml and bump dify_plugin to 0.4.5b2 in requirements.txt

* chore: update GitHub provider to support additional OAuth scopes and improve payload handling

- Bumped version in manifest.yaml to 0.0.5.
- Enhanced OAuth credential retrieval to include the 'admin:repo_hook' scope.
- Improved payload parsing logic for better handling of incoming requests.
- Adjusted default event in provider configuration for clarity.

* feat(trigger): enhance GitHub trigger with multiple event selection and dynamic parameter options

- Updated `IssueCommentTrigger` and `GithubProvider` to support multiple event selections for GitHub triggers.
- Introduced a new `multiple` field in the trigger parameters to allow users to select multiple events.
- Implemented dynamic fetching of repository options based on OAuth credentials.
- Bumped version in `manifest.yaml` to 0.0.7 to reflect these enhancements.

This update improves the flexibility and usability of the GitHub trigger integration.

* chore: bump version to 0.4.5b3 in pyproject.toml

* chore: bump dify_plugin version to 0.4.5b3 in requirements.txt

* chore: bump dify_plugin version to 0.6.0b1 in pyproject.toml and requirements.txt

* refactor: clean up imports and improve code readability

- Removed unused imports in `__init__.py` and `dynamic_options.py`.
- Consolidated import statements in `github.py` and `issue_comment.py` for better organization.
- Standardized string formatting in test cases for consistency.
- Enhanced overall code clarity and maintainability.

These changes contribute to a cleaner codebase and improved readability across the project.

* refactor: standardize import statements in GitHub trigger files

- Removed redundant import paths for `fetch_repositories` in `github.py` and `issue_comment.py`.
- Updated import statements to use a consistent module path for better maintainability.

These changes enhance code organization and readability across the GitHub trigger implementation.

* fix(test): update test case for oauth_get_authorization_url to include redirect URI

- Modified the test for `oauth_get_authorization_url` to pass a redirect URI as the first argument, ensuring proper functionality and coverage.

This change enhances the accuracy of the test case for the TriggerProvider's OAuth implementation.

* 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.

* feat(provider): add 'multiple' field to ProviderConfig for enhanced configuration options

- Introduced a new boolean field 'multiple' in the ProviderConfig class to allow for more flexible configuration settings.

This addition improves the configurability of provider options within the plugin.

* feat(trigger): introduce new error class and enhance event payload handling

- Added `TriggerIgnoreEventError` to handle cases where events should be ignored based on filter criteria.
- Updated various GitHub trigger files to return relevant payload fields directly, improving data accessibility for event handling.
- Enhanced the handling of event filtering in triggers to ensure only relevant events are processed.

These changes improve the robustness and clarity of the GitHub trigger integration, allowing for better error management and data handling.

* feat(whatsapp_trigger): add WhatsApp Business integration with message triggers

- Introduced a new plugin for WhatsApp Business that integrates webhook triggers for automated messaging workflows.
- Implemented triggers for text, image, and message delivery events, allowing users to respond to various message types.
- Added dynamic options fetching for available phone numbers and message templates.
- Included comprehensive documentation in README.md and manifest.yaml for setup and usage instructions.
- Enhanced security with signature validation for incoming webhook requests.

These additions provide a robust framework for automating interactions via WhatsApp, improving user engagement and operational efficiency.

* feat(github_trigger): update trigger configurations and remove deprecated files

- Added a new trigger configuration for `pull_request_merged.yaml` to enhance event handling.
- Updated the `deployment_status_created.py` to return event variables correctly.
- Expanded the `deployment_status_created.yaml` with additional properties for better event context.
- Removed obsolete trigger files related to discussions and issues, streamlining the trigger set.

These changes improve the overall functionality and maintainability of the GitHub trigger integration.

* feat(github_trigger): remove deprecated trigger files and add new issue trigger

- Deleted obsolete trigger files for various GitHub events including commit comments, create, delete, deployment, discussion, and others to streamline the trigger set.
- Introduced a new `issues.py` trigger to handle GitHub issue events, enhancing event handling capabilities.
- Added corresponding `issues.yaml` configuration to define the new trigger's properties and behavior.

These changes improve the overall functionality and maintainability of the GitHub trigger integration, ensuring a more efficient event handling process.

* 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.

* 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.

* 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.

* 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.

* refactor: rename Unsubscription class to UnsubscribeResult for clarity

- Updated the class name from Unsubscription to UnsubscribeResult to better reflect its purpose.
- Adjusted related type hints and return types in the TriggerProvider interface and example implementations to maintain consistency.

These changes enhance code readability and improve the understanding of the unsubscription process in the trigger system.

* feat: introduce UnsubscribeError for improved error handling in GitHub provider

- Added UnsubscribeError class to handle errors during unsubscribe operations, providing detailed error messages and codes.
- Updated GithubProvider to raise UnsubscribeError in various failure scenarios, enhancing error reporting and debugging.
- Minor adjustments in the IssuesTrigger class to prepare for future enhancements.

These changes improve the robustness of the GitHub trigger integration by ensuring clearer error management during webhook unsubscription processes.

* 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.

* Add documentation and tests for trigger factory (#212)

* 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.

* fix: update GitHub trigger plugin configuration

- Removed the MAX_REQUEST_TIMEOUT parameter from the Plugin initialization for default behavior.
- Added a new section in the GitHub provider YAML file to specify the source of the Python implementation.

These changes simplify the plugin setup and enhance the configuration clarity for the GitHub trigger integration.

* 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.

* refactor: simplify trigger implementation in tests

- Removed the TriggerRuntime dependency from the test_construct_trigger.py file, streamlining the trigger instantiation process.
- Adjusted imports to reflect the updated structure, enhancing code clarity.

These changes contribute to a cleaner and more maintainable test setup for the trigger functionality.

* refactor: enhance test structure for TriggerProvider and TriggerSubscriptionConstructor

- Introduced TriggerProviderImpl and TriggerSubscriptionConstructor implementations in test_construct_trigger_provider.py to facilitate testing.
- Updated session management and request/response handling for improved test clarity and functionality.
- Ensured that the tests validate the behavior of the TriggerProvider and TriggerSubscriptionConstructor interfaces effectively.

These changes contribute to a more robust and maintainable testing framework for trigger functionality.

* feat: add checkbox parameter type to provider configuration

- Introduced a new CHECKBOX type in CommonParameterType to enhance parameter options.
- Updated ToolParameter and TriggerParameter classes to include the new CHECKBOX type.
- Modified the GitHub trigger manifest version to 1.1.0 and changed parameter type from select to checkbox in issues.yaml.

These changes improve the flexibility of parameter types available in the plugin, allowing for more diverse user interactions.

* refactor: streamline GitHub issue trigger implementation

- Removed the deprecated IssuesTrigger class and replaced it with a more focused IssueOpenedTrigger class to handle specific events when a new issue is opened.
- Updated the GitHub trigger YAML configuration to reflect changes in the subscription schema and parameters.
- Enhanced the validation logic for issue parameters, including title patterns, labels, assignees, authors, milestones, and body content.
- Improved the overall structure and clarity of the trigger implementation, ensuring better maintainability and functionality.

These changes contribute to a more efficient and organized handling of GitHub issue events, enhancing the plugin's responsiveness to user interactions.

* chore: bump version to 0.6.0b2 in pyproject.toml and update requirements

- Updated the version of the dify_plugin from 0.6.0b1 to 0.6.0b2 in pyproject.toml.
- Adjusted the requirements.txt file to reflect the new plugin version.

These changes ensure that the project dependencies are aligned with the latest plugin version.

* fix: no argument when provider created for oauth & credential validation

* 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.

* 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.

* chore: bump version to 0.6.0b4 in pyproject.toml

- Updated the version of the dify_plugin from 0.6.0b3 to 0.6.0b4 in pyproject.toml.

This change ensures that the project reflects the latest version of the plugin.

* chore: update manifest and requirements for plugin version bump

- Adjusted the indentation in manifest.yaml for better YAML formatting.
- Bumped the dify_plugin version from 0.6.0b4 to 0.6.0b5 in requirements.txt.

These changes ensure the project reflects the latest plugin version and maintains proper configuration formatting.

* feat: expand GitHub issue trigger events in provider

- Added new event mappings for issue closed, reopened, edited, labeled, unlabeled, assigned, and unassigned in the GithubTrigger class.
- Updated the YAML configuration to include the new events for subscription.

These changes enhance the GitHub trigger functionality by supporting a broader range of issue events, improving responsiveness to user interactions.

* 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.

* chore: bump dify_plugin version to 0.6.0b5 in pyproject.toml and requirements.txt

- Updated the version of dify_plugin from 0.6.0b4 to 0.6.0b5 in both pyproject.toml and requirements.txt.

This change ensures that the project dependencies are aligned with the latest plugin version.

* docs: update TriggerSubscriptionConstructor to clarify selected_events parameter

- Added documentation for the selected_events parameter in TriggerSubscriptionConstructor, explaining its optional nature and behavior when set to None or provided with specific event types.

This change enhances the clarity of the subscription configuration for users, improving the overall usability of the trigger interface.

* 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.

* refactor: enhance GitHub trigger event handling and configuration

- Updated the GitHub trigger implementation to improve type annotations and clarity in the GithubSubscriptionConstructor class.
- Removed the obsolete _resolve_webhook_events method to streamline event resolution.
- Expanded the YAML configuration to include a comprehensive list of available GitHub events for subscriptions, enhancing user configurability.

These changes improve the maintainability and usability of the GitHub trigger functionality.

* 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.

* chore: bump GitHub trigger plugin version to 1.1.2 and fix event naming

- Updated the version in manifest.yaml from 1.1.1 to 1.1.2.
- Changed the event naming in GithubTrigger class from 'issues_{action}' to 'issue_{action}' for consistency.

These changes ensure the plugin version is up-to-date and improve the clarity of event handling.

* 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.

* 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.

* refactor: improve type annotations and documentation clarity

- Enhanced type annotations in the PluginExecutor by adding Mapping to the import statements for better type safety.
- Reformatted the docstring in TriggerSubscriptionConstructor to improve readability by breaking long lines into multiple lines.

These changes contribute to better code clarity and maintainability across the plugin.

* chore: bump GitHub trigger plugin version to 1.2.1 and add time_range parameter

- Updated the version in manifest.yaml from 1.1.3 to 1.2.1.
- Added a new optional parameter 'time_range' in star_created.yaml to allow triggering based on a specified time range for stars.

These changes ensure the plugin is up-to-date and enhance the configurability of the star event trigger.

* refactor: update OAuth provider instance retrieval and enhance type annotations

- Modified the `_get_oauth_provider_instance` method in `PluginExecutor` to accept a `Session` parameter and return the appropriate OAuth provider instance.
- Updated the `get_supported_oauth_provider_cls` method in `PluginRegistration` to `get_supported_oauth_provider`, improving its signature and functionality.
- Enhanced type annotations across methods to improve clarity and type safety.

These changes streamline the OAuth provider handling and improve code maintainability.

* chore: bump dify_plugin version to 0.6.0b9 in pyproject.toml

- Updated the version of dify_plugin from 0.6.0b8 to 0.6.0b9 in pyproject.toml.

This change ensures that the project is aligned with the latest version of the plugin.

* 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.

* chore: bump dify_plugin version to 0.6.0b10 in pyproject.toml

- Updated the version of dify_plugin from 0.6.0b9 to 0.6.0b10 in pyproject.toml.

This change ensures that the project reflects the latest version of the plugin.

* feat: add comprehensive Lark trigger events implementation

Add Lark/Feishu webhook trigger with 10 event handlers:
- IM events: messages, member changes, reactions, read receipts
- Calendar events: event changes
- Approval events: approval status updates
- Drive events: file creation
- Contact events: employee onboarding, department creation

All events properly extract fields from Lark SDK models with:
- Explicit field declarations (no __dict__ usage)
- Correct data types (integers/booleans preserved)
- Human-friendly labels in EN/ZH/JA languages
- Organized subdirectory structure by domain

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

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: update event description type and clean up YAML files

- Changed the type of the event description in EventConfiguration from EventDescription to I18nObject for better internationalization support.
- Updated related test cases to reflect this change.
- Simplified the description fields in various issue and star event YAML files by removing redundant human and llm sections, retaining only the essential translations.

These changes enhance the clarity and maintainability of event configurations and improve support for multiple languages.

* chore: bump dify_plugin version to 0.6.0b11 in pyproject.toml

- Updated the version of dify_plugin from 0.6.0b10 to 0.6.0b11 in pyproject.toml.

This change ensures that the project reflects the latest version of the plugin.

* refactor: de-duplicate lark event dispatcher setup (#215)

* refactor: reuse lark event dispatch setup

* fix: expose structured lark trigger payloads

* Update python/examples/lark_trigger/events/contact/user_updated_v3.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update python/examples/lark_trigger/events/contact/user_updated_v3.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update python/examples/lark_trigger/events/contact/user_updated_v3.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update python/examples/lark_trigger/events/contact/user_updated_v3.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update python/examples/lark_trigger/events/contact/user_updated_v3.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* chore: bump GitHub trigger plugin version to 1.3.0 and update dify_plugin version to 0.6.0b11

- Updated the version in manifest.yaml from 1.2.2 to 1.3.0.
- Updated the version of dify_plugin from 0.6.0b9 to 0.6.0b11 in requirements.txt.

These changes ensure the plugin is up-to-date with the latest versions.

* refactor: add generics to lark dispatch helper (#216)

* refactor: update Lark trigger events to use new dispatch_single_event interface

- Replace direct lark.EventDispatcherHandler.builder usage with dispatch_single_event helper
- Update lambda syntax from callback pattern to direct method reference
- Change department_created_v3 YAML to use array types instead of JSON strings
- Remove redundant imports and boilerplate code across all event handlers
- Improve consistency across IM, contact, calendar, approval, and drive events

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

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: update Lark trigger YAML descriptions to use I18nObject format

- Remove human/llm nested structure from description fields
- Convert to direct I18nObject format with language codes as keys
- Update all 19 event YAML files across approval, calendar, contact, drive, and IM events
- Align with new SDK trigger description format requirements

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: remove leaked and unimplemented event registrations from Lark provider

- Remove p2p_chat_entered event registration (no handler file exists)
- Remove p2p_im_chat_member_bot_added_v1 event registration (no handler file exists)
- Fix calendar event name to match file naming (event_changed_v4 instead of calendar_event_changed_v4)
- Clean up unused imports for removed event types

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

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: implement new Lark trigger events for chat disbanded and updated

- Add P2ImChatDisbandedV1 event handler for when chats are disbanded
- Add P2ImChatUpdatedV1 event handler for chat information updates
- Register new events in provider and add to event list
- Check and use actual Lark SDK fields for proper data extraction

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

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: implement additional Lark trigger events

- Add P2ImMessageRecalledV1 event for message recall notifications
- Add P2ContactUserDeletedV3 event for employee deletion/departure
- Add P2DriveFileTrashedV1 event for file trash operations
- Fix department_ids to be array type instead of string in user_deleted_v3
- Register all new events in provider and add handler methods
- Check actual Lark SDK fields for proper data extraction

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

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: implement 11 new Lark trigger events and convert JSON outputs to proper data structures

- Add IM/Chat events: message_receive_v1, message_reaction_deleted_v1, chat_member_user_withdrawn_v1, chat_member_bot_added_v1, chat_member_bot_deleted_v1
- Add Drive events: file_read_v1, file_title_updated_v1
- Convert all JSON string outputs to proper arrays/objects across all events
- Update YAML schemas to use proper data types (array, object, number) instead of strings
- Fix data structure handling for department_ids, user lists, and complex nested objects
- Register all new events in provider with appropriate handlers

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

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: add comprehensive Lark event support (VC, meeting room, tasks)

- Added video conference (VC) events:
  - meeting_started_v1, meeting_ended_v1
  - join_meeting_v1, leave_meeting_v1
  - recording_started_v1, recording_ended_v1, recording_ready_v1
- Added meeting room events:
  - meeting_room_created_v1
  - meeting_room_status_changed_v1
- Added task events:
  - task_updated_v1
  - task_comment_updated_v1
- Added calendar and contact events:
  - calendar_changed_v4
  - scope_updated_v3
- Added Bitable events:
  - file_bitable_record_changed_v1
  - file_bitable_field_changed_v1

All events properly check SDK fields and use correct data structures.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix

* lark readme

* refactor: remove star created and deleted events from GitHub trigger

- Deleted the StarCreatedEvent and StarDeletedEvent classes along with their corresponding YAML configurations.
- Updated the GitHub trigger provider to simplify star event handling by consolidating to a single star event type.

These changes streamline the event structure and improve maintainability.

* chore: update GitHub trigger plugin version and remove deprecated issue comment events

- Bumped version from 1.3.0 to 1.3.1 in the manifest.
- Removed deprecated issue comment events: issue_comment_created, issue_comment_edited, issue_comment_deleted.
- Consolidated issue comment handling into a unified structure for better maintainability.
- Updated README to reflect changes in event handling and provide clearer setup instructions.

* chore: bump GitHub trigger plugin version to 1.3.5

- Updated version in manifest.yaml from 1.3.1 to 1.3.5 to reflect recent changes.

* Expand Slack trigger to full Events API catalog (#217)

* Expand Slack trigger to full Events API catalog

* Remove Slack trigger subscription constructor

* Remove Slack event selection from subscription schema

* Use official Slack icon asset

* Stop reading Slack signing secret from constructor parameters

* chore: remove tead_id

* plugin example: telegram (#219)

* chore: switch telegram trigger icon to svg

* fix: inline telegram trigger schemas

* chore: expand telegram trigger schemas

* Codex/implement slack trigger in main.py (#220)

* Expand Slack trigger to full Events API catalog

* Remove Slack trigger subscription constructor

* Remove Slack event selection from subscription schema

* Use official Slack icon asset

* Stop reading Slack signing secret from constructor parameters

* chore: remove tead_id

* refactoring

---------

Co-authored-by: Claude <noreply@anthropic.com>

* fix: apply ruff

* fix: icons

* fix: slack

* Refactor Telegram trigger events to follow consistent pattern

- Applied chat_boost event pattern to all 20 Telegram event handlers
- All event classes now inherit from both TelegramUpdateEvent and Event
- Preserved custom _build_variables implementations where present (e.g., message_received.py)
- Simple events now follow the minimal pattern with just update_key defined

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

Co-Authored-By: Claude <noreply@anthropic.com>

* rename

* Add Gmail trigger example plugin with automated subscription (#218)

* Add Gmail trigger example with automatic subscription

* Replace Gmail trigger example with Google Drive trigger

* Fix duplicate labels in Telegram trigger events

- Renamed "Message Received" to more specific labels:
  - message_edited.yaml → "Message Edited"
  - business_message_received.yaml → "Business Message Received"
  - business_message_edited.yaml → "Business Message Edited"
  - channel_post_created.yaml → "Channel Post Created"
  - channel_post_edited.yaml → "Channel Post Edited"

Now all event labels are unique and clearly describe their specific purpose.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: telegram yaml

* 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.

* chore: bump plugin version to 0.6.0b12 in pyproject.toml

* Refine Google Drive change_detected.yaml with detailed schema

Based on real webhook data, added comprehensive output schema including:
- Detailed file object properties (id, name, mimeType, createdTime, modifiedTime, etc.)
- Nested user objects for owners and lastModifyingUser
- Complete subscription object with channel metadata and user details
- Proper descriptions for all fields

This ensures the event output accurately reflects the actual Google Drive API response structure.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: support payload in distaptch_event and _on_event

* add payload to

* refactor: add payload to event handler's on_event function

* 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.

* refactoring: fetch changes inside provider

* fix: remove logs

* fix: remove custom tag

* feat: add parameters

* (google drive) feat: support filname pattern

* readme

* refine: readme

* chore: bump GitHub trigger plugin version to 1.3.9 and add OAuth scope configuration

- Updated version in manifest.yaml to 1.3.9.
- Added optional 'scope' field in github.yaml for OAuth API access with default value and help documentation.

* fix: change parameter type from select to checkbox in star.yaml

* refactor: update parameter descriptions to improve clarity across multiple YAML files

* fix: telegram tag

* bump sdk

* fix: google drive schema

* chore: bump GitHub trigger plugin version to 1.4.0

* feat: add Dropbox webhook trigger plugin with file change event support

* feat: enhance file_changes event to include detailed payload handling

- Updated _on_event method to accept a Request object and additional parameters.
- Modified payload processing to extract and structure changes, accounts, cursors, and received timestamp.
- Removed unnecessary cursor fields from the output schema in YAML.

* feat: Gmail trigger plugin

* feat: update file_changes event to rename cursor fields and enhance YAML schema

- Renamed cursor fields in the payload from 'cursor_before' and 'cursor_after' to 'cursor_start' and 'cursor_end' for clarity.
- Added descriptions for new cursor fields in the YAML output schema to improve documentation.

* chore: update Dropbox trigger plugin version to 0.0.1

* fix: update EventConfiguration to use default_factory for parameters and enhance file_changes YAML schema

- Changed parameters in EventConfiguration to use default_factory for better initialization.
- Added parameters section in file_changes YAML to improve event documentation.

* chore: bump version to 0.6.0b14 in pyproject.toml

* chore: update dify_plugin version to 0.6.0b14 in requirements.txt

* chore: bump GitHub trigger plugin version to 1.4.1 and update dify_plugin version to 0.6.0b14

* fix: increase maximum pages for Dropbox file changes retrieval from 3 to 10

- Updated the _MAX_PAGES constant to allow for more pages of changes to be fetched.
- Removed the time constraint on fetching changes to improve efficiency.

* refactor: clean up star event handling and remove unused parameter options

- Simplified error message formatting for unrecognized star actions.
- Removed the unused _fetch_parameter_options method and its associated imports to streamline the code.

* feat: add parameter options fetching for star event handling

- Introduced a new method _fetch_parameter_options to retrieve parameter options based on credential type and access tokens.
- Enhanced the handling of unauthorized credentials by providing a default option when no valid credentials are available.
- Updated imports to include necessary entities for the new functionality.

* fix

* docs: slack

* refactor: streamline star event handling and improve error message formatting

- Simplified error message formatting for unrecognized star actions using f-strings.
- Removed the unused _fetch_parameter_options method and its associated imports to clean up the code.

* fix(gmail_trigger): correct types, ensure int, correct permission, and bump sdk (#233)

* fix(gmail_trigger): correct types for client_schema

* fix: ensure int

* fix: add storage permission

* fix: bump sdk version

* fix: bump version

* docs(gmail_trigger): update README and YAML for improved setup instructions and remove deprecated parameters

- Enhanced the README with detailed setup steps for Google Cloud project and OAuth configuration.
- Added images for better clarity on GCP setup.
- Removed deprecated parameters like `watch_email` and `topic_name` from the YAML schema.
- Introduced label-based filtering in event handling for better message management.

* 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.

* refactor(gmail_trigger): remove deprecated Gmail message event handling

- Deleted the GmailMessageEvent class and its associated YAML configuration as part of the cleanup process.
- Updated the GmailTrigger class to remove references to the unified message event, focusing on individual message addition and deletion events.
- Adjusted documentation to reflect the removal of the unified event handling.

* fix(gmail_trigger): improve error handling in GmailLabelAddedEvent

- Enhanced error handling by preserving the original exception context when raising EventIgnoreError.
- This change ensures better debugging and traceability of errors during event processing.

* chore: update dify_plugin version across multiple triggers to 0.6.0b14

* refactor(gmail_trigger): update manifest and remove deprecated files

- Renamed the trigger label from "Gmail" to "Gmail Trigger" for clarity.
- Updated the manifest to reflect the new naming convention and removed the old `gmail.yaml` configuration file.
- Deleted the `gmail.py` provider file as part of the cleanup process, streamlining the trigger's implementation.

* refactor(gmail_trigger): standardize naming and enhance attachment handling

- Renamed the trigger from "Gmail Trigger" to "gmail_trigger" in the manifest for consistency.
- Improved the GmailMessageAddedEvent class by adding methods for processing attachments, including handling inline data and file uploads.
- Updated the output schema in the YAML to include new fields for attachment metadata, enhancing the event's data structure.

* feat(gmail_trigger): enhance attachment handling and metadata extraction

- Updated the GmailMessageAddedEvent class to support uploading up to 20 attachments, with improved handling for inline content and external links.
- Introduced new methods for extracting links from HTML and text, allowing for better integration of external attachments.
- Modified the output schema in the YAML to reflect changes in attachment metadata, including renaming fields for clarity.

* feat(gmail_trigger): improve attachment processing and metadata updates

- Enhanced the GmailMessageAddedEvent class to support additional attachment types and improved metadata extraction.
- Updated methods for handling inline content and external links, ensuring better integration with attachments.
- Revised the output schema in the YAML to include new fields for attachment metadata, improving clarity and usability.

* refactor(google_calendar_trigger): update manifest and remove deprecated event files

- Changed the icon in the manifest from `icon.svg` to `icon.png` for consistency.
- Renamed the trigger from "Google Calendar Trigger" to "google_calendar_trigger" in the manifest for standardization.
- Deleted obsolete event handling files for created, updated, and deleted Google Calendar events to streamline the implementation.
- Updated the event references in the provider configuration to reflect the new file structure.

* feat(google_calendar_trigger): add event detail enrichment option and refactor event handling

- Introduced a new parameter `enrich_event_details` to control whether full event details are fetched for created, updated, and deleted events.
- Updated the event handling logic in `google_calendar_event_created.py`, `google_calendar_event_updated.py`, and `google_calendar_event_deleted.py` to conditionally enrich event details based on the new parameter.
- Refactored utility functions to support the new enrichment logic and improved the handling of sync tokens in the Google Calendar trigger implementation.
- Updated the YAML configuration to include the new parameter with appropriate descriptions for better user guidance.

* refactor: clean up imports and remove unnecessary lines in multiple trigger files

- Removed trailing blank lines in `main.py` files for Dropbox and Gmail triggers to improve code cleanliness.
- Cleaned up import statements in `dropbox.py` by rearranging the order of imports for better readability.
- Eliminated trailing blank lines in the utility function file for Google Calendar trigger to maintain consistency across the codebase.
- Removed an unused import in the message handling file for the Telegram trigger to streamline the code.

* refactor: improve error handling and streamline code in trigger files

- Replaced try-except blocks with contextlib.suppress for cleaner error handling in Dropbox, Gmail, and Google Calendar triggers.
- Enhanced exception handling in Gmail event classes to preserve original error context when raising EventIgnoreError.
- Updated hashing method for topic IDs and push subscription names in Gmail trigger to use SHA-256 for better security.
- Improved code readability by simplifying function definitions and ensuring consistent handling of optional parameters.

* chore: bump version to 0.6.0

---------

Co-authored-by: Harry <xh001x@hotmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: kurokobo <kuro664@gmail.com>
2025-11-14 13:34:55 +08:00
Rick b96f493563 feat: add max_invocation_timeout parameter (#208)
* feat: add max_invocation_timeout parameter

* style: format MAX_INVOCATION_TIMEOUT description for better readability

---------

Co-authored-by: Bytechoreographer <bytechoreographer@gmail.com>
2025-09-26 13:14:02 +08:00
Harry 963c901290 fix: linter 2025-07-31 23:04:34 +08:00
Harry 8d552ae069 feat: examples 2025-07-29 18:48:16 +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 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
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 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
Yeuoly 132d6572ee feat[0.4.0]: add dynamic select support (#163)
* feat: add dynamic select support

- Introduced ParameterOption class for parameter options with value, label, and optional icon.
- Updated ToolParameterOption to inherit from ParameterOption.
- Added DYNAMIC_SELECT to CommonParameterType enum.
- Implemented fetch_parameter_options method in Tool class for fetching parameter options.
- Created DynamicSelectProtocol for dynamic select functionality.
- Added tests for Tool construction and parameter options fetching.

* feat: implement dynamic parameter fetching functionality

- Added DynamicParameterFetchParameterOptionsRequest class for dynamic parameter requests.
- Introduced DynamicParameterActions enum for action types related to dynamic parameters.
- Enhanced PluginExecutor with methods to handle dynamic parameter fetching.
- Updated Tool interface to include a method for fetching parameter options.
- Documented the DynamicSelectProtocol for clarity on its usage.

* feat: enhance plugin functionality with dynamic parameter options and trigger interface

- Added dynamic parameter fetching capabilities to the Plugin class.
- Introduced TriggerProvider and Trigger classes for managing trigger functionalities.
- Updated Tool interface to enforce implementation of credential validation and OAuth methods.
- Enhanced error messages for NotImplementedError in ToolProvider and Trigger classes.
- Removed deprecated tools and their configurations from the codebase.

* docs: update README.md to include support for `dynamic-select` parameter type in manifest versioning

* chore: remove code_based_workflow
2025-06-27 15:59:22 +08:00
Harry b1e745603d feat: Plugin OAuth 2025-06-23 14:25:17 +08:00
Dongyu Li edc5d4b666 feat:add datasource router 2025-06-05 10:34:18 +08:00
Yeuoly 8f028d2832 feat: add datasource declaration handling in plugin initialization
- Implemented logic to write a datasource declaration message when a datasource configuration is present during plugin initialization.
- Introduced a new message type, `DATASOURCE_DECLARATION`, in the `InitializeMessage` class to support this functionality.
2025-05-23 19:17:15 +08:00
Will 371bbbfc94 fix REMOTE_INSTALL_URL, need default value (#141) 2025-05-14 13:01:06 +08:00
Bowen Liang 9353164ddb feat: support REMOTE_INSTALL_URL config for remote installing and debugging (#136)
* support REMOTE_INSTALL_URL

* nit

* nit

* passing remote_install_host and remote_install_port to TCPReaderWriter

* fix the host and port parsing approach without yarl

* extract method for parsing the host and port

* nit

* nit

* nit

* nit

* improve _get_remote_install_host_and_port method

* fix style

* fix style
2025-05-13 15:42:54 +08:00
QuantumGhost 5cb24625c3 ci(python): Add CI Pipeline for Python SDK (#72)
* chore(python): temporarily disable `UP007` rule in Ruff

Disable the `UP007` rule temporarily due to numerous existing
violations in the current codebase.

* ci(python): add lint and test for Python SDK

* ci: Add mega-linter

* chore(python): Add final newline to markdown files

* fix(python): Fix linter issues by using ruff's auto fix

* fix(python): Fix TRY400 linter violations

Ruff suggests using `logger.exception` to log when
logging an exception, instead of using `logging.error`.

The former logs the exception and the traceback
automatically.

ref: https://docs.astral.sh/ruff/rules/error-instead-of-exception/

* fix(python): fix ruff linter violations

* test(python): Add Test cases for LLM entities

Test the initialization of `LLMResult` and `LLMResultChunk`.

* test(python): Add test for `AgentModelConfig`

Ensures that the `history_prompt_messages` attribute is
not shared between instances of `AgentModelConfig`.

* chore(python): output diffs in Ruff's format check

* style(python): format code with Ruff

* chore(python): Add a bash script for fix and format python code

* chore: add `persist-credentials: false` to checkout action

Enhances security by preventing subsequent
steps from accessing GitHub credentials, reducing
potential attack surfaces.

Ref: https://github.com/actions/checkout#checkout-v4
2025-04-14 20:25:19 +08:00
QuantumGhost 22ae421dd6 feat(python): Integrate flake8-builtins (A) ruleset with ruff (#66)
Introduce the flake8-builtins (A) ruleset to prevent accidental shadowing
of Python's built-in functions.

Address existing issues primarily by adding `# noqa` to suppress warnings where necessary.
2025-03-24 18:58:50 +08:00
Yeuoly 46c029bf65 refactor: aws_lambda to serverless 2025-02-10 14:58:05 +08:00
Yeuoly f69257db40 fix: add AWS_LAMBDA_HOST 2025-01-21 14:32:12 +08:00
Novice Lee 92558f5c07 feat: add agent strategy support 2025-01-08 07:48:27 +08:00
Yeuoly d450c94888 fix: using absolute importing 2024-12-17 18:24:31 +08:00
Yeuoly a623638d01 refactor: rename agent to agent strategy 2024-12-12 18:26:34 +08:00
Yeuoly 15c14aedf8 feat: agent plugin 2024-12-09 22:01:41 +08:00
-LAN- ef7b886db4 refactor: prevent yoda-conditions
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-02 21:55:35 +08:00
-LAN- b3e0612e53 chore: Apply format
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-02 21:18:36 +08:00
-LAN- 5858fe715e chore: Apply formet and auto fix
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-02 21:10:36 +08:00
Yeuoly e71e7575d7 fix: endless aws transaction 2024-11-08 21:22:18 +08:00
Yeuoly 37b1fcace4 refactor: initialization process 2024-11-05 16:43:39 +08:00
takatost 6f117d207d fix route 2024-11-01 00:45:14 -07:00
Yeuoly 697ddc22d7 feat: support split large file into small chunks 2024-10-23 16:50:24 +08:00
Yeuoly 041df019b0 feat: add app_id/conversation_id/message_id/endpoint_id into sessions 2024-10-16 15:22:08 +08:00
takatost 0d541b7d5b feat: add missing routes 2024-09-27 18:56:01 +08:00
takatost 5c9a48c67d feat: add GetAIModelSchema route 2024-09-26 15:11:04 +08:00
Yeuoly c325ff7193 fix: aws runtime lifetime 2024-09-12 23:18:23 +08:00
Yeuoly 3ac5a201e1 fix: relative import 2024-09-11 15:45:53 +08:00
takatost f611636766 remove unused files 2024-09-04 19:51:15 +08:00
Yeuoly 98ce6231a5 feat: assets 2024-09-04 18:26:54 +08:00
Yeuoly 5b09b6b537 feat: support tool selector 2024-09-04 15:24:13 +08:00
takatost 26d3b944b3 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	python/dify_plugin/core/runtime/abstract/request.py
#	python/dify_plugin/core/runtime/request.py
#	python/dify_plugin/plugin.py
2024-08-30 03:31:24 +08:00
takatost a6d55f604d refactor: move runtime request into separate modules 2024-08-30 03:28:09 +08:00
Yeuoly 83b0cf34dc feat: add logger to tcp stream 2024-08-28 12:49:22 +08:00
Yeuoly 55443ac092 refactor: move entities to core 2024-08-27 17:09:38 +08:00