Builtin Library
README.md
zeromind.search
Search the ZeroMind library for published assets and worlds. Say what you need in q, in plain words, the way you would describe it to a person: what the thing is or what it does. Search decides which asset types the words are about, judges every candidate against them, and returns the relevant ones best first. Returns both halves, assets and worlds, so a caller can index either without checking which target it asked for; target restricts the search to one half.
Leave assetType out. Naming one replaces the search's own choice of types, so only the named types are searched and a wrong guess returns nothing even when the library holds exactly what was asked for. Set it only when the task itself fixes the type, such as a material to put on a renderer or a shader to compile, and then name that one type. No assets in the answer means nothing was judged relevant: rephrase by what the thing does or looks like.
Each asset hit carries what the search core answered: guid, name, assetType, summary (the opening of its README), p (the judge's probability; hits come best first), similarity (how close the text is, 0 to 1), preview_description when the asset's preview has one (what the picture shows), type_key, which points into the answer's types (the asset types the query was about), container_key and system_key, which point into the answer's containers (the container the hit ships in and the highest one above it, such as a tool's toolbox and the package that toolbox ships in, or the world it belongs to; each entry { key, guid, name, assetType, parent_key?, description? } names the one above it by parent_key, and its description is the opening of its README), the world guid it was published in with that world's world_title and license, its owner, when it was updated, open_issues when the library states them (counts against the asset and against its world), local_ when this world already holds it, and, on a library search (from = "all"), reviews, what its raters said: ZeroMind's rating counts, dimensions (how many of its 10 newest reviews named each dimension strong and weak) and recent, the newest two reviews, each with its verdict, the version it judged, its author, strong, weak and the opening of its comment, marked untrusted unless your account wrote it (zeromind.inspect lists 20, each comment whole). A world hit of a library search carries reviews the same way; the answer's warning says what the untrusted marking means, and its reviews_error why the reviews could not be read. This world's own content is searched too, by its words, and listed after the library's hits marked from = "world". A world hit's description is the opening of its description too. An answer sized for choosing a hit carries each text once and as its opening: the paragraph after the README's title, cut back to a whole word within 300 characters. note says so when a text was cut, and zeromind.inspect with the hit's or the container's guid reads the README whole.
from says WHERE results may come from. 'all' (default) is everything published. 'bound' is the current world and its installed libraries, answered by this engine with no published-library leg; mode still picks how the query is matched: mode='keyword' reads this engine's own files, unpushed ones and a private world's included, and a semantic search lists this world's own files that match by their words after its ranked hits, each marked from: world. A bound search answers the asset half alone and needs q. 'owned', the worlds you own or maintain, is answered by ZeroMind's hosted zeromind.search and refused here by name. mode matters only for from='bound': from='all' is semantic, and mode='keyword' with it is refused.
The usual first call when a world needs something it does not already have. Everything in the library is open to install, change and build on, the way open-source code is: install the hit that fits with zeromind.installAsset, run it on the job, and change and finish it where it falls short; zm pr create sends the change back to where it came from, so everyone who uses it gets it. zm ls-tree @<guid>, zm grep <pattern> @<guid>, zm show @<guid>:<path> and zm log @<guid> read a hit's files in the shell, zeromind.inspect shows its record and thumbnail, and zeromind.preview what an install would write.
Requires the engine to be linked to ZeroMind (zeromind.login). The credential stays in the trusted VM; this tool asks for the search by name and never holds a bearer.