@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 +3 -3
- package/dist/chunks/{-PMO5HHO2.js → -JRJJV4LP.js} +2 -2
- package/dist/chunks/{chunk-RJRJWNSQ.js → chunk-5GS6AZ5L.js} +1 -1
- package/dist/chunks/{chunk-QKBTYUXG.js → chunk-75CD5P6X.js} +1 -1
- package/dist/chunks/{chunk-CF4LJZLC.js → chunk-WZRGCKEK.js} +8 -1
- package/dist/chunks/{hook-QEFJTAKR.js → hook-AHF4ELOX.js} +3 -3
- package/dist/chunks/{hook-process-D5ENJPRB.js → hook-process-3OTLNDSS.js} +4 -4
- package/package.json +1 -1
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-
|
|
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-
|
|
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/-
|
|
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-
|
|
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-
|
|
48
|
+
} from "./chunk-WZRGCKEK.js";
|
|
49
49
|
import {
|
|
50
50
|
AGENT_IDS,
|
|
51
51
|
ensureHome,
|
|
@@ -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
|
|
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-
|
|
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-
|
|
18
|
+
} from "./chunk-75CD5P6X.js";
|
|
19
19
|
import {
|
|
20
20
|
clampTokensPerPage,
|
|
21
21
|
settingsFor
|
|
22
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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(
|