Skip to content

Commit 427398d

Browse files
yuanoOobravomarkerigoYeuoly41tair
authored
bump to 0.2.0 (#7)
* fix: Fix the issue where the List method of Alibaba Cloud OSS did not correctly return plugin file paths. (langgenius#287) * feat(redis): Add support for Redis Sentinel mode (langgenius#276) * feat(redis): Add support for Redis Sentinel mode Added support for Redis Sentinel mode to the Redis client, enabling automatic discovery and connection to the primary node through Sentinel. Updated relevant configuration files and initialization logic to support Sentinel mode configuration and connection. * add lost RedisUser. * chore: coding style (langgenius#291) - Renamed parameters for consistency and clarity, changing `tenant_id`, `plugin_unique_identifier`, and `install_type` to `tenantId`, `pluginUniqueIdentifier`, and `installType` respectively across multiple functions. - Updated corresponding database queries to reflect the new parameter names, enhancing code readability and maintainability. * feat: Enhance plugin signing with authorized category verification (langgenius#293) * feat: Enhance plugin signing with authorized category verification - Added support for an `authorized_category` flag in the signature command to validate the category before signing. - Updated the `Sign` function to accept a verification parameter, allowing for category-based signing. - Enhanced error handling for invalid categories during the signing process. - Updated tests to cover new verification scenarios and ensure proper functionality with the authorized category. * fix * fix * test * test: Add unit test for plugin verification without verification field - Introduced a new test case to verify the behavior of plugins that lack a verification field. - Updated the signature_test.go file to include the test, ensuring proper functionality of the signing process. - Removed the outdated verifier_test.go file and associated test data to streamline the codebase. * Update issue templates * fix(lock): Add concurrency test for Redis lock functionality (langgenius#305) - Introduced a new test case `TestLock` to validate the behavior of the Redis locking mechanism under concurrent access. - Enhanced the `Lock` function to improve error handling and ensure proper locking behavior. - Utilized `sync.WaitGroup` and atomic operations to measure wait times during lock acquisition, ensuring the lock behaves as expected under high concurrency. * feat: Add code generation for plugin controllers and services (langgenius#301) * feat: Add code generation for plugin controllers and services - Introduced a code generation mechanism for plugin controllers and services, allowing for automatic generation based on defined dispatchers. - Created new files for generated controllers, services, and templates to streamline the plugin invocation process. - Removed outdated functions related to tool validation and runtime parameters, consolidating functionality into generated files. - Updated dependencies in go.mod and go.sum to include necessary packages for the new code generation features. * fix * feat: Generate HTTP server routes from template (langgenius#306) * feat: Generate HTTP server routes from template - Added a new file `http_server.gen.go` to automatically generate HTTP server routes based on defined dispatchers. - Refactored existing route definitions in `http_server.go` to utilize the generated routes, improving maintainability. - Introduced a code generation function in `generator.go` to create the HTTP server file, enhancing the plugin development workflow. - Updated the template for HTTP server generation to streamline route creation for various controllers. * fix: Update OAuth paths in PluginDispatchers for consistency - Changed the path for authorization URL from `/oauth/authorization_url` to `/oauth/get_authorization_url`. - Updated the path for credentials from `/oauth/credentials` to `/oauth/get_credentials` to align with naming conventions. * fix: errChan failed to write response because of panic nil (langgenius#296) (langgenius#297) * fix: errChan failed to write response because of panic nil (langgenius#296) * fix: join err and er into a single error using errors.Join, thanks @Yeuoly (langgenius#296) --------- Co-authored-by: NeatGuyCoding <cto@sb> * fix: signature dose not work as expected, if upload new pkg to old dify (langgenius#311) - Updated the method in the interface to remove the parameter, simplifying its usage. - Introduced a new function to provide a default verification structure. - Added a file to store verification data, improving the plugin signing process. - Enhanced tests in to validate the verification process, ensuring proper handling of success and failure scenarios. - Refactored related code to accommodate the new verification structure and improve overall maintainability. * feat: change listPlugin struct & add total (langgenius#302) * add packaged file info when plugin package larger than max size (langgenius#312) * refactor: streamline plugin initialization and update YAML templates for consistency (langgenius#313) - Removed redundant flag retrieval in the plugin initialization process, simplifying the code. - Updated permission handling to use a single `permissionRequirement` structure for better clarity and maintainability. - Enhanced YAML templates by adding quotes around dynamic values to ensure proper formatting and prevent potential parsing issues. * update issute template: add self checks * feat: add mcp tool type (langgenius#315) * Feat: Replace the internal/oss module with dify-cloud-kit (langgenius#317) * replace internal oss with dify-cloud-kit * remove validate * fix tests * fix tests * fix: support serverless plugin management with execution timeout (langgenius#318) - Added `pluginMaxExecutionTimeout` to `PluginManager` for configurable execution limits. - Updated `ServerlessPluginRuntime` to utilize the new timeout setting in HTTP requests. - Refactored AWSPluginRuntime references to ServerlessPluginRuntime for consistency across the codebase. * fix: remove redundant Content-Type header for payloadReader in HTTP request builder (langgenius#320) * Fix env read bug for GCS_CREDENTIALS. (langgenius#324) * fix build error, go.mod upgrade for github.com/panjf2000/ants/v2 (langgenius#323) Signed-off-by: zhanluxianshen <[email protected]> * Chore/unify configurations (langgenius#319) * refactor: update PluginManager to use configuration for various configurations - Replaced hardcoded values in PluginManager methods with values from the configuration. - Updated serverless plugin launch timeout and working paths to utilize the new configuration structure. - Enhanced local plugin runtime initialization to pull settings from the configuration, improving maintainability and flexibility. * refactor: clean up PluginManager by removing unused fields and updating platform check - Removed commented-out fields from PluginManager to enhance code clarity. - Updated platform check to utilize the configuration structure instead of a direct field reference, improving maintainability. * feat: agent plugin add meta version * bump dify-cloud-kit version to 681efb7762a4 (langgenius#339) * add serverless runtime interface docs (langgenius#338) * add sri docs * add refer to readme * format readme * add USE_AWS_S3 args avoid ambiguity. (langgenius#340) * feat: add length-prefixed HTTP chunking functionality (langgenius#341) - Introduced new constants for HTTP option types to improve code readability and maintainability. - Updated existing HTTP option functions to utilize the new constants. - Implemented line-based and length-prefixed chunking methods for improved data processing in HTTP requests. - Added comprehensive tests for chunking functionality to ensure reliability and correctness. * refactor: using length-prefixed chunking for Backwards invocations (langgenius#342) - Adjusted the header byte manipulation in chunking functions to correctly use the first four bytes for data length. - Modified the HTTP request streaming function to include the length-prefixed option for improved data handling. * fix s3 client path style not used (langgenius#344) * bump cloud-kit version to fix langgenius#343 * change env name USE_AWS_S3 to S3_USE_AWS * update s3_use_aws default value to true * update readme about the upgrade notice * refactor(local_runtime): optimize listener lookup in stdioHolder (langgenius#345) Directly fetch and invoke the listener for a given session_id instead of iterating over the entire listener map. Signed-off-by: guanz42 <[email protected]> * fix: skip waiting if error occured (langgenius#337) * fix: skip waiting if error occured * Update internal/core/plugin_manager/watcher.go Co-authored-by: Rhys <[email protected]> * fix: handle nil error channels in plugin manager --------- Co-authored-by: Yeuoly <[email protected]> Co-authored-by: Yeuoly <[email protected]> * feat(db): enhance database configuration with charset and extras support (langgenius#347) - Updated .env.example to include DB_EXTRAS and DB_CHARSET variables. - Refactored InitPluginDB functions for PostgreSQL and MySQL to accept a configuration struct, allowing for more flexible database connection settings. - Adjusted connection pool settings to utilize new configuration options for charset and extras. This change improves the configurability of database connections and prepares the codebase for future enhancements. * feat: add decode plugin from identifier endpoint (langgenius#349) * feat: add decode plugin from identifier endpoint - Introduced a new endpoint to decode a plugin from a unique identifier. - Implemented the DecodePluginFromIdentifier function to handle decoding and verification of plugin signatures. - Updated the HTTP server routes to include the new decode endpoint. * refactor: update decode plugin endpoint path - Moved the decode plugin from identifier endpoint to a new path for better organization. - Updated the HTTP server routes accordingly to reflect the new endpoint structure. * Split REMOTE_INSTALL_ADDRESS into HOST and PORT in .env.example to align with the official docs (langgenius#356) Co-authored-by: lizb <[email protected]> * fix: launch error when using redis sentinel (langgenius#352) * refactor(plugin_manager): remove first logging of local plugin launch (langgenius#357) * refactor: extract DSN construction to buildDSN for better reuse and readability (langgenius#360) * fix:response data will be discard if tool/llm response buffer overflow (langgenius#362) Co-authored-by: kino.lu <[email protected]> * test(stream): add delay in TestStreamCloseBlockingWrite to ensure blocking write completion (langgenius#365) * feat: add pull request template for improved contribution guidelines (langgenius#366) - Introduced a new pull request template to standardize contributions. - The template includes sections for description, type of change, essential checklist, and additional information to assist reviewers. * fix: prevent duplicate packaging (langgenius#367) fixes: langgenius/dify-plugins#612 fixes: langgenius/dify-plugins#234 Signed-off-by: jingfelix <[email protected]> * feat(dynamic_select): implement dynamic parameter fetching functionality (langgenius#358) * feat(dynamic_select): implement dynamic parameter fetching functionality - Added FetchDynamicParameterOptions function to handle dynamic parameter selection. - Introduced new access type and action for dynamic select in access_types. - Updated HTTP server routes to include the new endpoint for fetching dynamic parameters. - Created necessary service and controller files for dynamic select operations. * refactor(access_types): rename dynamic select access type to dynamic parameter - Updated access type constants to reflect the change from PLUGIN_ACCESS_TYPE_DYNAMIC_SELECT to PLUGIN_ACCESS_TYPE_DYNAMIC_PARAMETER. - Adjusted related references in the PluginDispatchers and FetchDynamicParameterOptions function to maintain consistency. * Update README.md (langgenius#372) * feat: add InvokeLLMWithStructuredOutput functionality (langgenius#369) * feat: add InvokeLLMWithStructuredOutput functionality - Introduced a new method InvokeLLMWithStructuredOutput to the BackwardsInvocation interface for handling structured output requests. - Added corresponding request and response types to support structured output. - Implemented the method in both RealBackwardsInvocation and MockedDifyInvocation for testing purposes. - Updated permission handling and task execution for the new structured output invocation type. This enhancement allows for more flexible and detailed responses from the LLM, improving the overall functionality of the invocation system. * refactor: enhance LLMResultChunkWithStructuredOutput structure - Updated the LLMResultChunkWithStructuredOutput type to include additional fields: Model, SystemFingerprint, and Delta. - Added comments to clarify the reasoning behind the structure and the use of type embedding for JSON marshaling. This change improves the clarity and functionality of the LLMResultChunkWithStructuredOutput type, ensuring proper JSON serialization. * refactor: streamline LLMResultChunk construction in InvokeLLMWithStructuredOutput - Simplified the construction of LLMResultChunk and LLMResultChunkWithStructuredOutput by removing unnecessary type embedding. - Enhanced readability and maintainability of the code while preserving functionality. This change contributes to cleaner code and improved clarity in the handling of structured output responses. * skip error plugin names (langgenius#381) * feat: add active request tracking to health check and dispatch routes (langgenius#384) - Implemented middleware to track active requests and active dispatch requests using atomic counters. - Updated health check response to include counts of active requests and active dispatch requests. - Integrated the new middleware into the HTTP server and plugin dispatch group for improved monitoring. * optimize: skip sleep for remote plugin runtime during restart, making the debugging experience smoother (langgenius#387) * enhance(cli/icon): add multiple categories default plugin icons (langgenius#388) * feat: add support for dark icon - Introduced IconDark field in PluginDeclaration and related structures to support dark mode icons. - Updated the installation process to handle dark icons. - Enhanced asset validation to check for the presence of dark icons. This change improves the visual consistency of plugins in dark mode environments. * enhance(cli/icon): add plugin icon support with multiple categories - Added support for light and dark icons for various plugin categories including agent, datasource, extension, model, tool, and trigger. - Replaced the previous single icon implementation with a structured map for better organization and retrieval of icons based on category and theme. - Removed the old Python icon file to streamline asset management. This update improves the visual representation of plugins across different themes, enhancing user experience. * change icons * fix * fix * comments * feat(plugin_manager): optimize local plugin startup with concurrency (langgenius#375) * feat(plugin_manager): optimize local plugin startup with concurrent control - Add semaphore-based concurrency control for plugin launches - Implement parallel plugin startup using goroutines - Optimize error handling to prevent goroutine blocking - Add concurrency metrics logging Note: handleNewLocalPlugins now accepts config parameter with default concurrency limit * feat(plugin_manager): make local plugin launching concurrency configurable * fix(plugin_manager): optimize comment and error handling - Updated comments to clarify the concurrent plugin launching configuration. - Added a nil check for the error channel during plugin startup to improve code robustness. * refactor(plugin_manager): refactor plugin startup logic - Remove the semaphore mechanism and switch to using routine.Submit for concurrency management * fix(plugin_manager): Optimize plugin startup logs and concurrency control - Added log output for maximum concurrency when starting local plugins - Implemented a channel-based concurrency control mechanism to ensure limits are not exceeded - Fixed closure variable capture issue to prevent incorrect plugin information - Improved error handling to avoid deadlocks during startup * fix(plugin_manager): simplify error channel handling and semaphore release logic --------- Co-authored-by: jim02.he <[email protected]> * feat(plugin_manager): enhance asset remapping for icons (langgenius#392) - Refactored the RemapAssets function to streamline the remapping of icon fields for both models and tools, including support for dark mode icons. - Introduced new fields IconSmallDark and IconLargeDark in the ModelProviderDeclaration and added IconDark in ToolProviderIdentity to accommodate dark mode assets. - Improved error handling during the remapping process for better clarity and maintainability. * refactor(plugin_manager): enhance HTTP client timeout handling in ser… (langgenius#385) * refactor(plugin_manager): enhance HTTP client timeout handling in serverless runtime with DialContext - Updated the HTTP client in the ServerlessPluginRuntime to use a context-aware DialContext for better timeout management. - Removed the write timeout option from the HTTP request builder, streamlining the request handling process. - Improved connection handling by setting write deadlines based on the PluginMaxExecutionTimeout. This change enhances the reliability of network operations within the serverless runtime environment. * refactor(plugin_manager): remove write deadline setting in serverless runtime connection initialization - Eliminated the write deadline setting from the connection initialization in the ServerlessPluginRuntime. - This change simplifies the connection handling process and aligns with the recent enhancements to timeout management. This update contributes to a more streamlined and efficient network operation within the serverless environment. * refactor(plugin_manager): adjust HTTP client timeout settings in serverless runtime - Modified the HTTP client configuration in the ServerlessPluginRuntime to set the TLS handshake timeout based on PluginMaxExecutionTimeout. - Retained the IdleConnTimeout setting to ensure consistent connection management. This update improves the timeout handling for secure connections, enhancing overall network reliability in the serverless environment. * 0.2.0 (langgenius#402) * feat(oauth): add RedirectURI field to OAuth request structures * feat(oauth): update OAuthSchema validation * feat: add Context field to request and session structures * feat: add CredentialType field to Credentials and InvokeToolRequest structures * fix: handle unhandled default case in basic_type.go * feat: add support for build branches in build-push.yml * feat/tool oauth cli template (langgenius#407) * feat(cli): update OAuth handling and requirements for dify_plugin * feat(oauth): update OAuth support and adjust dify_plugin version constraints * feat(plugin_decoder): add support for internationalized readme files (langgenius#393) * feat(plugin_decoder): add support for internationalized readme files - Introduced the AvailableI18nReadme method in the PluginDecoder interface to retrieve available readme files in multiple languages. - Implemented the method in FSPluginDecoder and ZipPluginDecoder to read localized readme files from the filesystem and zip archives. - Enhanced UnixPluginDecoder to handle readme files in a structured manner, including support for reading from a dedicated "readme" directory. - Added unit tests to verify the functionality of the AvailableI18nReadme method and ensure correct retrieval of localized readme content. * feat(plugin): add support for multilingual README generation - Introduced functionality to create README files in multiple languages (Simplified Chinese, Japanese, Portuguese) based on user selection. - Enhanced the profile management to include options for enabling internationalized README and selecting languages. - Added new language choice structure to manage language options and their selection state. - Implemented rendering and writing of language-specific README files during plugin creation. - Included new README template files for each supported language. * feat(plugin): add README command and list functionality - Introduced a new `readme` command to the plugin CLI for managing README files. - Added `list` subcommand to display available README languages for a specified plugin path. - Implemented functionality to read and list supported README languages in a tabular format. - Enhanced error handling for plugin file reading and decoding processes. * feat(oauth): implement refresh credentials functionality (langgenius#408) * feat(oauth): implement refresh credentials functionality - Added RefreshCredentials endpoint to handle OAuth credential refresh requests. - Introduced RequestOAuthRefreshCredentials structure for request validation. - Updated access types and actions to include refresh credentials. - Enhanced server routing and controller logic to support the new functionality. - Updated OAuth entities to include expiration handling for refreshed credentials. * feat(oauth): add metadata field to OAuthGetCredentialsResult --------- Co-authored-by: Harry <[email protected]> * chore(deps): bump github.com/go-jose/go-jose/v4 from 4.0.4 to 4.0.5 (langgenius#409) Bumps [github.com/go-jose/go-jose/v4](https://github.com/go-jose/go-jose) from 4.0.4 to 4.0.5. - [Release notes](https://github.com/go-jose/go-jose/releases) - [Commits](go-jose/go-jose@v4.0.4...v4.0.5) --- updated-dependencies: - dependency-name: github.com/go-jose/go-jose/v4 dependency-version: 4.0.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: MySQL compatible Dify plugin daemon based on https://github.com/langgenius/dify-plugin-daemon/releases/tag/0.2.0 --------- Signed-off-by: zhanluxianshen <[email protected]> Signed-off-by: guanz42 <[email protected]> Signed-off-by: jingfelix <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: bravomark <[email protected]> Co-authored-by: Zhi <[email protected]> Co-authored-by: Yeuoly <[email protected]> Co-authored-by: Byron.wang <[email protected]> Co-authored-by: NeatGuyCoding <[email protected]> Co-authored-by: NeatGuyCoding <cto@sb> Co-authored-by: Good Wood <[email protected]> Co-authored-by: Byron.wang <[email protected]> Co-authored-by: Novice <[email protected]> Co-authored-by: 湛露先生 <[email protected]> Co-authored-by: Nevermore <[email protected]> Co-authored-by: Rhys <[email protected]> Co-authored-by: Yeuoly <[email protected]> Co-authored-by: Ganondorf <[email protected]> Co-authored-by: lizb <[email protected]> Co-authored-by: Tsonglew <[email protected]> Co-authored-by: kinoooolu <[email protected]> Co-authored-by: kino.lu <[email protected]> Co-authored-by: Tianyi Jing <[email protected]> Co-authored-by: @defstream <[email protected]> Co-authored-by: AkisAya <[email protected]> Co-authored-by: Blackoutta <[email protected]> Co-authored-by: homejim <[email protected]> Co-authored-by: jim02.he <[email protected]> Co-authored-by: Maries <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 733ca3c commit 427398d

File tree

160 files changed

+5852
-2652
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+5852
-2652
lines changed

.env.example

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ PLUGIN_REMOTE_INSTALLING_HOST=127.0.0.1
1111
PLUGIN_REMOTE_INSTALLING_PORT=5003
1212

1313
# s3 credentials
14-
S3_USE_AWS_MANAGED_IAM=true
14+
S3_USE_AWS=true
15+
S3_USE_AWS_MANAGED_IAM=false
1516
S3_ENDPOINT=
1617
S3_USE_PATH_STYLE=true
1718
AWS_ACCESS_KEY=
@@ -35,7 +36,23 @@ ALIYUN_OSS_PATH=
3536
AZURE_BLOB_STORAGE_CONTAINER_NAME=
3637
AZURE_BLOB_STORAGE_CONNECTION_STRING=
3738

39+
# volcengine tos
40+
VOLCENGINE_TOS_ENDPOINT=
41+
VOLCENGINE_TOS_ACCESS_KEY=
42+
VOLCENGINE_TOS_SECRET_KEY=
43+
VOLCENGINE_TOS_REGION=
44+
45+
# gcs storage credentials base64 string
46+
GCS_CREDENTIALS=
47+
48+
# huawei obs credentials
49+
HUAWEI_OBS_ACCESS_KEY=
50+
HUAWEI_OBS_SECRET_KEY=
51+
HUAWEI_OBS_SERVER=
52+
53+
3854
# services storage
55+
# https://github.com/langgenius/dify-cloud-kit/blob/main/oss/factory/factory.go
3956
PLUGIN_STORAGE_TYPE=local
4057
PLUGIN_STORAGE_OSS_BUCKET=
4158
PLUGIN_STORAGE_LOCAL_ROOT=./storage
@@ -62,6 +79,18 @@ REDIS_PORT=6379
6279
REDIS_PASSWORD=difyai123456
6380
REDIS_DB=0
6481

82+
# Whether to use Redis Sentinel mode.
83+
# If set to true, the application will automatically discover and connect to the master node through Sentinel.
84+
REDIS_USE_SENTINEL=false
85+
86+
# List of Redis Sentinel nodes. If Sentinel mode is enabled, provide at least one Sentinel IP and port.
87+
# Format: `<sentinel1_ip>:<sentinel1_port>,<sentinel2_ip>:<sentinel2_port>,<sentinel3_ip>:<sentinel3_port>`
88+
REDIS_SENTINELS=
89+
REDIS_SENTINEL_SERVICE_NAME=
90+
REDIS_SENTINEL_USERNAME=
91+
REDIS_SENTINEL_PASSWORD=
92+
REDIS_SENTINEL_SOCKET_TIMEOUT=0.1
93+
6594
DB_USERNAME=postgres
6695
DB_PASSWORD=difyai123456
6796
DB_HOST=localhost
@@ -75,6 +104,9 @@ DB_SSL_MODE=disable
75104
DB_MAX_IDLE_CONNS=10
76105
DB_MAX_OPEN_CONNS=30
77106
DB_CONN_MAX_LIFETIME=3600
107+
# DB_EXTRAS in GORM format
108+
DB_EXTRAS=
109+
DB_CHARSET=
78110

79111
DIFY_INVOCATION_CONNECTION_IDLE_TIMEOUT=120
80112

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
**Self Checks**
10+
11+
To make sure we get to you in time, please check the following :)
12+
- [ ] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify-plugin-daemon/issues), including closed ones.
13+
- [ ] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)).
14+
- [ ] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
15+
- [ ] "Please do not modify this template :) and fill in all the required fields."
16+
17+
**Versions**
18+
1. dify-plugin-daemon Version
19+
2. dify-api Version
20+
21+
**Describe the bug**
22+
A clear and concise description of what the bug is.
23+
24+
**To Reproduce**
25+
Steps to reproduce the behavior:
26+
1. Go to '...'
27+
2. Click on '....'
28+
3. Scroll down to '....'
29+
4. See error
30+
31+
**Expected behavior**
32+
A clear and concise description of what you expected to happen.
33+
34+
**Screenshots**
35+
If applicable, add screenshots to help explain your problem.
36+
37+
**Additional context**
38+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Self Checks**
11+
12+
To make sure we get to you in time, please check the following :)
13+
- [ ] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify-plugin-daemon/issues), including closed ones.
14+
- [ ] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)).
15+
- [ ] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
16+
- [ ] "Please do not modify this template :) and fill in all the required fields."
17+
18+
19+
**Is your feature request related to a problem? Please describe.**
20+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
21+
22+
**Describe the solution you'd like**
23+
A clear and concise description of what you want to happen.
24+
25+
**Describe alternatives you've considered**
26+
A clear and concise description of any alternative solutions or features you've considered.
27+
28+
**Additional context**
29+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Description
2+
3+
Please provide a brief description of the changes made in this pull request.
4+
Please also include the issue number if this is related to an issue using the format `Fixes #123` or `Closes #123`.
5+
6+
## Type of Change
7+
8+
- [ ] Bug fix
9+
- [ ] New feature
10+
- [ ] Refactor
11+
- [ ] Performance improvement
12+
- [ ] Other
13+
14+
## Essential Checklist
15+
16+
### Testing
17+
- [ ] I have tested the changes locally and confirmed they work as expected
18+
- [ ] I have added unit tests where necessary and they pass successfully
19+
20+
### Bug Fix (if applicable)
21+
- [ ] I have used GitHub syntax to close the related issue (e.g., `Fixes #123` or `Closes #123`)
22+
23+
## Additional Information
24+
25+
Please provide any additional context that would help reviewers understand the changes.

