@svatah/yam-schema
Zod definitions and generated JSON Schemas for the Yam artifact contracts
- Source:
packages/schema· README:packages/schema/README.md - Install:
npm install @svatah/yam-schema - Version 0.1.0 · Apache-2.0
Exports
| Export | Kind | Signature | |
|---|---|---|---|
ActArgs | typealias | export type ActArgs = z.infer<typeof actArgsSchema>; | |
actArgsSchema | variable | actArgsSchema = z.record( | |
Action | typealias | export type Action = z.infer<typeof actionSchema>; | |
ACTION_FORMS | variable | ACTION_FORMS: readonly ActionForm[] = [ | The forms, in the order an inspector offers them: the common ones first. |
ActionField | interface | export interface ActionField | |
ActionFieldType | typealias | export type ActionFieldType = "string" | "number" | "boolean" | "url" | "key"; | How a field is collected, and how it is typed on the way to args. |
ActionForm | interface | export interface ActionForm | |
actionFormFor | function | export function actionFormFor(action: string): ActionForm | undefined | One form by action name. |
ACTIONS | variable | ACTIONS = [ | Every action a compiled step can carry. Order follows LLD §3.2 exactly. |
actionSchema | variable | actionSchema = z.enum(ACTIONS) | |
ActResult | typealias | export type ActResult = z.infer<typeof actResultSchema>; | |
actResultSchema | variable | actResultSchema = z | |
AdapterName | typealias | export type AdapterName = z.infer<typeof adapterNameSchema>; | |
adapterNameSchema | variable | adapterNameSchema = z.enum(["playwright", "bidi", "appium", "uia", "ax", "http", "process", "atspi"]) | Project configuration, yam.config.yaml (LLD §3.5). |
ApiRequest | typealias | export type ApiRequest = z.infer<typeof apiRequestSchema>; | |
apiRequestSchema | variable | apiRequestSchema = z | |
ApiResponse | typealias | export type ApiResponse = z.infer<typeof apiResponseSchema>; | |
apiResponseSchema | variable | apiResponseSchema = z | |
ArgValue | typealias | export type ArgValue = ValueRef | ScalarArg; | |
argValueSchema | variable | argValueSchema: z.ZodType<ValueRef | ScalarArg> = z.union([ | Step.args values: a ValueRef or a plain scalar (LLD §3.2). |
AUDIT_KINDS | variable | AUDIT_KINDS = [ | |
AuditKind | typealias | export type AuditKind = z.infer<typeof auditKindSchema>; | |
auditKindSchema | variable | auditKindSchema = z.enum(AUDIT_KINDS) | |
AuditLine | typealias | export type AuditLine = z.infer<typeof auditLineSchema>; | |
auditLineSchema | variable | auditLineSchema = z | |
Behavior | typealias | export type Behavior = z.infer<typeof behaviorSchema>; | |
behaviorSchema | variable | behaviorSchema = z.enum(["test", "workflow", "tool"]) | |
BindingContext | typealias | export type BindingContext = z.infer<typeof bindingContextSchema>; | |
bindingContextSchema | variable | bindingContextSchema = z | |
BindingEntry | typealias | export type BindingEntry = z.infer<typeof bindingEntrySchema>; | |
bindingEntrySchema | variable | bindingEntrySchema = z | One recorded binding for one context. |
BindingFile | typealias | export type BindingFile = z.infer<typeof bindingFileSchema>; | |
bindingFileSchema | variable | bindingFileSchema = z | |
BindingPlatform | typealias | export type BindingPlatform = z.infer<typeof bindingPlatformSchema>; | |
bindingPlatformSchema | variable | bindingPlatformSchema = z.enum(["web", "mobile", "desktop"]) | |
bindingsHash | function | export function bindingsHash(files: Record<string, unknown>): string | Hash of a whole bindings store: the id → file map, hashed canonically. Used in |
Box | typealias | export type Box = z.infer<typeof boxSchema>; | |
boxSchema | variable | boxSchema = z.tuple([z.number(), z.number(), z.number(), z.number()]) | [x, y, width, height]. |
Candidate | typealias | export type Candidate = z.infer<typeof candidateSchema>; | |
CANDIDATE_KINDS | variable | CANDIDATE_KINDS = [ | |
CandidateKind | typealias | export type CandidateKind = z.infer<typeof candidateKindSchema>; | |
candidateKindSchema | variable | candidateKindSchema = z.enum(CANDIDATE_KINDS) | |
candidateSchema | variable | candidateSchema = z | |
canonicalHash | function | export function canonicalHash(value: unknown): string | sha256 of the compact canonical form, hex encoded. |
canonicalJson | function | export function canonicalJson(value: unknown): string | Deterministic JSON: sorted keys, two-space indent, one trailing newline. |
canonicalJsonCompact | function | export function canonicalJsonCompact(value: unknown): string | Deterministic JSON with no whitespace — the form hashes are taken over. |
canonicalYaml | function | export function canonicalYaml(value: unknown): string | Deterministic YAML: sorted keys, block style, no line folding. |
Capabilities | typealias | export type Capabilities = z.infer<typeof capabilitiesSchema>; | |
CAPABILITIES | variable | CAPABILITIES: readonly CapabilityFlag[] = CAPABILITY_FLAGS | Every capability flag, so a client can render a readiness list. |
capabilitiesSchema | variable | capabilitiesSchema = z | |
CAPABILITY_FLAGS | variable | CAPABILITY_FLAGS = [ | |
CapabilityFlag | typealias | export type CapabilityFlag = (typeof CAPABILITY_FLAGS)[number]; | |
Capture | typealias | export type Capture = z.infer<typeof captureSchema>; | |
captureSchema | variable | captureSchema = z | |
Checkpoint | typealias | export type Checkpoint = z.infer<typeof checkpointSchema>; | |
checkpointSchema | variable | checkpointSchema = z | Enough state to resume a flow from this step (REQ-AUTO-3). |
CheckResult | typealias | export type CheckResult = z.infer<typeof checkResultSchema>; | |
checkResultSchema | variable | checkResultSchema = z | |
CheckSubject | typealias | export type CheckSubject = z.infer<typeof checkSubjectSchema>; | |
checkSubjectSchema | variable | checkSubjectSchema = z.enum(["ref", "page", "dialog"]) | |
COMPILER_TIERS | variable | COMPILER_TIERS = [0, 1, 2, 3] as const | |
Config | typealias | export type Config = z.infer<typeof configSchema>; | |
configSchema | variable | configSchema = z | |
COORDS_CANDIDATE_KIND | variable | COORDS_CANDIDATE_KIND = "coords" as const | Last resort: the element's box centre. |
DEFAULT_CONFIG | variable | DEFAULT_CONFIG: Omit<Config, "project"> | The default configuration yam init writes; also the base a partial config merges onto. |
DEFAULT_IGNORE_ATTRIBUTES | variable | DEFAULT_IGNORE_ATTRIBUTES = ["data-yam-eval"] | The default of bindings.ignoreAttributes (LLD §3.5, §16, Draft 2.3). |
defaultActionForRole | function | export function defaultActionForRole(role: string | undefined): string | The action an inspector opens on for an element of this role. |
DESKTOP_CANDIDATE_KINDS | variable | DESKTOP_CANDIDATE_KINDS = ["automationId", "controlPath"] as const | Desktop candidate kinds (Windows UIA, macOS AX). |
ElementDescription | typealias | export type ElementDescription = z.infer<typeof elementDescriptionSchema>; | |
elementDescriptionSchema | variable | elementDescriptionSchema = z | What describe(ref) returns: everything candidate synthesis and fingerprinting |
Environment | typealias | export type Environment = z.infer<typeof environmentSchema>; | |
environmentSchema | variable | environmentSchema = z.enum(["test", "staging", "production"]) | |
Expectation | typealias | export type Expectation = z.infer<typeof expectationSchema>; | |
expectationSchema | variable | expectationSchema = z | |
EXPR_OPS | variable | EXPR_OPS = ["eq", "ne", "gt", "lt", "matches"] as const | |
FAILURE_CLASSES | variable | FAILURE_CLASSES = [ | |
FailureClass | typealias | export type FailureClass = z.infer<typeof failureClassSchema>; | |
failureClassSchema | variable | failureClassSchema = z.enum(FAILURE_CLASSES) | |
Fingerprint | typealias | export type Fingerprint = z.infer<typeof fingerprintSchema>; | |
fingerprintSchema | variable | fingerprintSchema = z | |
FLOW_STATUSES | variable | FLOW_STATUSES = ["passed", "failed", "healed", "aborted"] as const | |
FlowStatus | typealias | export type FlowStatus = z.infer<typeof flowStatusSchema>; | |
flowStatusSchema | variable | flowStatusSchema = z.enum(FLOW_STATUSES) | |
GeneratedSchemas | typealias | export type GeneratedSchemas = Record<string, string>; | Base name → generated JSON Schema text, exactly as it is written to disk. |
generateJsonSchemas | function | export function generateJsonSchemas(): GeneratedSchemas | Render every published schema (REQ-STD-1). |
GEOMETRY_PREDICATE_KINDS | variable | GEOMETRY_PREDICATE_KINDS = ["location", "size", "box"] as const | |
Guard | typealias | export type Guard = z.infer<typeof guardSchema>; | |
guardSchema | variable | guardSchema = z | |
HUMAN_PROVENANCE_MODEL | variable | HUMAN_PROVENANCE_MODEL = "human" | The model value that marks a human, rather than model, decision. |
INPUT_TYPES | variable | INPUT_TYPES = ["string", "number", "boolean", "json", "secret"] as const | |
Invoker | typealias | export type Invoker = z.infer<typeof invokerSchema>; | |
invokerSchema | variable | invokerSchema = z | |
isHumanProvenance | function | export function isHumanProvenance(p: Provenance): boolean | True when the provenance records a human decision rather than a model call. |
MOBILE_CANDIDATE_KINDS | variable | MOBILE_CANDIDATE_KINDS = ["accessibilityId", "resourceId"] as const | Mobile candidate kinds (Appium). |
MODEL_TIERS | variable | MODEL_TIERS: readonly Tier[] = [2, 3] | Tiers whose output came from a model and therefore requires provenance (REQ-STD-4). |
NAMED_VALUE_PREDICATE_KINDS | variable | NAMED_VALUE_PREDICATE_KINDS = ["attribute", "css"] as const | |
NODE_STATES | variable | NODE_STATES = [ | |
NodeState | typealias | export type NodeState = z.infer<typeof nodeStateSchema>; | |
nodeStateSchema | variable | nodeStateSchema = z.enum(NODE_STATES) | |
offeredActions | function | export function offeredActions( | The actions this surface can actually perform, in offer order (SF-09). |
OnFailure | typealias | export type OnFailure = z.infer<typeof onFailureSchema>; | |
onFailureSchema | variable | onFailureSchema = z.union([ | stop (default), continue, or run a named compensating story then stop. |
Origin | typealias | export type Origin = z.infer<typeof originSchema>; | |
originSchema | variable | originSchema = z | |
OUTPUT_TYPES | variable | OUTPUT_TYPES = ["string", "number", "boolean", "json"] as const | |
Plan | typealias | export type Plan = z.infer<typeof planSchema>; | |
planHash | function | export function planHash(plan: Record<string, unknown>): string | Hash of a plan's content (REQ-COMP-7, REQ-AUTO-3). |
planSchema | variable | planSchema = z | |
Predicate | typealias | export type Predicate = z.infer<typeof predicateSchema>; | |
PREDICATE_KINDS | variable | PREDICATE_KINDS = [ | Every predicate kind, in LLD §3.2 order. |
predicateSchema | variable | predicateSchema = z.union([ | |
PredicateSubject | typealias | export type PredicateSubject = z.infer<typeof predicateSubjectSchema>; | |
predicateSubjectSchema | variable | predicateSubjectSchema = z.enum(["target", "page", "dialog", "scope", "set", "api"]) | What a predicate is asked about (LLD §3.2; set and api from Draft 2.15). |
Proposal | typealias | export type Proposal = z.infer<typeof proposalSchema>; | |
proposalSchema | variable | proposalSchema = z | A proposal written to proposals/<date>/ by the trajectory compiler (HLD §6.6, |
Provenance | typealias | export type Provenance = z.infer<typeof provenanceSchema>; | |
provenanceSchema | variable | provenanceSchema = z | Provenance of a model-produced artifact (LLD §3.5). |
PUBLISHED_SCHEMAS | variable | PUBLISHED_SCHEMAS: readonly PublishedSchema[] = [ | |
publishedSchema | function | export function publishedSchema(name: string): PublishedSchema | undefined | Look one up by base name. |
PublishedSchema | interface | export interface PublishedSchema | Every schema that is published as a JSON Schema file under |
ReadKind | typealias | export type ReadKind = z.infer<typeof readKindSchema>; | |
readKindSchema | variable | readKindSchema = z.enum(["text", "value", "attribute", "title", "url", "result"]) | |
Ref | typealias | export type Ref = z.infer<typeof refSchema>; | |
referencesSecret | function | export function referencesSecret(ref: ValueRef): boolean | True when a ValueRef reads a value marked secret; used by redaction (REQ-NFR-6). |
refSchema | variable | refSchema = z.string().min(1) | Opaque above the surface: "r12" style, stable within one snapshot (LLD §2.2). |
ScalarArg | typealias | export type ScalarArg = z.infer<typeof scalarArgSchema>; | |
scalarArgSchema | variable | scalarArgSchema = z.union([z.string(), z.number(), z.boolean()]) | A literal that a step may carry directly rather than through a ValueRef. |
SCHEMA_VERSION | variable | SCHEMA_VERSION = "1.0.0" | The version of the Yam artifact contract. |
schemaFileName | function | export function schemaFileName(name: string): string | <name>.schema.json for a registry entry. |
SchemaVersion | typealias | export type SchemaVersion = typeof SCHEMA_VERSION; | |
SessionInit | typealias | export type SessionInit = z.infer<typeof sessionInitSchema>; | |
sessionInitSchema | variable | sessionInitSchema = z | |
SessionState | typealias | export type SessionState = z.infer<typeof sessionStateSchema>; | |
sessionStateSchema | variable | sessionStateSchema = z | The restorable subset of session state (LLD §2.1). It is what a checkpoint |
Signature | typealias | export type Signature = z.infer<typeof signatureSchema>; | |
signatureSchema | variable | signatureSchema = z | |
Snapshot | typealias | export type Snapshot = z.infer<typeof snapshotSchema>; | |
SnapshotNode | typealias | export type SnapshotNode = z.infer<typeof snapshotNodeSchema>; | |
snapshotNodeSchema | variable | snapshotNodeSchema = z | |
snapshotSchema | variable | snapshotSchema = z | |
STATE_PREDICATE_KINDS | variable | STATE_PREDICATE_KINDS = [ | |
Step | typealias | export type Step = z.infer<typeof stepShape>; | |
STEP_STATUSES | variable | STEP_STATUSES = ["passed", "failed", "skipped", "healed", "aborted"] as const | aborted was added in Draft 2 for the abort policies (REQ-AUTO-4). |
StepResult | typealias | export type StepResult = z.infer<typeof stepResultSchema>; | |
stepResultSchema | variable | stepResultSchema = z | |
stepSchema | variable | stepSchema = stepShape | A compiled step. |
StepStatus | typealias | export type StepStatus = z.infer<typeof stepStatusSchema>; | |
stepStatusSchema | variable | stepStatusSchema = z.enum(STEP_STATUSES) | |
Story | typealias | export type Story = z.infer<typeof storySchema>; | |
StoryMeta | typealias | export type StoryMeta = z.infer<typeof storyMetaSchema>; | |
storyMetaSchema | variable | storyMetaSchema = z | |
storySchema | variable | storySchema = z | |
Summary | typealias | export type Summary = z.infer<typeof summarySchema>; | |
summarySchema | variable | summarySchema = z | |
SURFACE_ACTIONS | variable | SURFACE_ACTIONS: readonly SurfaceAction[] = surfaceActionSchema.options | |
SURFACE_ONLY_EXCLUSIONS | variable | SURFACE_ONLY_EXCLUSIONS = ["api", "custom", "expect"] as const | The actions an adapter implements: the IR action set minus api, custom and |
SurfaceAction | typealias | export type SurfaceAction = Exclude<Action, (typeof SURFACE_ONLY_EXCLUSIONS)[number]>; | |
surfaceActionSchema | variable | surfaceActionSchema = actionSchema.exclude(SURFACE_ONLY_EXCLUSIONS) | |
SurfaceActMessage | typealias | export type SurfaceActMessage = z.infer<typeof surfaceActMessageSchema>; | |
surfaceActMessageSchema | variable | surfaceActMessageSchema = z | surface.act.schema.json — request and response of act(). |
SurfaceCapabilitiesMessage | typealias | export type SurfaceCapabilitiesMessage = z.infer<typeof surfaceCapabilitiesMessageSchema>; | |
surfaceCapabilitiesMessageSchema | variable | surfaceCapabilitiesMessageSchema = z | surface.capabilities.schema.json — the descriptor an adapter publishes. |
SurfaceCheckMessage | typealias | export type SurfaceCheckMessage = z.infer<typeof surfaceCheckMessageSchema>; | |
surfaceCheckMessageSchema | variable | surfaceCheckMessageSchema = z | surface.check.schema.json — request and response of check(). |
SurfaceKind | typealias | export type SurfaceKind = z.infer<typeof surfaceKindSchema>; | |
surfaceKindSchema | variable | surfaceKindSchema = z.enum(["web", "mobile", "desktop", "http", "process"]) | process is a terminal (T22, SF-22). |
SurfaceLocateMessage | typealias | export type SurfaceLocateMessage = z.infer<typeof surfaceLocateMessageSchema>; | |
surfaceLocateMessageSchema | variable | surfaceLocateMessageSchema = z | surface.locate.schema.json — candidate in, references out (used by the resolver). |
SurfaceReadMessage | typealias | export type SurfaceReadMessage = z.infer<typeof surfaceReadMessageSchema>; | |
surfaceReadMessageSchema | variable | surfaceReadMessageSchema = z | surface.read.schema.json — request and response of read(). |
SurfaceSnapshotMessage | typealias | export type SurfaceSnapshotMessage = z.infer<typeof surfaceSnapshotMessageSchema>; | |
surfaceSnapshotMessageSchema | variable | surfaceSnapshotMessageSchema = z | surface.snapshot.schema.json — request and response of snapshot(). |
TargetRef | typealias | export type TargetRef = z.infer<typeof targetRefSchema>; | |
targetRefSchema | variable | targetRefSchema = z | |
TargetScope | typealias | export type TargetScope = z.infer<typeof targetScopeSchema>; | |
targetScopeSchema | variable | targetScopeSchema = z.enum(["page", "dialog", "frame", "desktop", "window"]) | desktop and window were added in Draft 2 for the OS accessibility adapters. |
TargetStatus | typealias | export type TargetStatus = z.infer<typeof targetStatusSchema>; | |
targetStatusSchema | variable | targetStatusSchema = z.enum(["bound", "unbound", "ambiguous"]) | |
Tier | typealias | export type Tier = z.infer<typeof tierSchema>; | |
tierSchema | variable | tierSchema = z.union([ | |
VALUE_PREDICATE_KINDS | variable | VALUE_PREDICATE_KINDS = [ | |
ValueRef | typealias | export type ValueRef | How a step refers to a value (LLD §3.1). |
valueRefSchema | variable | valueRefSchema: z.ZodType<ValueRef> = z.lazy(() => | |
WEB_CANDIDATE_KINDS | variable | WEB_CANDIDATE_KINDS = [ | Web candidate kinds. |
WEBMCP_CANDIDATE_KIND | variable | WEBMCP_CANDIDATE_KIND = "webmcp" as const | A tool the page declared through WebMCP; preferred over locators at replay (REQ-ADP-9). |