tandem_generator 0.4.0
tandem_generator: ^0.4.0 copied to clipboard
Generates the code behind Tandem with build_runner. It turns the data and methods a class lists for an AI agent into JSON Schemas and tools, and your widgets into A2UI components.
0.4.0 #
- Breaking: Upgrade
tandemto 0.4.0 and rundart run build_runner buildagain. - The builder writes an enum of the methods a class lists next to its mixin, such as
OrderCubitTool, and eachAgentToolnames its method with it. A value'svalueandtoString()give the name the agent calls, such asset_quantity. - The build fails, naming both, when two listed methods would be the same member of the enum, or when the class's library already declares the enum's name.
example/example.mdshows the enum in the generatedAgentTooland how an app matches it.- The description and topics on pub.dev say what the builder writes and name GenUI and A2UI.
0.3.1 #
Generation #
@TandemAgentuses its ownconverters:even when another annotation on the same class also declares converters.- A catalog widget keeps its constructor default for a child widget or a nonempty list of children. The build names the property and leaves it out of the catalog so the widget supplies its default.
- The build rejects two getters or two methods with the same agent name and names both Dart members. Before, names such as
setUrlandsetURLboth generated the toolset_url. - The build rejects app methods whose tool names start with
tandem_, the prefix reserved for Tandem tools. - A catalog that lists an abstract widget fails at build time. Before, the generated code tried to construct the widget and failed to compile.
- Agent descriptions and catalog guidelines preserve Markdown list items and fenced code blocks from doc comments.
- Generated code preserves a literal
$in identifiers such as field, getter and parameter names.
Diagnostics #
- An object parameter no longer triggers a build warning when the generator cannot find its type in
.sees. At runtime its path must still point to a current value of the required type. - Build errors explain when
agentCapabilitiesmust be a getter and name a converter whose output type Tandem cannot describe. - Catalog errors explain how to handle a required
Key,FocusNodeorChangeNotifierthat the agent cannot set. - Catalog example errors identify a non-string
idorcomponentand numbers too large for adouble.
Package documentation #
- The README describes how Tandem 0.3.2 writes local date-times with their offset and reads a time with an offset or
Zas the same instant in local time. - The README explains that a
Uriargument must have a scheme. - The README describes how ag-ui-adk converts nullable schemas for Gemini without tying the explanation to version 0.9.0.
- The package page on pub.dev links to the Tandem website.
0.3.0 #
- Breaking: Upgrade
tandemto 0.3.0 and rundart run build_runner buildagain. - Breaking: Mark an object parameter with
@TandemInput()when the agent should create it; otherwise list the objects it chooses from with.sees. - Breaking: Keep
agentCapabilitiesfree ofsuper, and write each.seesin that getter. - Breaking: Match constructor parameter and getter types in classes Tandem reads from their constructors.
- Breaking: Supply a
JsonConverterfor Flutter values without a built-in form instead of relying on constructor and getter serialization. @TandemCatalog([...])generates a catalog from the app's widget constructors, including children, actions and fields. Its doc comment supplies guidelines and an example whose component and property names are checked during the build.converters:on@TandemAgentand@TandemCatalogacceptsJsonConverter<T, S>values for types the app wants to describe differently..seesmay stand inside anif, aswitchor a spread, so the agent list can follow the route.- Supported types include
Uri,Set<T>, token classes and classes with concrete generic type arguments. - List parameters accept nullable elements and nested lists.
- A parameter's default may be a
static constmember of its class. - Dependency bounds accept analyzer 13.3 and source_gen 4.2.4, allowing apps using auto_route_generator 10.6 to resolve.
0.2.1 #
- An enum with its own
namefield reaches the agent by the name of its constant. Before, the generated code sent the field's value. - The example shows the order form of Tandem's example app.
0.2.0 #
- A description joins the wrapped lines of its doc comment and keeps its paragraphs, so the agent reads whole sentences.
- A method can return
Future<T>?orFutureOr<T>?. When it returns null, the agent gets null as the result.
0.1.0 #
- Generates the
_$Namemixin of a class with@TandemAgent(): the names, doc comments and JSON Schemas of what itsagentCapabilitieslist. - Parameters, results and
.seesvalues can beString,bool,int,double,num,DateTime, enums, extension types overString,int,double,numorbool,List<T>and plain classes. Any other type fails the build, which names the type and where it is. - The schema of a nullable parameter is
anyOfthe schema of its type and{"type": "null"}.