Introductionâ
services.Manifest() returns the current plugin-scoped manifest resource reading service. Paths are always relative to the manifest/ directory â for example, to read manifest/profile.yaml, pass profile.yaml.
Dynamic plugins use the same semantics but must declare the manifest service and allowed paths in plugin.yaml.
Capability Phase: Runtime
Supported Plugin Types: Source plugins, Dynamic plugins
Capability Designâ
Resource Binding Mechanismâ
Resources are bound to the current plugin: for source plugins they come from the embedded filesystem, for dynamic plugins from the published artifact or host-bound artifact resources. Paths must be canonical, using forward slashes, and escaping the current plugin's manifest/ root through relative paths is prohibited.
Resource Typesâ
| Path Example | Description |
|---|---|
profile.yaml | Plugin profile or display metadata |
config/config.example.yaml | Config template, not used for runtime default reads |
config/config.yaml | One of the plugin's default config sources |
i18n/zh-CN/plugin.json | Chinese language resources |
sql/install.sql | Install script raw resource |
Read-Only Raw Resource Semanticsâ
Reading resources does not mean executing SQL, registering language packs, or applying configuration. Configuration reading has dedicated capabilities. Runtime config values use Plugins().Config() or dynamic config.get; do not read config/config.yaml directly to bypass priority.
Interface Definitionsâ
Source Plugin Interfaceâ
| Method | Description |
|---|---|
Get | Reads the raw byte content at a specified path |
GetMany | Batch-reads raw resource content for a set of specified paths |
List | Returns resource metadata list under a specified prefix |
Exists | Checks whether a resource at a specified path exists |
Scan | Scans a YAML resource or nested key within it into the target struct |
Dynamic Plugin Interfaceâ
| Dynamic Method | Dynamic SDK Method | Description |
|---|---|---|
get | Manifest().Get, Manifest().GetMany, Manifest().List, Manifest().Exists, Manifest().Scan | Reads raw resources under authorized paths |
Capability Usageâ
Source Plugin Usageâ
Source plugins read resources shipped with the plugin through services.Manifest():
// Read plugin profile
content, err := services.Manifest().Get(ctx, "profile.yaml")
// Batch-read multiple resources
result, err := services.Manifest().GetMany(ctx, manifestcap.GetManyInput{
Paths: []string{"profile.yaml", "config/config.yaml"},
})
// List resource metadata
listResult, err := services.Manifest().List(ctx, manifestcap.ListInput{
Prefix: "i18n/",
Limit: 50,
})
// Check if a resource exists
exists, err := services.Manifest().Exists(ctx, "i18n/zh-CN/plugin.json")
// Scan YAML resource into struct
var config PluginConfig
err := services.Manifest().Scan(ctx, "config/config.yaml", "", &config)
Dynamic Plugin Usageâ
Dynamic plugins declare the manifest service and authorized paths in plugin.yaml:
hostServices:
- service: manifest
methods:
- get
resources:
paths:
- profile.yaml
- i18n/zh-CN/plugin.json
When manifest omits methods, it defaults to get. resources.paths must be paths relative to manifest/, not manifest/profile.yaml. Usage on the dynamic plugin side:
// Read plugin profile
content, err := pluginbridge.Default().Manifest().Get(ctx, "profile.yaml")
// Check if a resource exists
exists, err := pluginbridge.Default().Manifest().Exists(ctx, "i18n/zh-CN/plugin.json")
Design Constraintsâ
- Read-only raw resources. Reading resources does not mean executing
SQL, registering language packs, or applying configuration. - Configuration reading has dedicated capabilities. Runtime config values use
Plugins().Config()or dynamicconfig.get; do not readconfig/config.yamldirectly to bypass priority. - Resources are bound to the current plugin. For source plugins they come from the embedded filesystem, for dynamic plugins from the published artifact or host-bound artifact resources.
- Paths must be canonical. Use forward slashes; escaping the current plugin's
manifest/root through relative paths is prohibited.