@@ -300,7 +300,9 @@ const options = {
300300 git : true ,
301301 browser : 'folder' ,
302302 provisionKeys : false ,
303- bootstrap : true
303+ bootstrap : true ,
304+ nostr : false ,
305+ nostrPath : '/relay'
304306} ;
305307
306308const RUNG_1_USERNAME = 'me' ;
@@ -362,6 +364,21 @@ for (let i = 0; i < args.length; i++) {
362364 options . mcp = false ;
363365 } else if ( arg === '--no-bootstrap' ) {
364366 options . bootstrap = false ;
367+ } else if ( arg === '--nostr' ) {
368+ options . nostr = true ;
369+ } else if ( arg === '--no-nostr' ) {
370+ options . nostr = false ;
371+ } else if ( arg === '--nostr-path' ) {
372+ options . nostrPath = requireValue ( arg , args [ ++ i ] ) ;
373+ } else if ( arg === '--nostr-max-events' ) {
374+ const raw = requireValue ( arg , args [ ++ i ] ) ;
375+ const parsed = parseInt ( raw , 10 ) ;
376+ if ( ! Number . isInteger ( parsed ) || parsed < 1 || String ( parsed ) !== raw . trim ( ) ) {
377+ console . error ( chalk . red ( `✗ Invalid --nostr-max-events: ${ raw } ` ) ) ;
378+ console . error ( chalk . dim ( 'Must be a positive integer.' ) ) ;
379+ process . exit ( 1 ) ;
380+ }
381+ options . nostrMaxEvents = parsed ;
365382 } else if ( arg === '--browser' ) {
366383 const raw = requireValue ( arg , args [ ++ i ] ) ;
367384 if ( raw !== 'json' && raw !== 'folder' ) {
@@ -394,6 +411,9 @@ for (let i = 0; i < args.length; i++) {
394411 console . log ( chalk . green ( ' --browser ' ) + chalk . yellow ( '<folder|json>' ) + chalk . dim ( ' Data browser style (default: folder)' ) ) ;
395412 console . log ( chalk . green ( ' --provision-keys' ) + chalk . dim ( ' Generate a Nostr-compatible owner keypair on first start' ) ) ;
396413 console . log ( chalk . green ( ' --mcp' ) + chalk . dim ( ' Expose /mcp (Model Context Protocol) tool surface for agents' ) ) ;
414+ console . log ( chalk . green ( ' --nostr' ) + chalk . dim ( ' Run a Nostr relay (NIP-01) at <pod>/relay' ) ) ;
415+ console . log ( chalk . green ( ' --nostr-path ' ) + chalk . yellow ( '<path>' ) + chalk . dim ( ' Relay WebSocket path (default: /relay)' ) ) ;
416+ console . log ( chalk . green ( ' --nostr-max-events ' ) + chalk . yellow ( '<n>' ) + chalk . dim ( ' Max events kept in relay memory (default: 1000)' ) ) ;
397417 console . log ( chalk . green ( ' --no-bootstrap' ) + chalk . dim ( ' Skip auto-install of the `default` app bundle on first run' ) ) ;
398418 console . log ( chalk . green ( ' -v, --version' ) + chalk . dim ( ' Show jspod version' ) ) ;
399419 console . log ( chalk . green ( ' --help' ) + chalk . dim ( ' Show this help message\n' ) ) ;
@@ -406,6 +426,7 @@ for (let i = 0; i < args.length; i++) {
406426 console . log ( chalk . dim ( ' • WebID authentication' ) ) ;
407427 console . log ( chalk . dim ( ' • Passkey support' ) ) ;
408428 console . log ( chalk . dim ( ' • WebSocket notifications' ) ) ;
429+ console . log ( chalk . dim ( ' • Nostr relay (NIP-01, opt-in via --nostr)' ) ) ;
409430 console . log ( chalk . dim ( ' • JSON-LD native\n' ) ) ;
410431 console . log ( chalk . white ( 'Resources:' ) ) ;
411432 console . log ( chalk . blue ( ' https://github.com/JavaScriptSolidServer/jspod' ) ) ;
@@ -442,7 +463,10 @@ console.log(chalk.cyan(' ├─ ') + chalk.white('URL: ') + chalk.bold.g
442463console . log ( chalk . cyan ( ' ├─ ' ) + chalk . white ( 'Port: ' ) + chalk . yellow ( options . port ) ) ;
443464console . log ( chalk . cyan ( ' ├─ ' ) + chalk . white ( 'Host: ' ) + chalk . yellow ( options . host ) ) ;
444465console . log ( chalk . cyan ( ' ├─ ' ) + chalk . white ( 'Pod Root: ' ) + chalk . yellow ( options . root ) ) ;
445- console . log ( chalk . cyan ( ' └─ ' ) + chalk . white ( 'Mode: ' ) + ( options . multiuser ? chalk . yellow ( 'Multi-user' ) : chalk . yellow ( 'Single-user' ) ) ) ;
466+ console . log ( chalk . cyan ( options . nostr ? ' ├─ ' : ' └─ ' ) + chalk . white ( 'Mode: ' ) + ( options . multiuser ? chalk . yellow ( 'Multi-user' ) : chalk . yellow ( 'Single-user' ) ) ) ;
467+ if ( options . nostr ) {
468+ console . log ( chalk . cyan ( ' └─ ' ) + chalk . white ( 'Relay: ' ) + chalk . bold . green ( `enabled (${ options . nostrPath } )` ) ) ;
469+ }
446470
447471if ( options . auth && ! options . multiuser ) {
448472 const rungLabel = RUNG_1_PASSWORD_FROM_ENV
0 commit comments