tenjin-cli 0.1.0-alpha.0 → 0.1.0-alpha.2

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 (138) hide show
  1. package/NOTICE.md +33 -0
  2. package/README.md +198 -18
  3. package/dist/{_esm-ZH2J4QEH.js → _esm-C5CRWCYU.js} +2 -2
  4. package/dist/_esm-FEASBWRP.js +881 -0
  5. package/dist/buy-U35DQ6XM.js +1598 -0
  6. package/dist/buy-U35DQ6XM.js.map +1 -0
  7. package/dist/candidate-RLYCQMF5.js +127 -0
  8. package/dist/candidate-RLYCQMF5.js.map +1 -0
  9. package/dist/{ccip-FXWZDDF5.js → ccip-NQXCEK2U.js} +6 -5
  10. package/dist/ccip-XR5NE5QK.js +19 -0
  11. package/dist/chunk-27ONARHV.js +171 -0
  12. package/dist/chunk-27ONARHV.js.map +1 -0
  13. package/dist/chunk-2I4QTOLB.js +11 -0
  14. package/dist/chunk-2I4QTOLB.js.map +1 -0
  15. package/dist/chunk-3OV7E5G5.js +18 -0
  16. package/dist/chunk-3OV7E5G5.js.map +1 -0
  17. package/dist/chunk-5CLSD5YN.js +209 -0
  18. package/dist/chunk-5CLSD5YN.js.map +1 -0
  19. package/dist/chunk-7KUW4MJD.js +59 -0
  20. package/dist/chunk-7KUW4MJD.js.map +1 -0
  21. package/dist/{doctor-MVLZRVPU.js → chunk-7PHSZKQS.js} +88 -93
  22. package/dist/chunk-7PHSZKQS.js.map +1 -0
  23. package/dist/chunk-CYOF7ROH.js +70 -0
  24. package/dist/chunk-CYOF7ROH.js.map +1 -0
  25. package/dist/chunk-HIVZG55D.js +204 -0
  26. package/dist/chunk-HIVZG55D.js.map +1 -0
  27. package/dist/chunk-HSDCI7OV.js +7806 -0
  28. package/dist/chunk-HSDCI7OV.js.map +1 -0
  29. package/dist/{chunk-LTTRND4A.js → chunk-IYLHQMT5.js} +85 -9
  30. package/dist/chunk-IYLHQMT5.js.map +1 -0
  31. package/dist/chunk-JPHG2JW3.js +96 -0
  32. package/dist/chunk-JPHG2JW3.js.map +1 -0
  33. package/dist/{chunk-ZPZFPVDN.js → chunk-MUBUQVC3.js} +1 -1
  34. package/dist/chunk-MUBUQVC3.js.map +1 -0
  35. package/dist/chunk-N62ROTMC.js +79 -0
  36. package/dist/chunk-N62ROTMC.js.map +1 -0
  37. package/dist/{chunk-SXQQ2ZSR.js → chunk-NCE5NSN6.js} +186 -18
  38. package/dist/chunk-NCE5NSN6.js.map +1 -0
  39. package/dist/{chunk-FIYZLITH.js → chunk-OYMYCW7J.js} +23 -4
  40. package/dist/{chunk-FIYZLITH.js.map → chunk-OYMYCW7J.js.map} +1 -1
  41. package/dist/chunk-QNP7H47L.js +152 -0
  42. package/dist/chunk-QNP7H47L.js.map +1 -0
  43. package/dist/{chunk-TX5T3LKJ.js → chunk-QVX5MWJZ.js} +21 -17
  44. package/dist/{chunk-TX5T3LKJ.js.map → chunk-QVX5MWJZ.js.map} +1 -1
  45. package/dist/{chunk-CPUZRZ2A.js → chunk-RBJPAZFI.js} +25 -170
  46. package/dist/chunk-RBJPAZFI.js.map +1 -0
  47. package/dist/chunk-RRN3YTK7.js +6199 -0
  48. package/dist/chunk-RRN3YTK7.js.map +1 -0
  49. package/dist/chunk-RY4XKNV3.js +140 -0
  50. package/dist/chunk-RY4XKNV3.js.map +1 -0
  51. package/dist/chunk-S3IGX57D.js +14682 -0
  52. package/dist/chunk-S3IGX57D.js.map +1 -0
  53. package/dist/{config-XVXZ3V2Q.js → chunk-TFGSOPWR.js} +117 -62
  54. package/dist/chunk-TFGSOPWR.js.map +1 -0
  55. package/dist/chunk-TLCMMYLY.js +126 -0
  56. package/dist/chunk-TLCMMYLY.js.map +1 -0
  57. package/dist/{chunk-PAAL45FJ.js → chunk-UGX7YPX2.js} +3446 -448
  58. package/dist/chunk-UGX7YPX2.js.map +1 -0
  59. package/dist/chunk-UO22YNY4.js +69 -0
  60. package/dist/chunk-UO22YNY4.js.map +1 -0
  61. package/dist/chunk-UPIEAMGH.js +160 -0
  62. package/dist/chunk-UPIEAMGH.js.map +1 -0
  63. package/dist/chunk-XJIW7USF.js +217 -0
  64. package/dist/chunk-XJIW7USF.js.map +1 -0
  65. package/dist/{chunk-F5DZJLU3.js → chunk-YALGASEU.js} +2065 -1258
  66. package/dist/chunk-YALGASEU.js.map +1 -0
  67. package/dist/chunk-YBMMV4Y4.js +51 -0
  68. package/dist/chunk-YBMMV4Y4.js.map +1 -0
  69. package/dist/chunk-YIYQ2ZNT.js +286 -0
  70. package/dist/chunk-YIYQ2ZNT.js.map +1 -0
  71. package/dist/{chunk-376LHMK2.js → chunk-YN5SHIXQ.js} +36 -10
  72. package/dist/chunk-YN5SHIXQ.js.map +1 -0
  73. package/dist/chunk-Z52RA3NC.js +137 -0
  74. package/dist/chunk-Z52RA3NC.js.map +1 -0
  75. package/dist/chunk-Z6MFJV5Z.js +1330 -0
  76. package/dist/chunk-Z6MFJV5Z.js.map +1 -0
  77. package/dist/chunk-ZABPQJ3M.js +83 -0
  78. package/dist/chunk-ZABPQJ3M.js.map +1 -0
  79. package/dist/{chunk-WOHCAMDQ.js → chunk-ZMHYXMO6.js} +1887 -1029
  80. package/dist/chunk-ZMHYXMO6.js.map +1 -0
  81. package/dist/{chunk-3IMLRUZE.js → chunk-ZXTAQYNA.js} +6 -2
  82. package/dist/{cli-LMHGCZ5S.js → cli-4NNBEQYH.js} +175 -179
  83. package/dist/cli-4NNBEQYH.js.map +1 -0
  84. package/dist/config-2VSXWWHK.js +21 -0
  85. package/dist/doctor-JJPNIBYH.js +20 -0
  86. package/dist/doctor-JJPNIBYH.js.map +1 -0
  87. package/dist/ethersCompat-Df4a6QIZ-3YZIAXDK.js +18 -0
  88. package/dist/ethersCompat-Df4a6QIZ-3YZIAXDK.js.map +1 -0
  89. package/dist/index.js +1 -1
  90. package/dist/inspect-JGYJWFDP.js +96 -0
  91. package/dist/inspect-JGYJWFDP.js.map +1 -0
  92. package/dist/install-ZQRMSRGW.js +378 -0
  93. package/dist/install-ZQRMSRGW.js.map +1 -0
  94. package/dist/lookup-WYVTOMVY.js +113 -0
  95. package/dist/lookup-WYVTOMVY.js.map +1 -0
  96. package/dist/{mine.wasm-GQECMSGN.js → mine.wasm-6PIT3DK6.js} +2 -2
  97. package/dist/outcome-HKKT6QIA.js +66 -0
  98. package/dist/outcome-HKKT6QIA.js.map +1 -0
  99. package/dist/publish-D76B3MBK.js +1480 -0
  100. package/dist/publish-D76B3MBK.js.map +1 -0
  101. package/dist/{secp256k1-35YNNB6F.js → secp256k1-N3ZHU7LB.js} +5 -4
  102. package/dist/secp256k1-N3ZHU7LB.js.map +1 -0
  103. package/dist/usdc-JIAJW4SV.js +22 -0
  104. package/dist/usdc-JIAJW4SV.js.map +1 -0
  105. package/dist/viemAdapter-By13KInL-ZZE6UV4Y.js +14 -0
  106. package/dist/viemAdapter-By13KInL-ZZE6UV4Y.js.map +1 -0
  107. package/dist/wallet-6QKS6UHW.js +179 -0
  108. package/dist/wallet-6QKS6UHW.js.map +1 -0
  109. package/dist/wallet-PA54CRBL.js +30 -0
  110. package/dist/wallet-PA54CRBL.js.map +1 -0
  111. package/package.json +20 -15
  112. package/skills/tenjin/SKILL.md +199 -0
  113. package/skills/tenjin-publish/SKILL.md +96 -0
  114. package/skills/tenjin-search/SKILL.md +122 -0
  115. package/dist/chunk-376LHMK2.js.map +0 -1
  116. package/dist/chunk-CPUZRZ2A.js.map +0 -1
  117. package/dist/chunk-F5DZJLU3.js.map +0 -1
  118. package/dist/chunk-LTTRND4A.js.map +0 -1
  119. package/dist/chunk-PAAL45FJ.js.map +0 -1
  120. package/dist/chunk-QHIEYBLV.js +0 -320
  121. package/dist/chunk-QHIEYBLV.js.map +0 -1
  122. package/dist/chunk-SXQQ2ZSR.js.map +0 -1
  123. package/dist/chunk-WOHCAMDQ.js.map +0 -1
  124. package/dist/chunk-ZPZFPVDN.js.map +0 -1
  125. package/dist/cli-LMHGCZ5S.js.map +0 -1
  126. package/dist/config-XVXZ3V2Q.js.map +0 -1
  127. package/dist/doctor-MVLZRVPU.js.map +0 -1
  128. package/dist/usdc-OQUOFF6R.js +0 -18
  129. package/dist/wallet-NRKWLKHX.js +0 -153
  130. package/dist/wallet-NRKWLKHX.js.map +0 -1
  131. package/dist/wallet-QUWK2PA4.js +0 -22
  132. /package/dist/{_esm-ZH2J4QEH.js.map → _esm-C5CRWCYU.js.map} +0 -0
  133. /package/dist/{ccip-FXWZDDF5.js.map → _esm-FEASBWRP.js.map} +0 -0
  134. /package/dist/{chunk-3IMLRUZE.js.map → ccip-NQXCEK2U.js.map} +0 -0
  135. /package/dist/{secp256k1-35YNNB6F.js.map → ccip-XR5NE5QK.js.map} +0 -0
  136. /package/dist/{usdc-OQUOFF6R.js.map → chunk-ZXTAQYNA.js.map} +0 -0
  137. /package/dist/{wallet-QUWK2PA4.js.map → config-2VSXWWHK.js.map} +0 -0
  138. /package/dist/{mine.wasm-GQECMSGN.js.map → mine.wasm-6PIT3DK6.js.map} +0 -0
