feat(image): 以插件声明统一图片参数、尺寸选择与定价合同 (#760)
* feat(image): 图片参数 - 统一插件声明配置与生成合同 * docs(image): 图片参数 - 说明声明合同与验证边界 * fix(plugins): 图片声明 - 保留内联素材支持并同步制品文档 * fix(image): 参数合同 - 对齐审批意图和尺寸预检调用方 * fix(image): 调用链 - 保留公开意图并接通独立分辨率 * fix(image): 图片参数 - 补齐分辨率接线与目录价格投影
This commit is contained in:
1 parent
88de4ce422
commit
7466119867
104 files changed
+6013
-568
No files matched your search
@@ -26,6 +26,7 @@ type PluginProviderCatalogItem struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
UnavailableReason string `json:"unavailableReason,omitempty"`
|
||||
Parameters []protocol.Parameter `json:"parameters,omitempty"`
|
||||
ImageParameters []protocol.ImageParameter `json:"imageParameters,omitempty"`
|
||||
Workflows []protocol.ManifestWorkflow `json:"workflows,omitempty"`
|
||||
}
|
||||
|
||||
@@ -42,6 +43,7 @@ func (s *Service) PluginProviderCatalog(scope, capability string, includeUnavail
|
||||
}
|
||||
item := PluginProviderCatalogItem{ID: provider.ID, Version: plugin.Manifest.Version, Name: provider.Label, Vendor: plugin.Manifest.Author, Categories: provider.Capabilities, Scopes: provider.Scopes, BaseURL: provider.BaseURL, Enabled: plugin.Status == "enabled", UnavailableReason: plugin.Error, Parameters: provider.Parameters, Workflows: workflowsForProvider(plugin.Manifest.Contributes.Workflows, provider.ID)}
|
||||
item.Create, item.Poll, item.ContentType = operationSummary(provider.Create), operationSummaryPtr(provider.Poll), provider.Create.ContentType
|
||||
item.ImageParameters = provider.ImageParameters
|
||||
// The registry metadata is the canonical provider projection. This keeps
|
||||
// host-backed dispatch paths out of every user-facing catalog consumer.
|
||||
if adapter, ok := canonicalProviderAdapter(s.protocolRegistry(), provider.ID); ok {
|
||||
@@ -180,6 +182,7 @@ func (s *Service) InstallPlugin(data []byte, fileName string) (PluginView, error
|
||||
}
|
||||
plugin, err := s.pluginRuntime.install(data, fileName)
|
||||
if err == nil {
|
||||
s.invalidateRouteCatalog()
|
||||
s.refreshPaymentRegistry()
|
||||
}
|
||||
return plugin, err
|
||||
@@ -241,6 +244,7 @@ func (s *Service) SetPluginEnabled(id string, enabled bool) (PluginView, error)
|
||||
}
|
||||
plugin, err := s.pluginRuntime.setEnabled(id, enabled)
|
||||
if err == nil {
|
||||
s.invalidateRouteCatalog()
|
||||
s.refreshPaymentRegistry()
|
||||
}
|
||||
return plugin, err
|
||||
@@ -255,6 +259,7 @@ func (s *Service) UninstallPlugin(id string) error {
|
||||
}
|
||||
err := s.pluginRuntime.uninstall(id)
|
||||
if err == nil {
|
||||
s.invalidateRouteCatalog()
|
||||
s.refreshPaymentRegistry()
|
||||
}
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user