Repository navigation
v0.14.0
Minor Changes
-
8802338: Add browser-safe session-content primitives to
@fro.bot/space-bus/coreso consumers (e.g. Mothership'side_*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.limitdefaults to 20 and is capped at a hard maximum of 200;0, negative, fractional,NaN, andInfinityvalues 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-validatesanswersis a non-emptystring[][]before any fetch, verifiesrequestIdbelongs to a pending question onsessionId(arequestIdfor a different session is refused with no mutation), and verifiesanswers.lengthmatches that request's subquestion count before sending (mismatched cardinality is refused with no mutation).dispatch()gains an optional, backward-compatibleargs.onPendingQuestion: "question-reply" | "blocked", validated and preserved bytoDispatchArgs(invalid values are rejected). The default preserves 0.13.1's fail-open question-reply behavior for existing callers, including its behavior when/questionis 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 stableResulterror — instead of guessing — when pending-question state can't be verified (a non-2xx or unparseableGET /questionresponse), 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>/BusContextcontract, the per-call context validation gate, the localhost guard, internal session-to-directory resolution, and the browser-safe/coreimport lane (no Node builtins, no ambient env reads).
Patch Changes
- f599505: Fix the CLI's
--configflag leaking intoprocess.env.SPACE_BUS_CONFIG.resolveRoster()insrc/cli.tspreviously mutated the process environment as a side effect of resolving an explicit--configpath, 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()insrc/config.tsnow accepts an optional explicit override argument, so the CLI can thread--configthrough without touchingprocess.env.