@opendatalabs/personal-server-ts-core 0.0.1-canary.bc9c8d9 → 0.0.1-canary.bdbd228

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 (490) hide show
  1. package/dist/api/index.d.ts +384 -7
  2. package/dist/api/index.d.ts.map +1 -1
  3. package/dist/api/index.js +1176 -100
  4. package/dist/api/index.js.map +1 -1
  5. package/dist/api/raw-envelope.d.ts +3 -0
  6. package/dist/api/raw-envelope.d.ts.map +1 -0
  7. package/dist/api/raw-envelope.js +215 -0
  8. package/dist/api/raw-envelope.js.map +1 -0
  9. package/dist/auth/request.d.ts.map +1 -1
  10. package/dist/auth/request.js.map +1 -1
  11. package/dist/client.d.ts +8 -1
  12. package/dist/client.d.ts.map +1 -1
  13. package/dist/client.js +21 -3
  14. package/dist/client.js.map +1 -1
  15. package/dist/contracts/binary.d.ts +66 -0
  16. package/dist/contracts/binary.d.ts.map +1 -0
  17. package/dist/contracts/binary.js +123 -0
  18. package/dist/contracts/binary.js.map +1 -0
  19. package/dist/contracts/data.d.ts +105 -6
  20. package/dist/contracts/data.d.ts.map +1 -1
  21. package/dist/contracts/data.js +335 -27
  22. package/dist/contracts/data.js.map +1 -1
  23. package/dist/contracts/grants.d.ts +7 -5
  24. package/dist/contracts/grants.d.ts.map +1 -1
  25. package/dist/contracts/grants.js +60 -37
  26. package/dist/contracts/grants.js.map +1 -1
  27. package/dist/contracts/index.d.ts +4 -2
  28. package/dist/contracts/index.d.ts.map +1 -1
  29. package/dist/contracts/index.js +2 -1
  30. package/dist/contracts/index.js.map +1 -1
  31. package/dist/contracts/sync.d.ts.map +1 -1
  32. package/dist/contracts/sync.js +1 -0
  33. package/dist/contracts/sync.js.map +1 -1
  34. package/dist/derivatives/answer-shape.d.ts +83 -0
  35. package/dist/derivatives/answer-shape.d.ts.map +1 -0
  36. package/dist/derivatives/answer-shape.js +320 -0
  37. package/dist/derivatives/answer-shape.js.map +1 -0
  38. package/dist/derivatives/api.d.ts +48 -0
  39. package/dist/derivatives/api.d.ts.map +1 -0
  40. package/dist/derivatives/api.js +374 -0
  41. package/dist/derivatives/api.js.map +1 -0
  42. package/dist/derivatives/compute.d.ts +112 -0
  43. package/dist/derivatives/compute.d.ts.map +1 -0
  44. package/dist/derivatives/compute.js +476 -0
  45. package/dist/derivatives/compute.js.map +1 -0
  46. package/dist/derivatives/e2ee/aad.d.ts +22 -0
  47. package/dist/derivatives/e2ee/aad.d.ts.map +1 -0
  48. package/dist/derivatives/e2ee/aad.js +32 -0
  49. package/dist/derivatives/e2ee/aad.js.map +1 -0
  50. package/dist/derivatives/e2ee/attestation.d.ts +134 -0
  51. package/dist/derivatives/e2ee/attestation.d.ts.map +1 -0
  52. package/dist/derivatives/e2ee/attestation.js +248 -0
  53. package/dist/derivatives/e2ee/attestation.js.map +1 -0
  54. package/dist/derivatives/e2ee/index.d.ts +6 -0
  55. package/dist/derivatives/e2ee/index.d.ts.map +1 -0
  56. package/dist/derivatives/e2ee/index.js +6 -0
  57. package/dist/derivatives/e2ee/index.js.map +1 -0
  58. package/dist/derivatives/e2ee/jcs.d.ts +17 -0
  59. package/dist/derivatives/e2ee/jcs.d.ts.map +1 -0
  60. package/dist/derivatives/e2ee/jcs.js +55 -0
  61. package/dist/derivatives/e2ee/jcs.js.map +1 -0
  62. package/dist/derivatives/e2ee/phala.d.ts +62 -0
  63. package/dist/derivatives/e2ee/phala.d.ts.map +1 -0
  64. package/dist/derivatives/e2ee/phala.js +168 -0
  65. package/dist/derivatives/e2ee/phala.js.map +1 -0
  66. package/dist/derivatives/e2ee/suite.d.ts +56 -0
  67. package/dist/derivatives/e2ee/suite.d.ts.map +1 -0
  68. package/dist/derivatives/e2ee/suite.js +164 -0
  69. package/dist/derivatives/e2ee/suite.js.map +1 -0
  70. package/dist/derivatives/index.d.ts +11 -0
  71. package/dist/derivatives/index.d.ts.map +1 -0
  72. package/dist/derivatives/index.js +11 -0
  73. package/dist/derivatives/index.js.map +1 -0
  74. package/dist/derivatives/inference.d.ts +151 -0
  75. package/dist/derivatives/inference.d.ts.map +1 -0
  76. package/dist/derivatives/inference.js +262 -0
  77. package/dist/derivatives/inference.js.map +1 -0
  78. package/dist/derivatives/prompt.d.ts +99 -0
  79. package/dist/derivatives/prompt.d.ts.map +1 -0
  80. package/dist/derivatives/prompt.js +281 -0
  81. package/dist/derivatives/prompt.js.map +1 -0
  82. package/dist/derivatives/registration.d.ts +56 -0
  83. package/dist/derivatives/registration.d.ts.map +1 -0
  84. package/dist/derivatives/registration.js +187 -0
  85. package/dist/derivatives/registration.js.map +1 -0
  86. package/dist/derivatives/scheduler.d.ts +114 -0
  87. package/dist/derivatives/scheduler.d.ts.map +1 -0
  88. package/dist/derivatives/scheduler.js +331 -0
  89. package/dist/derivatives/scheduler.js.map +1 -0
  90. package/dist/derivatives/store.d.ts +14 -0
  91. package/dist/derivatives/store.d.ts.map +1 -0
  92. package/dist/derivatives/store.js +79 -0
  93. package/dist/derivatives/store.js.map +1 -0
  94. package/dist/derivatives/types.d.ts +102 -0
  95. package/dist/derivatives/types.d.ts.map +1 -0
  96. package/dist/derivatives/types.js +29 -0
  97. package/dist/derivatives/types.js.map +1 -0
  98. package/dist/errors/catalog.d.ts +75 -0
  99. package/dist/errors/catalog.d.ts.map +1 -1
  100. package/dist/errors/catalog.js +104 -0
  101. package/dist/errors/catalog.js.map +1 -1
  102. package/dist/errors/pdpp-catalog.d.ts +36 -0
  103. package/dist/errors/pdpp-catalog.d.ts.map +1 -0
  104. package/dist/errors/pdpp-catalog.js +84 -0
  105. package/dist/errors/pdpp-catalog.js.map +1 -0
  106. package/dist/grants/index.d.ts +4 -1
  107. package/dist/grants/index.d.ts.map +1 -1
  108. package/dist/grants/index.js +5 -1
  109. package/dist/grants/index.js.map +1 -1
  110. package/dist/grants/pdpp-binding-store.d.ts +89 -0
  111. package/dist/grants/pdpp-binding-store.d.ts.map +1 -0
  112. package/dist/grants/pdpp-binding-store.js +112 -0
  113. package/dist/grants/pdpp-binding-store.js.map +1 -0
  114. package/dist/grants/pdpp-binding.d.ts +169 -0
  115. package/dist/grants/pdpp-binding.d.ts.map +1 -0
  116. package/dist/grants/pdpp-binding.js +236 -0
  117. package/dist/grants/pdpp-binding.js.map +1 -0
  118. package/dist/keys/index.d.ts +1 -0
  119. package/dist/keys/index.d.ts.map +1 -1
  120. package/dist/keys/index.js +1 -1
  121. package/dist/keys/index.js.map +1 -1
  122. package/dist/keys/public-only-account.d.ts +8 -0
  123. package/dist/keys/public-only-account.d.ts.map +1 -0
  124. package/dist/keys/public-only-account.js +21 -0
  125. package/dist/keys/public-only-account.js.map +1 -0
  126. package/dist/keys/server-account.d.ts +2 -2
  127. package/dist/keys/server-account.d.ts.map +1 -1
  128. package/dist/lineage/attestation.d.ts +42 -0
  129. package/dist/lineage/attestation.d.ts.map +1 -0
  130. package/dist/lineage/attestation.js +25 -0
  131. package/dist/lineage/attestation.js.map +1 -0
  132. package/dist/lineage/gateway.d.ts +105 -0
  133. package/dist/lineage/gateway.d.ts.map +1 -0
  134. package/dist/lineage/gateway.js +242 -0
  135. package/dist/lineage/gateway.js.map +1 -0
  136. package/dist/lineage/index.d.ts +5 -0
  137. package/dist/lineage/index.d.ts.map +1 -0
  138. package/dist/lineage/index.js +5 -0
  139. package/dist/lineage/index.js.map +1 -0
  140. package/dist/lineage/lineage.d.ts +141 -0
  141. package/dist/lineage/lineage.d.ts.map +1 -0
  142. package/dist/lineage/lineage.js +255 -0
  143. package/dist/lineage/lineage.js.map +1 -0
  144. package/dist/logging/access-log.d.ts +10 -1
  145. package/dist/logging/access-log.d.ts.map +1 -1
  146. package/dist/mcp/activity.d.ts +68 -0
  147. package/dist/mcp/activity.d.ts.map +1 -0
  148. package/dist/mcp/activity.js +111 -0
  149. package/dist/mcp/activity.js.map +1 -0
  150. package/dist/mcp/connection-api.d.ts +33 -2
  151. package/dist/mcp/connection-api.d.ts.map +1 -1
  152. package/dist/mcp/connection-api.js +144 -18
  153. package/dist/mcp/connection-api.js.map +1 -1
  154. package/dist/mcp/index.d.ts +3 -0
  155. package/dist/mcp/index.d.ts.map +1 -1
  156. package/dist/mcp/index.js +3 -0
  157. package/dist/mcp/index.js.map +1 -1
  158. package/dist/mcp/read-client.d.ts +126 -13
  159. package/dist/mcp/read-client.d.ts.map +1 -1
  160. package/dist/mcp/read-client.js +530 -21
  161. package/dist/mcp/read-client.js.map +1 -1
  162. package/dist/mcp/resources.d.ts +37 -0
  163. package/dist/mcp/resources.d.ts.map +1 -0
  164. package/dist/mcp/resources.js +114 -0
  165. package/dist/mcp/resources.js.map +1 -0
  166. package/dist/mcp/search/index.d.ts +34 -0
  167. package/dist/mcp/search/index.d.ts.map +1 -0
  168. package/dist/mcp/search/index.js +156 -0
  169. package/dist/mcp/search/index.js.map +1 -0
  170. package/dist/mcp/server.d.ts +36 -0
  171. package/dist/mcp/server.d.ts.map +1 -1
  172. package/dist/mcp/server.js +394 -25
  173. package/dist/mcp/server.js.map +1 -1
  174. package/dist/mcp/session.d.ts +160 -0
  175. package/dist/mcp/session.d.ts.map +1 -0
  176. package/dist/mcp/session.js +243 -0
  177. package/dist/mcp/session.js.map +1 -0
  178. package/dist/mcp/store.d.ts.map +1 -1
  179. package/dist/mcp/store.js +21 -0
  180. package/dist/mcp/store.js.map +1 -1
  181. package/dist/mcp/token-expiry.d.ts +38 -0
  182. package/dist/mcp/token-expiry.d.ts.map +1 -0
  183. package/dist/mcp/token-expiry.js +55 -0
  184. package/dist/mcp/token-expiry.js.map +1 -0
  185. package/dist/mcp/tools.d.ts +60 -6
  186. package/dist/mcp/tools.d.ts.map +1 -1
  187. package/dist/mcp/tools.js +1236 -64
  188. package/dist/mcp/tools.js.map +1 -1
  189. package/dist/mcp/types.d.ts +42 -4
  190. package/dist/mcp/types.d.ts.map +1 -1
  191. package/dist/mcp/types.js +1 -1
  192. package/dist/mcp/types.js.map +1 -1
  193. package/dist/payment/index.d.ts +2 -0
  194. package/dist/payment/index.d.ts.map +1 -0
  195. package/dist/payment/index.js +2 -0
  196. package/dist/payment/index.js.map +1 -0
  197. package/dist/payment/x402.d.ts +155 -0
  198. package/dist/payment/x402.d.ts.map +1 -0
  199. package/dist/payment/x402.js +402 -0
  200. package/dist/payment/x402.js.map +1 -0
  201. package/dist/pdpp/approval.d.ts +271 -0
  202. package/dist/pdpp/approval.d.ts.map +1 -0
  203. package/dist/pdpp/approval.js +443 -0
  204. package/dist/pdpp/approval.js.map +1 -0
  205. package/dist/pdpp/client-identity.d.ts +88 -0
  206. package/dist/pdpp/client-identity.d.ts.map +1 -0
  207. package/dist/pdpp/client-identity.js +196 -0
  208. package/dist/pdpp/client-identity.js.map +1 -0
  209. package/dist/pdpp/client-metadata.d.ts +95 -0
  210. package/dist/pdpp/client-metadata.d.ts.map +1 -0
  211. package/dist/pdpp/client-metadata.js +96 -0
  212. package/dist/pdpp/client-metadata.js.map +1 -0
  213. package/dist/pdpp/commitments.d.ts +75 -0
  214. package/dist/pdpp/commitments.d.ts.map +1 -0
  215. package/dist/pdpp/commitments.js +113 -0
  216. package/dist/pdpp/commitments.js.map +1 -0
  217. package/dist/pdpp/declaration.d.ts +118 -0
  218. package/dist/pdpp/declaration.d.ts.map +1 -0
  219. package/dist/pdpp/declaration.js +836 -0
  220. package/dist/pdpp/declaration.js.map +1 -0
  221. package/dist/pdpp/index.d.ts +37 -0
  222. package/dist/pdpp/index.d.ts.map +1 -0
  223. package/dist/pdpp/index.js +23 -0
  224. package/dist/pdpp/index.js.map +1 -0
  225. package/dist/pdpp/issuance.d.ts +126 -0
  226. package/dist/pdpp/issuance.d.ts.map +1 -0
  227. package/dist/pdpp/issuance.js +180 -0
  228. package/dist/pdpp/issuance.js.map +1 -0
  229. package/dist/pdpp/pkce.d.ts +53 -0
  230. package/dist/pdpp/pkce.d.ts.map +1 -0
  231. package/dist/pdpp/pkce.js +109 -0
  232. package/dist/pdpp/pkce.js.map +1 -0
  233. package/dist/pdpp/redirect.d.ts +60 -0
  234. package/dist/pdpp/redirect.d.ts.map +1 -0
  235. package/dist/pdpp/redirect.js +125 -0
  236. package/dist/pdpp/redirect.js.map +1 -0
  237. package/dist/pdpp/resolve.d.ts +109 -0
  238. package/dist/pdpp/resolve.d.ts.map +1 -0
  239. package/dist/pdpp/resolve.js +393 -0
  240. package/dist/pdpp/resolve.js.map +1 -0
  241. package/dist/pdpp/review.d.ts +280 -0
  242. package/dist/pdpp/review.d.ts.map +1 -0
  243. package/dist/pdpp/review.js +205 -0
  244. package/dist/pdpp/review.js.map +1 -0
  245. package/dist/pdpp/selection.d.ts +50 -0
  246. package/dist/pdpp/selection.d.ts.map +1 -0
  247. package/dist/pdpp/selection.js +442 -0
  248. package/dist/pdpp/selection.js.map +1 -0
  249. package/dist/pdpp/store.d.ts +226 -0
  250. package/dist/pdpp/store.d.ts.map +1 -0
  251. package/dist/pdpp/store.js +537 -0
  252. package/dist/pdpp/store.js.map +1 -0
  253. package/dist/pdpp/tokens.d.ts +180 -0
  254. package/dist/pdpp/tokens.d.ts.map +1 -0
  255. package/dist/pdpp/tokens.js +416 -0
  256. package/dist/pdpp/tokens.js.map +1 -0
  257. package/dist/pdpp/types.d.ts +437 -0
  258. package/dist/pdpp/types.d.ts.map +1 -0
  259. package/dist/pdpp/types.js +61 -0
  260. package/dist/pdpp/types.js.map +1 -0
  261. package/dist/pdpp-version.d.ts +28 -0
  262. package/dist/pdpp-version.d.ts.map +1 -0
  263. package/dist/pdpp-version.js +28 -0
  264. package/dist/pdpp-version.js.map +1 -0
  265. package/dist/policy/data-read.d.ts +42 -2
  266. package/dist/policy/data-read.d.ts.map +1 -1
  267. package/dist/policy/data-read.js +128 -49
  268. package/dist/policy/data-read.js.map +1 -1
  269. package/dist/policy/data-write.d.ts +69 -0
  270. package/dist/policy/data-write.d.ts.map +1 -0
  271. package/dist/policy/data-write.js +131 -0
  272. package/dist/policy/data-write.js.map +1 -0
  273. package/dist/policy/index.d.ts +3 -1
  274. package/dist/policy/index.d.ts.map +1 -1
  275. package/dist/policy/index.js +3 -1
  276. package/dist/policy/index.js.map +1 -1
  277. package/dist/policy/signed-artifacts.d.ts +17 -0
  278. package/dist/policy/signed-artifacts.d.ts.map +1 -0
  279. package/dist/policy/signed-artifacts.js +110 -0
  280. package/dist/policy/signed-artifacts.js.map +1 -0
  281. package/dist/ports/index.d.ts +193 -19
  282. package/dist/ports/index.d.ts.map +1 -1
  283. package/dist/ports/index.js +6 -5
  284. package/dist/ports/index.js.map +1 -1
  285. package/dist/ports/pdpp-auth.d.ts +127 -0
  286. package/dist/ports/pdpp-auth.d.ts.map +1 -0
  287. package/dist/ports/pdpp-auth.js +60 -0
  288. package/dist/ports/pdpp-auth.js.map +1 -0
  289. package/dist/ports/pdpp-auth.test-utils.d.ts +9 -0
  290. package/dist/ports/pdpp-auth.test-utils.d.ts.map +1 -0
  291. package/dist/ports/pdpp-auth.test-utils.js +18 -0
  292. package/dist/ports/pdpp-auth.test-utils.js.map +1 -0
  293. package/dist/schemas/server-config.d.ts +86 -0
  294. package/dist/schemas/server-config.d.ts.map +1 -1
  295. package/dist/schemas/server-config.js +187 -4
  296. package/dist/schemas/server-config.js.map +1 -1
  297. package/dist/signing/index.d.ts +1 -1
  298. package/dist/signing/index.d.ts.map +1 -1
  299. package/dist/signing/index.js.map +1 -1
  300. package/dist/signing/request-signer.d.ts +2 -0
  301. package/dist/signing/request-signer.d.ts.map +1 -1
  302. package/dist/signing/request-signer.js +1 -0
  303. package/dist/signing/request-signer.js.map +1 -1
  304. package/dist/signing/signer.d.ts +28 -3
  305. package/dist/signing/signer.d.ts.map +1 -1
  306. package/dist/signing/signer.js +32 -21
  307. package/dist/signing/signer.js.map +1 -1
  308. package/dist/storage/adapters/index.d.ts +1 -1
  309. package/dist/storage/adapters/index.d.ts.map +1 -1
  310. package/dist/storage/adapters/index.js +1 -1
  311. package/dist/storage/adapters/index.js.map +1 -1
  312. package/dist/storage/adapters/interface.d.ts +10 -0
  313. package/dist/storage/adapters/interface.d.ts.map +1 -1
  314. package/dist/storage/adapters/sdk.d.ts +11 -1
  315. package/dist/storage/adapters/sdk.d.ts.map +1 -1
  316. package/dist/storage/adapters/sdk.js +38 -3
  317. package/dist/storage/adapters/sdk.js.map +1 -1
  318. package/dist/storage/adapters/vana.d.ts +4 -1
  319. package/dist/storage/adapters/vana.d.ts.map +1 -1
  320. package/dist/storage/adapters/vana.js +100 -2
  321. package/dist/storage/adapters/vana.js.map +1 -1
  322. package/dist/storage/blocks/build.d.ts +20 -0
  323. package/dist/storage/blocks/build.d.ts.map +1 -0
  324. package/dist/storage/blocks/build.js +378 -0
  325. package/dist/storage/blocks/build.js.map +1 -0
  326. package/dist/storage/blocks/cursor.d.ts +33 -0
  327. package/dist/storage/blocks/cursor.d.ts.map +1 -0
  328. package/dist/storage/blocks/cursor.js +142 -0
  329. package/dist/storage/blocks/cursor.js.map +1 -0
  330. package/dist/storage/blocks/errors.d.ts +6 -0
  331. package/dist/storage/blocks/errors.d.ts.map +1 -0
  332. package/dist/storage/blocks/errors.js +9 -0
  333. package/dist/storage/blocks/errors.js.map +1 -0
  334. package/dist/storage/blocks/index.d.ts +6 -0
  335. package/dist/storage/blocks/index.d.ts.map +1 -0
  336. package/dist/storage/blocks/index.js +5 -0
  337. package/dist/storage/blocks/index.js.map +1 -0
  338. package/dist/storage/blocks/select.d.ts +29 -0
  339. package/dist/storage/blocks/select.d.ts.map +1 -0
  340. package/dist/storage/blocks/select.js +120 -0
  341. package/dist/storage/blocks/select.js.map +1 -0
  342. package/dist/storage/blocks/types.d.ts +56 -0
  343. package/dist/storage/blocks/types.d.ts.map +1 -0
  344. package/dist/storage/blocks/types.js +2 -0
  345. package/dist/storage/blocks/types.js.map +1 -0
  346. package/dist/storage/index/manager.d.ts +57 -2
  347. package/dist/storage/index/manager.d.ts.map +1 -1
  348. package/dist/storage/index/schema.d.ts +1 -1
  349. package/dist/storage/index/schema.js +1 -1
  350. package/dist/storage/index/types.d.ts +20 -1
  351. package/dist/storage/index/types.d.ts.map +1 -1
  352. package/dist/storage/pdpp-records/cursor.d.ts +41 -0
  353. package/dist/storage/pdpp-records/cursor.d.ts.map +1 -0
  354. package/dist/storage/pdpp-records/cursor.js +49 -0
  355. package/dist/storage/pdpp-records/cursor.js.map +1 -0
  356. package/dist/storage/pdpp-records/enforcement.d.ts +52 -0
  357. package/dist/storage/pdpp-records/enforcement.d.ts.map +1 -0
  358. package/dist/storage/pdpp-records/enforcement.js +116 -0
  359. package/dist/storage/pdpp-records/enforcement.js.map +1 -0
  360. package/dist/storage/pdpp-records/index.d.ts +9 -0
  361. package/dist/storage/pdpp-records/index.d.ts.map +1 -0
  362. package/dist/storage/pdpp-records/index.js +9 -0
  363. package/dist/storage/pdpp-records/index.js.map +1 -0
  364. package/dist/storage/pdpp-records/ingest-plan.d.ts +39 -0
  365. package/dist/storage/pdpp-records/ingest-plan.d.ts.map +1 -0
  366. package/dist/storage/pdpp-records/ingest-plan.js +103 -0
  367. package/dist/storage/pdpp-records/ingest-plan.js.map +1 -0
  368. package/dist/storage/pdpp-records/interface.d.ts +104 -0
  369. package/dist/storage/pdpp-records/interface.d.ts.map +1 -0
  370. package/dist/storage/pdpp-records/interface.js +2 -0
  371. package/dist/storage/pdpp-records/interface.js.map +1 -0
  372. package/dist/storage/pdpp-records/memory-store.d.ts +9 -0
  373. package/dist/storage/pdpp-records/memory-store.d.ts.map +1 -0
  374. package/dist/storage/pdpp-records/memory-store.js +460 -0
  375. package/dist/storage/pdpp-records/memory-store.js.map +1 -0
  376. package/dist/storage/pdpp-records/record-key.d.ts +52 -0
  377. package/dist/storage/pdpp-records/record-key.d.ts.map +1 -0
  378. package/dist/storage/pdpp-records/record-key.js +97 -0
  379. package/dist/storage/pdpp-records/record-key.js.map +1 -0
  380. package/dist/storage/pdpp-records/stream-declaration.d.ts +88 -0
  381. package/dist/storage/pdpp-records/stream-declaration.d.ts.map +1 -0
  382. package/dist/storage/pdpp-records/stream-declaration.js +55 -0
  383. package/dist/storage/pdpp-records/stream-declaration.js.map +1 -0
  384. package/dist/storage/pdpp-records/types.d.ts +138 -0
  385. package/dist/storage/pdpp-records/types.d.ts.map +1 -0
  386. package/dist/storage/pdpp-records/types.js +38 -0
  387. package/dist/storage/pdpp-records/types.js.map +1 -0
  388. package/dist/storage/preview.d.ts +12 -0
  389. package/dist/storage/preview.d.ts.map +1 -0
  390. package/dist/storage/preview.js +239 -0
  391. package/dist/storage/preview.js.map +1 -0
  392. package/dist/sync/data-point-feed.d.ts +35 -0
  393. package/dist/sync/data-point-feed.d.ts.map +1 -0
  394. package/dist/sync/data-point-feed.js +122 -0
  395. package/dist/sync/data-point-feed.js.map +1 -0
  396. package/dist/sync/data-point-id.d.ts +7 -0
  397. package/dist/sync/data-point-id.d.ts.map +1 -0
  398. package/dist/sync/data-point-id.js +16 -0
  399. package/dist/sync/data-point-id.js.map +1 -0
  400. package/dist/sync/delete-data-port.d.ts +50 -0
  401. package/dist/sync/delete-data-port.d.ts.map +1 -0
  402. package/dist/sync/delete-data-port.js +244 -0
  403. package/dist/sync/delete-data-port.js.map +1 -0
  404. package/dist/sync/engine/sync-manager.d.ts +20 -4
  405. package/dist/sync/engine/sync-manager.d.ts.map +1 -1
  406. package/dist/sync/engine/sync-manager.js +131 -32
  407. package/dist/sync/engine/sync-manager.js.map +1 -1
  408. package/dist/sync/index.d.ts +11 -0
  409. package/dist/sync/index.d.ts.map +1 -1
  410. package/dist/sync/index.js +12 -0
  411. package/dist/sync/index.js.map +1 -1
  412. package/dist/sync/issues.d.ts +55 -0
  413. package/dist/sync/issues.d.ts.map +1 -0
  414. package/dist/sync/issues.js +168 -0
  415. package/dist/sync/issues.js.map +1 -0
  416. package/dist/sync/pdpp-import.d.ts +192 -0
  417. package/dist/sync/pdpp-import.d.ts.map +1 -0
  418. package/dist/sync/pdpp-import.js +441 -0
  419. package/dist/sync/pdpp-import.js.map +1 -0
  420. package/dist/sync/pending-blob-deletions.d.ts +29 -0
  421. package/dist/sync/pending-blob-deletions.d.ts.map +1 -0
  422. package/dist/sync/pending-blob-deletions.js +116 -0
  423. package/dist/sync/pending-blob-deletions.js.map +1 -0
  424. package/dist/sync/retry-memory.d.ts +33 -0
  425. package/dist/sync/retry-memory.d.ts.map +1 -0
  426. package/dist/sync/retry-memory.js +68 -0
  427. package/dist/sync/retry-memory.js.map +1 -0
  428. package/dist/sync/scope-deletions.d.ts +155 -0
  429. package/dist/sync/scope-deletions.d.ts.map +1 -0
  430. package/dist/sync/scope-deletions.js +225 -0
  431. package/dist/sync/scope-deletions.js.map +1 -0
  432. package/dist/sync/tombstone.d.ts +27 -0
  433. package/dist/sync/tombstone.d.ts.map +1 -0
  434. package/dist/sync/tombstone.js +28 -0
  435. package/dist/sync/tombstone.js.map +1 -0
  436. package/dist/sync/types.d.ts +2 -0
  437. package/dist/sync/types.d.ts.map +1 -1
  438. package/dist/sync/workers/delete.d.ts +152 -31
  439. package/dist/sync/workers/delete.d.ts.map +1 -1
  440. package/dist/sync/workers/delete.js +457 -55
  441. package/dist/sync/workers/delete.js.map +1 -1
  442. package/dist/sync/workers/download.d.ts +134 -13
  443. package/dist/sync/workers/download.d.ts.map +1 -1
  444. package/dist/sync/workers/download.js +685 -76
  445. package/dist/sync/workers/download.js.map +1 -1
  446. package/dist/sync/workers/upload.d.ts +66 -11
  447. package/dist/sync/workers/upload.d.ts.map +1 -1
  448. package/dist/sync/workers/upload.js +371 -42
  449. package/dist/sync/workers/upload.js.map +1 -1
  450. package/dist/test-utils/e2ee-fixtures.d.ts +94 -0
  451. package/dist/test-utils/e2ee-fixtures.d.ts.map +1 -0
  452. package/dist/test-utils/e2ee-fixtures.js +116 -0
  453. package/dist/test-utils/e2ee-fixtures.js.map +1 -0
  454. package/dist/test-utils/e2ee-gateway.d.ts +61 -0
  455. package/dist/test-utils/e2ee-gateway.d.ts.map +1 -0
  456. package/dist/test-utils/e2ee-gateway.js +248 -0
  457. package/dist/test-utils/e2ee-gateway.js.map +1 -0
  458. package/dist/test-utils/index.d.ts +3 -0
  459. package/dist/test-utils/index.d.ts.map +1 -1
  460. package/dist/test-utils/index.js +3 -0
  461. package/dist/test-utils/index.js.map +1 -1
  462. package/dist/test-utils/memory-storage.d.ts +12 -0
  463. package/dist/test-utils/memory-storage.d.ts.map +1 -0
  464. package/dist/test-utils/memory-storage.js +152 -0
  465. package/dist/test-utils/memory-storage.js.map +1 -0
  466. package/dist/test-utils/wallet.d.ts +6 -0
  467. package/dist/test-utils/wallet.d.ts.map +1 -1
  468. package/dist/test-utils/wallet.js +46 -0
  469. package/dist/test-utils/wallet.js.map +1 -1
  470. package/dist/write/attribution.d.ts +185 -0
  471. package/dist/write/attribution.d.ts.map +1 -0
  472. package/dist/write/attribution.js +450 -0
  473. package/dist/write/attribution.js.map +1 -0
  474. package/dist/write/authorize.d.ts +77 -0
  475. package/dist/write/authorize.d.ts.map +1 -0
  476. package/dist/write/authorize.js +109 -0
  477. package/dist/write/authorize.js.map +1 -0
  478. package/dist/write/index.d.ts +5 -0
  479. package/dist/write/index.d.ts.map +1 -0
  480. package/dist/write/index.js +5 -0
  481. package/dist/write/index.js.map +1 -0
  482. package/dist/write/route.d.ts +61 -0
  483. package/dist/write/route.d.ts.map +1 -0
  484. package/dist/write/route.js +132 -0
  485. package/dist/write/route.js.map +1 -0
  486. package/dist/write/session.d.ts +96 -0
  487. package/dist/write/session.d.ts.map +1 -0
  488. package/dist/write/session.js +136 -0
  489. package/dist/write/session.js.map +1 -0
  490. package/package.json +57 -3
