Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit61a33237e0

README.md

shared Module

Cross-tool helpers for the api toolbox. Every tool inside this toolbox can pull these in with require(".shared").

Purpose

This module holds the small set of helpers that more than one tool in the toolbox needs — typically the ok(value, formatted?) / fail(message, exitCode?) constructors that produce the canonical apiToolResult shape, plus any toolbox-wide parsers, validators, or shared state. Keep it focused: per-tool implementation stays inside each <x>.tool/init.luau (with its own --!desc / --!arg / --!return / --!example annotations).

Usage

local shared = require(".shared")

function M.someTool(...)
    if not ok then
        return shared.fail("reason", 1)
    end
    return shared.ok(value, "")
end

Exports

See init.luau for the full export surface. Typical exports include shared.ok(value, formatted?) and shared.fail(message, exitCode?) for building the toolbox's standard result envelope.