AppPlayerCoreService class
Top-level entrypoint assembling Connection / Runtime / Session / Dashboard / Tenant layers (MOD-CORE-001, FR-CORE-001~008).
Hosts receive AppSession / DashboardSession from the open* methods and
never touch MCPUIRuntime directly.
- Available extensions
Constructors
- AppPlayerCoreService()
- AppPlayerCoreService.forTesting({required ClientConnector connector})
- Test-only constructor that injects a mock ClientConnector. Kept out of the public initialize signature to prevent leaking a transport seam into production APIs (NFR-API-005).
Properties
- bundleInstallRoot → String
-
Absolute path where installed bundles are stored.
no setter
- connectionManagerForInternals → ConnectionManager
-
no setter
-
connections
→ Map<
String, ConnectionInfo> -
no setter
- credentialVault → CredentialVault
-
Exposed for transport configs that need to read secrets when building
connection options. Callers must not cache returned values.
no setter
- currentTenant → TenantContext?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
hostBrightness
→ ValueListenable<
Brightness> ? -
no setter
- lifecycleListenable → Listenable
-
Notifier that fires whenever connection or runtime lifecycle state
changes — launcher UI listens to this to refresh per-app badges
("connected" dot on the app icon) without polling.
no setter
- resourceSubscriberForInternals → ResourceSubscriber
-
no setter
- runtimeManagerForInternals → RuntimeManager
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toolDispatcherForInternals → ToolDispatcher
-
no setter
Methods
-
applyTenant(
String appCode) → Future< TenantContext> - FR-CORE-005
-
clearTenant(
) → Future< void> -
closeApp(
AppHandle handle) → Future< void> - FR-CORE-008 — terminate a session by handle.
-
closeDashboard(
) → Future< void> -
deleteServer(
String id) → Future< void> -
dispose(
) → Future< void> - FR-CORE-006
-
getServer(
String id) → Future< ServerConfig?> -
Fetches a single ServerConfig by id (FR-STOR passthrough).
Returns
nullwhen no entry matches. -
handleFor(
HasAppHandle app) → AppHandle -
Available on AppPlayerCoreService, provided by the AppPlayerCoreServiceActivity extension
Returns the AppHandle used by core for the given launcher entry. Useful forcloseApp(handle)calls from a context-menu close action. -
initialize(
{required ServerStorage storage, required String bundleInstallRoot, TenantSource? tenantSource, Logger? logger, MetricsPort? metrics, BundleFetcher? bundleFetcher, AppMetadataSink? appMetadataSink, CredentialVault? credentialVault, HealthMonitorConfig? healthConfig, ValueListenable< Brightness> ? hostBrightness, McpLogMessageHandler? onMcpLogMessage}) → Future<void> - FR-CORE-001
-
installBundleFromDirectory(
String mbdPath) → Future< InstalledAppBundle> -
installBundleFromFile(
String filePath) → Future< InstalledAppBundle> -
installBundleFromUrl(
Uri url) → Future< InstalledAppBundle> -
isAppActive(
HasAppHandle app) → bool -
Available on AppPlayerCoreService, provided by the AppPlayerCoreServiceActivity extension
-
isBundleLoaded(
String bundleId) → bool - True when a bundle's runtime is currently loaded in the runtime cache. Bundle apps don't maintain a network connection, so the cached runtime is the equivalent "is this app active?" signal.
-
isServerConnected(
String serverId) → bool -
True when a stdio / HTTP connection for
serverIdis live (ConnectionState.connected). Used by the launcher to paint the "connected" dot on server-type and dashboard-type tiles. -
listInstalledBundles(
) → Future< List< InstalledAppBundle> > -
listServers(
) → Future< List< ServerConfig> > -
loadBundle(
BundleRef ref) → Future< McpBundle> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openAppFromBundle(
BundleRef bundleRef, {TrustLevel trustLevel = TrustLevel.basic}) → Future< AppSession> -
FR-CORE-003 — Local Bundle path (
McpBundlefile / inline JSON). -
openAppFromServer(
String serverId, {TrustLevel trustLevel = TrustLevel.basic}) → Future< AppSession> -
FR-CORE-002 — Online path (MCP server serves
ui://application). -
openDashboard(
DashboardBundleRef bundle, List< String> deviceIds) → Future<DashboardSession> - FR-CORE-004
-
resolveBundleEntry(
McpBundle bundle) → BundleEntryPoint -
saveServer(
ServerConfig server) → Future< void> -
setMcpLoggingLevel(
String serverId, McpLogLevel level) → Future< bool> -
MCP logging spec — request the server identified by
serverIdto emit only messages at or abovelevelvianotifications/message. Returnsfalsewhen there is no active connection forserverId. -
toString(
) → String -
A string representation of this object.
inherited
-
uninstallBundle(
String bundleId) → Future< void>
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited