Repository navigation
Mayura 1.2.0
Release engineering
- Release workflows retain the explicitly selected archives, receipts, SBOM and notes under
.artifacts;
rehearsals fail if no evidence files are found instead of silently succeeding without a downloadable artifact. - Full releases publish the coordinated version already committed through a reviewed, qualified PR. The publisher
no longer commits, rebases or pushes protected main; only verified publication can create its version tag and
GitHub Release. Explicitdry_runrehearsals work while publishing is enabled. - Full-set OIDC publication validates every archive and dependency before writes, requires exact-main push
qualification, preserves the non-target distribution channel and checks registry integrity/provenance. Frozen
same-run recovery receipts prevent replaying accepted or uncertain uploads after failures or scanning delays. - Release readiness records the green 39-job main qualification and successful 22-package
1.2.0-rc.1trusted
publication, while retaining the remaining 84-package OIDC qualification and experimental interoperability limits.
Changed
-
The protected release workflow can publish the fixed 22-package RC set through OIDC with provenance, exact-main
qualification, immutable recovery receipts and checks that preserve all existinglatesttags. -
Frontend journal fixtures use an explicit logical clock while native SQLite I/O and claim races remain real,
avoiding accidental one-second claim expiry on slow runners while preserving expiry and retention assertions. -
Cross-platform qualification separates consumers from two Vitest and two bundle shards per OS/Node combination.
Shared checks run once, PR branch pushes no longer duplicate the full matrix, and an aggregate qualification gate
requires all lanes to succeed, including database, runtime and container coverage. -
The paid-summary recovery fixture allows slow Windows CI disk I/O across its seeded turns, denied publication
and receipt-only retry while still asserting exactly one model call. -
libSQL conformance cleanup yields to native statement finalizers and repeats garbage collection on bounded
Windows file-lock retries; persistent locks still fail the suite. -
Key-rotation conformance checks the persisted overlap deadline and explicitly expires the predecessor, avoiding
short wall-clock waits that fail when durable storage is slow on Windows CI. -
Code Mode crash fixtures allow slow Windows SQLite I/O before the deliberate process kill, then wait for the
matching lease expiry before checking recovery without replay. -
The libSQL caller-owned client check uses an in-memory database, keeping its lifecycle assertion independent
of native file cleanup while the file durability and lock conformance suites remain covered. -
Scheduler crash fixtures use a matching Windows lease and post-kill expiry wait, while the live-renewal check
has time to reach renewal before expiry. Explicit stale-claim checks keep their short leases. -
Long-running workflow renewal conformance outlives the configured Windows lease with matching tool and case
deadlines, retaining its single-effect and unchanged-fence assertions. -
Coordinator conformance fixtures allow slow document-store I/O without accidentally expiring their leases;
explicit uncertainty cases retain their shorter lease settings. -
Durable-budget fixture cleanup retries transient Windows file locks after libSQL closes its native handles.
-
Release automation uses npm trusted publishing through GitHub OIDC without an npm token secret. Added a resumable
package-trust setup helper, including prerelease-only packages without alatesttag, and documented
first-publication requirements for new extensions.
Validation status (2026-10-21)
- Full release-branch CI passed: all 13 jobs in qualification run 39576846216
succeeded atf443c76e822eef27b143d318d748ed513599e00c, covering six Linux/macOS/Windows Node 22/24 consumers,
four database shards, runtime compatibility and both container jobs. The documentation follow-up, newermain
changes and pull-request merge commit require their own green checks before release. - Local Windows qualification: 5,296 unit tests passed; six conditional PostgreSQL cases skipped by the unit run
were exercised in the separate PostgreSQL journal profile (12 passed). - Integration qualification: 2,338 latest executed cases passed, with no unresolved failures after targeted serial
reruns. The original all-service run failed 54 cases and skipped 313; later executions clear the failures. This
result does not claim a clean first-pass full suite or qualification of skipped external profiles. - Builds, types, 451 documentation snippets, API compatibility reports, edge/runtime checks, offline consumers,
75 public package entry points, 105 extensions, 106 release archives, 11 starters, eight templates, 18 offline
examples, the website, secret scan and license/SBOM checks passed locally. - Paid provider/gateway checks, real authorization/vector service interoperability, the AG-UI reference-client/browser
flow and live deployments remain outstanding. AG-UI and RAG
retain their documented experimental status. No version bump, publication or release tag has been performed. - See release validation status for evidence scope and remaining release gates.
Fixed
-
Workflow draining fences dependent nodes that resume a delayed storage read or policy evaluation after shutdown
begins, while allowing already-claimed effects and their receipts to settle without replay. -
Make the Mistral conformance transport reject requests whose signals aborted before listener registration,
matching real fetch cancellation; cover the delayed-subscription path deterministically through the adapter. -
Control the checkpoint host-expiry test clock at the deadline boundary so slow persistence cannot expire
the approval before the not-due assertion; retain the real checkpoint store and execution assertions. -
Give the coordinator reopen conformance fixture a bounded ten-second lease so delayed claim delivery
does not unintentionally test expiry; preserve immutable resource plans and exactly-once execution checks. -
Retry scheduled-workflow fixture removal within a bounded window after closing native database handles,
allowing Windows WAL/SHM locks to settle while continuing to fail persistent cleanup errors. -
Admit the workflow-tree capacity fixture through real SQLite before its handler timeout, and observe
actual capacity release after settlement while retaining exclusion and exactly-once execution assertions. -
Resolve the website gallery's shared UI source against the site's own React installation and declarations,
so clean site-only installs type-check and build without workspace dependencies or duplicate React runtimes. -
The server starters' production flow works out of the box again.
docker compose upfailed inmigrate, andnpm run devfailed at startup once.env.examplewas copied to.env, with "Environment values must satisfy configured bounds." because each.env.example(approval-workflow, event-automation, research-team, support-agent) shipped an emptyMAYURA_ALLOWED_ORIGINS=line, and an empty variable is refused. The optional line is now commented out, so the only empty lines are the values the README asks you to fill in; each starter's tests load its.env.examplewith just those filled in and check that production configuration succeeds. The event-automation compose file also says to fill inTRACKER_MCP_TOKEN, which it requires. -
validatedEnvironmentfrommayura/helpersnames the empty or oversized variables it refuses (Empty environment variable: MAYURA_ALLOWED_ORIGINS. Set a value or leave it unset.), never their values, as its schema errors already did. The error code staysINVALID_CONFIG. -
Allow durable adapter round trips within the key-manager rate-limit conformance window, then wait for the returned
retry deadline before checking that requests resume; refusal and window-reset assertions remain unchanged. -
Observe real adapter commit acknowledgements through bounded barriers in concurrency and late-evidence fixtures,
avoiding polling contention while retaining persisted execution, exclusion and accounting assertions. Keep slow-runner
fixture admission windows long enough to test approval expiry after preparation rather than before it, and retain
explicit short leases only in lease-expiry/renewal scenarios on Windows CI. -
Give process-crash recovery fixtures transaction headroom on Windows CI while retaining actual lease-expiry waits,
terminal-state checks and exactly-once effect assertions. -
Assert headless disposal against the actual transport signal and drain cancellation fixtures on assertion failures.
-
Pin database CI to Ubuntu 22.04 while the pinned MongoDB build is incompatible with newer runner kernels; fail
immediately when MongoDB exits or readiness expires, retaining bounded container diagnostics. -
Accept the complete bounded server capability catalog during identity admission, preserving capability and policy
enforcement for threads, approvals and compaction. -
Snapshot workflow submission input before asynchronous authorization, so concurrent caller edits cannot change the
request bound to its idempotency key. -
Preserve native memory validity when indexing and deleting RAG chunks, and keep memory export lookahead pages within
the storage contract's bounds. -
Restore run-qualified execution receipts when inspecting saved approval and frontend-tool checkpoints after restart.
-
Keep SQLite worker modules external in framework production builds; update SvelteKit configuration, React Router
dependencies and CSS types, and the static UI gallery link. -
Protect active qualification work directories from concurrent check cleanup, and refresh package closure, starter
catalog, API classification and terminal fixtures for the current release.
Dependency maintenance
- Resolve workspace peer conflicts with OpenTelemetry 2.9 development peers and an exact-version pnpm metadata
patch giving Stagehand's legacy OpenAI 4 transport its own supported Zod 3 dependency. Keep Mayura on Zod 4
and strict peer checks enabled; frozen installation succeeds with lifecycle scripts disabled.
Added
-
RAG milestone. Scoped retrieval and citations, inert HTML/PDF parser boundaries, parent/contextual retrieval,
durable content-hash ingestion and embedding claims, hybrid/query expansion, six vector extensions, three
rerankers, provider embeddings and offline evaluation. Offline regression tests, builds and package checks passed locally; real service qualification remains outstanding. -
Framework notebooks. Six
mayura init --starterapplications for Next.js App Router, Hono, React Router,
TanStack Start, SvelteKit and Nuxt wire scoped persistent threads, exact note approvals, deterministic model fixtures,
effect-local idempotency and separate workflow permissions. React source is copied from the UI registry; Svelte/Vue
use native headless views. Hono includes Node/Bun/Deno and D1/Workers Cron source. Environment/deploy files, offline
regression cases and framework starter qualification passed locally and in the recorded full CI run. Browser and deployment qualification remain outstanding. -
Framework starter packaging. Bounded route filenames and server
.mjscatalog entries are supported; generated
output, local secrets and state are excluded from bundled starter assets. The reviewed D1 extension is pinned to the
initializer's Mayura release alongsidemayura. -
AI gateway providers. Optional Vercel, Cloudflare, OpenRouter, Portkey, Helicone and LiteLLM packages add explicit
authentication, registry model identities, bounded permissioned discovery where supported, shared thread history,
tools and streaming. Compatible transport accounting takes the maximum of host token prices and gateway-reported
USD cost, preserves known usage on failures, and supports long-context prices. Fake-transport regression cases and
an explicit owner-run paid qualification harness are included. Offline tests, builds and package checks passed locally; the paid harness has not been run. -
AG-UI notebook and guarded projections. Runnable offline chat source connects thread history, exact approvals,
shared state, durable browser results and native checkpoint recovery; optional guarded text, metadata CUSTOM
events and opaque image/PDF handles extend the adapter. Local adapter and native server tests passed. The reference SDK harness, browser notebook flow and actual client interoperability remain unqualified. -
Thread import and media references. Explicit scoped import permission/capability, expected-sequence atomic
append and exact replay receipts add conversation import across service/HTTP/client/headless/React actions.
Durable media references retain opaque IDs and display metadata without bytes or signed URLs. No implicit
migration, synthetic approvals, automatic media fetching or write replay. -
Copy-in UI registry and gallery. Versioned bundled source for chat, history, approvals, threads, run/workflow
status, tools, citations, browser/sandbox display and bounded voice recording.mayura add uiplans reviewed
writes, refuses incompatible installed Mayura, links and stale targets; existing 1.x UI APIs remain available.
Website previews and source views added. Local tests, builds and website link checks passed; rendered browser, visual and accessibility checks remain outstanding. -
Oso authorization adapter. Optional
@mayurajs/authz-osoimplements native Oso Cloud single-check
authorization with explicit environment credentials, exact action mappings and full-scope typed actor/resource
identities. Permissioned bounded Fetch, retained cancellation capacity and strict boolean responses fail closed
without inline facts, policy/fact writes, retries or local decision caches. Core audit/OTel stay shared. Provisioning
helper, docs, offline regression cases and API metadata added; offline tests, types, docs and package checks passed locally; real provider/native engine interoperability remains unqualified. Host owns
policy/data deployment and revision consistency. All four planned provider adapter slices are now implemented. -
Permit.io authorization adapter. Optional
@mayurajs/authz-permitimplements native PDP/allowedchecks
with explicit environment credentials, exact action mappings, full-scope user/resource identities and project
tenants. Bounded Fetch, explicit provider permission, retained cancellation capacity and strict boolean decisions
fail closed without provisioning writes, retries or local allow caches. Core audit/OTel stay shared. Provisioning
helper, docs, offline regression cases and API metadata added; offline tests, types, docs and package checks passed locally; real provider/native engine interoperability remains unqualified. Native
environment/revision consistency is host-managed. Oso is implemented in a separate slice. -
Cedar authorization adapter. Optional
@mayurajs/authz-cedarconnects host-supplied native Cedar evaluation
to core enforcement/audit/OTel with pinned static policies, schema and engine revision, exact action mappings,
scoped identities and trusted literal attributes. Explicit permission, bounded snapshots/deadlines and retained
concurrency fail closed, including native evaluation errors alongside allow. Docs, offline regression cases and
API metadata added; offline tests, types, docs and package checks passed locally; real provider/native engine interoperability remains unqualified. Oso is implemented in a separate slice; Amazon Verified
Permissions service integration is separate future work. -
OpenFGA authorization adapter. Optional
@mayurajs/authz-openfgamaps exact resource/actions to native
OpenFGA Check tuples with pinned store/model IDs, full principal/project/namespace isolation and a stable
configuration fingerprint. Explicit transport permission, higher-consistency checks, HTTPS, deadlines, byte and
retained concurrency bounds fail closed without retries, relationship writes or a local decision cache. Core
enforcement/audit/OTel remain shared. Provisioning helper, docs, regression cases and metadata added; offline tests, types, docs and package checks passed locally; provider interoperability remains unqualified. Oso is implemented in a separate slice. -
Safe native-owner recovery for AG-UI frontend results. Opt-in host permission parks a native continuation
before browser dispatch, retaining settled history, admitted input, budget/counters, remaining batch and thread
association. Scopedruns:resumecommands and authorized frontend recovery scans consume authoritative outboxes
through an exact holder/lease/version/digest checkpoint fence. Completed models, tools, input guards and proposal
hooks are not replayed; uncertain post-consume work remains reconciliation-only. Human approvals cannot resume
frontend waits. Built-in stores, client/headless snapshots, docs and regression cases updated; local offline validation passed. -
Durable AG-UI frontend-tool claims and result outboxes. An opt-in scoped aggregate journal removes HTTP
session affinity through stable call identities, permanent one-time claims, atomic immutable result acceptance
and bounded native-owner polling. Result retries are idempotent; delivery reservations never transfer or replay
browser writes. Authorized recovery metadata and retention redaction preserve non-executable tombstones.
Native-owner loss retains evidence for reconciliation without restarting paid execution. Process-local mode
remains available. Docs, regression cases and API metadata updated; local offline validation passed. -
Permissioned AG-UI frontend tools. Host-registered native tools bridge to browser handlers through scoped,
one-shot claims. Exact advertised schemas, native frontend/effect grants and mandatory core frontend policy
checks constrain dispatch and result acceptance. Bounded JSON tool messages resume the same native run/budget,
retain native output validation/guards and support exact result-submission replay without rerunning handlers.
A browser executor normalizes failures, propagates cancellation and never retries uncertain claims or writes.
The process-local mode requires session affinity; process loss never redispatches pending browser effects.
Docs, offline regression cases and API metadata updated; local offline validation passed. -
AG-UI state snapshots and deltas. Optional scoped, read-only host state sources require
ag-ui:stateand can
share the corethread/read_stateauthorizer/audit path. Each new or resumed stream receives an authoritative
snapshot, followed by revisioned RFC 6902 deltas at event boundaries/heartbeats, with full snapshot fallback for
patch bounds. Browser state echoes never become native input or writes. Source read limits, timeouts, retained
orphan slots and disclosure rechecks bound observation without replaying approvals or resetting run budgets.
Docs, offline regression cases and API metadata updated; local offline validation passed. -
Experimental AG-UI adapter.
mayura/ag-uiexposes a pinned AG-UI 1.0 Fetch profile over the scoped native
server: run/step events, authoritative bounded thread snapshots, final released text and sealed approval interrupts.
Resume answers retain the native run, budget and recording association, bind the exact call/digest and never retry
an approval write. Explicit serving permission, same-origin Bearer authentication, disclosure rechecks, observer
bounds and cancellation cleanup preserve native policy/audit enforcement. State patches and frontend tools are included. Offline regression tests passed locally; reference SDK conformance remains unqualified. -
History application events and approval observers. Fresh agent runs emit content-free
history.applied
metadata with exact message/omitted-turn counts, UTF-8 byte size and scan truncation.RunHistoryaccepts fitted
thread history directly; models receive only its messages.onApprovalRequestedextends bounded metadata-only
lifecycle observers before pending/checkpoint publication, with mandatory failures blocking and saved-candidate
continuations avoiding duplicate notification. Client/headless admission, durable run records and telemetry support
the new event/stage. Docs, regression cases and API metadata updated; local offline validation passed. -
Thread, approval and compaction authorization. Scoped thread services accept shared core authorizers and
cancellation, guard storage/disclosure and seal filtered-list continuations. Bound agent approval and expiration
paths authorize the thread before claiming checkpoints. Claimed-approval terminal controls use core run/thread
checks alongside existing service authority. Compaction guards source, paid dispatch and publication while
preserving ready paid summaries for retries without another model call. Existing terminal recording settlement
retains its durable association after revocation. Server forwarding, audit integration, docs, regression cases and
API metadata updated; local offline validation passed. -
Workflow and child-workflow execution authorization. Conservative, scheduled, graph, tree and lifecycle
engines accept shared core authorizers; loops, sagas and fleet coordinators propagate execution authority.
Definition/run admission, child delegation, queued tool dispatch and output publication recheck live policy
using existing audit/OTel delivery. Child budgets and static permissions remain separate; known receipts and costs
survive revoked disclosure without replaying writes. Inner agent phases accept their own policy instance.
Documentation, API metadata and regression cases updated; local offline validation passed. -
Agent-run and tool authorization. Runtime and tool/batch invocation accept host-owned core authorizers, and
scoped servers forward their owned instance into execution, including compaction summarizers. Root/child admission, handoffs, approvals, model and
managed-guard dispatch, queued tool writes and output disclosure recheck current policy alongside static grants,
budgets and approval proofs. Known execution evidence and settled costs survive withheld output; no denied call
automatically replays a write. Existing core audit/OTel sinks receive metadata-only decisions. Local offline validation passed. -
Memory and document authorization. Optional shared core authorizers guard aggregate/native memory operations,
graph endpoints, imports/exports, embedding admission and remote index calls while emitting existing audit events.
Retrieval filters denied records and seals scanned continuations. Context assembly checks memory/document source
identities before selection, withholds denied evidence metadata and bypasses cached authorization decisions.
Local offline validation passed. -
External HTTP authorization policy.
@mayurajs/authz-httpimplements a scoped, version-pinned and correlated
decision protocol with explicitauthz:httpadmission, bounded HTTPS transport and fail-closed responses. Core
authorizer, scoped server and audit/OTel wiring share the existing contract; timeouts, cancellations and failures
never retry protected operations or emit duplicate audit receipts. Core decision validation also refuses non-string
denial reasons without invoking coercion hooks. Local offline validation passed. -
Authorization audit and OpenTelemetry. Explicit
authz:auditpermits bounded, isolated decision receipt delivery,
counters and flush controls, including host-only methods on fetch and Node servers. The optional OpenTelemetry
adapter uses application tracers/meters, omits identifiers by default and keeps metric labels to closed enumerations.
Sink failures do not change access decisions or replay operations. Local offline validation passed. -
Scoped server authorization. Fetch and Node hosts opt into core/RBAC policy enforcement alongside token
capabilities and scoped adapters. Resource reads, commands, idempotent replay, catalog/list rows and event streams
fail closed; command/view responses and revision hints cannot bypass read policies. Filtered continuation cursors
are sealed to scope, policy and view, with an optional replica-shared key. Clients preserve terminal authorization
denials, and server shutdown cancels policy work. Core resource kinds add server operations and human requests. -
Core authorization and built-in RBAC. Versioned policy contracts and explicit
authorize/requirehelpers
validate immutable scoped requests and fail closed on denied grants, malformed decisions, cancellation, deadline
expiry and policy failure.mayura/authzcompiles bounded role inheritance and principal/project bindings with
explicit-deny precedence, exact action/resource matching and optional trusted ownership conditions. Host enforcement
is explicit and supplements existing run grants; no server or provider dependency enters the core contract. -
Agent handoffs. Immutable host-declared target edges expose
handoff.<agent>proposals gated byagent:<id>.
Transfers keep one run, thread transcript, recorder, scope, deadline and budget while replacing active agent grants,
models, tools, guards and hooks.maxHandoffsand existing call/step ceilings bound transfer chains. Approval
checkpoints pin the complete target policy and resume the active target without replaying prior models or writes.
The original output contract remains enforced; this slice supports buffered text-only non-speculative root runs. -
React thread compaction. Subscription/action hooks and an accessible compaction control review the captured
thread and command, require inspection after uncertain submission, publish durably staged summaries without another
model call, and support cancellation during submission. Saved summaries render as bounded plain text; the application
owns controller lifetime and history refresh. Headless snapshots expose their immutable thread/command binding. -
Hosted thread compaction. Opt-in scoped start, inspection and cancellation routes pin the summarizer and
cost/source limits on the host. The separatethreads:compactcapability, agent allowlists and durable command
journal prevent cross-scope access and duplicate paid dispatch. Client methods and a headless controller expose
immutable receipts and safe cancellation feedback, including during submission. -
Permissioned thread compaction.
threads.compactjournals an explicitly budgeted, single-call summarizer,
retains original conversation entries, and publishes a summary with source/model/cost provenance atomically.
Pending commands never dispatch another paid call automatically; staged/committed retries reuse saved output,
cancellation fences late publication, and deletion removes associated journals. History replaces covered prefixes
with tagged untrusted summary data, preserves whole recent turns, and reports bounded scan truncation.
Client readers accept and validate compaction provenance. An offline example demonstrates the complete flow. -
Safe claimed-approval reconciliation. Separate service authorization exposes host-only inspection and explicit
close controls on Fetch and Node hosts. An exact expired-claim fence retains immutable operator findings and evidence;
closure recordsoutcome_unknownonce, releases the thread and never runs models/tools or invents their results.
Identical commands repair interrupted persistence, stale reviews/holders are refused, and known terminal outcomes win.
Checkpoint adapters add atomicreconcile; thread/client run entries accept bounded reconciliation receipts. -
Hosted conversation recovery. An opt-in service grant and per-scope policy authorize bounded recovery pages
for expired approvals and interrupted terminal recordings. Fetch and Node hosts exposerecoverConversations;
background hosts can schedule sweeps, while request hosts use a trusted job. Resumed handles persist events and
outcomes, journal repair never reruns tools, and claimed checkpoints remain available for reconciliation.
Storage adapters expose ordered metadata scans;runtime.expireApprovalandcheckpoints.autoExpirelet hosts own expiry. -
Runnable thread chat example. A loopback React app connects thread history and approval controls to a
deterministic note agent, SQLite storage and durable run records. It supports approval/rejection, cancellation,
page-reload recovery, paging and explicit idempotent recovery of an uncertain send. CI builds the UI and runs
the offline flow; component integration tests exercise the same app/session against in-process Fetch. -
React conversation components.
MayuraThreadHistoryrenders bounded, text-only history with explicit paging
intents and omitted-content markers.MayuraRunApprovalControlreviews a captured tool call and submits explicit
approve/reject decisions with optional reasons. Accessible pending/expiry/conflict/failure feedback prevents
duplicate decisions; truncated input cannot be approved. Both reuse caller-owned stores without I/O on mount. -
Browser conversation APIs and React hooks. The client exposes scoped thread CRUD, paged history,
thread-bound submissions, waiting snapshots and digest-bound run approvals. Headless thread/index stores and
approval controllers provide bounded immutable state, cancellation and conflict feedback. React hooks subscribe
without requests or decisions on mount. Run stores and activity projections follow approval pauses/resumes;
quiet waiting SSE streams remain observable until completion. -
Scoped conversation HTTP routes and agent approvals.
threads: { store }enables thread creation, listing,
reads, entries, updates, archive/restore, deletion, and thread-bound run submissions. New explicit capabilities are
threads:read,threads:write,threads:deleteandruns:approve. Approval answers use the authenticated actor;
checkpoints support cross-replica inspection, resumption and cancellation (runtime.cancelSaved). Durable run
records preservewaiting, transfer ownership only inside a checkpoint claim throughresume, and keep a
monotonic SSE sequence after resumption. Request-mode responses can end at a durable approval wait. -
Thread turns are recorded across approval restarts.
recorder: threads.recorderpersists the thread/run
association before execution, carries it and approval decisions through checkpoints, and records terminal turns
once with sequence-checked chunks. A durable completion journal supportsthreads.recoverRun(threadId, runId)
after interrupted recording;runtime.retryRecording(handle)retries in-process failures without re-execution.
Unfinished turns remain fenced after lease expiry, and deletion removes journal content. The host seam exports
RunRecorder,RunRecordingContext,RunRecordingandRecordedApproval; conversation storage adds the bounded
ThreadRecordingCommandandThreadStore.recordingoperation on the existing persistence seam. -
Runs take a conversation history.
runtime.submit(agent, { input, history })sends the earlier turns, oldest first, before the run's own messages on every model call.- History is whole turns: every tool call answered by its result, in order. An earlier final answer is
{ role: 'assistant', output }(ModelHistoryMessage). It is checked before the run starts (INVALID_INPUT) and counts towardlimits.maxContextBytes. - Only adapters that declare
capabilities.historyreceiveModelRequest.history. A history for any other adapter is refused withINVALID_CONFIG, never dropped. - The model router declares it when every route does, and
scriptedModeltakes it unless givenhistory: false. - Hooks see the history in their view of a model call, and
run.startedreports how many messages it has. History carries no media yet. - Every Mayura provider takes a history: the built-in OpenAI Responses, OpenAI-compatible Chat and Anthropic adapters, and
@mayurajs/provider-openai,-azure,-anthropic,-groq,-google,-bedrock,-mistraland-ollama.- Each sends it in its provider's format, without reasoning or thinking state, and keeps its continuation counting only the run's own turns.
- A call id the provider refuses is renamed on the wire, and a new call never reuses a history id.
- For an agent without tools, Anthropic and Bedrock get earlier calls and results as JSON text, since they refuse tool blocks in a request without tools.
-
Threads: users' conversations, kept in your store (
mayura/threads).createThreads({ store, scope, permissions })creates, lists, renames, archives, restores and deletes a scope's threads and reads their entries, with the grantsthread:read,thread:writeandthread:delete. Deleting removes every entry for good and keeps a tombstone, so an id is never reused.purgeIdleThreads({ store, idleBefore })deletes idle threads in every scope, for retention.runInThread({ threads, runtime, agent, threadId, input })runs one message as a turn: it holds the thread (one turn at a time, renewed while the run lasts, including while it waits for approval), gives the run the thread's newest whole turns as history, and records the turn when the run ends: the input, each batch of calls with its approvals and released results, the output and the outcome. Failed turns are recorded but left out of later history; an entry too large to store is recorded as omitted.threads.history(id, { maxEntries, maxBytes })fits whole turns, says how many were left out, and refuses withLIMIT_EXCEEDEDrather than cut the newest turn.runtime.transcript(run)returns a run's own conversation: its input as the model saw it, its tool calls and the results released to the model.
-
Agent runs can wait for a person to approve a tool call.
- A tool declares
approval: 'required', or a function of the proposed input.createRuntime({ approvals: { tools, expiresInMs, onExpired } })adds tools without editing them and sets how long a request waits (default 15 minutes, at most 7 days). - The run asks only after the call passed its permissions, input schema and
beforeToolCallhooks. It emitsapproval.requested, its status becomeswaiting, andruntime.inspect(run).approvalshows the exact call and its digest. It holds no reservation while waiting, and waiting does not count againstmaxDurationMs. runtime.approve(run or runId, { callId, digest, decision, actorId, reason? })answers it. The digest binds the answer to the run, call, tool version, input and expiry. Approved, the call runs with exactly that input. Rejected or expired, the model gets{ error: 'APPROVAL_REJECTED' | 'APPROVAL_EXPIRED', message }as the tool's result and carries on, or withonExpired: 'cancel'the run is cancelled.approval.resolvedreports the decision.- The tools broker enforces it: a tool that declares approval runs only with the runtime's proof that a person approved that exact call. Child runs, hook actions, code mode and other callers get the new error code
APPROVAL_UNAVAILABLE. A workflow step withapproval: truesupplies the proof once approved. testTool(tool, input, { approved: true })tests such a tool, andtoolNeedsApproval(tool, input)tells whether a call would wait. TypesApprovalOptions,ApprovalAnswer,PendingApproval,RunStatus,CheckpointOptions,RunCheckpointPortandStoredRunCheckpointare exported. Run records and the observability bridge accept the new events.- With
createRuntime({ checkpoints: { store: store.runCheckpoints, agents } }), a waiting run is saved to the store at a safe point (run.paused) and holds no slot or timer. Any runtime with the same store, scope and agent continues it onapprove(runId, ...)(run.resumed), after a restart or on another server, with its conversation, remaining batch, budget, permissions (only ever narrowed) and active time. The checkpoint is removed before the approved call runs, so it runs at most once. An agent changed meanwhile ends the run with the new error codeDEFINITION_CHANGED.runtime.expireApprovals()continues this scope's expired runs; a runtime does it itself for runs it paused. Without a store, a waiting run lives in memory. - A run id can be saved again after its checkpoint is deleted, as a run that pauses twice needs (a new storage conformance case).
- A tool declares
Fixed
-
Node hosts preserve
threadsandrunExecutionwhen snapshotting server configuration, enabling checkpoint-backed
conversations through both local and production listeners. Zero-byte HTTP request streams are normalized so
body-free cancellation and thread commands work through the Node transport. -
@mayurajs/provider-google: when Gemini gives a call no id, the id made up for it no longer repeats an earlier call's id in the run, which the runtime refused as a conflict. -
Thread and run-checkpoint storage on every store. Two new storage contracts, the base that conversation threads and runs paused for approval will build on:
store.threadskeeps a scope's conversations. It supports:- create, read, update with compare-and-set, and listing newest first, page by page;
- a lease, so one run at a time writes to a thread;
- appending entries in order (user inputs, final answers, tool calls and results, approvals, summaries and run boundaries), with each entry's data at most 256 KiB and at most 64 entries or 1 MiB per append;
- reading entries in either direction.
- Deleting a thread makes its content unreadable at once, then removes its entries page by page and keeps a tombstone, so the id is never reused.
expire({ idleBeforeMs })marks threads idle since a time for deletion, for retention. store.runCheckpointskeeps a paused run's saved state, at most 3 MiB, stored in parts. It is claimed by one holder at a time with a lease, updated by that holder at the version it read, released, deleted, and listed when past its expiry.- Written once in the shared storage layer, with one implementation for the four SQL stores, one for D1 and DynamoDB, and one for MongoDB. Every store passes the same conformance suite.
await store.threads.initialize()creates the tables or indexes. It is additive; the schema version stays 1.