@@ -27,15 +27,6 @@ import (
2727type PluginManager struct {
2828 m mapping.Map [string , plugin_entities.PluginLifetime ]
2929
30- // max size of a plugin package
31- maxPluginPackageSize int64
32-
33- // where the plugin finally running
34- workingDirectory string
35-
36- // where the plugin finally installed but not running
37- pluginStoragePath string
38-
3930 // mediaBucket is used to manage media files like plugin icons, images, etc.
4031 mediaBucket * media_transport.MediaBucket
4132
@@ -54,52 +45,13 @@ type PluginManager struct {
5445 // backwardsInvocation is a handle to invoke dify
5546 backwardsInvocation dify_invocation.BackwardsInvocation
5647
57- // python interpreter path
58- pythonInterpreterPath string
59-
60- // uv path
61- uvPath string
62-
63- // python env init timeout
64- pythonEnvInitTimeout int
65-
66- // proxy settings
67- HttpProxy string
68- HttpsProxy string
69- NoProxy string
70-
71- // pip mirror url
72- pipMirrorUrl string
73-
74- // pip prefer binary
75- pipPreferBinary bool
76-
77- // pip verbose
78- pipVerbose bool
79-
80- // pip extra args
81- pipExtraArgs string
82-
83- // python compileall extra args
84- pythonCompileAllExtraArgs string
48+ config * app.Config
8549
8650 // remote plugin server
8751 remotePluginServer debugging_runtime.RemotePluginServerInterface
8852
8953 // max launching lock to prevent too many plugins launching at the same time
9054 maxLaunchingLock chan bool
91-
92- // platform, local or serverless
93- platform app.PlatformType
94-
95- // serverless connector launch timeout
96- serverlessConnectorLaunchTimeout int
97-
98- pluginMaxExecutionTimeout int
99-
100- // plugin stdio buffer size
101- pluginStdioBufferSize int
102- pluginStdioMaxBufferSize int
10355}
10456
10557var (
10860
10961func InitGlobalManager (oss oss.OSS , configuration * app.Config ) * PluginManager {
11062 manager = & PluginManager {
111- maxPluginPackageSize : configuration .MaxPluginPackageSize ,
112- pluginStoragePath : configuration .PluginInstalledPath ,
113- workingDirectory : configuration .PluginWorkingPath ,
11463 mediaBucket : media_transport .NewAssetsBucket (
11564 oss ,
11665 configuration .PluginMediaCachePath ,
@@ -124,24 +73,9 @@ func InitGlobalManager(oss oss.OSS, configuration *app.Config) *PluginManager {
12473 oss ,
12574 configuration .PluginInstalledPath ,
12675 ),
127- localPluginLaunchingLock : lock .NewGranularityLock (),
128- maxLaunchingLock : make (chan bool , 2 ), // by default, we allow 2 plugins launching at the same time
129- pythonInterpreterPath : configuration .PythonInterpreterPath ,
130- uvPath : configuration .UvPath ,
131- pythonEnvInitTimeout : configuration .PythonEnvInitTimeout ,
132- pythonCompileAllExtraArgs : configuration .PythonCompileAllExtraArgs ,
133- platform : configuration .Platform ,
134- HttpProxy : configuration .HttpProxy ,
135- HttpsProxy : configuration .HttpsProxy ,
136- NoProxy : configuration .NoProxy ,
137- pipMirrorUrl : configuration .PipMirrorUrl ,
138- pipPreferBinary : * configuration .PipPreferBinary ,
139- pipVerbose : * configuration .PipVerbose ,
140- pipExtraArgs : configuration .PipExtraArgs ,
141- serverlessConnectorLaunchTimeout : configuration .DifyPluginServerlessConnectorLaunchTimeout ,
142- pluginStdioBufferSize : configuration .PluginStdioBufferSize ,
143- pluginStdioMaxBufferSize : configuration .PluginStdioMaxBufferSize ,
144- pluginMaxExecutionTimeout : configuration .PluginMaxExecutionTimeout ,
76+ localPluginLaunchingLock : lock .NewGranularityLock (),
77+ maxLaunchingLock : make (chan bool , 2 ), // by default, we allow 2 plugins launching at the same time
78+ config : configuration ,
14579 }
14680
14781 return manager
@@ -154,7 +88,7 @@ func Manager() *PluginManager {
15488func (p * PluginManager ) Get (
15589 identity plugin_entities.PluginUniqueIdentifier ,
15690) (plugin_entities.PluginLifetime , error ) {
157- if identity .RemoteLike () || p .platform == app .PLATFORM_LOCAL {
91+ if identity .RemoteLike () || p .config . Platform == app .PLATFORM_LOCAL {
15892 // check if it's a debugging plugin or a local plugin
15993 if v , ok := p .m .Load (identity .String ()); ok {
16094 return v , nil
0 commit comments