@@ -1,47 +1,295 @@
1
1
  import type { AccessLogWriter } from "../logging/access-log.js";
2
2
  import type { AccessLogReader } from "../logging/access-reader.js";
3
- import { type DataStoragePort, type RuntimeAvailabilityPort, type SchemaResolverPort, type FeeVerifierPort } from "../ports/index.js";
3
+ import { type DataStoragePort, type RuntimeAvailabilityPort } from "../ports/index.js";
4
4
  import type { DataReadPolicyPorts } from "../policy/index.js";
5
5
  import type { SyncManager } from "../sync/index.js";
6
+ import { type ScopeDeletionTracker } from "../sync/scope-deletions.js";
7
+ import type { IndexEntry } from "../storage/index/types.js";
8
+ import { type PdppImporter } from "../sync/pdpp-import.js";
9
+ import { type DeleteScopeResult } from "../sync/workers/delete.js";
6
10
  import { type OAuthDeviceSessionLookup, type OAuthTokenStorePort } from "../contracts/index.js";
7
- import type { DataPortabilityGatewayConfig, GatewayClient } from "@opendatalabs/vana-sdk/browser";
11
+ import type { DataFileEnvelope, DataPortabilityGatewayConfig, GatewayClient } from "@opendatalabs/vana-sdk/browser";
8
12
  import type { ServerSigner } from "../signing/index.js";
