Skip to content

mistri 0.2.0

Choose a tag to compare

@mcheemaa mcheemaa released this 05 Jul 09:11
  • Repository hygiene: coverage floor enforced in CI (simplecov, 90% line),
    contributing/security/conduct docs, issue and PR templates, Dependabot,
    and rubygems documentation and bug tracker links.

  • Per-tool timeouts: Tool.define(..., timeout: 30) answers in band when a
    handler stalls, so one hung tool cannot stall the run.

  • :tool_result events carry duration (seconds) for executed tools, feeding
    latency metrics straight from any sink.

  • Mistri::Reminder.every(3, text): a periodic tail reminder for long runs,
    riding transform_context; due by completed assistant turns, fresh on the
    wire each time, never persisted.

  • Tool hooks: before_tool(call, context) blocks a call by returning the
    reason as a String, answered to the model in band; it outranks the
    approval gate and screens approved calls again at settle time, so an
    aged approval never beats current policy. after_tool(call, result,
    context) may replace a result (both channels), nil keeps it. Hooks that
    raise fail safe: before blocks, after answers in band.

  • transform_context accepts an array of transforms, applied in order.

  • Result#usage: every run reports its own token and cost accounting,
    summing persisted turns and compaction calls; task sums across its fix
    passes. Hosts meter a run without walking the session.

  • MCP stdio wire: Client.new(command: [...], env: {...}) spawns a local
    server as a child process speaking line-delimited JSON-RPC, credentials
    in its environment per spec. Dying servers and non-protocol stdout fail
    loudly; close terminates the child.

  • MCP connections out of the box: Mistri::MCP::OAuth.start/.complete/
    .refresh are storage-agnostic services implementing the spec's OAuth 2.1
    subset (challenge and well-known discovery, RFC 8414 metadata with an
    OpenID fallback, dynamic client registration as the host application,
    PKCE with resource indicators, rotating refresh). rails generate mistri:mcp YourModel creates a host-named connection model whose rows
    carry their own flow state and encrypted tokens, with connection.tools
    bridging straight into an agent and refreshing ahead of expiry.

  • MCP bridge: Mistri::MCP::Client speaks Streamable HTTP (initialize
    handshake, tools/list with pagination, tools/call, sessions with
    transparent expiry recovery, JSON or SSE responses) with zero new
    dependencies. Auth is a headers hash or a token string-or-lambda; a
    lambda re-resolves once on 401, so host refresh logic lives in one place.
    Mistri::MCP.tools bridges any server (or any duck-typed client, the
    official mcp gem included) into Mistri tools with allow/deny lists, name
    prefixing, and per-tool approval gates, so a third-party write tool can
    ride the human-approval arc.