Interface GatewayAiContext

All Superinterfaces:
AiContext

public interface GatewayAiContext extends AiContext
Gateway-scoped facade for AI features. Reached through GatewayContext.getAiContext(), which returns empty when AI is not enabled on the gateway; once a caller holds one of these, every accessor is non-empty and ready to use.
  • Method Details

    • getDiagnosticDigestManager

      DiagnosticDigestManager getDiagnosticDigestManager()
      Returns:
      the registry that consumer modules use to publish a DiagnosticDigestGenerator for a given page URL.
    • hasModelProviders

      boolean hasModelProviders()
      Whether at least one model provider is configured. Answers from configuration alone, without contacting any provider.
    • getMcpConnections

      List<McpConnectionInfo> getMcpConnections()
      Snapshot of every currently running gateway MCP connection, used by inventory routes that feed the user-agent configuration UI. Only includes connections whose startup succeeded.
    • mcpToolsFor

      McpToolSource mcpToolsFor(Collection<String> connectionNames)
      Build an McpToolSource whose resource name matches an entry of connectionNames (deduped). An empty collection yields a source that contributes no tools.

      The set of participating connections is resolved at this call — names that don't resolve to a running connection are skipped. Each subsequent McpToolSource.getMcpTools() invocation still re-lists tools on the already-resolved connections, so a connection's tool set may change turn-to-turn even though the set of connections is frozen.

      Each tool reports its connection's configured permissions through CallableTool.permissions(), re-read live rather than captured, so the harness gates listing and execution against the run's AiActor. This method performs no gating itself.

      Compose with AiContext.HarnessBuilder.mcpTools(McpToolSource) to scope a harness's MCP tools to an agent's explicit selection — e.g. ctx.newAgenticHarness(...).mcpTools(ctx.mcpToolsFor(cfg.mcpConnections())).build().