13
+ import { type WriterAttribution } from "../write/attribution.js";
14
+ import type { LineageGatewayPort } from "../lineage/gateway.js";
15
+ import { type X402Challenge } from "../payment/index.js";
9
16
  export interface PersonalServerReadAuthInput {
10
17
  request: Request;
11
18
  scope: string;
12
19
  grantId?: string;
13
20
  fileId?: string;
21
+ /**
22
+ * The `collectedAt` version the read is pinned to (cursor-pinned or
23
+ * `?at=`-pinned reads). Payment-enforcing auth ports use it to bind the
24
+ * x402 challenge/settlement to the exact version served, not the latest.
25
+ */
26
+ at?: string;
14
27
  }
15
28
  export interface PersonalServerReadAuthResult {
16
29
  builder?: `0x${string}` | string;
17
30
  grantId?: string;
18
31
  }
32
+ export interface PersonalServerWriteAuthInput {
33
+ request: Request;
34
+ /** Raw scope path param (validated by parseDataScopeContract after auth,
35
+ * same precedence as the owner write path). */
36
+ scope: string;
37
+ }
38
+ export interface PersonalServerScopeAuthInput {
39
+ request: Request;
40
+ /** Raw scope path param; auth ports that need scope binding validate it. */
41
+ scope: string;
42
+ }
43
+ /**
44
+ * Result of authorizing a DELEGATED (write-session) write. A void return
45
+ * means the request was authorized as the owner instead — the ingest then
46
+ * proceeds exactly as today, with no attribution stamped.
47
+ */
48
+ export interface PersonalServerWriteAuthResult {
49
+ builder: `0x${string}`;
50
+ grantId: string;
51
+ /**
52
+ * The live grant's scope entries (read entries bare, write entries
53
+ * `write:`-prefixed). Consumers that need more than the write permission
54
+ * (the derivative compute layer checks read coverage of source scopes)
55
+ * fail closed when this is absent.
56
+ */
57
+ grantScopes?: string[];
58
+ attribution: WriterAttribution;
59
+ /**
60
+ * Rolls back the per-write proof reservation (replay guard). The handler
61
+ * calls it when the write fails BEFORE the record is committed, so the
62
+ * builder can retry with the same still-valid proof.
63
+ */
64
+ releaseProof?: () => Promise<void>;
65
+ }
66
+ /**
67
+ * Result of recognizing a delegated caller WITHOUT a scope to authorize
68
+ * against (see `authorizeWriteSession`). Identity only: no grant policy has
69
+ * been evaluated, so this must never gate access to data — it exists so a
70
+ * route can tell "a builder is calling" from "nobody is authenticated" and
71
+ * answer 404 / 400 instead of a misleading 401.
72
+ */
73
+ export interface PersonalServerWriteSessionResult {
74
+ builder: `0x${string}`;
75
+ grantId: string;
76
+ /** Rolls back the per-call proof reservation; see the write result. */
77
+ releaseProof?: () => Promise<void>;
78
+ }
79
+ /** A read the server actually served, or one it refused. */
80
+ export type PersonalServerReadOutcome = "served" | "denied";
81
+ /** Which surface the read came in on. */
82
+ export type PersonalServerReadSource = "mcp" | "api";
83
+ /**
84
+ * Stand-in for a grant/grantee that does not exist on a denial — a scope that
85
+ * no grant covers has no grant id and no builder to attribute the read to.
86
+ */
87
+ export declare const READ_FULFILLMENT_NONE = "none";
88
+ export interface PersonalServerReadFulfillment {
89
+ /** Grantee address, or `READ_FULFILLMENT_NONE` on a denial. */
90
+ builder: string;
91
+ /** Deny code (e.g. `scope_not_granted`); only set when outcome is denied. */
92
+ denyReason?: string;
93
+ fileId?: string;
94
+ /**
95
+ * Grant id. A denial names the grant the refused call arrived on: the
96
+ * Gateway stores a 32-byte id, so `READ_FULFILLMENT_NONE` is refused there.
97
+ */
98
+ grantId: string;
99
+ /** Absent on surfaces that carry no request metadata (MCP tool calls). */
100
+ ipAddress?: string;
101
+ logId: string;
102
+ outcome: PersonalServerReadOutcome;
103
+ scope: string;
104
+ servedAt: string;
105
+ source: PersonalServerReadSource;
106
+ /** MCP tool name; absent on the plain HTTP read path. */
107
+ tool?: string;
108
+ userAgent?: string;
109
+ }
110
+ export interface PersonalServerReadFulfillmentReporter {
111
+ report(event: PersonalServerReadFulfillment): Promise<void>;
112
+ /**
113
+ * Optional: reporters that only settle served reads (relay-gated Lite) can
114
+ * omit it and denials are simply not recorded.
115
+ */
116
+ reportDenied?(event: PersonalServerReadFulfillment): Promise<void>;
117
+ }
19
118
  export interface PersonalServerApiAuthPort {
20
119
  authorizeOwner(request: Request): Promise<void>;
21
120
  authorizeBuilderList(request: Request): Promise<void>;
121
+ /**
122
+ * Authorize listing versions for one legacy scope. Optional so auth ports
123
+ * without scoped owner-token support keep the existing builder-list gate.
124
+ */
125
+ authorizeScopeVersions?(input: PersonalServerScopeAuthInput): Promise<void>;
22
126
  authorizeBuilderRead(input: PersonalServerReadAuthInput): Promise<PersonalServerReadAuthResult | void>;
127
+ /**
128
+ * Authorize a data ingest (POST /v1/data/:scope). Optional — auth ports
129
+ * that don't support delegated writes omit it and the handler falls back
130
+ * to authorizeOwner, preserving today's owner-only behavior. Ports that DO
131
+ * support write sessions handle BOTH paths here: a recognized session
132
+ * token authorizes as the builder (write policy + attribution proof) and
133
+ * returns the attribution to store; anything else falls through to the
134
+ * owner path and returns void.
135
+ */
136
+ authorizeWrite?(input: PersonalServerWriteAuthInput): Promise<PersonalServerWriteAuthResult | void>;
137
+ /**
138
+ * Recognize a live write session (bearer + `X-Vana-Write-Signature` proof)
139
+ * WITHOUT authorizing a scope. Optional, and identity only: routes use it
140
+ * where there is no scope to authorize against yet — an unknown question
141
+ * id, or a builder list call missing its `?derivedScope=` — so the answer
142
+ * is 404 / 400 rather than the owner gate's 401, which would send every
143
+ * client with a re-handshake-on-401 policy through a pointless handshake.
144
+ * Returns void when the request carries no write-session credential.
145
+ */
146
+ authorizeWriteSession?(request: Request): Promise<PersonalServerWriteSessionResult | void>;
23
147
  }
