feat(sdk): SettingsAPI.DataDir() + plugindev dispatchSettings 补 DataDir

SDK SettingsAPI 新增 DataDir() 插件专属数据目录;
plugindev 工具链 dispatchSettings 模板补 DataDir 实现(callString 51)。
ai_image example 改用 DataDir + 本地交付。详见 TrueAgent 仓库。
This commit is contained in:
JianFeeeee
2026-08-26 21:41:28 +08:00
parent cd1984e26e
commit 130f805b6e
4 changed files with 92 additions and 7 deletions

View File

@ -19,6 +19,11 @@ type SettingsAPI interface {
// ListCore lists core config keys matching the prefix.
ListCore(prefix string) ([]string, error)
// DataDir returns the plugin-specific data directory (guaranteed to exist):
// <daemon data>/plugin_data/<plugin_name>. Plugins should persist any
// runtime files (generated images, caches, downloads) here.
DataDir() string
// GetPlugin reads another plugin's config table.
GetPlugin(plugin, key string) (interface{}, error)