Commit Graph

967 Commits

Author SHA1 Message Date
Stream 56480c27be fix: avoid path collusion 2025-10-24 19:53:02 +08:00
Stream 2c87f0ac8b Merge branch 'feat/plugin-readme' into feat/trigger
# Conflicts:
#	internal/db/init.go
2025-10-23 11:26:38 +08:00
Harry afea59cd7a feat(trigger): update TriggerDispatchEventResponse structure 2025-10-20 12:33:34 +08:00
Yeuoly dd7d38c337 fix 2025-10-18 18:26:43 +08:00
Yeuoly fff9a36a06 feat: add payload to TriggerDispatchEventResponse 2025-10-18 18:23:09 +08:00
Harry d4d21be101 feat(trigger): add UserID field to TriggerDispatchEventResponse
- Introduced a new UserID field in the TriggerDispatchEventResponse struct to include user identification in the response.
- The field is marked as optional, enhancing the response's flexibility while maintaining existing functionality.
2025-10-17 18:40:20 +08:00
Harry 531d14d85d refactor(event): simplify EventDescription structure in EventDeclaration
- Removed the EventDescription struct and replaced it with a direct I18nObject field in EventDeclaration.
- This change streamlines the event configuration by reducing complexity while maintaining required validation for the description.
2025-10-13 21:11:25 +08:00
Harry 1f475078e5 feat(trigger): add Subscription field to TriggerInvokeEventRequest
- Introduced a new Subscription field in the TriggerInvokeEventRequest struct to accommodate subscription data.
- Ensured the field is marked as required, enhancing the request's functionality and validation requirements.
2025-10-13 17:46:05 +08:00
Harry 5e4319d8a3 fix(plugin): add recovery mechanism in OnTraffic to handle panics
- Introduced a deferred function in OnTraffic to recover from panics, logging the error and stack trace for better debugging.
- This enhancement improves the stability of the DifyServer by preventing crashes due to unexpected runtime errors.
2025-10-13 16:46:34 +08:00
Harry 3aa1466268 fix(trigger): improve nil checks for SubscriptionConstructor in TriggerProviderDeclaration
- Added nil checks for SubscriptionConstructor before accessing its fields to prevent potential nil pointer dereferences.
- Ensured that Parameters and CredentialsSchema are initialized only if SubscriptionConstructor is not nil, enhancing code robustness.
2025-10-13 16:38:52 +08:00
Harry 2d6a2dc303 refactor(trigger): remove Subscription struct from trigger_declaration.go and update TriggerDispatchEventRequest
- Removed the Subscription struct from trigger_declaration.go to streamline the codebase.
- Added Credentials field to TriggerDispatchEventRequest for enhanced functionality and clarity.
- Ensured that the changes maintain consistency with the existing naming conventions and structures.
2025-10-11 21:15:33 +08:00
Harry 27f3d3ad8d refactor(trigger): rename TriggerInvoke to TriggerInvokeEvent and update related structures
- Renamed TriggerInvoke function and associated request/response types to TriggerInvokeEvent for improved clarity.
- Updated routing and controller methods to reflect the new naming convention.
- Ensured all references to the trigger invoke functionality are consistent with the new event terminology.
2025-10-10 19:48:23 +08:00
Harry f62cc9e8b4 refactor(trigger): rename Trigger to Event in plugin entities and related structures
- Updated the naming conventions in trigger_declaration.go to replace 'Trigger' with 'Event' for better clarity and consistency.
- Adjusted related types, validation functions, and unmarshalling logic to reflect the new 'Event' terminology.
- Ensured that all references to triggers in the codebase are updated to events, including in the SubscriptionConstructor and response structures.
2025-09-30 20:10:02 +08:00
Harry 67909d8b1c fix(trigger): update SubscriptionConstructor validation in TriggerProviderDeclaration
- Changed the validation for SubscriptionConstructor in TriggerProviderDeclaration from 'omitempty,dive' to 'omitempty' to simplify the validation logic.
- Ensured that the SubscriptionConstructor field remains optional while maintaining its intended functionality.
2025-09-29 18:58:33 +08:00
Harry 4c7b399e60 Merge remote-tracking branch 'origin/main' into feat/trigger 2025-09-29 18:52:44 +08:00
Harry 6742313e91 refactor(trigger): enhance YAML unmarshalling for SubscriptionConstructor and SubscriptionSchema
- Introduced a new helper function to convert YAML nodes to ProviderConfig lists, improving the handling of subscription_schema and credentials_schema.
- Updated the UnmarshalYAML method to utilize the new function, simplifying the logic for parsing different YAML formats.
- Ensured proper initialization of SubscriptionConstructor fields to prevent nil pointer dereferences.
2025-09-29 18:51:57 +08:00
Harry 912ac4231b fix(trigger): rename ParametersSchema to Parameters in SubscriptionConstructor
- Updated the SubscriptionConstructor struct to rename the ParametersSchema field to Parameters for consistency.
- Adjusted related JSON and YAML marshaling logic to reflect the new field name, ensuring proper handling of trigger parameters.
2025-09-29 18:34:51 +08:00
Yeuoly 057d8ec0e4 Check manifest when saving plugin packages (#467) 2025-09-29 18:17:06 +08:00
QuantumGhost 50ff9a31ee packaging: add dependencies required by bowenliang123/md_exporter plugin (#466)
simplify local.dockerfile with heredoc
2025-09-29 18:12:04 +08:00
Harry ee18aa313b fix(trigger): update SubscriptionSchema validation in TriggerProviderDeclaration
- Changed SubscriptionSchema validation from 'omitempty' to 'required' in TriggerProviderDeclaration to ensure it is always provided.
- Updated SubscriptionConstructor field to be a pointer to allow for optional inclusion in the trigger provider configuration.
2025-09-29 18:04:25 +08:00
Harry 883eab5cbe feat(trigger): add CHECKBOX parameter type to plugin entities and refactor the trigger provider strcuture
- Introduced a new CHECKBOX parameter type in constant.go for plugin entities.
- Updated tool_declaration.go and trigger_declaration.go to include TOOL_PARAMETER_TYPE_CHECKBOX and TRIGGER_PARAMETER_TYPE_CHECKBOX respectively.
- Enhanced validation logic to accommodate the new CHECKBOX type in parameter checks.
2025-09-29 17:18:29 +08:00
Harry c6081df17a fix(plugin): update validation error messages in ManifestValidate method
- Enhanced error messages in the ManifestValidate function to include 'trigger' in the validation checks for plugin declarations.
- Updated logic to ensure that all relevant fields are considered when validating the presence of mutually exclusive parameters.
2025-09-26 12:05:48 +08:00
Harry 1dcee066a3 Merge remote-tracking branch 'origin/main' into feat/trigger 2025-09-26 12:04:54 +08:00
Yeuoly b85253f773 feat(plugin): implement unauthorized Langgenius plugin blocking (#458)
* feat(plugin): implement unauthorized Langgenius plugin blocking

- Added configuration option to disable installation of plugins falsely claiming Langgenius authorship.
- Introduced new error handling for unauthorized Langgenius claims during plugin installation.
- Implemented tests to validate unauthorized Langgenius detection logic.
- Updated environment configuration and service files to support the new feature.

* fix: typo

* refactor(plugin): update Langgenius plugin signature enforcement

- Renamed configuration option from DISABLE_UNAUTHORIZED_LANGGENIUS_PACKAGE to ENFORCE_LANGGENIUS_PLUGIN_SIGNATURES for clarity.
- Updated error messages and logic in the plugin installation process to reflect the new configuration.
- Enhanced tests to validate the behavior of unauthorized Langgenius plugin detection with the new enforcement setting.
0.3.1
2025-09-24 11:28:41 +08:00
Maries 64738319b8 Fix/json schema (#460)
* fix(agent_declaration): remove unnecessary 'json_schema' validation from OutputSchema

* fix(endpoint): add error handling for missing endpoint configuration in ListPluginEndpoints

* fix(endpoint): update error handling for missing endpoint configuration in ListPluginEndpoints
2025-09-23 23:53:21 +08:00
Oleg Sadov 294a521d54 Added git to local.dockerfile (#453)
Signed-off-by: Oleg Sadov <oleg.sadov@gmail.com>
2025-09-23 16:14:24 +08:00
crazywoola dbbc4a29cc 454 bump cli template (#455)
* feat: update template

* feat: update ja_JP

* feat: update GUIDE.md
2025-09-22 14:41:47 +08:00
Harry 00d76a24c9 feat: add Multiple field to ProviderConfig for enhanced configuration
- Introduced a new Multiple field in the ProviderConfig struct to allow for multiple values in provider configurations.
- This addition improves the flexibility of provider options within the plugin system.

These changes enhance the capability of provider configurations, enabling more complex setups.
2025-09-17 22:08:13 +08:00
Tianyi Jing 1dacb201ff feat(cmd): add datasource template (#449)
* feat: add template for datasource plugins

Signed-off-by: jingfelix <jingfelix@outlook.com>

* fix: description and missing category

Signed-off-by: jingfelix <jingfelix@outlook.com>

---------

Signed-off-by: jingfelix <jingfelix@outlook.com>
0.3.0
2025-09-17 09:40:09 +08:00
Yeuoly 878edde455 feat(datasource): Implement datasource validation and invocation steps (#295)
* feat(datasource): Implement datasource validation and invocation steps

- Added new functionality for validating datasource credentials and invoking the first and second steps of the datasource process.
- Introduced new API endpoints for datasource operations in the HTTP server.
- Created corresponding service and controller methods to handle datasource requests.
- Defined new request and response structures for datasource operations in the entities package.

* feat: add routes

* feat(datasource): Add initial datasource models and validation

- Introduced new `DatasourceInstallation` model to represent datasource installations with relevant fields.
- Created `datasource.go` file for future datasource service implementation.
- Enhanced `datasource_declaration.go` with new types and validation functions for datasource provider and parameters.
- Updated `plugin_declaration.go` to include datasource support in plugin structures.
- Refactored `agent_declaration.go` and `tool_declaration.go` to use a unified `ParameterOption` type for options.

* refactor(datasource): Update request and response types for online document content retrieval

- Renamed and updated request and response types for the `DatasourceGetOnlineDocumentPageContent` function to improve clarity and consistency.
- Introduced `RequestInvokeOnlineDocumentDatasourceGetContent` and `DatasourceInvokeOnlineDocumentGetContentResponse` types.
- Adjusted related function signatures and dispatchers to reflect the new types across the datasource service and controller implementations.

* feat(datasource): Implement datasource installation handling

- Added functionality to create and update `DatasourceInstallation` records during plugin installation and upgrade processes.
- Enhanced the `InstallPlugin` function to create a new datasource installation if a datasource declaration is present.
- Updated the `UpgradePlugin` function to handle the deletion of the original datasource installation and creation of a new one if the datasource declaration changes.

* feat(datasource): Add datasource registration handling in plugin runtime

- Introduced handling for datasource declarations in the plugin runtime.
- Updated `RemotePluginRuntime` to track datasource registration status.
- Enhanced message processing to include validation and assignment of datasource declarations.

* feat(datasource): Implement datasource listing and retrieval endpoints

- Added `ListDatasources` and `GetDatasource` functions to the service layer for handling datasource queries.
- Created corresponding controller methods to process HTTP requests for listing and retrieving datasources.
- Implemented request validation for tenant ID, page, page size, plugin ID, and provider parameters.

* add datasource routes

* feat(datasource): Add icon remapping for datasource declarations

- Implemented functionality to remap icons for both the main datasource and its individual datasources within the plugin declaration.
- Enhanced error handling to provide clearer feedback when remapping fails.

* fix(datasource): update OAuthSchema validation to remove unnecessary 'dive' tag

- Modified the validation tag for OAuthSchema in DatasourceProviderDeclaration to simplify the validation process by removing the 'dive' requirement.

* feat(tests): add datasource declaration parsing and output

- Introduced a new main.go file for testing datasource declaration parsing.
- Implemented JSON unmarshalling for RemotePluginRegisterPayload and DatasourceProviderDeclaration.
- Added a sample datasource declaration for testing purposes.

* fix(plugin): improve error handling in UninstallPlugin and add datasource deletion

- Enhanced error handling to return a specific message when a plugin is not installed.
- Added functionality to delete the associated datasource installation during the uninstallation process.

* feat(datasource): add support for decoding datasource provider declaration

- Added custom JSON marshalling and unmarshalling methods to handle CredentialsSchema and Datasources more effectively.
- Improved error handling during YAML unmarshalling to support both object and array formats for CredentialsSchema.
- Ensured proper initialization of DatasourceFiles and Tags to prevent nil references.

* fix: provider type

* refactor(datasource): simplify JSON unmarshalling for CredentialsSchema

- Removed complex handling of CredentialsSchema in the UnmarshalJSON method, focusing on the Datasources field.
- Streamlined the code to improve readability and maintainability by eliminating unnecessary checks and logic related to CredentialsSchema.

* feat: streaming datasource

* feat: datasource

* feat: datasource

* feat:datasource

* feat:datasource

* feat:datasource

* feat: add redirect_uri field to OAuth request structs

* feat: add online driver file request and response structures

* feat: add online driver file request and response structures

* feat: add online_driver datasource type to validation

* feat: rename online driver to online drive and update related classes and methods :)

* refactor: rename OnlineDocumentPageChunk to DatasourceGetPagesResponse and update related references

* feat: update request types for online drive browsing and downloading

* feat: add metadata field to OAuthGetCredentialsResult

* feat: built-in json schema definations

* feat(plugin_entities): add built-in schema definitions and processing for datasource YAML

* test(plugin_entities): add unit tests for schema definitions and YAML processing

* refactor(plugin_entities): centralize built-in schema definitions and processing

* refactor(plugin_entities): remove unused properties from built-in schema definitions

* refactor(plugin_entities): built-in schema & new datasource structure

* refactor(plugin_entities): enhance schema processing with  checks and error handling

* refactor(plugin_entities): update validation for OnlineDriveBrowseFilesRequest prefix field to be optional

* refactor(json_schema): remove json schema definitions and validation

* fix(plugin_entities): remove output_schema validation tests

* feat: add rag tag

---------

Co-authored-by: Harry <xh001x@hotmail.com>
Co-authored-by: Dongyu Li <544104925@qq.com>
Co-authored-by: Novice <novice12185727@gmail.com>
2025-09-16 17:32:14 +08:00
Harry 0b9e03dd15 feat: add Multiple field to TriggerParameter for enhanced configuration
- Introduced a new Multiple field in the TriggerParameter struct to allow for multiple values in trigger configurations.
- This addition improves the flexibility of trigger parameters within the plugin system.

These changes enhance the capability of trigger parameters, enabling more complex configurations.
2025-09-15 19:04:23 +08:00
Yunlu Wen 9e3081bd17 feat: support orphan plugin (#440)
* support orphan plugin in serverless mode

* add validation to UpgradePlugin

* log reinstalls
2025-09-12 20:34:38 +08:00
Yunlu Wen e6bb4967a8 fix lock release (#447) 2025-09-12 19:30:01 +08:00
kenwoodjw bb83075acd feat: add max-size flag (#445)
Signed-off-by: kenwoodjw <blackxin55+@gmail.com>
2025-09-12 19:26:29 +08:00
Harry 1ca6c35697 feat: add remapping for trigger icons in MediaBucket
- Enhanced the RemapAssets function to include remapping of trigger identity icons and dark icons.
- Added error handling for remapping failures to ensure robust asset management.

These changes improve the handling of trigger assets within the plugin system, ensuring icons are correctly remapped as needed.
2025-09-05 12:03:12 +08:00
Harry 24a63d88a8 Add trigger functionality and enhance database integration
- Introduced TriggerInstallation model for managing trigger installations in the database.
- Updated autoMigrate function to include trigger installations in the migration process.
- Added new HTTP routes for listing and retrieving triggers in the HTTP server.
- Implemented ListTriggers and GetTrigger controller functions for handling trigger requests.
- Enhanced plugin management functions to create, update, and delete trigger installations during plugin lifecycle events.

These changes integrate trigger capabilities into the system, improving the overall plugin functionality and management.
2025-09-04 13:31:20 +08:00
Byron.wang b4da677c5e bump dify-cloud-kit version to v0.1.0 (#442) 2025-09-03 18:08:28 +08:00
Harry 5b396a4c7e Refactor trigger-related types and enhance dynamic select functionality
- Updated TriggerProviderIdentity and TriggerProviderConfiguration to improve structure and validation.
- Renamed TriggerConfiguration to TriggerDeclaration for clarity.
- Added CredentialType to RequestDynamicParameterSelect for better request handling.
- Enhanced PluginDecoderHelper to read and unmarshal trigger files correctly.

These changes streamline the trigger system and improve the overall request handling in the plugin architecture.
2025-09-03 11:28:21 +08:00
Yunlu Wen a4c32d32ea feat: propagate plugin unique identifier to serverless control plane (#428)
* feat: propagate plugin unique identifier to serverless

* resolve conflict
2025-09-03 11:01:48 +08:00
Harry 390b7641ea Implement trigger functionality and clean up dynamic select code
- Added new trigger-related access types and actions in access.go.
- Introduced new HTTP routes for trigger operations in http_server.gen.go.
- Updated plugin declaration to include triggers in plugin_entities.
- Removed unused dynamic select service and controller files.
- Enhanced message handling in debugging_runtime to support trigger registration.

This update enhances the plugin system by integrating trigger capabilities while cleaning up legacy code.
2025-09-02 16:28:19 +08:00
Yeuoly 5c57624f5d docs: add comprehensive development documentation (#433) 2025-09-01 13:30:42 +08:00
toli-ch 880dc70345 Fix OS and architecture detection for Windows (#432) 2025-09-01 13:21:29 +08:00
Yeuoly 604da5d495 refactor: rename AWS references to Serverless in plugin daemon (#437)
- Updated AWS-related types and functions to reflect Serverless terminology, including renaming `AWSTransactionHandler` to `ServerlessTransactionHandler` and `AWSTransactionWriter` to `ServerlessTransactionWriter`.
- Adjusted error messages and comments to align with the new naming conventions.
- Modified installation functions to use Serverless terminology for clarity and consistency across the codebase.
2025-08-28 18:24:22 +08:00
Stream 5134f3b5d0 feat: add plugin asset extraction endpoint with caching support 2025-08-27 18:54:56 +08:00
Stream 5b5f709e7d feat: implement readme endpoint 2025-08-27 15:57:22 +08:00
Stream 0647713f4c feat: implement readme extracting and storage 2025-08-27 15:57:09 +08:00
Stream 1aed761b11 feat: add PluginReadme database model 2025-08-27 15:02:18 +08:00
Blackoutta b86f12fbaa Add Redis caching to FetchPluginInstallation middleware for performance optimization (#400)
* add caching to fetch plugin installation middleware

* invalidate plugin inst cache after successfully upgrading or uninstalling operations

* optimize: refactored cache invalidation ops from curd layer to service layer

---------

Co-authored-by: yangyi.hu593671 <yangyi.hu593671@seres.cn>
2025-08-27 14:16:52 +08:00
kuangzhiqiang 6c03c1b3c8 fix Frequent plugin pulls (#420)
Co-authored-by: kuangzhiqiang <kuangzhiqiang@xiaomi.com>
2025-08-27 14:16:31 +08:00
Yeuoly ab7540eed9 Add Claude Code GitHub Workflow (#434)
* "Claude PR Assistant workflow"

* "Claude Code Review workflow"
2025-08-27 14:03:59 +08:00