antigravity 0.19.0
antigravity: ^0.19.0 copied to clipboard
A native Dart client SDK for Google Antigravity, fully decoupled from the Flutter framework for server, CLI, and mobile compatibility.
0.19.0 #
Syncs with Python SDK v0.1.24 and uses localharness 0.1.24 as the download fallback.
Changed #
LocalAgentConfigdefaults togemini-4-hydrogen.ThinkingLevel.extraHighsendsxhigh. Existing serialized Gemini options containingextra_highstill decode to the same Dart enum value.- Gemini endpoints use
GOOGLE_GEMINI_BASE_URLwhen their explicitbaseUrlis absent or empty. - LiteRT automatically detects vision support and accepts image parts in
prompts.
visionBackendoverrides detection. Responses expose the LiteRT thought channel in both streaming and synchronous completions. - Completed
ChatResponseandWorkflowResultretain structured output, usage, and stop reason across later turns. Starting a new chat waits for the previous turn, including when its chunks have yet to be read. Conversation.compactionIndicesrecords completed root compactions. Structured output comes from the current turn's root finish step.- Local harness and LiteRT startup failures release subprocess resources.
Tool paths collapse lexical
.and..segments before reaching hooks and consumers.
Removed #
- Removed the GAOS Interactions transport and
InteractionsAgentConfigto match upstream. UseLocalAgentConfigfor local harness connections.
0.18.1 #
Changed #
- Added
.pubignorerules to omit files that package consumers do not need, reducing the published package size from approximately 1 MB to 963 KB (about 4%).
0.18.0 #
Syncs with Python SDK v0.1.23.
Added #
agent.beta.runWorkflow(args: {...})passes JSON-encodable input arguments to the workflow script, where they are available asargs. The prompt includes them as JSON, encoded like Python'sjson.dumps. An empty map sends nothing; values that cannot be encoded (including NaN and infinity) throw anArgumentErrorbefore the model is called.CustomSystemInstructions.titlerenders replacement system instructions under<title>tags instead of the generic<System>section. It is sent ascustom.part[].titlefor the main agent and subagents, and omitted when null or empty.normalizeSchemamapsread_only/write_onlytoreadOnly/writeOnly. It also catches up with upstream keywords from earlier releases:multiple_of,exclusive_minimum,exclusive_maximum,prefix_items,property_names,dependent_required,dependent_schemas,unevaluated_properties, andunevaluated_itemsare now converted to camelCase.
Changed #
- Workflow validation follows upstream:
validateWorkflowSourcenow rejectsprint(...)calls (includingbuiltins.print(...)) anywhere in the script, and no longer rejects imports,whileloops,_-prefixed attributes, or__-prefixed names. Top-levelreturnandyieldare still rejected. runWorkflowresolves a relativescriptPathagainst every workspace in order, not only the first.normalizeSchemakeepstitle,description,summary,format,pattern,example,examples, anddependentRequiredvalues as-is, so a description or example of"STRING"is no longer lowercased. The keys ofdependentSchemasare treated as property names, like the keys ofproperties.- Media MIME types are trimmed and lowercased (
' IMAGE/PNG 'becomesimage/png) in theImage,Document,Audio, andVideoconstructors and inMediaContent.fromBytes.fromFileexpands a leading~to the home directory. - Pre-tool hooks normalize path arguments and pick
canonicalPathin one pass, in the fixed order ofwirePathArgumentKeys(now aList). - The LiteRT loopback server script is synced with upstream: it reuses the LiteRT conversation and KV cache across turns, merges consecutive tool messages into one tool turn, applies the default 16,384 output-token and 8,192 thinking-token limits, handles client disconnects, and closes the cached conversation on shutdown.
- Default harness release: 0.1.23.
Tooling #
- Requires Dart SDK 3.13 or later. Dependencies are upgraded (
mcp_dart2.4.3,test1.33.0,build_runner2.16.2) and theanalyzerpin is removed. - The code uses private named initializing formals, null-aware collection
elements, and wildcard
_parameters. - Every public API member now has a doc comment, and the
public_member_api_docslint is enabled so new ones need one too.
0.17.0 #
Syncs with Python SDK v0.1.22.
Added #
GeminiModelOptions.maxOutputTokenssets the per-step output token limit for Gemini and Vertex endpoints (sent asmax_output_tokens). Must be in(0, 2147483647]; when null, the harness default (65,536) applies.eval()keeps it when applyingthinkingLevel.CapabilitiesConfig.mcpMaxOutputBytessets the size at which MCP tool output is spilled to disk instead of inlined (sent asmcp_max_output_bytes). Must be in(0, 2147483647]; when null, the runtime default (4096 bytes) applies.lightweight()keeps it.BuiltinTools.fromValue,normalizeBuiltinToolName, anddeprecatedStartSubagentToolNamefor resolving tool names.InteractionsAgentConfignow sends subagentmodeloverrides as{"model": {"name": ...}}instead of rejecting them.
Changed #
BuiltinTools.startSubagentis nowBuiltinTools.invokeSubagent, with the wire valueinvoke_subagent.startSubagentremains as a deprecated alias.start_subagentis still accepted in serialized capability lists,ToolCall,ToolResult, and policy tool names, and resolves toinvoke_subagent. MCP tools namedstart_subagent(with aserverName) are left unchanged.BuiltinTools.toString()now returns the wire value.- Tool hooks for subagent calls now see
invoke_subagentinstead ofstart_subagent. Update any hook that compares against the old string. - Localharness
skill_lookupsteps are typed asStepType.toolCallwith askill_lookuptool call. Failed lookups keepStepStatus.errorand the error message. - Interactions transport:
- Prompts containing a
SlashCommandare sent asinput_content, so slash commands can be mixed with text and media.input_contentin incoming user input is parsed back into prompt content. - Compaction steps come from
compactionsteps on the step stream (ACTIVE, then DONE) instead of being emitted from theon_compactionhook request. The hook still runs. model_outputsteps described asFinishare emitted asStepType.finish, withstructuredOutputparsed from the JSON text when the step completes.usage_updateevents (flat or nested) add to cumulative and per-trajectory usage.- Tool call IDs are used as step IDs for tool steps, elicitation steps, and
the
pre_tool,post_tool, andon_tool_errorhooks, so hook data matches streamed steps.post_toolno longer reads anerrorfield. - Builtin wire names on tool steps (for example
invoke_subagent) map to SDK tool names; MCP tool names are kept as sent.
- Prompts containing a
- Default harness release: 0.1.22.
0.16.0 #
Syncs with Python SDK v0.1.21.
Added #
InteractionsAgentConfig,InteractionsConnectionStrategy, andInteractionsConnection: the local harness over the GAOS Interactions JSON protocol, with streamed step assembly, client tools, lifecycle hooks, question elicitations, and usage tracking. Triggers,auto()and dynamic policies, and subagentmodeloverrides are rejected; rootinlineSkillsare ignored.InlineSkillandinlineSkillson all local configs. Paths and inline root skills are mutually exclusive.- Subagent skill inheritance, disabling, and path overrides via
SubagentSkillsConfigand its three mode types, accepted directly through the sealedSubagentSkillsOptioninterface. Local inline overrides are rejected, matching upstream. HookRunner(hooks: ...)andregisterHooks, MCPforceAllToolsEager, and numeric-zero identity for usage addition/subtraction.- Experimental
agent.beta.runWorkflow(scriptPath: ...),WorkflowResult,WorkflowProgress, andBuiltinTools.runWorkflow. Workflows execute Python script files in the harness; Dart closures are not transpiled. - Experimental
validateWorkflowSourceandWorkflowExceptioninpackage:antigravity/beta.dart.runWorkflownow rejects imports,whileloops, private attributes, dunder names, and top-levelreturn/yieldbefore contacting the model. The check is lexical; full syntax checking stays with the harness.
Changed #
allowAll()disables harness workspace containment unless paired withworkspaceOnly(...).- Delegation remains enabled if either
startSubagentorrunWorkflowis active. Explicit subagent capabilities now honor default tools and denylists. - Error steps no longer emit text/thought deltas. Empty tool IDs retain the existing correct behavior, now covered by regression tests.
- Harness shutdown waits for exit and reports nonzero status with stderr.
Toolhas readable inspection output; tool runner batches accept iterables.runWorkflowexpands~in script paths and only tries the first workspace for relative paths.- Default harness release: 0.1.21. Generated mappers, tests, skills, README, and workflow example updated.
0.15.0 #
Syncs with Python SDK v0.1.18.
Behavior changes #
- Default tools.
list_directory,search_directory, andfind_fileare now deprecated and off unless you list them inenabledTools. They are no longer indefaultTools(),readOnly(),nondestructive(), orminimal().minimal()is nowrun_command,view_file,create_file, andedit_file. scheduleis on by default. The newBuiltinTools.scheduletool is part ofdefaultTools(),readOnly(), andnondestructive(). To turn it off, add it todisabledTools.manage_taskfollowsrun_commandandschedule. The harness enablesmanage_taskwhenever either tool is active, for the main agent and for subagents.- The harness evaluates policies. Local configs now send
policiesto the harness aspolicy_config.LocalConnectionanswers the harness'spolicy_decision_requestfor dynamic rules (rules with awhenpredicate or anaskUserdecision).Agentno longer registers the client-sideenforce()hook for these configs, so each rule is evaluated, and eachaskUserhandler prompts, once per tool call.enforce()still runs when the agent starts, so invalid policies fail early. run_commandis denied by default. Whenpoliciesis omitted,LocalAgentConfig,LocalOpenAIAgentConfig, andLiteRTAgentConfignow default toconfirmRunCommand(), which deniesrun_commandand allows everything else, as upstream does. Previously the default allowed every tool, includingrun_command. Passpolicies: [allowAll()]to keep the old behavior. An explicitpolicies: []stays empty, so the missing-safety-policy check applies again.- No automatic workspace policy. Local configs no longer add a
workspace()rule for each workspace. That rule was a wildcard allow that never denied anything, and on the wire it cost a round trip to the SDK on every tool call. The harness already restricts file tools to the configuredworkspaces, as upstream does.workspace()is deprecated; useworkspacesorworkspaceOnly(). - Safer terminal prompts.
ToolConfirmationHookandaskUserHandlerstrip ANSI escape sequences and control characters from tool names, arguments, and reasons before printing them.
Added #
-
eval()preset onLocalAgentConfig,LocalOpenAIAgentConfig, andLiteRTAgentConfig, for benchmark and evaluation runs. It:- disables
generate_imageand subagents; - enables daemon commands (
RunCommandConfig(enableDaemons: true)); - applies
allowAll()if you set no policies, andRetryConfig.benchmark()if you set no retry config; - on
LocalAgentConfig, sets text Gemini and Vertex targets toThinkingLevel.high. PassthinkingLevel: nullto leave thinking levels unchanged.
It raises
AntigravityValidationExceptionif a text target already setsthinkingLevel, or if a thinking level is requested onLiteRTAgentConfigorLocalOpenAIAgentConfig. Your ownenabledToolsordisabledToolslist replaces thegenerate_imagedenylist. Dart can't tell an explicitenableSubagents: truefrom the default, so subagents are always disabled. The defaultconfirmRunCommand()rules don't count as policies you set, soeval()replaces them. - disables
-
Auto policy mode.
auto({name, handler, model})returns anAutoPolicy, sent to the harness aspolicy_config.auto_config. The harness's safety assessor checks risky tool calls. Without a handler, flagged calls are denied; with one, you're asked to confirm. Only oneauto()rule is allowed.runInteractiveLoopgives anauto()rule without a handler the terminalaskUserHandler. -
Policy reasons.
deny()andaskUser()acceptreason. It's sent as the rule'sdeny_reason, and it's the denial message and the reason passed to handlers. -
Reasons for ask-user handlers. Handlers can take an optional
reason, either positional ((tc, [String? reason])) or named ((tc, {String reason = ''})), to get the runtime's explanation, such as an auto-mode safety assessment. One-argument handlers still work.executeAskUseris exported for custom integrations. -
SubagentConfig.model. A model name for one subagent, sent ascustom_subagents[].model.name. Subagents still use the agent-level endpoint. -
AgentConfig.evaluatesPoliciesInHarness. True for the local configs. CustomAgentConfigsubclasses default to false and keep client-sideenforce(). -
BuiltinTools.deprecated()returns the three directory tools.
Changed #
safeDefaults()and the write-tool safety check treat the deprecated directory tools as read-only, as upstream does.HarnessDownloader.defaultVersionis0.1.18.- Raised minimum dependency versions:
dart_mappable^4.10.0,mcp_dart^2.4.2, andmeta^1.19.0. Dev dependencies:test^1.32.0,build_runner^2.16.1, anddart_mappable_builder^4.10.0.
Not ported #
- The v0.1.18 release notes also list JSON schema normalization,
ToolRunnercoercion changes, the removal ofmodified_arguments_json, and a service-tier ingestion fix. None of those files changed between v0.1.17 and v0.1.18. Dart already parses unknown service tiers asServiceTier.standard. SpeechAnnotation,Environment.StorageQuota, theExternalClientEventrename, and theSystemInstructionTemplaterestructure are proto-only and don't change SDK behavior.- Upstream
LiteRTAgentConfigapplies the lightweight preset automatically, and has since v0.1.17. The Dart config doesn't; calllightweight()yourself.
0.14.0 #
- Sync with Python SDK v0.1.17:
- Simplified
CompactionConfigto the validatedtokenThresholdfield, retaining the deprecatedcheckpointIntervalTokensgetter for source compatibility. - Added
ToolOutputTruncationConfig,SandboxStatus,UsageMetadatascalar multiplication, andBuiltinTools.defaultTools(). - Updated generated mappers, harness serialization, documentation, and compatibility tests for the new wire shapes.
- Simplified
0.13.0 #
- Sync with Python SDK v0.1.16:
- Context Compaction Policy (
CompactionConfig):- Added
CompactionConfigintypes/compaction.dart, exposingcheckpointIntervalTokens(tokens of history per compaction checkpoint) andmaxContextTokens(hard context-window ceiling), with validation that both are positive and thatcheckpointIntervalTokens <= maxContextTokens. - Retained the deprecated
compactionThresholdalias, which maps tocheckpoint_interval_tokenson the wire and raises on conflicting values. - Added
AgentConfig.compactionConfigandAgentConfig.effectiveCompactionConfig, which resolves the legacyCapabilitiesConfig.compactionThresholdwhen noCompactionConfigis set. - Emitted
compaction_configover the wire (alongside the legacycompaction_threshold) and deprecatedCapabilitiesConfig.compactionThreshold, which now also rejects non-positive values (matching the upstreamgt=0constraint).
- Added
- Lightweight Configuration Preset (
lightweight()):- Added
AgentConfig.lightweight(), implemented onLocalAgentConfig,LocalOpenAIAgentConfig, andLiteRTAgentConfigwith covariant return types. It returns a copy restricted toBuiltinTools.minimal(), withAgentBehavior.minimal, subagents disabled, and a 64 Ki-token compaction checkpoint interval (AgentConfig.lightweightCheckpointIntervalTokens). - The presets act as defaults rather than a wholesale replacement, mirroring upstream: a caller-provided
enabledToolsallowlist wins, a caller-provideddisabledToolslist is subtracted fromBuiltinTools.minimal(), andrunCommandConfig,finishToolSchemaJson, andcompactionConfigare carried over. Resolution lives in the sharedAgentConfig.lightweightCapabilities()andAgentConfig.lightweightCompactionConfig()helpers. - Divergence from Python:
agentBehaviorandenableSubagentsalways take the preset, because Dart cannot distinguish an explicitly-set value from a default on a non-nullable field (Pydantic'smodel_fields_sethas no equivalent). Subagent scoping (maxSubagentDepth,allowedSubagents) is intentionally dropped, sinceCapabilitiesConfigrejects both once subagents are disabled. - Added
BuiltinTools.minimal()(run_command,view_file,create_file,edit_file,list_directory,search_directory) and theAgentBehavior.minimalvariant (AGENT_BEHAVIOR_MINIMALon the wire).
- Added
- Budget Scope (
BudgetScope):- Added the
BudgetScopeenum (LIFETIME,FORWARD_LOOKING) andBudgetConfig.scope(defaults toBudgetScope.lifetime), letting a resumed session budget only the calls and tokens made from that point onwards. budget_configis now emitted only when at least one limit is set, and always carries an explicitscope.
- Added the
- Terminal Command Sandbox on the Wire:
enable_sandboxis now emitted in theharness_side_tools.run_commandproto, soRunCommandConfig.enableSandboxreaches the harness.
- LiteRT Context Ceiling Consolidation:
- Deprecated
LiteRTAgentConfig.maxContextTokensin favour ofcompactionConfig.maxContextTokens, mirroring upstream's removal of the standalone field.LiteRTAgentConfig.effectiveCompactionConfigfolds the legacy value into the shared compaction policy andeffectiveMaxContextTokensexposes the resolved ceiling, so the LiteRT runner and the harness now read one source of truth. Dart keeps the field deprecated rather than removing it outright, matching howcompactionThresholdis handled. - All three local configs now hand
effectiveCompactionConfigto their strategy, matching upstream; the strategy retains its own capability fallback for directly-constructed strategies.
- Deprecated
- Conversation History Seeding:
Conversation(andConversation.create) now accepthistoryto pre-seed steps andmaxHistorySizeas a constructor parameter; compaction indices and cumulative usage are computed over the combined history. (historyalready existed upstream in v0.1.15 and was only documented in v0.1.16; it was previously missing in Dart.)
- Step Usage Metadata Deprecation:
- Deprecated
Step.usageMetadatain favour ofChatResponse.usageMetadatafor per-turn usage andConversation.cumulativeUsagefor the session total. The field remains on the wire and is still read internally.
- Deprecated
- Default Model:
- Updated
defaultModeltogemini-3.8-flash.
- Updated
- Harness Downloader Default Version:
- Updated default upstream
localharnessbinary download version inHarnessDownloaderto0.1.16.
- Updated default upstream
- Not ported (no Dart counterpart):
- Upstream's
ToolRunnersupport for callable-class and dataclass tools relies on Python reflection (typing.get_type_hintsover__call__); Dart tools are explicitTool(name:, schema:, handler:)values with nothing to introspect. - Upstream's new
struct_converterand the dependentevent_processorbranch convertgenai.Contentand proto-message tool results intogoogle.protobuf.Struct. Dart has nogenaidependency and tool results are plain Dart values, so the existing media extraction path already covers this. - Vertex AI Express Mode (
vertex: truewithapiKey) already shipped in Dart 0.10.0.
- Upstream's
- Examples:
- Added
example/getting_started/compaction.dart,example/getting_started/sandboxing.dart, andexample/getting_started/vertex.dart(Express and Standard Vertex AI modes, configured viaPlatform.environmentrather than an argument parser, matching existing Dart examples). - Added a
BudgetScope.forwardLookingsession-resume demo toexample/getting_started/budget_limits.dart. example/getting_started/subagents.dartnow relies on subagents being enabled by default and exposesexample/resources/as the workspace for all three demos, replacing the temporary directories and synthetictarget_code.dart/design.md/perf_data.txtfixtures. The static reviewer audits the bundledmcp_server.dart, and the nested hierarchy fact-checksmcp_server.dartandsample_doc.txt.
- Added
- Context Compaction Policy (
0.12.0 #
- Sync with Python SDK v0.1.15:
- Stop Lifecycle Hook (
StopHook):- Added
StopHook,StopDecision,StopHookResult, andStopArgsfor intercepting turn completion when the agent reaches idle. - Enables inspecting the assistant's final response and deciding whether to allow the turn to finish (
StopDecision.allowStop) or continue execution (StopDecision.continueTurn) with an injected feedback system prompt. - Added
HookRunner.dispatchStopand wiredLIFECYCLE_HOOK_STOPthroughHookRouter, preserving turn context across continuation cycles. - Followed Dart language heuristics: mapped Python
StopDecision.CONTINUEtoStopDecision.continueTurn(sincecontinueis a reserved control flow keyword in Dart) while maintaining exact wire compatibility (CONTINUEon the wire, supporting both prefixed and bare values).
- Added
- Terminal Command Sandbox Configuration (
enableSandbox):- Added
enableSandboxproperty toRunCommandConfig(defaults tofalse). - Propagated
enable_sandboxintolocalharnessharness_side_tools.run_commandconfiguration over the wire, allowing opt-in execution within OS-level sandboxing (exebox).
- Added
- Universal JSON Schema Normalization (
normalizeSchema):- Added
normalizeSchemainschema_utils.dartto canonicalize custom tool input schemas before wire transmission. - Recursively normalizes uppercase type names (
STRING,OBJECT, etc.) to standard lowercase OpenAPI/JSON Schema strings (string,object), converts snake_case combiners and attributes (any_of,additional_properties, etc.) to camelCase (anyOf,additionalProperties), and preserves literal constraints (enum,const,default). - Eliminates HTTP 400 Bad Request schema validation errors when targeting local OpenAI-compatible inference endpoints (Ollama, LM Studio, vLLM).
- Added
- Tool Execution Metadata Preservation:
- Added
serverNametoToolResultand preservedid,callId,stepId, andserverNameacross allToolResultexecutions, error handlers, and internal SDK fallback responses.
- Added
- Interactive CLI Execution Behavior:
- Updated
runInteractiveLoopininteractive.dartto ensurecapabilities.agentBehavioris explicitly set toAgentBehavior.interactive.
- Updated
- Harness Downloader Default Version:
- Updated default upstream
localharnessbinary download version inHarnessDownloaderto0.1.15.
- Updated default upstream
- Stop Lifecycle Hook (
0.11.0 #
- Sync with Python SDK v0.1.14:
- Workspace Path Normalization:
- Added
normalizeWorkspacePathandnormalizeWorkspacePathsinlocal_connection_config.dartto expand~, normalizefile:///URIs, and resolve relative workspace paths against the current working directory to absolute filesystem paths. - Updated
BaseLocalAgentConfigandLocalConnectionStrategyto canonicalize all workspace directories before transmitting tolocalharness, preventing incorrect resolution againstappDataDir.
- Added
- Compaction Lifecycle Hook:
- Added
LIFECYCLE_HOOK_ON_COMPACTIONsupport toHookRouterand enabled hooks payload inLocalConnection. - Removed duplicate compaction hook dispatches from raw streaming
StepUpdateevents, ensuringOnCompactionHookhandlers fire exactly once per compaction event. This matches the upstream fix, which routes compaction solely through the lifecycle hook RPC.
- Added
- Compaction index de-duplication (Dart-only, no Python counterpart):
- Added a
Conversationsafeguard that de-duplicatescompactionIndicesby compaction step identity (wireid, elsetrajectoryId:stepIndex). The Python SDK appends compaction indices unconditionally and relies on the harness emitting a singleCOMPACTIONstep per event; this guard keeps the count correct if successiveACTIVE/DONEupdates arrive for the same step. It is a deliberate divergence, not a port.
- Added a
- Vertex AI authentication override:
- Verified against the upstream
VertexEndpointand thelocalharnessproto contract: the accepted resolution was theapi_key(Express Mode) field, and there is noauthfield in either the Python model or the wire message. Dart already shipped this in v0.10.0, so is satisfied without further work in this release.
- Verified against the upstream
- Subagent Custom Tools Scoping & Discovery:
- Added
AgentConfig.getAllCustomTools()to automatically collect and register custom callable tools across the main agent and subagents, detecting name collisions early. - Added support for subagent-exclusive tools and resolved tool definitions automatically in
LocalConnectionStrategy._buildHarnessConfig().
- Added
- Harness Downloader Default Version:
- Updated default upstream
localharnessbinary download version inHarnessDownloaderto0.1.14.
- Updated default upstream
- Workspace Path Normalization:
0.10.0 #
- Sync with Python SDK v0.1.13:
- Pre-Tool Hook Argument Modification:
- Pre-tool lifecycle hooks can now inspect, sanitize, and modify tool input arguments prior to execution by returning
HookResult(allow: true, modifiedArgs: {...}). - Added sequential argument modification chaining across registered
PreToolCallDecideHookinstances inHookRunner.dispatchPreToolCall. - Updated
HookRouterto emitmodified_arguments_jsoninPreToolResultfor harness-side tool authorization.
- Pre-tool lifecycle hooks can now inspect, sanitize, and modify tool input arguments prior to execution by returning
- Tool Lifecycle Step Correlation (
stepId):- Added
stepId(@MappableField(key: 'step_id')) toToolCallandToolResult. - Added
stepIdparameter and property toToolExecutionException. - Updated
HookRouterto extract and correlatestepId(trajectory_id:step_index) across pre-tool, post-tool, and on-tool-error lifecycle hooks.
- Added
- Structured Command Execution Configuration (
RunCommandConfig):- Introduced
RunCommandConfigto configure execution timeouts (timeoutSeconds) and authorize background daemon commands (enableDaemons). - Added
runCommandConfigproperty toCapabilitiesConfigandSubagentCapabilities. - Mapped
RunCommandConfigtolocalharnessharness_side_tools.run_commandconfiguration (enable_daemon_commandsandmax_timeout_ms).
- Introduced
- Vertex AI Custom Base URL Support:
- Updated
VertexEndpointto avoid hydrating ambientGOOGLE_CLOUD_PROJECTandGOOGLE_CLOUD_LOCATIONenvironment variables when a custombaseUrlis specified.
- Updated
- Harness & Binary Discovery:
- Updated default
localharnessbinary download version inHarnessDownloaderto0.1.13.
- Updated default
- Pre-Tool Hook Argument Modification:
0.9.2 #
- Fix
RetryConfigSerialization:ModelAPIRetryConfig.toMap()/toJson()(and anyRetryConfigcontaining one) threwMapperException: Unknown type Durationand emitted a spuriousinitial_sleep_durationkey thatlocalharnessrejects. TheinitialSleepDurationDurationis a convenience argument, not a wire field, but was being generated as one.- Added
ModelAPIRetryConfig.raw()as the@MappableConstructor(), so only the integerinitialSleepDurationMsis serialized. The unnamed constructor still accepts eitherinitialSleepDurationMsorinitialSleepDuration.
- Fix Subagent Tool Protobuf Naming:
- Corrected
harness_side_toolsfield names for subagents inLocalConnectionStrategy("file_edit"and"write_to_file", matchinglocalharness.proto), resolvingunknown field "edit_file"errors when launching static subagents.
- Corrected
- CI & Example Automation:
- Added non-interactive terminal fallback (
stdin.hasTerminal) toexample/getting_started/human_in_the_loop.dartto prevent test runs from blocking on headless standard input.
- Added non-interactive terminal fallback (
0.9.1 #
- Critical Bug Fixes for Local Harness Execution:
- Trajectory Idle State Recognition: Added support for
STATE_FULLY_IDLE(andFULLY_IDLE) inLocalConnectiontrajectory state updates, properly emitting theidle_sentinelstep and preventingagent.chat()/response.text()from hanging at turn completion. - Tool Authorization Handshake: Added handler for
LIFECYCLE_HOOK_PRE_TOOL/PRE_TOOLinHookRouter, returning validpre_tool_resultdecisions (ALLOW/DENY) to the harness and resolving tool execution deadlocks. - Wire Path Normalization: Added wire-format URI normalization (
file:///,cns://) for tool call arguments inHookRouterto support path-based safety policies and canonical workspace containment.
- Trajectory Idle State Recognition: Added support for
0.9.0 #
- Sync with Python SDK v0.1.11:
- Default Model Upgrade to Gemini 3.7 Flash: Updated default generative text model in
lib/src/models.darttogemini-3.7-flash. - Session Budget Enforcement (
BudgetConfig) & Stop Reasons (StopReason):- Introduced
BudgetConfigto configure session-level caps:maxModelCalls,maxToolCalls,maxInputTokens,maxOutputTokens,maxTotalTokens. - Added
StopReasonenum (unspecified,maxModelCallsExceeded,maxToolCallsExceeded,maxInputTokensExceeded,maxOutputTokensExceeded,maxTotalTokensExceeded,quotaExhausted). - Exposed
ChatResponse.stopReason,ChatResponse.usage, andConversation.lastTurnStopReason.
- Introduced
- Vertex AI Express Mode (
apiKey):- Added
apiKeysupport toVertexEndpointfor Vertex AI Express Mode authentication. - Implemented mutual exclusivity validation: rejects configurations passing both
apiKey(Express Mode) andproject/location(Standard Mode).
- Added
- Agent Behavior Standard (
AgentBehavior):- Renamed
AgentModeenum toAgentBehavior(autonomous,interactive), mapping toAGENT_BEHAVIOR_AUTONOMOUSandAGENT_BEHAVIOR_INTERACTIVEprotobuf values. - Provided
typedef AgentMode = AgentBehaviorand constructor/getter aliases for backward compatibility.
- Renamed
- Hierarchical & Nested Subagent Controls:
- Added
maxSubagentDepthandallowedSubagentsallowlist configuration onCapabilitiesConfigandSubagentCapabilities. - Enabled
BuiltinTools.startSubagenton custom subagents when configured in their capability toolsets. - Validated that
maxSubagentDepthandallowedSubagentscannot be set when subagents are disabled. - Added subagent allowlist validation on
BaseLocalAgentConfigensuring all referenced subagent names exist in the configuredsubagentslist.
- Added
- Step Metadata & Image Artifact Paths:
- Added
parentTrajectoryIdanddepthfields toStepand updatedStep.fromMapparser. - Added
outputPathtoGenerateImageResultand updatedtoString()to returnoutputPathwhen non-empty.
- Added
- Policy Enhancements:
- Made
handleroptional inaskUserpolicy builder for host platform delegation compatibility.
- Made
- New Example & Documentation:
- Added
example/getting_started/budget_limits.dartdemonstrating all 5 budget limits and stop reason inspection. - Updated
example/getting_started/subagents.dartshowcasing dynamic self-delegation, static subagents, and nested subagent hierarchies.
- Added
- SDK Version Bump & Dependency Synchronization:
- Updated package version to
0.9.0and MCP implementation version to0.9.0.
- Updated package version to
- Default Model Upgrade to Gemini 3.7 Flash: Updated default generative text model in
0.8.0 #
- Sync with Python SDK v0.1.10 & Dart-Idiomatic Enhancements:
- Breaking API Change:
Conversation.lastTurnUsagesignature updated toUsageMetadata?(matching Python SDK v0.1.10) to returnnullwhen no token usage was recorded during a turn. - Gemini Prioritized Inference (
ServiceTier): IntroducedServiceTierenum (standard,priority,flex) and support inGeminiModelOptionsandUsageMetadatato configure high-priority model execution with automated fallback. - Live Token Usage Updates: Added support for live
UsageUpdateevent streaming over WebSockets, accumulating per-trajectory token usage live during execution. Added subtraction (-) operator support toUsageMetadata. - Agent Execution Modes (
AgentMode): IntroducedAgentModeenum (autonomous,interactive) inCapabilitiesConfigandSubagentCapabilitieswith interactive tool validation warnings (BuiltinTools.askQuestion). - Interactive CLI Spinner: Updated interactive CLI step spinner formatting (
formatStepSpinnerMessage) to display all active tool names during concurrent tool calls (e.g.Running tools 'tool_a', 'tool_b'...). - Tool Call Correlation ID: Added
callIdcorrelation support acrossToolCall,ToolResult,ToolExecutionException, and lifecycle hook payloads. - Flexible Context-Aware Lifecycle Hooks: Added
.stateless()factory constructors toFunctionInspectHook,FunctionDecideHook, andFunctionTransformHookto seamlessly support both(data)and(context, data)callback signatures. - ActionCompaction Handling: Emits context window compaction events over WebSockets and dispatches registered
OnCompactionHookhandlers. - Standardized System Instructions Strategy: Plain string instructions default to an appended system instruction strategy, while
CustomSystemInstructionscompletely replaces built-in instructions. - LiteRT Token Output Limit: Increased LiteRT default
maxOutputTokensfrom 8192 to 16,384 tokens to prevent truncation during complex generation.
- Breaking API Change:
0.7.0 #
- Sync with Python SDK v0.1.9 & Dart-Idiomatic Enhancements:
- Model-Call Retry & Backoff Configuration: Introduced
RetryConfig,ModelAPIRetryConfig, andModelOutputRetryConfigwithRetryConfig.benchmark()preset for controlling exponential backoff and output retry behavior acrossLocalAgentConfig,LocalOpenAIAgentConfig, andLiteRTAgentConfig. - Strongly-Typed
Duration& Jitter Ratio Validation: AddedDurationsupport (initialSleepDuration,serverTimeout) toModelAPIRetryConfigandMcpServerConfig. ValidatesjitterRangeas a ratio between0.0and1.0. - Strongly-Typed Logging with
package:logging:DebugConfigaccepts strongly-typedLevelobjects (level: Level.WARNING) or string names, validating levels and applying process-safe logger updates onAgent.start(). Uri&Uint8ListMedia Buffers: AddedUrigetters (uri,baseUri) onMcpStreamableHttpServerandModelEndpoint, plusMcpStreamableHttpServer.fromUri()factory constructor. AddedUint8List get bytesgetter onMediaContentandFileobject support infromFile().- Step & Turn Extensions: Added extension getters (
isUserTurn,isModelTurn,isFinished,isDone) onStep,StepSource, andStepStatus. - LiteRT Warm-up Timeout Scaling: Dynamically scales LiteRT engine warm-up timeouts based on context size (
maxContextTokens). - Expanded Audio Payload MIME Support: Added support for
audio/x-wav,audio/wave,audio/vnd.wave,audio/mp4,audio/webm, and additional audio formats. - Prompt Validation: Added strict validation in
Conversation.chat()to reject null, empty string, whitespace-only, or empty content prompts withAntigravityValidationException. - Hybrid Exception Hierarchy:
AntigravityValidationExceptionimplements bothExceptionandArgumentErrorfor backwards compatibility. - SDK Alignment: Bumped SDK version to
0.7.0aligned with Python SDKv0.1.9release.
- Model-Call Retry & Backoff Configuration: Introduced
0.6.0 #
- Sync with Python SDK v0.1.8:
- Default Model Upgrade to Gemini 3.6 Flash: Updated default generative text model in
lib/src/models.darttogemini-3.6-flash. - Prompt Sanitization: Strips null bytes (
\x00) and dangerous control characters (DEL,BEL,C1) from incoming string prompts at the wire boundary. - Tool Execution Exception: Introduced
ToolExecutionExceptioncarryingmessage,toolName, andserverNamemetadata when tool execution fails, with updated hook routing inHookRouter. - Subagent Custom & Templated System Instructions: Expanded
SubagentConfigsystem instructions to supportCustomSystemInstructionsandTemplatedSystemInstructions. - SDK Version Bump & Alignment: Bumping SDK version to 0.6.0 aligned with Python SDK v0.1.8 release updates.
- Default Model Upgrade to Gemini 3.6 Flash: Updated default generative text model in
0.5.0 #
- Sync with Python SDK v0.1.7:
- Hierarchical Thread-Safe State Management: Introduced the
StateStoreclass for hierarchical context state sharing and lock/reentrancy support. RetargetedHookContextandToolContextto inherit fromStateStore. - Session Continuation Modes: Implemented
SessionContinuationModeto specify continuation behavior (RESUME,CREATE_OR_RESUME,CREATE_ONLY,SESSION_CONTINUATION_MODE_UNSPECIFIED) with validation checks onAgentConfig. - Dynamic Environment Hydration: Hydrates Vertex project and location parameters automatically from standard
GOOGLE_CLOUD_PROJECTandGOOGLE_CLOUD_LOCATIONenvironment variables when not explicitly passed, and enables Vertex mode automatically whenGOOGLE_GENAI_USE_VERTEXAIorGOOGLE_GENAI_USE_ENTERPRISEis set. - Websocket Retry Backoff & DNS Resolution: Refactored websocket connections in
LocalConnectionStrategyto retry on bothlocalhostand127.0.0.1to ensure reliable connections in containerized sandboxes. - Spinner Pause/Resume: Enhanced CLI
Spinnerwith pause and resume behaviors, and integrated them into user confirmation/question hooks to prevent prompt clobbering. - Custom Tool Execution Support: Added
custom_toolparsing support inStep.fromMapand filtered out tool calls from StepUpdate if they are local custom tools to prevent client duplicate events. - Addition Operator for Token Usage: Implemented
+addition operator onUsageMetadatafor clean accumulation of token usage. - Updated default image generation model to
'gemini-3.1-flash-lite-image'. - Added
ThinkingLevel.extraHigh('extra_high') level support.
- Hierarchical Thread-Safe State Management: Introduced the
0.4.1 #
- Bug Fixes & Adjustments:
- Restored default workspaces (current working directory) and capabilities configuration on
BaseLocalAgentConfigto prevent silent sandboxing regressions. - Fixed client handshake protocol to announce the correct client version instead of a stale one.
- Added missing
read_url_contenttool field mapping inStep.fromMapparser. - Resolved
HttpClientsocket/connection leak in LiteRT loopback server health checks. - Documented public configuration fields on
LocalOpenAIAgentConfigandLiteRTAgentConfig.
- Restored default workspaces (current working directory) and capabilities configuration on
0.4.0 #
- Local Inference & OpenAI Endpoint Support:
- Added support for local Gemma execution using LiteRT via
LiteRTAgentConfigandLiteRTConnectionStrategy(which manages a python loopback HTTP server). - Added support for any OpenAI-compatible completions API (e.g. Ollama, LM Studio) via
LocalOpenAIAgentConfigandLocalOpenAIConnectionStrategy.
- Added support for local Gemma execution using LiteRT via
- Multimodal Tool Outputs:
- Enabled custom tools to return media assets (images, audio, video, documents) directly via a single tool response without needing separate follow-up turns. Media is extracted and sent as
supplemental_mediaintool_response.
- Enabled custom tools to return media assets (images, audio, video, documents) directly via a single tool response without needing separate follow-up turns. Media is extracted and sent as
- Model Context Protocol (MCP):
- Decoupled tool calls and safety policy engines from legacy
mcp_string prefix synthesis, utilizing explicitserverNameattributes in tool evaluation.
- Decoupled tool calls and safety policy engines from legacy
- Alias Deserialization Support:
- Handled
results/entriesalias inListDirectoryResultandoutput/combined_outputalias inRunCommandResult.
- Handled
- Automated Binary Discovery Updates:
- Added version checking logic to verify if the cached
localharnessbinary is out of date. - Automatically triggers a re-download/upgrade if the cached binary version is older than the SDK's default version (
0.1.6).
- Added version checking logic to verify if the cached
0.3.1 #
-
Fix Tool Error Hook Dispatching:
- Resolved a bug where
OnToolErrorHookwas never dispatched for either client-side custom tool failures or harness-side built-in tool failures. - Implemented client-side tool error dispatching in
local_connection.dartwith support for recovery values. - Added routing for
LIFECYCLE_HOOK_ON_TOOL_ERRORandON_TOOL_ERRORhook requests inhook_router.dartand covered it with a unit test.
- Resolved a bug where
-
Dart 3 Modernization:
- Refactored core classes
ConnectionandConnectionStrategyto use Dart 3abstract interface classmodifiers. - Marked
MediaContentas asealed classto restrict subclass hierarchy and support compiler-level exhaustiveness checks. - Modernized
registerHook,allow,deny, andaskUserto leverage case type pattern matching inside switch statements. - Refactored policy bucket index resolution (
_bucketIndex), file change triggers (onFileChange), shorthand model builder (_buildShorthandModels), and step state mappings (Step.fromMap) to use clean switch expressions and logical OR patterns. - Updated local connection classes to implement rather than extend the new interface classes.
- Added conditional imports in
lib/src/types/content.dartto support running the package on the web.
- Refactored core classes
0.3.0 #
- Synchronize updates from Python SDK (v0.1.5):
- Added new
read_url_contentbuiltin tool and itsReadUrlContentResultstructured output. - Added
StepType.thinkingto enum representation for telemetry tracking. - Implemented the
HookRouterto process WebSocket-basedCallHookRequestturn and tool lifecycle hooks delegated by the harness. - Added support for telemetry
PreStepHookandPostStepHookinsideHookRunnerand connection parser. - Implemented
_StepTrackerto prevent duplicate step hooks or non-linear state transitions. - Supported error and cancelled propagation in
trajectory_state_updateevents. - Historical Step Absorption: Aligned startup handshake to await and parse pre-existing conversation history and usage metadata from
initialize_conversation_response, populating them immediately inConversationon start.
- Added new
0.2.2 #
- Update to support web platform use
0.2.1 #
- Reintroduce generated files in package
0.2.0 #
- Model Configuration Overhaul: Replaced the monolithic
GeminiConfigwith a more flexibleModelTargetand polymorphicModelEndpointclass hierarchy (GeminiAPIEndpoint,VertexEndpoint). - Subagents Feature: Introduced
SubagentConfigandSubagentCapabilitiesallowing definition and inclusion of subagents in the main agent's configuration. - New Builtin Tools: Added
SearchWebtool and relatedSearchWebResultstructured output. - Enhanced Configuration: Support for environment variables (
env) inMcpStdioServer. RemovedimageModelfromCapabilitiesConfigto favor the new generic model targeting features.
0.1.3 #
- Added support for Vertex AI configuration (project, location, vertex options) in
GeminiConfig. - Refactored Model Context Protocol (MCP) server configurations to run connections natively on the Go-based harness, removing client-side
McpBridgereferences. - Added
SlashCommandstructure to input content primitives to support built-in planning flows. - Integrated CLI
SpinnerintorunInteractiveLoopwith step-by-step progress tracking viaagent.conversation.receiveSteps(). - Enhanced policy engine with a 9-level priority model supporting prefix wildcards and custom MCP policy validators.
- Added
AntigravityCancelledExceptionandAntigravityExecutionExceptionfor robust error handling.
0.0.1 #
- Initial release of the Antigravity Dart SDK.