You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
openers_for(tools, kind, address, surface): the rows of an "Open with" menu for a world (kind="world") or one element of it ("element"), in order, each a dict {id, name, href, state} (Opener). First the site's own row (onlyworlds.com, the world's or the element's page on www.onlyworlds.com, never a word), then one row per tools list row, in the list's order, that is listed and has an open link for this kind; a tool with only a world link is offered on an element as opening its world. surface is a mapping of what the page knows, and nothing is guessed: audience (member or public, required; the public sees only rows whose open.needs is None), signed_in (True, False, or None when the page cannot know), browser (default True), phone (default False) and tool, the page's own client name. state is the first that holds: "You are here" (the row whose client is tool), "Opens in your browser" (needs an account, outside a browser), "Sign in to first" (needs an account, signed out), "Needs the world on this phone" (needs the world on the device, on a phone), "Opens the world" (a world link on an element), else None. An address with no world, or with a slug for it, raises AddressError (no_world, bad_world); an element's rows from an address with no element, an unknown kind, a missing audience, and an unknown key on the address or the surface raise TypeError. The npm SDK's openersFor answers the same shared fixture (41 cases) row for row.
TOOLS: the OnlyWorlds tools list (github.com/OnlyWorlds/tools, tools.json format 1) as of this release, the keys openers_for reads (id, name, url, client, rung, open), typed by Tool and ToolOpen. It is generated by codegen/generate_tools.py from a copy vendored byte for byte at a pinned commit (codegen/tools-pin.json, the commit and the file's sha256, the npm SDK's pin), and CI and the release run its --check. A tool listed after a release is offered from the next one.