Effect classes: a command either touches only the person's own space ("private") or reaches other people ("others"). Help groups commands under those headings, an "others" command needs --why and previews its audience before it acts, and its result says who can see it. readOnly marks reads, which change nothing.
npx shadcn@latest add ourostack/ouro-ui/ax-effects#v1.3.10It installs lib/ouro/ax/effects.ts. Its tests are ax-effects-tests. Every item runs on Node 22.18 or later as it is copied: the files import each other as ./<file>.ts. The Ouro AX guide shows how they fit together.
Exports
Audience
Who can see an effect, in words a person reads: { only: true, who: "only you" } or the people of a conversation.
interface Audience {
only: boolean;
who: string;
}audienceLines
The audience preview an "others" action prints before it runs, and the line its result states.
function audienceLines(a: { doing: string; done: string; where: string; as: string; who: readonly string[] | "everyone"; }): { preview: string; result: string; }Example:
audienceLines({ doing: "Sending", done: "Sent", where: '"Design sync"', as: "the person", who: ["Jo Park", "Ana Ruiz"] })DEFAULT_HEADINGS
const DEFAULT_HEADINGS: EffectHeadingsDRY_RUN_FLAG
The flag that previews an "others" command's effect and audience without acting.
const DRY_RUN_FLAG: "dry-run"Effect
Effect classes: a command either touches only the person's own space ("private") or reaches other people ("others"). Help groups commands under those headings, an "others" command needs --why and previews its audience before it acts, and its result says who can see it. readOnly marks reads, which change nothing.
type Effect = "private" | "others";effectAnnotations
MCP tool annotations for an effect, as the MCP specification defines them.
function effectAnnotations(effect: Effect, readOnly: boolean): { readOnlyHint: boolean; destructiveHint: boolean; openWorldHint: boolean; }EffectHeadings
interface EffectHeadings {
private: string;
others: string;
}namesLine
"Jo Park", "Jo Park and Ana Ruiz", "Jo Park, Ana Ruiz and 3 others".
function namesLine(names: readonly string[], max?: number): stringONLY_YOU
const ONLY_YOU: AudienceprivateResult
The result line of a private action: what changed, and that nobody else saw it.
function privateResult(what: string): stringWHY_FLAG
The flag an "others" command takes: who asked, and what they said.
const WHY_FLAG: "why"WHY_PLACEHOLDER
const WHY_PLACEHOLDER: "<who asked you, and what they said>"