mtok-relay 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mtok-relay.mjs +7 -0
- package/package.json +1 -1
package/dist/mtok-relay.mjs
CHANGED
|
@@ -7804,6 +7804,9 @@ function createServeCore({
|
|
|
7804
7804
|
feeRecipient,
|
|
7805
7805
|
feeBps,
|
|
7806
7806
|
screenPayer,
|
|
7807
|
+
// A retired payment domain may honor verified receipts without admitting
|
|
7808
|
+
// quotes or another inference attempt for an unrecorded payment.
|
|
7809
|
+
replayOnly = false,
|
|
7807
7810
|
// The host counts its actual sanitized provider input. Missing or failed
|
|
7808
7811
|
// accounting refuses a fresh claim; saved completions do not need recounting.
|
|
7809
7812
|
countInputTokens,
|
|
@@ -7816,6 +7819,7 @@ function createServeCore({
|
|
|
7816
7819
|
maxOutputTokens = DEFAULT_MAX_OUTPUT_TOKENS
|
|
7817
7820
|
}) {
|
|
7818
7821
|
const quote = async (request) => {
|
|
7822
|
+
if (replayOnly) return { status: 503, body: { error: "redemption_unavailable", detail: "this relay only replays saved completions" } };
|
|
7819
7823
|
const checked = validateRequest(request, model);
|
|
7820
7824
|
if (checked.error) return { status: 400, body: { error: "bad_request", detail: checked.error } };
|
|
7821
7825
|
try {
|
|
@@ -7913,6 +7917,9 @@ function createServeCore({
|
|
|
7913
7917
|
if (redemptionState === "pending") {
|
|
7914
7918
|
return { status: 409, body: { error: "draw_pending", detail: "this paid draw was already claimed; refusing to run upstream again", _bookingId: bookingId } };
|
|
7915
7919
|
}
|
|
7920
|
+
if (replayOnly) {
|
|
7921
|
+
return { status: 503, body: { error: "redemption_unavailable", detail: "this payment has no saved completion; retry this same paid draw after reconciliation", _bookingId: bookingId } };
|
|
7922
|
+
}
|
|
7916
7923
|
let currentFeeBps;
|
|
7917
7924
|
try {
|
|
7918
7925
|
currentFeeBps = typeof feeBps === "function" ? await feeBps(paid) : feeBps ?? 0;
|
package/package.json
CHANGED