24
148
  export interface PersonalServerApiLogger {
149
+ debug?(payload: Record<string, unknown>, message: string): void;
25
150
  info?(payload: Record<string, unknown>, message: string): void;
151
+ warn?(payload: Record<string, unknown>, message: string): void;
26
152
  error?(payload: Record<string, unknown>, message: string): void;
27
153
  }
28
154
  export interface PersonalServerIngestSyncManager {
29
155
  trigger(): Promise<void>;
30
156
  notifyNewData?(): void;
31
- /** Propagate a scope deletion to R2 + the gateway before the local delete. */
32
- deleteScopeRemote?(scope: string): Promise<void>;
157
+ /**
158
+ * Durable scope deletion (gateway tombstone -> storage blobs -> local).
159
+ * When absent the DELETE route deletes the local copy only and reports
160
+ * `durable: false`.
161
+ */
162
+ deleteScope?(scope: string): Promise<DeleteScopeResult>;
33
163
  }
34
164
  export interface PersonalServerDataApiDeps {
35
165
  storage: DataStoragePort;
36
166
  auth: PersonalServerApiAuthPort;
37
- schemaResolver?: SchemaResolverPort;
38
167
  accessLogWriter: AccessLogWriter;
39
168
  syncManager?: PersonalServerIngestSyncManager | null;
40
169
  runtimeAvailability?: RuntimeAvailabilityPort;
41
- feeVerifier?: FeeVerifierPort;
170
+ readFulfillmentReporter?: PersonalServerReadFulfillmentReporter;
171
+ /**
172
+ * Read-side memory of gateway tombstones (see sync/scope-deletions.ts for
173
+ * the consistency window). Every read consults it before serving or
174
+ * charging: a scope the gateway reports deleted answers 410 DATA_DELETED
175
+ * whether or not a stale local copy still exists, and a local miss on a
176
+ * deleted scope answers 410 instead of 404 so SDK readers can tell
177
+ * "deleted" from "never had it". Without it reads are local-only.
178
+ */
179
+ scopeDeletions?: ScopeDeletionTracker;
180
+ /**
181
+ * Required when payment is on. Powers two things on GET /v1/data/:scope:
182
+ * - the X402 challenge generation (fee lookup, accessRecord binding)
183
+ * - the forward of validated X-PAYMENTs to gateway.payForOperation
184
+ *
185
+ * Two channels because the SDK client's payForOperation throws plain
186
+ * Errors on non-2xx and loses the gateway's structured error body — we
187
+ * need that body to map gateway 402/409/400 into fresh challenges.
188
+ */
189
+ gateway?: Pick<GatewayClient, "getGrant">;
190
+ /**
191
+ * Gateway base URL. Used for the direct-fetch forwarding of validated
192
+ * X-PAYMENTs to POST /v1/escrow/pay so we can inspect the gateway's
193
+ * structured error body (which the SDK's gateway.payForOperation
194
+ * discards). Required when X402 is enabled.
195
+ */
196
+ gatewayUrl?: string;
197
+ /**
198
+ * Required to construct escrowPaymentDomain + dataRegistryDomain for
199
+ * EIP-712 signature recovery during X-PAYMENT validation.
200
+ */
201
+ gatewayConfig?: DataPortabilityGatewayConfig;
202
+ /**
203
+ * Required for the X402 flow. Signs RECORD_DATA_ACCESS attestations
204
+ * embedded in 402 challenges. Without it, challenges still issue but
205
+ * never include an accessRecord — gateway accepts the resulting payment
206
+ * but the on-chain recordDataAccess won't be scheduled.
207
+ */
208
+ serverSigner?: Pick<ServerSigner, "signRecordDataAccess">;
209
+ serverOwner?: `0x${string}`;
210
+ /**
211
+ * The server's own account address — accessRecord signatures must
212
+ * recover to this for the X-PAYMENT validation to accept them as
213
+ * server-issued.
214
+ */
215
+ serverAddress?: `0x${string}`;
216
+ /**
217
+ * Identifier echoed in the X402 challenge as `accepts[].network`. Pure
218
+ * convention (e.g. "vana-moksha"); the gateway doesn't read it.
219
+ */
220
+ network?: string;
221
+ /**
222
+ * When true, GET /v1/data/:scope enforces the X402 dance: missing /
223
+ * invalid X-PAYMENT → 402 challenge; valid → forward to gateway then
224
+ * serve. When false (default), reads bypass payment entirely.
225
+ */
226
+ paymentEnabled?: boolean;
227
+ /**
228
+ * Test seam for the gateway forwarding fetch. Defaults to the global
229
+ * `fetch`; tests inject a mock that returns specific gateway statuses.
230
+ */
231
+ paymentFetch?: typeof fetch;
232
+ /**
233
+ * Test seam for the per-event recordId / paymentNonce / clock. Production
234
+ * leaves these unset and the X402 module generates fresh values via
235
+ * crypto.getRandomValues / Date.now.
236
+ */
237
+ generateRecordId?: () => `0x${string}`;
238
+ generatePaymentNonce?: () => bigint;
42
239
  now?: () => Date;
43
240
  createLogId?: () => string;
44
241
  logger?: PersonalServerApiLogger;
242
+ /**
243
+ * Gateway access for derivative data (docs/derivative-data-api.md): source
244
+ * lookups for lineage validation on write and the signed lineage read
245
+ * behind GET /v1/data/:scope/lineage. Absent = writes with lineage can
246
+ * only cite local scopes and the lineage read answers 503.
247
+ */
248
+ lineageGateway?: LineageGatewayPort;
249
+ /**
250
+ * Called after a write is committed (owner or builder, JSON or binary).
251
+ * The derivative compute layer uses it to mark questions that read the
252
+ * scope stale; the recompute itself waits for a reader (see onDataRead).
253
+ * Best-effort: a throwing hook is swallowed, the write already succeeded.
254
+ */
255
+ onDataWritten?: (event: {
256
+ scope: string;
257
+ collectedAt: string;
258
+ /** The stamped `$lineage.sources` of the written record, if any. */
259
+ lineageSources?: string[];
260
+ }) => void;
261
+ /**
262
+ * Import a locally-ingested envelope into the PDPP record store, when the
263
+ * deployment mounted one.
264
+ *
265
+ * The same importer, the same envelope shape and the same best-effort
266
+ * contract as the download worker's (`sync/workers/download.ts`). It is
267
+ * here because a `$pdpp`-annotated envelope can reach this server two ways
268
+ * — pulled from the gateway by sync, or POSTed to `/v1/data/:scope` by a
269
+ * local owner-authenticated producer — and only the first offered it to the
270
+ * importer. A record that arrived by the second route was stored and
271
+ * indexed but never became readable over the PDPP resource surface, which
272
+ * made a local producer's write silently half-land.
273
+ *
274
+ * Runs AFTER the legacy write and index, never in place of them, and a
275
+ * failure is logged and swallowed: the record is already durable by the
276
+ * time this runs, so throwing would turn a committed write into a 500 and
277
+ * invite a duplicate on retry.
278
+ */
279
+ pdppImporter?: PdppImporter;
280
+ /**
281
+ * Called on GET /v1/data/:scope once the read is authorized (a live grant
282
+ * covering the scope, or the owner) and the scope is not tombstoned, and
283
+ * before anything is served. The derivative compute layer uses it to run
284
+ * a question whose answer is stale just in time: a source refresh only
285
+ * marks the answer stale, and this is the demand that pays for the
286
+ * recompute. Called for every scope — the compute layer decides whether a
287
+ * question is behind it. Best-effort and non-blocking: a throwing hook is
288
+ * swallowed and the read is never delayed by inference.
289
+ */
290
+ onDataRead?: (event: {
291
+ scope: string;
292
+ }) => void;
45
293
  }
