chore(ai): event schema validation tool + fixes

- Added `scripts/agent/validate-events.mjs` to validate event builders against schemas.
- Fixed `NOTE_TYPES.REPOST` schema content format (json instead of empty).
- Added `NOTE_TYPES.MUTE_LIST` and `buildMuteListEvent`.
- Added `buildProfileMetadataEvent` to standardise Kind 0 creation.
- Updated `js/ui/profileModalController.js` to use `buildProfileMetadataEvent`.
- Updated `js/userBlocks.js` to use `buildMuteListEvent` for publishing mute list snapshots.
- Updated `docs/nostr-event-schemas.md` with new schemas and builders.
This commit is contained in:
google-labs-jules[bot] committed 2026-01-19 05:47:37 +00:00
1 parent 474071e84a
commit 4d2bb8bf3d
5 files changed
+406 -26

No files matched your search

+5 -7
View File
@@ -22,6 +22,7 @@ import {
} from "../utils/hashtagNormalization.js";
import { getActiveSigner } from "../nostr/client.js";
import { buildPublicUrl, buildR2Key } from "../r2.js";
import { buildProfileMetadataEvent } from "../nostrEventSchemas.js";
const noop = () => {};
@@ -6376,14 +6377,11 @@ export class ProfileModalController {
}
try {
const content = JSON.stringify(profile);
const event = {
kind: 0,
created_at: Math.floor(Date.now() / 1000),
const event = buildProfileMetadataEvent({
pubkey,
tags: [],
content,
};
created_at: Math.floor(Date.now() / 1000),
metadata: profile,
});
const result =
await this.services.nostrClient.signAndPublishEvent(event);