masamune_ai_debugger library

AI debug overlay, incident reporting, and performance monitoring for Masamune apps running in debug mode.

To use, import package:masamune_ai_debugger/masamune_ai_debugger.dart. The default SamuraiAI integration reads its project ID, endpoint, and API key from MASAMUNE_AI_DEBUGGER_PROJECT_ID, MASAMUNE_AI_DEBUGGER_ENDPOINT, and MASAMUNE_AI_DEBUGGER_API_KEY.

Classes

AIDebugCameraPicture
A camera picture exposed by the AI debugger's debug camera UI.
AIDebugContextSnapshot
A bounded snapshot of the app state attached to a debug request.
AIDebugController
Network and incident lifecycle used by AIDebuggerMasamuneAdapter.
AIDebuggerMasamuneAdapter
Adds an in-app AI debug console, incident reporting, and performance monitoring to Masamune debug builds.
AIDebugPurchaseProduct
A purchase product exposed by the AI debugger's debug purchase UI.
AIDebugSettings
Persisted AI Debugger session and performance settings.

Enums

AIDebugModel
Models available to AI Debugger sessions.
AIDebugPermissionMode
Permission modes available to AI Debugger sessions.

Typedefs

AIDebugAnonymousLoginCallback = FutureOr<void> Function()
Signs in a debug user anonymously.
AIDebugCameraPicturesCallback = List<AIDebugCameraPicture> Function()
Returns the pictures available to the debug camera UI.
AIDebugCancelPurchaseCallback = FutureOr<void> Function(AIDebugPurchaseProduct product)
Removes the supplied product from the purchased state.
AIDebugConfiguredReportIncidentCallback = Future<void> Function(AIDebugController controller, {required String kind, required String message, required Map<String, Object?> metadata, required AIDebugModel model, required AIDebugPermissionMode permissionMode, required String stackTrace, required DateTime timestamp})
Reports an incident with its selected model and permission mode.
AIDebugConfiguredSendRequestCallback = Future<String?> Function(AIDebugController controller, String instruction, List<String> screenshotNames, {required AIDebugModel model, required AIDebugPermissionMode permissionMode})
Sends an instruction with its selected model and permission mode.
AIDebugContextProvider = FutureOr<AIDebugContextSnapshot?> Function()
Supplies page, route, and explicitly selected state at send time.
AIDebugEndRunCallback = Future<void> Function(AIDebugController controller)
Ends an AI debugger run.
AIDebugHeartbeatCallback = Future<void> Function(AIDebugController controller)
Sends a heartbeat for an AI debugger run.
AIDebugIsCameraPictureSetCallback = bool Function(AIDebugCameraPicture picture)
Returns whether the supplied picture is currently set on the camera.
AIDebugIsLoggedInCallback = bool Function()
Returns whether a debug user is currently signed in.
AIDebugIsPurchasedCallback = bool Function(AIDebugPurchaseProduct product)
Returns whether the supplied product is currently purchased.
AIDebugLoginCallback = FutureOr<void> Function(String email, String password)
Signs in a debug user with an email address and password.
AIDebugLogoutCallback = FutureOr<void> Function()
Signs out the current debug user.
AIDebugPost = Future<Map<String, Object?>> Function(String url, Map<String, String> headers, Map<String, Object?> body)
Testable transport used by AIDebugController.
AIDebugPurchaseCallback = FutureOr<void> Function(AIDebugPurchaseProduct product)
Forces the supplied product into a purchased state.
AIDebugPurchaseProductsCallback = List<AIDebugPurchaseProduct> Function()
Returns the purchase products available to the debug purchase UI.
AIDebugRegisterRunCallback = Future<void> Function(AIDebugController controller)
Registers an AI debugger run.
AIDebugReportIncidentCallback = Future<void> Function(AIDebugController controller, {required String kind, required String message, required Map<String, Object?> metadata, required String stackTrace, required DateTime timestamp})
Reports an exception or performance incident.
AIDebugSendRequestCallback = Future<String?> Function(AIDebugController controller, String instruction, List<String> screenshotNames)
Sends an instruction and returns an optional provider-specific session ID.
AIDebugSetCameraPictureCallback = FutureOr<void> Function(AIDebugCameraPicture picture)
Sets the supplied picture as the camera's debug picture.
AIDebugUnsetCameraPictureCallback = FutureOr<void> Function()
Removes the camera's current debug picture.
AIDebugUploadEventsCallback = Future<void> Function(AIDebugController controller, List<Map<String, Object?>> events)
Uploads a batch of log events.
AIDebugUploadScreenshotCallback = Future<String> Function(AIDebugController controller, Uint8List bytes, {required String name})
Uploads a screenshot and returns its provider-specific identifier.

Exceptions / Errors

AIDebugHttpException
HTTP failure returned by the AI debug API.