tenjin-cli 0.1.0-alpha.3 → 0.1.0-alpha.4

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 (132) hide show
  1. package/README.md +156 -188
  2. package/dist/{_esm-FEASBWRP.js → _esm-N4KAVXQR.js} +9 -9
  3. package/dist/buy-OOOLUDND.js +41 -0
  4. package/dist/candidate-TWCWTFGA.js +22 -0
  5. package/dist/{ccip-XR5NE5QK.js → ccip-RPPPKTJR.js} +5 -5
  6. package/dist/{ccip-NQXCEK2U.js → ccip-ZGGWQN4X.js} +4 -4
  7. package/dist/{chunk-XJIW7USF.js → chunk-333FOTUJ.js} +5 -5
  8. package/dist/{chunk-YALGASEU.js → chunk-47PP7TAG.js} +1610 -1610
  9. package/dist/chunk-47PP7TAG.js.map +1 -0
  10. package/dist/{buy-EE6SEXP6.js → chunk-4GR7DGD6.js} +23 -41
  11. package/dist/{buy-EE6SEXP6.js.map → chunk-4GR7DGD6.js.map} +1 -1
  12. package/dist/{chunk-DXTQ3CSI.js → chunk-5JH7ZB6Z.js} +7 -7
  13. package/dist/{chunk-DXTQ3CSI.js.map → chunk-5JH7ZB6Z.js.map} +1 -1
  14. package/dist/{chunk-OYMYCW7J.js → chunk-6WWVYYSB.js} +32 -2
  15. package/dist/{chunk-OYMYCW7J.js.map → chunk-6WWVYYSB.js.map} +1 -1
  16. package/dist/{chunk-UGX7YPX2.js → chunk-7FK2UN2T.js} +65 -65
  17. package/dist/{chunk-UGX7YPX2.js.map → chunk-7FK2UN2T.js.map} +1 -1
  18. package/dist/{chunk-ESPNTPQ2.js → chunk-BXUS5UCT.js} +9 -4
  19. package/dist/{chunk-ESPNTPQ2.js.map → chunk-BXUS5UCT.js.map} +1 -1
  20. package/dist/{chunk-4ONXEEQL.js → chunk-C4TIWOAM.js} +2 -2
  21. package/dist/{chunk-4ONXEEQL.js.map → chunk-C4TIWOAM.js.map} +1 -1
  22. package/dist/{chunk-AWPAWHNX.js → chunk-CJU555P5.js} +24 -24
  23. package/dist/{chunk-AWPAWHNX.js.map → chunk-CJU555P5.js.map} +1 -1
  24. package/dist/{chunk-YN5SHIXQ.js → chunk-DPET3TW5.js} +2 -2
  25. package/dist/{chunk-TLCMMYLY.js → chunk-DPUMEMGM.js} +5 -5
  26. package/dist/chunk-DPUMEMGM.js.map +1 -0
  27. package/dist/{chunk-XHC6FCGZ.js → chunk-EUQN3L5X.js} +9 -9
  28. package/dist/{chunk-XHC6FCGZ.js.map → chunk-EUQN3L5X.js.map} +1 -1
  29. package/dist/{chunk-GO75V3NZ.js → chunk-FHB3VKZW.js} +6 -6
  30. package/dist/{chunk-GO75V3NZ.js.map → chunk-FHB3VKZW.js.map} +1 -1
  31. package/dist/{chunk-S3IGX57D.js → chunk-FU6MCSLG.js} +9 -9
  32. package/dist/{lookup-ZPN2Q67N.js → chunk-H5ETJRQD.js} +40 -31
  33. package/dist/chunk-H5ETJRQD.js.map +1 -0
  34. package/dist/chunk-KXIX7YDV.js +59 -0
  35. package/dist/chunk-KXIX7YDV.js.map +1 -0
  36. package/dist/{chunk-5CLSD5YN.js → chunk-KYQVEKP5.js} +7 -7
  37. package/dist/{chunk-RRN3YTK7.js → chunk-KZAAWQNP.js} +3 -3
  38. package/dist/{chunk-NCE5NSN6.js → chunk-M2O56UK7.js} +158 -158
  39. package/dist/chunk-M2O56UK7.js.map +1 -0
  40. package/dist/{chunk-7KUW4MJD.js → chunk-MM4TGTST.js} +6 -6
  41. package/dist/{chunk-7KUW4MJD.js.map → chunk-MM4TGTST.js.map} +1 -1
  42. package/dist/{chunk-662MSGZB.js → chunk-NXCJN2FJ.js} +55 -28
  43. package/dist/chunk-NXCJN2FJ.js.map +1 -0
  44. package/dist/{candidate-ERMSYYQZ.js → chunk-OJD54DIU.js} +15 -19
  45. package/dist/{candidate-ERMSYYQZ.js.map → chunk-OJD54DIU.js.map} +1 -1
  46. package/dist/{chunk-ZABPQJ3M.js → chunk-POJRB2AE.js} +2 -2
  47. package/dist/{chunk-FJPLRISB.js → chunk-QH6677FJ.js} +5 -4
  48. package/dist/chunk-QH6677FJ.js.map +1 -0
  49. package/dist/{wallet-CWEMYVIH.js → chunk-R7BMDJZM.js} +15 -27
  50. package/dist/{wallet-CWEMYVIH.js.map → chunk-R7BMDJZM.js.map} +1 -1
  51. package/dist/{chunk-Z6MFJV5Z.js → chunk-S3KZ3PPK.js} +15 -11
  52. package/dist/{chunk-Z6MFJV5Z.js.map → chunk-S3KZ3PPK.js.map} +1 -1
  53. package/dist/{chunk-CYOF7ROH.js → chunk-S5RYMCV6.js} +3 -3
  54. package/dist/{chunk-ZMHYXMO6.js → chunk-U5S527PP.js} +3 -3
  55. package/dist/{chunk-RY4XKNV3.js → chunk-UHTVXQ2O.js} +3 -3
  56. package/dist/{publish-BKBQQAW4.js → chunk-ULLWHHIT.js} +19 -34
  57. package/dist/{publish-BKBQQAW4.js.map → chunk-ULLWHHIT.js.map} +1 -1
  58. package/dist/{chunk-Z52RA3NC.js → chunk-VV4P5RVK.js} +47 -20
  59. package/dist/chunk-VV4P5RVK.js.map +1 -0
  60. package/dist/{chunk-QVX5MWJZ.js → chunk-W6R3HAAG.js} +2 -2
  61. package/dist/{chunk-3OV7E5G5.js → chunk-WWX32ML4.js} +1 -1
  62. package/dist/{chunk-3OV7E5G5.js.map → chunk-WWX32ML4.js.map} +1 -1
  63. package/dist/{chunk-HIVZG55D.js → chunk-XJN5WUKL.js} +2 -2
  64. package/dist/{chunk-JPHG2JW3.js → chunk-XNNOR7F7.js} +25 -25
  65. package/dist/chunk-XNNOR7F7.js.map +1 -0
  66. package/dist/{inspect-LMKOXE4Y.js → chunk-YFREUEUI.js} +8 -26
  67. package/dist/{inspect-LMKOXE4Y.js.map → chunk-YFREUEUI.js.map} +1 -1
  68. package/dist/{chunk-HSDCI7OV.js → chunk-YLYINX2H.js} +3 -3
  69. package/dist/{cli-SBXI5AMS.js → cli-AFSLAKR6.js} +47 -36
  70. package/dist/{cli-SBXI5AMS.js.map → cli-AFSLAKR6.js.map} +1 -1
  71. package/dist/{config-VELDKLHY.js → config-DBEEM3UA.js} +5 -5
  72. package/dist/{doctor-T3KWNNP2.js → doctor-XDA3YU6H.js} +7 -7
  73. package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js → ethersCompat-Df4a6QIZ-WHYKB6HA.js} +5 -5
  74. package/dist/index.js +1 -1
  75. package/dist/inspect-YBGDAG47.js +33 -0
  76. package/dist/{install-LEX3ENQ6.js → install-7J6KKEEP.js} +240 -85
  77. package/dist/install-7J6KKEEP.js.map +1 -0
  78. package/dist/outcome-ZFGHX2XW.js +20 -0
  79. package/dist/publish-IH7RJXGB.js +36 -0
  80. package/dist/publish-IH7RJXGB.js.map +1 -0
  81. package/dist/run-DCZFEW2C.js +16806 -0
  82. package/dist/run-DCZFEW2C.js.map +1 -0
  83. package/dist/search-R6NIQFXI.js +24 -0
  84. package/dist/search-R6NIQFXI.js.map +1 -0
  85. package/dist/{secp256k1-N3ZHU7LB.js → secp256k1-XRPVBC6V.js} +3 -3
  86. package/dist/secp256k1-XRPVBC6V.js.map +1 -0
  87. package/dist/usdc-AU6ZIKA6.js +22 -0
  88. package/dist/usdc-AU6ZIKA6.js.map +1 -0
  89. package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js → viemAdapter-By13KInL-TUQJBMHM.js} +5 -5
  90. package/dist/viemAdapter-By13KInL-TUQJBMHM.js.map +1 -0
  91. package/dist/{wallet-PA54CRBL.js → wallet-HKG3GSTX.js} +10 -10
  92. package/dist/wallet-HKG3GSTX.js.map +1 -0
  93. package/dist/wallet-UWHSHWC6.js +31 -0
  94. package/dist/wallet-UWHSHWC6.js.map +1 -0
  95. package/package.json +4 -3
  96. package/skills/tenjin/SKILL.md +56 -13
  97. package/skills/tenjin-publish/SKILL.md +21 -6
  98. package/skills/tenjin-search/SKILL.md +35 -20
  99. package/dist/chunk-662MSGZB.js.map +0 -1
  100. package/dist/chunk-FJPLRISB.js.map +0 -1
  101. package/dist/chunk-JPHG2JW3.js.map +0 -1
  102. package/dist/chunk-NCE5NSN6.js.map +0 -1
  103. package/dist/chunk-TLCMMYLY.js.map +0 -1
  104. package/dist/chunk-YALGASEU.js.map +0 -1
  105. package/dist/chunk-Z52RA3NC.js.map +0 -1
  106. package/dist/install-LEX3ENQ6.js.map +0 -1
  107. package/dist/lookup-ZPN2Q67N.js.map +0 -1
  108. package/dist/outcome-N7TAK6WR.js +0 -66
  109. package/dist/outcome-N7TAK6WR.js.map +0 -1
  110. package/dist/usdc-JIAJW4SV.js +0 -22
  111. /package/dist/{_esm-FEASBWRP.js.map → _esm-N4KAVXQR.js.map} +0 -0
  112. /package/dist/{ccip-NQXCEK2U.js.map → buy-OOOLUDND.js.map} +0 -0
  113. /package/dist/{ccip-XR5NE5QK.js.map → candidate-TWCWTFGA.js.map} +0 -0
  114. /package/dist/{config-VELDKLHY.js.map → ccip-RPPPKTJR.js.map} +0 -0
  115. /package/dist/{doctor-T3KWNNP2.js.map → ccip-ZGGWQN4X.js.map} +0 -0
  116. /package/dist/{chunk-XJIW7USF.js.map → chunk-333FOTUJ.js.map} +0 -0
  117. /package/dist/{chunk-YN5SHIXQ.js.map → chunk-DPET3TW5.js.map} +0 -0
  118. /package/dist/{chunk-S3IGX57D.js.map → chunk-FU6MCSLG.js.map} +0 -0
  119. /package/dist/{chunk-5CLSD5YN.js.map → chunk-KYQVEKP5.js.map} +0 -0
  120. /package/dist/{chunk-RRN3YTK7.js.map → chunk-KZAAWQNP.js.map} +0 -0
  121. /package/dist/{chunk-ZABPQJ3M.js.map → chunk-POJRB2AE.js.map} +0 -0
  122. /package/dist/{chunk-CYOF7ROH.js.map → chunk-S5RYMCV6.js.map} +0 -0
  123. /package/dist/{chunk-ZMHYXMO6.js.map → chunk-U5S527PP.js.map} +0 -0
  124. /package/dist/{chunk-RY4XKNV3.js.map → chunk-UHTVXQ2O.js.map} +0 -0
  125. /package/dist/{chunk-QVX5MWJZ.js.map → chunk-W6R3HAAG.js.map} +0 -0
  126. /package/dist/{chunk-HIVZG55D.js.map → chunk-XJN5WUKL.js.map} +0 -0
  127. /package/dist/{chunk-HSDCI7OV.js.map → chunk-YLYINX2H.js.map} +0 -0
  128. /package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js.map → config-DBEEM3UA.js.map} +0 -0
  129. /package/dist/{secp256k1-N3ZHU7LB.js.map → doctor-XDA3YU6H.js.map} +0 -0
  130. /package/dist/{usdc-JIAJW4SV.js.map → ethersCompat-Df4a6QIZ-WHYKB6HA.js.map} +0 -0
  131. /package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js.map → inspect-YBGDAG47.js.map} +0 -0
  132. /package/dist/{wallet-PA54CRBL.js.map → outcome-ZFGHX2XW.js.map} +0 -0