.github/workflows/build-push.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- "deploy/dev"
88
- "cache-test"
99
- "dify-for-mysql"
10+
- "build/**"
1011
pull_request:
1112
branches:
1213
- "main"
@@ -32,7 +33,7 @@ jobs:
3233
steps:
3334
- name: Checkout code
3435
uses: actions/checkout@v4
35-
36+
3637
- name: Set matrix
3738
id: set-matrix
3839
run: |

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ All requests from Dify api based on HTTP protocol, but depends on the runtime ty
1414

1515
- For local runtime, daemon will start plugin as the subprocess and communicate with the plugin via STDIN/STDOUT.
1616
- For debug runtime, daemon wait for a plugin to connect and communicate in full-duplex way, it's TCP based.
17-
- For serverless runtime, plugin will be packaged to a third-party service like AWS Lambda and then be invoked by the daemon via HTTP protocol.
17+
- For serverless runtime, plugin will be packaged to a third-party service like AWS Lambda and then be invoked by the daemon via HTTP protocol. You may refer to [SRI Docs](./docs/runtime/sri.md) for more detailed information.
1818

1919
For more detailed introduction about Dify plugin, please refer to our docs [https://docs.dify.ai/plugins/introduction](https://docs.dify.ai/plugins/introduction).
2020

@@ -48,10 +48,13 @@ Firstly copy the `.env.example` file to `.env` and set the correct environment v
4848
cp .env.example .env
4949
```
5050

51+
If you were using a non-AWS S3 storage before version 0.1.2, you need to manually set the S3_USE_AWS environment variable to false in the .env file.
52+
5153
Attention that the `PYTHON_INTERPRETER_PATH` is the path to the python interpreter, please specify the correct path according to your python installation and make sure the python version is 3.11 or higher, as dify-plugin-sdk requires.
5254

5355
We recommend you to use `vscode` to debug the daemon, and a `launch.json` file is provided in the `.vscode` directory.
5456

57+
5558
### Python environment
5659
#### UV
5760
Daemon uses `uv` to manage the dependencies of plugins, before you start the daemon, you need to install [uv](https://github.com/astral-sh/uv) by yourself.
@@ -71,7 +74,7 @@ uses docker volume to share the directory with the host machine, it's better for
7174

7275
### Kubernetes
7376

74-
For now, Daemon community edition dose not support smoothly scale out with the number of replicas, If you are interested in this feature, please contact us. we have a more production-ready version for enterprise users.
77+
For now, Daemon community edition does not support smoothly scale out with the number of replicas, If you are interested in this feature, please contact us. we have a more production-ready version for enterprise users.
7578

7679
## Benchmark
7780

cmd/codegen/main.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package main
2+
3+
import (
4+
"flag"
5+
"fmt"
6+
"os"
7+
8+
"github.com/langgenius/dify-plugin-daemon/internal/server/controllers/generator"
9+
)
10+
11+
func main() {
12+
// Parse command line flags
13+
flag.Parse()
14+
15+
// Generate all files
16+
if err := generator.GenerateAll(); err != nil {
17+
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
18+
os.Exit(1)
19+
}
20+
}

cmd/commandline/plugin.go

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,6 @@ var (
3737
Long: `Initialize a new plugin with the given parameters.
3838
If no parameters are provided, an interactive mode will be started.`,
3939
Run: func(c *cobra.Command, args []string) {
40-
author, _ := c.Flags().GetString("author")
41-
name, _ := c.Flags().GetString("name")
42-
repo, _ := c.Flags().GetString("repo")
43-
description, _ := c.Flags().GetString("description")
44-
allowRegisterEndpoint, _ := c.Flags().GetBool("allow-register-endpoint")
45-
allowInvokeTool, _ := c.Flags().GetBool("allow-invoke-tool")
46-
allowInvokeModel, _ := c.Flags().GetBool("allow-invoke-model")
47-
allowInvokeLLM, _ := c.Flags().GetBool("allow-invoke-llm")
48-
allowInvokeTextEmbedding, _ := c.Flags().GetBool("allow-invoke-text-embedding")
49-
allowInvokeRerank, _ := c.Flags().GetBool("allow-invoke-rerank")
50-
allowInvokeTTS, _ := c.Flags().GetBool("allow-invoke-tts")
51-
allowInvokeSpeech2Text, _ := c.Flags().GetBool("allow-invoke-speech2text")
52-
allowInvokeModeration, _ := c.Flags().GetBool("allow-invoke-moderation")
53-
allowInvokeNode, _ := c.Flags().GetBool("allow-invoke-node")
54-
allowInvokeApp, _ := c.Flags().GetBool("allow-invoke-app")
55-
allowUseStorage, _ := c.Flags().GetBool("allow-use-storage")
56-
storageSize, _ := c.Flags().GetUint64("storage-size")
57-
category, _ := c.Flags().GetString("category")
58-
language, _ := c.Flags().GetString("language")
59-
minDifyVersion, _ := c.Flags().GetString("min-dify-version")
60-
quick, _ := c.Flags().GetBool("quick")
61-
6240
plugin.InitPluginWithFlags(
6341
author,
6442
name,
@@ -177,6 +155,23 @@ If no parameters are provided, an interactive mode will be started.`,
177155
},
178156
}
179157

