Skip to content

v0.15.0

Latest

Choose a tag to compare

@fro-bot fro-bot released this 19 Jul 08:38
· 8 commits to main since this release
7fa38ad

Minor Changes

  • fe0cc42: @fro.bot/space-bus/core gains a browser-safe message-correlation primitive for dispatched prompts, plus typed partial-failure handles for dispatch:

    • createDispatchMessageId() — generates an OpenCode-compatible ascending user message id (msg_ + a 12-character lowercase-hex timestamp/counter prefix + 14 random base62 characters), using only Date.now() and Web Crypto's crypto.getRandomValues — no Node builtins, no dependency. IDs generated in the same millisecond sort ascending by an internal per-millisecond counter, matching OpenCode's own id ordering.
    • dispatch()/toDispatchArgs() accept an optional messageId on DispatchArgs. toDispatchArgs validates a caller-supplied id against the exact msg_ + 12-hex + 14-alphanumeric shape and rejects anything else — including oversized or injection-like input — with a single stable, generic Result error that never echoes the rejected value. dispatch() re-validates independently as defense in depth for callers that construct DispatchArgs directly.
    • When messageId is supplied, new and follow-up dispatch modes include it as the OpenCode messageID field alongside the prompt's parts and echo it back as messageId on the result. The key is omitted entirely — not sent as null — whenever no messageId is given, and blocked/question-reply results never carry a messageId since no ordinary prompt message is sent on those branches.
    • New DispatchFailure type and optional dispatchFailure field on dispatch's Result error branch give callers a typed handle for partial failures: phase: "not_sent" for failures verified to precede any mutation (e.g. pending-question verification failing under the blocked policy), and phase: "indeterminate" for failures where a mutating request (session create, prompt send, question reply) may already have reached OpenCode despite an error response. Known-safe fields (project, and sessionId/messageId when known) are included; unknown fields are omitted rather than sent as undefined. Every other core function's Result error shape is unchanged.
    • dispatchMetadata() (shared by the MCP and plugin tool surfaces) and the bus_task MCP tool's outputSchema gain the same optional messageId, included for new/follow-up when supplied and omitted otherwise. bus_task's plugin and MCP messageId input parameter is optional and validated the same way as dispatch(). Human-readable dispatch text output is unchanged.

    All additions preserve the existing Result<T>/DispatchResult contract and the browser-safe /core import lane.