infria 0.1.2
infria: ^0.1.2 copied to clipboard
A clean, customizable Flutter UI SDK and runtime controller for AI chat interfaces, RAG, and dynamic client-side function calling.
Changelog #
All notable changes to the infria package will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.2 - 2026-09-03 #
Changed #
- Set default production runtime base URL to
https://asia-southeast2-infria-e1260.cloudfunctions.net/api/v1. - Upgraded
infria initandinfria useCLI commands to prompt for Public API Key (infria_pk_...) with direct navigation links to the Web Console (https://dashinfria.vercel.app/<projectId>/sdk). - Added
projectIdtoChatRequest.toJson()to ensure strict compliance with backend Zod validator requirements. - Enhanced HTTP error response parsing in
HttpTransportandRuntimeEventto safely handle nested error maps without type casting errors. - Added real-time HTTP request/response debug logging under
kDebugModeinHttpTransport. - Cleaned all emojis across documentation and CLI outputs for enterprise standard presentation.
0.1.1 - 2026-09-02 #
Documentation #
- Updated
README.mdto comprehensive English documentation for pub.dev. - Added comprehensive system architecture diagrams, quickstart guides, function calling examples, and custom UI builder references.
0.1.0 - 2026-09-02 #
Added #
- Initial Public Release of INFRIA:
InfriaSDK(andInfriaalias): Top-level singleton facade enabling one-line initialization (await InfriaSDK.initializeApp(options: DefaultInfriaOptions.currentPlatform)) and direct callback registration (InfriaSDK.onFunctionCall('check_queue_status', handler)).InfriaOptions: Multi-platform project configuration model holdingprojectId,apiKey,baseUrl,timeout, andcustomHeaders.infriaCLI tool (bin/infria.dart): Standalone developer CLI supportinginfria login(Live Google Popup Auth),infria init(Interactive project selector & non-destructive options generator),infria current,infria use, andinfria projects.InfriaChat,InfriaChatFloatingButton, and overlay helpers (showInfriaChatBottomSheet,showInfriaChatDialog): Complete, customizable Flutter AI chat UI with streaming support, suggestions, feedback ratings, and light/dark theming.- Parameter Schema Registration & Client-Side Function Calling (Tool Use) handshake with Gemini/OpenAPI compatibility.
- Comprehensive unit test suites with 87 passing tests (100% pass rate) and 0 analyzer issues.
Added #
- FlutterFire-like DX, InfriaSDK Facade & CLI (
infria init) (Phase 8):InfriaOptions: Multi-platform project configuration model holdingprojectId,apiKey,baseUrl,timeout, andcustomHeaders.InfriaSDK(andInfriaalias): Top-level singleton facade enabling one-line initialization (await InfriaSDK.initializeApp(options: DefaultInfriaOptions.currentPlatform)) and direct callback registration (InfriaSDK.onFunctionCall('request_refund', handler)).ChatControllerauto-binding: Seamlessly resolves to the activeInfriaSDK.instancewhen constructed without an explicitclientargument.infriaCLI tool (bin/infria.dart): Interactive terminal tool supportingdart run infria login,dart run infria init(with interactive project selector and automaticlib/infria_options.dartcode generation), anddart run infria projects.- Exported
executables: infria: infriainpubspec.yamlfor global CLI invocation. - Comprehensive unit test suites in
test/infria_sdk_test.dartandtest/infria_options_test.dart, increasing total tests to 87 passing tests (100% pass rate).
- Parameter Schema Registration & Slot-Filling Handshake (Phase 7):
FunctionParameter: Model parameter typed schema (string,number,integer,boolean,array,object) with metadata (description,isRequired,enumValues).- Added
RegisteredFunction.toSchemaJson()andFunctionRegistry.toSchemasJson()for OpenAPI / Gemini FunctionDeclaration schema compatibility. - Updated
ChatRequestandInfriaClient.sendChatMessage()to auto-serialize and inject client-side registered function schemas into runtime request payloads. - Added unit test suites verifying schema generation in
test/function_registry_test.dartandtest/infria_client_test.dart, increasing total tests to 76 passing tests (100% pass rate).
- Healthcare Showcase Example, Testing & pub.dev Preparation (Phase 6):
- Re-architected
example/lib/main.dartto showcase a complete Healthcare/Puskesmas Navigation Assistant (PKM-KI use case):- Integrated with
InfriaClientand real registered dynamic functions:check_queue_status(SIMRS queue check),get_doctor_schedule(specialist doctor schedule),get_bpjs_referral_status(BPJS validity), andcancel_appointment(sensitive action with confirmation modal). - Features quick action suggestions (
[🩺 Cek Antrean Poli],[📅 Jadwal Dokter],[📋 Syarat Rujukan BPJS],[❌ Batalkan Janji Temu]). - Interactive user feedback rating (👍/👎), function execution indicator, and presentation switching (Fullscreen, Dashboard with FAB & Bottom Sheet, Custom Hospital Theme Builder).
- Integrated with
- Enhanced
InfriaChatFloatingButton,showInfriaChatBottomSheet, andshowInfriaChatDialogto seamlessly acceptsuggestions,enableFeedback, andonFeedback. - Updated
pubspec.yamlwith pub.dev repository, issue tracker, topics, and detailed description. - Rewrote
README.mdwith complete architectural diagrams, quickstart instructions, BYOK security principles, and custom builder guides. - Achieved 100% test pass rate with 74 passing tests across 15 test suites and 0
dart analyzeissues.
- Re-architected
- UI Polish & Inclusive Conversational UX (Phase 5):
SuggestionChips&QuickSuggestion: Accessible, high-contrast action chips rendered above the chat input bar for effortless interactions by elderly and first-time users.FunctionExecutionIndicator: Smooth animated pulsing badge indicating active client-side function executions.MessageFeedbackBar: Interactive thumbs up (👍) / thumbs down (👎) rating component under assistant message bubbles supporting telemetry and the Observe & Improve cycle.showFunctionConfirmationDialog: Modal dialog prompting user confirmation before executing sensitive client functions (requiresConfirmation: true).InfriaChatUpdates: Addedsuggestions,enableFeedback, andonFeedbacksupport with seamless integration intoChatMessageListandChatMessageBubble.- Exported all new widgets in
lib/infria.dart. - Added widget test suites
test/suggestion_chips_test.dart,test/message_feedback_test.dart,test/confirmation_dialog_test.dart, and expandedtest/infria_chat_test.dart, increasing total tests to 74 passing tests (100% pass rate).
- Session Management & Controller Binding (Phase 4):
SessionManager: Thread-safe session management lifecycle (currentSessionId,newSession(),setSession(),clear()) with default hex-timestamp generator and customizable generator signature.ChatControllerUpgrades:- Integrated with
InfriaClientandSessionManagerfor full live AI chat support. - Updated
ChatStatusstate machine:idle,sending,executingFunction, anderror. - Automated Round-Trip Function Calling: seamlessly detects
function_callevent $\rightarrow$ updates status toexecutingFunction$\rightarrow$ runs local handler $\rightarrow$ submits result $\rightarrow$ appends final AI response without manual code from developers. - Added unhandled error callback
onErrorand graceful inline chat error messages. - Retained offline prototype fallback mode for preview and decoupled testing.
- Integrated with
ChatMessageUpdates: Added optionalmetadatafield for storing citations, model metadata, and backend payloads.- Exported
session_manager.dartinlib/infria.dart. - Added unit test suites
test/session_manager_test.dartand expandedtest/chat_controller_test.dart, increasing total tests to 66 passing tests (100% pass rate).
- Client-Side Function Callback Engine (Phase 3):
FunctionRegistry: Thread-safe registry for client-side local callbacks withregister(),registerDefinition(),unregister(),has(), andget().RegisteredFunction: Metadata model containing function name,FunctionHandlercallback signature (FutureOr<dynamic> Function(Map<String, dynamic>)), description, andrequiresConfirmationflag.FunctionExecutor: Safe execution dispatcher with automated argument validation, configurable timeout protection (defaultTimeout), and standardized error codes (FUNCTION_NOT_REGISTERED,FUNCTION_EXECUTION_ERROR,FUNCTION_TIMEOUT).InfriaClientUpdates:- Added
registerFunction(),unregisterFunction(), andhasFunction(). - Added
executeFunctionCall()to safely execute incomingfunction_callruntime events. - Added
handleFunctionCall()for full round-trip execution: parses event $\rightarrow$ executes local callback $\rightarrow$ submits result to/runtime/function-result$\rightarrow$ returns final AI response event.
- Added
- Exported
function_registry.dartandfunction_executor.dartinlib/infria.dart. - Added unit test suites
test/function_registry_test.dartandtest/function_executor_test.dart, expanding the test suite to 56 passing tests (100% pass rate).
- Core Client & Network Transport Layer (Phase 1 / Task 1):
InfriaConfig: Immutable configuration model for initializing the SDK withprojectId, publicapiKey(inf_pub_xxx),baseUrl,timeout, andcustomHeaders.InfriaExceptionHierarchy:InfriaApiException: General API error responses with HTTP status codes, error codes, request ID, and response payload.InfriaAuthenticationException: Handles HTTP 401 Unauthorized / invalid public project key.InfriaRateLimitException: Handles HTTP 429 Too Many Requests with optionalRetry-Afterduration parsing.InfriaNetworkException: Handles connection timeouts and socket/connectivity errors.InfriaConfigurationException: Handles invalid configuration parameters.
HttpTransport: Cross-platform HTTP layer usingpackage:httpwith automatic authentication headers (x-infria-project-id,x-infria-api-key,Content-Type: application/json) and injectable client for unit testing.InfriaClient(withInfriaalias): Main public SDK client providingsendChatMessage()andsendFunctionResult()API methods.
- Runtime Protocol Envelope & Event Parser (Phase 2):
RuntimeEvent&RuntimeEventType: Standardized envelope parsing formessage,function_call,error,feedback_ack, and streaming events.MessageEventData: Typed text response payload with metadata support.FunctionCallEventData: Typed local function execution request payload (callId,functionName,arguments).ErrorEventData: Typed error payload with machine-readable code and message.ChatRequest: Standardized request payload model for/runtime/chat.FunctionResult: Standardized execution result model for/runtime/function-result(FunctionResult.successandFunctionResult.error).UserFeedback&FeedbackRating: Observability feedback model (👍 / 👎) for/runtime/feedbacksupporting the Observe & Improve cycle.- Enhanced
InfriaClientwith typed methods:sendChat(),submitFunctionResult(), andsubmitFeedback().
- Engineering Task Roadmap:
- Added and updated
TASKS.mdto track 6 developmental phases with inclusive conversational UX & health services showcase.
- Added and updated
- Unit Test Suite Expansion:
- Added unit tests for
InfriaConfig,InfriaException,HttpTransport,ChatRequest,RuntimeEvent,FunctionResult, andUserFeedback. - Total test suite expanded to 40 passing tests.
- Added unit tests for
[0.1.0] - 2026-08-30 #
Added #
- Initial UI Prototype Release:
InfriaChat: Ready-to-use Flutter chat interface widget with support for custom headers, custom message bubble builders, and input builders.ChatController: Reactive state management built on FlutterChangeNotifierfor handling messages and prototype AI response simulation.ChatMessage&ChatMessageRole: Immutable data models for user and assistant messages with unique IDs and timestamps.InfriaChatTheme: Complete styling system withlight()anddark()presets, bubble colors, border radius, text styles, and avatar customization.InfriaChatFloatingButton: Floating action button with active badge dot to launch chat anywhere via bottom sheet or modal dialog.showInfriaChatBottomSheet&showInfriaChatDialog: Modal presentation overlay helpers.ChatMessageList&ChatMessageBubble: Auto-scrolling message list with custom bubbles and avatar support.TypingIndicator: Animated 3-dot pulsing loading indicator for assistant responses.example/: Comprehensive multi-screen demo application showcasing Dashboard FAB, Fullscreen Chat, and Custom Builders.- Initial unit and widget test suite (12 passing tests).