this repo has no description

feat: add PLC directory registration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Changed files
+27 -1
scripts
+27 -1
scripts/setup.js
··· 317 return result 318 } 319 320 // === MAIN === 321 322 async function main() { ··· 348 console.log(` Handle: ${fullHandle}`) 349 console.log('') 350 351 - // TODO: Register with plc.directory 352 // TODO: Initialize PDS 353 // TODO: Notify relay 354 }
··· 317 return result 318 } 319 320 + // === PLC DIRECTORY REGISTRATION === 321 + 322 + async function registerWithPlc(plcUrl, did, operation) { 323 + const url = `${plcUrl}/${encodeURIComponent(did)}` 324 + 325 + const response = await fetch(url, { 326 + method: 'POST', 327 + headers: { 328 + 'Content-Type': 'application/json' 329 + }, 330 + body: JSON.stringify(operation) 331 + }) 332 + 333 + if (!response.ok) { 334 + const text = await response.text() 335 + throw new Error(`PLC registration failed: ${response.status} ${text}`) 336 + } 337 + 338 + return true 339 + } 340 + 341 // === MAIN === 342 343 async function main() { ··· 369 console.log(` Handle: ${fullHandle}`) 370 console.log('') 371 372 + // Step 3: Register with PLC directory 373 + console.log(`Registering with ${opts.plcUrl}...`) 374 + await registerWithPlc(opts.plcUrl, did, operation) 375 + console.log(' Registered successfully!') 376 + console.log('') 377 + 378 // TODO: Initialize PDS 379 // TODO: Notify relay 380 }