158+
pluginReadmeCommand = &cobra.Command{
159+
Use: "readme",
160+
Short: "Readme",
161+
Long: "Readme",
162+
}
163+
164+
pluginReadmeListCommand = &cobra.Command{
165+
Use: "list [plugin_path]",
166+
Short: "List available README languages",
167+
Long: "List available README languages in the specified plugin",
168+
Args: cobra.ExactArgs(1),
169+
Run: func(cmd *cobra.Command, args []string) {
170+
pluginPath := args[0]
171+
plugin.ListReadme(pluginPath)
172+
},
173+
}
174+
180175
// NOTE: tester is deprecated, maybe, in several months, we will support this again
181176
// pluginTestCommand = &cobra.Command{
182177
// Use: "test [-i inputs] [-t timeout] package_path invoke_type invoke_action",
@@ -229,10 +224,12 @@ func init() {
229224
pluginCommand.AddCommand(pluginChecksumCommand)
230225
pluginCommand.AddCommand(pluginEditPermissionCommand)
231226
pluginCommand.AddCommand(pluginModuleCommand)
227+
pluginCommand.AddCommand(pluginReadmeCommand)
232228
pluginModuleCommand.AddCommand(pluginModuleListCommand)
233229
pluginModuleCommand.AddCommand(pluginModuleAppendCommand)
234230
pluginModuleAppendCommand.AddCommand(pluginModuleAppendToolsCommand)
235231
pluginModuleAppendCommand.AddCommand(pluginModuleAppendEndpointsCommand)
232+
pluginReadmeCommand.AddCommand(pluginReadmeListCommand)
236233

237234
pluginInitCommand.Flags().StringVar(&author, "author", "", "Author name (1-64 characters, lowercase letters, numbers, dashes and underscores only)")
238235
pluginInitCommand.Flags().StringVar(&name, "name", "", "Plugin name (1-128 characters, lowercase letters, numbers, dashes and underscores only)")

0 commit comments

Comments
 (0)