@dvmkit/sdk 0.3.0-rc.9 → 0.3.2-rc.10

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.
Files changed (49) hide show
  1. package/dist/{chunk-MD3H3BF7.js → chunk-2A33VHYM.js} +1 -1
  2. package/dist/{chunk-AJNFXR7J.js → chunk-3KYLYVY4.js} +4 -1
  3. package/dist/{chunk-YO56VCTQ.js → chunk-BWGRKGKG.js} +190 -75
  4. package/dist/{chunk-MMCE7XSR.js → chunk-C2AGARLM.js} +1 -13
  5. package/dist/chunk-D42FMCLJ.js +1423 -0
  6. package/dist/{chunk-QX52F6IB.js → chunk-DSVGYW3B.js} +7 -4
  7. package/dist/{chunk-LTAIBLS2.js → chunk-HNIKSOI2.js} +524 -408
  8. package/dist/{chunk-4A2RAKCW.js → chunk-IBDDIG4K.js} +7 -3
  9. package/dist/{chunk-D7YQYLLM.js → chunk-J7PW2U6P.js} +1 -1
  10. package/dist/{chunk-FDKRXOZO.js → chunk-KL4C3LQV.js} +57 -49
  11. package/dist/{chunk-VA7GT6C6.js → chunk-LHN75BTX.js} +56 -53
  12. package/dist/{chunk-C3MTFLC6.js → chunk-M4RSKQAV.js} +14 -12
  13. package/dist/{chunk-U5VNEALI.js → chunk-PPHE7XUU.js} +1 -1
  14. package/dist/{chunk-GAIPXGM3.js → chunk-SP42AI5T.js} +1 -1
  15. package/dist/{chunk-N5B66UOS.js → chunk-U2EYIPFX.js} +4 -1
  16. package/dist/{chunk-H2MEFVH6.js → chunk-UQCK5VMA.js} +7 -4
  17. package/dist/{chunk-XMDQOXHO.js → chunk-Y7JZLO5J.js} +4 -1
  18. package/dist/{chunk-HHTL3ZFT.js → chunk-YEO5GW7U.js} +16 -13
  19. package/dist/{chunk-O6D72KYA.js → chunk-YRDA7EWN.js} +1 -1
  20. package/dist/{chunk-VIVXB4CD.js → chunk-YYQG4R7T.js} +1 -1
  21. package/dist/{chunk-FPOLJRBF.js → chunk-Z3EHBW2G.js} +2 -2
  22. package/dist/{chunk-2D75MNNG.js → chunk-ZHTUITDW.js} +8 -5
  23. package/dist/{chunk-XZ7LW4S5.js → chunk-ZUTI56L7.js} +20 -16
  24. package/dist/{credit-ledger-MHA652TV.js → credit-ledger-4CCHRJE2.js} +3 -2
  25. package/dist/{credit-menu-BlCL7gZx.d.ts → credit-menu-0-UtJ3hh.d.ts} +5 -1
  26. package/dist/index.js +4 -3
  27. package/dist/internal/caller.d.ts +38 -3
  28. package/dist/internal/caller.js +59 -19
  29. package/dist/internal/index.js +1 -1
  30. package/dist/internal/server.d.ts +2 -2
  31. package/dist/internal/server.js +16 -15
  32. package/dist/memory-credit-ledger-TERNM5T6.js +10 -0
  33. package/dist/{mpp-setup-MPP3ST5X.js → mpp-setup-OQ4OV7A5.js} +2 -1
  34. package/dist/{payout-reporter-KEMUXEUO.js → payout-reporter-TQ3YIFLZ.js} +2 -1
  35. package/dist/{postgres-consumed-credential-store-6N2V5MJN.js → postgres-consumed-credential-store-LFQNC7LD.js} +4 -1
  36. package/dist/{postgres-job-store-VE2JRUEC.js → postgres-job-store-FGOJ7UIX.js} +2 -1
  37. package/dist/{postgres-replay-store-ZF4JNZOW.js → postgres-replay-store-DFQSXPCG.js} +2 -1
  38. package/dist/{pricing-MU5GNUJZ.js → pricing-UJAPJLOM.js} +2 -1
  39. package/dist/{revenue-reporter-O75BGYFK.js → revenue-reporter-VN4WYN74.js} +2 -1
  40. package/dist/server/index.d.ts +3 -3
  41. package/dist/server/index.js +112 -112
  42. package/dist/{tempo-charge-store-SDTUNTKA.js → tempo-charge-store-EA66LSVJ.js} +2 -1
  43. package/dist/{tempo-lifecycle-G5SB4HFC.js → tempo-lifecycle-TJ62A7UX.js} +3 -3
  44. package/dist/{tempo-session-store-WF3VZXNF.js → tempo-session-store-65NA77KJ.js} +3 -2
  45. package/dist/{tempo-wallet-ZFNUDFVO.js → tempo-wallet-RCGBBAJH.js} +1 -1
  46. package/dist/testing/index.js +4 -3
  47. package/dist/{x402-CI6PSHNO.js → x402-S47Q77UE.js} +2 -2
  48. package/package.json +2 -2
  49. package/dist/memory-credit-ledger-BYBATRN3.js +0 -9
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  withSdkInitLock
3
3
  } from "./chunk-COYKJRMM.js";
4
+ import {
5
+ diagnosticConsole
6
+ } from "./chunk-D42FMCLJ.js";
4
7
 
5
8
  // src/sdk/server/postgres-job-store.ts
6
9
  import { createHash } from "crypto";
@@ -594,12 +597,12 @@ var PostgresJobStore = class {
594
597
  ]
595
598
  );
