Skip to content

Add Migration Plan#721

Closed
gspencergoog wants to merge 18 commits intomainfrom
feature/v0.9-migration
Closed

Add Migration Plan#721
gspencergoog wants to merge 18 commits intomainfrom
feature/v0.9-migration

Conversation

@gspencergoog
Copy link
Collaborator

Description

A giant change to move to A2UI 0.9 from 0.8 and integrate the "Bring your own LLM" API.

gemini-code-assist[bot]

This comment was marked as resolved.

@gspencergoog gspencergoog force-pushed the feature/v0.9-migration branch from e59b54e to c472f35 Compare February 14, 2026 01:15
Removed the following legacy packages:
- packages/genui_dartantic
- packages/genui_firebase_ai
- packages/genui_google_generative_ai

Removed legacy examples:
- packages/genui_a2ui/example
- examples/custom_backend (if confirmed)
- packages/json_schema_builder: Migrated from `print` to `package:logging` for better output control.
- tool/test_and_fix: Migrated from `print` to `package:logging`.
Major refactor of the GenUI core framework to align with the A2UI v0.9 protocol.

Key changes:
- Catalog:
  - Renamed `CoreCatalog` to `BasicCatalog` and moved widgets to `basic_catalog_widgets`.
  - Implemented new A2UI v0.9 compatible widgets (AudioPlayer, Button, CheckBox, etc.).
- Architecture:
  - Introduced `SurfaceController`, `SurfaceRegistry`, and `DataModelStore` for better state management.
  - Added `PromptBuilder` and `Conversation` facade for simplified API usage.
  - Implemented `ExpressionParser` and function resolution logic.
- Transport:
  - Added `A2uiTransportAdapter` and `A2uiParserTransformer` for handling A2UI messages.
- Cleanup:
  - Removed legacy `ContentGenerator`, `UiTools`, and other obsolete core classes.
  - Deleted documentation and examples that are no longer relevant.
- Submodules:
  - Added `submodules/a2ui`.
Updated `genui_a2ui` to use the new `genui` core architecture.
- Removed `A2uiContentGenerator` (replaced by `A2uiAgentConnector` usage in `genui` core).
- Updated `A2uiAgentConnector` to work with the new `SurfaceController` and `Transport` interfaces.
- Added `logging_utils.dart`.
- General cleanup and modernization.
- catalog_gallery:
  - Added comprehensive samples for various scenarios (e-commerce, dashboard, etc.).
  - Updated tests and added integration tests.
  - Updated macOS/iOS build configurations.
- simple_chat:
  - Refactored to use new `ai_client` and `chat_session`.
  - Added integration tests.
- travel_app:
  - Refactored to use new `ai_client` structure.
  - Added Google Generative AI client implementation.
- Added comprehensive documentation:
  - `docs/DESIGN.md`
  - `docs/REVIEWING_GUIDE.md`
  - `docs/migration_0.7.0_to_0.8.0.md`
  - Architecture diagrams and assets.
- Updated configuration:
  - `.github/workflows/flutter_packages.yaml`
  - `analysis_options.yaml`
  - `README.md`
@gspencergoog gspencergoog force-pushed the feature/v0.9-migration branch from c472f35 to 866d779 Compare February 14, 2026 01:38
gemini-code-assist[bot]

This comment was marked as resolved.

gspencergoog and others added 8 commits February 13, 2026 18:04
- Remove `ToolStartEvent`, `ToolEndEvent`, `TokenUsageEvent`, and `ThinkingEvent` from `genui` package.
- Move removed events to `travel_app` as `AiGenerationEvent` subclasses, as they are specific to the `GoogleGenerativeAiClient` implementation there.
- Rename `registerStandardFunctions` to `registerBasicFunctions` in `FunctionRegistry`.
- Update `Design_Proposal.md`.
- Minor cleanup in `SurfaceController` and `A2uiMessage`.
…alogId

- Changed `SurfaceContext.catalogs` (Iterable) to `SurfaceContext.catalog` (Catalog?).
- Updated `SurfaceDefinition.catalogId` to be non-nullable, defaulting to `basicCatalogId`.
- Updated `SurfaceController` to handle non-nullable `catalogId` and implement `SurfaceContext.catalog`.
- Updated `Surface` widget to use `SurfaceContext.catalog` directly.
- Updated tests to reflect API changes.
…elegate.

- Moved modal showing logic to `Modal` component using an `ElevatedButton` trigger.
- Removed `showModal` handling from `DefaultActionDelegate`.
- Updated tests to reflect the new `Modal` behavior.
- Applied formatting fixes.
Adding version numbers to examples in based_catalog_embed.dart
Removed `watchSurface` from `SurfaceHost` and `SurfaceController` as it was
redundant. Usages should replace `watchSurface(id)` with
`contextFor(id).definition`.

Refactored `genui` package and `examples/verdure` to use the new pattern.
Updated documentation and tests.
@gspencergoog gspencergoog force-pushed the feature/v0.9-migration branch from e22c986 to 6e61463 Compare February 18, 2026 18:53
Introduces AiClientTransport to bridge AiClient and Conversation.
Refactors ChatSession to use Conversation for state management and wiring.
This major refactor elevates client-side functions from a global, static registry to first-class citizens within the `Catalog` system, enabling modularity, versioning, and reactive data flow.

Key Changes:

1.  **Reactive `ClientFunction` Interface**:
    -   Defined `ClientFunction` interface in `interfaces/client_function.dart` which returns `Stream<Object?>`, allowing functions to push updates (e.g., clock, network status).
    -   Introduced `SynchronousClientFunction` base class for functions that don't need reactivity, replacing the old `SimpleClientFunction` concept.
    -   Renamed `SimpleClientFunction` to `SynchronousClientFunction` and its `call` method to `executeSync` to clearly indicate synchronous execution.

2.  **Catalog Integration**:
    -   Updated `Catalog` to include a `functions` registry, similar to components.
    -   Moved standard functions (e.g., `len`, `formatString`, `add`) from the global `FunctionRegistry` to `BasicCatalog` in `catalog/basic_functions.dart`.
    -   Deleted the global `FunctionRegistry` (`functions/functions.dart`) to enforce catalog-based lookup.

3.  **Context-Aware `ExpressionParser`**:
    -   Updated `ExpressionParser` to resolve functions via `DataContext` (which aggregates functions from catalogs) instead of a global static map.
    -   Renamed `evaluateCondition` to `evaluateConditionSync` to strictly denote synchronous boolean evaluation and prevent "truthy stream" bugs.
    -   Implemented strict recursion depth checks (`RecursionExpectedException`) in `evaluateFunctionCall`, `_evaluate`, and `parse` to prevent infinite loops in reactive chains.

4.  **Validation Logic Extraction**:
    -   Extracted reusable stream-based validation logic into `ValidationHelper` (`utils/validation_helper.dart`).
    -   Updated `DateTimeInput` and `TextField` widgets to use `ValidationHelper`, simplifying their implementation and reducing code duplication.

5.  **Dependencies**:
    -   Added `rxdart` to `pubspec.yaml` to support complex stream combinations in `ValidationHelper`.

BREAKING CHANGES:
-   `SimpleClientFunction` is renamed to `SynchronousClientFunction`.
-   `ClientFunction.call` is renamed to `executeSync`.
-   `ExpressionParser.evaluateCondition` is renamed to `evaluateConditionSync`.
-   Global `FunctionRegistry` is removed; functions must now be registered in a `Catalog`.
-   `ExpressionParser` methods now require `DataContext` for function resolution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments