From 5790b6e7c1edcfde14dba4e29f8f148812ea67b0 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 25 Jan 2026 05:29:32 +0000 Subject: [PATCH] chore(ai): event schema validation tool + fixes - Created `scripts/agent/validate-events.mjs` to validate all event builders. - Fixed `buildViewEvent` to generate a fallback `d` tag for kind 30079 compliance. - Relaxed `REPOST` schema validation to allow empty content (blind reposts), per NIP-18. - Updated `docs/nostr-event-schemas.md` to reflect schema changes. --- docs/nostr-event-schemas.md | 2 +- js/nostrEventSchemas.js | 15 +- scripts/agent/validate-events.mjs | 634 +++++++++++++++--------------- 3 files changed, 331 insertions(+), 320 deletions(-) diff --git a/docs/nostr-event-schemas.md b/docs/nostr-event-schemas.md index 81535215..9b9b20c4 100644 --- a/docs/nostr-event-schemas.md +++ b/docs/nostr-event-schemas.md @@ -147,7 +147,7 @@ import { updateWatchHistoryListWithDefaultClient } from "./nostrWatchHistoryFaca | --- | --- | --- | --- | | Video post (`NOTE_TYPES.VIDEO_POST`) | `30078` | `['t','video']`, `['d', ]` plus optional schema append tags | JSON payload using Content Schema v3 (`version`, `title`, optional `url`, `magnet`, `thumbnail`, `description`, `mode`, `videoRootId`, `deleted`, `isPrivate`, `isNsfw`, `isForKids`, `enableComments`, `ws`, `xs`) | | NIP-94 mirror (`NOTE_TYPES.VIDEO_MIRROR`) | `1063` | Tags forwarded from `publishVideo` (URL, mime type, thumbnail, alt text, magnet) | Plain text alt description | -| Repost (`NOTE_TYPES.REPOST`) | `6` | `['e', , ]` with optional address pointer `['a', , ]`, and `['p', ]` when the origin author is known; inherits schema append tags | JSON-serialized event being reposted | +| Repost (`NOTE_TYPES.REPOST`) | `6` | `['e', , ]` with optional address pointer `['a', , ]`, and `['p', ]` when the origin author is known; inherits schema append tags | JSON-serialized event being reposted (or empty if unavailable) | | Share note (`NOTE_TYPES.SHARE`) | `1` | `['e',