596
599
  if (rowCount === 0) {
597
- console.warn(
598
- JSON.stringify({
600
+ diagnosticConsole.warn(
601
+ {
599
602
  level: "job_save_rejected_terminal",
600
603
  jobId: record.id,
601
604
  attemptedStatus: record.status
602
- })
605
+ }
603
606
  );
604
607
  return;
605
608
  }
@@ -1150,21 +1153,21 @@ var PostgresJobStore = class {
1150
1153
  onNotification: (payload) => {
1151
1154
  this.dispatch(payload);
1152
1155
  },
1153
- onLost: (err) => {
1154
- console.warn(
1155
- JSON.stringify({
1156
+ onLost: (_err) => {
1157
+ diagnosticConsole.warn(
1158
+ {
1156
1159
  level: "job_messages_listen_lost",
1157
- error: err ? err.message : "client closed"
1158
- })
1160
+ error: void 0
1161
+ }
1159
1162
  );
1160
1163
  },
1161
- onReconnectFailed: (attempt, err) => {
1162
- console.warn(
1163
- JSON.stringify({
1164
+ onReconnectFailed: (attempt, _err) => {
1165
+ diagnosticConsole.warn(
1166
+ {
1164
1167
  level: "job_messages_listen_connect_failed",
1165
1168
  attempt,
1166
- error: err instanceof Error ? err.message : String(err)
1167
- })
1169
+ error: void 0
1170
+ }
1168
1171
  );
1169
1172
  }
1170
1173
  });
@@ -4,7 +4,7 @@ import {
4
4
  listCredits,
5
5
  maxAdvertisedMicro,
6
6
  withinAdvertisedTolerance
7
- } from "./chunk-MMCE7XSR.js";
7
+ } from "./chunk-C2AGARLM.js";
8
8
  import {
9
9
  authorizeProtectedRemoval,
10
10
  isValidEvmPrivateKey,
@@ -101,7 +101,7 @@ async function generateTempoKey(opts = {}) {
101
101
  );
102
102
  }
103
103
  if (existing && opts.force) {
104
- const { assertTempoWalletIdle } = await import("./tempo-lifecycle-G5SB4HFC.js");
104
+ const { assertTempoWalletIdle } = await import("./tempo-lifecycle-TJ62A7UX.js");
105
105
  await assertTempoWalletIdle("replace");
106
106
  }
107
107
  const { privateKeyToAccount, generatePrivateKey } = await import("viem/accounts");
@@ -2,14 +2,14 @@ import {
2
2
  connectedTempoAccount,
3
3
  tempoBalanceCheckHint,
4
4
  tempoTokenReference
5
- } from "./chunk-VIVXB4CD.js";
5
+ } from "./chunk-YYQG4R7T.js";
6
6
  import {
7
7
  fundingReachableAt,
8
8
  listCredits,
9
9
  maxAdvertisedMicro,
10
10
  normalizeCreditEndpoint,
11
11
  withinAdvertisedTolerance
12
- } from "./chunk-MMCE7XSR.js";
12
+ } from "./chunk-C2AGARLM.js";
13
13
  import {
14
14
  costAnchor,
15
15
  formatUsd,
@@ -3,7 +3,10 @@ import {
3
3
  } from "./chunk-COYKJRMM.js";
4
4
  import {
5
5
  applyRetryToPool
6
- } from "./chunk-C3MTFLC6.js";
6
+ } from "./chunk-M4RSKQAV.js";
7
+ import {
8
+ diagnosticConsole
9
+ } from "./chunk-D42FMCLJ.js";
7
10
 
8
11
  // src/sdk/server/credit-ledger.ts
9
12
  import { randomUUID } from "crypto";
@@ -1323,15 +1326,15 @@ var CreditLedger = class {
1323
1326
  const uncovered = Number(rows[0]?.uncovered ?? 0);
1324
1327
  const unbacked = Number(rows[0]?.unbacked ?? 0);
1325
1328
  if (rowCount === 0 && uncovered === 0 && unbacked === 0) return;
1326
- console.warn(
1327
- JSON.stringify({
1329
+ diagnosticConsole.warn(
1330
+ {
1328
1331
  level: uncovered > 0 ? "warn" : "info",
1329
1332
  event: "credit_funding_lot_backfill",
1330
1333
  backfilled: rowCount ?? 0,
1331
1334
  uncovered_credits: uncovered,
1332
1335
  unbacked_credits: unbacked,
1333
- message: uncovered > 0 ? "Some open Bitcoin credits hold more balance than their funding lots cover. Those reclaims are priced off a live rate rather than in kind until the gap is repaired." : "Funding lots are in place for every open Bitcoin credit."
1334
- })
1336
+ message: void 0
1337
+ }
1335
1338
  );
1336
1339
  }
1337
1340
  /**
@@ -1,3 +1,7 @@
1
+ import {
2
+ diagnosticConsole
3
+ } from "./chunk-D42FMCLJ.js";
4
+
1
5
  // src/sdk/server/mpp-setup.ts
2
6
  import { randomUUID } from "crypto";
3
7
  import { Errors as MppxErrors, PaymentRequest } from "mppx";
@@ -117,8 +121,8 @@ var TempoSettlementReadiness = class {
117
121
  ...failure.creditId ? { creditId: failure.creditId } : {},
118
122
  ...failure.drainId ? { drainId: failure.drainId } : {}
119
123
  };
120
- console.warn(
121
- JSON.stringify({
124
+ diagnosticConsole.warn(
125
+ {
122
126
  level: "warn",
123
127
  event: "tempo_settlement_insufficient_funds",
124
128
  address: observation.address,
@@ -129,7 +133,7 @@ var TempoSettlementReadiness = class {
129
133
  ...observation.channelId ? { channel_id: observation.channelId } : {},
130
134
  ...observation.creditId ? { credit_id: observation.creditId } : {},
131
135
  ...observation.drainId ? { drain_id: observation.drainId } : {}
132
- })
136
+ }
133
137
  );
134
138
  await this.notify((listener) => listener.onFailure?.(observation));
135
139
  if (sharedLatchWritten && this.failureBalanceMicro === void 0) {
@@ -259,8 +263,8 @@ var TempoSettlementReadiness = class {
259
263
  checkedAt: this.now(),
260
264
  ready: this.available()
261
265
  };
262
- console.info(
263
- JSON.stringify({
266
+ diagnosticConsole.info(
267
+ {
264
268
  level: "info",
265
269
  event: "tempo_settlement_fee_balance",
266
270
  address: observation.address,
@@ -269,7 +273,7 @@ var TempoSettlementReadiness = class {
269
273
  balance_micro: observation.balanceMicro.toString(),
270
274
  low_balance_micro: observation.lowBalanceMicro.toString(),
271
275
  ready: observation.ready
272
- })
276
+ }
273
277
  );
274
278
  await this.notify((listener) => listener.onBalance?.(observation));
275
279
  return observation;
@@ -286,22 +290,22 @@ function isTempoInsufficientFundsError(error) {
286
290
  if (error instanceof InsufficientFundsError) return true;
287
291
  return error instanceof BaseError && error.walk((cause) => cause instanceof InsufficientFundsError) !== null;
288
292
  }
289
- function logBalanceFailure(error) {
290
- console.warn(
291
- JSON.stringify({
293
+ function logBalanceFailure(_error) {
294
+ diagnosticConsole.warn(
295
+ {
292
296
  level: "warn",
293
297
  event: "tempo_settlement_fee_balance_failed",
294
- error_name: error instanceof Error ? error.name : "unknown"
295
- })
298
+ error_name: void 0
299
+ }
296
300
  );
297
301
  }
298
- function logStateFailure(error) {
299
- console.warn(
300
- JSON.stringify({
302
+ function logStateFailure(_error) {
303
+ diagnosticConsole.warn(
304
+ {
301
305
  level: "warn",
302
306
  event: "tempo_settlement_readiness_state_failed",
303
- error_name: error instanceof Error ? error.name : "unknown"
304
- })
307
+ error_name: void 0
308
+ }
305
309
  );
306
310
  }
307
311
 
@@ -10,9 +10,10 @@ import {
10
10
  isDrainMethod,
11
11
  isFundingRail,
12
12
  x402SettlementPending
13
- } from "./chunk-2D75MNNG.js";
13
+ } from "./chunk-ZHTUITDW.js";
14
14
  import "./chunk-COYKJRMM.js";
15
- import "./chunk-C3MTFLC6.js";
15
+ import "./chunk-M4RSKQAV.js";
16
+ import "./chunk-D42FMCLJ.js";
16
17
  export {
17
18
  CreditLedger,
18
19
  CreditLedgerError,
@@ -188,6 +188,8 @@ interface HostingControlConfig {
188
188
  scope: string;
189
189
  }
190
190
  interface HostingControlCommand {
191
+ /** Version two is required for resume; version one remains valid for drain and status. */
192
+ version?: 2;
191
193
  action: "drain" | "resume" | "status";
192
194
  scope: string;
193
195
  dvmId: string;
@@ -195,13 +197,15 @@ interface HostingControlCommand {
195
197
  nonce: string;
196
198
  generation?: number;
197
199
  deadlineMs?: number;
200
+ leaseExpiresAtMs?: number;
198
201
  }
199
- /** The ordered JSON array is the version-one wire signing contract. */
202
+ /** Ordered JSON arrays are the versioned wire signing contract. */
200
203
  declare function signHostingControl(secret: string, command: HostingControlCommand): string;
201
204
  interface HostingControlStatus {
202
205
  state: "accepting" | "draining";
203
206
  generation: number;
204
207
  deadlineMs: number | null;
208
+ leaseExpiresAtMs: number | null;
205
209
  activeJobIds: string[];
206
210
  unownedActiveJobIds: string[];
207
211
  pendingAdmissionCount: number;
package/dist/index.js CHANGED
@@ -7,11 +7,11 @@ import {
7
7
  import {
8
8
  configureDVM,
9
9
  isConfiguredDVMDescriptor
10
- } from "./chunk-GAIPXGM3.js";
10
+ } from "./chunk-SP42AI5T.js";
11
11
  import {
12
12
  SignedRequestError,
13
13
  createSignedRequestVerifier
14
- } from "./chunk-H2MEFVH6.js";
14
+ } from "./chunk-UQCK5VMA.js";
15
15
  import {
16
16
  DEFAULT_CREDIT_MAX,
17
17
  DEFAULT_CREDIT_MIN,
@@ -33,7 +33,7 @@ import {
33
33
  fxRateFor,
34
34
  resolveFxSourceFromEnv,
35
35
  validateCurrency
36
- } from "./chunk-4A2RAKCW.js";
36
+ } from "./chunk-IBDDIG4K.js";
37
37
  import {
38
38
  InvalidFxRateError,
39
39
  fiatToSatsCeil,
@@ -42,6 +42,7 @@ import {
42
42
  roundUsd,
43
43
  satsToFiat
44
44
  } from "./chunk-AT6V3SY7.js";
45
+ import "./chunk-D42FMCLJ.js";
45
46
 
46
47
  // src/sdk/heartbeat.ts
47
48
  async function withProgressHeartbeat(opts, fn) {
@@ -3834,8 +3834,8 @@ interface StoredCredit extends DvmLocated {
3834
3834
  */
3835
3835
  siblingCredits?: StoredSiblingCredit[];
3836
3836
  /**
3837
- * Drains requested from this endpoint and not yet retired, at most one per
3838
- * credit id.
3837
+ * Unresolved drains requested from this endpoint. Retained without a count or age limit;
3838
+ * only explicit retirement removes their recovery descriptors and credentials.
3839
3839
  *
3840
3840
  * Plural because drains are credit-scoped while the record is DVM-scoped
3841
3841
  * and re-points at whichever credit the DVM last named ({@link adoptCreditId}):
@@ -4330,6 +4330,11 @@ interface DeferredFunding {
4330
4330
  pinnedRail?: CreditFundRail;
4331
4331
  pinnedRailSource?: ForcedFundingRail["source"];
4332
4332
  }
4333
+ /** Explains an eligible automatic purchase left per-call; carries no spending authorization or amounts. */
4334
+ interface FundingSkip {
4335
+ reason: "btc_rate_unavailable";
4336
+ operation: "open" | "refill";
4337
+ }
4333
4338
  type CreditPlan =
4334
4339
  /**
4335
4340
  * Per-call implicit N=1 — wire-identical to the pre-credits request.
@@ -4343,6 +4348,7 @@ type CreditPlan =
4343
4348
  suppressed?: SuppressedPurchase;
4344
4349
  deferred?: DeferredFunding;
4345
4350
  drawSkipped?: DrawSkip;
4351
+ fundingSkipped?: FundingSkip;
4346
4352
  }
4347
4353
  /** Draw on an existing credit: credit fields in the signed body, no payment attach. */
4348
4354
  | {
@@ -6802,6 +6808,31 @@ declare const SPANS_DATASETS: readonly [{
6802
6808
  }];
6803
6809
  type DatasetName = (typeof SPANS_DATASETS)[number]["name"];
6804
6810
 
6811
+ declare const DIAGNOSTIC_CATALOGUE_VERSION: number;
6812
+ declare const diagnosticCapabilityAuthorityBrand: unique symbol;
6813
+ declare const diagnosticIdentityAuthorityBrand: unique symbol;
6814
+ /** Opaque, process-local proof that capability names came from one app definition. */
6815
+ interface DiagnosticCapabilityAuthority {
6816
+ readonly [diagnosticCapabilityAuthorityBrand]: true;
6817
+ }
6818
+ /** Opaque, process-local proof that diagnostic identities came from trusted context. */
6819
+ interface DiagnosticIdentityAuthority {
6820
+ readonly [diagnosticIdentityAuthorityBrand]: true;
6821
+ }
6822
+ type SpanProjectionResult = {
6823
+ ok: true;
6824
+ row: SpanRow;
6825
+ } | {
6826
+ ok: false;
6827
+ code: "invalid_span" | "invalid_span_id" | "invalid_trace_id" | "invalid_parent_span_id" | "invalid_dataset" | "invalid_level" | "invalid_status" | "invalid_timestamp";
6828
+ };
6829
+ /** Project an untrusted row into the versioned diagnostic catalogue. */
6830
+ declare function projectSpanRow(input: unknown): SpanProjectionResult;
6831
+ /** Project arbitrary diagnostic fields without invoking getters or coercion hooks. */
6832
+ declare function projectDiagnosticFields(input: unknown, dataset?: string, authority?: DiagnosticCapabilityAuthority, identityAuthority?: DiagnosticIdentityAuthority): Record<string, unknown>;
6833
+ /** Select a known event name without reflecting untrusted input. */
6834
+ declare function projectEventName(input: unknown, fallback?: string): string;
6835
+
6805
6836
  /** Severity level for a span (log lines use the same enum). */
6806
6837
  type SpanLevel = "info" | "warn" | "error";
6807
6838
  type SpanStatus = "ok" | "error";
@@ -6834,6 +6865,10 @@ interface TraceContext {
6834
6865
  dimensions: Record<string, unknown>;
6835
6866
  /** Service identifier: "router", "platform-api", or `isolate-${slug}`. */
6836
6867
  service: string;
6868
+ /** Process-local authority for this app's configured capability names. */
6869
+ diagnosticCapabilityAuthority?: DiagnosticCapabilityAuthority;
6870
+ /** Process-local authority for configured or authenticated diagnostic identity. */
6871
+ diagnosticIdentityAuthority?: DiagnosticIdentityAuthority;
6837
6872
  /** W3C tracestate header value preserved verbatim for outbound propagation. */
6838
6873
  tracestate?: string;
6839
6874
  /**
@@ -8962,4 +8997,4 @@ declare function readX402ChannelOnChain(args: {
8962
8997
  */
8963
8998
  declare function x402ChannelControlledBy(channel: StoredX402ChannelMetadata, address: string | null | undefined): boolean;
8964
8999
 
8965
- export { ADMIN_STATE_UNAVAILABLE, AGENT_MNEMONIC_FILE, type AgentProof, type AgentWallet, type AmountLabelOptions, type AttestedDvmIdentity, BTC_RATE_FILE, BUDGET_FILE, type BudgetCaps, type BudgetSpendKind, type BudgetWindow, type BuilderLockKeypair, CAPABILITY_NAME_RE, COINGECKO_SIMPLE_PRICE_URL, CONFIG_AUDIT_FILE, CONFIG_BACKUP_FILE, CONFIG_DIR, CONFIG_FILE, CONFIG_PINNED_FILE, CREDITS_FILE, CREDIT_DRAIN_RAILS, CREDIT_FUNDING_MODES, CREDIT_FUND_RAILS, CREDIT_POSTURES, type CachedBtcRate, type CancelOptions, type CashOutMintOutcome, type CashOutQuote, type CliIdentityEntry, type CoinGeckoBtcSpot, type CoinGeckoSpot, type Config, type ConfigBackupInfo, type ConfigDirModeResult, type ConfigField, type ConfigRollbackPreview, type ConfigSnapshotSlot, CreatedInvoice, type CreditConfig, type CreditDrainRail, type CreditFundOutcome, type CreditFundRail, type CreditFundStatus, type CreditFundingMode, type CreditMenu, type CreditOpResult, type CreditPlan, type CreditPosture, type CreditRailPick, type CreditRailReason, type CreditRailSource, type CreditTerms, type CreditWire, DEFAULT_AGENT_MINT_URL, DEFAULT_CREDIT_POSTURE, DEFAULT_RESERVE_LOCKTIME_SECONDS, DbTransport, type DeferredFunding, type DeliveredResult, type DescribeOptions, type DrainReceiptChecks, type DrainReceiptVerifyResult, type DrainWire, type DrawCeilingSource, type DrawSkip, DvmError, DvmX402ChannelStorage, type EffectiveFundingRail, FAVORITES_FILE, FEEDBACK_NUDGES_FILE, FEEDBACK_POSTURES, type FeedbackPosture, type Float, type FloatPayment, type FloatProbe, type FundCreditArgs, FundingReceipt, type FundingReceiptChecks, type FundingReceiptVerifyResult, IDENTITIES_FILE, IDENTITIES_VERSION, type IdentitiesFile, InvoiceStatus, JOBS_FILE, type JobCompletion, type JobEnvelope, type JobPolicy, JobReceipt$1 as JobReceipt, type JobRecord, type JobStatus, JsonValue, LightningBackend, type LightningFundingOffer, LightningPayment, LightningTransactionListOptions, LightningTransactionSnapshot, LightningWalletInfo, type LnAddressParts, MESSAGES_DIR, type MeltQuoteInfo, type MeltSweepResult, MemoryKVStore, Message, type MessagePollOptions, MessageType, MintAmountBounds, MintHealthCheckResult, type MintSource, type MnemonicValidationResult, MppxChallenge, MppxCredential, NWC_FUNDING_FLOAT_ROLE, type NextAction, type NextActionRefund, NwcBackend, type NwcConnection, NwcError, type NwcRequestOptions, type NwcTransaction, type OutboundMessage, PAIRINGS_DIR, PRIVKEY_HEX_RE, type PayInvoiceOutcome, type PayInvoiceReconcilingOptions, type PayInvoiceResult, type PayOutcome, type Payment, type PaymentRailKey, PaymentRequired, type PendingDrain, type PendingFunding, type PendingMint, type PendingSubmission, type PendingX402ExactFunding, type PendingX402Funding, type PersistedOutputData, PersistentCounterSource, type PreparedAgentSpend, type ProtectedTarget, type ProviderInfo, type ProviderRef, type ProviderText, type Quote, RAIL_FLAGS, RECEIPTS_FILE, RECENT_SPENDS_CAP, RECOMMENDED_MINTS, RECOVERY_MNEMONIC_FILE, REQUEST_INTENTS_DIR, RESUME_MAX_AGE_MS, RESUME_MAX_ATTEMPTS, ROUTER_FEEDBACK_CLAIM_HEADER, ROUTER_FEEDBACK_CLAIM_TTL_MS, type Rail, type RailFlag, type RailProbe, type ReceiptCapture, type ReceiptChecks, ReceiptCredit, type ReceiptInvalidReason, type ReceiptKeypair, type ReceiptParseError, type ReceiptTrustAnchor, type ReceiptVerification, type ReceiptVerifyResult, type ReleaseMintOutcome, type ResolvedBtcRate, ResourceInfo, SPANS_INSERTED_CHANNEL, STABLECOIN_FUND_RAILS, SUPPORTED_PROTOCOL_VERSION, type SelectError, type SendMessageOptions, type SpanRow, type SpanTransport, SpanWriter, type StaleRateNotice, type StatusOptions, type StoredCredit, type StoredFundingMenuSnapshot, type StoredImplicitCredit, type StoredReceipt, type StoredSiblingCredit, type StoredX402ChannelConfig, type StoredX402ChannelMetadata, type StreamOptions, type StreamResult, type SubmissionSweepOutcome, type SubmitOptions, type SuppressedPurchase, type SweepResult, TEMPO_CHAIN_ID, TEMPO_CHANNELS_FILE, TEMPO_EXIT_KEY_MISSING_HINT, TEMPO_MODERATO_CHAIN_ID, TEMPO_MODERATO_RPC, TEMPO_PATH_USD_MODERATO, type TempoAccount, type TempoChannelAssociation, type TempoChannelExitResult, type TempoChannelReconcileResult, type TempoNetwork, type TerminalJobStatus, type Transport, type JobReceipt as TransportJobReceipt, type TrustAnchorRead, type TrustLadder, type V1InfoCapability, type V1InfoResponse, type VerifyJobReceiptArgs, WALLET_FILE, WALLET_VERSION, type WalletInfo, type X402Asset, type X402Balance, type X402BatchPayment, type X402ChannelChainReport, type X402ChannelClient, type X402ChannelReconciliation, type X402ConnectedWallet, type X402CreditFlavour, type X402CreditInstrument, X402EnvValidationError, type X402Network, type X402PaymentProof, type X402RefundArgs, type X402RefundOutcome, type X402RepinnedWallet, type X402UnobservedBalanceProvenance, X402Version, X402Wallet, X402_BATCH_CHANNEL_ABI, X402_BATCH_SETTLEMENT_KEY, X402_BATCH_SETTLEMENT_SCHEME, X402_CHANNELS_FILE, X402_DEFAULT_FACILITATOR, X402_EXACT_AUTHORIZATION_TTL_SECONDS, X402_EXACT_SCHEME, X402_NETWORKS, X402_PENDING_STALE_MS, X402_RECEIVER_AUTHORIZER_KEY, X402_REFUSAL_TRANSACTION_DISCOVERY_WINDOW_MS, X402_RPC_URL_KEY, X402_SELF_RELAY_KEY, abandonPendingSubmission, acknowledgeReplayedX402Payment, acknowledgeX402ChannelOwner, addPayment, advanceTempoChannelExit, applyImplicitReceiptCredit, applyReceiptCredit, applyRetryToPool, asProviderText, asProviderTextOpt, assertAgentMnemonicReplaceable, assertFloatBudget, assertSupportedX402Network, assertTempoWalletIdle, assertValidBudget, assertX402ChannelPayer, assertX402RequirementDescribesChannel, assertX402WalletIdle, attestedDvmIdentity, authenticatedBuilderPubkey, authorizeProtectedRemoval, automaticCreditBoundRail, availableRails, backfillTrustAnchor, backupSecretFile, buildAdminAuthHeader, buildAdminChallenge, buildCompletionHintFields, buildDisplayMintInventory, buildPolicy, buildTempoCredential, builderLockPath, canReplaceExpiredX402Deposit, captureFundingReceipt, captureTransportReceipt, cashOutFromMint, cashuSubmissionBindingFingerprint, checkMeltQuoteState, checkReceiptAttestation, clearCreditSelection, clearPendingDrain, clearPendingX402ExactFunding, clearPendingX402Funding, clearRefillRailUnavailable, generateIdentity as cliIdentityStoreGenerateIdentity, commitAgentSpend, completionFromMessages, completionSnapshot, computeNextAction, computeSmartDenominations, configSnapshotPath, connectedTempoAccount, connectedX402Payer, correctPendingFundAmount, costAnchor, coveringMintsForSpend, createMonotonicClock, createNoopLogger, createStdoutLogger, createTempoCloseCredential, createX402BatchPayment, currentContext, deleteAgentMnemonic, deriveAgentMasterKeypair, deriveBuilderLockKeypair, deriveBuilderLockPubkey, deriveIdentityFromPrivkey, derivePubkeyFromPrivkey, deriveReceiptKeypair, deriveReceiptSecret, deriveTempoAddress, describeConfigBackup, describeMintBounds, drainReceiptsDisplay, drainReceiptsHint, dvmLocationIdentity, effectiveCreditPosture, effectiveFundingMint, effectiveFundingRail, effectiveMints, emitFloatBudgetWarning, enforceGlobalBudget, ensureAddress, ensureConfig, ensureConfigDir, ensureConfigSubdir, ensureProvisionalCredit, entryKind, epochMsToIso, extractBuilderHandle, fetchBtcUsdRate, fetchCoinGeckoBtcUsd, fetchCoinGeckoSpot, fetchLnurlPayInvoice, fetchMeltQuote, fetchMissingJobReceipt, fetchTrustAnchor, findSigningIdentityByPubkey, findX402Channel, floatBudgetJson, floatPaymentDisplay, floatPaymentJson, forgetCredit, formatAmount, formatAmountBestEffort, formatLocktime, formatPaymentAmount, formatSats, formatStaleness, formatUsd, formatUsdcMicrounits, fundAgentWallet, fundCredit, fundWireAmountMicro, fundingModeForTempoIntent, fundingModeForX402Flavour, fundingRailLabel, generateAgentMnemonic, generateEphemeralReceiptKey, generateTempoKey, generateX402PrivateKey, getBalance, getBalanceByMint, getFundingGuidance, getInfo, getInputFeesForProofs, getLastKnownBtcRate, getOutputTraceId, getTempoUsdcBalance, getX402Balance, hashedCanonicalDvmId, identitiesFileExists, info, initLoggers, insertSpanBatch, isAbortError, isCreditFundRail, isCreditFundingMode, isCreditPosture, isFeedbackPosture, isPaymentRailKey, isPublicRequestId, isResumable, isStablecoinFundRail, isTerminalJobStatus, isValidEvmPrivateKey, issueRouterFeedbackClaim, json, listCredits, listFundingMenuSnapshots, listImplicitCredits, listPendingFundings, listPendingX402Fundings, listPendingX402FundingsForChannel, listResumableTempoChargeFundings, listResumableX402ExactFundings, listResumableX402Fundings, listTempoChannelAssociations, listTransactions, listX402Channels, loadAgentWallet, loadAllJobs, loadConfig, loadConfiguredMints, loadCredit, loadFloat, loadIdentities, loadImplicitCredits, loadJob, loadLedger, loadPendingFunding, loadReceipt, loadReceipts, loadResumableX402ExactFunding, loadResumableX402Funding, loadTempoChannelAssociation, loadTempoChannelController, loadTempoChannelEntry, loadX402Wallet, loggers, looksLikeMnemonic, lookupInvoice, makeInvoice, markCredit, markImplicitCreditLost, markJobTerminal, markRefillDrainNoticed, markRefillRailUnavailable, maxKeysetDenomination, microToSats, missingDleqRecoveryDiagnostic, mnemonicFingerprint, monetaryJson, msatsToMicro, msatsToUsd, msatsToUsdCents, msatsToUsdc, needsPocketRefill, needsTopup, nextStepHint, normalizeCreditEndpoint, normalizeFeedbackEndpointHost, nwcDedupWindowMs, nwcRejectionDisplay, nwcTimeoutMs, offersTempoCreditFunding, offersX402CreditFunding, parseBudget, parseCreditMenu, parseCreditTerms, parseLnAddress, parseLocktime, parseNwcUri, parseStatedBudget, parseTraceparent, payInvoiceReconciling, payViaFloat, paymentRailLabel, pendingDrainById, pendingDrainFor, pickCreditFundRail, pinConfigSnapshot, pinDimension, planConfigReset, planCreditForQuote, planProbeDraw, pocketTargetMicro, pollNextAction, pollPendingCreditFundings, preferLightningFirst, prepareAgentSpend, prepareP2PKMint, previewConfigRollback, printFundingGuidance, probeFloat, probeRailLabel, probeWallets, processX402BatchCorrection, processX402BatchResponse, processX402BatchResponseForWallet, providerProseSources, providerTextToString, railLabelAtSentenceStart, randomTraceId, raw, readFundValuation, readX402ChannelOnChain, receiptDisplay, receiptFailureDetail, receiptHint, receiptIssuedAtIso, receiptJsonFields, receiptPubkeyFromSecret, receiptTrustFields, receiveToAgentWallet, reclaimAtMs, reconcileRefusedX402Deposits, reconcileTempoChannelOnChain, recordBalanceResponse, recordCreditX402Instrument, recordDrainReceipts, recordFloatSpend, recordFundResponse, recordFundingMenuSnapshot, recordPendingDrain, recordPendingX402ExactFunding, recordPendingX402Funding, recordRefusedDrawBalance, recordSpend, recordX402ChannelMetadata, recoverPendingSubmission, redactUrl, redactUrlsInText, refFromJob, refundX402BatchChannel, releaseAgentReserve, removeX402Wallet, renderReceiptHuman, repairConfigDirMode, repinX402WalletNetwork, replayStoredReceipt, reserveAgentWallet, resolveBtcUsdRate, resolveFundMint, resolveLnurlPayMetadataUrl, resolveRpcHttpTransportOptions, resolveRpcOverride, resolveSigningIdentity, resolveTempoAsset, resolveTempoNetwork, resolveX402Asset, resolveX402ChannelRpc, restoreProofsFromOutputs, retireConfigBackup, retirePendingX402Funding, rollbackConfig, rpcEndpointLine, rpcEndpointSuffix, saveAgentWallet, saveIdentities, saveJob, saveLedger, saveX402Wallet, selectProofsForSpend, serializeOutputData, setEmitter, setOutputTraceId, settleDrainEvidence, shellQuoteArg, signDvmRequestData, signRequestData, signedRequestDomain, spendableAt, staleRateNotice, statusSnapshot, swapFeeForProofs, swapSendReserve, sweepPendingMelts, sweepPendingMints, sweepPendingSubmissions, sweepStaleInFlight, tempoBalanceCheckHint, tempoChannelControlledBy, tempoCredentialAmountMicro, tempoKeyImportRoutes, tempoSessionChallenge, tempoSessionChallengeMicro, tempoTokenReference, tempoWrongAssetHint, tierCapOverrides, toAgentProof, toFloatError, transportErrorCode, trustLadderFor, trustOverrideCapMicro, tryResolveBtcUsdRate, tryResolveTempoAsset, tryX402Payment, unreachableRailDisplay, unreachableRailHint, unrecordedFloatBudgetWarning, unsignRequestData, updateConfig, updateJob, usdToMsats, usdcToMsats, validateAgentMnemonic, validateLnAddress, validateX402Env, verifyCanonicalSignedRequest, verifyChallenge, verifyDrainReceiptChain, verifyFundingReceiptChain, verifyJobReceipt, verifyRouterFeedbackClaim, walletExists, weakestReceiptVerdict, windowStart, withIdentitiesLock, withInitRetry, withNwcPool, withTempoChannelLock, withTraceContext, withWalletLock, withX402ChannelLock, writeAgentMnemonic, x402ChannelBalanceUnreconciledAt, x402ChannelControlledBy, x402ChannelReservation, x402CreditChannelNetworks, x402CreditExactNetworks, x402ExactFundingDead, x402FlavourForInstrument, x402NetworkByCaip2, x402NetworkBySlug, x402NetworkLabel, x402NetworkListForCopy, x402PendingBlockExpiresAt, x402PendingDepositExpiresAt, x402PendingFundingJson, x402PendingRetired, x402PendingStale, x402PendingUnsettled, x402RequiredFromError, x402ReservationRelease, x402SupportedNetworksHint, x402VoucherPendingRefusal, x402WrongAssetHint };
9000
+ export { ADMIN_STATE_UNAVAILABLE, AGENT_MNEMONIC_FILE, type AgentProof, type AgentWallet, type AmountLabelOptions, type AttestedDvmIdentity, BTC_RATE_FILE, BUDGET_FILE, type BudgetCaps, type BudgetSpendKind, type BudgetWindow, type BuilderLockKeypair, CAPABILITY_NAME_RE, COINGECKO_SIMPLE_PRICE_URL, CONFIG_AUDIT_FILE, CONFIG_BACKUP_FILE, CONFIG_DIR, CONFIG_FILE, CONFIG_PINNED_FILE, CREDITS_FILE, CREDIT_DRAIN_RAILS, CREDIT_FUNDING_MODES, CREDIT_FUND_RAILS, CREDIT_POSTURES, type CachedBtcRate, type CancelOptions, type CashOutMintOutcome, type CashOutQuote, type CliIdentityEntry, type CoinGeckoBtcSpot, type CoinGeckoSpot, type Config, type ConfigBackupInfo, type ConfigDirModeResult, type ConfigField, type ConfigRollbackPreview, type ConfigSnapshotSlot, CreatedInvoice, type CreditConfig, type CreditDrainRail, type CreditFundOutcome, type CreditFundRail, type CreditFundStatus, type CreditFundingMode, type CreditMenu, type CreditOpResult, type CreditPlan, type CreditPosture, type CreditRailPick, type CreditRailReason, type CreditRailSource, type CreditTerms, type CreditWire, DEFAULT_AGENT_MINT_URL, DEFAULT_CREDIT_POSTURE, DEFAULT_RESERVE_LOCKTIME_SECONDS, DIAGNOSTIC_CATALOGUE_VERSION, DbTransport, type DeferredFunding, type DeliveredResult, type DescribeOptions, type DrainReceiptChecks, type DrainReceiptVerifyResult, type DrainWire, type DrawCeilingSource, type DrawSkip, DvmError, DvmX402ChannelStorage, type EffectiveFundingRail, FAVORITES_FILE, FEEDBACK_NUDGES_FILE, FEEDBACK_POSTURES, type FeedbackPosture, type Float, type FloatPayment, type FloatProbe, type FundCreditArgs, FundingReceipt, type FundingReceiptChecks, type FundingReceiptVerifyResult, type FundingSkip, IDENTITIES_FILE, IDENTITIES_VERSION, type IdentitiesFile, InvoiceStatus, JOBS_FILE, type JobCompletion, type JobEnvelope, type JobPolicy, JobReceipt$1 as JobReceipt, type JobRecord, type JobStatus, JsonValue, LightningBackend, type LightningFundingOffer, LightningPayment, LightningTransactionListOptions, LightningTransactionSnapshot, LightningWalletInfo, type LnAddressParts, MESSAGES_DIR, type MeltQuoteInfo, type MeltSweepResult, MemoryKVStore, Message, type MessagePollOptions, MessageType, MintAmountBounds, MintHealthCheckResult, type MintSource, type MnemonicValidationResult, MppxChallenge, MppxCredential, NWC_FUNDING_FLOAT_ROLE, type NextAction, type NextActionRefund, NwcBackend, type NwcConnection, NwcError, type NwcRequestOptions, type NwcTransaction, type OutboundMessage, PAIRINGS_DIR, PRIVKEY_HEX_RE, type PayInvoiceOutcome, type PayInvoiceReconcilingOptions, type PayInvoiceResult, type PayOutcome, type Payment, type PaymentRailKey, PaymentRequired, type PendingDrain, type PendingFunding, type PendingMint, type PendingSubmission, type PendingX402ExactFunding, type PendingX402Funding, type PersistedOutputData, PersistentCounterSource, type PreparedAgentSpend, type ProtectedTarget, type ProviderInfo, type ProviderRef, type ProviderText, type Quote, RAIL_FLAGS, RECEIPTS_FILE, RECENT_SPENDS_CAP, RECOMMENDED_MINTS, RECOVERY_MNEMONIC_FILE, REQUEST_INTENTS_DIR, RESUME_MAX_AGE_MS, RESUME_MAX_ATTEMPTS, ROUTER_FEEDBACK_CLAIM_HEADER, ROUTER_FEEDBACK_CLAIM_TTL_MS, type Rail, type RailFlag, type RailProbe, type ReceiptCapture, type ReceiptChecks, ReceiptCredit, type ReceiptInvalidReason, type ReceiptKeypair, type ReceiptParseError, type ReceiptTrustAnchor, type ReceiptVerification, type ReceiptVerifyResult, type ReleaseMintOutcome, type ResolvedBtcRate, ResourceInfo, SPANS_INSERTED_CHANNEL, STABLECOIN_FUND_RAILS, SUPPORTED_PROTOCOL_VERSION, type SelectError, type SendMessageOptions, type SpanProjectionResult, type SpanRow, type SpanTransport, SpanWriter, type StaleRateNotice, type StatusOptions, type StoredCredit, type StoredFundingMenuSnapshot, type StoredImplicitCredit, type StoredReceipt, type StoredSiblingCredit, type StoredX402ChannelConfig, type StoredX402ChannelMetadata, type StreamOptions, type StreamResult, type SubmissionSweepOutcome, type SubmitOptions, type SuppressedPurchase, type SweepResult, TEMPO_CHAIN_ID, TEMPO_CHANNELS_FILE, TEMPO_EXIT_KEY_MISSING_HINT, TEMPO_MODERATO_CHAIN_ID, TEMPO_MODERATO_RPC, TEMPO_PATH_USD_MODERATO, type TempoAccount, type TempoChannelAssociation, type TempoChannelExitResult, type TempoChannelReconcileResult, type TempoNetwork, type TerminalJobStatus, type Transport, type JobReceipt as TransportJobReceipt, type TrustAnchorRead, type TrustLadder, type V1InfoCapability, type V1InfoResponse, type VerifyJobReceiptArgs, WALLET_FILE, WALLET_VERSION, type WalletInfo, type X402Asset, type X402Balance, type X402BatchPayment, type X402ChannelChainReport, type X402ChannelClient, type X402ChannelReconciliation, type X402ConnectedWallet, type X402CreditFlavour, type X402CreditInstrument, X402EnvValidationError, type X402Network, type X402PaymentProof, type X402RefundArgs, type X402RefundOutcome, type X402RepinnedWallet, type X402UnobservedBalanceProvenance, X402Version, X402Wallet, X402_BATCH_CHANNEL_ABI, X402_BATCH_SETTLEMENT_KEY, X402_BATCH_SETTLEMENT_SCHEME, X402_CHANNELS_FILE, X402_DEFAULT_FACILITATOR, X402_EXACT_AUTHORIZATION_TTL_SECONDS, X402_EXACT_SCHEME, X402_NETWORKS, X402_PENDING_STALE_MS, X402_RECEIVER_AUTHORIZER_KEY, X402_REFUSAL_TRANSACTION_DISCOVERY_WINDOW_MS, X402_RPC_URL_KEY, X402_SELF_RELAY_KEY, abandonPendingSubmission, acknowledgeReplayedX402Payment, acknowledgeX402ChannelOwner, addPayment, advanceTempoChannelExit, applyImplicitReceiptCredit, applyReceiptCredit, applyRetryToPool, asProviderText, asProviderTextOpt, assertAgentMnemonicReplaceable, assertFloatBudget, assertSupportedX402Network, assertTempoWalletIdle, assertValidBudget, assertX402ChannelPayer, assertX402RequirementDescribesChannel, assertX402WalletIdle, attestedDvmIdentity, authenticatedBuilderPubkey, authorizeProtectedRemoval, automaticCreditBoundRail, availableRails, backfillTrustAnchor, backupSecretFile, buildAdminAuthHeader, buildAdminChallenge, buildCompletionHintFields, buildDisplayMintInventory, buildPolicy, buildTempoCredential, builderLockPath, canReplaceExpiredX402Deposit, captureFundingReceipt, captureTransportReceipt, cashOutFromMint, cashuSubmissionBindingFingerprint, checkMeltQuoteState, checkReceiptAttestation, clearCreditSelection, clearPendingDrain, clearPendingX402ExactFunding, clearPendingX402Funding, clearRefillRailUnavailable, generateIdentity as cliIdentityStoreGenerateIdentity, commitAgentSpend, completionFromMessages, completionSnapshot, computeNextAction, computeSmartDenominations, configSnapshotPath, connectedTempoAccount, connectedX402Payer, correctPendingFundAmount, costAnchor, coveringMintsForSpend, createMonotonicClock, createNoopLogger, createStdoutLogger, createTempoCloseCredential, createX402BatchPayment, currentContext, deleteAgentMnemonic, deriveAgentMasterKeypair, deriveBuilderLockKeypair, deriveBuilderLockPubkey, deriveIdentityFromPrivkey, derivePubkeyFromPrivkey, deriveReceiptKeypair, deriveReceiptSecret, deriveTempoAddress, describeConfigBackup, describeMintBounds, drainReceiptsDisplay, drainReceiptsHint, dvmLocationIdentity, effectiveCreditPosture, effectiveFundingMint, effectiveFundingRail, effectiveMints, emitFloatBudgetWarning, enforceGlobalBudget, ensureAddress, ensureConfig, ensureConfigDir, ensureConfigSubdir, ensureProvisionalCredit, entryKind, epochMsToIso, extractBuilderHandle, fetchBtcUsdRate, fetchCoinGeckoBtcUsd, fetchCoinGeckoSpot, fetchLnurlPayInvoice, fetchMeltQuote, fetchMissingJobReceipt, fetchTrustAnchor, findSigningIdentityByPubkey, findX402Channel, floatBudgetJson, floatPaymentDisplay, floatPaymentJson, forgetCredit, formatAmount, formatAmountBestEffort, formatLocktime, formatPaymentAmount, formatSats, formatStaleness, formatUsd, formatUsdcMicrounits, fundAgentWallet, fundCredit, fundWireAmountMicro, fundingModeForTempoIntent, fundingModeForX402Flavour, fundingRailLabel, generateAgentMnemonic, generateEphemeralReceiptKey, generateTempoKey, generateX402PrivateKey, getBalance, getBalanceByMint, getFundingGuidance, getInfo, getInputFeesForProofs, getLastKnownBtcRate, getOutputTraceId, getTempoUsdcBalance, getX402Balance, hashedCanonicalDvmId, identitiesFileExists, info, initLoggers, insertSpanBatch, isAbortError, isCreditFundRail, isCreditFundingMode, isCreditPosture, isFeedbackPosture, isPaymentRailKey, isPublicRequestId, isResumable, isStablecoinFundRail, isTerminalJobStatus, isValidEvmPrivateKey, issueRouterFeedbackClaim, json, listCredits, listFundingMenuSnapshots, listImplicitCredits, listPendingFundings, listPendingX402Fundings, listPendingX402FundingsForChannel, listResumableTempoChargeFundings, listResumableX402ExactFundings, listResumableX402Fundings, listTempoChannelAssociations, listTransactions, listX402Channels, loadAgentWallet, loadAllJobs, loadConfig, loadConfiguredMints, loadCredit, loadFloat, loadIdentities, loadImplicitCredits, loadJob, loadLedger, loadPendingFunding, loadReceipt, loadReceipts, loadResumableX402ExactFunding, loadResumableX402Funding, loadTempoChannelAssociation, loadTempoChannelController, loadTempoChannelEntry, loadX402Wallet, loggers, looksLikeMnemonic, lookupInvoice, makeInvoice, markCredit, markImplicitCreditLost, markJobTerminal, markRefillDrainNoticed, markRefillRailUnavailable, maxKeysetDenomination, microToSats, missingDleqRecoveryDiagnostic, mnemonicFingerprint, monetaryJson, msatsToMicro, msatsToUsd, msatsToUsdCents, msatsToUsdc, needsPocketRefill, needsTopup, nextStepHint, normalizeCreditEndpoint, normalizeFeedbackEndpointHost, nwcDedupWindowMs, nwcRejectionDisplay, nwcTimeoutMs, offersTempoCreditFunding, offersX402CreditFunding, parseBudget, parseCreditMenu, parseCreditTerms, parseLnAddress, parseLocktime, parseNwcUri, parseStatedBudget, parseTraceparent, payInvoiceReconciling, payViaFloat, paymentRailLabel, pendingDrainById, pendingDrainFor, pickCreditFundRail, pinConfigSnapshot, pinDimension, planConfigReset, planCreditForQuote, planProbeDraw, pocketTargetMicro, pollNextAction, pollPendingCreditFundings, preferLightningFirst, prepareAgentSpend, prepareP2PKMint, previewConfigRollback, printFundingGuidance, probeFloat, probeRailLabel, probeWallets, processX402BatchCorrection, processX402BatchResponse, processX402BatchResponseForWallet, projectDiagnosticFields, projectEventName, projectSpanRow, providerProseSources, providerTextToString, railLabelAtSentenceStart, randomTraceId, raw, readFundValuation, readX402ChannelOnChain, receiptDisplay, receiptFailureDetail, receiptHint, receiptIssuedAtIso, receiptJsonFields, receiptPubkeyFromSecret, receiptTrustFields, receiveToAgentWallet, reclaimAtMs, reconcileRefusedX402Deposits, reconcileTempoChannelOnChain, recordBalanceResponse, recordCreditX402Instrument, recordDrainReceipts, recordFloatSpend, recordFundResponse, recordFundingMenuSnapshot, recordPendingDrain, recordPendingX402ExactFunding, recordPendingX402Funding, recordRefusedDrawBalance, recordSpend, recordX402ChannelMetadata, recoverPendingSubmission, redactUrl, redactUrlsInText, refFromJob, refundX402BatchChannel, releaseAgentReserve, removeX402Wallet, renderReceiptHuman, repairConfigDirMode, repinX402WalletNetwork, replayStoredReceipt, reserveAgentWallet, resolveBtcUsdRate, resolveFundMint, resolveLnurlPayMetadataUrl, resolveRpcHttpTransportOptions, resolveRpcOverride, resolveSigningIdentity, resolveTempoAsset, resolveTempoNetwork, resolveX402Asset, resolveX402ChannelRpc, restoreProofsFromOutputs, retireConfigBackup, retirePendingX402Funding, rollbackConfig, rpcEndpointLine, rpcEndpointSuffix, saveAgentWallet, saveIdentities, saveJob, saveLedger, saveX402Wallet, selectProofsForSpend, serializeOutputData, setEmitter, setOutputTraceId, settleDrainEvidence, shellQuoteArg, signDvmRequestData, signRequestData, signedRequestDomain, spendableAt, staleRateNotice, statusSnapshot, swapFeeForProofs, swapSendReserve, sweepPendingMelts, sweepPendingMints, sweepPendingSubmissions, sweepStaleInFlight, tempoBalanceCheckHint, tempoChannelControlledBy, tempoCredentialAmountMicro, tempoKeyImportRoutes, tempoSessionChallenge, tempoSessionChallengeMicro, tempoTokenReference, tempoWrongAssetHint, tierCapOverrides, toAgentProof, toFloatError, transportErrorCode, trustLadderFor, trustOverrideCapMicro, tryResolveBtcUsdRate, tryResolveTempoAsset, tryX402Payment, unreachableRailDisplay, unreachableRailHint, unrecordedFloatBudgetWarning, unsignRequestData, updateConfig, updateJob, usdToMsats, usdcToMsats, validateAgentMnemonic, validateLnAddress, validateX402Env, verifyCanonicalSignedRequest, verifyChallenge, verifyDrainReceiptChain, verifyFundingReceiptChain, verifyJobReceipt, verifyRouterFeedbackClaim, walletExists, weakestReceiptVerdict, windowStart, withIdentitiesLock, withInitRetry, withNwcPool, withTempoChannelLock, withTraceContext, withWalletLock, withX402ChannelLock, writeAgentMnemonic, x402ChannelBalanceUnreconciledAt, x402ChannelControlledBy, x402ChannelReservation, x402CreditChannelNetworks, x402CreditExactNetworks, x402ExactFundingDead, x402FlavourForInstrument, x402NetworkByCaip2, x402NetworkBySlug, x402NetworkLabel, x402NetworkListForCopy, x402PendingBlockExpiresAt, x402PendingDepositExpiresAt, x402PendingFundingJson, x402PendingRetired, x402PendingStale, x402PendingUnsettled, x402RequiredFromError, x402ReservationRelease, x402SupportedNetworksHint, x402VoucherPendingRefusal, x402WrongAssetHint };
@@ -55,7 +55,7 @@ import {
55
55
  withIdentitiesLock,
56
56
  withTempoChannelLock,
57
57
  withholdsTempoCreditSession
58
- } from "../chunk-FPOLJRBF.js";
58
+ } from "../chunk-Z3EHBW2G.js";
59
59
  import {
60
60
  TEMPO_CHAIN_ID,
61
61
  TEMPO_MODERATO_CHAIN_ID,
@@ -71,7 +71,7 @@ import {
71
71
  tempoTokenReference,
72
72
  tempoWrongAssetHint,
73
73
  tryResolveTempoAsset
74
- } from "../chunk-VIVXB4CD.js";
74
+ } from "../chunk-YYQG4R7T.js";
75
75
  import {
76
76
  DvmX402ChannelStorage,
77
77
  X402_EXACT_AUTHORIZATION_TTL_SECONDS,
@@ -116,7 +116,7 @@ import {
116
116
  x402PendingStale,
117
117
  x402PendingUnsettled,
118
118
  x402WrongAssetHint
119
- } from "../chunk-O6D72KYA.js";
119
+ } from "../chunk-YRDA7EWN.js";
120
120
  import {
121
121
  RAIL_FLAGS,
122
122
  SUPPORTED_PROTOCOL_VERSION,
@@ -163,7 +163,7 @@ import {
163
163
  setOutputTraceId,
164
164
  settleDrainEvidence,
165
165
  withinAdvertisedTolerance
166
- } from "../chunk-MMCE7XSR.js";
166
+ } from "../chunk-C2AGARLM.js";
167
167
  import {
168
168
  CREDIT_POSTURES,
169
169
  FEEDBACK_POSTURES,
@@ -184,7 +184,7 @@ import {
184
184
  } from "../chunk-MG67KXU7.js";
185
185
  import {
186
186
  CAPABILITY_NAME_RE
187
- } from "../chunk-GAIPXGM3.js";
187
+ } from "../chunk-SP42AI5T.js";
188
188
  import {
189
189
  DbTransport,
190
190
  NwcBackend,
@@ -209,7 +209,7 @@ import {
209
209
  sha256hex,
210
210
  validateX402Env,
211
211
  withNwcPool
212
- } from "../chunk-FDKRXOZO.js";
212
+ } from "../chunk-KL4C3LQV.js";
213
213
  import {
214
214
  MemoryKVStore
215
215
  } from "../chunk-SDK6KDJN.js";
@@ -289,7 +289,7 @@ import {
289
289
  withWalletLock,
290
290
  writeAgentMnemonic,
291
291
  writeIdentity
292
- } from "../chunk-QX52F6IB.js";
292
+ } from "../chunk-DSVGYW3B.js";
293
293
  import {
294
294
  X402_BATCH_SETTLEMENT_SCHEME,
295
295
  X402_DEFAULT_FACILITATOR,
@@ -398,7 +398,7 @@ import {
398
398
  randomTraceId,
399
399
  setEmitter,
400
400
  withTraceContext
401
- } from "../chunk-YO56VCTQ.js";
401
+ } from "../chunk-BWGRKGKG.js";
402
402
  import "../chunk-66HGCPBU.js";
403
403
  import {
404
404
  redactUrl,
@@ -408,7 +408,7 @@ import {
408
408
  FX_CACHE_TTL_MS,
409
409
  FX_RETRY_COUNT,
410
410
  warmFxSnapshot
411
- } from "../chunk-4A2RAKCW.js";
411
+ } from "../chunk-IBDDIG4K.js";
412
412
  import {
413
413
  InvalidUsdPriceError,
414
414
  parseUsdPrice
@@ -416,7 +416,13 @@ import {
416
416
  import {
417
417
  applyRetryToPool,
418
418
  withInitRetry
419
- } from "../chunk-C3MTFLC6.js";
419
+ } from "../chunk-M4RSKQAV.js";
420
+ import {
421
+ DIAGNOSTIC_CATALOGUE_VERSION,
422
+ projectDiagnosticFields,
423
+ projectEventName,
424
+ projectSpanRow
425
+ } from "../chunk-D42FMCLJ.js";
420
426
 
421
427
  // src/lib/budget-ledger.ts
422
428
  import { existsSync, readFileSync, renameSync, writeFileSync } from "fs";
@@ -3454,7 +3460,36 @@ function planCreditForQuote(args) {
3454
3460
  const canX402 = menu.funding.includes("x402") && args.x402Connected === true && offersX402CreditFunding(menu, args.x402Network);
3455
3461
  const canMpp = menu.funding.includes("tempo") && args.tempoConnected === true && offersTempoCreditFunding(menu);
3456
3462
  if (!canCashu && !canFloat && !canX402 && !canMpp) return none;
3457
- if (args.btcRate <= 0 || args.priceMsats <= 0) return none;
3463
+ if (!Number.isFinite(args.priceMsats) || args.priceMsats <= 0) return none;
3464
+ const stored = args.stored;
3465
+ if (stored?.reconciliationPending) return none;
3466
+ const refilling = stored?.status === "active" && stored.currency === menu.currency;
3467
+ const rateUnavailable = !Number.isFinite(args.btcRate) || args.btcRate <= 0;
3468
+ if (!refilling) {
3469
+ const completed = completedReceiptsFor(
3470
+ args.receipts,
3471
+ args.endpoint,
3472
+ args.signingPubkey,
3473
+ args.identity
3474
+ );
3475
+ if (completed.length === 0) return none;
3476
+ const identity = args.identity;
3477
+ if (rateUnavailable && identity && !completed.some((entry) => {
3478
+ const attested = attestedDvmIdentity(entry.builder);
3479
+ return attested?.dvmId === identity.dvmId && attested.builderPubkey === identity.builderPubkey;
3480
+ })) {
3481
+ return none;
3482
+ }
3483
+ }
3484
+ if (rateUnavailable) {
3485
+ return posture === "auto" ? {
3486
+ mode: "none",
3487
+ fundingSkipped: {
3488
+ reason: "btc_rate_unavailable",
3489
+ operation: refilling ? "refill" : "open"
3490
+ }
3491
+ } : none;
3492
+ }
3458
3493
  const priceMicro = msatsToMicro(args.priceMsats, args.btcRate);
3459
3494
  if (priceMicro <= 0) return none;
3460
3495
  const tier = trustTierFor({
@@ -3465,8 +3500,6 @@ function planCreditForQuote(args) {
3465
3500
  menu,
3466
3501
  ...tierCapOverrides(args.config)
3467
3502
  });
3468
- const stored = args.stored;
3469
- if (stored?.reconciliationPending) return none;
3470
3503
  const targetJobs = targetJobsFor(args.config, args.endpoint, args.identity);
3471
3504
  const pin = effectiveFundingRail(args.config, args.endpoint, args.identity);
3472
3505
  const eligible = [
@@ -3501,7 +3534,7 @@ function planCreditForQuote(args) {
3501
3534
  ...forced ? { pinnedRail: forced.rail, pinnedRailSource: forced.source } : {}
3502
3535
  }
3503
3536
  });
3504
- if (stored?.status === "active" && stored.currency === menu.currency) {
3537
+ if (refilling) {
3505
3538
  const targetMicro2 = refillTargetMicro({
3506
3539
  menu,
3507
3540
  priceMicro,
@@ -3536,9 +3569,6 @@ function planCreditForQuote(args) {
3536
3569
  railReason: refillRoute.reason
3537
3570
  };
3538
3571
  }
3539
- if (completedReceiptsFor(args.receipts, args.endpoint, args.signingPubkey, args.identity).length === 0) {
3540
- return none;
3541
- }
3542
3572
  const fundMicro = sizeCreditMicro({
3543
3573
  menu,
3544
3574
  priceMicro,
@@ -3680,6 +3710,12 @@ function completedReceiptsFor(receipts, endpoint, signingPubkey, identity) {
3680
3710
  if (normalizeCreditEndpoint(entry.endpoint) !== key || !mine(entry)) continue;
3681
3711
  const verdict = verifyJobReceipt({ receipt: entry.receipt, builder: entry.builder });
3682
3712
  if (verdict.status !== "verified" && verdict.status !== "verified_unattested") continue;
3713
+ if (identity !== void 0) {
3714
+ const attested = verdict.checks.attestation === "ok" ? attestedDvmIdentity(entry.builder) : void 0;
3715
+ if (attested?.dvmId !== identity.dvmId || attested.builderPubkey !== identity.builderPubkey) {
3716
+ continue;
3717
+ }
3718
+ }
3683
3719
  here.push(entry);
3684
3720
  if (anchor === void 0 && verdict.checks.attestation === "ok") {
3685
3721
  anchor = attestedDvmIdentity(entry.builder);
@@ -9395,7 +9431,7 @@ async function probeX402(x402, timeoutMs) {
9395
9431
  let network;
9396
9432
  let address;
9397
9433
  try {
9398
- const { loadX402Wallet: loadX402Wallet2, getX402Balance: getX402Balance2, ensureAddress: ensureAddress2, usdcContractByCaip2: usdcContractByCaip22 } = await import("../x402-CI6PSHNO.js");
9434
+ const { loadX402Wallet: loadX402Wallet2, getX402Balance: getX402Balance2, ensureAddress: ensureAddress2, usdcContractByCaip2: usdcContractByCaip22 } = await import("../x402-S47Q77UE.js");
9399
9435
  const wallet = loadX402Wallet2();
9400
9436
  if (!wallet) {
9401
9437
  const storedKey = x402.privateKey;
@@ -9447,7 +9483,7 @@ async function probeMpp(mpp, timeoutMs) {
9447
9483
  if (!mpp) return null;
9448
9484
  if (mpp.method === "tempo") {
9449
9485
  try {
9450
- const { connectedTempoAccount: connectedTempoAccount2, getTempoUsdcBalance: getTempoUsdcBalance2, resolveTempoNetwork: resolveTempoNetwork2 } = await import("../tempo-wallet-ZFNUDFVO.js");
9486
+ const { connectedTempoAccount: connectedTempoAccount2, getTempoUsdcBalance: getTempoUsdcBalance2, resolveTempoNetwork: resolveTempoNetwork2 } = await import("../tempo-wallet-RCGBBAJH.js");
9451
9487
  const account = await connectedTempoAccount2();
9452
9488
  if (!account) {
9453
9489
  return {
@@ -9553,6 +9589,7 @@ export {
9553
9589
  DEFAULT_AGENT_MINT_URL,
9554
9590
  DEFAULT_CREDIT_POSTURE,
9555
9591
  DEFAULT_RESERVE_LOCKTIME_SECONDS,
9592
+ DIAGNOSTIC_CATALOGUE_VERSION,
9556
9593
  DbTransport,
9557
9594
  DvmError,
9558
9595
  DvmX402ChannelStorage,
@@ -9889,6 +9926,9 @@ export {
9889
9926
  processX402BatchCorrection,
9890
9927
  processX402BatchResponse,
9891
9928
  processX402BatchResponseForWallet,
9929
+ projectDiagnosticFields,
9930
+ projectEventName,
9931
+ projectSpanRow,
9892
9932
  providerProseSources,
9893
9933
  providerTextToString,
9894
9934
  railLabelAtSentenceStart,