Commit Graph

430 Commits

Author SHA1 Message Date
deniswen 6b1d99fb62 fix: resolve 100% CPU usage in stdio buffer by replacing O(n²) Byte concatenation with BytesIO (#201)
* fix: improve stream reading and buffering logic

* fix: Re-add accidentally deleted line

---------

Co-authored-by: deniswen <denis.wen@anker-in.com>
2025-09-08 15:23:41 +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 1fa18bfd1c 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.
2025-09-03 14:04:33 +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 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
Novice fbb6346f69 feat: add rag tag (#200) 2025-09-02 21:58:09 +08:00
Harry 63e477e54a 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.
2025-09-01 18:19:38 +08:00
Harry e9975e101d 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.
2025-09-01 14:19:48 +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
Novice a554614833 feat: add developer message (#192) 2025-08-29 17:40:43 +08:00
-LAN- 582381a673 feat: add filename support to multi-modal prompt messages (#197)
* feat: add filename support to multi-modal prompt messages

- Add filename field to MultiModalPromptMessageContent class
- Field defaults to empty string for backward compatibility
- Inherited by all multi-modal content types (Image, Video, Audio, Document)
- Aligns with main Dify repository implementation (PR #24777)

Closes #196

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

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

* docs(README.md): update version binding

Signed-off-by: -LAN- <laipz8200@outlook.com>

---------

Signed-off-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-08-29 17:33:28 +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 a35dcd74f7 feat(trigger): enhance provider configuration and validation 2025-08-29 10:03:11 +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 65422a8af7 refactor(trigger): update type hints and add dispatch_event to trigger provider 2025-08-25 18:54:48 +08:00
Harry f2a079f835 Merge remote-tracking branch 'origin/main' into feat/trigger
# 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/provider_config.py
#	python/dify_plugin/entities/tool.py
#	python/dify_plugin/interfaces/tool/__init__.py
#	python/dify_plugin/plugin.py
#	python/examples/code_based_workflow/.env
#	python/examples/code_based_workflow/provider/code_based_workflow.yaml
#	python/examples/code_based_workflow/tools/llm.py
#	python/examples/code_based_workflow/tools/llm.yaml
#	python/tests/interfaces/tool/test_costruct_tool.py
2025-08-20 22:00:46 +08:00
Harry 7477bb18de refactor: update datasource field type and clean up output schemas in Google Cloud Storage examples 2025-08-11 15:36:27 +08:00
Harry 654336032a refactor: remove unused builtin definitions and schema resolver utilities 2025-08-08 15:34:38 +08:00
Harry 1c3a3d1db3 refactor: remove output schema resolution logic from datasource and tool manifest loading 2025-08-08 14:23:22 +08:00
Harry bacfb3ea6e refactor: remove redundant 'dify_builtin_type' properties from schema definitions 2025-08-08 11:03:46 +08:00
Harry e96e7716b7 refactor: clean up whitespace and formatting in schema-related files 2025-08-07 17:28:04 +08:00
Harry 9f37b75887 feat: implement built-in schema definitions and schema resolution utilities 2025-08-07 17:18:05 +08:00
Harry 22b7df0e6c feat: enhance datasource manifest with new structure chunks and schema resolution 2025-08-06 18:03:49 +08:00
Tianyi Jing 99a0bd3f5a fix: type for ProviderConfig.default (#186) 2025-08-01 17:33:30 +08:00
Harry 685a14077b feat: built-in json schema 2025-08-01 15:08:47 +08:00
Harry 963c901290 fix: linter 2025-07-31 23:04:34 +08:00
Harry e126c70b01 chore: apply ruff 2025-07-31 22:59:45 +08:00
Harry d7e109f760 feat: built-in json schema 2025-07-31 22:58:57 +08:00
Harry 01deb74621 feat: add OAuth credential refresh functionality and update Notion datasource 2025-07-29 22:04:59 +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
Yeuoly 2448e826a8 fix(tool): temporarily alias LogMetadata to CommonLogMetadata to prevent import errors before version 0.5.0 (#182)
* fix(tool): temporarily alias LogMetadata to CommonLogMetadata to prevent import errors before version 0.5.0

* apply ruff
2025-07-24 17:32:14 +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 6e3a6fc4d4 feat(notion): add Notion datasource plugin with OAuth support and initial implementation 2025-07-18 19:43:31 +08:00
Harry 1915391a14 Merge branch 'feat/plugin-oauth' into feat/datasource 2025-07-14 11:01:08 +08:00
Harry d846ab2699 feat(oauth): session context and tool backwards invocation credential support 2025-07-14 10:30:05 +08:00
Harry 3f1899a1dd feat(session): session context and tool backwards invocation credential support 2025-07-13 01:33:41 +08:00
Harry b4a9ef23d1 feat(plugin-oauth): add credential_id and credential_type to tool parameters 2025-07-11 14:26:34 +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 799bea4c41 feat(invoke-message): refactor message handling and introduce InvokeMessage class 2025-07-07 17:33:23 +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 89137a3694 refactor: rename OnlineDocumentPagesMessage to DatasourceGetPagesResponse and update related methods 2025-07-02 23:18:09 +08:00