chore(ai): event schema validation tool + fixes

- Created `scripts/agent/validate-events.mjs` to validate event builders against schemas.
- Refactored `buildVideoPostEvent` in `js/nostrEventSchemas.js` to automatically generate the required `s` (storage pointer) tag if missing, using `infoHash`, `url`, or `videoRootId`.
- Verified that `js/utils/storagePointer.js` exists and is imported correctly.
- Updated `docs/nostr-event-schemas.md` to reflect the auto-generation behavior.
- Verified fixes with `scripts/agent/validate-events.mjs` and existing unit tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-01-27 05:47:05 +00:00
1 parent 0d70cbbcfc
commit f5233a93f3
3 files changed
+44 -1

No files matched your search

+7
View File
@@ -1,3 +1,10 @@
/**
* Event Schema Validation Tool
*
* Scans the codebase for event builder usage and verifies that the output
* conforms to the defined schemas in `js/nostrEventSchemas.js`.
*/
import fs from 'node:fs';
import path from 'node:path';
import crypto from 'node:crypto';