tom_core_agentic 2.0.0
tom_core_agentic: ^2.0.0 copied to clipboard
Building blocks for agentic systems in the TOM framework: cancellation, close-guards, typed config reading and the agent data models (profiles, prompt queue, chat and trail); Anthropic's Claude Agent [...]
2.0.0 #
One Agent SDK provider. The package carried two over the tom_llm contract —
the main barrel's AgentSdkLlmProvider (used by the brain) and
agent_sdk.dart's AgentSdkSessionProvider (used by Webwork). The second is
the one that remains, and takes over what only the first could do.
Breaking #
AgentSdkLlmProvideris deleted, with its session strategies (AgentSdkSessionStrategy,NoSessionStrategy,BrainSessionStrategy,QuestSessionStrategy),AgentSdkSessionStoreandagentSdkLooksLikeSessionError. No re-export. Thelib/src/llm/unit is gone; the main barrel re-exportstom_llmdirectly.doc/llm.mdanddoc/api/api_summary_llm.mdare removed with it.AgentSdkCompletionRequestcarries one prompt.contextandwirePromptare removed: the provider sends the request'sWirePrompt.combinedbody unchanged (system channel first), asWirePromptrequires of a backend with no system channel. It used to send the user channel first and the context after a---rule.- The request's model wins.
AgentSdkSessionProvider.modelis the default for a request that names none; it used to override the request. AgentSdkTransportSelector.candidatesis a getter.
Added #
- Resuming the far end's conversation (
resume.dart):AgentSdkResumeStrategywithAgentSdkStoredResumeover anAgentSdkResumeStore(keyed byLlmOptions.sessionId) and the read-onlyAgentSdkQuestResume;agentSdkLooksLikeResumeError. The provider'sresumeconsults it per request, records the conversation a completed run named, and retries once, fresh, a resumed conversation the far end does not know — while no text has been delivered, counted in the report'sretries. AgentSdkCompletionRequest.resumeand the completion eventAgentSdkConversation, which the CLI-server channel emits when the far end names the run's conversation;boundedAiRun(onConversation:)and the session manager'sonConversationcarry it to the provider.AgentSdkAgentLoop(AgentSdkSessionProvider.agentLoop,AgentSdkCompletionRequest.agentLoop): Claude Code's own loop — its tools and MCP servers,maxTurns,permissionMode.AgentSdkWhenBusy(AgentSdkSessionProvider.whenBusy) andAgentSdkSessionManager.run(queueWhenBusy:): a run in a busy session waits for it instead of being refused.AgentSdkSessionManager.idleClose: a session idle that long has its host stopped, and starts again on its next run.AgentSdkSessionProvider.connectOnDemand: a run with no active transport retries the selector and, when nothing answers, ends as a failed run with the selector's reason.AgentSdkTransportSelector.replaceCandidatesmoves a provider to another endpoint.AgentSdkRunAttribution(AgentSdkSessionProvider.attribution): a run names the transport (default) or the provider'sid. WithagentLoopset, Claude Code's own tool calls stay in the trails and out of the caller's run.AgentSdkSessionProvider.id(defaultanthropic), and a completed run's report attributed to the request's prompt:anchorHash,promptHash(promptSha256of the combined body) andtemplateSha.
1.9.0 #
Added #
-
agent_sdk.dart: Anthropic's Claude Agent SDK as atom_llmprovider, withagent_sdk_live_probe.dart,agent_sdk_testing.dart, theinstall_agent_sdk_serverexecutable and the Node server undernode/. Formerly the packagetom_core_agent_sdk, which is deleted, with no re-export:- Transports.
AgentSdkServerTransportwith the hosted VS Code CLI server transport (port scan, identity handshake, workspace pin) and the standalone Node child transport (credential isolation, ready line, stderr on death). - The channel.
CliServerAiChannelwith the stall bound as a gap and 401-retry detection, andSdkTrailTranslatorfrom Agent SDK messages totom_llmrun events. - Selection.
AgentSdkTransportSelectorand the availability gate with a reason a program can branch on. - Sessions.
AgentSdkSessionProviderand one isolate per session. - The server.
agent_sdk_server.js, its on-demand install (install_agent_sdk_server) and payload verification. - Live probe.
live_probe.dart; test doubles intesting.dart.
- Transports.
-
agent_tools.dart: the tool surface for LLM agents. Formerly the packagetom_core_agent_tools, which is deleted, with no re-export:- Tools.
AgentToolwith a validated argument schema,AgentToolRegistrywithwhere, andAgentToolContextwith the guard and the transaction hooks an application implements. - Scope and consent.
AgentScopeand the five-gateagentGuard;AgentInvocationwith execution granted only against anAgentExecutionGrantstatement. - Audit.
AgentAuditEntry,AgentAuditLog,AgentMemoryAuditLogandAgentFileAuditLogover anAgentAuditStore; the per-callAgentAuditRecording. - Presentations.
AgentToolBinding(anLlmToolBinding) andAgentInProcessMcpServer. - Runs.
AgentRunwith its dry run, andAgentPreviewThenApply.
- Tools.
Removed #
- Breaking: the cancellation token and the YAML config writer.
CancellationToken,CancellationTokenSource,OperationCancelledandYamlConfigWriterare gone from the barrel, with no re-export. Usetom_basics'TomCancellationToken,TomCancellationSource,TomOperationCancelledandTomYamlConfigWriter(package:tom_basics/utilities.dart, tom_basics 3.3.0). The shared token also carries a reason:cancel([reason]), andwhenCancelledcompletes with it.AgentSend.send'scancelTokenis aTomCancellationToken.
Changed #
- The Dart SDK floor is 3.10.8, and
tom_vscode_scripting_apiis taken from pub.dev (^2.0.0). - Breaking: the Agent SDK and agent tool classes are
final, under the package's class-modifier rule; none was subclassed or implemented anywhere. promptSha256is'sha256:'+tom_basics'tomSha256OfText; the digest is unchanged.cryptomoves todev_dependencies(the test checks the digest against it independently), and thetom_basicsfloor is 3.3.0.- A session belongs to its manager, not to its first caller.
AgentSdkSessionManageropens a session's isolate ports, in-process worker messages and cancel timer in the zone the manager was built in. Opened from the caller's zone, a session handed every later run's events through a zone that had stopped running — a second widget test over one manager never heard its answer. - Breaking:
StandaloneNodeAiTransportrefuses an emptyapiKey(ArgumentError). It was taken as the only credential, cutting the child off from the ambient login, and failed at the far end as a rejected credential. Pass null to use the environment's.
Tests #
test/ai_citation_test.dartfails the suite when an artefact of the package cites a document in the AI-state mount. It runstom_ai/core/tool/check_doc_ai_citations.pyover the package throughtom_ai/core/tool/package_gate.dart; the rule and its one exemption (the runtime_ai/trail/directory) are stated in the checker alone.test/formatting_test.dartfails the suite when a Dart file the package authors is notdart format-clean. It states the package's file floor, landmark directories and generated output, and delegates the sweep totom_ai/core/tool/package_format_guard.dart, which every package undertom_ai/coreshares.
Changed #
-
The provider contract is
tom_llm's.LlmProvider,WirePrompt,LlmOptions,LlmCallReport,CapturedWirePrompt, the tool types and theLlmStream*events are deleted here; the one contract the workspace has —LlmProvider.run(LlmRequest)as a stream ofLlmEvents,completederived from it — lives intom_llm, which this package depends on and its barrel re-exports.AgentSdkLlmProviderextends it: it implementsrun(LlmRunStartednaming purpose, provider, model and call;LlmTextDelta;LlmRunCompletedorLlmRunFailed, each naming the call), and through the derivedcompletea failure is anLlmTransportExceptionof kindremotecarrying the SDK's error as its cause.LlmOptions.brainSessionIdisLlmOptions.sessionId, whichBrainSessionStrategykeys on. The value-type tests moved with the types. -
thinkingEnabledreaches the Agent SDK as its thinking configuration, through the newthinkingConfigFor:falseisThinkingDisabled,trueisThinkingEnabledwith the profile'sthinkingBudgetTokenswhen it sets one andThinkingAdaptivewhen it does not, and an unset value sends nothing.AgentSendConfigcarries it asthinking, overlaid like the turn cap and the permission mode — an explicit argument, then the profile, thenAgentSettings.Options.thinkingexists in everytom_vscode_scripting_apirelease the package accepts, so it was never a field with no destination.maxTokensandpromptCachingEnabledstill have none and are still not sent. -
No public class in the package is left without a modifier. The 29 that carried none — the eleven
*Storeclasses, the bridge and reconnect services,AgentSendEngineandAgentSendConfig, the value types, the two exceptions,AsyncShutdownCoordinatorandCancellationTokenSource— are closed, as the rest of the package already was. Nothing in the workspace extends, implements or mixes in any of them. The fiveAgentSendEventleaves are nowfinal class, so the package's two sealed event hierarchies agree withLlmStreamEvent's.BridgeConnectionServiceis varied through its injectedBridgePortScanner, which is its documented seam; the reconnect tests use it instead of subclassing the service. -
EditorPlaceholderBindingsstates its limits as decisions. The library comment deferred file injection and workspace wiring to "later steps" and named capability tiers that exist nowhere. It now says what the binder does: one capability level, no I/O, with reserved${file:…}/${state:…}forms passing through verbatim and file or workspace values supplied by the caller as bindings. A test holds the pass-through. -
Quest mode pays for a stale session once.
QuestSessionStrategy.evictremembers the rejected id in memory, andresumeIdForno longer offers it while the editor's file still names it, so every later call starts fresh instead of failing a resume first. The file is still never written; a new id in it is resumed. The constructor is no longerconst. -
A guarded request that times out can cancel the work it abandons.
IsolateRequestGuard.guardtakes an optionalcancellationtoken andcancelcallback (both or neither); on a deadline it fails the caller, then callscancel(token)once so the host can send its cancel envelope. A completed request and a worker death never call it. -
A profile's tool-approval mode reaches the Agent SDK, as a permission mode:
alwaysis the SDK default (prompt for dangerous operations),neverisacceptEdits(permissionModeForApproval). -
AgentSendConfig.fromProfiletakessettings:and applies the overlayAgentSettingsdocumented: for the turn cap and the permission mode an explicit argument wins, then the profile's field, then the settings'. -
maxTokens,thinkingEnabledandpromptCachingEnabledsay what they do not do. The Agent SDK'sOptionshas no field for any of them, so they are stored and edited but not sent;AgentSettings.maxTokensno longer names anOptions.maxTokensthat does not exist.
Fixed #
-
The README's
dart:iocoupling figures were wrong, and are now derived (tcopen354). It said "Fourteen files underlib/importdart:io" where there are 15 — the tenth sidecar store added an importer and only the test's pinned set was updated. Itssrc/agent/agent.dartrow was wrong twice over: eleven file-backed stores where nine importdart:io, and no mention that the export also reachesplaceholder_resolver.dartthrough the editor placeholder bindings.The section now states 15 direct importers, 5 of 36 coupled exports, 31 clean, and a per-row reach count — and
test/dart_io_coupling_test.dartreads the section and fails when any figure stops matching the import graph. The sets were already pinned; the prose about them was the half nothing checked, which is exactly how it drifted.
Added #
-
The shared-stack constructor parameter is covered (tcopen353).
PlaceholderResolver'sstackis what lets two resolvers share a namespace — the shapeplaceholder_stack.dart's header describes, nested frames resolving against one set of bindings — and every construction in the package took the default, so a regression that dropped the parameter and always allocated a fresh stack would have passed the suite.Five cases: the resolver holds the caller's object rather than a copy; a binding made after construction reaches it; two resolvers over one stack read each other's bindings while keeping their own environment and mode;
pushandpopmove both together; and, as the control, two resolvers left to default do not share. The control earns its place — without it every other assertion would also pass against one process-wide stack, which is the opposite defect and the worse one.example/placeholders/placeholders_example.dartgained an act showing the shape, since a parameter nothing demonstrates is a parameter nobody uses.
Changed #
-
The placeholder re-scan is documented as a trust boundary (tcopen352). Both entry points loop while resolvable placeholders remain, so a substituted value is scanned again whatever form produced it — and what it can reference is every namespace the resolver has. Only the binding-to-binding half of that was ever stated, as the composition feature it is.
All six source/namespace pairs were probed and behave identically: a binding value may reference the environment, an environment value may reference a binding, an expression result is text like any other, and
${name?}differs only in the unbound case. A reserved${file:…}/${state:…}form is the one exemption, and not really an exception — it is never substituted at any level, so a value that looks like one survives verbatim.The source header,
doc/placeholders.mdand the API summary now say what is re-scanned, what it means for text arriving from outside the program, and the isolation available today: an emptyenvironmentover a fresh stack, in strict mode, refuses an unknown reference instead of rendering it away. Nine cases intest/placeholder_resolver_test.dartpin it.The behaviour was not changed, and special-casing the environment was rejected rather than deferred: it would leave binding-to-binding injection untouched while making the rule non-uniform, so it would not close the surface it was aimed at.
Fixed #
api_summary_placeholders.mdstated a constructor signaturePlaceholderResolverdoes not have. It gave the class arequired PlaceholderStack stackand a non-nullableenvironment. Every parameter is optional:stackdefaults to a fresh standalonePlaceholderStackandenvironmenttoPlatform.environment, soPlaceholderResolver()is a working strict resolver over its own empty scope. The page now says so, and says that both nullable parameters become non-nullable fields.
Added #
doc/api/api_summary_placeholders.md(tcopen349). Six types, one function and three constants with a section each: the four placeholder forms and the two entry points, the lexical scope chain, the expression seam, and the three wire-coded failures.
Changed #
-
The summary threshold counts members, not types. A unit earns a symbol-level summary at ten exported public members. Counting types put
placeholderson the wrong side of the line — 6 types againstisolate_streaming's 12, but 35 members against its 47, which is also where its 647 lines put it.PlaceholderResolverandPlaceholderStackcarry seventeen members between them and a type count sees none of them.The member figure partitions the package more decisively too: 0, 5 | 35, 47, 107, 344 has nothing near the line, where 3, 6 | 12, 20, 52 is a factor of two.
test/api_summary_test.dartmeasures members by brace depth rather than by pattern — a member sits at depth 1 and everything in a method body is deeper — and also holds the index's own table to the measured counts, so the numbers the rule argues from cannot go stale.tom_flutter_uikeeps the threshold over types, for a reason its own index states: it is a widget catalogue where a type is the unit of surface. Whether the two should be unified istcextension57_aivw.
Fixed #
- Twelve broken markdown reference links in
doc/(tcopen347). Three onbearer_auth.mdand nine onisolate_streaming.mdwere written as[`SomeType`]— dartdoc's square-bracket syntax in a markdown file, where it renders as literal brackets around a code span rather than as a link. None had an anchor to point at, so the brackets are gone and the code spans remain, which is what the surrounding prose does throughout both pages.
Added #
-
All three
BearerAuthFailureReasoncategories now have a producer (tcopen346).malformedhad none, and the reason was structural rather than an oversight: every authenticator in the package was a map lookup, and a lookup has no parse step for that category to describe. So the one reason that distinguishes the taxonomy from a boolean accept/reject was the one an implementer had no reference for.example/mcp_auth/mcp_auth_example.dartnow parses a JWT-shaped token — three dot-separated segments with base64url JSON claims in the middle, and no signature verification, which it says loudly — and demonstrates all four outcomes.test/bearer_auth_test.dartpins each category and closes on the one comparison the distinction rests on: two tokens naming a subject the authenticator knows, differing only in whether the envelope parses.doc/bearer_auth.mdstates the rule the reasons follow — did the server learn who was claimed? — and the three cases most easily got backwards: an expired token and a signature that fails verification arerejected, while claims that parse but carry no subject aremalformed. -
doc/api/api_summary_index.mdstates which units get a summary (tcopen344). A unit earns one at ten exported public types. The rule partitions the package with no exception:agent(52),llm(20) andisolate_streaming(12) have summaries;placeholders(6),bearer_auth(3) andmcp_auth(0 types, two constants) are mirrored by their prose page's Overview table instead.test/api_summary_test.dartnow holds the whole arrangement rather than only the summaries that happen to exist: it derives every unit fromlib/src/, fails a unit at or over the threshold with no summary, holds a sub-threshold unit's## Overviewto every exported type, function and constant, and requires the index to account for every unit and link no summary that is not there.That last part closes a hole.
tool/check_doc_overview_types.pycompares types and skips a unit that exports none —mcp_authis named in its source as the reason — so the unit whose entire surface is two constants was the one no derived check read.
Changed #
-
The
bearerTokenMetaKeynaming guard is a closed rule, not a list. It checked the key against four package names, which fails open: mintingtom_forgeand writingtomForgeBearerTokenwould have passed. The capitalised words in the key must now be exactlyBearerandToken, so a package name anywhere in it fails whether or not the test knows the package. -
Two pointers to
test/agent_api_summary_test.dart, which was renamed totest/api_summary_test.dart, inREADME.mdanddoc/agent.md; anddoc/agent.md's exported-type count, which stayed at 51 when the tenth sidecar store added a type. -
WirePrompt.combinedno longer documents a migration (tcopen343). Its dartdoc calledcombinedthe fallback used "transitionally [by] any provider until its native-channel mapping lands". There is no such mapping to wait for: routingsystemanduserto native channels, or sendingcombinedwhen the backend has none, is the choice itself, made once per provider. The clause is gone, and the getter now states the part it never had — thatpromptHashis the content hash ofcombinedfor every provider, sender or not, which makes the join part of the hash contract rather than of formatting.LlmProvider's no-mutation rule had the same elision, telling implementers to translatecombinedwhere a channel-aware provider does not, and now names both routes. -
The
agentandllmmodule documents state their dependencies as the standard table. Both had a prose list, whichcheck_module_dependencies.pyreported as a shape fault and which was also wrong: theagentlist claimedtom_basics, which no file in the module imports, and omitteddart:async,cancellation.dartandplaceholders; thellmlist omitteddart:async,dart:convertandprompt_sha256.dart.
Added #
-
The Agent SDK provider is tested against a two-channel prompt (tcopen343). Every existing assertion rode a system-only
WirePrompt, wherecombined == system, so a provider that put the system channel on the wire and fingerprinted it would have passed all of them; the bufferedcompleteasserted two fields and never the provenance triple. A new group drives both entry points with both channels filled, with a control on the fixture itself. -
Tests for the llm unit's value types (tcopen342).
test/llm_value_types_test.dartcovers the four pieces the provider tests reached only in passing.LlmOptions.copyWith's_unsetsentinel exists to distinguish omitting a parameter from passingnull, and both arms are now asserted — including that each of the five nullable fields clears independently, and thatstopSequencesandtoolCataloguecannot be cleared because they are non-nullable with defaults.WirePrompt.combinedgets its three branches. It feedspromptSha256, which stampsLlmCallReport.promptHash, so a change to the join would silently change every prompt hash ever recorded with nothing failing.ToolCatalogueandToolDescriptorare exercised throughLlmOptions, andLlmStreamToolCallProposedthrough an exhaustiveswitch— which is how a consumer of a sealed family meets a variant the shipped provider never emits. -
A runnable example for the
llmunit (tcopen339).example/llm/llm_example.dartimplementsLlmProviderend to end and drives it throughcompleteandcompleteStream. It asserts the three invariants an implementer most easily breaks — the anchor stamp, the unmodified body, and one route announced once — with the route check made under a per-call model override, because under default options a provider that resolved the model twice would look correct.It also shows that one failure takes two shapes: a terminal
LlmStreamFailedcarrying a still-attributable report on the streaming path, and an exception on the buffered one. -
An API mirror for the
llmunit (tcopen338).doc/api/api_summary_llm.mdgives each of the twenty exported types a section, plusagentSdkLooksLikeSessionErrorand both public statics. With ittest/api_summary_test.dartnow holds three mirrors, discovered fromdoc/api/rather than listed. -
A prose page for the
llmunit (tcopen337).doc/llm.mddocuments the provider seam a reader could previously only reconstruct from dartdoc: theLlmProvidercontract and its anchor, no-mutation and provenance invariants; the stream lifecycle and why a non-streaming backend still implementscompleteStream; the value types, including whyWirePromptisfinaland whycombinedpreserves the anchor guarantee; and forAgentSdkLlmProvider, the control inversion, the dropped thinking blocks whose tokens still count, the tool-call event that is deliberately never emitted, the four conditions on its single retry, and the conservative two-cue session matcher that separates it from the editor's broader one.The three session strategies get a table and the rule that matters most: no method may throw because the session state is damaged, write included — the provider awaits
recordon the success path, so a throwing store would destroy a call that has already been billed. -
markWorkerDeadsays that it is terminal (tcopen335). A guard told its worker died fails every future request for the rest of its life; a host that respawns builds a new guard. That followed from "one-shot" and is now stated on the method, with the reason a resettable guard would be worse — it would have to decide what it owed the requests that were in flight at the death. -
The cancellation discriminator's precondition is enforced (tcopen334).
IsolateCancellationRegistry.registerasserts that token ids arrive strictly increasing — the property that lets the high-water mark tell a pre-open cancel from a post-close one, and which holds only for a single host allocator over an ordered transport. Two allocators into one registry, or a reordering transport, previously made a genuine pre-open cancel indistinguishable from a post-close one: it was dropped, and the request ran to completion having been cancelled with no error anywhere.Four tests pin it, including a control over the ordinary in-order sequence and one that demonstrates the silent mis-read the assert replaces.
-
Disposal is documented as an obligation, and the example proves it (tcopen333).
IsolateCancellationHandle.dispose()removes a request's entry from the registry; skipping it holds one entry per request served for the life of the isolate, with nothing failing andinFlightCountthe only reading that would show it.doc/isolate_streaming.mdstates that under Concurrency and Lifecycle anddoc/api/api_summary_isolate_streaming.mdstates it on the handle.example/isolate_streaming/now asks its worker forinFlightCountafter both cancelled requests have ended and asserts it is zero. Removing thefinallythat disposes makes the demo print2 in flightand fail — so the example shows what the obligation buys instead of performing it silently. -
An API mirror for the
isolate_streamingunit (tcopen332).doc/api/api_summary_isolate_streaming.mdgives each of the twelve exported types a section; the unit declares no top-level function, constant or public static, so twelve sections are the whole of it. It leads with the fact the prose had wrong twice — which side of the boundary each type lives on — as a table: onlyIsolateCancellationTokenis sendable, the registry and handle hold live completers and never leave the executor's isolate, and the guard and the exception registry are host-side.test/agent_api_summary_test.dartis nowtest/api_summary_test.dartand holds everydoc/api/api_summary_<unit>.md, deriving each one's required symbols fromlib/src/<unit>/<unit>.dart. Neither a unit name nor a symbol name is written out in it, so a third mirror is covered the day it lands. -
ReminderTemplateStore(tcopen331).ReminderTemplatewas the one persisted-shaped model in the unit with no store — afromYaml/toYamlpair like the nine that had one, and nothing that could read or write a set of them. That mattered because two models which are persisted hold areminderTemplateId:QueuedPromptandTimedRequest. A queue restored on the next launch therefore named a reminder body nothing in the package could load, which is a reference in name only.The store is the tenth instance of an already-uniform pattern —
Store(File), aresolveDefault()honouringTOM_SPECS_REMINDER_TEMPLATES_FILEand falling back to<cwd>/.tom/reminder_templates.yaml, aload()degrading to an empty list, asave()writing theversion: 1envelope — so it inherits the shared degradation rule rather than restating it.
Fixed #
-
Three citations of documents the package does not ship (tcopen341).
lib/src/llm/llm.dartexplained which providers were deliberately left behind and pointed at a workspace-internal deferral note that a package reader cannot reach — and which said nothing about the providers, so the sentence pointed at a document that neither shipped nor carried the claim. The reason is now stated inline. The README anddoc/placeholders.mdeach cited another such note for the deferreddart:ioremoval; both now say the work is deferred without naming a file nobody outside this workspace can open. -
doc/api/api_summary_agent.mddescribedTimedRequest.scheduleModeas optional (tcopen331). It is required, and deliberately so: a caller states whether an entry repeats on an interval or at fixed times instead of discovering which one they got. The summary said the opposite because it followed an older finding's description of the defect rather than the constructor, which is the one source it claims to be written from. -
A runnable example for the
agentunit (tcopen329).example/agent/agent_example.dartwalks it end to end in four acts: a sidecar round-trip and both degradation rules (parse damage costs the file, shape damage costs one entry — shown with three rows of which two are unusable), bridge discovery with alocalhostbinding matched back against a127.0.0.1scan result, the reconnect back-off resolvingsameWorkspace,differentWorkspaceandstillGone, and a send that refreshes a stale session id and then declines to refresh a second time.No network, no VS Code, no API key: the port scanner, the reconnect delay and the Agent SDK transport are injected, which is possible only because the unit already takes each of them as a seam. It runs in under a second and touches only a temporary directory it deletes.
-
An API mirror for the
agentunit (tcopen328).doc/api/api_summary_agent.mdgives each of the unit's 51 exported types, 13 top-level functions and 4 constants its own section and names all three public statics — 68 symbols whose only listing was a table in a quest document the package does not ship.It is held rather than trusted:
test/agent_api_summary_test.dartderives the required set fromlib/src/agent/agent.dartand fails on a symbol with no section, a public static never named, or a section naming something the barrel does not export. No symbol name is written out in the test, so it cannot go stale in the same direction as the document it guards. -
A prose page for the
agentunit (tcopen327).doc/agent.mddocuments what a caller cannot infer from signatures: the ten sidecar paths and their environment overrides, the payload key and identity field each list store uses, and the two halves of the degradation rule — parse damage costs the file, shape damage costs one entry. Then the bridge protocol (the 19900–19909 scan range, the workspace-identity handshake, and why a binding matches a scan endpoint-wise rather than by string), the reconnect back-off with its 10/30/60-second schedule and three resolutions, and the send engine: the event lifecycle, the four conditions that together permit one retry with a fresh session, and the fact that cancellation ends the stream with no terminal event at all, so a consumer waiting for one to re-enable its UI must also watch the token.The README gains a table linking all five of the package's doc pages, none of which it referenced before.
1.8.0 #
Changed #
-
Every example refuses to run without
--enable-asserts. The examples verify themselves withassert, anddart runstrips asserts unless given the flag, so a flagless run printed a plausible transcript and exited 0 having checked nothing — a result that cannot be told from success.test/examples_test.dartalready ran each example under its documented command, which kept the examples honest; it did nothing for a reader running one from memory. Each example now opens withrequireAsserts()(example/require_asserts.dart), which exits with status 2 and the corrected command when asserts are off, and the test requires that refusal of every example.tom_core_kernel's samples refuse the same way. -
isolate_streamingclosed its last two open classes.IsolateRequestGuardandIsolateExceptionRegistrywere plainclasswhile the module's other eight public types werefinal. Nothing in the workspace extended, implemented or mixed in either — the two consumers (tom_brain_substrate,tom_brain_memory) use both by composition — so the split bought no extension point and recorded no decision; it read as whichever modifier each file happened to be written with. Both are nowfinal, and each says in its dartdoc why, because that is the part a modifier alone cannot convey: neither type is varied by subclassing. The guard is adjusted bydefaultTimeoutandguard's per-calltimeout, and learns of a death throughmarkWorkerDeadrather than an overridable hook; the registry is specialised by theIsolateExceptionFactoryclosures you register, which is already a function type. A subclass of either would have nothing to override that is not already a parameter. The module's two private helpers,_GuardEntryand_RegistryEntry, were deliberately not given the keyword. A class modifier governs subtyping from outside the declaring library and a private class is invisible there, sofinalon them would permit exactly what its absence permits while reading as a decision. Each now carries a line saying so, which is the honest form of the same consistency. No API is lost: both classes were only ever constructed and called, and both consumer packages still analyze clean.doc/isolate_streaming.mdmoves tofinal classin both rows, which is what makes this stick —tool/check_doc_kinds.pycompares theKindcell to the declaration's modifiers verbatim, so droppingfinalagain now fails a gate rather than passing unnoticed as it did before.
Fixed #
-
A mis-typed optional field cost the whole agent entry. The nine models in
agent/read their optional fields through 123 nullable casts of the shapeyaml['name'] as String? ?? ''. That shape answers an absent field — it defaults — and not a field that is present holding the wrong type:name: 7is not aString?, so the cast threw.decodeAgentYamlEntriescaught theTypeError, so nothing escaped, but the entry was dropped in full — a profile whosedescriptionwas a number lost its prompt, its model, its tool list and its id, when defaultingdescriptionto''would have cost the user nothing they notice. Three leaf readers inagent/agent_yaml.dartreplace the idiom at every one of those sites:yamlValue<T>(type-tests rather than casts, so absent and unusable give the same answer),yamlStringList(keeps the elements that are strings) andyamlEnum(absent staysnull; an unrecognised string falls back inside the enum's ownfromValue). Damage below the identity now costs the field, at its documented default. The identity fields are deliberately untouched and still cast: an entry whoseid— or aChatVariable'sname, or aTrailPair'srequest— cannot be read cannot be addressed, updated or deleted, so there is nothing to salvage, anddecodeAgentYamlEntries'son TypeErrorremains the last resort that drops it.test/sidecar_shape_damage_test.dartasserts both halves. Two models gain the guarantee they never had, because neither is read through a list store and so nothing was catching for them:AgentSettings, where an all-or-nothing read reset every option the user set because one was unreadable, andReminderTemplate, whosefromYamlpropagated theTypeErrorto its caller.QueueTemplate.promptschanges shape with them: it stringified whatever the list held (- 7became'7') and now keeps the strings and drops the rest, matchingAgentProfile.enabledToolsand the nested-list rule everywhere else in the package. -
isSimpleIdentifierwas documented as the simple form's grammar. The simple form has no grammar. Three texts called it "the shape the simple${name}fast path accepts". Nothing in this package applies it: the scanner routes on prefix alone, so any body that is notenv:/file:/state:is a lookup key, andPlaceholderStack.bindaccepts any string as a name. That latitude is load-bearing, not accidental — the brain substrate'srole.anchorbuilt-in is a dotted name, andSystemScaffold.templateleads with it. Enforcing the documented rule inbindor_classifywould have broken the assistant's system prompt, which is why the texts were corrected instead of the code. The second half of the same sentence — "the only binding names that can be injected as d4rt expression locals" — is true, and is enforced, just not here:D4rtExpressionContext.evaluateintom_brain_procedurefiltersflatten()through this predicate before synthesising its parameter list. The constraint is d4rt's (a local becomes a parameter name), so it belongs to the backing, in the same tier-design that keeps this package free of a d4rt dependency. The dartdoc now says which layer applies it. The real consequence is milder than a failure and was undocumented: a non-identifier binding is visible to${name}and silently absent from${{ … }}. Four tests pin it (520 → 524), plus one intom_brain_procedureat the enforcement point. -
${name}was documented as "equivalent to${{ name }}". It is not. The resolver header anddoc/placeholders.mdboth invited a reader to substitute one form for the other, when the forms agree on exactly one case — a bound name, resolved throughresolve, against a configured backing — and diverge on three axes everywhere else.${{ name }}requires aPlaceholderExpressionsbacking and throws without one; it throws onresolveSynceven with a backing, so the config loaders can never reach it at all; and on an unbound name it consults neitherstrictnor lenient, because that case belongs to the backing. The third axis is the one the docs hid most effectively: the divergence is not "strict is bypassed", it survives switching to lenient. Both texts now state the qualified relationship rather than an equivalence, and three tests pin each axis (517 → 520). The alternative — short-circuiting an identifier-shaped${{ … }}body to the simple lookup, making the equivalence true — was rejected:placeholder_expressions.dartdocuments the no-backing failure as deliberate ("a stray${{ … }}in a config value fails fast rather than silently passing through"), so short-circuiting would let${{ name }}pass in a config value while${{ name + 1 }}still failed, and it contradicts an existing test asserting the backing receives an unbound body. -
The package-wide
dart:io-free claim was false, and the carve-out that qualified it was too. Four documents stated thatPlaceholderResolverheld the package's onlydart:ioimport. A grep returns fourteen importers, and five of the thirty-six barrel exports reach one —agent/,llm/,path_scope_io.dart,placeholders/, andyaml_config_reader.dart, the last coupled only transitively through the placeholder resolver it uses for${…}expansion. The claim was true when written (2026-06-15) and went stale the next day, whenagent_sdk_session.dartlanded; nothing rechecked it as the package grew. The carve-out made this worse than silence would have, because it told a reader the exception had been counted. The claim is now restated at the level where it holds: the package is notdart:io-free, the other 31 exports are, and that subset is whatdart:io-forbidding consumers use —tom_brain_shared, the one named consumer, draws seven symbols and all seven are in it. The documents also had the mechanism wrong.dart compile jsdoes not rejectdart:io: it compiles, stubs the library, and throwsUnsupportedErroronly when a stubbed member is reached, so a web consumer can import the barrel — orshowa symbol from a coupled export — and fail at runtime instead of at build time. Since no compiler catches this,test/dart_io_coupling_test.dartnow pins both the importer set and the coupled/clean export split (514 → 517), which is what makes the README table checkable rather than a second count waiting to rot. -
Kindcolumns indoc/named things Dart does not declare. Eight Overview rows acrossdoc/bearer_auth.mdanddoc/placeholders.mddescribed a symbol's role in the column that is asked what its declaration is:BearerTokenAuthenticator<P>wasinterfacewhile being anabstract interface class,BearerAuthFailurewasexceptionwhile being a plainclass, and the six placeholder types wereclass/interface/exceptionwhile beingfinal classandabstract interface class. Each cell was true as a description and useless as an answer to the question the column exists for — may I extend this, or only implement it? — and the two restrictive kinds are exactly the ones the informal words cannot express.doc/mcp_auth.mdanddoc/isolate_streaming.mdwere checked the same way and were already correct.
Changed #
- Wire key
tomBrainBearerToken→tomBearerToken(bearerTokenMetaKey). The value namedtom_brain— a package this one does not depend on and never will — from when the constant lived there, so every future MCP server in the framework (a planning server, a procedure server) would have presented its token under a key named for someone else's package, in a package whose barrel and README both advertise "generic, domain-free building blocks". Of the five symbols in the module this is the only one that had to be renamed rather than re-exported: the other four are Dart symbols a consumer can rename at will, whereas the_metakey is the single thing a client and a server agree on out of band — the compiler renames a symbol, only a coordinated release renames a wire key, which is why it was done now, before publication, rather than left. Every Dart consumer reads the constant rather than the literal, so the compiler carried the rename; the only edits were prose and two test expectations. Downstream:tom_brain_memory's MCP server and itsa76_bearer_auth_test.dartwere swept in the same pass — its full suite (1496 tests, including a two-OS-process client/server run over HTTP) is green, so the rename is verified end-to-end on the wire and not merely compile-clean. Coverage:test/mcp_auth_test.dartgains a case asserting the key is scoped to the framework and names no package in it, pinning the invariant the rename restored so it cannot quietly regress (513 → 514). mcp_auth/→bearer_auth/+mcp_auth/: the bearer-auth module was one file holding two unrelated things — a transport-neutral failure taxonomy (BearerTokenAuthenticator<P>,BearerAuthFailure,BearerAuthFailureReason) and two MCP wire constants (bearerTokenMetaKey,bearerAuthRpcErrorCode) — and three documents claimed its existence was what stopped servers re-deriving that taxonomy. The claim was false: the HTTP edge intom_brain_accessdeclares its own copy with a byte-identicaltoString, and does so while already depending ontom_core_agentic, so availability was never the obstacle — reaching the taxonomy meant importing a_metakey and a JSON-RPC error code an HTTP edge has no use for. The three neutral types now live inlib/src/bearer_auth/, whose contract file has no imports at all;mcp_auth/keeps only the two constants and imports the contract, so the dependency runs MCP → taxonomy and not back. Their dartdoc was de-MCP-ified in the move (the prose described theinitializehandshake as the only place a token could arrive, andBearerAuthFailurecross-referencedbearerAuthRpcErrorCodeas the translation rather than one edge's mapping) — moving the file without that would have carried the coupling along in the one form a compiler cannot check. No call site changes: all five symbols are still exported from the package barrel under the same names with the same values and behaviour. Coverage: the six taxonomy tests moved verbatim totest/bearer_auth_test.dart, which importssrc/bearer_auth/bearer_auth_contract.dartrather than the barrel — so the separation is a compile-time fact and folding the types back in beside the constants would stop that file compiling.doc/mcp_auth.mdsplit accordingly, gainingdoc/bearer_auth.md.
Fixed #
-
llm/: thellmunit's flagship worked example — theEchoProvidera reader copies to write their own provider — broke both of the contracts the prose around it is about. It announcedLlmStreamStarted(providerId: 'echo', modelId: 'echo')from aconstconstructor while completing withproviderId: id, modelId: options.model ?? 'echo', soEchoProvider('primary')underLlmOptions(model: 'sonnet')opened on one route and terminated on another; theconstis what forced it, since a const constructor cannot read either value, making the mistake structural rather than a typo. Itscomplete()wascompleteStream(...).whereType<LlmStreamCompleted>().first, which on a failed stream raises a bareStateError: No elementand discards theLlmStreamFailedcarrying the reason — every failure reported identically and uninformatively. The example now stampsid/modelIdon Started and drains the stream, rethrowingfailure.causeor the failure message, which is the shape the shipped provider already had. Root cause: the invariant was real and tested but stated nowhere a copier would read it —LlmProvider.completeStreamandLlmStreamStarted's field dartdoc only ever constrained the terminal report, so nothing said Started had to agree with it. Both now say so. Coverage: the two tests that touched Started asserted its fields against literals that happened to match the report's, which pins two values but not the relationship between them; they now assert the agreement directly, so a provider that hardcoded the pair fails instead of passing. -
llm/: four documents promised that a provider emits onlyclassCode: 'unknown', which the one shipped provider has never done — a stream that ends without a terminal result yields'format'. The promise was the thing a consumer would most reasonably rely on ("I only ever have to handleunknownfrom this layer"), and it was false at the single place it could be checked, so a consumer switching onclassCodemishandled exactly the malformed-stream case. Resolved by correcting the documents rather than narrowing the provider:formatalready appears in the dartdoc's own taxonomy list, it is asserted by a test, and flattening it tounknownwould discard the one thing the provider genuinely observed for itself. The four now state the actual contract — a provider settles the two classes it can determine without interpreting the backend (formatfor a malformed stream,unknownfor everything else) and leaves the rest of the taxonomy to the caller, so a consumer must handle both. The same paragraphs calledclassCode"kebab-case" in three places while every example listed, and the two values actually emitted, are snake_case; nothing in the module is kebab-case. Coverage: the two paths that emitunknownhad tests assertingmessageand the report but neverclassCode, which is why the claim could drift unnoticed — both now pin it, so all three emission sites are held. -
llm/:AgentSdkLlmProvidermisreported both retry fields of everyLlmCallReport._buildReporthardcodedretries: 0— including on the report emitted after the evict-and-retry-fresh path had just burned a retry — andwallClockMspreferred the SDK result'sduration_msover the provider's own stopwatch. The two defects compound:duration_mstimes a single attempt on the backend, so on a retried call it silently dropped the failed first attempt and the wait between them, which is exactly the case the retry counter was supposed to flag. The contract onLlmCallReportwas right all along ("in-caller retries burned before this report", "total wall-clock between submission and completion (includes retry waits)"); only the provider disagreed. This reached further than the trail:LlmRouter._foldRetriescomputesreport.retries + retries, so the hardcoded zero under-counted the router's aggregate too. The provider's retry flag is now anint retriesthat_buildReporttakes as a required argument — required rather than defaulted, because a default is what let every report claim a first-shot success — andwallClockMsalways reads the stopwatch, which is started once at submission and deliberately read without stopping it, since the costed-error branch may still continue into a retry. The agent-SDK provider is the only provider affected: the HTTP and stub providers hardcode0correctly, having no internal retry (the router owns retry for them). Coverage: the existing evict-and-retry test now scripts a delay into both attempts and assertsretries: 1plus a wall clock spanning both, and the first-shot test pinsretries: 0. One existing assertion had to be corrected rather than kept —agent_sdk_provider_test.dartassertedwallClockMs == 1234, the scriptedduration_ms, so it was pinning the defect in place; it now asserts the figure is a real elapsed measurement and specifically not the backend number. -
llm/:AgentSdkSessionStorehonoured its no-throw contract on reads only._loaddegraded a missing, corrupt or unreadable file to an empty map, but_flushcaught nothing — and the provider awaits it twice on paths where an exception destroys work already done.putruns on the success path, immediately before the terminal event, so an unwritable store turned a completed, billed model call into a stream error: noLlmStreamCompleted, no report, no usage or cost, andcomplete()throwing too.removeruns from the evict-and-retry-fresh decision, which the provider awaits outside its try/catch, so the same store turned a classifiedLlmStreamFailedinto an unhandled stream error._flushnow degrades exactly as_loaddoes. The guard went into the store rather than into the provider's call ordering because that is where the contract is stated, and because it covers both call sites: makingrecordfire-and-forget would have left the evict path open and converted the throw into an unhandled async error. Little is actually lost — both mutators update the in-memory cache before flushing, so the session survives in-process and only a restart pays the one fresh call the contract allows for. Coverage: four tests driving an unwritable store (a path whose parent is an ordinary file, so it reproduces without depending on the uid the suite runs as) throughput,remove, a successful call, and the evict path. -
isolate_streaming/:doc/isolate_streaming.mdhad drifted from the module in three places at once, all of them the same failure — the prose was written before the module reached its current shape and was not re-read as the module moved. TheKindcolumn called 8 of its 12 rows something the declaration does not say (twoexceptionrows for types that arefinal class ... implements Exception, and sixclassrows forfinal class); the Overview row forIsolateCancellationRegistrystill summarised the unknown-token cancel as "remembers late cancels", the pre-fix half of a rule that has two branches; and the Concurrency section repeated that same half-truth a third time while asserting the tests use hand-heldCompleters "rather than a real isolate" — which the sendability group (a liveSendPort) and the real-isolate cancellation demo inexample/isolate_streaming/had both already falsified. All corrected against the declarations and the tests. The workspace's completion mirror of this package was accurate throughout and was used as the reference; the drift was one-sided. Two of the three defects were found by auditing the file rather than from the report, and the reported counts were themselves off (8 of 12 rows, not nine). -
isolate_streaming/:BackpressureTrackerlet the closed flag decide whether an argument was valid.grantreturned on_closedbefore itsn <= 0check, sogrant(0)threw while open and passed in silence once closed — the same call answered two ways by state the caller may not know, and both documents stated the guard unconditionally.consumehad no closed check at all, so it kept drawing down a ledger nobody was keeping, and could raise the over-consumeStateErroragainst a balance that had stopped meaning anything. The two methods disagreed with each other andgrantdisagreed with its own documentation. Both now follow one rule: validate the argument, then consult the closed flag. A nonsensical count is a caller bug in either state; a state-dependent effect is skipped once the ledger closes. Coverage: four tests beside the existing close test intest/isolate_streaming_test.dart. -
isolate_streaming/: neither document said what a closed tracker does withconsume, which left the primitive's whole close path unspecified — the todo's own note called this the real question, the line move being the easy half. Written down now, on the class and in both documents: afterclosethe ledger stops accounting (grant/consumeno-op,creditsfreezes) and onlyawaitCreditreports the closure. Makingconsumethrow instead was considered and rejected on evidence, not symmetry: a close routinely lands mid-iteration, afterawaitCreditreturned and the chunk went out but before the trailingconsume, and intom_brain_memory's producer that throw would land outside itson StateErrorguard and in the generic catch — reporting a clean close to the host as a stream error.awaitCreditstays the single unwind point because it is the only one callers already handle. -
isolate_streaming/:IsolateCancellationRegistry.isCancelledwas documented as answering "whether or not it is currently registered", which it has not done since the post-close-cancel fix and could not do cheaply.dispose()removes the entry, so a request that really was cancelled readsfalsefrom the registry a moment later — while its handle, which holds the entry directly, still readstrue. The doc promised the durable reading and the code gives the in-flight one, and the difference is a silently wrong answer rather than an error. The contract is now the narrow one on both the dartdoc and indoc/isolate_streaming.md: the registry answers for what it currently holds (an in-flight entry, or a remembered pre-open cancel), the handle is the durable answer for one request, and callers should prefer the handle wherever one is in scope. Making the registry durable instead was rejected because it recreates the leak the post-close drop exists to prevent — ids are never recycled, so a cancelled-and-closed record can only grow for the executor's lifetime. Coverage:registry isCancelled is scoped to the registration windowanda remembered pre-open cancel is inside the windowintest/isolate_streaming_test.dart, which assert both sides of the divergence; the neighbouring post-close-cancel test now says in a comment that itsisFalsefollows from this contract rather than stating one of its own. -
isolate_streaming/:doc/isolate_streaming.mdand the example described the cancellation split backwards — registry on the host, handle shipped across to the worker — where the source puts the registry and the handle inside the executor's isolate and sends only the token. The guide's snippet was not merely differently-worded but unrunnable: the handle holds aCompleter, so the firstSendPort.sendraisesArgumentError: object is unsendable, with nothing to suggest the document had caused it. The prose also contradicted itself within four lines, calling the handle a "worker-side view" and then having the host construct it. Both now describe the split the source implements, and the cancellation demo spawns a real isolate instead of faking the boundary with futures — faking it is what let an inverted arrangement look as convincing as the correct one. Two adjacent inaccuracies found in the same pass are fixed too: the registry does not remember every late cancel (an id it has already seen is dropped, or the pending set would grow forever), andIsolateRequestGuardis host-side. Coverage: the newsendability across an isolate boundarygroup intest/isolate_streaming_test.dartpins which members may cross — the fact the whole design rests on, previously asserted nowhere, which is why the documents could disagree with the code for so long. -
agent/: a bound bridge that was up and answering could be reported as gone. Four defaults named the bridge host and one disagreed —AgentSettings.bridgeHostwas'localhost'whereBridgeServer,BridgeConnectionServiceandBridgeChoice.fromMapall said'127.0.0.1'— and both places that compare a binding to a discovered server compared the host strings.localhostand127.0.0.1are one endpoint and two strings, so in the package's own default configurationReconnectCoordinatorresolvedstillGonefor a live bridge (the §6.1 still-gone modal, and no auto-resend) and the picker'sisBoundshowed the bound window as merelyavailable. Fixed at both levels: the newdefaultBridgeHostconstant supplies every host default so they cannot drift again, and the newBridgeChoice.matchescompares endpoints rather than strings, so a host typed by hand into the settings file costs nothing either. Coverage:test/bridge_connection_test.dart,test/reconnect_test.dart, andconnection_test.dartintom_forge_agenticfor the picker side. -
agent/bridge_connection.dart:BridgeChoiceStore.load()had notryat all — alone among the ten sidecar stores. An unreadable file raisedFileSystemExceptionand a syntactically damaged one raisedYamlException, so a hand-edited sidecar crashed the editor on launch instead of costing a re-pick. It now degrades like its nine siblings (FileSystemException/FormatException→null) and reads through the shareddecodeAgentYaml, which makes the root-shape check the same one they make. -
agent/bridge_connection.dart:BridgeChoice.fromMapcast rather than type-tested, so a mis-typed value —port: "19900", the classic hand-edit slip — threw aTypeErrorstraight past the store's catch. It now defaults an unusable value exactly as it already defaulted an absent one. Coverage for both defects:test/bridge_connection_test.dart. -
agent/: every sidecar store caughtFileSystemExceptionandFormatExceptionaround its load, which answers a file that will not parse but not a file that parses into the wrong shape. An entry whoseidwas absent or non-string — the shape a hand-edit produces when a line is deleted — threw aTypeErrorout offromYaml, past both catches and into the caller. Entries the file cannot supply are now skipped individually, so one damaged row costs that row rather than the whole file. The nested lists (QueuedPrompt.prePrompts/.followUps,TimedRequest.scheduledTimes,AgentProfile.enabledTools,TrailPair.answer) skip bad elements the same way. Coverage:test/sidecar_shape_damage_test.dart.
Changed #
agent/timed_request.dart:TimedRequest.scheduleModeis now a required constructor parameter (it defaulted toScheduleMode.interval). The default was introduced by the port — the upstreamtom_vscode_scripting_api.TimedRequestrequires it — and it meant a request built without the parameter became an interval request nobody chose, withintervalMinutesnullable beside it. Its payload stays optional: these are editor working state, and "scheduled, but no times entered yet" is a state the type has to be able to hold. The persisted key also stays optional, coerced byScheduleMode.fromValue, so a hand-edited file costs a re-pick rather than the entry.agent/agent_sidecar.dart(new, exported):readAgentYamlFile,decodeAgentYamlListanddecodeAgentYamlValue— plusdecodeAgentYamlEntriesinagent/agent_yaml.dartfor the nested lists. The ten stores had ten copies of oneload()body, and the copies had drifted exactly as copies do: one shipped with notryat all (above), and all ten mistook "parses as YAML" for "is shaped like the model". All ten now read through this one path, so "every sidecar degrades the same way" is a property of one function rather than a claim about ten bodies. No behaviour change beyond the fixes above.
Features #
agent/: added the editor-facing agent data models for the TomSpecs editor (tom_specs_editor_specification.md§20 step 2) —AgentProfile(incl. the editor-specificinterruptRetryPrefix, N10), the prompt-queue model (QueuedPrompt/QueuedPrePrompt/QueuedFollowUpPromptwith statuses, repeats, reminders and multi-transport routing), the chat / trail model (ChatMessage/TrailPair),ReminderTemplateandTimedRequest. All models round-trip through YAML via the newencodeAgentYaml/decodeAgentYamlcodec.agent/: addedEditorPlaceholderBindings, a sync + lenient binder over the sharedPlaceholderResolverthat supports${name},${name?},${env:NAME}and the{{name}}alias, and rejects the${{ … }}expression form withPlaceholderExpressionsUnsupportedErrorrather than executing it (§11.5, no JS). Coverage:test/agent_models_test.dart.
1.6.0 #
Features #
llm/: migrated the LLM provider contract (LlmProvider,WirePrompt,LlmOptions,LlmCallReport,CapturedWirePrompt, theLlmStreamEventfamily,LlmFailure) and the Anthropic Agent-SDK provider path (AgentSdkLlmProvider, theAgentSdkSession*strategies / store,agentSdkLooksLikeSessionError) out of thetom_brainsubstrate / run layers so the provider seam is reusable outside the brain (the TomSpecs editor consumes it over the VS Code bridge). Added thetom_vscode_scripting_apidependency. The substrate-coupled HTTP / stub providers are intentionally not migrated (see the quest'scompletion_steps.tom_specs.md, CS-04). Coverage:test/agent_sdk_provider_test.dart,test/agent_sdk_session_test.dart.
1.5.0 #
Documentation #
isolate_streaming/: addeddoc/isolate_streaming.md(a module guide for the cancellation family, the per-stream close signal, the backpressure ledger, the request guard, and the exception registry) and a runnableexample/isolate_streaming/isolate_streaming_example.dart. Filled the one remaining dartdoc gap (IsolateStreamCloseSignal.closeRequested). No public API change; the existing isolate-streaming test files remain the coverage.mcp_auth/: addeddoc/mcp_auth.md(the bearer-token wire contract, the authenticator interface, the closed failure taxonomy, and the tier boundary) and a runnableexample/mcp_auth/mcp_auth_example.dartthat plays both sides of an MCPinitializehandshake. No public API change; the existingmcp_auth_test.dartremains the coverage.placeholders/: addeddoc/placeholders.md(the four placeholder forms,resolve/resolveSync, the lexical scope stack, the${{ … }}expression seam, strict/lenient + recursion policy, and the typed failures) and a runnableexample/placeholders/placeholders_example.dart. No public API change; the existingplaceholder_resolver_test.dart/placeholder_stack_test.dartremain the coverage. Flagged (for a follow-up) thatPlaceholderResolveris the package's soledart:ioimport, at odds with thedart:io-free design. (True on the day this shipped; the next commit added a second importer and the count has grown since. See 1.8.0 for the measured position.)
1.4.0 #
Consolidated record of the incremental feature development between 1.0.0 and
the current pubspec.yaml version 1.4.0. These primitives were added across
several unversioned increments; the precise per-release (1.1.0–1.3.0)
boundaries were not recorded at the time, so they are grouped here under the
current package version. Reconstructed from the project's git history.
Added #
- Isolate-streaming infrastructure (
isolate_streaming/): a domain-free worker-isolate streaming layer — cooperativeIsolateCancellation, stream close-signalling, aBackpressureTracker, a per-requestIsolateRequestGuard(worker-death + per-request deadline), and a genericIsolateExceptionRegistrythat reconstructs typed errors across the isolate boundary. - MCP transport-auth contract (
mcp_auth/): the generic bearer-auth contract and MCP authentication helpers, hosted here so transports share one auth abstraction. - Placeholder engine (
placeholders/):PlaceholderResolveras the single${…}engine, with the expression grammar, a resolution stack, the optional${name?}form, and the placeholder error types. - Generic primitives:
CategoryLog(category-tag facade overtomLog),systemClock,AsyncShutdownCoordinator,MapFieldReader,YamlConfigWriter(AST-preserving config writes),promptSha256(content-hash convention),percentileDuration/LatencySummary(nearest-rank percentile maths),deepValueEquals/deepValueHash(collection equality), SQL helpers (blobFromColumn/blobFromColumnOrNull), JSON helpers (decodeJsonObject),formatException, aTokenBucketwith snapshot/restore, token-estimate andTtlCacheutilities, a Kahn topological plan ordering, a domain-free procedure re-rank scorer, a deliberation-cue classifier, a multi-format tool-call text parser, and thePathScope/Deadline/ day-boundary / argument-guard sandbox primitives.
1.0.0 #
- Initial version. Generic agentic building blocks extracted from
tom_brain_substrate:CancellationToken/CancellationTokenSource,OperationCancelled,CloseGuard,buildUniqueById,textPreview,HttpDate, andYamlConfigReader.