PackageModule class abstract
Runtime module contract for Zuraffa-native packages (spec 025, FR-006/FR-007).
A PackageModule is the lifecycle entry point a reusable package exposes to consuming apps. It follows the standard engine lifecycle — no separate lifecycle model is introduced:
- register —
ZuraffaEngine.register/registerPackageaccepts the module (registerPackage additionally validates the package's zuraffa SDK constraint against the running version, FR-015). - bootstrap —
registerDependenciesruns (the generated package registrar wires datasources/repositories/usecases into the consuming app's container — FR-005), thenonInit. - ready —
ZuraffaEngine.ready()awaits onReady for every module, in registration order. - dispose —
ZuraffaEngine.shutdown()awaits onDispose for every module, in reverse registration order.
Example (generated by zfa package create):
class MyPkgPackageModule extends PackageModule {
@override
String get pluginId => 'my_pkg';
@override
void registerDependencies(ZuraffaDIContainer di) =>
registerMyPkgPackage(di); // from di/my_pkg_package_registrar.dart
@override
Map<String, ZuraffaRouteHandler> get routes => const {};
}
- Inheritance
-
- Object
- ZuraffaPlugin
- PackageModule
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- packageName → String
-
The package identity used to namespace contributed agent tools
(FR-008:
<package>.<usecase>).no setter - pluginId → String
-
Unique identifier for this plugin.
no setterinherited
-
routes
→ Map<
String, ZuraffaRouteHandler> -
Route table contributed by this plugin.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- zuraffaSdkConstraint → String
-
The zuraffa SDK constraint this package was generated against.
no setter
Methods
-
buildAgentTools(
ZuraffaDIContainer di) → List< McpTool> -
Agent tools contributed by this package (FR-008), built against
the consuming app's
dicontainer once it is wired. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDispose(
ZuraffaDIContainer di) → Future< void> -
Disposal hook called by ZuraffaEngine.shutdown in reverse
registration order (spec 025 — package runtime modules).
inherited
-
onInit(
ZuraffaDIContainer di) → Future< void> -
Asynchronous initialisation hook called after all plugins
have completed registerDependencies.
inherited
-
onReady(
ZuraffaDIContainer di) → Future< void> -
Readiness hook called by ZuraffaEngine.ready after bootstrap has
completed for every plugin (spec 025 — package runtime modules).
inherited
-
registerDependencies(
ZuraffaDIContainer di) → void -
Registers this plugin's dependencies into the shared
dicontainer.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited