Cotal TypeScript packages
    Preparing search index...

    Function resolveMeshTarget

    • Resolve the mesh target by precedence (first match wins):

      1. --space selects a registered space or identifies this project's matching stopped space.
      2. --server — registry entry on that server (for creds/personas), else the local project.
      3. The current selected by cotal use, except inside a project whose root has one RUNNING space other than it, where step 4 applies. A space this folder prepared and never started, and one whose stack here is stopped, does not take the selection's place; a folder holding the records of a stack that runs from another folder or under another Cotal home refuses at step 4 and names where it runs (recordsRunElsewhere), and one whose own stack is half started or half stopped is the target at step 4 (unfinishedStackSpace). The selection stays the target when its own broker is down, and a selection that names no registration refuses rather than reaching another mesh. Inside a project whose root has several running spaces, none of them the selection, the run warns first.
      4. A genuine local project (cwd walks up to a real .cotal/).
      5. The registry's running meshes: 0 ⇒ error; 1 ⇒ use it; N ⇒ error naming each + its root. flags.offline (from a sweep) is excluded here; a named --space and the selected current are not filtered. A space cotal space create prepared and no up started, named by --space, selected, or prepared at the local project, refuses as not-started. So does a local project with no registration whose stack journal recorded a broker; only a project with neither gets the default. No silent fallback — an unresolved target throws one human sentence.

      Parameters

      Returns MeshTarget