Repository navigation
Releases: chily-john/TrailStep
Release list
@trailstep/sub-agents@0.3.1
Patch Changes
-
28e6560: Agents now load the project's context files by default, and the user can
control the whole execution (hygiene) block from the TrailStep config.@trailstep/corechanges the default execution block from
contextFiles: "project-only"tocontextFiles: true."project-only"was
misleading on every provider CLI that has no project-only flag:pi --no-context-filesdisables AGENTS.md/CLAUDE.md discovery entirely, so the
value that claimed to restrict context to the project actually removed it. An
agent with an execution block now loads the project's context files unless it
opts out, and the value stays available for providers that do offer a
project-only flag.@trailstep/corealso addssettings.executionto the TrailStep config, both
globally (settings.execution) and per workflow
(workflows.<id>.settings.execution). The block has the same shape as
AgentExecutionConfig(tools,skills,mcp,extensions,contextFiles)
and is merged field by field with the agent role's own block: step execution >
per-workflow config > global config > role, per field. A config block that
names onlycontextFilestherefore changes only that field and leaves the
role's other fields alone; an explicitfalseor[]overrides a
lower-precedence value. An invalid config block fails fast with a
config-scoped diagnostic before any provider process is spawned, and no block
anywhere still means "render no hygiene args at all".@trailstep/sub-agentsno longer pinscontextFilesin the delegate's lean
execution block, so a delegate turn inherits the framework default and reads
the repository's ownAGENTS.md/CLAUDE.mdinstead of disabling context
discovery. The rest of the lean block is unchanged:--no-skills,--no-mcp
and--no-extensionsare still rendered, and all tools stay available.Behavior is otherwise preserved.
-
337eab6: Coerce stringified workflow input scalars and enrich the MCP tool descriptions.
@trailstep/core: workflow input is now coerced against the workflow's own
input schema before validation. A string that unambiguously matches the
declared scalar type becomes that type -- a plain decimal becomes anumber
orinteger, and exactlytrue/falsebecomes aboolean-- including in
nested object properties and array items. Ambiguous strings ("abc",
"25abc","1e5"," 25 ","yes") and schemas without a declared type are
left untouched, so a genuinely invalid input still fails with the same
validation_faileddiagnostics. The coercion is opt-in at the workflow-input
call site; the sharedjsonSchema()/assert()validators used for agent
step outputs and documents are unchanged. The coerced value is what the run
persists, so a replayed or resumed run validates the same value.@trailstep/mcp: thetrst_run_workflowdescription now says that a
per-workflow tool (for exampletrst_delegateortrst_take-it-away) should
be preferred when one exists, and thetrst_watchdescription now says that
the byte-offset cursor is persisted per run, that an unknown run id returns an
error result instead of waiting, and how it pairs withtrst_run_workflowand
trst_answer. The server also sendsinstructionson initialize pointing at
thetrailstep://instructionsresource.@trailstep/sub-agents: the delegate workflow descriptions (and the
delegateParalleldescription) now say what the workflow does, whatmode
selects, thatmaxTurnsbounds the number of turns, and that a delegate which
needs a decision returns a question answered withtrst_answerand continued
withtrst_resume. The generated per-workflow tool JSON takes its description
from the workflow description, so the live tools pick this up. The shipped
delegate skill files are built fromskillDescription/skillFocusand are
unchanged.@trailstep/cli: the pi MCP server description now points at the
trailstep://instructionsresource that documents the run -> watch -> answer
-> resume loop.Behavior is otherwise preserved.
-
51d35f5: Share the remaining duplicated helpers.
@trailstep/authoring: exports the canonicalnonEmptyOptionaland
nonEmptyOrDefaultstring helpers (packages/authoring/src/strings.ts) so that
workflow packages share one "trim, then drop empty" definition.@trailstep/cli: the six per-commandparseFlagscopies (add,agents,
init,mcp,providers,remove) now share one shape-driven parser
(packages/cli/src/internals/command-framework/flags.ts). Each command keeps
parsing exactly what it parsed before — same accepted flags, same error
messages, same empty-value and missing-value handling — and the shared
agent_targets_unavailableguard now lives in one place
(packages/cli/src/internals/agent-config/agent-targets-error.ts) used by both
theaddandagentscommands.@trailstep/create-flows,@trailstep/sub-agents: the duplicated
nonEmptyOptionalhelper is imported from@trailstep/authoring, and the
worktree input subschema is declared once
(delegateWorktreeInputShapeinpackages/sub-agents/src/delegate/schema.ts)
and reused by the delegate and delegate-parallel input shapes.This is a behavior-preserving refactor: no public workflow shape, CLI flag
behavior, or runtime behavior changed. -
Updated dependencies [51d35f5]
- @trailstep/authoring@0.4.0
@trailstep/provider-pi@0.3.1
Patch Changes
-
51d35f5: Split the remaining large modules into focused ones, and align the CLI's
official-provider capability metadata with the provider package manifests.@trailstep/coresplits the resume replay
(runtime/resume/replay-to-waiting-step/) into the replay entry point, the
wait-event helpers, and the waiting-step phase prefix replay. The resume
behavior and the emitted event trail are unchanged.@trailstep/clisplitscommands/update/update-command.ts,
internals/mcp-tools/mcp-registration.tsand
commands/agents/agents-setup-wizard.tsinto focused modules (preflight
scanning, recommended config, dependency install, MCP server command, agent
target detection, add-mcp request, manual fallback text, scope prompts, named
agent flow, workflow role flow). The public behavior, prompts and help output
are unchanged.The provider package manifest is the single source of truth for a provider
CLI's capabilities. The CLI'sofficialProviderSpecFor()table now mirrors it
(model support, model discovery, thinking support and thinking levels), the Pi
provider manifest declares itspi --list-modelsdiscovery spec, and a new
official-providerstest pins the agreement between the CLI table and the
@trailstep/provider-*manifests.
@trailstep/mcp@0.3.0
Minor Changes
-
65f6a96: Publish the MCP package with a declared public surface and complete npm
metadata.The MCP package was published without an
exportsmap, withoutbugsand
homepagemetadata, and without aLICENSEfile in its tarball, and it was
not covered by the repository's public-package checks - so none of that was
caught before a release.- The package now declares its public entry point through
exports, matching
every other published TrailStep package. The./package.jsonsubpath stays
reachable, because the CLI resolves it to locate theadd-mcpbinary.
BREAKING (minor, because the package is pre-1.0): deep imports such as
@trailstep/mcp/dist/tools/trst_watch.jsno longer resolve. Import from
@trailstep/mcpinstead. - The
bugsandhomepagemetadata are now declared, and the tarball
includes theLICENSEfile the manifest already promised. - The package is now part of the public-package metadata check and the npm
pack dry-run, so a packaging mistake fails CI instead of a release.
- The package now declares its public entry point through
-
94788f4: Make the MCP server correct under real-world conditions.
BREAKING (minor, because the package is pre-1.0): the legacy
run_workflow
module and therunWorkflow/RunWorkflowResultaliases were removed. Use
runWorkflowTooland theRunWorkflowToolOptions/RunWorkflowToolResult
types instead. Therun_workflowTOOL itself is unchanged and still
registered on the server.The MCP tools are thin adapters over the real CLI seams, and several of them
were not correct:trst_watchresolved runs under a hardcoded<cwd>/.trailstep/runsand
ignoredTRAILSTEP_RUNS_ROOT, so a run started under a custom runs root
could not be watched by name. It now resolves the runs root the same way
the rest of the system does.trst_run_workflowreportedstatus: "started"even when the background
process never started. It now verifies that the run materialized and reports
status: "failed"with an error when it did not.- The Windows path fallback spawned the CLI through
cmd.exewith the
--inputJSON unquoted, which mangled the input. The fallback is now
refused with a clear pointer toTRAILSTEP_CLI_ENTRY. - The watch cursor wrote its temp file to a path that collided between
overlapping watch calls in one process, so two calls could clobber each
other's cursor. The temp name is now unique per write. trst_resumespawned the continue process without the caller's
environment, so a caller-suppliedTRAILSTEP_RUNS_ROOTor
TRAILSTEP_CLI_ENTRYapplied to resolution but not to the run.trst_answerdiscarded the persisted-answer report when the follow-up
continue failed. It now returnspersisted: truetogether with the
continue error, so the caller can tell the answer was saved.
-
51d35f5: Share the run-artifact helpers with the CLI instead of copying them.
The MCP package cannot import the CLI package - the CLI already depends on the
MCP package, so that would be a dependency cycle - which is why the shared
helpers had been duplicated. They now live in@trailstep/core, next to the
run-artifact layout they describe, and both the CLI and the MCP package use
them.- The MCP package no longer carries its own copy of the wait-file helpers.
- Wait-answer writes go through the shared atomic write, so an answer file is
never observed half-written. - Run-name generation is unified. The CLI and the MCP now derive the same run
name for the same workflow. Two visible differences remain, both noted
because they change a name a caller sees:- a bundle reference (
pkg#workflow) started through the MCP tool now
yieldsworkflow-<timestamp>-<suffix>, where the reference's export name
is used rather than the wholepkg-workflowstring; - for a direct file reference the MCP tool uses the file name, while the
CLI uses the workflow's declared id. These differ only when a workflow
file's name is not its declared id.
- a bundle reference (
- The two divergent CLI-entry resolvers in the MCP package (one reading
process.argv, one walking upnode_modules) are now one module with one
resolution strategy. The Windows path fallback refusal is preserved.
Patch Changes
-
94788f4: Make cancelled runs continuable and keep generated MCP tools in step with the
workflows they describe.- A cancelled run can be continued again. The cancellation marker is consumed
when the run is continued, so a cancelled run is no longer permanently
unrunnable, andtrailstep cancel --clearremoves a pending cancellation
without starting a run. - The CLI cancel command now creates events through the core helpers, so it
emits conforming event ids and appends through the shared append path
instead of a hand-rolled id and a raw append that could interleave with
the live run. A cancelled run always reaches its terminal cancelled event. trailstep removenow deletes the generated MCP tool JSON for the workflow
it removes, and the MCP server skips per-workflow tool files whose workflow
no longer resolves, so a removed workflow stops publishing a dead tool.- The MCP server reuses the core MCP config parsing instead of re-implementing
it, which removes a source of drift between the two.
- A cancelled run can be continued again. The cancellation marker is consumed
-
337eab6: Coerce stringified workflow input scalars and enrich the MCP tool descriptions.
@trailstep/core: workflow input is now coerced against the workflow's own
input schema before validation. A string that unambiguously matches the
declared scalar type becomes that type -- a plain decimal becomes anumber
orinteger, and exactlytrue/falsebecomes aboolean-- including in
nested object properties and array items. Ambiguous strings ("abc",
"25abc","1e5"," 25 ","yes") and schemas without a declared type are
left untouched, so a genuinely invalid input still fails with the same
validation_faileddiagnostics. The coercion is opt-in at the workflow-input
call site; the sharedjsonSchema()/assert()validators used for agent
step outputs and documents are unchanged. The coerced value is what the run
persists, so a replayed or resumed run validates the same value.@trailstep/mcp: thetrst_run_workflowdescription now says that a
per-workflow tool (for exampletrst_delegateortrst_take-it-away) should
be preferred when one exists, and thetrst_watchdescription now says that
the byte-offset cursor is persisted per run, that an unknown run id returns an
error result instead of waiting, and how it pairs withtrst_run_workflowand
trst_answer. The server also sendsinstructionson initialize pointing at
thetrailstep://instructionsresource.@trailstep/sub-agents: the delegate workflow descriptions (and the
delegateParalleldescription) now say what the workflow does, whatmode
selects, thatmaxTurnsbounds the number of turns, and that a delegate which
needs a decision returns a question answered withtrst_answerand continued
withtrst_resume. The generated per-workflow tool JSON takes its description
from the workflow description, so the live tools pick this up. The shipped
delegate skill files are built fromskillDescription/skillFocusand are
unchanged.@trailstep/cli: the pi MCP server description now points at the
trailstep://instructionsresource that documents the run -> watch -> answer
-> resume loop.Behavior is otherwise preserved.
-
Updated dependencies [3d3dc86]
-
Updated dependencies [51d35f5]
-
Updated dependencies [28e6560]
-
Updated dependencies [3d3dc86]
-
Updated dependencies [94788f4]
-
Updated dependencies [51d35f5]
-
Updated dependencies [337eab6]
-
Updated dependencies [51d35f5]
-
Updated dependencies [81a4942]
- @trailstep/core@0.6.0
@trailstep/create-flows@0.3.7
Patch Changes
-
51d35f5: Share the remaining duplicated helpers.
@trailstep/authoring: exports the canonicalnonEmptyOptionaland
nonEmptyOrDefaultstring helpers (packages/authoring/src/strings.ts) so that
workflow packages share one "trim, then drop empty" definition.@trailstep/cli: the six per-commandparseFlagscopies (add,agents,
init,mcp,providers,remove) now share one shape-driven parser
(packages/cli/src/internals/command-framework/flags.ts). Each command keeps
parsing exactly what it parsed before — same accepted flags, same error
messages, same empty-value and missing-value handling — and the shared
agent_targets_unavailableguard now lives in one place
(packages/cli/src/internals/agent-config/agent-targets-error.ts) used by both
theaddandagentscommands.@trailstep/create-flows,@trailstep/sub-agents: the duplicated
nonEmptyOptionalhelper is imported from@trailstep/authoring, and the
worktree input subschema is declared once
(delegateWorktreeInputShapeinpackages/sub-agents/src/delegate/schema.ts)
and reused by the delegate and delegate-parallel input shapes.This is a behavior-preserving refactor: no public workflow shape, CLI flag
behavior, or runtime behavior changed. -
3d3dc86: Verticalize the CLI internals and the create-flows shared directory.
@trailstep/cli: the loosepackages/cli/src/internals/root files that formed
one concern now live inpackages/cli/src/internals/command-framework/
(command.types.ts,command.types.test.ts,command-registry.ts,
command-registry.test.ts), andofficial-provider-specs.tswas folded into
packages/cli/src/internals/providers/official-providers.tsalongside the
existing official-provider package helpers. Every importer was updated.@trailstep/create-flows: the misnamedsrc/feature-implementation/shared/
directory was split. The cross-flow contracts imported by the sibling
grill-it-awayandtake-it-awayflows (agent-roles.ts,input-schema.ts,
output-schema.ts,constants.ts) moved to package level at
packages/create-flows/src/shared/. The feature-implementation-only files
(story-state.ts,story-view.ts,review-schema.ts) stayed inside
packages/create-flows/src/feature-implementation/shared/story/, and the prompt
fragment markdown files moved to
packages/create-flows/src/feature-implementation/prompts/.This is a behavior-preserving refactor: no public export, workflow shape, or
runtime behavior changed. -
Updated dependencies [51d35f5]
- @trailstep/authoring@0.4.0
@trailstep/core@0.6.0
Minor Changes
-
51d35f5: Complete the cancellation lifecycle: the cancel marker is a pending request, not
a record.- The runtime consumes the cancel marker when it honours a cancellation. A run
that ends cancelled no longer leaves acancel.jsonbehind, so a later
cancel, continue, or retry can tell "requested but not yet acted on" from
"already honoured and the run is over". The event trail
(workflow.cancelRequested+workflow.cancelled) remains the record. - A cancelled run can be retried.
trailstep retry <workflow-ref> <run>on a
cancelled run consumes the pending cancellation and re-executes the step the
cancellation interrupted instead of failing with "no latest unresolved
failure". The retry reports its target through aworkflow.retryStartedevent
that carries the cancelled step and the cancellation event it replaces. trailstep retryclears a pending cancellation for the run it targets, the
same waytrailstep continuedoes, and reports waiting and cancelled retry
results instead of treating them as failures.trailstep cancelreports the run's real terminal status: a failed run is
reported as already failed (not already completed), and a stale marker left
behind by an already honoured cancellation never turns an already cancelled
run back into a "cancellation requested" report.
- The runtime consumes the cancel marker when it honours a cancellation. A run
-
3d3dc86: Add canonical shared guards and the TrailStep directory-name constant.
@trailstep/corenow exportsisRecord,isPlainObject,isNodeErrorand
errorMessagefrom a single canonical module (packages/core/src/json/guards.ts)
plus theTRAILSTEP_DIR_NAMEconstant (.trailstep) from the run-storage
module. The package internals were de-duplicated to use these exports instead
of the previously duplicated local helper copies, and the scattered.trailstep
path literals now use the shared constant. This is a behavior-preserving
refactor: the strict "plain object" definition (object, notnull, prototype
Object.prototypeornull) is now the single canonical one. -
94788f4: Make run artifacts durable under concurrent access.
BREAKING (minor, because the package is pre-1.0): the
deferEngineInit
export was removed. It was a no-op that was never called; use the runtime's
own initialization instead.- Run state, global state, branch state and track artifacts are now written
atomically (temp file in the same directory plus a rename), so a reader
never observes a partially written document. The CLI wait-answer write
used bytrailstep answeris atomic in the same way. - A replace-rename on Windows fails with
EPERMwhile another process holds
the target open. The runtime's own wait poller and the dashboard both read
the answer file while it is being written, so a concurrent reader could
turn the write into a hard failure. The rename now retries with a longer
bounded backoff. - The queued run-state and global-state writes no longer swallow a
persistence failure. Each failure surfaces exactly once to the caller that
triggered it, a failed read is retried instead of poisoning the queue, and
a reporting failure can no longer deadlock the queue. - The vestigial
deferEngineInitexport and the legacy MCPrun_workflow
re-export were removed.
- Run state, global state, branch state and track artifacts are now written
-
51d35f5: Harden the remaining unguarded parses, swallowed promises and failure inspection.
@trailstep/corenow exportsisFailureLikeErrorandreadFailureCodefrom
the failure contract, so consumers no longer hand-roll duplicate
failure-shape checks.- Step control and interactive agent execution no longer discard a detached
promise rejection. Abort and cancellation rejections stay quiet, while an
unexpected failure is reported (injectable viaonUnexpectedError). trailstep watchreports and skips malformed or torn event lines instead of
aborting the watcher.
-
81a4942: Make automatic step retry transient-only.
Automatic step retry now re-runs a step only when its failure is classified as
transient (step_timeout,agent_provider_unavailable,agent_provider_failed,
agent_provider_spawn_error,agent_provider_timeout, or a failure explicitly
marked retryable). Every other failure — including new failure codes that are
not on the transient allowlist — is permanent and fails on the first attempt
with the same event trail as before. Astep.attemptFailedevent is emitted
only when a retry actually follows.The retry policy gains an optional
retryOn?: "transient" | "always"setting
(step > workflow > global, default"transient") so a step, workflow, or
global configuration can opt into retrying every failure.
Patch Changes
-
3d3dc86: Break the import cycles in the authoring, provider-catalog and CLI registry
layers.@trailstep/corenow keeps mutually recursive type declarations in a single
leaf module each — the agent step request config moved next to the agent
adapter contract (contracts/agents/agent-adapter.types.ts), the workflow
invocation node moved next to theWorkflowcontract
(authoring/workflow/workflow.types.ts), and the durable runEventand the
interactive process contract moved intocontracts/events/event.types.tsand
contracts/process/interactive-process.types.ts.@trailstep/cliextracts the
shared registry vocabulary into
internals/workflow-registry/workflow-registry.types.tsand the path-shaped
reference check intointernals/workflow-reference/direct-file-reference.ts,
so the workflow registry and workflow resolution modules no longer import each
other. This is a behavior-preserving refactor: the public API of both packages
is unchanged and no runtime behavior changed. -
28e6560: Agents now load the project's context files by default, and the user can
control the whole execution (hygiene) block from the TrailStep config.@trailstep/corechanges the default execution block from
contextFiles: "project-only"tocontextFiles: true."project-only"was
misleading on every provider CLI that has no project-only flag:pi --no-context-filesdisables AGENTS.md/CLAUDE.md discovery entirely, so the
value that claimed to restrict context to the project actually removed it. An
agent with an execution block now loads the project's context files unless it
opts out, and the value stays available for providers that do offer a
project-only flag.@trailstep/corealso addssettings.executionto the TrailStep config, both
globally (settings.execution) and per workflow
(workflows.<id>.settings.execution). The block has the same shape as
AgentExecutionConfig(tools,skills,mcp,extensions,contextFiles)
and is merged field by field with the agent role's own block: step execution >
per-workflow config > global config > role, per field. A config block that
names onlycontextFilestherefore changes only that field and leaves the
role's other fields alone; an explicitfalseor[]overrides a
lower-precedence value. An invalid config block fails fast with a
config-scoped diagnostic before any provider process is spawned, and no block
anywhere still means "render no hygiene args at all".@trailstep/sub-agentsno longer pinscontextFilesin the delegate's lean
execution block, so a delegate turn inherits the framework default and reads
the repository's ownAGENTS.md/CLAUDE.mdinstead of disabling context
discovery. The rest of the lean block is unchanged:--no-skills,--no-mcp
and--no-extensionsare still rendered, and all tools stay available.Behavior is otherwise preserved.
-
337eab6: Coerce stringified workflow input scalars and enrich the MCP tool descriptions.
@trailstep/core: workflow input is now coerced against the workflow's own
input schema before validation. A string that unambiguously matches the
declared scalar type becomes that type -- a plain decimal becomes anumber
orinteger, and exactlytrue/falsebecomes aboolean-- including in
nested object properties and array items. Ambiguous strings ("abc",
"25abc","1e5"," 25 ","yes") and schemas without a declared type are
left untouched, so a genuinely invalid input still fails with the same
validation_faileddiagnostics. The coercion is opt-in at the workflow-input
call site; the sharedjsonSchema()/assert()validators used for agent
step outputs and documents are unchanged. The coerced value is what the run
persists, so a replayed or resumed run validates the same value.@trailstep/mcp: thetrst_run_workflowdescription now says that a
per-workflow tool (for exampletrst_delegateortrst_take-it-away) should
be preferred when one exists, and thetrst_watchdescription now says that
the byte-offset cursor is persisted per run, that an unknown run id returns an
error result instead of waiting, and how it pairs withtrst_run_workflowand
trst_answer. The server also sendsinstructionson initialize pointing at
thetrailstep://instructionsresource.@trailstep/sub-agents: the delegate workflow descriptions (and the
delegateParalleldescription) now say what the workflow does, whatmode
selects, thatmaxTurnsbounds the number of turns, and that a delegate which
needs a decision returns a question answered withtrst_answerand continued
withtrst_resume. The generated per-workflow tool JSON takes its description
from the workflow description, so the live tools pick this up. The shipped
delegate skill files are built fromskillDescription/skillFocusand are
unchanged.@trailstep/cli: the pi MCP server description now points at the
trailstep://instructionsresource that documents the run -> watch -> answer
-> resume loop.Behavior is otherwise preserved.
-
51d35f5: Split the...
@trailstep/cli@0.8.0
Minor Changes
-
51d35f5: Complete the cancellation lifecycle: the cancel marker is a pending request, not
a record.- The runtime consumes the cancel marker when it honours a cancellation. A run
that ends cancelled no longer leaves acancel.jsonbehind, so a later
cancel, continue, or retry can tell "requested but not yet acted on" from
"already honoured and the run is over". The event trail
(workflow.cancelRequested+workflow.cancelled) remains the record. - A cancelled run can be retried.
trailstep retry <workflow-ref> <run>on a
cancelled run consumes the pending cancellation and re-executes the step the
cancellation interrupted instead of failing with "no latest unresolved
failure". The retry reports its target through aworkflow.retryStartedevent
that carries the cancelled step and the cancellation event it replaces. trailstep retryclears a pending cancellation for the run it targets, the
same waytrailstep continuedoes, and reports waiting and cancelled retry
results instead of treating them as failures.trailstep cancelreports the run's real terminal status: a failed run is
reported as already failed (not already completed), and a stale marker left
behind by an already honoured cancellation never turns an already cancelled
run back into a "cancellation requested" report.
- The runtime consumes the cancel marker when it honours a cancellation. A run
-
94788f4: Make cancelled runs continuable and keep generated MCP tools in step with the
workflows they describe.- A cancelled run can be continued again. The cancellation marker is consumed
when the run is continued, so a cancelled run is no longer permanently
unrunnable, andtrailstep cancel --clearremoves a pending cancellation
without starting a run. - The CLI cancel command now creates events through the core helpers, so it
emits conforming event ids and appends through the shared append path
instead of a hand-rolled id and a raw append that could interleave with
the live run. A cancelled run always reaches its terminal cancelled event. trailstep removenow deletes the generated MCP tool JSON for the workflow
it removes, and the MCP server skips per-workflow tool files whose workflow
no longer resolves, so a removed workflow stops publishing a dead tool.- The MCP server reuses the core MCP config parsing instead of re-implementing
it, which removes a source of drift between the two.
- A cancelled run can be continued again. The cancellation marker is consumed
Patch Changes
-
3d3dc86: Break the import cycles in the authoring, provider-catalog and CLI registry
layers.@trailstep/corenow keeps mutually recursive type declarations in a single
leaf module each — the agent step request config moved next to the agent
adapter contract (contracts/agents/agent-adapter.types.ts), the workflow
invocation node moved next to theWorkflowcontract
(authoring/workflow/workflow.types.ts), and the durable runEventand the
interactive process contract moved intocontracts/events/event.types.tsand
contracts/process/interactive-process.types.ts.@trailstep/cliextracts the
shared registry vocabulary into
internals/workflow-registry/workflow-registry.types.tsand the path-shaped
reference check intointernals/workflow-reference/direct-file-reference.ts,
so the workflow registry and workflow resolution modules no longer import each
other. This is a behavior-preserving refactor: the public API of both packages
is unchanged and no runtime behavior changed. -
94788f4: Make run artifacts durable under concurrent access.
BREAKING (minor, because the package is pre-1.0): the
deferEngineInit
export was removed. It was a no-op that was never called; use the runtime's
own initialization instead.- Run state, global state, branch state and track artifacts are now written
atomically (temp file in the same directory plus a rename), so a reader
never observes a partially written document. The CLI wait-answer write
used bytrailstep answeris atomic in the same way. - A replace-rename on Windows fails with
EPERMwhile another process holds
the target open. The runtime's own wait poller and the dashboard both read
the answer file while it is being written, so a concurrent reader could
turn the write into a hard failure. The rename now retries with a longer
bounded backoff. - The queued run-state and global-state writes no longer swallow a
persistence failure. Each failure surfaces exactly once to the caller that
triggered it, a failed read is retried instead of poisoning the queue, and
a reporting failure can no longer deadlock the queue. - The vestigial
deferEngineInitexport and the legacy MCPrun_workflow
re-export were removed.
- Run state, global state, branch state and track artifacts are now written
-
51d35f5: Harden the remaining unguarded parses, swallowed promises and failure inspection.
@trailstep/corenow exportsisFailureLikeErrorandreadFailureCodefrom
the failure contract, so consumers no longer hand-roll duplicate
failure-shape checks.- Step control and interactive agent execution no longer discard a detached
promise rejection. Abort and cancellation rejections stay quiet, while an
unexpected failure is reported (injectable viaonUnexpectedError). trailstep watchreports and skips malformed or torn event lines instead of
aborting the watcher.
-
337eab6: Coerce stringified workflow input scalars and enrich the MCP tool descriptions.
@trailstep/core: workflow input is now coerced against the workflow's own
input schema before validation. A string that unambiguously matches the
declared scalar type becomes that type -- a plain decimal becomes anumber
orinteger, and exactlytrue/falsebecomes aboolean-- including in
nested object properties and array items. Ambiguous strings ("abc",
"25abc","1e5"," 25 ","yes") and schemas without a declared type are
left untouched, so a genuinely invalid input still fails with the same
validation_faileddiagnostics. The coercion is opt-in at the workflow-input
call site; the sharedjsonSchema()/assert()validators used for agent
step outputs and documents are unchanged. The coerced value is what the run
persists, so a replayed or resumed run validates the same value.@trailstep/mcp: thetrst_run_workflowdescription now says that a
per-workflow tool (for exampletrst_delegateortrst_take-it-away) should
be preferred when one exists, and thetrst_watchdescription now says that
the byte-offset cursor is persisted per run, that an unknown run id returns an
error result instead of waiting, and how it pairs withtrst_run_workflowand
trst_answer. The server also sendsinstructionson initialize pointing at
thetrailstep://instructionsresource.@trailstep/sub-agents: the delegate workflow descriptions (and the
delegateParalleldescription) now say what the workflow does, whatmode
selects, thatmaxTurnsbounds the number of turns, and that a delegate which
needs a decision returns a question answered withtrst_answerand continued
withtrst_resume. The generated per-workflow tool JSON takes its description
from the workflow description, so the live tools pick this up. The shipped
delegate skill files are built fromskillDescription/skillFocusand are
unchanged.@trailstep/cli: the pi MCP server description now points at the
trailstep://instructionsresource that documents the run -> watch -> answer
-> resume loop.Behavior is otherwise preserved.
-
94788f4: Make the MCP server correct under real-world conditions.
BREAKING (minor, because the package is pre-1.0): the legacy
run_workflow
module and therunWorkflow/RunWorkflowResultaliases were removed. Use
runWorkflowTooland theRunWorkflowToolOptions/RunWorkflowToolResult
types instead. Therun_workflowTOOL itself is unchanged and still
registered on the server.The MCP tools are thin adapters over the real CLI seams, and several of them
were not correct:trst_watchresolved runs under a hardcoded<cwd>/.trailstep/runsand
ignoredTRAILSTEP_RUNS_ROOT, so a run started under a custom runs root
could not be watched by name. It now resolves the runs root the same way
the rest of the system does.trst_run_workflowreportedstatus: "started"even when the background
process never started. It now verifies that the run materialized and reports
status: "failed"with an error when it did not.- The Windows path fallback spawned the CLI through
cmd.exewith the
--inputJSON unquoted, which mangled the input. The fallback is now
refused with a clear pointer toTRAILSTEP_CLI_ENTRY. - The watch cursor wrote its temp file to a path that collided between
overlapping watch calls in one process, so two calls could clobber each
other's cursor. The temp name is now unique per write. trst_resumespawned the continue process without the caller's
environment, so a caller-suppliedTRAILSTEP_RUNS_ROOTor
TRAILSTEP_CLI_ENTRYapplied to resolution but not to the run.trst_answerdiscarded the persisted-answer report when the follow-up
continue failed. It now returnspersisted: truetogether with the
continue error, so the caller can tell the answer was saved.
-
01690f3: Register the TrailStep MCP server with pi by writing pi's
mcp.jsonentry directly instead of going throughadd-mcp.pi's
exposure/toolExposurekeys are pi-only concepts thatadd-mcpcannot express, so every pi user used to get the default whole-servercodemodeexposure. The direct write now applies an exposure profile that keeps the generic run-loop tools (trst_run_workflow,trst_watch,trst_answer,trst_resume)directwhile the large-schema per-workflowtrst_*tools staycodemode. The scope-to-path mapping is fixed as well: project ...
@trailstep/sub-agents@0.3.0
Minor Changes
- 805dbe9: Add opt-in lean
executioncontext (AgentExecutionConfig,resolveAgentExecutionConfig,DEFAULT_AGENT_EXECUTION) on agent steps and workflow roles, rendered through providerhygienecapability mappings into{{tools}},{{skills}},{{mcpArgs}},{{extensionsArgs}}, and{{contextFilesArgs}}argv templates. Wire hygiene placeholders into all four provider manifests (pi, claude, codex, gemini), default every delegate workflow to the lean context, and document flag splitting plus theproject-onlycollapse on CLIs without a dedicated project-only flag.
Patch Changes
- 69db9a9: Retry transient working-agent spawn failures with exponential backoff instead of burning the agent target chain. Windows process-level deaths (e.g.
0xC0000142STATUS_DLL_INIT_FAILED) and resource-exhausted spawn errors are now classified as transient: the format phase is retried in the same session (never re-running Phase 1 work) and failing targets are retried before falling back, with growing jittered delays (default 4 attempts, 2s base, x3, 60s cap) configurable viasettings.spawnRetry. Failures are now visible the moment they happen: newagent.attemptFailedevents, an incrementalattempts.jsonaudit trail per step, and captured spawnstderr.txtartifacts. Track state recordsownerPidso runs leftrunningby a dead runner are reported as orphaned instead of silently active. - Updated dependencies [805dbe9]
- Updated dependencies [69db9a9]
- @trailstep/authoring@0.3.0
@trailstep/provider-pi@0.3.0
Minor Changes
- 805dbe9: Add opt-in lean
executioncontext (AgentExecutionConfig,resolveAgentExecutionConfig,DEFAULT_AGENT_EXECUTION) on agent steps and workflow roles, rendered through providerhygienecapability mappings into{{tools}},{{skills}},{{mcpArgs}},{{extensionsArgs}}, and{{contextFilesArgs}}argv templates. Wire hygiene placeholders into all four provider manifests (pi, claude, codex, gemini), default every delegate workflow to the lean context, and document flag splitting plus theproject-onlycollapse on CLIs without a dedicated project-only flag.
@trailstep/provider-gemini@0.2.0
Minor Changes
- 805dbe9: Add opt-in lean
executioncontext (AgentExecutionConfig,resolveAgentExecutionConfig,DEFAULT_AGENT_EXECUTION) on agent steps and workflow roles, rendered through providerhygienecapability mappings into{{tools}},{{skills}},{{mcpArgs}},{{extensionsArgs}}, and{{contextFilesArgs}}argv templates. Wire hygiene placeholders into all four provider manifests (pi, claude, codex, gemini), default every delegate workflow to the lean context, and document flag splitting plus theproject-onlycollapse on CLIs without a dedicated project-only flag.