-
Notifications
You must be signed in to change notification settings - Fork 0
feat(events): define v1 semantic route descriptors #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "agent-bundle": minor | ||
| "@agent-bundle/runtime": minor | ||
| --- | ||
|
|
||
| Add the seven v1 semantic event-route descriptors and the `Agent.Context` | ||
| document vocabulary used for immediate host guidance. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,10 +31,16 @@ export const generateRouteTypes = (graph: CompiledRouteGraph): string => { | |
| ' input: SchemaOutput<InputSchema>;', | ||
| ' result: SchemaOutput<ResultSchema>;', | ||
| '}>;', | ||
| 'export type EventRouteContract<Component, Event extends string> = Readonly<{', | ||
| ' component: Component;', | ||
| ' event: Event;', | ||
| '}>;', | ||
| '', | ||
| 'export interface AgentBundleRoutes {', | ||
| ...routes.map((route, index) => | ||
| ` ${JSON.stringify(route.id)}: RouteContract<typeof route${String(index)}.inputSchema, typeof route${String(index)}.resultSchema>;`), | ||
| route.kind === 'event-route' | ||
| ? ` ${JSON.stringify(route.id)}: EventRouteContract<typeof route${String(index)}.default, ${JSON.stringify(route.event)}>;` | ||
|
Comment on lines
+41
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a graph contains any newly admitted event route, this branch adds an Useful? React with 👍 / 👎.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in #198 (merged as d992838). The generated declarations now route |
||
| : ` ${JSON.stringify(route.id)}: RouteContract<typeof route${String(index)}.inputSchema, typeof route${String(index)}.resultSchema>;`), | ||
| '}', | ||
| '', | ||
| 'export type RouteId = keyof AgentBundleRoutes;', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consumers authoring against this new public contract cannot exercise their event routes through
agent-bundle/test:componentPropsinsrc/test/render.tsstill passes{ event, payload, signal }forevent-route, rather than{ canonical, native, signal }, and its event value is the prefixed route ID such asevent:tool/after. Consequently, routes that destructure the newly documentedcanonicalornativeprops receiveundefinedand may fail during route-unit rendering; the harness needs to construct the same canonical/native envelope promised here.Useful? React with 👍 / 👎.