Contribution tools

Offer your own files and methods into the shared library, track your reuse and earnings stats, and see, explain, or adopt divergences on referenced code.

These tools live in the on-demand catalog rather than the default tool list, keeping the connected client's context small. Discover them with search_tools (e.g. search_tools(queries: ["contribute"])) and run them with execute_tools — or call them directly if your client has already loaded them.


Submit Code

submit_code via execute_tools

Offer a file or method the user OWNS into the shared reusable-code library for curator review. Use this when the user has built something reusable and wants to contribute it (e.g. "submit this", "share this with the library", "offer this for reuse"). REFERENCE MODEL: the user keeps ownership — approval makes the unit referenceable by other projects and the user earns when it is reused; it is never copied away from them. Submittable code must be in the user's own project (net-new or a fork; both are fine). A curator reviews and approves or rejects — submission does not publish immediately. Pass an optional note making the case for why this unit is useful to others (it is shown to the curator and, on approval, to developers browsing variants). Do NOT call this to reuse code — that is reuse_code; this is the contribute direction.

Parameters

  • Name
    type
    Type
    string
    Required
    required
    Description

    Whether the unit being submitted is a file or a method.

  • Name
    uuid
    Type
    string
    Required
    required
    Description

    UUID of the file or method to submit. Must belong to the active project (code the user owns).

  • Name
    note
    Type
    string
    Description

    Optional note for the curator: the case for why this unit is useful to others. Shown at review, and to developers browsing variants on approval.


Get Contributions

get_contributions read-only via execute_tools

Report the user's OWN contribution stats — how their shared code is being reused across the library. Use when they ask "has my code been reused?", "what have I earned?", or "how are my contributions doing?". Returns { total_reuses (times a stranger's project referenced your units), projects (distinct projects doing so), credits_pending (recorded, awaiting the retention window), credits_granted (settled) }. Scoped to the caller — never another user. Read-only, no input. Pair with submit_code (the contribute direction).

This tool takes no parameters.


See Divergences

see_divergences read-only via execute_tools

See how PEERS changed the canonical code your project references — the reasoned divergences other projects made from units you reference ("someone on this code changed it, here's why"). Use it when adapting reused code: before you re-implement a change to a referenced unit, check whether another project already diverged the same way and why — you may want the same edit, or it may warn you off. Returns { canonical_uuid, resource_type, reason, diverged_at } per divergence; EXPLAINED divergences only (an unexplained fork is noise), and never your own. Read-only, no input.

This tool takes no parameters.


Explain Divergence

explain_divergence read-only via execute_tools

Explain a divergence you just made — attach the WHY to a referenced unit your project forked. When you edit code that was referenced (not authored) here, copy-on-write forks a private copy; call this right after so other projects on the same canonical unit can see why you changed it (and, later, adopt it). Pass fork_uuid = the uuid of the referenced unit you just edited, and a one-line reason. Only the project that made the fork can explain it, and only a real divergence of a referenced unit qualifies (editing your own code records nothing to explain).

Parameters

  • Name
    fork_uuid
    Type
    string
    Required
    required
    Description

    UUID of the referenced unit you just edited (its local uuid — the same one you passed to the edit tool).

  • Name
    reason
    Type
    string
    Required
    required
    Description

    One line: what you changed and why (max 500 chars). This is the signal other referencers see.


Adopt Divergence

adopt_divergence via execute_tools

Adopt a peer's divergence — take their change to a unit you reference. Re-points your project's reference from the canonical unit to the peer's forked version, a granular swap that leaves the rest of the file untouched; the diverger earns on adoption. Use after see_divergences when a peer's reasoned change is one you want too. Pass fork_uuid from the see_divergences feed. Only works if your project actually references the unit that was diverged from. This tracks the peer's version — to instead make your OWN change, just edit the referenced unit (copy-on-write forks your private copy).

Parameters

  • Name
    fork_uuid
    Type
    string
    Required
    required
    Description

    UUID of the peer divergence to adopt, from the see_divergences feed.