Skip to content

Releases: chily-john/TrailStep

@trailstep/sub-agents@0.3.1

Choose a tag to compare

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/core changes the default execution block from
    contextFiles: "project-only" to contextFiles: true. "project-only" was
    misleading on every provider CLI that has no project-only flag: pi --no-context-files disables 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/core also adds settings.execution to 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 only contextFiles therefore changes only that field and leaves the
    role's other fields alone; an explicit false or [] 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-agents no longer pins contextFiles in the delegate's lean
    execution block, so a delegate turn inherits the framework default and reads
    the repository's own AGENTS.md / CLAUDE.md instead of disabling context
    discovery. The rest of the lean block is unchanged: --no-skills, --no-mcp
    and --no-extensions are 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 a number
    or integer, and exactly true / false becomes a boolean -- 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_failed diagnostics. The coercion is opt-in at the workflow-input
    call site; the shared jsonSchema() / 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: the trst_run_workflow description now says that a
    per-workflow tool (for example trst_delegate or trst_take-it-away) should
    be preferred when one exists, and the trst_watch description 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 with trst_run_workflow and
    trst_answer. The server also sends instructions on initialize pointing at
    the trailstep://instructions resource.

    @trailstep/sub-agents: the delegate workflow descriptions (and the
    delegateParallel description) now say what the workflow does, what mode
    selects, that maxTurns bounds the number of turns, and that a delegate which
    needs a decision returns a question answered with trst_answer and continued
    with trst_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 from skillDescription / skillFocus and are
    unchanged.

    @trailstep/cli: the pi MCP server description now points at the
    trailstep://instructions resource that documents the run -> watch -> answer
    -> resume loop.

    Behavior is otherwise preserved.

  • 51d35f5: Share the remaining duplicated helpers.

    @trailstep/authoring: exports the canonical nonEmptyOptional and
    nonEmptyOrDefault string helpers (packages/authoring/src/strings.ts) so that
    workflow packages share one "trim, then drop empty" definition.

    @trailstep/cli: the six per-command parseFlags copies (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_unavailable guard now lives in one place
    (packages/cli/src/internals/agent-config/agent-targets-error.ts) used by both
    the add and agents commands.

    @trailstep/create-flows, @trailstep/sub-agents: the duplicated
    nonEmptyOptional helper is imported from @trailstep/authoring, and the
    worktree input subschema is declared once
    (delegateWorktreeInputShape in packages/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

Choose a tag to compare

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/core splits 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/cli splits commands/update/update-command.ts,
    internals/mcp-tools/mcp-registration.ts and
    commands/agents/agents-setup-wizard.ts into 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's officialProviderSpecFor() table now mirrors it
    (model support, model discovery, thinking support and thinking levels), the Pi
    provider manifest declares its pi --list-models discovery spec, and a new
    official-providers test pins the agreement between the CLI table and the
    @trailstep/provider-* manifests.

@trailstep/mcp@0.3.0

Choose a tag to compare

Minor Changes

  • 65f6a96: Publish the MCP package with a declared public surface and complete npm
    metadata.

    The MCP package was published without an exports map, without bugs and
    homepage metadata, and without a LICENSE file 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.json subpath stays
      reachable, because the CLI resolves it to locate the add-mcp binary.
      BREAKING (minor, because the package is pre-1.0): deep imports such as
      @trailstep/mcp/dist/tools/trst_watch.js no longer resolve. Import from
      @trailstep/mcp instead.
    • The bugs and homepage metadata are now declared, and the tarball
      includes the LICENSE file 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.
  • 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 the runWorkflow / RunWorkflowResult aliases were removed. Use
    runWorkflowTool and the RunWorkflowToolOptions / RunWorkflowToolResult
    types instead. The run_workflow TOOL 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_watch resolved runs under a hardcoded <cwd>/.trailstep/runs and
      ignored TRAILSTEP_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_workflow reported status: "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.exe with the
      --input JSON unquoted, which mangled the input. The fallback is now
      refused with a clear pointer to TRAILSTEP_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_resume spawned the continue process without the caller's
      environment, so a caller-supplied TRAILSTEP_RUNS_ROOT or
      TRAILSTEP_CLI_ENTRY applied to resolution but not to the run.
    • trst_answer discarded the persisted-answer report when the follow-up
      continue failed. It now returns persisted: true together 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
        yields workflow-<timestamp>-<suffix>, where the reference's export name
        is used rather than the whole pkg-workflow string;
      • 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.
    • The two divergent CLI-entry resolvers in the MCP package (one reading
      process.argv, one walking up node_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, and trailstep cancel --clear removes 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 remove now 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.
  • 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 a number
    or integer, and exactly true / false becomes a boolean -- 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_failed diagnostics. The coercion is opt-in at the workflow-input
    call site; the shared jsonSchema() / 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: the trst_run_workflow description now says that a
    per-workflow tool (for example trst_delegate or trst_take-it-away) should
    be preferred when one exists, and the trst_watch description 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 with trst_run_workflow and
    trst_answer. The server also sends instructions on initialize pointing at
    the trailstep://instructions resource.

    @trailstep/sub-agents: the delegate workflow descriptions (and the
    delegateParallel description) now say what the workflow does, what mode
    selects, that maxTurns bounds the number of turns, and that a delegate which
    needs a decision returns a question answered with trst_answer and continued
    with trst_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 from skillDescription / skillFocus and are
    unchanged.

    @trailstep/cli: the pi MCP server description now points at the
    trailstep://instructions resource 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

Choose a tag to compare

Patch Changes

  • 51d35f5: Share the remaining duplicated helpers.

    @trailstep/authoring: exports the canonical nonEmptyOptional and
    nonEmptyOrDefault string helpers (packages/authoring/src/strings.ts) so that
    workflow packages share one "trim, then drop empty" definition.

    @trailstep/cli: the six per-command parseFlags copies (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_unavailable guard now lives in one place
    (packages/cli/src/internals/agent-config/agent-targets-error.ts) used by both
    the add and agents commands.

    @trailstep/create-flows, @trailstep/sub-agents: the duplicated
    nonEmptyOptional helper is imported from @trailstep/authoring, and the
    worktree input subschema is declared once
    (delegateWorktreeInputShape in packages/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 loose packages/cli/src/internals/ root files that formed
    one concern now live in packages/cli/src/internals/command-framework/
    (command.types.ts, command.types.test.ts, command-registry.ts,
    command-registry.test.ts), and official-provider-specs.ts was folded into
    packages/cli/src/internals/providers/official-providers.ts alongside the
    existing official-provider package helpers. Every importer was updated.

    @trailstep/create-flows: the misnamed src/feature-implementation/shared/
    directory was split. The cross-flow contracts imported by the sibling
    grill-it-away and take-it-away flows (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

Choose a tag to compare

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 a cancel.json behind, 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 a workflow.retryStarted event
      that carries the cancelled step and the cancellation event it replaces.
    • trailstep retry clears a pending cancellation for the run it targets, the
      same way trailstep continue does, and reports waiting and cancelled retry
      results instead of treating them as failures.
    • trailstep cancel reports 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.
  • 3d3dc86: Add canonical shared guards and the TrailStep directory-name constant.

    @trailstep/core now exports isRecord, isPlainObject, isNodeError and
    errorMessage from a single canonical module (packages/core/src/json/guards.ts)
    plus the TRAILSTEP_DIR_NAME constant (.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, not null, prototype
    Object.prototype or null) 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 by trailstep answer is atomic in the same way.
    • A replace-rename on Windows fails with EPERM while 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 deferEngineInit export and the legacy MCP run_workflow
      re-export were removed.
  • 51d35f5: Harden the remaining unguarded parses, swallowed promises and failure inspection.

    • @trailstep/core now exports isFailureLikeError and readFailureCode from
      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 via onUnexpectedError).
    • trailstep watch reports 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. A step.attemptFailed event 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/core now 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 the Workflow contract
    (authoring/workflow/workflow.types.ts), and the durable run Event and the
    interactive process contract moved into contracts/events/event.types.ts and
    contracts/process/interactive-process.types.ts. @trailstep/cli extracts the
    shared registry vocabulary into
    internals/workflow-registry/workflow-registry.types.ts and the path-shaped
    reference check into internals/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/core changes the default execution block from
    contextFiles: "project-only" to contextFiles: true. "project-only" was
    misleading on every provider CLI that has no project-only flag: pi --no-context-files disables 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/core also adds settings.execution to 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 only contextFiles therefore changes only that field and leaves the
    role's other fields alone; an explicit false or [] 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-agents no longer pins contextFiles in the delegate's lean
    execution block, so a delegate turn inherits the framework default and reads
    the repository's own AGENTS.md / CLAUDE.md instead of disabling context
    discovery. The rest of the lean block is unchanged: --no-skills, --no-mcp
    and --no-extensions are 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 a number
    or integer, and exactly true / false becomes a boolean -- 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_failed diagnostics. The coercion is opt-in at the workflow-input
    call site; the shared jsonSchema() / 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: the trst_run_workflow description now says that a
    per-workflow tool (for example trst_delegate or trst_take-it-away) should
    be preferred when one exists, and the trst_watch description 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 with trst_run_workflow and
    trst_answer. The server also sends instructions on initialize pointing at
    the trailstep://instructions resource.

    @trailstep/sub-agents: the delegate workflow descriptions (and the
    delegateParallel description) now say what the workflow does, what mode
    selects, that maxTurns bounds the number of turns, and that a delegate which
    needs a decision returns a question answered with trst_answer and continued
    with trst_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 from skillDescription / skillFocus and are
    unchanged.

    @trailstep/cli: the pi MCP server description now points at the
    trailstep://instructions resource that documents the run -> watch -> answer
    -> resume loop.

    Behavior is otherwise preserved.

  • 51d35f5: Split the...

Read more

@trailstep/cli@0.8.0

Choose a tag to compare

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 a cancel.json behind, 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 a workflow.retryStarted event
      that carries the cancelled step and the cancellation event it replaces.
    • trailstep retry clears a pending cancellation for the run it targets, the
      same way trailstep continue does, and reports waiting and cancelled retry
      results instead of treating them as failures.
    • trailstep cancel reports 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.
  • 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, and trailstep cancel --clear removes 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 remove now 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.

Patch Changes

  • 3d3dc86: Break the import cycles in the authoring, provider-catalog and CLI registry
    layers.

    @trailstep/core now 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 the Workflow contract
    (authoring/workflow/workflow.types.ts), and the durable run Event and the
    interactive process contract moved into contracts/events/event.types.ts and
    contracts/process/interactive-process.types.ts. @trailstep/cli extracts the
    shared registry vocabulary into
    internals/workflow-registry/workflow-registry.types.ts and the path-shaped
    reference check into internals/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 by trailstep answer is atomic in the same way.
    • A replace-rename on Windows fails with EPERM while 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 deferEngineInit export and the legacy MCP run_workflow
      re-export were removed.
  • 51d35f5: Harden the remaining unguarded parses, swallowed promises and failure inspection.

    • @trailstep/core now exports isFailureLikeError and readFailureCode from
      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 via onUnexpectedError).
    • trailstep watch reports 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 a number
    or integer, and exactly true / false becomes a boolean -- 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_failed diagnostics. The coercion is opt-in at the workflow-input
    call site; the shared jsonSchema() / 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: the trst_run_workflow description now says that a
    per-workflow tool (for example trst_delegate or trst_take-it-away) should
    be preferred when one exists, and the trst_watch description 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 with trst_run_workflow and
    trst_answer. The server also sends instructions on initialize pointing at
    the trailstep://instructions resource.

    @trailstep/sub-agents: the delegate workflow descriptions (and the
    delegateParallel description) now say what the workflow does, what mode
    selects, that maxTurns bounds the number of turns, and that a delegate which
    needs a decision returns a question answered with trst_answer and continued
    with trst_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 from skillDescription / skillFocus and are
    unchanged.

    @trailstep/cli: the pi MCP server description now points at the
    trailstep://instructions resource 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 the runWorkflow / RunWorkflowResult aliases were removed. Use
    runWorkflowTool and the RunWorkflowToolOptions / RunWorkflowToolResult
    types instead. The run_workflow TOOL 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_watch resolved runs under a hardcoded <cwd>/.trailstep/runs and
      ignored TRAILSTEP_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_workflow reported status: "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.exe with the
      --input JSON unquoted, which mangled the input. The fallback is now
      refused with a clear pointer to TRAILSTEP_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_resume spawned the continue process without the caller's
      environment, so a caller-supplied TRAILSTEP_RUNS_ROOT or
      TRAILSTEP_CLI_ENTRY applied to resolution but not to the run.
    • trst_answer discarded the persisted-answer report when the follow-up
      continue failed. It now returns persisted: true together 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.json entry directly instead of going through add-mcp.

    pi's exposure / toolExposure keys are pi-only concepts that add-mcp cannot express, so every pi user used to get the default whole-server codemode exposure. The direct write now applies an exposure profile that keeps the generic run-loop tools (trst_run_workflow, trst_watch, trst_answer, trst_resume) direct while the large-schema per-workflow trst_* tools stay codemode. The scope-to-path mapping is fixed as well: project ...

Read more

@trailstep/authoring@0.4.0

Choose a tag to compare

Minor Changes

  • 51d35f5: Share the remaining duplicated helpers.

    @trailstep/authoring: exports the canonical nonEmptyOptional and
    nonEmptyOrDefault string helpers (packages/authoring/src/strings.ts) so that
    workflow packages share one "trim, then drop empty" definition.

    @trailstep/cli: the six per-command parseFlags copies (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_unavailable guard now lives in one place
    (packages/cli/src/internals/agent-config/agent-targets-error.ts) used by both
    the add and agents commands.

    @trailstep/create-flows, @trailstep/sub-agents: the duplicated
    nonEmptyOptional helper is imported from @trailstep/authoring, and the
    worktree input subschema is declared once
    (delegateWorktreeInputShape in packages/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.

Patch Changes

@trailstep/sub-agents@0.3.0

Choose a tag to compare

@github-actions github-actions released this 20 Oct 20:26
cc4681f

Minor Changes

  • 805dbe9: Add opt-in lean execution context (AgentExecutionConfig, resolveAgentExecutionConfig, DEFAULT_AGENT_EXECUTION) on agent steps and workflow roles, rendered through provider hygiene capability 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 the project-only collapse 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. 0xC0000142 STATUS_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 via settings.spawnRetry. Failures are now visible the moment they happen: new agent.attemptFailed events, an incremental attempts.json audit trail per step, and captured spawn stderr.txt artifacts. Track state records ownerPid so runs left running by 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

Choose a tag to compare

@github-actions github-actions released this 20 Oct 20:26
cc4681f

Minor Changes

  • 805dbe9: Add opt-in lean execution context (AgentExecutionConfig, resolveAgentExecutionConfig, DEFAULT_AGENT_EXECUTION) on agent steps and workflow roles, rendered through provider hygiene capability 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 the project-only collapse on CLIs without a dedicated project-only flag.

@trailstep/provider-gemini@0.2.0

Choose a tag to compare

@github-actions github-actions released this 20 Oct 20:26
cc4681f

Minor Changes

  • 805dbe9: Add opt-in lean execution context (AgentExecutionConfig, resolveAgentExecutionConfig, DEFAULT_AGENT_EXECUTION) on agent steps and workflow roles, rendered through provider hygiene capability 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 the project-only collapse on CLIs without a dedicated project-only flag.