@tempoxyz/patron 0.0.30 → 0.0.32

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/bin.js CHANGED
@@ -12,14 +12,14 @@ if (!process.env.PATRON_HOME) {
12
12
  if (home) process.env.PATRON_HOME = home;
13
13
  }
14
14
  if (process.argv[2] === "hook") {
15
- const { runHookProcess } = await import("./chunks/hook-process-ETJ3UZZT.js");
15
+ const { runHookProcess } = await import("./chunks/hook-process-Y3K3FTXH.js");
16
16
  await runHookProcess().catch(() => void 0);
17
17
  process.exit(0);
18
18
  } else if (process.argv[2] === "pay") {
19
- const { runPayProcess } = await import("./chunks/hook-process-ETJ3UZZT.js");
19
+ const { runPayProcess } = await import("./chunks/hook-process-Y3K3FTXH.js");
20
20
  await runPayProcess().catch(() => void 0);
21
21
  process.exit(0);
22
22
  } else {
23
- const { run } = await import("./chunks/-WRUP4P4C.js");
23
+ const { run } = await import("./chunks/-ZBR7H4YK.js");
24
24
  process.exitCode = await run(process.argv.slice(2));
25
25
  }
@@ -31,12 +31,12 @@ import {
31
31
  withPatronStatus,
32
32
  withoutPatronHandlers,
33
33
  writeJsonObject
34
- } from "./chunk-4SXIRXUL.js";
34
+ } from "./chunk-AN64RW3X.js";
35
35
  import {
36
36
  awaitRedemptions,
37
37
  gatewayTurn,
38
38
  startRefill
39
- } from "./chunk-TC2WEQ25.js";
39
+ } from "./chunk-D3IY3ICC.js";
40
40
  import {
41
41
  inferHome,
42
42
  resolveSettings,
@@ -46,7 +46,7 @@ import {
46
46
  LeaderboardResponse,
47
47
  PatronInfo,
48
48
  profileMessage
49
- } from "./chunk-ROVOCDKE.js";
49
+ } from "./chunk-GBZCXMDZ.js";
50
50
  import {
51
51
  AGENT_IDS,
52
52
  DEFAULT_MONTHLY_BUDGET_USD,
@@ -68,7 +68,7 @@ import {
68
68
  withLock,
69
69
  writeConfig,
70
70
  writePrivateFile
71
- } from "./chunk-AKOXBXV3.js";
71
+ } from "./chunk-JTPFWITF.js";
72
72
  import "./chunk-GTMLTZRN.js";
73
73
 
74
74
  // src/index.ts
@@ -361,7 +361,8 @@ import {
361
361
  realpath,
362
362
  rename,
363
363
  rm as rm3,
364
- symlink
364
+ symlink,
365
+ writeFile as writeFile2
365
366
  } from "node:fs/promises";
366
367
  import { basename, dirname as dirname3, join as join4 } from "node:path";
