Log inGet started
What it does

shared

Cross-tool helpers for the terrainSystem.toolbox. Loaded via require(".shared") from every tool inside the box. The module is intentionally thin — only result envelopes (ok / fail), the op dispatcher, and a couple of resolvers that every dispatching tool would otherwise duplicate. Per-tool logic lives in each <x>.tool/init.luau; this module is not a forwarder hub.

Exports

Result envelopes:

  • shared.ok(value?, formatted?) -> TerrainSystemToolResult — success.
  • shared.fail(message, exitCode?) -> TerrainSystemToolResult — failure (default exitCode = 1; pass 2 for argument-shape errors).

Argument plumbing:

  • shared.requireField(opts, name, context) — raise the canonical <context>: opts.<name> required error when the field is missing, otherwise return its value.
  • shared.dispatch(context, ops, opts) — op-keyed dispatch with uniform error messages listing the known ops.

Resolvers:

  • shared.resolveEntity(target) — normalize a string id, a string name (via entity.find), or a table with .entityId / .id / .__id to an entity id.
  • shared.handleOrAsset(value, context) — accept either an in-memory terrain handle or a .terrain asset ref (path / guid / AssetRef envelope) and return a handle.

Bound module reference (the toolbox's only seam into the underlying API):

  • shared.terrainSystem — the terrainSystem.* system module. Tools must reach the system through this field instead of re-requiring the module directly.

Types

  • TerrainSystemToolResult = { stdout, stderr, exitCode, ok, value } — the structured result shape every tool in this toolbox returns.

Usage

local shared = require(".shared")
local terrainSystem = shared.terrainSystem

local ops = {}
function ops.raise(opts)
    local handle = shared.handleOrAsset(opts.target, "terrainSystem.edit(op='raise')")
    terrainSystem.raise(handle, opts)
    return shared.ok(handle, "raised")
end

return {
    edit = function(opts)
        return shared.dispatch("terrainSystem.edit", ops, opts)
    end,
}

Notes

  • The shared.terrainSystem field is the only way tools reach into the terrainSystem.* namespace. New helpers that need a different module go through the same require-once-here pattern so the toolbox boundary stays a single import.
  • Don't extend the dispatcher with op-specific logic. Each op handler lives in its tool's own init.luau; the dispatcher only routes.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

This asset doesn't declare a schema or structured payload.

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

0items
This part has no composite children. See the Files segment for its leaf payloads.
This part has no leaf payloads.

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.