Builtin Library
README.md
search
The general query over the engine log ring.
Filters
All optional. They narrow together — a line must satisfy every one given.
| option | meaning |
|---|---|
level | minimum severity: trace, debug, info, warn, error |
type | subsystem, case-insensitive |
contains | case-insensitive substring of the message |
pattern | regex over the message |
script | lines a named script logged |
entity | lines logged by a script running on that entity |
caller | lines one caller's work raised: mine, unowned, or a caller key |
origin | local for lines raised by content this session authored, remote for content another session on the world authored |
within | how many seconds back to look |
since_time, until_time | an absolute window, in epoch seconds |
since | only lines newer than this seq, for incremental polling |
context | also return this many lines either side of each match |
group | collapse repeated messages into one row each |
limit | default 100 |
order | asc (default, oldest first) or desc |
include_mcp | include the record of your own tool calls |
A severity that is not one of the five is refused by name rather than matching
nothing, because an empty result reads as "the engine logged nothing". So is a
window that starts after it ends, a negative within, and an origin other
than local or remote.
An option this table does not name is refused naming it, along with the ones it does name. A misspelled filter would otherwise be dropped, and the answer to the wider question would read exactly like the narrowed one.
Context
context returns the lines either side of each match, each marked with
context. What led up to a failure is made of lines the filter rejected, so a
filtered view can never show it otherwise.
Overlapping windows merge, and a line that is itself a match stays a match rather than being demoted to context.
Grouping
group collapses lines sharing a message template — the same line with
numbers, hashes and ids masked out — into one row, most frequent first. A
per-frame error becomes one row with a count instead of burying everything
else. Each row carries template, message (the most recent occurrence),
count, level (the worst severity seen), first_seq, last_seq,
last_timestamp, and script / entity when every occurrence shared one.
context and group cannot be combined: a group has no single position in the
log for context to surround, so asking for both is refused rather than answered
with one of them quietly dropped.
Returns
| field | meaning |
|---|---|
entries | the matching lines — or groups when group is set |
shown | how many came back |
matched | how many the filter selects in the whole ring |
truncated | true when limit cut the answer short |
cursor | the seq to hand back as since next time |
counts | lifetime errors and warnings, which survive ring eviction |