Commit Graph

93 Commits

Author SHA1 Message Date
Harry c1c40a4c9d Merge remote-tracking branch 'origin/main' into feat/trigger
# Conflicts:
#	python/pyproject.toml
2025-10-27 11:33:59 +08:00
Harry b19a8b5f7b chore: bump version to 0.6.0b14 in pyproject.toml 2025-10-27 11:30:47 +08:00
Maries f049858db4 chore: bump to 0.5.1 (#224) 2025-10-20 14:41:22 +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
Harry 04937bdaf7 chore: bump plugin version to 0.6.0b12 in pyproject.toml 2025-10-17 20:58:56 +08:00
Harry a311b47671 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.
2025-10-13 20:48:51 +08:00
Harry 3cb052b1ac 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.
2025-10-13 18:19:10 +08:00
Harry 66e3c29c2c 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.
2025-10-11 21:58: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 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 2cdfedd73a 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.
2025-10-09 17:45:15 +08:00
Harry 7ef2492cd7 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.
2025-10-09 14:49:06 +08:00
Harry 891e678e3a fix: no argument when provider created for oauth & credential validation 2025-09-29 23:11:38 +08:00
Harry 641b27e76a 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.
2025-09-29 19:00:01 +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 04b6a5f36b chore: bump version to 0.5.0 2025-09-18 13:07:59 +08:00
Harry a04bdfdcf7 chore: bump dify_plugin version to 0.6.0b1 in pyproject.toml and requirements.txt 2025-09-08 23:49:20 +08:00
Harry b60bc8720d chore: bump version to 0.4.5b3 in pyproject.toml 2025-09-08 23:43:05 +08:00
Harry 6ea188988c chore: bump version to 0.4.5b2 in pyproject.toml 2025-09-04 21:32:56 +08:00
Harry cae5c910be Merge remote-tracking branch 'origin/main' into feat/trigger
# Conflicts:
#	python/pyproject.toml
2025-09-03 13:48:32 +08:00
Harry fcff911c94 chore: bump version to 0.4.4b1 in pyproject.toml 2025-09-03 13:46:20 +08:00
Novice 71da9e6ca6 chore: bump version to 0.5.0b15 2025-09-02 22:00:37 +08:00
Yeuoly 19da13ec06 Update pyproject.toml (#199) 2025-08-29 17:50:46 +08:00
Harry aab8a0383e chore: bump version to 0.5.0b14 2025-08-11 15:37:00 +08:00
Harry 84dc259157 chore: bump version to 0.5.0b13 2025-08-08 15:34:57 +08:00
Harry 1d42d79a03 chore: bump version to 0.5.0b12 2025-08-08 14:23:39 +08:00
Harry cc28036c9a chore: bump to 0.5.0b11 2025-08-07 17:21:50 +08:00
Harry 400ad358af chore: bump version to 0.5.0b10 2025-08-06 18:04:58 +08:00
Harry 002fb26057 chore: bump to 0.5.0b9 2025-07-31 23:02:28 +08:00
Harry 8d552ae069 feat: examples 2025-07-29 18:48:16 +08:00
Yeuoly 00ec765694 chore: bump to 0.4.3 2025-07-24 17:35:26 +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
Yeuoly 21e77bd043 Bump to 0.4.1 (#178) 2025-07-09 20:18:47 +08:00
Yeuoly 600b4b1d40 Bump to 0.4.0 (#167) 2025-06-27 16:28:01 +08:00
Bowen Liang 3babba0c65 update gevent~=25.5.1 (#157) 2025-06-27 15:56:42 +08:00
Novice 98d30068f7 chore: bump version to 0.3.5 2025-06-20 14:50:49 +08:00
Novice bdcbd46ab7 chore: bump version to 0.3.4 2025-06-19 16:59:52 +08:00
Novice 9030de3782 chore: bump version to 0.3.3 2025-06-17 10:29:42 +08:00
Novice 66d21b7af5 bump version to 0.3.2 2025-06-03 18:09:14 +08:00
Yeuoly 70de2582e2 bump to 0.3.1 (#151) 2025-05-27 14:36:40 +08:00
Yeuoly 6d77e16b7d chore: update dependencies and remove pydub from main requirements (#135)
- Removed `pydub` from the main dependencies in `pyproject.toml`.
- Added `pydub` back to the `requirements.txt` for the OpenAI example.
2025-05-19 22:19:49 +08:00
Yeuoly a4bad2b274 Bump to 0.3.0 (#146) 2025-05-19 15:00:25 +08:00
Yeuoly 46eb504125 feat[0.3.0]: add plugin runner functionality (#144)
* feat: add integration configuration and plugin runner functionality

- Introduced `IntegrationConfig` class for managing plugin testing configurations, including validation for the `dify_cli_path`.
- Added `PluginInvokeRequest` and `PluginGenericResponse` models to handle plugin invocation requests and responses.
- Implemented `PluginRunner` class to facilitate running plugins locally, including asynchronous message handling and process management.
- Merged access actions into a single `PluginAccessAction` for streamlined access control.

* apply ruff

* feat: enhance plugin runner with new response handling and exception management

- Added `PLUGIN_INVOKE_END` response type to manage the end of plugin invocations.
- Introduced `PluginStopped` exception to handle plugin termination gracefully.
- Updated `PluginRunner` to support stopping the plugin process and handling asynchronous message reading with improved error management.
- Modified message queue to accommodate `None` responses for completed invocations.

* refactor: rename PluginStopped exception to PluginStoppedError

- Renamed `PluginStopped` to `PluginStoppedError` for clarity and consistency.
- Updated references in the `run.py` file to reflect the new exception name.
- Added a docstring to `PluginStoppedError` to describe its purpose.

* fix: update version check for dify CLI in IntegrationConfig

- Modified the version check in the IntegrationConfig class to require a minimum version of 0.1.0 instead of 0.4.0.
- Ensured that the version validation logic is clearer and more robust.

* chore: update dependencies and lock file

- Updated the `content_hash` in `pdm.lock` to reflect changes in dependencies.
- Added `packaging>=25.0` to the dependencies in `pyproject.toml` to ensure compatibility with the latest packaging features.

* feat: enhance IntegrationConfig with improved CLI path validation

- Added a list of potential plugin names to search for the dify CLI executable.
- Updated the validation logic to check for the CLI path against multiple plugin names.
- Changed error handling to use ValidationError for invalid CLI path and version checks.

* feat: add setup script for dify-plugin-cli installation

- Introduced a new script to automate the installation of dify-plugin-cli, including OS and architecture detection.
- Updated the pull request workflow to include the setup of the dify-plugin-cli before installing dependencies.
- Refactored error handling in IntegrationConfig to use ValueError instead of ValidationError for CLI path and version checks.

* feat: add integration test for invoking LLM with mocked OpenAI server

- Introduced a new integration test in `test_invoke_llm.py` to validate the invocation of the LLM plugin using a mocked OpenAI server.
- Implemented a mock server to simulate OpenAI's chat completions API, supporting both streaming and non-streaming responses.
- The test downloads the latest `langgenius-openai` plugin, runs the plugin, and asserts the expected response from the LLM.

* fix: add timeout to requests in LLM integration test

- Updated the `test_invoke_llm.py` file to include a timeout of 10 seconds for both POST and GET requests to the marketplace API.
- This change aims to improve the reliability of the integration test by preventing indefinite blocking on network calls.

* feat: enhance dify-plugin-cli setup script with installation verification and PATH configuration

- Added verification to check if dify-plugin is available in the user's PATH after installation.
- Implemented logic to add dify-plugin to the system PATH for all users when run as root, or to the user's profile for non-root users.
- Created symlinks in common bin directories and provided usage instructions for the dify-plugin commands.

* refactor: update dify-plugin-cli setup script for improved PATH management

- Enhanced the script to add the installation directory to the GITHUB_PATH for GitHub Actions.
- Modified the PATH export for local development to ensure the installation directory is prioritized.
- Removed redundant installation verification and symlink creation logic, streamlining the setup process.

* test: add SSH support to pull request workflow

- Integrated SSH functionality into the pull request workflow using the mxschmitt/action-tmate@v3 action.
- This addition allows for interactive debugging and terminal access during pull request checks.

* chore: remove SSH step from pull request workflow and fix import in integration test

- Eliminated the SSH step from the pull request workflow to streamline the process.
- Fixed the import statement for the `requests` library in `test_invoke_llm.py` to ensure proper functionality during the test execution.

* wtf

* feat: implement OpenAI mock server for integration testing

- Added a new mock server in `python/tests/__mock_server` to simulate OpenAI's chat completions API, supporting both streaming and non-streaming responses.
- Updated the pull request workflow to install the `uv` tool and launch the mock server during testing.
- Refactored `test_invoke_llm.py` to utilize the mock server, ensuring reliable integration tests without external dependencies.

* apply ruff

* refactor: streamline mock server launch in pull request workflow

- Replaced inline mock server launch commands in the pull request workflow with a dedicated script `launch_mock_server.sh` for improved readability and maintainability.
- The new script handles the execution of the mock server, ensuring a cleaner workflow configuration.

* fix: update mock server launch path in pull request workflow

- Changed the path for launching the mock server script from `./scripts/launch_mock_server.sh` to `./python/scripts/launch_mock_server.sh` to ensure correct execution within the workflow.

* fix: run mock server in background during pull request workflow

- Updated the pull request workflow to launch the mock server script in the background by appending `&` to the command. This change allows subsequent steps to execute without waiting for the mock server to terminate.

* chore: clean up dify-plugin-cli setup script by removing outdated installation instructions

- Removed outdated comments regarding the download and installation of dify-plugin-cli, streamlining the script for clarity.

* feat: enhance PluginRunner with graceful shutdown and thread safety

- Introduced a stop flag and a lock to ensure thread-safe access to the stop flag in the PluginRunner class.
- Implemented a _close method to handle graceful termination of the plugin process, including sending a SIGTERM signal and closing pipes.
- Refactored the _read_async method to ensure proper cleanup and handling of messages, maintaining the integrity of the message queue.
2025-05-19 14:56:13 +08:00
Yeuoly e380493e25 Bump to 0.2.4 (#143) 2025-05-14 13:07:18 +08:00
Yeuoly ddb87f8605 Bump sdk to 0.2.3 (#139) 2025-05-13 15:46:31 +08:00
Bowen Liang 08c596d077 httpx~=0.28.1 (#137) 2025-05-12 14:45:55 +08:00
Yeuoly 50a8b90223 Bump to 0.2.2 (#131) 2025-05-06 16:39:38 +08:00
Yeuoly c278653d49 chore: bump version to 0.2.1 (#112) 2025-04-25 14:15:24 +08:00
Yeuoly b884686d5e chore: bump version to 0.2.0 (#110) 2025-04-25 13:58:29 +08:00