Home: your own folder, in every world
Finding it
local folder, why = home.folder() -- "/zero/home/<username>", or nil and why
print(home.status().state) -- "mounted", "mounting" or "unmounted"
home.status() says where the folder stands: mounted (with the folder, the owner and the home world that holds it), being mounted while a world opens, or not mounted with the reason (an offline engine, a play session, an account whose home world could not be read). A write under /zero/home/ while no folder is mounted is refused with that reason.
How it is stored
The folder is the content of your home world: an ordinary private world your account owns. In every world you open in the editor, the engine mounts that world's content at /zero/home/<username>. A file at /zero/home/<username>/notes.md is stored by the home world at its own /zero/source/notes.md; you never manage that, you read and write paths under the folder.
/zero/sourceis the world: shared with everyone in it, and published when it is pushed./zero/home/<username>is you: private, and the same files in whichever world you open. A script there is outside the open world's content, so an error in a half-written one holds up neither entering play nor a push of the world;lsp.check(path)still checks it.
The home world is the one your account names on ZeroMind, created the first time it is needed. A launch with --home-world-guid <guid> (homeWorldGuid in a web launch URL) names one instead; it has to be a private world your account owns. An agent account's home is the home of the person it acts for.
Your home world
local guid = home.get() -- the home world's guid, or nil when the account has none
local ensured, created = home.ensure() -- the home world's guid; created is true when this call made it
home.get() reads the account's home world and never creates one. home.ensure() answers the same world, and creates it the first time an account without one asks: a new private world your account owns, which every later call answers again. An account has one home world, and two home.ensure() calls made at once create one world between them. Both answer the world whose content home.folder() mounts, held to the same rule (a world is your home world only while the person your account acts for owns it), and both answer the launch-named world when the engine was started with --home-world-guid. The folder itself is mounted from that world while it is private and is not the world open in the session; home.status() names the reason when it is not. The home world is an ordinary world, so world.list() lists it among your worlds and a session can open it like any other; home.get() is what says which of them is the home world.
Both yield while ZeroMind answers, and raise, naming the reason, when the engine cannot read the account: an engine booted offline holds no ZeroMind session, and an engine signed in to no account has no account to read.
What you can keep there
Anything a VFS path holds: notes and plans, scripts and modules, templates, materials, images and data. Assets in the folder have their own identity and .meta, the way they do under /zero/source.
Your own authoring folder
/zero/home/<username>/.authoring/ is your home world's authoring folder: the folder every world keeps for its writers' own notes, which in your home world is yours alone. Code a world ships never reaches it, not even code in your home folder; your own code does (the editor, your agent's tools, your execute lines), and no carried closure, pack or export holds it.
The rule: world content cannot depend on your home
Your home is private, so a world must never need it. The boundary goes one way:
- A script in the world (
/zero/source, a library, a world module) cannotrequirea module in a home folder. The require fails, naming both files. - A world file that references a home path (a
require, an asset reference) records adep.home_isolationproblem, and a push of that world is refused, naming the file. - A short name (a leaf such as
main, a dotted name such asscenes.main, or a package's name such as~kit.thingorkit.thing) reaches the world's and the libraries' assets and packages, never one in a home folder, so a name in a world reads the same asset for everyone, whatever their home holds.startup_scene = "scenes.main"reads the world's ownscenes/main.scene. An asset in your home folder is reached by its path, and a~written inside a package in your home folder names that package's own members. - A module in your home folder can require another in the same folder, and it can require the world's modules.
- Your own
executeand console lines can require anything in your home folder.
To use something from home in a world, copy it from /zero/home/<username>/... into /zero/source/... and reference the copy. The copy is world content: shared, publishable, and standing on its own.