Version Packages (alpha) - #81
Merged
Merged
Conversation
github-actions
Bot
force-pushed
the
changeset-release/next
branch
from
July 20, 2026 16:06
7f7cd3d to
86b7ae0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated.
nextis currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, runchangeset pre exitonnext.Releases
@statelyai/agent@2.0.0-alpha.11
Minor Changes
3228715Thanks @davidkpiano! - Public API reorganization: a leaner root barrel, with adapter-author and durable-host plumbing moved behind two new subpaths. Breaking (alpha).New subpaths
@statelyai/agent/steps— the durable, per-model-call step path and decision control-flow:initialAgentStep,transitionAgentStep,resolveAgentStep,getAgentRequests,executeAgentRequest,resolveAgentRequests,resolveDecision,renderDecisionAttempts,PLAN_DONE_EVENT_TYPE(plusAgentStep/AgentRequest/AgentPlanRequest/AgentStepRequest,ResolveAgentRequestsOptions,ResolveDecisionOptions,DecisionLogicConfig).@statelyai/agent/adapter— the adapter-author seam:bindRequestExecutor,buildEnvelopeSchema,parseStructuredEnvelope,getAgentOutputMode,isStructuredOutputSchema,parseOutput,parseModelRef,getJsonSchema,getJsonSchemaSync,isStandardSchema,validateSchemaSync,getMachineStructuralHash,matchesEventPattern(plusStructuredOutputEnvelope,AgentOutputMode).All of the above moved OFF the root barrel — update imports to the new subpaths.
Removed outright
EVENT_TOOL_PREFIX(now internal; it just prefixes generated event tool names assend_event_).extractJsonSchemafrom@statelyai/agent/openai-compat— usegetJsonSchemafrom@statelyai/agent/adapter(identical function).Other changes
PlanLogic— fixes TS4023 "cannot be named" when re-exporting a machine that usesagent.plan.AgentRequestExecutorsslots are now all optional (generateText?,streamText?,decide?); a missing slot is still a clear bind-time error when the machine needs it. Adapter result sets (AiSdkExecutors,OpenAiCompatExecutors) still require all three.SimulationScript.userInputrenamed toinvokes(the by-src scripted-invoke channel forsimulateAgent; unrelated to theagent.userInputactor).f5a9b86Thanks @davidkpiano! - Versioned trace schema, shared identically across the controlled and uncontrolled paths:schemaVersion. EveryonTraceevent now carriesschemaVersion(currently1), exported as the constAGENT_TRACE_SCHEMA_VERSION. Consumers can gate on it.onTraceforprovideExecutors.ProvideExecutorsOptionsgainsonTrace, emitting request-level events (request.start,request.endincl. liftedreasoning,request.error,stream.chunk) with shapes identical torunAgent. Because one bound machine can back many concurrent root actors, envelope state (runId, monotonicseq) is minted per root actor at runtime — two concurrent actors get distinctrunIds and independentseq.traceTransitions(onTrace). New exported xstateinspecthandler that emitsmachine.transitiontrace events sharing the same versioned envelope and per-root-actorseqregistry, so pairing it withprovideExecutors'onTraceyields one ordered stream. The uncontrolled path has norun.start/run.end(no run boundary) by design.Patch Changes
f5a9b86Thanks @davidkpiano! - Examples now import the package by name (@statelyai/agent,@statelyai/agent/ai-sdk,@statelyai/agent/zod) instead of relative../../src/...paths, so each example is copy-paste-able outside the repo. Repo-level tsconfig/vitest aliases keep those names resolving tosrc/for the local dev loop.f5a9b86Thanks @davidkpiano! -runAgent'sinspectoption now accepts an observer object ({ next }) aswell as a function, matching
createActor.@statelyai/inspect'sinspector.inspectnow plugs in directly:runAgent(machine, { inspect: inspector.inspect }).f7d7446Thanks @davidkpiano! - DX pass: onerunAgent, first-class uncontrolled mode, trimmed surface.@statelyai/agent/ai-sdkno longer exportsrunAgentorcreateAgent. It is adapters-only (defineModels,createAiSdkExecutors). Use corerunAgent(machine, { input, executors: createAiSdkExecutors({ models }) }); mix adapters by spreading executor sets.toAiSdkTools,toAiSdkCallSettings,toAiSdkToolChoice,toAiSdkEventTools,toDecisionMessages,isStructuredOutputRequest,extractFirstJsonValue,toOpenAiMessages,toOpenAiCallSettings,toOpenAiTools,toOpenAiEventTools) are no longer exported.extractJsonSchemastays.provideExecutors(machine, executors, options?)binds every agent actor source in one call, returning a machine ready for a plaincreateActor(...)— the uncontrolled-mode counterpart torunAgent.promptandmessagesare missing.setupAgent.fromConfigno longer silently drops transition-levelactions(emits and assigns on transitions now fire).setupAgent.fromConfignow rejects invalid transition targets andonDoneonagent.decideinvokes at build time;lintAgentMachinewarns on undeclaredon:events (undeclared-event).onError.agent-workflow.jsonschema: accepts a root$schemakey; removed the unimplementedqueryLanguageproperty.