@tempoxyz/patron 0.0.22 → 0.0.23

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
@@ -4,14 +4,14 @@ const require = __patronCreateRequire(import.meta.url)
4
4
 
5
5
  // src/bin.ts
6
6
  if (process.argv[2] === "hook") {
7
- const { runHookProcess } = await import("./chunks/hook-process-D5ENJPRB.js");
7
+ const { runHookProcess } = await import("./chunks/hook-process-3OTLNDSS.js");
8
8
  await runHookProcess().catch(() => void 0);
9
9
  process.exit(0);
10
10
  } else if (process.argv[2] === "pay") {
11
- const { runPayProcess } = await import("./chunks/hook-process-D5ENJPRB.js");
11
+ const { runPayProcess } = await import("./chunks/hook-process-3OTLNDSS.js");
12
12
  await runPayProcess().catch(() => void 0);
13
13
  process.exit(0);
14
14
  } else {
15
- const { run } = await import("./chunks/-PMO5HHO2.js");
15
+ const { run } = await import("./chunks/-JRJJV4LP.js");
16
16
  process.exitCode = await run(process.argv.slice(2));
17
17
  }
@@ -29,7 +29,7 @@ import {
29
29
  withPatronStatus,
30
30
  withoutPatronHandlers,
31
31
  writeJsonObject
32
- } from "./chunk-QKBTYUXG.js";
32
+ } from "./chunk-75CD5P6X.js";
33
33
  import {
34
34
  startRefill
35
35
  } from "./chunk-HEQBEBKL.js";
@@ -45,7 +45,7 @@ import {
45
45
  resolveSettings,
46
46
  settingsFor,
47
47
  tokensToUnits
48
- } from "./chunk-CF4LJZLC.js";
48
+ } from "./chunk-WZRGCKEK.js";
49
49
  import {
50
50
  AGENT_IDS,
51
51
  ensureHome,
@@ -3,7 +3,7 @@ const require = __patronCreateRequire(import.meta.url)
3
3
  import {
4
4
  isExcludedByDefault,
5
5
  normalizePayee
6
- } from "./chunk-CF4LJZLC.js";
6
+ } from "./chunk-WZRGCKEK.js";
7
7
 
8
8
  // src/hook-input.ts
9
9
  var HOOK_TIMEOUT_MS = 2e3;
@@ -8,7 +8,7 @@ import {
8
8
  TOKEN_TYPE,
9
9
  fromBase64Url,
10
10
  toBase64Url
11
- } from "./chunk-CF4LJZLC.js";
11
+ } from "./chunk-WZRGCKEK.js";
12
12
  import {
13
13
  ensureHome,
14
14
  readJson,
@@ -849,9 +849,16 @@ function normalizeDomain(input) {
849
849
  if (!hostname || hostname === "localhost" || hostname.endsWith(".localhost"))
850
850
  return null;
851
851
  const parsed = (0, import_tldts.parse)(hostname, { allowPrivateDomains: true });
852
- if (parsed.isIp || !parsed.domain || !(parsed.isIcann || parsed.isPrivate)) return null;
852
+ if (parsed.isIp) return null;
853
+ if (isEnsGatewayName(hostname)) return hostname;
854
+ if (!parsed.domain || !(parsed.isIcann || parsed.isPrivate)) return null;
853
855
  return authorSite(hostname, parsed.domain) ?? parsed.domain;
854
856
  }
857
+ var ENS_GATEWAYS = /* @__PURE__ */ new Set(["eth.limo", "eth.link"]);
858
+ function isEnsGatewayName(hostname) {
859
+ const dot = hostname.indexOf(".");
860
+ return dot > 0 && ENS_GATEWAYS.has(hostname.slice(dot + 1));
861
+ }
855
862
  function authorSite(hostname, domain) {
856
863
  if (!AUTHOR_PLATFORMS.has(domain)) return null;
857
864
  const author = hostname.slice(0, -(domain.length + 1)).split(".").at(-1);
@@ -7,7 +7,7 @@ import {
7
7
  parseHookInput,
8
8
  payableDomain,
9
9
  turnEnd
10
- } from "./chunk-RJRJWNSQ.js";
10
+ } from "./chunk-5GS6AZ5L.js";
11
11
  import {
12
12
  FileTokenStore,
13
13
  codexHome,
@@ -15,11 +15,11 @@ import {
15
15
  needsRefill,
16
16
  redeem,
17
17
  refillSize
18
- } from "./chunk-QKBTYUXG.js";
18
+ } from "./chunk-75CD5P6X.js";
19
19
  import {
20
20
  clampTokensPerPage,
21
21
  settingsFor
22
- } from "./chunk-CF4LJZLC.js";
22
+ } from "./chunk-WZRGCKEK.js";
23
23
  import {
24
24
  readConfig,
25
25
  readUsage,
@@ -6,14 +6,14 @@ import {
6
6
  isCursorPayload,
7
7
  parseHookInput,
8
8
  turnEnd
9
- } from "./chunk-RJRJWNSQ.js";
9
+ } from "./chunk-5GS6AZ5L.js";
10
10
  import {
11
11
  startPayment,
12
12
  startRefill
13
13
  } from "./chunk-HEQBEBKL.js";
14
14
  import {
15
15
  resolveSettings
16
- } from "./chunk-CF4LJZLC.js";
16
+ } from "./chunk-WZRGCKEK.js";
17
17
  import "./chunk-GTMLTZRN.js";
18
18
 
19
19
  // src/hook-process.ts
@@ -25,7 +25,7 @@ async function runHookProcess(argument = process.argv[3]) {
25
25
  if (isCursorPayload(payload)) process.stdout.write("{}\n");
26
26
  if (!turnEnd(payload) && hookDomains(payload).length === 0) return;
27
27
  if (await startPayment(raw)) return;
28
- const { runHook } = await import("./hook-QEFJTAKR.js");
28
+ const { runHook } = await import("./hook-AHF4ELOX.js");
29
29
  await runHook({
30
30
  readInput: async () => raw,
31
31
  settings: resolveSettings(),
@@ -33,7 +33,7 @@ async function runHookProcess(argument = process.argv[3]) {
33
33
  });
34
34
  }
35
35
  async function runPayProcess() {
36
- const { PAY_TIMEOUT_MS, runHook } = await import("./hook-QEFJTAKR.js");
36
+ const { PAY_TIMEOUT_MS, runHook } = await import("./hook-AHF4ELOX.js");
37
37
  setTimeout(() => process.exit(0), PAY_TIMEOUT_MS + 1e3).unref();
38
38
  const raw = await readStdin(HOOK_TIMEOUT_MS);
39
39
  await runHook(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempoxyz/patron",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "Pay the websites your AI agents read, privately",
5
5
  "type": "module",
6
6
  "bin": {