Sharpee
Chord / Standard Library / Overview

Standard library

This page is a writer-facing catalog of what Sharpee gives you for free: every standard action a player can type, every trait you compose onto an entity, and the runtime services (plugins and daemons) behind timed and NPC behavior. This is the companion to the Author guide: that teaches the language and its define trait / define action escape hatches; this one catalogs everything already built in, so you know what not to define before reaching for those hatches.

What the standard library is

The standard library is everything Sharpee gives a story before the story says anything: fifty-odd actions the player can attempt, forty-odd traits an entity can be composed from, the behaviors that own their state changes, and the runtime services (plugins, daemons, channels) underneath. A Chord .story file builds directly on this vocabulary; the point of this reference is to know what is already there, so you reach for define trait / define action only when you are genuinely adding something new.

The reference is organized by author task:

PagesWhat they cover
Manipulationtake, drop, put, give, throw, push, pull, touch — and the per-entity verbs (lower, raise, turn, cut, dig)
Movementgo, enter, exit, climb — rooms, exits, doors-in-motion, regions
Containers & openablesopen, close, lock, unlock — and the door entry
Wearingwear, take off — wearable, clothing, equipment
Senses & examinationexamine, look, search, read, listen, smell
Devicesswitch on/off — switchable, light sources, buttons
NPCs & conversationtalk, ask, tell (topics), attack (combat), eat, drink, hide
Deathkill the player, deadly exits and rooms, the health trait
Meta & systemabout, help, inventory, score, save, undo, and friends
Traits catalogall forty-odd traits in one lookup table
Plugins & daemonsthe scheduler, NPC and state-machine plugins, extensions

How an action entry is laid out

Each action entry leads with the basics: the verbs that actually parse (grounded in the parser's grammar; where a listed synonym does not parse, the entry says so) and the trait that makes an entity eligible (or "anything"). Then comes a worked example: the author writes a small .story scene exercising the entry's override seams, and the player sees the real transcript it produces. A compact table closes the entry with the message keys you can retarget (Refusals and Success rows) and the events it emits for story reactions, followed by a one-line note on which on/after clauses the action consults.

Standard behavior vs. per-entity verbs

Most verbs have one canonical behavior (TAKE moves a thing to your hands, OPEN opens it), and stdlib implements it once, for every entity. A few verbs (LOWER, RAISE, plus unbound cousins like WAVE, WIND) have no single meaning; the platform refuses to invent one (ADR-090), and each entity that supports the verb defines what it means. The Manipulation entry shows the Chord pattern in full. TURN, once part of this family, now consults the entity directly instead. A related pair, CUT and DIG, gate on a trait and validate a tool, but the outcome is likewise each entity's own.

Messages are IDs, not fixed text

Standard actions never speak English; they emit message IDs that the language layer renders, each named by a single-word alias (taking-fixed-in-place). Per entity, you replace a moment's text with on/after clauses carrying your own phrases (the Manipulation opening shows the pattern); story-wide, an override message block under that alias (override message taking-fixed-in-place) replaces the platform text everywhere (ADR-255), and a TypeScript story can override the IDs through the language provider.

Intercepting standard actions

The on <gerund> it / after <gerund> it clause surface works on exactly the actions the platform wires for consultation, 38 of them. It is fail-fast: a gerund nothing consults is a load error, with a pointed message. Each entry here states what gets consulted, including the multi-entity commands where both sides are heard (give: item and recipient; lock: target then key; go: the room left, the room entered, and the door between). Meta actions and LOOK consult nothing, because there is no entity to key on.

Related references

  • The Author guide covers the .story language itself: syntax, clause semantics, define forms, tooling. Read it to write; read this reference to know what is already built.
  • The Grammar reference is the formal grammar, for tool authors and the terminally curious.
  • The Cookbook is the table-first quick lookup: phrasings, refusal keys, and worked scene/transcript pairs for the actions you reach for most.
  • packages/sharpee/docs/genai-api/ (in the npm package) is the generated TypeScript API reference, for the Sharpee Way: trait classes, behaviors, world-model and engine interfaces. Where this reference says "TypeScript-only," that is where the types live.