46
294
  export interface PersonalServerAccessLogsApiDeps {
47
295
  auth: Pick<PersonalServerApiAuthPort, "authorizeOwner">;
@@ -54,7 +302,7 @@ export interface PersonalServerSyncApiDeps {
54
302
  }
55
303
  export interface PersonalServerGrantsApiDeps {
56
304
  auth: Pick<PersonalServerApiAuthPort, "authorizeOwner">;
57
- gateway?: Pick<GatewayClient, "getBuilder" | "createGrant" | "listGrantsByUser" | "revokeGrant">;
305
+ gateway?: Pick<GatewayClient, "getBuilder" | "createGrant" | "listGrantsByUser" | "revokeGrant" | "getGrant">;
58
306
  gatewayConfig?: DataPortabilityGatewayConfig;
59
307
  serverOwner?: `0x${string}`;
60
308
  serverSigner?: Pick<ServerSigner, "signGrantRegistration"> & Partial<Pick<ServerSigner, "signGrantRevocation">>;
@@ -76,6 +324,135 @@ export interface PersonalServerOauthTokenApiDeps {
76
324
  export interface PersonalServerApiDispatchOptions {
77
325
  basePath?: string;
78
326
  }
327
+ /**
328
+ * What a 500 out of this layer must leave behind.
329
+ *
330
+ * These handlers run INSIDE the Hono app, so an error they catch never
331
+ * reaches the framework's `onError` — which is the one place that used to
332
+ * log. The result was that any unexpected fault on `/v1/data` answered a
333
+ * bare `INTERNAL_ERROR` and left nothing in stdout, nothing in the access
334
+ * log, and nothing for an operator to work from. Diagnosing one meant
335
+ * patching the server.
336
+ *
337
+ * Deliberately no request body, no headers, no query string and no
338
+ * authorization material: the route and method are the diagnostic value, and
339
+ * a grant id or signed header in a log file is a credential at rest. The
340
+ * request id is minted here when the caller did not supply one so the log
341
+ * line and the response can always be correlated.
342
+ */
343
+ export interface ApiErrorLogContext {
344
+ logger?: PersonalServerApiLogger;
345
+ /** Stable route label, e.g. `GET /v1/data/:scope`. Never the raw path. */
346
+ route: string;
347
+ /** Correlates the log line with the response. Minted if absent. */
348
+ requestId?: string;
349
+ /** Non-secret route parameters worth having in the line (e.g. scope). */
350
+ detail?: Record<string, string | undefined>;
351
+ }
352
+ /**
353
+ * The grant the caller nominates for a read: `?grantId=` or the
354
+ * `x-ps-grant-id` header, the SDK's shape on every read route. Exported so
355
+ * the derivatives status route authorizes with exactly the same inputs as
356
+ * a data read — a credential that reads /v1/data/<scope> must not be
357
+ * refused by /v1/derivatives/status.
358
+ */
359
+ export declare function selectedGrantId(request: Request, url: URL): string | undefined;
360
+ export interface X402CycleInput {
361
+ deps: PersonalServerDataApiDeps;
362
+ request: Request;
363
+ scope: string;
364
+ fileIdParam?: string;
365
+ atParam?: string;
366
+ grantId: string;
367
+ builder: `0x${string}`;
368
+ gateway: Pick<GatewayClient, "getGrant">;
369
+ gatewayConfig: DataPortabilityGatewayConfig;
370
+ gatewayUrl: string;
371
+ }
372
+ export type X402CycleResult = {
373
+ kind: "ok";
374
+ payResponse: unknown;
375
+ } | {
376
+ kind: "challenge";
377
+ body: X402Challenge;
378
+ } | {
379
+ kind: "gateway-error";
380
+ status: number;
381
+ body: unknown;
382
+ };
383
+ /**
384
+ * Run the X402 dispatch for one read:
385
+ *
386
+ * X-PAYMENT absent / malformed / fails local validation
387
+ * → challenge: fresh 402 with current fee + accessRecord
388
+ * X-PAYMENT valid, forward to gateway succeeds
389
+ * → ok: caller proceeds to read the data
390
+ * X-PAYMENT valid, gateway returns 4xx/5xx
391
+ * → gateway-error: relay the gateway's body verbatim so the builder
392
+ * can dispatch (insufficient balance vs. replay vs. race etc.)
393
+ *
394
+ * The gateway POST goes through `fetch` directly (not `gateway.payForOperation`)
395
+ * because the SDK client throws plain Errors and loses the body — which is
396
+ * exactly what we need to distinguish gateway 402 (insufficient balance) from
397
+ * 409 (replay) from 400 (amount mismatch).
398
+ */
399
+ export declare function handleX402Cycle(input: X402CycleInput): Promise<X402CycleResult>;
400
+ /**
401
+ * The deletion that applies to a read of `scope`, or null when the read may
402
+ * be served. `entry` is the local version the read would serve (undefined
403
+ * on a local miss).
404
+ *
405
+ * - A local copy is refused when the gateway holds a tombstone that covers
406
+ * it (see `isEntryCoveredByTombstone`: registry versions and the ingest
407
+ * marker, never clocks). A local re-add on top of the tombstone is served.
408
+ * - A local miss asks the tracker to consult the gateway (bounded by its
409
+ * per-scope verdict cache and failure back-off): the local index cannot
410
+ * tell "deleted long ago" from "never had it".
411
+ * Gateway unreachability never fails the read: the tracker answers from its
412
+ * last known state, which is the documented offline behaviour.
413
+ */
414
+ export declare function resolveReadDeletion(deps: Pick<PersonalServerDataApiDeps, "scopeDeletions" | "serverOwner">, scope: string, entry: ReadDeletionEntry | null | undefined): Promise<{
415
+ scope: string;
416
+ dataPointId: string | null;
417
+ deletedAt: string;
418
+ } | null>;
419
+ /**
420
+ * Throw 410 DATA_DELETED when `resolveReadDeletion` says the read must not be
421
+ * served. Call it before any payment step: a builder must never be charged
422
+ * for a scope the owner deleted.
423
+ */
424
+ export declare function assertScopeNotDeleted(deps: Pick<PersonalServerDataApiDeps, "scopeDeletions" | "serverOwner">, scope: string, entry: ReadDeletionEntry | null | undefined): Promise<void>;
425
+ /** The index fields the deletion gate needs from the entry a read would serve. */
426
+ export type ReadDeletionEntry = Pick<IndexEntry, "version" | "dataPointId" | "afterTombstoneVersion">;
427
+ /** Everything the fulfillment reporters need; see the MCP tool wrapper. */
428
+ export type PersonalServerReadReporterDeps = Pick<PersonalServerDataApiDeps, "logger" | "readFulfillmentReporter">;
429
+ export declare function reportPersonalServerReadFulfillment(deps: PersonalServerReadReporterDeps, event: PersonalServerReadFulfillment): void;
430
+ /**
431
+ * Denials mirror fulfillments but skip the grant filter: a refused read has no
432
+ * grant to filter on, and the record is what proves the refusal happened.
433
+ */
434
+ export declare function reportPersonalServerReadDenial(deps: PersonalServerReadReporterDeps, event: PersonalServerReadFulfillment): void;
435
+ /**
436
+ * True when a read auth result entitles the caller to the owner's view of a
437
+ * record — the same convention as resolveLineageGrantView: no result, or the
438
+ * "owner" / "policy-bypass" sentinels. Everything else is a grantee.
439
+ */
440
+ export declare function isOwnerView(authResult: PersonalServerReadAuthResult | void): boolean;
441
+ /**
442
+ * The envelope view a grantee read is entitled to. The server-stamped
443
+ * `$writtenBy` (writing builder's address, grantId, signature) and
444
+ * `$lineage` (the owner's source data-point ids, dictionary-attackable back
445
+ * to scopes since dataPointId = keccak(owner, scope)) never leave the server
446
+ * on a grantee read: the owner reads them from storage, and grantees get the
447
+ * graph only through the grant-redacted lineage endpoint. When `$lineage` is
448
+ * present, the caller-supplied lineage field it mirrors (top-level `lineage`
449
+ * on a JSON record, `metadata.lineage` on a binary one) carries the same ids
450
+ * and is dropped with it; without the stamp such a field is ordinary user
451
+ * data and stays. Redaction is at serve time only — the stored envelope, its
452
+ * dataHash commitment, and the owner's view are unchanged.
453
+ */
454
+ export declare function redactEnvelopeForGrantee(envelope: DataFileEnvelope): DataFileEnvelope;
455
+ export { redactJsonEnvelopeBytesForGrantee } from "./raw-envelope.js";
79
456
  export declare function handlePersonalServerDataRequest(request: Request, deps: PersonalServerDataApiDeps, options?: PersonalServerApiDispatchOptions): Promise<Response>;
80
457
  export declare function handlePersonalServerAccessLogsRequest(request: Request, deps: PersonalServerAccessLogsApiDeps, options?: PersonalServerApiDispatchOptions): Promise<Response>;
81
458
  export declare function handlePersonalServerSyncRequest(request: Request, deps: PersonalServerSyncApiDeps, options?: PersonalServerApiDispatchOptions): Promise<Response>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAoBL,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EAIzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,4BAA4B,EAC5B,a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