UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

29 lines (28 loc) • 1.63 kB
/** * design/159 S1 — the contract kit's version-lockstep constant (a downstream consumer requirement). * * The store-contract kit ships INSIDE `@sema-agent/core` and evolves in lockstep with the engine — * an assertion added because an engine release changed a store's semantics is only meaningful * against THAT engine generation. Because kit and engine are one package, lockstep holds by * construction and no entry point asserts a host version; this constant exists so an EXTERNAL * consumer can make the pairing loud instead of silent: * * ```ts * import { CONTRACT_KIT_ENGINE_VERSION } from "@sema-agent/core/…"; * if (CONTRACT_KIT_ENGINE_VERSION !== myPinnedEngineVersion) { * throw new Error(`contract kit ${CONTRACT_KIT_ENGINE_VERSION} != engine ${myPinnedEngineVersion}`); * } * ``` * * A third party running an old kit against a new engine (or the reverse) would otherwise get a * silent false-green — e.g. a pre-2.2.0 kit has no idempotent-reopen entry, so a * wiping SessionRepo passes it. Compare this constant against the `@sema-agent/core` version you * actually resolved (read the installed package.json — the lock file can pin something older than * what your manifest says). * * Same source as `package.json` `version`: resolved at runtime via {@link engineVersion} (the * package's own package.json, memoized, "unknown" only under an exotic bundler that severed the * module from its package root). A test pins it equal to the repo's package.json so the relative * walk can never drift from the published value. */ export declare const CONTRACT_KIT_ENGINE_VERSION: string;