Token Mint
Path:
loom-sprint-scaffold/loom/src/orchestrator/core/token-mint.tsRelative: loom/src/orchestrator/core/token-mint.tsSubproject: loom-sprint-scaffoldCategory: otherLines: 208Bytes: 6,815Imports: 6Exports: 2
Content Preview
- /**
- * H1.5 — HMAC single-use, stage-scoped, TTL'd approval tokens for destructive
- * actions. WebCrypto only.
- *
- * Token format compatibility with Loop 3's verifier:
- * - Loop 3 checks `tool\u0000${canonicalJSON(args)}` HMAC
- * - Mint signs the SAME message format, with structured metadata
- * (goal_id, stage_id, expires_at, nonce) embedded in args
- *
- * Single-use enforcement via consumed-nonce set in storage.
- */
- import { createLogger } from "../../lib/logger";
- import { importHmacKey