AgentRuntimePlugin constructor

AgentRuntimePlugin({
  1. List<McpToolProvider>? spiProviders,
  2. List<McpTool> usecaseTools = const <McpTool>[],
  3. List<RemoteMcpServer> remoteServers = const <RemoteMcpServer>[],
  4. StatefulAgent? statefulAgent,
  5. LlmClient? llmClient,
  6. FileStateStorage? stateStorage,
  7. List<AgentHook> hooks = const <AgentHook>[],
  8. String playbook = '',
})

Implementation

AgentRuntimePlugin({
  List<McpToolProvider>? spiProviders,
  List<McpTool> usecaseTools = const <McpTool>[],
  List<RemoteMcpServer> remoteServers = const <RemoteMcpServer>[],
  StatefulAgent? statefulAgent,
  LlmClient? llmClient,
  FileStateStorage? stateStorage,
  List<AgentHook> hooks = const <AgentHook>[],
  String playbook = '',
}) {
  _registry = McpToolRegistry();
  _assembleRegistry(
    spiProviders: spiProviders ?? const <McpToolProvider>[],
    usecaseTools: usecaseTools,
    remoteServers: remoteServers,
  );

  _kernel = AgentKernel(
    registry: _registry,
    statefulAgent: statefulAgent ?? StubStatefulAgent(),
    llmClient: llmClient,
    promptComposer: SystemPromptComposer(playbook: playbook),
    stateStorage: stateStorage,
    hooks: hooks,
  );

  _providers = <String, String>{
    for (final p in spiProviders ?? const <McpToolProvider>[])
      p.namespace: p.runtimeType.toString(),
  };
  _remoteServerHealth = <String, String>{
    for (final s in remoteServers) s.id: s.healthStatus,
  };
}