@svatah/yam
The yam CLI and MCP server
- Source:
packages/cli· README:packages/cli/README.md - Install:
npm install @svatah/yam· bin:yam - Version 0.1.0 · Apache-2.0
Exports
| Export | Kind | Signature | |
|---|---|---|---|
bindingsCommand | function | declare function bindingsCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode>; | |
boolOption | function | declare function boolOption(args: ParsedArgs, name: string, fallback?: boolean): boolean; | A boolean option: present as a bare flag, or --name true|false. |
CommandIo | interface | interface CommandIo | |
COMMANDS | variable | COMMANDS: readonly CommandHelp[] = [ | Every command, with its own help. Order is the order yam help lists them, then the nouns. |
compileProject | function | export function compileProject( | Compile a loaded project with the grammar alone. Offline, always. |
CONFIG_FILES | variable | CONFIG_FILES: string[] | |
connectToBroker | function | export async function connectToBroker(io: CommandIo): Promise<BrokerDescriptor> | The broker this machine is using, started if there is not one — and exactly |
defaultCasesPath | function | export function defaultCasesPath(): string | Where the cases live, relative to the repository this package is built in. |
depthOf | function | export function depthOf( | How much colour this process should send. Measured once, per process. |
diagnostic | function | export function diagnostic<C extends DiagnosticCode>(code: C, ...params: Parameters<(typeof CATALOGUE)[C]>): Diagnostic | A row of the catalogue, with its parameters filled in. |
DiagnosticCode | typealias | export type DiagnosticCode = keyof typeof CATALOGUE; | |
DIAGNOSTICS | variable | DIAGNOSTICS: readonly Diagnostic[] = [ | Every row with example parameters, for the vocabulary check and the docs. |
evalCommand | function | declare function evalCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode>; | |
evalSelfCommand | function | export async function evalSelfCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode> | |
EXIT | variable | EXIT: | The exit codes of LLD §15. |
EXIT_MEANINGS | variable | EXIT_MEANINGS: ReadonlyArray<readonly [number, string, string]> = [ | What each exit code means, in the words yam help exit-codes prints. |
ExitCode | typealias | type ExitCode = (typeof EXIT)[keyof typeof EXIT]; | |
FrontDoorDiagnostic | interface | export interface Diagnostic | |
GroundingAnswer | interface | export interface GroundingAnswer | |
groundingAnswers | function | export function groundingAnswers(path?: string): GroundingAnswers | |
GroundingAnswers | interface | export interface GroundingAnswers | |
GroundingCase | interface | export interface GroundingCase | |
groundingEvalCommand | function | export async function groundingEvalCommand( | |
hasModelGrounding | function | declare function hasBindGrounder(): boolean; | Whether anything but the picker-only default is registered. |
healCommand | function | declare function healCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode>; | |
helpFor | function | export function helpFor(words: readonly string[]): string | undefined | Help for one command, or for a noun alone; undefined when neither matches. |
installModelGrounding | function | export function installModelGrounding(options: ModelGroundingOptions = {}): boolean | Register the recorder's grounder for bind()'s record mode. |
loadBindings | function | export function loadBindings( | The bindings store, or a ConfigError naming the file (P2-F2). |
loadConfig | function | declare function loadConfig(root: string, env?: NodeJS.ProcessEnv): | The config with the selected endpoint applied (Draft 2.22, REQ-CLI-11). |
LoadedProject | interface | export interface LoadedProject | |
loadProject | function | export async function loadProject(root: string): Promise<LoadedProject> | |
main | function | export async function main(argv: readonly string[], io: CommandIo): Promise<ExitCode> | |
ModelGroundingOptions | interface | export interface ModelGroundingOptions | |
newRunId | function | declare function newRunId(now?: Date, random?: () => number): string; | A lexicographically sortable id, which is what a run directory wants. |
NOUNS | variable | NOUNS: ReadonlyArray<readonly [string, string]> = [ | The nouns, and the verbs under each, for yam <noun> alone. |
numberOption | function | declare function numberOption(args: ParsedArgs, name: string): number | undefined; | A numeric option, or undefined when absent or unparseable. |
paint | function | export function paint(what: StatusTone, text: string): string | A status word, in the colour the design system gives that tone — for the |
parseArgs | function | declare function parseArgs(argv: readonly string[]): ParsedArgs; | |
ParsedArgs | interface | interface ParsedArgs | A small argument reader for the CLI (LLD §15). |
ProjectRunnerOptions | interface | export interface ProjectRunnerOptions | |
projectRunners | function | export function projectRunners( | The API and custom-step runners a project's plan needs. |
readCases | function | export function readCases(path = defaultCasesPath()): GroundingCase[] | |
recordCommand | function | export async function recordCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode> | |
registerAllAdapters | function | export function registerAllAdapters(): void | |
registerRuntimeReplayer | function | export function registerRuntimeReplayer(options: RuntimeReplayerOptions): void | Register it. yam heal --run <id> calls this; nothing else does. |
runProject | function | export async function runProject( | Run a project with the standalone executor. |
RunProjectOptions | interface | export interface RunProjectOptions | What runProject needs beyond the loaded project. |
runtimeReplayer | function | export function runtimeReplayer(options: RuntimeReplayerOptions): Replayer | A replayer over a compiled plan. |
RuntimeReplayerOptions | interface | export interface RuntimeReplayerOptions | |
serviceCompileTrajectory | function | export async function serviceCompileTrajectory( | Compile a captured trajectory into proposals/<date>/ (T5.5). |
serviceHeal | function | export async function serviceHeal( | Heal a run, streaming each proposal as it is decided. |
serviceMigrateFromPrototype | function | export async function serviceMigrateFromPrototype( | POST /migrate, which is yam migrate <dest> --from-prototype <src>. |
serviceRecord | function | export async function serviceRecord( | |
serviceToolsFor | function | export async function serviceToolsFor( | The tools a project would expose, and the reasons for the ones it would not. |
serviceVerifyBindings | function | export async function serviceVerifyBindings( | Dry-resolve the store, one binding at a time. |
stringOption | function | declare function stringOption(args: ParsedArgs, name: string): string | undefined; | A string option, or undefined when absent. A bare flag is not a string. |
stringOptions | function | declare function stringOptions(args: ParsedArgs, name: string): string[]; | Every value of a repeated option, in order. |
surfaceCommand | function | declare function surfaceCommand(args: ParsedArgs, io: CommandIo): Promise<ExitCode>; | |
TIER2_PROMPT_VERSION | variable | TIER2_PROMPT_VERSION = "c2-1" | The prompt this tier is versioned by, in provenance (REQ-AGT-3). |
TIER2_SYSTEM_PROMPT | variable | TIER2_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_LEVEL | variable | TOP_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. |
topic | function | export function topic(name: string): string | undefined | yam help <topic>, or undefined for a topic that does not exist. |
TOPICS | variable | TOPICS = ["flows", "bindings", "exit-codes", "session", "adapters", "agents"] as const | |
uninstallModelGrounding | function | export function uninstallModelGrounding(): void | Put module (a)'s picker-only default back. |
userFacingHelpText | function | export function userFacingHelpText(): string | Every string a person can read from the help, for the vocabulary check (REQ-CLI-9). |
vitestCaseNames | function | export function vitestCaseNames(one: | Every name a catalogue may call one vitest case by (P11-F2). |
withDepth | function | export function withDepth(next: ColourDepth | undefined, theme?: Theme): void | For a test that wants to state a terminal rather than be run in one. |