Repository navigation
feat: Schema contracts and history - #5
Merged
Merged
Conversation
…isible horizon
A `horizon` message is a history boundary: for a generator that can see it,
projection renders history from the frame carrying it (messages before it
in that frame drop; the horizon itself stays so history projections see
the cut). It inherits audience semantics like any message (default
broadcast; a targeted horizon cuts only its targets). The fold, work
scheduling, and absorption ignore horizons — history is what the model
sees, work is durable state. Core has no opinion about what follows a
horizon; an app that wants a summary puts it in the same frame or the next.
visibleFramesForGenerator gains { horizon: "apply" | "ignore" }: projection
applies, absorption ignores.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…form Every schema position in @projectors/core (StateDescriptor.schema, Action.inputSchema, OutputConfig.schema, executor configSchema, charter and node params, dataContent) now accepts any StandardSchemaV1 instead of a z.ZodType. New src/schema.ts normalizes a schema once (memoized per object) into a NormalizedSchema with synchronous validate/parse/accepts and a jsonSchema() converter sourced from ~standard.jsonSchema (StandardJSONSchemaV1, which zod 4 implements), falling back to z.toJSONSchema for vendor "zod", or an explicit document attached via withJsonSchema(). Async validators and schemas with no JSON Schema source are rejected at creation. Type inference uses StandardSchemaV1.InferOutput/InferInput, so createState and createAction infer the same types for zod schemas as before, and no zod type appears in the public surface. zod stays a private dependency (hydration of serialized JSON Schema via z.fromJSONSchema) and is no longer a peer dependency consumers must pin. Params compatibility checks now read the schema's input JSON Schema (properties/required) instead of zod's .shape. Executors build AI SDK / LiveKit tools from the normalized JSON Schema and validate through the normalized schema; the cascade executor validates tool input itself since LiveKit no longer receives a zod object. Validation failures surface as SchemaError with "<message> (at path)" text. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
WorkCompletionMessage.lastResult is a MessageRef to the last result-bearing message the completing step produced — an action result (terminal actions included) or an assistant message — so hosts need not scan frames for an activation's outcome. Absent when the step produced neither. Apps with another convention read the frames themselves; core takes no position on what an activation "returns". Also: ExecuteActionResult.error stays a human-readable string; structured issues may be added alongside later. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ExecuteActionResult and the durable ActionResultMessage carry the schema's issues verbatim on input validation failure; the error string is their rendering (formatSchemaIssues). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.