npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gik-ai/evaluators

v0.1.2

Published

Shared JSONata evaluators and declarative validators for the Generative Interaction Kernel.

Readme

@gik-ai/evaluators

JSONata-based Cell evaluation and declarative validation for the Generative Interaction Kernel.

npm install @gik-ai/evaluators @gik-ai/kernel

Use this package when a host needs to evaluate Cell inputs, derive system inputs, or validate declarative values before they enter a GIK runtime.

import { evaluateCell, runDeclarativeValidators } from "@gik-ai/evaluators";

The package also owns the shared declarative form contract used by primitive:form and Blueprint contextFormSpec declarations. Use validateDeclarativeFormValues to enforce the field schema and its declarative validators, and resolveDeclarativeFormInitialValue to combine field defaults, form defaults, and caller-provided values.

Exported API

JSONata evaluation

  • evalSyncJsonata(expr, data, bindings?) evaluates one JSONata expression synchronously, returns plain JSON, and converts an undefined result to null.
  • evalAsyncJsonata(expr, data, bindings?) is the asynchronous equivalent and applies the same plain-JSON and undefined-to-null normalization.
  • validateJsonataExpression(expr, options?) validates one expression and returns { ok, error? }. options.mode accepts "full" or "safe" and defaults to "full".

Sequential step execution

  • type SyncJsonataStep = { expr: string; writeTo: string }
  • type ExecuteSyncJsonataStepsInput = { steps: readonly SyncJsonataStep[]; data: Json; bindings?: Record<string, Json>; returnKeys?: readonly string[] }
  • type ExecuteSyncJsonataStepsOutput = Record<string, Json>
  • executeSyncJsonataSteps(input) evaluates steps in declaration order against the same data value, exposes each step result to later steps under writeTo, and returns either the whole environment or only the requested returnKeys.
  • The companion schema exports are syncJsonataStepSchema, executeSyncJsonataStepsInputSchema, and executeSyncJsonataStepsOutputSchema.

Cell evaluation

  • evaluateCell(input) validates the supplied Cell, resolves only the tokens named in systemInputs, evaluates compute entries in order, and returns computed, operations, outputs, and effects.
  • validateCell(value) validates one Cell definition and reports Cell-specific errors and warnings.
  • validateTier(value) validates one standalone Tier definition.
  • validateServiceRecipe(value) validates one standalone service-axis lowering recipe (implementationPrograms + fallback).
  • validateProjectionRecipe(value) validates one standalone projection-axis lowering recipe (representations + fallback).

Declarative validators

  • runDeclarativeValidators(rawValidators, value, options?) normalizes the recognized validator entries, ignores malformed or unrecognized entries, runs recognized validators in declaration order, and returns { ok, errors, warnings }.
  • Supported validator kinds:
    • jsonata — evaluates a JSONata predicate and passes only when the result is exactly true.
    • ajv-schema — validates the value against a JSON Schema, with optional referenced schemas.
    • jsonata-expression — checks that the value is a string containing a valid JSONata expression.
    • typedef — checks whether the value matches one or more JSON value kinds.
    • blueprint-cell — validates one Blueprint Cell document.
    • blueprint-tier — validates one Blueprint Tier document.
    • blueprint-service-recipe — validates one service-axis lowering recipe document.
    • blueprint-projection-recipe — validates one projection-axis lowering recipe document.
    • blueprint — validates one Blueprint document, including its embedded Cells and both axes' recipes.

System-input helpers

  • systemInputTokens, SystemInputToken, systemInputDefinitions, SystemInputContext, and SystemInputDefinition describe the exported system-input registry. The current token is numSourcesRunning.
  • isSystemInputToken(value) checks whether a string is a supported system-input token.
  • resolveSystemInputs(tokens, context) resolves the requested token values for one Cell evaluation context.
  • systemInputRuntimeExpression(token, cellId) returns the runtime expression string for one supported token and Cell id.

Declarative form helpers

  • validateDeclarativeFormValues(fields, values, options?) validates form values against the field-derived JSON Schema and then runs any declarative validators attached to fields.
  • resolveDeclarativeFormInitialValue(spec, value?) merges field defaults, spec.initialValue, and caller-provided values in that order.

Included schemas

The package publishes its supported JSON schemas through @gik-ai/evaluators/schemas/*. Consumers may load those files directly without depending on repository-relative paths.

blueprint.schema.json requires serviceTiers, serviceRecipes, projectionTiers, and projectionRecipes and rejects the removed tiers and recipes fields. lowering-recipe.schema.json publishes strict serviceRecipe and projectionRecipe definitions; neither dialect accepts the other axis' fields.

The Blueprint schema intentionally leaves each native service declaration's config object structurally open because its fields are service-kind specific. The Blueprint owns concrete non-secret values such as endpoints and opaque credentialRef strings. ServiceKindRegistry validates that object against the registered kind's configSchema and rejects literal credential fields; the host separately authorizes endpoints and resolves referenced secrets.

Package boundary

@gik-ai/evaluators evaluates and validates declarative data. It does not own runtime state, execute effects, render UI, or choose host policy. Those responsibilities remain with @gik-ai/kernel and the embedding host.

License

MIT