owner_app/verify-packet.cjs

Read-only source from the unchanged 0.3.4 kit. Existing license terms apply.

// Independent command-line check using the same verifier as the owner console.
const fs = require("node:fs");
const AILCrypto = require("./ail-crypto.js");
(async () => {
  if (process.argv.length !== 3) throw new Error("Usage: node verify-packet.cjs PACKET.json");
  const packet = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
  const result = await AILCrypto.verifyIdentityPacket(packet);
  process.stdout.write(JSON.stringify(result, null, 2) + "\n");
  if (!result.valid) process.exitCode = 1;
})().catch(error => { process.stderr.write(error.message + "\n"); process.exitCode = 1; });