Skip to content

v0.14.0

Choose a tag to compare

@fro-bot fro-bot released this 18 Jul 18:34
· 14 commits to main since this release
778311f

Minor Changes

  • 8802338: Add browser-safe session-content primitives to @fro.bot/space-bus/core so consumers (e.g. Mothership's ide_* MCP surface) don't need to duplicate OpenCode message/question HTTP behavior:

    • messages(sessionId, { context, limit? }) — bounded full-message read. Resolves session ownership from the roster (never a caller-supplied directory) and returns { sessionId, project, messages: [{ id?, role, createdAt?, parts }] } — stable message identity/ordering metadata plus parsed parts, no unknown envelope fields. limit defaults to 20 and is capped at a hard maximum of 200; 0, negative, fractional, NaN, and Infinity values are rejected before any fetch.
    • questions(target, { context }) — complete project- or session-scoped pending-question read (target: { project } | { sessionId }, exactly one — both-present or neither-present is rejected before any fetch). Returns one entry per pending request with its full nested subquestion list (requestId, sessionId, questions: [{ header?, question, multiple, custom, options: [{ label, description? }] }]) — a single request can carry more than one subquestion, and every subquestion's header/question/multiple/custom/options round-trips.
    • answerQuestion({ sessionId, requestId, answers }, { context }) — explicit question answer. Runtime-validates answers is a non-empty string[][] before any fetch, verifies requestId belongs to a pending question on sessionId (a requestId for a different session is refused with no mutation), and verifies answers.length matches that request's subquestion count before sending (mismatched cardinality is refused with no mutation).
    • dispatch() gains an optional, backward-compatible args.onPendingQuestion: "question-reply" | "blocked", validated and preserved by toDispatchArgs (invalid values are rejected). The default preserves 0.13.1's fail-open question-reply behavior for existing callers, including its behavior when /question is unreadable. "blocked" is fail-closed: it returns a typed { mode: "blocked", requestId } result with no reply and no follow-up prompt when a question is pending, and returns a stable Result error — instead of guessing — when pending-question state can't be verified (a non-2xx or unparseable GET /question response), for callers that must never silently reinterpret a follow-up prompt as a question answer or dispatch under ambiguous state.

    All additions preserve the existing Result<T>/BusContext contract, the per-call context validation gate, the localhost guard, internal session-to-directory resolution, and the browser-safe /core import lane (no Node builtins, no ambient env reads).

Patch Changes

  • f599505: Fix the CLI's --config flag leaking into process.env.SPACE_BUS_CONFIG. resolveRoster() in src/cli.ts previously mutated the process environment as a side effect of resolving an explicit --config path, which persisted for the remainder of the process and could cause later ambient (env-based) roster resolution in the same process to resolve a stale/deleted path. resolveRosterPath() in src/config.ts now accepts an optional explicit override argument, so the CLI can thread --config through without touching process.env.