feat(core): add RenderedFeedItem type with JRX UI support

Add RenderedFeedItem that extends FeedItem with a ui: JrxNode field
for client-side rendering. Add @nym.sh/jrx and @json-render/core as
peer dependencies on @aelis/core.

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2026-03-11 23:29:50 +00:00
parent 805e4f2bc6
commit 21b653b029
5 changed files with 33 additions and 4 deletions

View File

@@ -7,6 +7,10 @@
"scripts": {
"test": "bun test ."
},
"peerDependencies": {
"@nym.sh/jrx": "*",
"@json-render/core": "*"
},
"dependencies": {
"@standard-schema/spec": "^1.1.0"
}

View File

@@ -1,3 +1,5 @@
import type { JrxNode } from "@nym.sh/jrx"
/**
* Source-provided hints for post-processors.
*
@@ -76,3 +78,12 @@ export interface FeedItem<
/** Named slots for LLM-fillable content. Keys are slot names. */
slots?: Record<string, Slot>
}
/** A FeedItem with a JRX UI tree attached for client-side rendering. */
export interface RenderedFeedItem<
TType extends string = string,
TData extends Record<string, unknown> = Record<string, unknown>,
> extends FeedItem<TType, TData> {
/** JRX node tree describing how to render this item */
ui: JrxNode
}

View File

@@ -7,7 +7,7 @@ export type { ActionDefinition } from "./action"
export { UnknownActionError } from "./action"
// Feed
export type { FeedItem, FeedItemSignals, Slot } from "./feed"
export type { FeedItem, FeedItemSignals, RenderedFeedItem, Slot } from "./feed"
export { TimeRelevance } from "./feed"
// Feed Source