@@ -3,22 +3,22 @@ import {
3
3
  SIWX_HEADER,
4
4
  decodePaymentRequiredHeader,
5
5
  decodePaymentResponseHeader
6
- } from "./chunk-S3IGX57D.js";
6
+ } from "./chunk-FU6MCSLG.js";
7
7
  import {
8
8
  rateLimitError
9
- } from "./chunk-662MSGZB.js";
9
+ } from "./chunk-NXCJN2FJ.js";
10
10
  import {
11
11
  SLUG_RE,
12
12
  UUID_RE
13
- } from "./chunk-3OV7E5G5.js";
13
+ } from "./chunk-WWX32ML4.js";
14
14
  import {
15
15
  CLIENT_HEADER,
16
16
  httpRequest
17
- } from "./chunk-4ONXEEQL.js";
17
+ } from "./chunk-C4TIWOAM.js";
18
18
  import {
19
19
  CliError,
20
20
  external_exports
21
- } from "./chunk-OYMYCW7J.js";
21
+ } from "./chunk-6WWVYYSB.js";
22
22
 
23
23
  // src/lib/read-client.ts
24
24
  var PAYMENT_REQUIRED_HEADER = "PAYMENT-REQUIRED";
@@ -58,7 +58,7 @@ async function fetchRead(url, opts) {
58
58
  accept: "application/json",
59
59
  "x-tenjin-client": CLIENT_HEADER
60
60
  };
