// Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
// ══════════════════════════════════════════════════════════════════
// Cycles — reserve/commit/release budget-authority rail
// ══════════════════════════════════════════════════════════════════
// Cycles (https://runcycles.io) is a pre-execution budget and action-
// authority protocol with a four-event lifecycle on the runtime plane:
//
//   decide  → stateless pre-check        (POST /v1/decide)
//   reserve → atomic authorization       (POST /v1/reservations)
//   commit  → settle at actual           (POST /v1/reservations/{id}/commit)
//   release → clear without debit        (POST /v1/reservations/{id}/release)
//
// Plus error responses (4xx/5xx) on any of the above.
//
// This adapter binds APS V2 governance to Cycles at the
// reserve / commit / release boundary, with the two-receipt emission
// model agreed in aeoess/agent-passport-system#25:
//
//   - Permit-receipt at reserve     (rail.budget_reservation.permit.v1)
//   - Release-receipt at release    (rail.budget_reservation.release.v1)
//   - Denial-receipt on live 4xx    (rail.budget_reservation.denial.v1)
//   - Denial-receipt on dry-run DENY or /v1/decide DENY (same literal)
//
// Signed denials carry an APS Tier-1 `denial_reason` (closed enum) plus
// the richer Cycles-specific detail Tier-2 in `cycles.denial_detail`.
// The full mapping spec lives at runcycles/cycles-protocol drafts/
// cycles-aps-denial-mapping-v0.1.md (merged commit 9b0fb5e).
//
// CyclesEvidence — the signed, content-addressed envelope wrapping the
// canonical Cycles wire body — is specified at runcycles/cycles-protocol
// drafts/cycles-evidence-v0.1.yaml (merged commit 61186a2). APS receipts
// reference it via the minimal `CyclesEvidenceRef` join shape below.
//
// SDK scope: type model + denial mapping + signed two-receipt emission.
// Out of scope (gateway product): live HTTP intercept, CyclesEvidence
// envelope construction (the Cycles server emits those), reservation
// lifecycle orchestration, multi-tenant routing.
// ══════════════════════════════════════════════════════════════════
/** Cycles protocol pin. Bump when the upstream protocol revision changes. */
export const CYCLES_PROTOCOL_VERSION = 'cycles-protocol-v0.1.25';
/** CyclesEvidence schema version this adapter consumes. */
export const CYCLES_EVIDENCE_SCHEMA_VERSION = 'cycles-evidence/v0.1';
// ── APS claim_type literals (rail.budget_reservation.*) ───────────
// These match the literals added to the payment-rails verifier in
// aeoess/agent-passport-system#27 (merged commit 4abd9df). The
// receipt-side literals (permit, release) ride the receipt-verify
// path; the denial literal rides the denial-verify path.
export const RAIL_BUDGET_RESERVATION_PERMIT_CLAIM_TYPE = 'rail.budget_reservation.permit.v1';
export const RAIL_BUDGET_RESERVATION_RELEASE_CLAIM_TYPE = 'rail.budget_reservation.release.v1';
export const RAIL_BUDGET_RESERVATION_DENIAL_CLAIM_TYPE = 'rail.budget_reservation.denial.v1';
//# sourceMappingURL=types.js.map