@@ -0,0 +1,152 @@
1
+ import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
+ import {
3
+ package_default
4
+ } from "./chunk-N62ROTMC.js";
5
+
6
+ // src/lib/http.ts
7
+ async function fetchJson(url, opts) {
8
+ const doFetch = opts.fetchImpl ?? fetch;
9
+ const controller = new AbortController();
10
+ let timedOut = false;
11
+ const timer = setTimeout(() => {
12
+ timedOut = true;
13
+ controller.abort();
14
+ }, opts.timeoutMs);
15
+ try {
16
+ let res;
17
+ try {
18
+ res = await doFetch(url, {
19
+ signal: controller.signal,
20
+ ...opts.headers !== void 0 ? { headers: opts.headers } : {}
21
+ });
22
+ } catch (err) {
23
+ return timedOut ? timeoutFailure(url, opts.timeoutMs) : { ok: false, kind: "network", message: `Request to ${url} failed: ${errorMessage(err)}` };
24
+ }
25
+ const requestId = res.headers.get("x-request-id") ?? void 0;
26
+ if (!res.ok) {
27
+ return {
28
+ ok: false,
29
+ kind: "http",
30
+ status: res.status,
31
+ ...requestId !== void 0 ? { requestId } : {},
32
+ message: `Request to ${url} failed with status ${res.status}`
33
+ };
34
+ }
35
+ let json;
36
+ try {
37
+ json = await res.json();
38
+ } catch (err) {
39
+ if (timedOut) return timeoutFailure(url, opts.timeoutMs);
40
+ if (err instanceof SyntaxError) {
41
+ return {
42
+ ok: false,
43
+ kind: "invalid-json",
44
+ status: res.status,
45
+ ...requestId !== void 0 ? { requestId } : {},
46
+ message: `Response from ${url} was not valid JSON`
47
+ };
48
+ }
49
+ return {
50
+ ok: false,
51
+ kind: "network",
52
+ status: res.status,
53
+ ...requestId !== void 0 ? { requestId } : {},
54
+ message: `Request to ${url} failed while reading the response body: ${errorMessage(err)}`
55
+ };
56
+ }
57
+ return {
58
+ ok: true,
59
+ status: res.status,
60
+ json,
61
+ ...requestId !== void 0 ? { requestId } : {}
62
+ };
63
+ } finally {
64
+ clearTimeout(timer);
65
+ }
66
+ }
67
+ function timeoutFailure(url, timeoutMs) {
68
+ return {
69
+ ok: false,
70
+ kind: "timeout",
71
+ message: `Request to ${url} timed out after ${timeoutMs}ms`
72
+ };
73
+ }
74
+ async function httpRequest(url, opts) {
75
+ const doFetch = opts.fetchImpl ?? fetch;
76
+ const controller = new AbortController();
77
+ let timedOut = false;
78
+ const timer = setTimeout(() => {
79
+ timedOut = true;
80
+ controller.abort();
81
+ }, opts.timeoutMs);
82
+ try {
83
+ const headers = { ...opts.headers ?? {} };
84
+ let body;
85
+ if (opts.jsonBody !== void 0) {
86
+ body = JSON.stringify(opts.jsonBody);
87
+ headers["content-type"] = "application/json";
88
+ }
89
+ if (opts.method === "POST" || body !== void 0) headers["accept"] ??= "application/json";
90
+ let res;
91
+ try {
92
+ res = await doFetch(url, {
93
+ method: opts.method ?? "GET",
94
+ headers,
95
+ body,
96
+ signal: controller.signal
97
+ });
98
+ } catch (err) {
99
+ return timedOut ? timeoutFailure(url, opts.timeoutMs) : { ok: false, kind: "network", message: `Request to ${url} failed: ${errorMessage(err)}` };
100
+ }
101
+ const requestId = res.headers.get("x-request-id") ?? void 0;
102
+ let text;
103
+ try {
104
+ text = await res.text();
105
+ } catch (err) {
106
+ if (timedOut) return timeoutFailure(url, opts.timeoutMs);
107
+ return {
108
+ ok: false,
109
+ kind: "network",
110
+ status: res.status,
111
+ ...requestId !== void 0 ? { requestId } : {},
112
+ message: `Request to ${url} failed while reading the response body: ${errorMessage(err)}`
113
+ };
114
+ }
115
+ let json;
116
+ if (text.length > 0) {
117
+ try {
118
+ json = JSON.parse(text);
119
+ } catch {
120
+ json = void 0;
121
+ }
122
+ }
123
+ return {
124
+ ok: true,
125
+ status: res.status,
126
+ header: (name) => res.headers.get(name) ?? void 0,
127
+ json,
128
+ ...requestId !== void 0 ? { requestId } : {}
129
+ };
130
+ } finally {
131
+ clearTimeout(timer);
132
+ }
133
+ }
134
+ function errorMessage(err) {
135
+ return err instanceof Error ? err.message : String(err);
136
+ }
137
+
138
+ // src/lib/client-meta.ts
139
+ var CLIENT_HEADER = `tenjin-cli/${package_default.version}`;
140
+
141
+ // src/lib/url.ts
142
+ function trimSlash(url) {
143
+ return url.replace(/\/+$/, "");
144
+ }
145
+
146
+ export {
147
+ fetchJson,
148
+ httpRequest,
149
+ CLIENT_HEADER,
150
+ trimSlash
151
+ };
152
+ //# sourceMappingURL=chunk-QNP7H47L.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/http.ts","../src/lib/client-meta.ts","../src/lib/url.ts"],"sourcesContent":["import { CliError } from './errors';\n\n/**\n * The single JSON client the whole CLI grows on: `doctor` uses it in B1, `lookup`\n * reuses it in B2. It never throws on a transport/protocol failure — it returns a\n * discriminated result so callers decide how each failure class maps to a check\n * or an error. `fetchImpl` is injectable so tests never touch the network.\n */\nexport interface FetchJsonOptions {\n /** Abort the request after this many milliseconds. */\n timeoutMs: number;\n /** Override global fetch (tests inject a stub returning canned Responses). */\n fetchImpl?: typeof fetch;\n /** Optional request headers (doctor sends the X-Tenjin-Client label). */\n headers?: Record<string, string>;\n}\n\n/** A successful 2xx whose body parsed as JSON. */\nexport interface FetchJsonSuccess {\n ok: true;\n status: number;\n json: unknown;\n /** The server's `x-request-id`, when it sent one — useful in error reports. */\n requestId?: string;\n}\n\n/**\n * A failed request, tagged by class so the caller maps it deliberately:\n * `network`/`timeout` (never reached the server or no answer), `http` (a non-2xx\n * status), `invalid-json` (2xx but the body was not JSON).\n */\nexport interface FetchJsonFailure {\n ok: false;\n kind: 'network' | 'timeout' | 'http' | 'invalid-json';\n status?: number;\n requestId?: string;\n message: string;\n}\n\nexport type FetchJsonResult = FetchJsonSuccess | FetchJsonFailure;\n\nexport async function fetchJson(url: string, opts: FetchJsonOptions): Promise<FetchJsonResult> {\n const doFetch = opts.fetchImpl ?? fetch;\n const controller = new AbortController();\n let timedOut = false;\n // The timer stays armed until the body is fully consumed (cleared in the outer\n // finally), so a server that sends headers then stalls the body still trips the\n // deadline instead of hanging forever on res.json().\n const timer = setTimeout(() => {\n timedOut = true;\n controller.abort();\n }, opts.timeoutMs);\n\n try {\n let res: Response;\n try {\n res = await doFetch(url, {\n signal: controller.signal,\n ...(opts.headers !== undefined ? { headers: opts.headers } : {}),\n });\n } catch (err) {\n // A timeout is a network failure the AbortController induced; distinguish it\n // from an organic one so the caller can say \"timed out\" rather than a raw\n // AbortError message.\n return timedOut\n ? timeoutFailure(url, opts.timeoutMs)\n : { ok: false, kind: 'network', message: `Request to ${url} failed: ${errorMessage(err)}` };\n }\n\n const requestId = res.headers.get('x-request-id') ?? undefined;\n\n if (!res.ok) {\n return {\n ok: false,\n kind: 'http',\n status: res.status,\n ...(requestId !== undefined ? { requestId } : {}),\n message: `Request to ${url} failed with status ${res.status}`,\n };\n }\n\n let json: unknown;\n try {\n json = await res.json();\n } catch (err) {\n // The body read can fail three ways. A timeout wins first: the abort fires\n // synchronously with `timedOut`, so any abort-induced rejection here is our\n // deadline. Otherwise a SyntaxError is a genuine parse failure (invalid\n // JSON); anything else is a transport failure mid-body (network).\n if (timedOut) return timeoutFailure(url, opts.timeoutMs);\n if (err instanceof SyntaxError) {\n return {\n ok: false,\n kind: 'invalid-json',\n status: res.status,\n ...(requestId !== undefined ? { requestId } : {}),\n message: `Response from ${url} was not valid JSON`,\n };\n }\n return {\n ok: false,\n kind: 'network',\n status: res.status,\n ...(requestId !== undefined ? { requestId } : {}),\n message: `Request to ${url} failed while reading the response body: ${errorMessage(err)}`,\n };\n }\n\n return {\n ok: true,\n status: res.status,\n json,\n ...(requestId !== undefined ? { requestId } : {}),\n };\n } finally {\n clearTimeout(timer);\n }\n}\n\nfunction timeoutFailure(url: string, timeoutMs: number): FetchJsonFailure {\n return {\n ok: false,\n kind: 'timeout',\n message: `Request to ${url} timed out after ${timeoutMs}ms`,\n };\n}\n\n/**\n * A full HTTP round trip that surfaces the STATUS, headers, and best-effort JSON\n * body for ANY status. Unlike fetchJson (2xx-only), the B2 read/pay flow needs\n * the body on a 402 (the leak-safe preview) and a 409 (the owned-re-pay gate),\n * and lookup/outcome need a 4xx validation envelope. A transport/timeout failure\n * still returns the discriminated FetchJsonFailure so callers map it uniformly.\n */\nexport interface HttpRequestOptions {\n method?: 'GET' | 'POST';\n timeoutMs: number;\n headers?: Record<string, string>;\n /** A JSON body (POST); serialized with a content-type header set automatically. */\n jsonBody?: unknown;\n fetchImpl?: typeof fetch;\n}\n\nexport interface HttpResponse {\n ok: true;\n status: number;\n /** Case-insensitive header lookup over the response. */\n header(name: string): string | undefined;\n /** Parsed JSON body, or undefined when the body was empty or not JSON. */\n json: unknown;\n requestId?: string;\n}\n\nexport type HttpResult = HttpResponse | FetchJsonFailure;\n\nexport async function httpRequest(url: string, opts: HttpRequestOptions): Promise<HttpResult> {\n const doFetch = opts.fetchImpl ?? fetch;\n const controller = new AbortController();\n let timedOut = false;\n const timer = setTimeout(() => {\n timedOut = true;\n controller.abort();\n }, opts.timeoutMs);\n\n try {\n const headers: Record<string, string> = { ...(opts.headers ?? {}) };\n let body: string | undefined;\n if (opts.jsonBody !== undefined) {\n body = JSON.stringify(opts.jsonBody);\n headers['content-type'] = 'application/json';\n }\n if (opts.method === 'POST' || body !== undefined) headers['accept'] ??= 'application/json';\n\n let res: Response;\n try {\n res = await doFetch(url, {\n method: opts.method ?? 'GET',\n headers,\n body,\n signal: controller.signal,\n });\n } catch (err) {\n return timedOut\n ? timeoutFailure(url, opts.timeoutMs)\n : { ok: false, kind: 'network', message: `Request to ${url} failed: ${errorMessage(err)}` };\n }\n\n const requestId = res.headers.get('x-request-id') ?? undefined;\n // Read the raw text once; parse best-effort. A non-JSON body (empty 202, an\n // HTML error page) yields `undefined` rather than a thrown parse, because a\n // 402/409 caller keys off the STATUS and only some statuses carry JSON.\n let text: string;\n try {\n text = await res.text();\n } catch (err) {\n if (timedOut) return timeoutFailure(url, opts.timeoutMs);\n return {\n ok: false,\n kind: 'network',\n status: res.status,\n ...(requestId !== undefined ? { requestId } : {}),\n message: `Request to ${url} failed while reading the response body: ${errorMessage(err)}`,\n };\n }\n let json: unknown;\n if (text.length > 0) {\n try {\n json = JSON.parse(text);\n } catch {\n json = undefined;\n }\n }\n return {\n ok: true,\n status: res.status,\n header: (name) => res.headers.get(name) ?? undefined,\n json,\n ...(requestId !== undefined ? { requestId } : {}),\n };\n } finally {\n clearTimeout(timer);\n }\n}\n\nexport interface FailureToCliErrorOptions {\n fix?: string;\n details?: unknown;\n}\n\n/**\n * Normalize a fetch failure into the CLI error contract: network/timeout are a\n * NETWORK_ERROR, an `http` status (server reachable but errored — commonly 5xx)\n * is API_UNREACHABLE, and a 2xx that failed to parse when JSON was required is a\n * CONTRACT_MISMATCH. Callers that need a check-specific code (doctor) build their\n * own CliError; this is the default B2's passthrough leans on.\n */\nexport function fetchFailureToCliError(\n failure: FetchJsonFailure,\n opts: FailureToCliErrorOptions = {},\n): CliError {\n const code =\n failure.kind === 'network' || failure.kind === 'timeout'\n ? 'NETWORK_ERROR'\n : failure.kind === 'invalid-json'\n ? 'CONTRACT_MISMATCH'\n : 'API_UNREACHABLE';\n return new CliError(code, failure.message, {\n ...(opts.fix !== undefined ? { fix: opts.fix } : {}),\n ...(opts.details !== undefined ? { details: opts.details } : {}),\n });\n}\n\nfunction errorMessage(err: unknown): string {\n return err instanceof Error ? err.message : String(err);\n}\n","import pkg from '../../package.json';\n\n/**\n * The `X-Tenjin-Client` value on every B2 request (spec 09 §purchase-attribution):\n * the server classifies views/payments by this label, so a CLI lookup-flow\n * purchase is never mixed with a web checkout. Format `tenjin-cli/<version>`.\n */\nexport const CLIENT_HEADER = `tenjin-cli/${pkg.version}`;\n","/** Drop trailing slashes from a base URL so `${base}/path` never doubles a slash. */\nexport function trimSlash(url: string): string {\n return url.replace(/\\/+$/, '');\n}\n"],"mappings":";;;;;;AAyCA,eAAsB,UAAU,KAAa,MAAkD;AAC7F,QAAM,UAAU,KAAK,aAAa;AAClC,QAAM,aAAa,IAAI,gBAAgB;AACvC,MAAI,WAAW;AAIf,QAAM,QAAQ,WAAW,MAAM;AAC7B,eAAW;AACX,eAAW,MAAM;AAAA,EACnB,GAAG,KAAK,SAAS;AAEjB,MAAI;AACF,QAAI;AACJ,QAAI;AACF,YAAM,MAAM,QAAQ,KAAK;AAAA,QACvB,QAAQ,WAAW;AAAA,QACnB,GAAI,KAAK,YAAY,SAAY,EAAE,SAAS,KAAK,QAAQ,IAAI,CAAC;AAAA,MAChE,CAAC;AAAA,IACH,SAAS,KAAK;AAIZ,aAAO,WACH,eAAe,KAAK,KAAK,SAAS,IAClC,EAAE,IAAI,OAAO,MAAM,WAAW,SAAS,cAAc,GAAG,YAAY,aAAa,GAAG,CAAC,GAAG;AAAA,IAC9F;AAEA,UAAM,YAAY,IAAI,QAAQ,IAAI,cAAc,KAAK;AAErD,QAAI,CAAC,IAAI,IAAI;AACX,aAAO;AAAA,QACL,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,QAAQ,IAAI;AAAA,QACZ,GAAI,cAAc,SAAY,EAAE,UAAU,IAAI,CAAC;AAAA,QAC/C,SAA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KAAsB;AAC1C,SAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AACxD;;;ACvPO,IAAM,gBAAgB,cAAc,gBAAI,OAAO;;;ACN/C,SAAS,UAAU,KAAqB;AAC7C,SAAO,IAAI,QAAQ,QAAQ,EAAE;AAC/B;","names":[]}
@@ -1,25 +1,15 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
2
  import {
3
- Hash,
4
3
  aInRange,
5
4
  abool,
6
- abytes,
7
- abytes2,
8
- aexists,
9
- ahash,
10
- anumber,
11
- aoutput,
5
+ abytes as abytes2,
12
6
  bitLen,
13
7
  bitMask,
14
8
  bytesToHex,
15
9
  bytesToNumberBE,
16
10
  bytesToNumberLE,
17
- clean,
18
- concatBytes,
19
- concatBytes2,
20
- createHasher,
11
+ concatBytes as concatBytes2,
21
12
  createHmacDrbg,
22
- createView,
23
13
  ensureBytes,
24
14
  hexToBytes,
25
15
  inRange,
@@ -28,12 +18,24 @@ import {
28
18
  numberToBytesBE,
29
19
  numberToBytesLE,
30
20
  numberToHexUnpadded,
31
- randomBytes,
32
- rotr,
33
- toBytes,
34
21
  utf8ToBytes,
35
22
  validateObject
36
- } from "./chunk-CPUZRZ2A.js";
23
+ } from "./chunk-RBJPAZFI.js";
24
+ import {
25
+ Hash,
26
+ abytes,
27
+ aexists,
28
+ ahash,
29
+ anumber,
30
+ aoutput,
31
+ clean,
32
+ concatBytes,
33
+ createHasher,
34
+ createView,
35
+ randomBytes,
36
+ rotr,
37
+ toBytes
38
+ } from "./chunk-5CLSD5YN.js";
37
39
 
38
40
  // node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js
39
41
  function setBigUint64(view, byteOffset, value, isLE) {
@@ -2230,7 +2232,9 @@ var hashToCurve = /* @__PURE__ */ (() => secp256k1_hasher.hashToCurve)();
2230
2232
  var encodeToCurve = /* @__PURE__ */ (() => secp256k1_hasher.encodeToCurve)();
2231
2233
 
2232
2234
  export {
2235
+ HashMD,
2233
2236
  sha256,
2237
+ hmac,
2234
2238
  secp256k1,
2235
2239
  schnorr,
2236
2240
  secp256k1_hasher,
@@ -2246,4 +2250,4 @@ export {
2246
2250
  @noble/curves/esm/secp256k1.js:
2247
2251
  (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
2248
2252
  */
2249
- //# sourceMappingURL=chunk-TX5T3LKJ.js.map
2253
+ //# sourceMappingURL=chunk-QVX5MWJZ.js.map