feat(schedule): add durable after reminders

This commit is contained in:
pku-xht
2026-08-06 03:47:37 +08:00
committed by Tianyi Cui
parent f7e7851e3f
commit 8b69252664
41 changed files with 354 additions and 146 deletions
+3 -5
View File
@@ -33,14 +33,12 @@ export type ToolEventView =
| { for: 'result'; view: ToolResultView }
/**
* Host-computed presentation for one non-surface Session event. The domain
* owns the presentation key and JSON-compatible view shape; the carrier keeps
* both generic so an opt-in client plugin can render the event without adding
* domain vocabulary to the connection package.
* Host-computed presentation for one non-surface Session event. The durable
* event type selects an optional client renderer; the sidecar carries only the
* JSON-compatible view so the connection package adds no domain vocabulary.
*/
export interface PresentedEventView {
for: 'event'
presentationKey: string
view: unknown
}
@@ -193,10 +193,9 @@ export const toolEventViewSchema = z.discriminatedUnion('for', [
z.object({ for: z.literal('result'), view: z.looseObject({ card: z.string() }) }),
]) as unknown as z.ZodType<ToolEventView>
/** Domain-owned presented-event sidecar with a carrier-validated key and present payload. */
/** Domain-owned presented-event sidecar whose durable event supplies the renderer key. */
const presentedEventViewSchema = z.object({
for: z.literal('event'),
presentationKey: z.string().min(1),
view: z.unknown(),
}).refine(value => Object.hasOwn(value, 'view'), {
message: 'presented event view payload is required',