61
- if (opts.lookupId !== void 0) headers["x-tenjin-lookup-id"] = opts.lookupId;
61
+ if (opts.searchId !== void 0) headers["x-tenjin-search-id"] = opts.searchId;
62
62
  if (opts.siwxHeader !== void 0) headers[SIWX_HEADER] = opts.siwxHeader;
63
63
  if (opts.paymentHeaders !== void 0) Object.assign(headers, opts.paymentHeaders);
64
64
  const res = await httpRequest(url, {
@@ -168,4 +168,4 @@ function readMessage(json) {
168
168
  export {
169
169
  fetchRead
170
170
  };
171
- //# sourceMappingURL=chunk-DXTQ3CSI.js.map
171
+ //# sourceMappingURL=chunk-5JH7ZB6Z.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lib/read-client.ts"],"sourcesContent":["import { z } from 'zod';\nimport { decodePaymentRequiredHeader, decodePaymentResponseHeader } from '@x402/core/http';\nimport type { PaymentRequired } from '@x402/core/types';\nimport { CliError } from './errors';\nimport { rateLimitError } from './agent-api';\nimport { httpRequest } from './http';\nimport { CLIENT_HEADER } from './client-meta';\nimport { SIWX_HEADER } from './siwx';\n\n/**\n * The read-route (`GET /api/read/<handle>/<slug>`) client, always JSON/x402, so\n * it is the robust agent target (llms-full). It surfaces the three outcomes the\n * buy flow branches on: `entitled` (200 with the full body, free post, SIWX\n * re-read, or freshly paid), `payment_required` (402 with the decoded\n * PAYMENT-REQUIRED header + the leak-safe preview body), and `already_purchased`\n * (409 owned-re-pay gate, nothing charged). Purchase attribution rides\n * `X-Tenjin-Client` always and `X-Tenjin-Lookup-Id` when a lookup preceded the buy.\n */\n\nconst PAYMENT_REQUIRED_HEADER = 'PAYMENT-REQUIRED';\nconst PAYMENT_RESPONSE_HEADER = 'PAYMENT-RESPONSE';\n\n// id/slug become filesystem path segments (the local library), so they are\n// validated as a uuid + the server's slug charset HERE, at the trust boundary, so\n// a hostile id='../../evil' or slug fails as CONTRACT_MISMATCH before delivery.\nimport { SLUG_RE, UUID_RE as RESOURCE_ID_RE } from './ids';\n\n/** The full essay body a 200 returns (loose: require what the CLI reads, keep the rest). */\nconst readBodySchema = z\n .object({\n id: z.string().regex(RESOURCE_ID_RE, 'resource id must be a uuid'),\n slug: z.string().regex(SLUG_RE, 'unsafe slug').max(80),\n title: z.string(),\n bodyMd: z.string(),\n price: z.string(),\n creator: z\n .object({\n handle: z.string().nullish(),\n walletAddress: z.string().nullish(),\n })\n .passthrough(),\n })\n .passthrough();\n\nexport type ReadBody = z.infer<typeof readBodySchema>;\n\n/** The leak-safe 402 preview body, never the paid content. */\nconst previewSchema = z\n .object({\n id: z.string().optional(),\n title: z.string().optional(),\n price: z.string().optional(),\n creator: z.record(z.string(), z.unknown()).optional(),\n })\n .passthrough();\n\nexport type Preview = z.infer<typeof previewSchema>;\n\n// The decoded PAYMENT-REQUIRED is money-path input: validate the fields the pay\n// path consumes (amount as an atomic integer, CAIP-2 network, 0x asset/payTo)\n// at THIS boundary instead of trusting raw base64 JSON. Loose otherwise so new\n// server fields never break an older CLI.\nconst ADDRESS_RE = /^0x[0-9a-fA-F]{40}$/;\nconst paymentRequiredSchema = z\n .object({\n x402Version: z.literal(2),\n accepts: z.array(\n z\n .object({\n scheme: z.string(),\n network: z.string().regex(/^eip155:\\d+$/, 'network must be CAIP-2 eip155'),\n asset: z.string().regex(ADDRESS_RE, 'asset must be a 0x address'),\n amount: z.string().regex(/^\\d{1,39}$/, 'amount must be an atomic integer string'),\n payTo: z.string().regex(ADDRESS_RE, 'payTo must be a 0x address'),\n })\n .passthrough(),\n ),\n })\n .passthrough();\n\nexport type ReadResult =\n | { kind: 'entitled'; body: ReadBody; settlementTxHash?: string }\n | { kind: 'payment_required'; paymentRequired: PaymentRequired; preview: Preview }\n | { kind: 'already_purchased'; message: string };\n\nexport interface ReadRequestOptions {\n timeoutMs: number;\n fetchImpl?: typeof fetch;\n /** A `SIGN-IN-WITH-X` header for the entitled free re-read. */\n siwxHeader?: string;\n /** The `PAYMENT-SIGNATURE` header(s) for a paid request. */\n paymentHeaders?: Record<string, string>;\n /** Attribute a following purchase to the lookup that surfaced it. */\n lookupId?: string;\n}\n\nexport async function fetchRead(url: string, opts: ReadRequestOptions): Promise<ReadResult> {\n const headers: Record<string, string> = {\n accept: 'application/json',\n 'x-tenjin-client': CLIENT_HEADER,\n };\n if (opts.lookupId !== undefined) headers['x-tenjin-lookup-id'] = opts.lookupId;\n if (opts.siwxHeader !== undefined) headers[SIWX_HEADER] = opts.siwxHeader;\n if (opts.paymentHeaders !== undefined) Object.assign(headers, opts.paymentHeaders);\n\n const res = await httpRequest(url, {\n method: 'GET',\n timeoutMs: opts.timeoutMs,\n headers,\n fetchImpl: opts.fetchImpl,\n });\n if (!res.ok) {\n const code =\n res.kind === 'network' || res.kind === 'timeout' ? 'NETWORK_ERROR' : 'API_UNREACHABLE';\n throw new CliError(code, `${url}: ${res.message}`, {\n fix: 'Check the resource URL and your network, then retry.',\n });\n }\n\n if (res.status === 200) {\n const parsed = readBodySchema.safeParse(res.json);\n if (!parsed.success) {\n throw new CliError(\n 'CONTRACT_MISMATCH',\n 'The read response did not match the expected contract',\n {\n fix: 'Update tenjin-cli; the read contract may have changed.',\n details: parsed.error.issues,\n },\n );\n }\n const settlement = decodeSettlement(res.header(PAYMENT_RESPONSE_HEADER));\n return {\n kind: 'entitled',\n body: parsed.data,\n ...(settlement !== undefined ? { settlementTxHash: settlement } : {}),\n };\n }\n\n if (res.status === 402) {\n const encoded = res.header(PAYMENT_REQUIRED_HEADER);\n if (encoded === undefined) {\n throw new CliError('CONTRACT_MISMATCH', 'The 402 carried no PAYMENT-REQUIRED header', {\n fix: 'The server may be misconfigured; try another resource or update tenjin-cli.',\n });\n }\n let decoded: PaymentRequired;\n try {\n decoded = decodePaymentRequiredHeader(encoded);\n } catch (err) {\n throw new CliError('CONTRACT_MISMATCH', 'Could not decode the PAYMENT-REQUIRED header', {\n fix: 'Update tenjin-cli; the x402 header format may have changed.',\n cause: err,\n });\n }\n const validated = paymentRequiredSchema.safeParse(decoded);\n if (!validated.success) {\n throw new CliError(\n 'CONTRACT_MISMATCH',\n 'The 402 challenge is not a valid x402 v2 payment declaration.',\n {\n fix: 'Update tenjin-cli, or check --base-url points at a Tenjin deployment.',\n details: validated.error.issues,\n },\n );\n }\n const paymentRequired = decoded;\n const preview = previewSchema.safeParse(res.json);\n return {\n kind: 'payment_required',\n paymentRequired,\n preview: preview.success ? preview.data : {},\n };\n }\n\n if (res.status === 409) {\n // The owned-re-pay gate: a payment for a post this wallet already bought is\n // refused, nothing charged. The caller falls back to a SIWX free re-read.\n return { kind: 'already_purchased', message: readMessage(res.json) ?? 'Already purchased.' };\n }\n\n if (res.status === 404) {\n throw new CliError('RESOURCE_NOT_FOUND', `No resource at ${url}`, {\n fix: 'Check the handle/slug or resource id.',\n });\n }\n\n // 429 on the paid-read path is a recoverable pause, not an outage: surface\n // RATE_LIMITED + retryAfterSeconds like postLookup/postOutcomes do, so a looping\n // agent (the caller most likely to hit this) can back off instead of treating it\n // as API_UNREACHABLE.\n if (res.status === 429) throw rateLimitError(url, (n) => res.header(n));\n\n throw new CliError(\n 'API_UNREACHABLE',\n readMessage(res.json) ?? `Unexpected status ${res.status} from ${url}`,\n {\n fix: 'Retry; if it persists the resource may be unavailable.',\n details: res.json,\n },\n );\n}\n\nfunction decodeSettlement(header: string | undefined): string | undefined {\n if (header === undefined) return undefined;\n try {\n const settle = decodePaymentResponseHeader(header);\n const tx = (settle as { transaction?: unknown }).transaction;\n return typeof tx === 'string' ? tx : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction readMessage(json: unknown): string | undefined {\n if (typeof json === 'object' && json !== null) {\n const rec = json as Record<string, unknown>;\n if (typeof rec.message === 'string') return rec.message;\n if (typeof rec.error === 'string') return rec.error;\n if (typeof rec.code === 'string') return rec.code;\n }\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;AAQhC,IAAM,iBAAiB,iBACpB,OAAO;AAAA,EACN,IAAI,iBAAE,OAAO,EAAE,MAAM,SAAgB,4BAA4B;AAAA,EACjE,MAAM,iBAAE,OAAO,EAAE,MAAM,SAAS,aAAa,EAAE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,IAAI,SAAS,SAAU,QAAO,IAAI;AAAA,EAC/C;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/lib/read-client.ts"],"sourcesContent":["import { z } from 'zod';\nimport { decodePaymentRequiredHeader, decodePaymentResponseHeader } from '@x402/core/http';\nimport type { PaymentRequired } from '@x402/core/types';\nimport { CliError } from './errors';\nimport { rateLimitError } from './agent-api';\nimport { httpRequest } from './http';\nimport { CLIENT_HEADER } from './client-meta';\nimport { SIWX_HEADER } from './siwx';\n\n/**\n * The read-route (`GET /api/read/<handle>/<slug>`) client, always JSON/x402, so\n * it is the robust agent target (llms-full). It surfaces the three outcomes the\n * buy flow branches on: `entitled` (200 with the full body, free post, SIWX\n * re-read, or freshly paid), `payment_required` (402 with the decoded\n * PAYMENT-REQUIRED header + the leak-safe preview body), and `already_purchased`\n * (409 owned-re-pay gate, nothing charged). Purchase attribution rides\n * `X-Tenjin-Client` always and `X-Tenjin-Search-Id` when a search preceded the buy.\n */\n\nconst PAYMENT_REQUIRED_HEADER = 'PAYMENT-REQUIRED';\nconst PAYMENT_RESPONSE_HEADER = 'PAYMENT-RESPONSE';\n\n// id/slug become filesystem path segments (the local library), so they are\n// validated as a uuid + the server's slug charset HERE, at the trust boundary, so\n// a hostile id='../../evil' or slug fails as CONTRACT_MISMATCH before delivery.\nimport { SLUG_RE, UUID_RE as RESOURCE_ID_RE } from './ids';\n\n/** The full essay body a 200 returns (loose: require what the CLI reads, keep the rest). */\nconst readBodySchema = z\n .object({\n id: z.string().regex(RESOURCE_ID_RE, 'resource id must be a uuid'),\n slug: z.string().regex(SLUG_RE, 'unsafe slug').max(80),\n title: z.string(),\n bodyMd: z.string(),\n price: z.string(),\n creator: z\n .object({\n handle: z.string().nullish(),\n walletAddress: z.string().nullish(),\n })\n .passthrough(),\n })\n .passthrough();\n\nexport type ReadBody = z.infer<typeof readBodySchema>;\n\n/** The leak-safe 402 preview body, never the paid content. */\nconst previewSchema = z\n .object({\n id: z.string().optional(),\n title: z.string().optional(),\n price: z.string().optional(),\n creator: z.record(z.string(), z.unknown()).optional(),\n })\n .passthrough();\n\nexport type Preview = z.infer<typeof previewSchema>;\n\n// The decoded PAYMENT-REQUIRED is money-path input: validate the fields the pay\n// path consumes (amount as an atomic integer, CAIP-2 network, 0x asset/payTo)\n// at THIS boundary instead of trusting raw base64 JSON. Loose otherwise so new\n// server fields never break an older CLI.\nconst ADDRESS_RE = /^0x[0-9a-fA-F]{40}$/;\nconst paymentRequiredSchema = z\n .object({\n x402Version: z.literal(2),\n accepts: z.array(\n z\n .object({\n scheme: z.string(),\n network: z.string().regex(/^eip155:\\d+$/, 'network must be CAIP-2 eip155'),\n asset: z.string().regex(ADDRESS_RE, 'asset must be a 0x address'),\n amount: z.string().regex(/^\\d{1,39}$/, 'amount must be an atomic integer string'),\n payTo: z.string().regex(ADDRESS_RE, 'payTo must be a 0x address'),\n })\n .passthrough(),\n ),\n })\n .passthrough();\n\nexport type ReadResult =\n | { kind: 'entitled'; body: ReadBody; settlementTxHash?: string }\n | { kind: 'payment_required'; paymentRequired: PaymentRequired; preview: Preview }\n | { kind: 'already_purchased'; message: string };\n\nexport interface ReadRequestOptions {\n timeoutMs: number;\n fetchImpl?: typeof fetch;\n /** A `SIGN-IN-WITH-X` header for the entitled free re-read. */\n siwxHeader?: string;\n /** The `PAYMENT-SIGNATURE` header(s) for a paid request. */\n paymentHeaders?: Record<string, string>;\n /** Attribute a following purchase to the search that surfaced it. */\n searchId?: string;\n}\n\nexport async function fetchRead(url: string, opts: ReadRequestOptions): Promise<ReadResult> {\n const headers: Record<string, string> = {\n accept: 'application/json',\n 'x-tenjin-client': CLIENT_HEADER,\n };\n if (opts.searchId !== undefined) headers['x-tenjin-search-id'] = opts.searchId;\n if (opts.siwxHeader !== undefined) headers[SIWX_HEADER] = opts.siwxHeader;\n if (opts.paymentHeaders !== undefined) Object.assign(headers, opts.paymentHeaders);\n\n const res = await httpRequest(url, {\n method: 'GET',\n timeoutMs: opts.timeoutMs,\n headers,\n fetchImpl: opts.fetchImpl,\n });\n if (!res.ok) {\n const code =\n res.kind === 'network' || res.kind === 'timeout' ? 'NETWORK_ERROR' : 'API_UNREACHABLE';\n throw new CliError(code, `${url}: ${res.message}`, {\n fix: 'Check the resource URL and your network, then retry.',\n });\n }\n\n if (res.status === 200) {\n const parsed = readBodySchema.safeParse(res.json);\n if (!parsed.success) {\n throw new CliError(\n 'CONTRACT_MISMATCH',\n 'The read response did not match the expected contract',\n {\n fix: 'Update tenjin-cli; the read contract may have changed.',\n details: parsed.error.issues,\n },\n );\n }\n const settlement = decodeSettlement(res.header(PAYMENT_RESPONSE_HEADER));\n return {\n kind: 'entitled',\n body: parsed.data,\n ...(settlement !== undefined ? { settlementTxHash: settlement } : {}),\n };\n }\n\n if (res.status === 402) {\n const encoded = res.header(PAYMENT_REQUIRED_HEADER);\n if (encoded === undefined) {\n throw new CliError('CONTRACT_MISMATCH', 'The 402 carried no PAYMENT-REQUIRED header', {\n fix: 'The server may be misconfigured; try another resource or update tenjin-cli.',\n });\n }\n let decoded: PaymentRequired;\n try {\n decoded = decodePaymentRequiredHeader(encoded);\n } catch (err) {\n throw new CliError('CONTRACT_MISMATCH', 'Could not decode the PAYMENT-REQUIRED header', {\n fix: 'Update tenjin-cli; the x402 header format may have changed.',\n cause: err,\n });\n }\n const validated = paymentRequiredSchema.safeParse(decoded);\n if (!validated.success) {\n throw new CliError(\n 'CONTRACT_MISMATCH',\n 'The 402 challenge is not a valid x402 v2 payment declaration.',\n {\n fix: 'Update tenjin-cli, or check --base-url points at a Tenjin deployment.',\n details: validated.error.issues,\n },\n );\n }\n const paymentRequired = decoded;\n const preview = previewSchema.safeParse(res.json);\n return {\n kind: 'payment_required',\n paymentRequired,\n preview: preview.success ? preview.data : {},\n };\n }\n\n if (res.status === 409) {\n // The owned-re-pay gate: a payment for a post this wallet already bought is\n // refused, nothing charged. The caller falls back to a SIWX free re-read.\n return { kind: 'already_purchased', message: readMessage(res.json) ?? 'Already purchased.' };\n }\n\n if (res.status === 404) {\n throw new CliError('RESOURCE_NOT_FOUND', `No resource at ${url}`, {\n fix: 'Check the handle/slug or resource id.',\n });\n }\n\n // 429 on the paid-read path is a recoverable pause, not an outage: surface\n // RATE_LIMITED + retryAfterSeconds like postSearch/postOutcomes do, so a looping\n // agent (the caller most likely to hit this) can back off instead of treating it\n // as API_UNREACHABLE.\n if (res.status === 429) throw rateLimitError(url, (n) => res.header(n));\n\n throw new CliError(\n 'API_UNREACHABLE',\n readMessage(res.json) ?? `Unexpected status ${res.status} from ${url}`,\n {\n fix: 'Retry; if it persists the resource may be unavailable.',\n details: res.json,\n },\n );\n}\n\nfunction decodeSettlement(header: string | undefined): string | undefined {\n if (header === undefined) return undefined;\n try {\n const settle = decodePaymentResponseHeader(header);\n const tx = (settle as { transaction?: unknown }).transaction;\n return typeof tx === 'string' ? tx : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction readMessage(json: unknown): string | undefined {\n if (typeof json === 'object' && json !== null) {\n const rec = json as Record<string, unknown>;\n if (typeof rec.message === 'string') return rec.message;\n if (typeof rec.error === 'string') return rec.error;\n if (typeof rec.code === 'string') return rec.code;\n }\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;AAQhC,IAAM,iBAAiB,iBACpB,OAAO;AAAA,EACN,IAAI,iBAAE,OAAO,EAAE,MAAM,SAAgB,4BAA4B;AAAA,EACjE,MAAM,iBAAE,OAAO,EAAE,MAAM,SAAS,aAAa,EAAE,IAAI,EAAE;AAAA,EACrD,OAAO,iBAAE,OAAO;AAAA,EAChB,QAAQ,iBAAE,OAAO;AAAA,EACjB,OAAO,iBAAE,OAAO;AAAA,EAChB,SAAS,iBACN,OAAO;AAAA,IACN,QAAQ,iBAAE,OAAO,EAAE,QAAQ;AAAA,IAC3B,eAAe,iBAAE,OAAO,EAAE,QAAQ;AAAA,EACpC,CAAC,EACA,YAAY;AACjB,C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_LIMITED: 1,
14541
14541
  // A publish awaiting confirmation or hard-blocked is understood-but-refused (3),
14542
14542
  // the same posture as POLICY_REFUSED; a write that failed after approval is a
@@ -14585,6 +14585,36 @@ function passphraseBlobPath(dir = dataDir()) {
14585
14585
  }
14586
14586
 
14587
14587
  export {
14588
+ $constructor,
14589
+ defineLazy,
14590
+ clone,
14591
+ normalizeParams,
14592
+ parse,
14593
+ parseAsync,
14594
+ safeParse,
14595
+ safeParseAsync,
14596
+ $ZodType,
14597
+ $ZodObject,
14598
+ toJSONSchema,
14599
+ iso_exports,
14600
+ string2 as string,
14601
+ number2 as number,
14602
+ boolean2 as boolean,
14603
+ _null3 as _null,
14604
+ unknown,
14605
+ array,
14606
+ object,
14607
+ looseObject,
14608
+ union,
14609
+ discriminatedUnion,
14610
+ intersection,
14611
+ record,
14612
+ _enum2 as _enum,
14613
+ literal,
14614
+ ZodOptional,
14615
+ optional,
14616
+ custom,
14617
+ preprocess,
14588
14618
  external_exports,
14589
14619
  CliError,
14590
14620
  dataDir,
@@ -14593,4 +14623,4 @@ export {
14593
14623
  sessionPath,
14594
14624
  passphraseBlobPath
14595
14625
  };
14596
- //# sourceMappingURL=chunk-OYMYCW7J.js.map
14626
+ //# sourceMappingURL=chunk-6WWVYYSB.js.map