share_service
Expose a deployed app through a hosted URL, choosing private owner-only access or public world access, so the app can be opened outside the LAN.
Instructions
Use when: you need a URL you can open (public_url is LAN-only).
Exposes the app at ``https://<name>--<slug>.<domain>/`` via the cloud
link. ``access='private'`` (default) opens only for the owner of this
machine's Nerdit account, signed in to the Nerdit App, and the people they
allow there — works on every linked node, nothing to configure.
``access='public'`` makes the URL world-reachable: it needs an
account in good standing (free during the public beta; else 409
``share.not_entitled``) AND either a
``[deploy].edge_auth`` on the app or ``consent=true`` (else 409
``share.unprotected``) — public means public. The node must be linked
(409 ``share.link_required``). Returns ``{access, url, state}``; ``state``
is ``ready`` | ``link_down`` | ``not_entitled``. The same URL then appears
in ``get_service`` / ``list_routes`` under ``public_urls`` (kind
``hosted``).
``state`` and ``origin`` answer two DIFFERENT questions and you need
both. ``state`` is about the LINK — is the hosted path provisioned.
``origin`` is about the APP behind it: ``{status, answers, hint}``, where
``answers`` is true only while the service is running. A share can be
``state: ready`` with ``origin.answers: false``, and then the URL returns
``share.not_shared`` (the hosted resolver refuses a service with no live
origin) — which reads exactly like "never shared". When ``answers`` is
false, ``origin.hint`` says what to do; call ``diagnose_service``.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name (or row id) of an existing deployed app — only kind 'service' can be exposed: ``share_service``/``add_domain`` refuse a model or database with 422 ``*.kind_unsupported``, while the remove tools just find nothing to undo. | |
| access | No | Exposure mode: ``private`` (the default — only the owner of this machine's Nerdit account and the people they allow in the Nerdit App) or ``public`` (world-reachable). Any other value is refused by the daemon with a 422. | private |
| consent | No | Acknowledges that a public share serves the app to anyone with the URL. Read only when ``access='public'``, where ``false`` (the default) is refused unless the app carries a ``[deploy].edge_auth`` block; ignored for a private share. | |
| hosted_only | No | ``true`` locks the app to its hosted URL: no local proxy route (409 ``share.hosted_only_conflict`` while a domain is bound, 409 ``share.hosted_only_no_token`` if the daemon is reachable without a token). ``false`` restores the LAN routes; omitted keeps the stored lock. With ``access='private'`` a lock request keeps an existing public share. | |
| idempotency_key | No | Caller-chosen key: a retry with the same key replays the first result instead of acting twice. Omit and a fresh key is minted per call, so each call acts. |