Commit graph

7 commits

Author SHA1 Message Date
SkateSpots
2e4930af2c fix(cvm-server): add WebSocket polyfill from ws for non-Bun runtimes 2026-09-26 15:24:09 +07:00
shakespeare.diy
0b83749aa1 cvm-server: only serve signature-verified events to agents (audit F2)
queryNostr() previously returned every event the community data relays
sent back, unverified. A malicious or buggy relay could inject forged
coach profiles / listings that would flow straight into agents as
trusted ground truth. Now each event is signature-verified with
nostr-tools verifyEvent() before being returned; anything that fails
(or throws) is dropped. Mirrors the client-side onlyVerified discipline
already applied in the trust-score hooks.

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-09-24 19:36:24 +07:00
shakespeare.diy
d844e151bd Fix CVM relay URL: relay.contextvm.net → relay.contextvm.org
Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-06-18 11:13:51 +07:00
shakespeare.diy
c772330e74 fix: remove debug logging from queryNostr, keep clean production server
Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-06-17 12:02:09 +07:00
shakespeare.diy
4c263e729a fix: replace subscribeMany with querySync for nostr-tools v2 compatibility
The server was using the nostr-tools v1 API (subscribeMany with onevent/oneose
callbacks) but the installed version is v2.23.5 which changed the internal
subscription handling. querySync() is the correct v2 API for one-shot queries
and handles EOSE cleanly without needing manual timeout management.

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-06-17 11:43:51 +07:00
shakespeare.diy
84aa009b33 fix: CVM server tag mapping + add city/country geocoding to spots
CVM server fixes (cvm-server/server.ts):
- Use 'title' tag instead of 'name' to read spot names (app publishes 'title')
- Search now checks 'title' tag (not just 'name') for keyword matches
- City filter now also checks 'title' tag and event content
- Country filter also checks event content
- Features filter now checks 't' tags (app uses 't' not 'feature')
- Validate spots with 't: skatespot' tag (same rule as the app)
- Return 'location' field and proper features list in results
- Image parsing now supports both 'image' (legacy) and 'imeta' (NIP-92)

CreateSpotPage fix (src/pages/CreateSpotPage.tsx):
- Add reverse geocoding via Nominatim on spot submit
- Emit structured 'city' and 'country' tags so CVM can filter by them
- Auto-fill location field from geocoding if user left it blank

SasquatchGuide improvement (src/components/SasquatchGuide.tsx):
- Add data model notes to system prompt explaining tag structure
- Instruct AI to handle 0-result responses gracefully (encourage adding spots)
- Use limit:20+ for city/country searches

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-06-17 11:14:50 +07:00
shakespeare.diy
2db0c6f7e2 feat: add SkateSpots CVM server — MCP tools over Nostr
Adds cvm-server/ directory with complete ContextVM server implementation:

- server.ts: Full MCP server with 5 tools (find_spots, find_events,
  find_coaches, find_gear, get_community_stats) using @contextvm/sdk
- bootstrap.sh: One-command VPS setup script (Bun, PM2, firewall, keygen)
- skatespots-cvm.service: systemd unit for production deployment
- .env.example: Environment variable template
- DEPLOY.md: Step-by-step deploy guide for LNVPS VPS
- package.cvm.json: Dependencies manifest

The server aggregates data from goskatespots.nostr1.com and other relays,
deduplicates addressable events, and exposes structured JSON tools that
AI agents can discover and call via the ContextVM/Nostr protocol (CEP-6).

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-06-16 17:45:04 +07:00