Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
458542c
fix: Fix the issue where the List method of Alibaba Cloud OSS did not…
bravomark May 20, 2025
6b112bc
feat(redis): Add support for Redis Sentinel mode (#276)
erigo May 20, 2025
c799d90
chore: coding style (#291)
Yeuoly May 20, 2025
9a1da25
feat: Enhance plugin signing with authorized category verification (#…
Yeuoly May 21, 2025
cdf3493
Update issue templates
41tair May 22, 2025
8380c1d
fix(lock): Add concurrency test for Redis lock functionality (#305)
Yeuoly May 23, 2025
3d28e0c
feat: Add code generation for plugin controllers and services (#301)
Yeuoly May 23, 2025
b6906f7
feat: Generate HTTP server routes from template (#306)
Yeuoly May 23, 2025
6b7172d
fix: errChan failed to write response because of panic nil (#296) (#297)
NeatGuyCoding May 26, 2025
478c98d
fix: signature dose not work as expected, if upload new pkg to old di…
Yeuoly May 26, 2025
2cd64ad
feat: change listPlugin struct & add total (#302)
LeeeeeeM May 27, 2025
b3c68cb
add packaged file info when plugin package larger than max size (#312)
41tair May 27, 2025
3918b37
refactor: streamline plugin initialization and update YAML templates …
Yeuoly May 27, 2025
1fb2d1b
update issute template: add self checks
41tair May 28, 2025
0167554
feat: add mcp tool type (#315)
Nov1c444 May 30, 2025
1c9e28b
Feat: Replace the internal/oss module with dify-cloud-kit (#317)
41tair May 30, 2025
f891441
fix: support serverless plugin management with execution timeout (#318)
Yeuoly May 30, 2025
052cd0c
fix: remove redundant Content-Type header for payloadReader in HTTP r…
Yeuoly May 30, 2025
5573e1f
Fix env read bug for GCS_CREDENTIALS. (#324)
zhanluxianshen Jun 2, 2025
412084b
fix build error, go.mod upgrade for github.com/panjf2000/ants/v2 (#323)
zhanluxianshen Jun 3, 2025
5f8072c
Chore/unify configurations (#319)
Yeuoly Jun 4, 2025
cfd399b
feat: agent plugin add meta version
Nov1c444 Jun 5, 2025
8c9458c
Merge pull request #325 from Nov1c444/feat/add-meta
Nov1c444 Jun 5, 2025
6873c3f
bump dify-cloud-kit version to 681efb7762a4 (#339)
41tair Jun 10, 2025
7c1e46f
add serverless runtime interface docs (#338)
41tair Jun 10, 2025
debb374
add USE_AWS_S3 args avoid ambiguity. (#340)
41tair Jun 11, 2025
ac64417
feat: add length-prefixed HTTP chunking functionality (#341)
Yeuoly Jun 11, 2025
1e260ee
refactor: using length-prefixed chunking for Backwards invocations (#…
Yeuoly Jun 11, 2025
18e91bb
fix s3 client path style not used (#344)
41tair Jun 13, 2025
6cea2d4
refactor(local_runtime): optimize listener lookup in stdioHolder (#345)
guanz42 Jun 16, 2025
3d1e2ab
fix: skip waiting if error occured (#337)
nht1206 Jun 16, 2025
dfc9622
feat(db): enhance database configuration with charset and extras supp…
Yeuoly Jun 18, 2025
a6c8fae
feat: add decode plugin from identifier endpoint (#349)
Yeuoly Jun 18, 2025
ff875c7
Split REMOTE_INSTALL_ADDRESS into HOST and PORT in .env.example to al…
ZombieBlue Jun 20, 2025
166609f
fix: launch error when using redis sentinel (#352)
tsonglew Jun 23, 2025
ae2658d
refactor(plugin_manager): remove first logging of local plugin launch…
Yeuoly Jun 24, 2025
9c6bbc6
refactor: extract DSN construction to buildDSN for better reuse and r…
41tair Jun 25, 2025
f096900
fix:response data will be discard if tool/llm response buffer overflo…
kinoooolu Jun 26, 2025
7bb6406
test(stream): add delay in TestStreamCloseBlockingWrite to ensure blo…
Yeuoly Jun 26, 2025
f80d8a8
feat: add pull request template for improved contribution guidelines …
Yeuoly Jun 26, 2025
af3fec6
fix: prevent duplicate packaging (#367)
jingfelix Jun 26, 2025
a70d808
feat(dynamic_select): implement dynamic parameter fetching functional…
Yeuoly Jun 27, 2025
7a7848b
Update README.md (#372)
defstream Jun 28, 2025
6d6fb38
feat: add InvokeLLMWithStructuredOutput functionality (#369)
Yeuoly Jun 30, 2025
412589f
skip error plugin names (#381)
AkisAya Jul 3, 2025
56fcd68
feat: add active request tracking to health check and dispatch routes…
Yeuoly Jul 4, 2025
18d4151
optimize: skip sleep for remote plugin runtime during restart, making…
Blackoutta Jul 7, 2025
b97cce7
enhance(cli/icon): add multiple categories default plugin icons (#388)
Yeuoly Jul 8, 2025
6ae762b
feat(plugin_manager): optimize local plugin startup with concurrency …
homejim Jul 8, 2025
7bc3b75
feat(plugin_manager): enhance asset remapping for icons (#392)
Yeuoly Jul 9, 2025
33c023b
refactor(plugin_manager): enhance HTTP client timeout handling in ser…
Yeuoly Jul 9, 2025
a0414b3
0.2.0 (#402)
Mairuis Jul 17, 2025
3b0a867
feat/tool oauth cli template (#407)
Mairuis Jul 21, 2025
7f463e3
feat(plugin_decoder): add support for internationalized readme files …
Yeuoly Jul 21, 2025
bace3bf
feat(oauth): implement refresh credentials functionality (#408)
Yeuoly Jul 23, 2025
9234aed
chore(deps): bump github.com/go-jose/go-jose/v4 from 4.0.4 to 4.0.5 (…
dependabot[bot] Jul 23, 2025
02802e1
Merge branch 'branch-from-0.2.0' into for-mysql
yuanoOo Sep 15, 2025
61b3a07
feat: MySQL compatible Dify plugin daemon based on https://github.com…
yuanoOo Sep 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ PLUGIN_REMOTE_INSTALLING_HOST=127.0.0.1
PLUGIN_REMOTE_INSTALLING_PORT=5003

# s3 credentials
S3_USE_AWS_MANAGED_IAM=true
S3_USE_AWS=true
S3_USE_AWS_MANAGED_IAM=false
S3_ENDPOINT=
S3_USE_PATH_STYLE=true
AWS_ACCESS_KEY=
Expand All @@ -35,7 +36,23 @@ ALIYUN_OSS_PATH=
AZURE_BLOB_STORAGE_CONTAINER_NAME=
AZURE_BLOB_STORAGE_CONNECTION_STRING=

# volcengine tos
VOLCENGINE_TOS_ENDPOINT=
VOLCENGINE_TOS_ACCESS_KEY=
VOLCENGINE_TOS_SECRET_KEY=
VOLCENGINE_TOS_REGION=

# gcs storage credentials base64 string
GCS_CREDENTIALS=

# huawei obs credentials
HUAWEI_OBS_ACCESS_KEY=
HUAWEI_OBS_SECRET_KEY=
HUAWEI_OBS_SERVER=


# services storage
# https://github.com/langgenius/dify-cloud-kit/blob/main/oss/factory/factory.go
PLUGIN_STORAGE_TYPE=local
PLUGIN_STORAGE_OSS_BUCKET=
PLUGIN_STORAGE_LOCAL_ROOT=./storage
Expand All @@ -62,6 +79,18 @@ REDIS_PORT=6379
REDIS_PASSWORD=difyai123456
REDIS_DB=0

# Whether to use Redis Sentinel mode.
# If set to true, the application will automatically discover and connect to the master node through Sentinel.
REDIS_USE_SENTINEL=false

# List of Redis Sentinel nodes. If Sentinel mode is enabled, provide at least one Sentinel IP and port.
# Format: `<sentinel1_ip>:<sentinel1_port>,<sentinel2_ip>:<sentinel2_port>,<sentinel3_ip>:<sentinel3_port>`
REDIS_SENTINELS=
REDIS_SENTINEL_SERVICE_NAME=
REDIS_SENTINEL_USERNAME=
REDIS_SENTINEL_PASSWORD=
REDIS_SENTINEL_SOCKET_TIMEOUT=0.1

DB_USERNAME=postgres
DB_PASSWORD=difyai123456
DB_HOST=localhost
Expand All @@ -75,6 +104,9 @@ DB_SSL_MODE=disable
DB_MAX_IDLE_CONNS=10
DB_MAX_OPEN_CONNS=30
DB_CONN_MAX_LIFETIME=3600
# DB_EXTRAS in GORM format
DB_EXTRAS=
DB_CHARSET=

DIFY_INVOCATION_CONNECTION_IDLE_TIMEOUT=120

Expand Down
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---
**Self Checks**

To make sure we get to you in time, please check the following :)
- [ ] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify-plugin-daemon/issues), including closed ones.
- [ ] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)).
- [ ] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [ ] "Please do not modify this template :) and fill in all the required fields."

**Versions**
1. dify-plugin-daemon Version
2. dify-api Version

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Self Checks**

To make sure we get to you in time, please check the following :)
- [ ] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify-plugin-daemon/issues), including closed ones.
- [ ] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)).
- [ ] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [ ] "Please do not modify this template :) and fill in all the required fields."


**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
25 changes: 25 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Description

Please provide a brief description of the changes made in this pull request.
Please also include the issue number if this is related to an issue using the format `Fixes #123` or `Closes #123`.

## Type of Change

- [ ] Bug fix
- [ ] New feature
- [ ] Refactor
- [ ] Performance improvement
- [ ] Other

## Essential Checklist

### Testing
- [ ] I have tested the changes locally and confirmed they work as expected
- [ ] I have added unit tests where necessary and they pass successfully

### Bug Fix (if applicable)
- [ ] I have used GitHub syntax to close the related issue (e.g., `Fixes #123` or `Closes #123`)

## Additional Information

Please provide any additional context that would help reviewers understand the changes.
3 changes: 2 additions & 1 deletion .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- "deploy/dev"
- "cache-test"
- "dify-for-mysql"
- "build/**"
pull_request:
branches:
- "main"
Expand All @@ -32,7 +33,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set matrix
id: set-matrix
run: |
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ All requests from Dify api based on HTTP protocol, but depends on the runtime ty

- For local runtime, daemon will start plugin as the subprocess and communicate with the plugin via STDIN/STDOUT.
- For debug runtime, daemon wait for a plugin to connect and communicate in full-duplex way, it's TCP based.
- 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.
- 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.

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

Expand Down Expand Up @@ -48,10 +48,13 @@ Firstly copy the `.env.example` file to `.env` and set the correct environment v
cp .env.example .env
```

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.

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.

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


### Python environment
#### UV
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.
Expand All @@ -71,7 +74,7 @@ uses docker volume to share the directory with the host machine, it's better for

### Kubernetes

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

## Benchmark

Expand Down
20 changes: 20 additions & 0 deletions cmd/codegen/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package main

import (
"flag"
"fmt"
"os"

"github.com/langgenius/dify-plugin-daemon/internal/server/controllers/generator"
)

func main() {
// Parse command line flags
flag.Parse()

// Generate all files
if err := generator.GenerateAll(); err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
}
41 changes: 19 additions & 22 deletions cmd/commandline/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,6 @@ var (
Long: `Initialize a new plugin with the given parameters.
If no parameters are provided, an interactive mode will be started.`,
Run: func(c *cobra.Command, args []string) {
author, _ := c.Flags().GetString("author")
name, _ := c.Flags().GetString("name")
repo, _ := c.Flags().GetString("repo")
description, _ := c.Flags().GetString("description")
allowRegisterEndpoint, _ := c.Flags().GetBool("allow-register-endpoint")
allowInvokeTool, _ := c.Flags().GetBool("allow-invoke-tool")
allowInvokeModel, _ := c.Flags().GetBool("allow-invoke-model")
allowInvokeLLM, _ := c.Flags().GetBool("allow-invoke-llm")
allowInvokeTextEmbedding, _ := c.Flags().GetBool("allow-invoke-text-embedding")
allowInvokeRerank, _ := c.Flags().GetBool("allow-invoke-rerank")
allowInvokeTTS, _ := c.Flags().GetBool("allow-invoke-tts")
allowInvokeSpeech2Text, _ := c.Flags().GetBool("allow-invoke-speech2text")
allowInvokeModeration, _ := c.Flags().GetBool("allow-invoke-moderation")
allowInvokeNode, _ := c.Flags().GetBool("allow-invoke-node")
allowInvokeApp, _ := c.Flags().GetBool("allow-invoke-app")
allowUseStorage, _ := c.Flags().GetBool("allow-use-storage")
storageSize, _ := c.Flags().GetUint64("storage-size")
category, _ := c.Flags().GetString("category")
language, _ := c.Flags().GetString("language")
minDifyVersion, _ := c.Flags().GetString("min-dify-version")
quick, _ := c.Flags().GetBool("quick")

plugin.InitPluginWithFlags(
author,
name,
Expand Down Expand Up @@ -177,6 +155,23 @@ If no parameters are provided, an interactive mode will be started.`,
},
}

pluginReadmeCommand = &cobra.Command{
Use: "readme",
Short: "Readme",
Long: "Readme",
}

pluginReadmeListCommand = &cobra.Command{
Use: "list [plugin_path]",
Short: "List available README languages",
Long: "List available README languages in the specified plugin",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
pluginPath := args[0]
plugin.ListReadme(pluginPath)
},
}

// NOTE: tester is deprecated, maybe, in several months, we will support this again
// pluginTestCommand = &cobra.Command{
// Use: "test [-i inputs] [-t timeout] package_path invoke_type invoke_action",
Expand Down Expand Up @@ -229,10 +224,12 @@ func init() {
pluginCommand.AddCommand(pluginChecksumCommand)
pluginCommand.AddCommand(pluginEditPermissionCommand)
pluginCommand.AddCommand(pluginModuleCommand)
pluginCommand.AddCommand(pluginReadmeCommand)
pluginModuleCommand.AddCommand(pluginModuleListCommand)
pluginModuleCommand.AddCommand(pluginModuleAppendCommand)
pluginModuleAppendCommand.AddCommand(pluginModuleAppendToolsCommand)
pluginModuleAppendCommand.AddCommand(pluginModuleAppendEndpointsCommand)
pluginReadmeCommand.AddCommand(pluginReadmeListCommand)

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