agents_flutter 0.6.1
agents_flutter: ^0.6.1 copied to clipboard
Flutter integration for the agents framework: a preconfigured harness agent, device-capability context providers and tools, chat history persistence, and configurable model profiles.
Changelog #
0.6.1 #
HeadlessWebViewPageLoaderaccepts an optionaluserAgent, sent with every page load in place of the platform WebView's default. Hosts opt in explicitly (for example from a user-managed profile); when omitted, behavior is unchanged and the system default is sent.
0.6.0 #
- Query-aware ranking (Phase 3 of the web evidence plan) completes the
four-tool web surface:
open_web_pageaccepts an optionalobjective; the returnedcontentis then the blocks most relevant to that question — ranked by a BM25-style lexical scorer with heading-path credit, block-type weights (tables and definitions boosted for numeric questions), and a positional prior — instead of the page's lead content. AFocused on:header line and[…]gap markers keep the selection honest; an unmatched objective falls back to lead content with a note.- Adjacency grouping: a selected block always brings the headings
above it and a short intro paragraph directly before it, so a bare
$25table row never travels without its "Fees" heading. - New
find_in_page(pageId, query)function ranks a cached page's blocks for a new question and returns the best matches with theirb<n>ids; unmatched queries return the outline instead of guesses. - Repeated blocks are marked
duplicateOfand skipped in rendering and ranking (duplicateBlockscount on page results), so syndication banners and print footers are never mistaken for independent confirmation. BlockScorerseam (FlutterHarnessAgentOptions.webBlockScorer,createWebSearchTools(blockScorer:)) lets hosts substitute a semantic scorer later; scores stay internal and are never exposed to the model.
0.5.0 #
- Page sessions and the escalation loop (Phase 2 of the web evidence
plan): opened pages are cached per tool set so agents can pull more of
a page without reloading it.
WebPageSessionStore— a small LRU (default 8 pages, configurable viaWebSearchToolOptions.maxCachedPages) created percreateWebSearchToolscall, sopage-Nids are scoped to one agent build and never leak across conversations. Reopening a URL replaces its earlier entry.open_web_pageresults now include apageIdfor block-bearing loads, and its description teaches the loop: package → outline →expand_page.- New
expand_page(pageId, blockIds?, heading?)function returns the full text of chosen blocks or a whole outline section, each run prefixed with itsUnder: A > Bheading context. Expired ids get a "reopen the URL" result; malformed requests return the outline to steer the next call. Budget caps are reported, never silent.
0.4.0 #
open_web_pagereturns structured evidence packages (Phase 1 of the web evidence plan,doc/WEB_EVIDENCE_PLAN.md). The extraction script is now a thin DOM walker emitting typed blocks; Dart classifies them, assigns heading paths, builds the page outline, and renders compact markdown:WebPageContentgainsblocks(WebContentBlockwith heading paths, links, and table cells),outline,structuredData(JSON-LD, labeled by origin),siteName/publishedTime/modifiedTime/author,contentMarkdown, andomittedBlocks/boilerplateBlockscounts.- Tool results carry
contentmarkdown plus anoutlinewithb<n>block ranges instead of flattext; the flat shape remains the fallback when block extraction yields nothing. Navigation, header, footer, and aside chrome is suppressed from the markdown and counted, never silently dropped; in-script caps and the character budget are reported throughomittedBlocksandtruncated. WebPageLoader's interface is unchanged and all newWebPageContentfields are additive with defaults.
0.3.1 #
- Focus-category search routing for the local
web_searchfunction:FlutterHarnessAgentOptions.webSearchSourcesByCategory(and the matchingcreateWebSearchToolsandaddFlutterHarnessContextparameters) maps category labels — "finance", "technology" — to dedicated search sources. The labels become an enum on the function'scategoryparameter so the model can steer a query to the source suited to its topic; they are the only part of the host's search configuration the model sees. Uncategorized calls usewebSearchSource; with no default source,categoryis required.
0.3.0 #
- Add vendor-neutral local web search and direct page-opening tools for the
Flutter harness.
open_web_pagerenders JavaScript in an isolated, incognito headless WebView, extracts readable text and metadata, and applies a configurable public-network navigation policy. - A configured local search source replaces the hosted web-search marker. A
page loader may instead add only
open_web_pagewhile retaining hosted search. Both retain the existing per-agent web-search access gate. - Add native headless page loading on Android, iOS, macOS, and Windows using
flutter_inappwebview, with structured timeout, navigation, HTTP, loading, empty-content, and challenge-detection results. Flutter web reports the capability as unsupported.
0.2.1 #
- Pushover as a harness capability with per-agent gating:
FlutterHarnessAgentOptions.pushoverClient(pluspushoverToolOptions) — when a host attaches a configuredPushoverClient, the harness adds the Pushover tools. Client-gated rather than flag-gated: the tools send real notifications, so they exist exactly when the host attached a client.AgentAccessConfig.enablePushover— opt-in per saved agent,falseby default.ConfiguredAgentFactorystrips the client from agents that have an access record without the opt-in, wherever the client was attached; agents without an access record keep the harness default.createPushoverToolsandPushoverToolOptions— builds the send, quota, and receipt tool set from one configuration.
0.2.0 #
- Require
agents: ^1.6.0, including the new live shell output stream and callback APIs and persistent-shell stderr capture.
0.1.0 #
First public release. Flutter integration layer for the
agents framework.
FlutterHarnessAgent— a one-callHarnessAgentpreconfigured with the Flutter capabilities, compaction, function invocation, and per-call chat history persistence. Reachable from aChatClientviaasFlutterHarnessAgent(...), or through dependency injection withaddFlutterHarness(...)/useFlutterHarnessAgent(...).- Device-capability context providers and tools, each registrable on a
ServiceCollectionor directly onChatClientAgentOptions:- Temporal —
TemporalContextProviderplus theget_current_timetool. - Connectivity —
ConnectivityContextProvider(withConnectivityMonitor) plus theget_connectivitytool. - Device and app info —
DeviceContextProvider,get_device_info, andget_app_info, withDeviceInfoHostedServiceandPackageInfoHostedServicefor the DI path. - Location —
LocationContextProvider,get_current_location, andgeocode_address. - Network —
NetworkContextProviderandget_current_network_info. - Wake lock — the
set_wake_locktool. - Pushover —
PushoverClientplus thesend_pushover_notification,get_pushover_limits, andcheck_pushover_receipttools, registrable withaddPushover(...). Credentials stay out of the tool schema, so a model chooses what a notification says but never who receives it. Supports multipart image attachments, resolved from a model-supplied reference through a host-providedPushoverAttachmentResolver, and end-to-end encryption viaPushoverAesEncryptor.
- Temporal —
- Configured agents (
configured_agents/):ConfiguredAgentsManager,ConfiguredAgentFactory,AgentScope, and persistentAgentConfigurationStore/ModelSourceStorefor defining and switching agents at runtime. - Model profiles (
configured_agents/model_profile/): per-model chat and tool-call formats (Hermes, Llama 3, Mistral, LFM2), streaming tool-call decoding, think-tag filtering, GGUF metadata inspection, andOpenAiCompatibleChatClient. - Chat history persistence:
FlutterChatHistoryProvider,ChatMessageCodec, and stale tool-result redaction. - Storage and memory built on
sembast:RecordStorewith in-memory and sembast backends,RecordStoreAgentFileStore, andRecordStoreVectorStorewith a memory scorer. - Downloads:
DownloadServicebacked bybackground_downloader, plus a Hugging Face API client and model downloader. - Logging:
AppLogStore, anAppLogStoreLoggerProvider, andAgentTrafficLoggingAgentfor recording agent request/response traffic. - Chat client decorators:
UsageTrackingChatClientandTextFileInliningChatClient. - A2A pairing helpers under
a2a/. - Adaptive layout widgets under
layout/.