Skip to main content

@svatah/yam-trajectory

Trajectory capture and compile to proposals

Exports

ExportKindSignature
captureNameForfunctionexport function captureNameFor(phrase: string, kind: string): stringA capture name for a read: usernameFieldValue, from the phrase and kind.
checkTrajectoryfunctionexport function checkTrajectory(lines: readonly TrajectoryLine[]): string[]Whether a trajectory is well formed: sequential and in order.
CompiledTrajectoryinterfaceexport interface CompiledTrajectory
compileTrajectoryfunctionexport function compileTrajectory(Compile a trajectory. Writes nothing; writeProposal does that.
CompileTrajectoryOptionsinterfaceexport interface CompileTrajectoryOptions
draftForfunctionexport function draftFor(line: TrajectoryLine): DraftStep | undefined
DraftStepinterfaceexport interface DraftStepA step drafted from one or more calls.
NO_INTENTvariableNO_INTENT = "(no intent recorded)"What a call with no intent is called while it waits for a person (SF-12).
phraseForfunctionexport function phraseFor(describe: ElementDescription): stringthe Sign in link, the username field, the booking-result element.
readTrajectoryfunctionexport function readTrajectory(path: string): TrajectoryLine[]Read a trajectory.jsonl, validating every line (REQ-STD-1).
sentenceForActfunctionexport function sentenceForAct(The canonical sentence for one action (LLD §13.4's "map act kinds to IR
sentenceForCheckfunctionexport function sentenceForCheck(The sign in button should be visible, and the page and URL forms.
sentenceForReadfunctionexport function sentenceForRead(Remember the value of the username field as usernameFieldValue.
TrajectoryCalltypealiasexport type TrajectoryCall = z.infer<typeof trajectoryCallSchema>;
trajectoryCallSchemavariabletrajectoryCallSchema = z.enum(["snapshot", "act", "read", "check"])Which surface call a line records.
TrajectoryLinetypealiasexport type TrajectoryLine = z.infer<typeof trajectoryLineSchema>;
trajectoryLineSchemavariabletrajectoryLineSchema = z
TrajectoryWriterclassexport class TrajectoryWriterAppend-only, one JSON object per line, flushed per call.
writeProposalfunctionexport function writeProposal(Write a proposal to proposals/<date>/.