Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part oftoolbox coinfall.toolbox·originates fromworld 9d2cf424-f…

shared

Cross-tool helpers for the [name] toolbox. Every tool inside the toolbox can pull these in with `require(".shared")`. Holds the small set of helpers that more than one tool needs — typically the `ok(value, formatted?)` / `fail(message, exitCode?)` constructors that produce the ca…

byzero-proxy @ DESKTOP-DB3UJOJ·posted 2mo ago
What it does

shared

Cross-tool helpers for the [name] toolbox. Every tool inside the toolbox can pull these in with require(".shared"). Holds the small set of helpers that more than one tool needs — typically the ok(value, formatted?) / fail(message, exitCode?) constructors that produce the canonical [name]ToolResult shape, plus any toolbox-wide parsers, validators, or shared state. Per-tool implementation stays inside each <x>.tool/init.luau; this module is not a place to forward logic from.

Exports

  • M.ok(value: any?, formatted: string?) -> [name]ToolResult — success envelope (exitCode = 0, ok = true).
  • M.fail(message: string, exitCode: number?) -> [name]ToolResult — failure envelope (exitCode defaults to 1, ok = false).

Types:

  • [name]ToolResult = { stdout: string, stderr: string, exitCode: number, ok: boolean, value: any? }
    • stdout — human-readable formatted output; empty when the op produces no text.
    • stderr — error message on failure; empty on success.
    • exitCode — POSIX-style exit code: 0 success, 1 generic failure, 2 bad arguments.
    • ok — true iff exitCode == 0.
    • value — structured return from the underlying op; nil for void ops.

Usage

local shared = require(".shared")

function M.someTool(args)
    if not args.id then
        return shared.fail("missing id", 2)
    end
    return shared.ok({ id = args.id }, "created " .. args.id)
end

Notes

  • Pure constructors — no engine calls, no state. Safe to call from any context.
  • Tools that opt into this shape get a stable envelope every other tool in the toolbox can rely on. Tools that do something custom can return whatever shape they want — [name]ToolResult is opt-in.
  • Per-tool implementations still own their own --!desc / --!arg / --!return / --!example annotations even when their result is constructed through these helpers.

Interface

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

conforms to

zero/source-extract/v2

Shared Module Cross-tool helpers for this toolbox. Loaded via `require(".shared")` from any tool inside the box. Per the project convention, this module is for GENUINE cross-tool sharing only — `ok` / `fail` result envelopes, common parsers, shared validators, cross-tool state. Each `<x>.tool/init.luau` MUST contain its own full implementation plus its own `--!desc` / `--!arg` / `--!return` / `--!example` annotations; do NOT move per-tool logic into `shared.module/init.luau` and have the tool be a one-line forwarder. Consumers: local shared = require(".shared") if not ok then return shared.fail("reason", 1) end return shared.ok(value, "created")

ok(value: any?, formatted: string?) → ToolResult

Build a success result. Empty `stdout` is the default; pass `formatted` when the op produces human-readable output.

argtypedescription
valueany?Optional payload returned to the caller.
formattedstring?Optional human-readable stdout string.

examples

return shared.ok({ id = "abc" }, "created")

fail(message: string, exitCode: number?) → ToolResult

Build a failure result. `exitCode` defaults to 1; pass 2 for argument-shape errors.

argtypedescription
messagestringHuman-readable failure reason.
exitCodenumber?Optional non-zero exit code (defaults to 1).

examples

return shared.fail("not found", 2)
⌬ Types
ToolResult = {

Sub-parts

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

2items
This part has no composite children. See the Files segment for its leaf payloads.
backing path · coinfall.toolbox/shared.module

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.