infria 0.1.2 copy "infria: ^0.1.2" to clipboard
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 init and infria use CLI commands to prompt for Public API Key (infria_pk_...) with direct navigation links to the Web Console (https://dashinfria.vercel.app/<projectId>/sdk).
  • Added projectId to ChatRequest.toJson() to ensure strict compliance with backend Zod validator requirements.
  • Enhanced HTTP error response parsing in HttpTransport and RuntimeEvent to safely handle nested error maps without type casting errors.
  • Added real-time HTTP request/response debug logging under kDebugMode in HttpTransport.
  • Cleaned all emojis across documentation and CLI outputs for enterprise standard presentation.

0.1.1 - 2026-09-02 #

Documentation #

  • Updated README.md to 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 (and Infria alias): 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 holding projectId, apiKey, baseUrl, timeout, and customHeaders.
    • infria CLI tool (bin/infria.dart): Standalone developer CLI supporting infria login (Live Google Popup Auth), infria init (Interactive project selector & non-destructive options generator), infria current, infria use, and infria 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 holding projectId, apiKey, baseUrl, timeout, and customHeaders.
    • InfriaSDK (and Infria alias): Top-level singleton facade enabling one-line initialization (await InfriaSDK.initializeApp(options: DefaultInfriaOptions.currentPlatform)) and direct callback registration (InfriaSDK.onFunctionCall('request_refund', handler)).
    • ChatController auto-binding: Seamlessly resolves to the active InfriaSDK.instance when constructed without an explicit client argument.
    • infria CLI tool (bin/infria.dart): Interactive terminal tool supporting dart run infria login, dart run infria init (with interactive project selector and automatic lib/infria_options.dart code generation), and dart run infria projects.
    • Exported executables: infria: infria in pubspec.yaml for global CLI invocation.
    • Comprehensive unit test suites in test/infria_sdk_test.dart and test/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() and FunctionRegistry.toSchemasJson() for OpenAPI / Gemini FunctionDeclaration schema compatibility.
    • Updated ChatRequest and InfriaClient.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.dart and test/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.dart to showcase a complete Healthcare/Puskesmas Navigation Assistant (PKM-KI use case):
      • Integrated with InfriaClient and real registered dynamic functions: check_queue_status (SIMRS queue check), get_doctor_schedule (specialist doctor schedule), get_bpjs_referral_status (BPJS validity), and cancel_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).
    • Enhanced InfriaChatFloatingButton, showInfriaChatBottomSheet, and showInfriaChatDialog to seamlessly accept suggestions, enableFeedback, and onFeedback.
    • Updated pubspec.yaml with pub.dev repository, issue tracker, topics, and detailed description.
    • Rewrote README.md with 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 analyze issues.
  • 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).
    • InfriaChat Updates: Added suggestions, enableFeedback, and onFeedback support with seamless integration into ChatMessageList and ChatMessageBubble.
    • 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 expanded test/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.
    • ChatController Upgrades:
      • Integrated with InfriaClient and SessionManager for full live AI chat support.
      • Updated ChatStatus state machine: idle, sending, executingFunction, and error.
      • Automated Round-Trip Function Calling: seamlessly detects function_call event $\rightarrow$ updates status to executingFunction $\rightarrow$ runs local handler $\rightarrow$ submits result $\rightarrow$ appends final AI response without manual code from developers.
      • Added unhandled error callback onError and graceful inline chat error messages.
      • Retained offline prototype fallback mode for preview and decoupled testing.
    • ChatMessage Updates: Added optional metadata field for storing citations, model metadata, and backend payloads.
    • Exported session_manager.dart in lib/infria.dart.
    • Added unit test suites test/session_manager_test.dart and expanded test/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 with register(), registerDefinition(), unregister(), has(), and get().
    • RegisteredFunction: Metadata model containing function name, FunctionHandler callback signature (FutureOr<dynamic> Function(Map<String, dynamic>)), description, and requiresConfirmation flag.
    • FunctionExecutor: Safe execution dispatcher with automated argument validation, configurable timeout protection (defaultTimeout), and standardized error codes (FUNCTION_NOT_REGISTERED, FUNCTION_EXECUTION_ERROR, FUNCTION_TIMEOUT).
    • InfriaClient Updates:
      • Added registerFunction(), unregisterFunction(), and hasFunction().
      • Added executeFunctionCall() to safely execute incoming function_call runtime 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.
    • Exported function_registry.dart and function_executor.dart in lib/infria.dart.
    • Added unit test suites test/function_registry_test.dart and test/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 with projectId, public apiKey (inf_pub_xxx), baseUrl, timeout, and customHeaders.
    • InfriaException Hierarchy:
      • 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 optional Retry-After duration parsing.
      • InfriaNetworkException: Handles connection timeouts and socket/connectivity errors.
      • InfriaConfigurationException: Handles invalid configuration parameters.
    • HttpTransport: Cross-platform HTTP layer using package:http with automatic authentication headers (x-infria-project-id, x-infria-api-key, Content-Type: application/json) and injectable client for unit testing.
    • InfriaClient (with Infria alias): Main public SDK client providing sendChatMessage() and sendFunctionResult() API methods.
  • Runtime Protocol Envelope & Event Parser (Phase 2):
    • RuntimeEvent & RuntimeEventType: Standardized envelope parsing for message, 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.success and FunctionResult.error).
    • UserFeedback & FeedbackRating: Observability feedback model (👍 / 👎) for /runtime/feedback supporting the Observe & Improve cycle.
    • Enhanced InfriaClient with typed methods: sendChat(), submitFunctionResult(), and submitFeedback().
  • Engineering Task Roadmap:
    • Added and updated TASKS.md to track 6 developmental phases with inclusive conversational UX & health services showcase.
  • Unit Test Suite Expansion:
    • Added unit tests for InfriaConfig, InfriaException, HttpTransport, ChatRequest, RuntimeEvent, FunctionResult, and UserFeedback.
    • Total test suite expanded to 40 passing tests.

[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 Flutter ChangeNotifier for 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 with light() and dark() 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).
1
likes
160
points
130
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A clean, customizable Flutter UI SDK and runtime controller for AI chat interfaces, RAG, and dynamic client-side function calling.

Homepage
Repository (GitHub)
View/report issues

Topics

#ai #chat #flutter #healthcare #llm

License

MIT (license)

Dependencies

flutter, http

More

Packages that depend on infria