Skip to content

@onlyworlds/sdk 4.93.0

Choose a tag to compare

@github-actions github-actions released this 27 Oct 16:56
· 359 commits to main since this release

Added

  • The lens profile's graph reader: worldGraph(world, reader, options?) reads a world as nodes and edges for one reader, over the same snapshot and OwLensReader as resolveLens, and returns OwWorldGraph (nodes, edges, edgesCut, cut, unreadable). Pure: nothing is stored or written. A node is { id, type, name, family, icon }, family and icon from the distribution's presentation defaults, with marks (room, hidden, proposed) on an element of a kind that is out by default and known_of: true on a guest's known-of stub, which has no edges out. An edge is { source, field, target, index }, one per element, field and target, from the schema's link fields and the two declared extension links (x_lens_leads_to, x_spine_depends_on); index is the target's place in the list as the reader is served it, and a link held on both ends is two edges. Nodes sort by id and edges by source, field and index, each by code point. Without options.lens the nodes are every element the reader sees less room elements, hidden ones, proposed ones and map space (Map, Pin, Marker, Zone); the flags rooms, hidden, proposed and mapSpace bring each back, and cut counts what stayed out. With a lens (a body, or the id of one the reader sees) the nodes are exactly the lens's kept, its cut rides along unchanged, and no flag adds to it; a lens whose x_lens cannot be read gives an empty graph with unreadable naming the key, as resolveLens does (unreadable is null otherwise, and always without a lens). A link to an element that is not a node is counted in edgesCut by that element's reason (a lens's cut reason; with a lens, outside_lens for one the reader sees that the lens neither kept nor cut, counted for every rung and never part of a lens's cut; without one, one of the four kinds; or not_visible), in one order: the lens's reasons, then room, hidden, proposed, map_space, outside_lens; a reader that is not the owner never carries anchor_not_visible, not_visible, hidden or proposed, and a link to an id not in the world is not counted. hidden or proposed from a reader that is not the owner, or any flag from a public reader, throws a TypeError naming the flag before anything is read; an owner reading as another reader is judged by that reader's rung. Unknown option keys are refused, as everywhere in the package. It answers the 34 cases of the fixture's graph kind (schema-dist serial 81), which the Python package runs too; the answers equal the Python package's world_graph on thousands of random worlds.

Changed

  • Schema repinned to schema-dist v0.33.0-dist.81 (from dist.80; the same canonical 00.33.00, so ONLYWORLDS_VERSION stays '00.33.00' and no element field moved). Serial 81 writes the lens profile's graph section, which worldGraph reads, and the fixture's graph kind: the graph tests now run its 34 cases and read its graph tables (the flags, the owner-only flags, the edge reasons, the declared links) back through the reader, in place of the package's own copy of the same cases.
  • OwWorldMeta.counts and getWorld say what keel serves since its PR 289: every world read carries counts, as that reader may read, not only the keyless read. Only the doc comments moved.