space
Genie space metadata helpers.
Fetches a Genie space’s definition (including the opt-in serialized_space
blob) and extracts the curated starter questions an author configured on the
space. The typed SDK client.genie.getSpace only returns the
directory-listing surface (title / description / warehouse_id); the
sample questions live inside serialized_space, which the REST API returns
only when include_serialized_space=true. We hit that endpoint through the
workspace client’s raw apiClient since the typed request shape has no flag
for it.
The serialized blob is also more privileged than the listing surface: the
workspace API requires Can Edit on the space to return it, while Can Run
is enough for title / description. A caller that only holds Can Run - an
app service principal granted just enough to ask questions is the common case
- would otherwise lose the whole space lookup to a
PERMISSION_DENIEDit cannot act on, so the fetch degrades to the unserialized request instead of failing (see getGenieSpace).