367
368
  function stableBin(home) {
@@ -382,6 +383,7 @@ async function installStableCli(home, script = process.argv[1], anySource = proc
382
383
  await rm3(staging, { force: true, recursive: true });
383
384
  await cp(join4(packageDir, "dist"), join4(staging, "dist"), { recursive: true });
384
385
  await cp(join4(packageDir, "package.json"), join4(staging, "package.json"));
386
+ await writeFile2(join4(staging, "origin.json"), JSON.stringify({ bin: resolved }));
385
387
  await rm3(target, { force: true, recursive: true });
386
388
  await rename(staging, target);
387
389
  }
@@ -778,10 +780,10 @@ async function linkRefillFailedAt(home) {
778
780
  }
779
781
  var defaultOpenWallet = async (settings, config, issuer, maxUnits) => {
780
782
  if (config.wallet === "link") {
781
- const { openLinkWallet } = await import("./wallet-OTFEEKIG.js");
783
+ const { openLinkWallet } = await import("./wallet-WR6EBMN6.js");
782
784
  return openLinkWallet(config, maxUnits);
783
785
  }
784
- const { openWallet } = await import("./wallet-OTFEEKIG.js");
786
+ const { openWallet } = await import("./wallet-WR6EBMN6.js");
785
787
  return openWallet(settings, config.wallet, issuer, maxUnits);
786
788
  };
787
789
  var REFILL_LOCK_STALE_MS = 5 * 60 * 1e3;
@@ -847,9 +849,11 @@ async function refill(base, openWallet = defaultOpenWallet, now = Date.now, slee
847
849
  const bought = await gatewayTurn(
848
850
  settings.home,
849
851
  async () => {
850
- if (stale)
851
- await loadIssuer(settings.home, settings.gatewayUrl).catch(() => void 0);
852
- return low ? refillLocked(settings, config, openWallet, now) : 0;
852
+ const current = await readConfig(base.home);
853
+ if (!current || current.paused) return 0;
854
+ const latest = settingsFor(base, current);
855
+ if (stale) await loadIssuer(latest.home, latest.gatewayUrl).catch(() => void 0);
856
+ return low ? refillLocked(latest, current, openWallet, now) : 0;
853
857
  },
854
858
  { maxWaitMs: REFILL_GATEWAY_WAIT_MS, ...sleep ? { sleep } : {} }
855
859
  );
@@ -920,9 +924,20 @@ function formatStatus(view, color) {
920
924
  ),
921
925
  row(
922
926
  "Rank",
923
- standing?.rank ? `#${standing.rank} \xB7 ${tokensUsd(standing.tokens)} added` : styleText("not ranked yet", "dim", color),
927
+ standing?.rank ? `#${standing.rank} \xB7 ${tokensUsd(standing.tokens)} added${view.standingSkipped ? styleText(" (last check)", "dim", color) : ""}` : view.standingSkipped ? styleText("not checked right now", "dim", color) : styleText("not ranked yet", "dim", color),
924
928
  color
925
929
  ),
930
+ ...view.standingSkipped ? [
931
+ row(
932
+ "",
933
+ styleText(
934
+ "Checked once your agents' payments go quiet, so the two can't be linked.",
935
+ "dim",
936
+ color
937
+ ),
938
+ color
939
+ )
940
+ ] : [],
926
941
  row(
927
942
  "Agents",
928
943
  config.agents.length > 0 ? config.agents.map((agent) => AGENT_LABELS[agent]).join(", ") : styleText("none", "dim", color),
@@ -980,20 +995,63 @@ async function inGatewayTurn(deps, fn) {
980
995
  const result = await gatewayTurn(
981
996
  deps.settings.home,
982
997
  async () => ({ value: await fn() }),
983
- {
984
- ...waiting(deps),
985
- onWait: (ms) => say(
986
- deps,
987
- styleText(
988
- ` Waiting ${minutes(ms)} after your agents' last payment, so Patron can't link the two.`,
989
- "dim",
990
- deps.color
991
- )
992
- )
993
- }
998
+ gatewayWaiting(deps)
994
999
  );
995
1000
  return result.value;
996
1001
  }
1002
+ function gatewayWaiting(deps) {
1003
+ return {
1004
+ ...waiting(deps),
1005
+ onWait: (ms) => say(
1006
+ deps,
1007
+ styleText(
1008
+ ` Waiting ${minutes(ms)} after the last payment, so Patron can't link the two.`,
1009
+ "dim",
1010
+ deps.color
1011
+ )
1012
+ )
1013
+ };
1014
+ }
1015
+ async function currentIssuer(deps, settings) {
1016
+ const stored = await storedIssuer(settings.home, settings.gatewayUrl);
1017
+ if (stored && !stored.stale) return stored.issuer;
1018
+ return inGatewayTurn(
1019
+ deps,
1020
+ () => loadIssuer(settings.home, settings.gatewayUrl, { fetch: deps.fetch, fresh: true })
1021
+ );
1022
+ }
1023
+ async function standingFor(deps, settings, config) {
1024
+ const address = config.address.toLowerCase();
1025
+ if (!address) return {};
1026
+ const path = statePaths(settings.home).standing;
1027
+ const fetched = await gatewayTurn(
1028
+ settings.home,
1029
+ async () => ({
1030
+ standing: await fetchStanding(
1031
+ settings.gatewayUrl,
1032
+ address,
1033
+ config.name,
1034
+ deps.fetch
1035
+ ).catch(() => void 0)
1036
+ }),
1037
+ { maxWaitMs: 0, want: false }
1038
+ ).catch(() => void 0);
1039
+ if (fetched) {
1040
+ if (fetched.standing)
1041
+ await writePrivateFile(
1042
+ path,
1043
+ JSON.stringify({
1044
+ address,
1045
+ gatewayUrl: settings.gatewayUrl,
1046
+ standing: fetched.standing
1047
+ })
1048
+ ).catch(() => void 0);
1049
+ return { standing: fetched.standing };
1050
+ }
1051
+ const cached = await readJson(path).catch(() => void 0);
1052
+ const last = cached?.address === address && cached.gatewayUrl === settings.gatewayUrl ? cached.standing : void 0;
1053
+ return { skipped: true, standing: last };
1054
+ }
997
1055
  function waiting(deps) {
998
1056
  return deps.sleep ? { sleep: deps.sleep } : {};
999
1057
  }
@@ -1012,7 +1070,7 @@ function defaults() {
1012
1070
  prompter: () => createPrompter(process.stdout, color),
1013
1071
  settings: resolveSettings(),
1014
1072
  stderr: process.stderr,
1015
- startRefill: () => startRefill(),
1073
+ startRefill: (options) => startRefill(options),
1016
1074
  stdout: process.stdout
1017
1075
  };
1018
1076
  }
@@ -1245,7 +1303,7 @@ async function tempoSignIn(deps, budgetUnits, issuer) {
1245
1303
  deps,
1246
1304
  deps.settings.privateKey ? "Using PATRON_PRIVATE_KEY" : "Signing in with Tempo Wallet"
1247
1305
  );
1248
- const { signIn } = await import("./wallet-OTFEEKIG.js");
1306
+ const { signIn } = await import("./wallet-WR6EBMN6.js");
1249
1307
  const account = await signIn(deps.settings, {
1250
1308
  budgetUnits,
1251
1309
  issuer,
@@ -1303,18 +1361,23 @@ async function askBudget(deps, fallback) {
1303
1361
  }
1304
1362
  async function status(deps, menu) {
1305
1363
  const { config, settings } = await loadSetup(deps);
1306
- const [tokensLeft, usage, standing, refillFailedAt] = await Promise.all([
1364
+ const [tokensLeft, usage, rank, refillFailedAt] = await Promise.all([
1307
1365
  new FileTokenStore(settings.home).count(),
1308
1366
  readUsage(settings.home),
1309
- config.address ? fetchStanding(settings.gatewayUrl, config.address, config.name, deps.fetch).catch(
1310
- () => void 0
1311
- ) : void 0,
1367
+ standingFor(deps, settings, config),
1312
1368
  config.wallet === "link" ? linkRefillFailedAt(settings.home) : void 0
1313
1369
  ]);
1314
1370
  say(
1315
1371
  deps,
1316
1372
  formatStatus(
1317
- { config, linkRefillFailedAt: refillFailedAt, standing, tokensLeft, usage },
1373
+ {
1374
+ config,
1375
+ linkRefillFailedAt: refillFailedAt,
1376
+ standing: rank.standing,
1377
+ ...rank.skipped ? { standingSkipped: true } : {},
1378
+ tokensLeft,
1379
+ usage
1380
+ },
1318
1381
  deps.color
1319
1382
  )
1320
1383
  );
@@ -1359,17 +1422,15 @@ async function changeBudget(deps, input) {
1359
1422
  } else budget = await askBudget(deps, config.monthlyBudgetUsd);
1360
1423
  if (config.wallet === "tempo" && budget >= config.monthlyBudgetUsd) {
1361
1424
  step(deps, "Approve the new spending limit in Tempo Wallet");
1362
- const { authorizeBudget } = await import("./wallet-OTFEEKIG.js");
1363
- const issuer = await loadIssuer(settings.home, settings.gatewayUrl, {
1364
- fetch: deps.fetch
1365
- });
1425
+ const { authorizeBudget } = await import("./wallet-WR6EBMN6.js");
1426
+ const issuer = await currentIssuer(deps, settings);
1366
1427
  await authorizeBudget(settings, {
1367
1428
  budgetUnits: BigInt(budgetTokens(budget)) * TOKEN_PRICE_UNITS,
1368
1429
  issuer,
1369
1430
  output: deps.stdout
1370
1431
  });
1371
1432
  }
1372
- await writeConfig(settings.home, { ...config, monthlyBudgetUsd: budget });
1433
+ await updateConfigField(settings.home, { monthlyBudgetUsd: budget });
1373
1434
  done(deps, `Monthly budget set to $${twoDecimals(String(budget))}.`);
1374
1435
  }
1375
1436
  async function changePerPage(deps, input) {
@@ -1420,10 +1481,13 @@ async function tip(deps, url, amount = "0.10") {
1420
1481
  () => buyWithinBudget(settings, config, amount2, deps.openWallet)
1421
1482
  );
1422
1483
  }
1423
- const issuer = (await storedIssuer(settings.home, settings.gatewayUrl))?.issuer ?? await inGatewayTurn(
1484
+ const stored = await storedIssuer(settings.home, settings.gatewayUrl);
1485
+ let issuer = stored?.issuer ?? await inGatewayTurn(
1424
1486
  deps,
1425
1487
  () => loadIssuer(settings.home, settings.gatewayUrl, { fetch: deps.fetch, fresh: true })
1426
1488
  );
1489
+ let stale = stored?.stale ?? false;
1490
+ let refreshed = false;
1427
1491
  const redeemFetch = (input, init) => deps.fetch(input, { ...init, signal: AbortSignal.timeout(TIP_REDEEM_TIMEOUT_MS) });
1428
1492
  let told = false;
1429
1493
  const claimBatch = (cancelled) => awaitRedemptions(settings.home, TIP_BATCH_LEASE_MS, {
@@ -1454,9 +1518,11 @@ async function tip(deps, url, amount = "0.10") {
1454
1518
  let paid = 0;
1455
1519
  let sent = 0;
1456
1520
  let rejection;
1521
+ let claimed = true;
1457
1522
  try {
1458
1523
  while (sent < count && !stopped) {
1459
- if (sent > 0 && !await claimBatch(() => stopped)) break;
1524
+ if (!claimed && !await claimBatch(() => stopped)) break;
1525
+ claimed = false;
1460
1526
  const batch = await store.takeMany(Math.min(TIP_BATCH, count - sent));
1461
1527
  if (batch.length === 0) break;
1462
1528
  sent += batch.length;
@@ -1499,12 +1565,31 @@ async function tip(deps, url, amount = "0.10") {
1499
1565
  deps.color
1500
1566
  )
1501
1567
  );
1502
- if (ok === 0 && (rejected > 0 || unsent.length > 0)) break;
1568
+ if (ok === 0 && (rejected > 0 || unsent.length > 0)) {
1569
+ if (rejected === 0 && stale && !refreshed) {
1570
+ refreshed = true;
1571
+ const fresh = await gatewayTurn(
1572
+ settings.home,
1573
+ () => loadIssuer(settings.home, settings.gatewayUrl, {
1574
+ fetch: deps.fetch,
1575
+ fresh: true
1576
+ }),
1577
+ { ...gatewayWaiting(deps), cancelled: () => stopped }
1578
+ ).catch(() => void 0);
1579
+ if (fresh) {
1580
+ issuer = fresh;
1581
+ stale = false;
1582
+ continue;
1583
+ }
1584
+ }
1585
+ break;
1586
+ }
1503
1587
  }
1504
1588
  } finally {
1505
1589
  process.off("SIGINT", stop);
1506
1590
  process.off("SIGTERM", stop);
1507
1591
  }
1592
+ if (stale) deps.startRefill({ delayed: true });
1508
1593
  if (stopped && sent < count)
1509
1594
  throw new Error(
1510
1595
  `Tip stopped: tipped ${domain} ${tokensUsd(paid)} of ${tokensUsd(count)}; the rest stays in your balance.`
@@ -1532,15 +1617,21 @@ async function setName(deps, name) {
1532
1617
  throw new UsageError(
1533
1618
  "Leaderboard names belong to Tempo addresses; Link purchases are not ranked."
1534
1619
  );
1535
- const issuer = await loadIssuer(settings.home, settings.gatewayUrl, {
1536
- fetch: deps.fetch
1537
- });
1538
- const open = deps.openWallet ?? (async (s, c, i, max) => (await import("./wallet-OTFEEKIG.js")).openWallet(s, c.wallet, i, max));
1620
+ const issuer = await currentIssuer(deps, settings);
1621
+ const open = deps.openWallet ?? (async (s, c, i, max) => (await import("./wallet-WR6EBMN6.js")).openWallet(s, c.wallet, i, max));
1539
1622
  const wallet = await open(settings, config, issuer, 0n);
1540
- await setProfile(settings.gatewayUrl, wallet, name, deps.fetch);
1541
- await writeConfig(settings.home, { ...config, name });
1623
+ await inGatewayTurn(
1624
+ deps,
1625
+ () => setProfile(settings.gatewayUrl, wallet, name, deps.fetch)
1626
+ );
1627
+ await updateConfigField(settings.home, { name });
1542
1628
  done(deps, `Leaderboard name set to ${name}.`);
1543
1629
  }
1630
+ async function updateConfigField(home, fields) {
1631
+ const current = await readConfig(home);
1632
+ if (!current) throw new Error("Patron is not set up. Run npx @tempoxyz/patron.");
1633
+ await writeConfig(home, { ...current, ...fields });
1634
+ }
1544
1635
  async function uninstall(deps) {
1545
1636
  const config = await readConfig(deps.settings.home);
1546
1637
  const removed = await removeAgents(deps.agents);
@@ -3,7 +3,7 @@ const require = __patronCreateRequire(import.meta.url)
3
3
  import {
4
4
  isExcludedByDefault,
5
5
  normalizePayee
6
- } from "./chunk-AKOXBXV3.js";
6
+ } from "./chunk-JTPFWITF.js";
7
7
 
8
8
  // src/hook-input.ts
9
9
  var HOOK_TIMEOUT_MS = 2e3;
@@ -4,7 +4,7 @@ import {
4
4
  IssueResponse,
5
5
  IssuerInfo,
6
6
  RedeemResponse
7
- } from "./chunk-ROVOCDKE.js";
7
+ } from "./chunk-GBZCXMDZ.js";
8
8
  import {
9
9
  ISSUER_NAME,
10
10
  MAX_TOKENS_PER_PURCHASE,
@@ -18,7 +18,7 @@ import {
18
18
  toBase64Url,
19
19
  withLock,
20
20
  writePrivateFile
21
- } from "./chunk-AKOXBXV3.js";
21
+ } from "./chunk-JTPFWITF.js";
22
22
  import {
23
23
  __commonJS,
24
24
  __export,
@@ -6,11 +6,13 @@ import {
6
6
  statePaths,
7
7
  withLock,
8
8
  writePrivateFile
9
- } from "./chunk-AKOXBXV3.js";
9
+ } from "./chunk-JTPFWITF.js";
10
10
 
11
11
  // src/refill-process.ts
12
12
  import { spawn } from "node:child_process";
13
+ import { existsSync, readFileSync } from "node:fs";
13
14
  import { createRequire } from "node:module";
15
+ import { dirname, join } from "node:path";
14
16
  function startRefill(options = {}, script = process.argv[1]) {
15
17
  try {
16
18
  if (!script) return;
@@ -19,22 +21,38 @@ function startRefill(options = {}, script = process.argv[1]) {
19
21
  const child = spawn(command, args, {
20
22
  detached: true,
21
23
  env: process.env,
22
- stdio: "ignore"
24
+ stdio: "ignore",
25
+ // On Windows a detached cmd has no console, so its npx child would open a visible one.
26
+ windowsHide: true
23
27
  });
24
28
  child.on("error", () => void 0);
25
29
  child.unref();
26
30
  } catch {
27
31
  }
28
32
  }
29
- function refillCommand(script) {
33
+ function refillCommand(script, platform = process.platform, env = process.env) {
34
+ const bin = withWallet(script) ?? withWallet(originBin(script));
35
+ if (bin) return [process.execPath, [...process.execArgv, bin, "refill"]];
36
+ const npx = ["npx", "-y", "@tempoxyz/patron", "refill"];
37
+ return platform === "win32" ? [env.ComSpec || "cmd.exe", ["/d", "/s", "/c", ...npx]] : [npx[0], npx.slice(1)];
38
+ }
39
+ function withWallet(bin) {
40
+ if (!bin || !existsSync(bin)) return void 0;
30
41
  try {
31
- createRequire(script).resolve("mppx");
32
- return [process.execPath, [...process.execArgv, script, "refill"]];
42
+ createRequire(bin).resolve("mppx");
43
+ return bin;
33
44
  } catch {
34
- return [
35
- process.platform === "win32" ? "npx.cmd" : "npx",
36
- ["-y", "@tempoxyz/patron", "refill"]
37
- ];
45
+ return void 0;
46
+ }
47
+ }
48
+ function originBin(script) {
49
+ try {
50
+ const origin = JSON.parse(
51
+ readFileSync(join(dirname(dirname(script)), "origin.json"), "utf8")
52
+ );
53
+ return typeof origin.bin === "string" ? origin.bin : void 0;
54
+ } catch {
55
+ return void 0;
38
56
  }
39
57
  }
40
58
  function startDrain(script = process.argv[1]) {
@@ -95,7 +113,7 @@ function claimRedemptions(home, now, leaseMs) {
95
113
  function redemptionWait(home, now = Date.now()) {
96
114
  return update(home, (spacing) => ({ result: redeemWait(spacing, now) }));
97
115
  }
98
- function claimGateway(home, now, random = Math.random) {
116
+ function claimGateway(home, now, random = Math.random, want = true) {
99
117
  return update(home, (spacing) => {
100
118
  const wait = Math.max(
101
119
  0,
@@ -105,7 +123,7 @@ function claimGateway(home, now, random = Math.random) {
105
123
  const active = spacing.gatewayWanted !== void 0 && now < spacing.gatewayWanted + GATEWAY_WANT_MS;
106
124
  return {
107
125
  result: wait,
108
- ...active ? {} : { next: { ...spacing, gatewayWanted: now } }
126
+ ...active || !want ? {} : { next: { ...spacing, gatewayWanted: now } }
109
127
  };
110
128
  }
111
129
  const id = randomBytes(6).toString("hex");
@@ -135,23 +153,30 @@ function claimGateway(home, now, random = Math.random) {
135
153
  }
136
154
  var defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
137
155
  var RECHECK_MS = 6e4;
156
+ var CANCEL_CHECK_MS = 2e3;
138
157
  async function gatewayTurn(home, fn, options = {}) {
139
158
  const sleep = options.sleep ?? defaultSleep;
140
159
  let waited = 0;
141
160
  for (; ; ) {
142
- const claim = await claimGateway(home, Date.now(), options.random);
161
+ if (options.cancelled?.()) return void 0;
162
+ const claim = await claimGateway(home, Date.now(), options.random, options.want);
143
163
  if (typeof claim !== "number") {
144
164
  try {
145
165
  return await fn();
146
166
  } finally {
147
- await claim();
167
+ await claim().catch(() => void 0);
148
168
  }
149
169
  }
150
170
  if (waited + claim > (options.maxWaitMs ?? Number.POSITIVE_INFINITY)) return void 0;
151
171
  if (waited === 0) options.onWait?.(claim);
152
- const ms = claim + 1e3;
153
- await sleep(ms);
154
- waited += ms;
172
+ let remaining = claim + 1e3;
173
+ while (remaining > 0) {
174
+ if (options.cancelled?.()) return void 0;
175
+ const step = Math.min(remaining, CANCEL_CHECK_MS);
176
+ await sleep(step);
177
+ waited += step;
178
+ remaining -= step;
179
+ }
155
180
  }
156
181
  }
157
182
  async function awaitRedemptions(home, leaseMs, options = {}) {
@@ -2,7 +2,7 @@ import { createRequire as __patronCreateRequire } from 'node:module'
2
2
  const require = __patronCreateRequire(import.meta.url)
3
3
  import {
4
4
  MAX_TOKENS_PER_PURCHASE
5
- } from "./chunk-AKOXBXV3.js";
5
+ } from "./chunk-JTPFWITF.js";
6
6
  import {
7
7
  __export
8
8
  } from "./chunk-GTMLTZRN.js";
@@ -1032,6 +1032,7 @@ function statePaths(home) {
1032
1032
  refillWait: join(home, "refill-wait.lock"),
1033
1033
  spacing: join(home, "spacing.json"),
1034
1034
  spacingLock: join(home, "spacing.lock"),
1035
+ standing: join(home, "standing.json"),
1035
1036
  stateLock: join(home, "state.lock"),
1036
1037
  tokens: join(home, "tokens.enc"),
1037
1038
  usage: join(home, "usage.json"),
@@ -8,7 +8,7 @@ import {
8
8
  parseHookInput,
9
9
  payableDomain,
10
10
  turnEnd
11
- } from "./chunk-23MZSDN6.js";
11
+ } from "./chunk-6G6SAUGB.js";
12
12
  import {
13
13
  FileTokenStore,
14
14
  codexHome,
@@ -16,11 +16,11 @@ import {
16
16
  redeem,
17
17
  refillSize,
18
18
  storedIssuer
19
- } from "./chunk-4SXIRXUL.js";
19
+ } from "./chunk-AN64RW3X.js";
20
20
  import {
21
21
  settingsFor
22
22
  } from "./chunk-NDBTADXZ.js";
23
- import "./chunk-ROVOCDKE.js";
23
+ import "./chunk-GBZCXMDZ.js";
24
24
  import {
25
25
  clampTokensPerPage,
26
26
  readConfig,
@@ -28,7 +28,7 @@ import {
28
28
  updateUsage,
29
29
  withLock,
30
30
  writePrivateFile
31
- } from "./chunk-AKOXBXV3.js";
31
+ } from "./chunk-JTPFWITF.js";
32
32
  import "./chunk-GTMLTZRN.js";
33
33
 
34
34
  // src/hook.ts
@@ -7,19 +7,19 @@ import {
7
7
  isCursorPayload,
8
8
  parseHookInput,
9
9
  turnEnd
10
- } from "./chunk-23MZSDN6.js";
10
+ } from "./chunk-6G6SAUGB.js";
11
11
  import {
12
12
  claimRedemptions,
13
13
  redemptionWait,
14
14
  startDrain,
15
15
  startRefill
16
- } from "./chunk-TC2WEQ25.js";
16
+ } from "./chunk-D3IY3ICC.js";
17
17
  import {
18
18
  resolveSettings
19
19
  } from "./chunk-NDBTADXZ.js";
20
20
  import {
21
21
  tryLock
22
- } from "./chunk-AKOXBXV3.js";
22
+ } from "./chunk-JTPFWITF.js";
23
23
  import "./chunk-GTMLTZRN.js";
24
24
 
25
25
  // src/hook-process.ts
@@ -248,7 +248,7 @@ async function waitForHold(home) {
248
248
  }
249
249
  async function payEvent(event, settings, refill, timeoutMs) {
250
250
  if (timeoutMs <= 0) return;
251
- const { runHook } = await import("./hook-IE7INCPX.js");
251
+ const { runHook } = await import("./hook-6DQ3RLVH.js");
252
252
  await runHook(
253
253
  {
254
254
  readInput: async () => event.raw,
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __patronCreateRequire } from 'node:module'
2
2
  const require = __patronCreateRequire(import.meta.url)
3
- import "./chunk-ROVOCDKE.js";
3
+ import "./chunk-GBZCXMDZ.js";
4
4
  import {
5
5
  accessKeyLimitUnits,
6
6
  statePaths
7
- } from "./chunk-AKOXBXV3.js";
7
+ } from "./chunk-JTPFWITF.js";
8
8
  import "./chunk-GTMLTZRN.js";
9
9
 
10
10
  // src/wallet.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempoxyz/patron",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "description": "Pay the websites your AI agents read, privately",
5
5
  "type": "module",
6
6
  "bin": {