Topics

UTTORI ASM ยท IN DEVELOPMENT

Plugin activation and errors

Integrate plugin activation and errors through supported Uttori ASM APIs.

definePlugin supplies typing and returns the same object. The manager performs validation. Manifest apiVersion must equal PLUGIN_API_VERSION, independently of package semver. Dependencies activate first. IDs are lowercase. Contribution IDs require a namespace dot. Contributions must be registered before activate resolves and cannot be mutated after commit.

validateOptions supplies defaults or throws. Its result is frozen in place, including nested objects, so return owned data. Without a validator, nonempty options are rejected. Each plugin's registrations commit together. A later failed plugin does not roll back earlier successful plugins in the batch. If activation throws before returning a disposable, it must clean up its own resources. Freezing validates cross-contribution references and aliases and prevents further activation.

Handle PluginError.code and optional owner/module/target fields instead of matching messages. Source errors can be ordinary errors. Disposal attempts all resources and reports AggregateError after cleanup failures. Repeated disposal is a no-op. Never continue using disposed sessions or plugin resources. Direct AssemblerEnvironment construction is an advanced path that assumes already validated, frozen contribution records. Prefer PluginManager.freeze().