Skip to main content

@svatah/yam

The yam CLI and MCP server

Exports

ExportKindSignature
bindingsCommandfunctiondeclare function bindingsCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode>;
boolOptionfunctiondeclare function boolOption(args: ParsedArgs, name: string, fallback?: boolean): boolean;A boolean option: present as a bare flag, or --name true|false.
CommandIointerfaceinterface CommandIo
COMMANDSvariableCOMMANDS: readonly CommandHelp[] = [Every command, with its own help. Order is the order yam help lists them, then the nouns.
compileProjectfunctionexport function compileProject(Compile a loaded project with the grammar alone. Offline, always.
CONFIG_FILESvariableCONFIG_FILES: string[]
connectToBrokerfunctionexport async function connectToBroker(io: CommandIo): Promise<BrokerDescriptor>The broker this machine is using, started if there is not one — and exactly
defaultCasesPathfunctionexport function defaultCasesPath(): stringWhere the cases live, relative to the repository this package is built in.
depthOffunctionexport function depthOf(How much colour this process should send. Measured once, per process.
diagnosticfunctionexport function diagnostic<C extends DiagnosticCode>(code: C, ...params: Parameters<(typeof CATALOGUE)[C]>): DiagnosticA row of the catalogue, with its parameters filled in.
DiagnosticCodetypealiasexport type DiagnosticCode = keyof typeof CATALOGUE;
DIAGNOSTICSvariableDIAGNOSTICS: readonly Diagnostic[] = [Every row with example parameters, for the vocabulary check and the docs.
evalCommandfunctiondeclare function evalCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode>;
evalSelfCommandfunctionexport async function evalSelfCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode>
EXITvariableEXIT:The exit codes of LLD §15.
EXIT_MEANINGSvariableEXIT_MEANINGS: ReadonlyArray<readonly [number, string, string]> = [What each exit code means, in the words yam help exit-codes prints.
ExitCodetypealiastype ExitCode = (typeof EXIT)[keyof typeof EXIT];
FrontDoorDiagnosticinterfaceexport interface Diagnostic
GroundingAnswerinterfaceexport interface GroundingAnswer
groundingAnswersfunctionexport function groundingAnswers(path?: string): GroundingAnswers
GroundingAnswersinterfaceexport interface GroundingAnswers
GroundingCaseinterfaceexport interface GroundingCase
groundingEvalCommandfunctionexport async function groundingEvalCommand(
hasModelGroundingfunctiondeclare function hasBindGrounder(): boolean;Whether anything but the picker-only default is registered.
healCommandfunctiondeclare function healCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode>;
helpForfunctionexport function helpFor(words: readonly string[]): string | undefinedHelp for one command, or for a noun alone; undefined when neither matches.
installModelGroundingfunctionexport function installModelGrounding(options: ModelGroundingOptions = {}): booleanRegister the recorder's grounder for bind()'s record mode.
loadBindingsfunctionexport function loadBindings(The bindings store, or a ConfigError naming the file (P2-F2).
loadConfigfunctiondeclare function loadConfig(root: string, env?: NodeJS.ProcessEnv):The config with the selected endpoint applied (Draft 2.22, REQ-CLI-11).
LoadedProjectinterfaceexport interface LoadedProject
loadProjectfunctionexport async function loadProject(root: string): Promise<LoadedProject>
mainfunctionexport async function main(argv: readonly string[], io: CommandIo): Promise<ExitCode>
ModelGroundingOptionsinterfaceexport interface ModelGroundingOptions
newRunIdfunctiondeclare function newRunId(now?: Date, random?: () => number): string;A lexicographically sortable id, which is what a run directory wants.
NOUNSvariableNOUNS: ReadonlyArray<readonly [string, string]> = [The nouns, and the verbs under each, for yam <noun> alone.
numberOptionfunctiondeclare function numberOption(args: ParsedArgs, name: string): number | undefined;A numeric option, or undefined when absent or unparseable.
paintfunctionexport function paint(what: StatusTone, text: string): stringA status word, in the colour the design system gives that tone — for the
parseArgsfunctiondeclare function parseArgs(argv: readonly string[]): ParsedArgs;
ParsedArgsinterfaceinterface ParsedArgsA small argument reader for the CLI (LLD §15).
ProjectRunnerOptionsinterfaceexport interface ProjectRunnerOptions
projectRunnersfunctionexport function projectRunners(The API and custom-step runners a project's plan needs.
readCasesfunctionexport function readCases(path = defaultCasesPath()): GroundingCase[]
recordCommandfunctionexport async function recordCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode>
registerAllAdaptersfunctionexport function registerAllAdapters(): void
registerRuntimeReplayerfunctionexport function registerRuntimeReplayer(options: RuntimeReplayerOptions): voidRegister it. yam heal --run <id> calls this; nothing else does.
runProjectfunctionexport async function runProject(Run a project with the standalone executor.
RunProjectOptionsinterfaceexport interface RunProjectOptionsWhat runProject needs beyond the loaded project.
runtimeReplayerfunctionexport function runtimeReplayer(options: RuntimeReplayerOptions): ReplayerA replayer over a compiled plan.
RuntimeReplayerOptionsinterfaceexport interface RuntimeReplayerOptions
serviceCompileTrajectoryfunctionexport async function serviceCompileTrajectory(Compile a captured trajectory into proposals/<date>/ (T5.5).
serviceHealfunctionexport async function serviceHeal(Heal a run, streaming each proposal as it is decided.
serviceMigrateFromPrototypefunctionexport async function serviceMigrateFromPrototype(POST /migrate, which is yam migrate <dest> --from-prototype <src>.
serviceRecordfunctionexport async function serviceRecord(
serviceToolsForfunctionexport async function serviceToolsFor(The tools a project would expose, and the reasons for the ones it would not.
serviceVerifyBindingsfunctionexport async function serviceVerifyBindings(Dry-resolve the store, one binding at a time.
stringOptionfunctiondeclare function stringOption(args: ParsedArgs, name: string): string | undefined;A string option, or undefined when absent. A bare flag is not a string.
stringOptionsfunctiondeclare function stringOptions(args: ParsedArgs, name: string): string[];Every value of a repeated option, in order.
surfaceCommandfunctiondeclare function surfaceCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode>;
TIER2_PROMPT_VERSIONvariableTIER2_PROMPT_VERSION = "c2-1"The prompt this tier is versioned by, in provenance (REQ-AGT-3).
TIER2_SYSTEM_PROMPTvariableTIER2_SYSTEM_PROMPT = You translate one sentence from a browser automation script into a JSON step.`The instruction block. Stable, so the gateway's cache key is stable.
TOP_LEVELvariableTOP_LEVEL = yam — describe a behaviour once, bind it to the real application, replay it without a model`The top-level help, verbatim from the design; a test compares it.
topicfunctionexport function topic(name: string): string | undefinedyam help <topic>, or undefined for a topic that does not exist.
TOPICSvariableTOPICS = ["flows", "bindings", "exit-codes", "session", "adapters", "agents"] as const
uninstallModelGroundingfunctionexport function uninstallModelGrounding(): voidPut module (a)'s picker-only default back.
userFacingHelpTextfunctionexport function userFacingHelpText(): stringEvery string a person can read from the help, for the vocabulary check (REQ-CLI-9).
vitestCaseNamesfunctionexport function vitestCaseNames(one:Every name a catalogue may call one vitest case by (P11-F2).
withDepthfunctionexport function withDepth(next: ColourDepth | undefined, theme?: Theme): voidFor a test that wants to state a terminal rather than be run in one.