@superbee/core 0.2.0-pre.2 → 0.2.0-pre.20

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 (517) hide show
  1. package/README.md +1000 -0
  2. package/dist/artifact-contract.d.ts +90 -0
  3. package/dist/artifact-contract.d.ts.map +1 -0
  4. package/dist/artifact-contract.js +205 -0
  5. package/dist/artifact-contract.js.map +1 -0
  6. package/dist/backend.d.ts +19 -1
  7. package/dist/backend.d.ts.map +1 -1
  8. package/dist/backend.js +83 -36
  9. package/dist/backend.js.map +1 -1
  10. package/dist/blob-contract.d.ts +80 -0
  11. package/dist/blob-contract.d.ts.map +1 -0
  12. package/dist/blob-contract.js +131 -0
  13. package/dist/blob-contract.js.map +1 -0
  14. package/dist/blob-journal.d.ts +302 -0
  15. package/dist/blob-journal.d.ts.map +1 -0
  16. package/dist/blob-journal.js +540 -0
  17. package/dist/blob-journal.js.map +1 -0
  18. package/dist/body-replace-guards.d.ts +50 -0
  19. package/dist/body-replace-guards.d.ts.map +1 -0
  20. package/dist/body-replace-guards.js +158 -0
  21. package/dist/body-replace-guards.js.map +1 -0
  22. package/dist/builtin-recipes/content.d.ts +93 -0
  23. package/dist/builtin-recipes/content.d.ts.map +1 -0
  24. package/dist/builtin-recipes/content.js +288 -0
  25. package/dist/builtin-recipes/content.js.map +1 -0
  26. package/dist/builtin-recipes.d.ts +10 -0
  27. package/dist/builtin-recipes.d.ts.map +1 -0
  28. package/dist/builtin-recipes.js +97 -0
  29. package/dist/builtin-recipes.js.map +1 -0
  30. package/dist/bundle-health/index.d.ts +14 -0
  31. package/dist/bundle-health/index.d.ts.map +1 -0
  32. package/dist/bundle-health/index.js +12 -0
  33. package/dist/bundle-health/index.js.map +1 -0
  34. package/dist/bundle-health/kind-findings.d.ts +44 -0
  35. package/dist/bundle-health/kind-findings.d.ts.map +1 -0
  36. package/dist/bundle-health/kind-findings.js +68 -0
  37. package/dist/bundle-health/kind-findings.js.map +1 -0
  38. package/dist/bundle-health/legacy-page.d.ts +39 -0
  39. package/dist/bundle-health/legacy-page.d.ts.map +1 -0
  40. package/dist/bundle-health/legacy-page.js +50 -0
  41. package/dist/bundle-health/legacy-page.js.map +1 -0
  42. package/dist/bundle-health/report.d.ts +202 -0
  43. package/dist/bundle-health/report.d.ts.map +1 -0
  44. package/dist/bundle-health/report.js +438 -0
  45. package/dist/bundle-health/report.js.map +1 -0
  46. package/dist/bundle-ops.d.ts +1 -1
  47. package/dist/bundle-ops.d.ts.map +1 -1
  48. package/dist/bundle-ops.js +2 -2
  49. package/dist/bundle-ops.js.map +1 -1
  50. package/dist/bundle.d.ts +2 -1
  51. package/dist/bundle.d.ts.map +1 -1
  52. package/dist/bundle.js +3 -3
  53. package/dist/bundle.js.map +1 -1
  54. package/dist/code-point-order.d.ts +8 -0
  55. package/dist/code-point-order.d.ts.map +1 -0
  56. package/dist/code-point-order.js +20 -0
  57. package/dist/code-point-order.js.map +1 -0
  58. package/dist/connectors.d.ts +230 -0
  59. package/dist/connectors.d.ts.map +1 -0
  60. package/dist/connectors.js +1150 -0
  61. package/dist/connectors.js.map +1 -0
  62. package/dist/cross-bundle.d.ts +135 -0
  63. package/dist/cross-bundle.d.ts.map +1 -0
  64. package/dist/cross-bundle.js +186 -0
  65. package/dist/cross-bundle.js.map +1 -0
  66. package/dist/dependencies.d.ts +94 -0
  67. package/dist/dependencies.d.ts.map +1 -0
  68. package/dist/dependencies.js +180 -0
  69. package/dist/dependencies.js.map +1 -0
  70. package/dist/document-codec.d.ts +6 -1
  71. package/dist/document-codec.d.ts.map +1 -1
  72. package/dist/document-codec.js +8 -4
  73. package/dist/document-codec.js.map +1 -1
  74. package/dist/document-field-actions.d.ts +31 -1
  75. package/dist/document-field-actions.d.ts.map +1 -1
  76. package/dist/document-field-actions.js +137 -34
  77. package/dist/document-field-actions.js.map +1 -1
  78. package/dist/document-mutation.d.ts +22 -10
  79. package/dist/document-mutation.d.ts.map +1 -1
  80. package/dist/document-mutation.js +58 -27
  81. package/dist/document-mutation.js.map +1 -1
  82. package/dist/document-write-policy.d.ts.map +1 -1
  83. package/dist/document-write-policy.js +4 -2
  84. package/dist/document-write-policy.js.map +1 -1
  85. package/dist/engine.d.ts +9 -2
  86. package/dist/engine.d.ts.map +1 -1
  87. package/dist/engine.js +11 -4
  88. package/dist/engine.js.map +1 -1
  89. package/dist/file-journaled-backend-internal.d.ts +21 -0
  90. package/dist/file-journaled-backend-internal.d.ts.map +1 -0
  91. package/dist/file-journaled-backend-internal.js +12 -0
  92. package/dist/file-journaled-backend-internal.js.map +1 -0
  93. package/dist/file-journaled-backend.d.ts +200 -0
  94. package/dist/file-journaled-backend.d.ts.map +1 -0
  95. package/dist/file-journaled-backend.js +1334 -0
  96. package/dist/file-journaled-backend.js.map +1 -0
  97. package/dist/filesystem-host.d.ts +15 -0
  98. package/dist/filesystem-host.d.ts.map +1 -0
  99. package/dist/filesystem-host.js +20 -0
  100. package/dist/filesystem-host.js.map +1 -0
  101. package/dist/filesystem-identity.d.ts +86 -4
  102. package/dist/filesystem-identity.d.ts.map +1 -1
  103. package/dist/filesystem-identity.js +338 -102
  104. package/dist/filesystem-identity.js.map +1 -1
  105. package/dist/filesystem-lock.d.ts +16 -3
  106. package/dist/filesystem-lock.d.ts.map +1 -1
  107. package/dist/filesystem-lock.js +323 -77
  108. package/dist/filesystem-lock.js.map +1 -1
  109. package/dist/filesystem-push-role.d.ts +77 -0
  110. package/dist/filesystem-push-role.d.ts.map +1 -0
  111. package/dist/filesystem-push-role.js +165 -0
  112. package/dist/filesystem-push-role.js.map +1 -0
  113. package/dist/filesystem.d.ts +17 -0
  114. package/dist/filesystem.d.ts.map +1 -0
  115. package/dist/filesystem.js +18 -0
  116. package/dist/filesystem.js.map +1 -0
  117. package/dist/frontmatter.d.ts +8 -0
  118. package/dist/frontmatter.d.ts.map +1 -1
  119. package/dist/frontmatter.js +14 -4
  120. package/dist/frontmatter.js.map +1 -1
  121. package/dist/governed-body-write.d.ts +106 -0
  122. package/dist/governed-body-write.d.ts.map +1 -0
  123. package/dist/governed-body-write.js +251 -0
  124. package/dist/governed-body-write.js.map +1 -0
  125. package/dist/host-policy-snapshot.d.ts +9 -0
  126. package/dist/host-policy-snapshot.d.ts.map +1 -0
  127. package/dist/host-policy-snapshot.js +33 -0
  128. package/dist/host-policy-snapshot.js.map +1 -0
  129. package/dist/host-text.d.ts +31 -0
  130. package/dist/host-text.d.ts.map +1 -0
  131. package/dist/host-text.js +77 -0
  132. package/dist/host-text.js.map +1 -0
  133. package/dist/hosted-client/binding.d.ts +7 -0
  134. package/dist/hosted-client/binding.d.ts.map +1 -0
  135. package/dist/hosted-client/binding.js +10 -0
  136. package/dist/hosted-client/binding.js.map +1 -0
  137. package/dist/hosted-client/blob-delivery.d.ts +67 -0
  138. package/dist/hosted-client/blob-delivery.d.ts.map +1 -0
  139. package/dist/hosted-client/blob-delivery.js +169 -0
  140. package/dist/hosted-client/blob-delivery.js.map +1 -0
  141. package/dist/hosted-client/blob-write.d.ts +386 -0
  142. package/dist/hosted-client/blob-write.d.ts.map +1 -0
  143. package/dist/hosted-client/blob-write.js +770 -0
  144. package/dist/hosted-client/blob-write.js.map +1 -0
  145. package/dist/hosted-client/bundle-listing.d.ts +46 -0
  146. package/dist/hosted-client/bundle-listing.d.ts.map +1 -0
  147. package/dist/hosted-client/bundle-listing.js +36 -0
  148. package/dist/hosted-client/bundle-listing.js.map +1 -0
  149. package/dist/hosted-client/client.d.ts +219 -0
  150. package/dist/hosted-client/client.d.ts.map +1 -0
  151. package/dist/hosted-client/client.js +309 -0
  152. package/dist/hosted-client/client.js.map +1 -0
  153. package/dist/hosted-client/directory.d.ts +46 -0
  154. package/dist/hosted-client/directory.d.ts.map +1 -0
  155. package/dist/hosted-client/directory.js +74 -0
  156. package/dist/hosted-client/directory.js.map +1 -0
  157. package/dist/hosted-client/errors.d.ts +26 -0
  158. package/dist/hosted-client/errors.d.ts.map +1 -0
  159. package/dist/hosted-client/errors.js +35 -0
  160. package/dist/hosted-client/errors.js.map +1 -0
  161. package/dist/hosted-client/inbox.d.ts +320 -0
  162. package/dist/hosted-client/inbox.d.ts.map +1 -0
  163. package/dist/hosted-client/inbox.js +379 -0
  164. package/dist/hosted-client/inbox.js.map +1 -0
  165. package/dist/hosted-client/index.d.ts +30 -0
  166. package/dist/hosted-client/index.d.ts.map +1 -0
  167. package/dist/hosted-client/index.js +32 -0
  168. package/dist/hosted-client/index.js.map +1 -0
  169. package/dist/hosted-client/journal.d.ts +103 -0
  170. package/dist/hosted-client/journal.d.ts.map +1 -0
  171. package/dist/hosted-client/journal.js +464 -0
  172. package/dist/hosted-client/journal.js.map +1 -0
  173. package/dist/hosted-client/node.d.ts +74 -0
  174. package/dist/hosted-client/node.d.ts.map +1 -0
  175. package/dist/hosted-client/node.js +219 -0
  176. package/dist/hosted-client/node.js.map +1 -0
  177. package/dist/hosted-client/reference.d.ts +12 -0
  178. package/dist/hosted-client/reference.d.ts.map +1 -0
  179. package/dist/hosted-client/reference.js +29 -0
  180. package/dist/hosted-client/reference.js.map +1 -0
  181. package/dist/hosted-client/write.d.ts +217 -0
  182. package/dist/hosted-client/write.d.ts.map +1 -0
  183. package/dist/hosted-client/write.js +418 -0
  184. package/dist/hosted-client/write.js.map +1 -0
  185. package/dist/hosted-transport/answer-rows.d.ts +243 -0
  186. package/dist/hosted-transport/answer-rows.d.ts.map +1 -0
  187. package/dist/hosted-transport/answer-rows.js +454 -0
  188. package/dist/hosted-transport/answer-rows.js.map +1 -0
  189. package/dist/hosted-transport/blob-reads.d.ts +35 -0
  190. package/dist/hosted-transport/blob-reads.d.ts.map +1 -0
  191. package/dist/hosted-transport/blob-reads.js +179 -0
  192. package/dist/hosted-transport/blob-reads.js.map +1 -0
  193. package/dist/hosted-transport/blob-write.d.ts +34 -0
  194. package/dist/hosted-transport/blob-write.d.ts.map +1 -0
  195. package/dist/hosted-transport/blob-write.js +115 -0
  196. package/dist/hosted-transport/blob-write.js.map +1 -0
  197. package/dist/hosted-transport/carrier.d.ts +151 -0
  198. package/dist/hosted-transport/carrier.d.ts.map +1 -0
  199. package/dist/hosted-transport/carrier.js +260 -0
  200. package/dist/hosted-transport/carrier.js.map +1 -0
  201. package/dist/hosted-transport/history-pages.d.ts +55 -0
  202. package/dist/hosted-transport/history-pages.d.ts.map +1 -0
  203. package/dist/hosted-transport/history-pages.js +69 -0
  204. package/dist/hosted-transport/history-pages.js.map +1 -0
  205. package/dist/hosted-transport/index.d.ts +18 -0
  206. package/dist/hosted-transport/index.d.ts.map +1 -0
  207. package/dist/hosted-transport/index.js +18 -0
  208. package/dist/hosted-transport/index.js.map +1 -0
  209. package/dist/hosted-transport/operations.d.ts +85 -0
  210. package/dist/hosted-transport/operations.d.ts.map +1 -0
  211. package/dist/hosted-transport/operations.js +128 -0
  212. package/dist/hosted-transport/operations.js.map +1 -0
  213. package/dist/hosted-transport/paged-reads.d.ts +87 -0
  214. package/dist/hosted-transport/paged-reads.d.ts.map +1 -0
  215. package/dist/hosted-transport/paged-reads.js +238 -0
  216. package/dist/hosted-transport/paged-reads.js.map +1 -0
  217. package/dist/hosted-transport/read-adapter.d.ts +256 -0
  218. package/dist/hosted-transport/read-adapter.d.ts.map +1 -0
  219. package/dist/hosted-transport/read-adapter.js +568 -0
  220. package/dist/hosted-transport/read-adapter.js.map +1 -0
  221. package/dist/hosted-transport/root-write.d.ts +114 -0
  222. package/dist/hosted-transport/root-write.d.ts.map +1 -0
  223. package/dist/hosted-transport/root-write.js +171 -0
  224. package/dist/hosted-transport/root-write.js.map +1 -0
  225. package/dist/hosted-transport/whole-document-transport.d.ts +204 -0
  226. package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -0
  227. package/dist/hosted-transport/whole-document-transport.js +447 -0
  228. package/dist/hosted-transport/whole-document-transport.js.map +1 -0
  229. package/dist/index.d.ts +34 -10
  230. package/dist/index.d.ts.map +1 -1
  231. package/dist/index.js +26 -8
  232. package/dist/index.js.map +1 -1
  233. package/dist/indexeddb-backend.d.ts +28 -6
  234. package/dist/indexeddb-backend.d.ts.map +1 -1
  235. package/dist/indexeddb-backend.js +471 -92
  236. package/dist/indexeddb-backend.js.map +1 -1
  237. package/dist/journaled-backend.d.ts +247 -10
  238. package/dist/journaled-backend.d.ts.map +1 -1
  239. package/dist/journaled-backend.js +302 -1
  240. package/dist/journaled-backend.js.map +1 -1
  241. package/dist/kind-authoring.d.ts +170 -0
  242. package/dist/kind-authoring.d.ts.map +1 -0
  243. package/dist/kind-authoring.js +451 -0
  244. package/dist/kind-authoring.js.map +1 -0
  245. package/dist/kind-conformance-error.d.ts +15 -0
  246. package/dist/kind-conformance-error.d.ts.map +1 -0
  247. package/dist/kind-conformance-error.js +20 -0
  248. package/dist/kind-conformance-error.js.map +1 -0
  249. package/dist/kind-coverage.d.ts +99 -0
  250. package/dist/kind-coverage.d.ts.map +1 -0
  251. package/dist/kind-coverage.js +186 -0
  252. package/dist/kind-coverage.js.map +1 -0
  253. package/dist/kind-field-mutation.d.ts +4 -0
  254. package/dist/kind-field-mutation.d.ts.map +1 -1
  255. package/dist/kind-field-mutation.js +28 -3
  256. package/dist/kind-field-mutation.js.map +1 -1
  257. package/dist/kinds-load.js +4 -4
  258. package/dist/kinds-load.js.map +1 -1
  259. package/dist/kinds.d.ts +65 -2
  260. package/dist/kinds.d.ts.map +1 -1
  261. package/dist/kinds.js +341 -21
  262. package/dist/kinds.js.map +1 -1
  263. package/dist/link-types.d.ts +26 -0
  264. package/dist/link-types.d.ts.map +1 -0
  265. package/dist/link-types.js +57 -0
  266. package/dist/link-types.js.map +1 -0
  267. package/dist/links.d.ts +21 -3
  268. package/dist/links.d.ts.map +1 -1
  269. package/dist/links.js +213 -14
  270. package/dist/links.js.map +1 -1
  271. package/dist/managed-document-metadata.d.ts +2 -0
  272. package/dist/managed-document-metadata.d.ts.map +1 -0
  273. package/dist/managed-document-metadata.js +9 -0
  274. package/dist/managed-document-metadata.js.map +1 -0
  275. package/dist/memory-backend.d.ts +2 -2
  276. package/dist/memory-backend.d.ts.map +1 -1
  277. package/dist/memory-backend.js +26 -11
  278. package/dist/memory-backend.js.map +1 -1
  279. package/dist/paths.d.ts +16 -0
  280. package/dist/paths.d.ts.map +1 -1
  281. package/dist/paths.js +25 -0
  282. package/dist/paths.js.map +1 -1
  283. package/dist/platform.d.ts +13 -2
  284. package/dist/platform.d.ts.map +1 -1
  285. package/dist/platform.js +16 -0
  286. package/dist/platform.js.map +1 -1
  287. package/dist/portable-export.d.ts +119 -0
  288. package/dist/portable-export.d.ts.map +1 -0
  289. package/dist/portable-export.js +501 -0
  290. package/dist/portable-export.js.map +1 -0
  291. package/dist/publication-filesystem.d.ts +1 -1
  292. package/dist/publication-filesystem.d.ts.map +1 -1
  293. package/dist/publication-filesystem.js +1 -1
  294. package/dist/publication-filesystem.js.map +1 -1
  295. package/dist/qualified-links.d.ts +67 -0
  296. package/dist/qualified-links.d.ts.map +1 -0
  297. package/dist/qualified-links.js +117 -0
  298. package/dist/qualified-links.js.map +1 -0
  299. package/dist/query-filter.d.ts +16 -2
  300. package/dist/query-filter.d.ts.map +1 -1
  301. package/dist/query-filter.js +40 -1
  302. package/dist/query-filter.js.map +1 -1
  303. package/dist/query-order.d.ts +22 -0
  304. package/dist/query-order.d.ts.map +1 -0
  305. package/dist/query-order.js +42 -0
  306. package/dist/query-order.js.map +1 -0
  307. package/dist/recipe-lifecycle/errors.d.ts +94 -0
  308. package/dist/recipe-lifecycle/errors.d.ts.map +1 -0
  309. package/dist/recipe-lifecycle/errors.js +122 -0
  310. package/dist/recipe-lifecycle/errors.js.map +1 -0
  311. package/dist/recipe-lifecycle/evolution.d.ts +75 -0
  312. package/dist/recipe-lifecycle/evolution.d.ts.map +1 -0
  313. package/dist/recipe-lifecycle/evolution.js +789 -0
  314. package/dist/recipe-lifecycle/evolution.js.map +1 -0
  315. package/dist/recipe-lifecycle/index.d.ts +24 -0
  316. package/dist/recipe-lifecycle/index.d.ts.map +1 -0
  317. package/dist/recipe-lifecycle/index.js +20 -0
  318. package/dist/recipe-lifecycle/index.js.map +1 -0
  319. package/dist/recipe-lifecycle/install.d.ts +126 -0
  320. package/dist/recipe-lifecycle/install.d.ts.map +1 -0
  321. package/dist/recipe-lifecycle/install.js +511 -0
  322. package/dist/recipe-lifecycle/install.js.map +1 -0
  323. package/dist/recipe-lifecycle/legacy-aliases.d.ts +16 -0
  324. package/dist/recipe-lifecycle/legacy-aliases.d.ts.map +1 -0
  325. package/dist/recipe-lifecycle/legacy-aliases.js +51 -0
  326. package/dist/recipe-lifecycle/legacy-aliases.js.map +1 -0
  327. package/dist/recipe-lifecycle/stamp.d.ts +136 -0
  328. package/dist/recipe-lifecycle/stamp.d.ts.map +1 -0
  329. package/dist/recipe-lifecycle/stamp.js +326 -0
  330. package/dist/recipe-lifecycle/stamp.js.map +1 -0
  331. package/dist/recipes.d.ts +29 -1
  332. package/dist/recipes.d.ts.map +1 -1
  333. package/dist/recipes.js +137 -1
  334. package/dist/recipes.js.map +1 -1
  335. package/dist/record-overlay/apply.d.ts +43 -0
  336. package/dist/record-overlay/apply.d.ts.map +1 -0
  337. package/dist/record-overlay/apply.js +527 -0
  338. package/dist/record-overlay/apply.js.map +1 -0
  339. package/dist/record-overlay/canonical.d.ts +22 -0
  340. package/dist/record-overlay/canonical.d.ts.map +1 -0
  341. package/dist/record-overlay/canonical.js +47 -0
  342. package/dist/record-overlay/canonical.js.map +1 -0
  343. package/dist/record-overlay/digest.d.ts +4 -0
  344. package/dist/record-overlay/digest.d.ts.map +1 -0
  345. package/dist/record-overlay/digest.js +11 -0
  346. package/dist/record-overlay/digest.js.map +1 -0
  347. package/dist/record-overlay/errors.d.ts +44 -0
  348. package/dist/record-overlay/errors.d.ts.map +1 -0
  349. package/dist/record-overlay/errors.js +55 -0
  350. package/dist/record-overlay/errors.js.map +1 -0
  351. package/dist/record-overlay/findings.d.ts +5 -0
  352. package/dist/record-overlay/findings.d.ts.map +1 -0
  353. package/dist/record-overlay/findings.js +83 -0
  354. package/dist/record-overlay/findings.js.map +1 -0
  355. package/dist/record-overlay/index.d.ts +23 -0
  356. package/dist/record-overlay/index.d.ts.map +1 -0
  357. package/dist/record-overlay/index.js +21 -0
  358. package/dist/record-overlay/index.js.map +1 -0
  359. package/dist/record-overlay/plan.d.ts +12 -0
  360. package/dist/record-overlay/plan.d.ts.map +1 -0
  361. package/dist/record-overlay/plan.js +285 -0
  362. package/dist/record-overlay/plan.js.map +1 -0
  363. package/dist/record-overlay/policy.d.ts +69 -0
  364. package/dist/record-overlay/policy.d.ts.map +1 -0
  365. package/dist/record-overlay/policy.js +228 -0
  366. package/dist/record-overlay/policy.js.map +1 -0
  367. package/dist/record-overlay/redact.d.ts +3 -0
  368. package/dist/record-overlay/redact.d.ts.map +1 -0
  369. package/dist/record-overlay/redact.js +27 -0
  370. package/dist/record-overlay/redact.js.map +1 -0
  371. package/dist/record-overlay/signal-kind.d.ts +30 -0
  372. package/dist/record-overlay/signal-kind.d.ts.map +1 -0
  373. package/dist/record-overlay/signal-kind.js +38 -0
  374. package/dist/record-overlay/signal-kind.js.map +1 -0
  375. package/dist/record-overlay/signal-text.d.ts +45 -0
  376. package/dist/record-overlay/signal-text.d.ts.map +1 -0
  377. package/dist/record-overlay/signal-text.js +116 -0
  378. package/dist/record-overlay/signal-text.js.map +1 -0
  379. package/dist/record-overlay/source-index.d.ts +19 -0
  380. package/dist/record-overlay/source-index.d.ts.map +1 -0
  381. package/dist/record-overlay/source-index.js +102 -0
  382. package/dist/record-overlay/source-index.js.map +1 -0
  383. package/dist/record-overlay/types.d.ts +291 -0
  384. package/dist/record-overlay/types.d.ts.map +1 -0
  385. package/dist/record-overlay/types.js +2 -0
  386. package/dist/record-overlay/types.js.map +1 -0
  387. package/dist/remote-backend.d.ts +67 -67
  388. package/dist/remote-backend.d.ts.map +1 -1
  389. package/dist/remote-backend.js +169 -201
  390. package/dist/remote-backend.js.map +1 -1
  391. package/dist/remote-document-codec.d.ts +15 -0
  392. package/dist/remote-document-codec.d.ts.map +1 -0
  393. package/dist/remote-document-codec.js +103 -0
  394. package/dist/remote-document-codec.js.map +1 -0
  395. package/dist/remote-error.d.ts +38 -0
  396. package/dist/remote-error.d.ts.map +1 -0
  397. package/dist/remote-error.js +59 -0
  398. package/dist/remote-error.js.map +1 -0
  399. package/dist/remote-operations.d.ts +6 -3
  400. package/dist/remote-operations.d.ts.map +1 -1
  401. package/dist/remote-operations.js +23 -5
  402. package/dist/remote-operations.js.map +1 -1
  403. package/dist/remote-parsers.d.ts +86 -0
  404. package/dist/remote-parsers.d.ts.map +1 -0
  405. package/dist/remote-parsers.js +181 -0
  406. package/dist/remote-parsers.js.map +1 -0
  407. package/dist/remote.d.ts +5 -2
  408. package/dist/remote.d.ts.map +1 -1
  409. package/dist/remote.js +5 -1
  410. package/dist/remote.js.map +1 -1
  411. package/dist/search/backend-source.d.ts +6 -0
  412. package/dist/search/backend-source.d.ts.map +1 -0
  413. package/dist/search/backend-source.js +33 -0
  414. package/dist/search/backend-source.js.map +1 -0
  415. package/dist/search/contract.d.ts +151 -0
  416. package/dist/search/contract.d.ts.map +1 -0
  417. package/dist/search/contract.js +78 -0
  418. package/dist/search/contract.js.map +1 -0
  419. package/dist/search/errors.d.ts +30 -0
  420. package/dist/search/errors.d.ts.map +1 -0
  421. package/dist/search/errors.js +50 -0
  422. package/dist/search/errors.js.map +1 -0
  423. package/dist/search/identity.d.ts +12 -0
  424. package/dist/search/identity.d.ts.map +1 -0
  425. package/dist/search/identity.js +90 -0
  426. package/dist/search/identity.js.map +1 -0
  427. package/dist/search/index.d.ts +16 -0
  428. package/dist/search/index.d.ts.map +1 -0
  429. package/dist/search/index.js +15 -0
  430. package/dist/search/index.js.map +1 -0
  431. package/dist/search/memory-source.d.ts +36 -0
  432. package/dist/search/memory-source.d.ts.map +1 -0
  433. package/dist/search/memory-source.js +235 -0
  434. package/dist/search/memory-source.js.map +1 -0
  435. package/dist/search/rank.d.ts +34 -0
  436. package/dist/search/rank.d.ts.map +1 -0
  437. package/dist/search/rank.js +129 -0
  438. package/dist/search/rank.js.map +1 -0
  439. package/dist/search/row-text.d.ts +38 -0
  440. package/dist/search/row-text.d.ts.map +1 -0
  441. package/dist/search/row-text.js +88 -0
  442. package/dist/search/row-text.js.map +1 -0
  443. package/dist/search/search.d.ts +28 -0
  444. package/dist/search/search.d.ts.map +1 -0
  445. package/dist/search/search.js +257 -0
  446. package/dist/search/search.js.map +1 -0
  447. package/dist/search/source.d.ts +67 -0
  448. package/dist/search/source.d.ts.map +1 -0
  449. package/dist/search/source.js +2 -0
  450. package/dist/search/source.js.map +1 -0
  451. package/dist/search/text.d.ts +47 -0
  452. package/dist/search/text.d.ts.map +1 -0
  453. package/dist/search/text.js +148 -0
  454. package/dist/search/text.js.map +1 -0
  455. package/dist/site-capabilities.d.ts +339 -0
  456. package/dist/site-capabilities.d.ts.map +1 -0
  457. package/dist/site-capabilities.js +717 -0
  458. package/dist/site-capabilities.js.map +1 -0
  459. package/dist/source-engine/guard.d.ts +82 -0
  460. package/dist/source-engine/guard.d.ts.map +1 -0
  461. package/dist/source-engine/guard.js +396 -0
  462. package/dist/source-engine/guard.js.map +1 -0
  463. package/dist/source-engine/index.d.ts +24 -0
  464. package/dist/source-engine/index.d.ts.map +1 -0
  465. package/dist/source-engine/index.js +20 -0
  466. package/dist/source-engine/index.js.map +1 -0
  467. package/dist/source-engine/machine-state.d.ts +74 -0
  468. package/dist/source-engine/machine-state.d.ts.map +1 -0
  469. package/dist/source-engine/machine-state.js +48 -0
  470. package/dist/source-engine/machine-state.js.map +1 -0
  471. package/dist/source-engine/observe.d.ts +18 -0
  472. package/dist/source-engine/observe.d.ts.map +1 -0
  473. package/dist/source-engine/observe.js +598 -0
  474. package/dist/source-engine/observe.js.map +1 -0
  475. package/dist/source-engine/robots.d.ts +53 -0
  476. package/dist/source-engine/robots.d.ts.map +1 -0
  477. package/dist/source-engine/robots.js +158 -0
  478. package/dist/source-engine/robots.js.map +1 -0
  479. package/dist/source-engine/types.d.ts +285 -0
  480. package/dist/source-engine/types.d.ts.map +1 -0
  481. package/dist/source-engine/types.js +2 -0
  482. package/dist/source-engine/types.js.map +1 -0
  483. package/dist/source-harness/conformance.d.ts +16 -0
  484. package/dist/source-harness/conformance.d.ts.map +1 -0
  485. package/dist/source-harness/conformance.js +265 -0
  486. package/dist/source-harness/conformance.js.map +1 -0
  487. package/dist/source-harness/fixture.d.ts +95 -0
  488. package/dist/source-harness/fixture.d.ts.map +1 -0
  489. package/dist/source-harness/fixture.js +261 -0
  490. package/dist/source-harness/fixture.js.map +1 -0
  491. package/dist/source-harness/index.d.ts +22 -0
  492. package/dist/source-harness/index.d.ts.map +1 -0
  493. package/dist/source-harness/index.js +19 -0
  494. package/dist/source-harness/index.js.map +1 -0
  495. package/dist/source-harness/peer.d.ts +74 -0
  496. package/dist/source-harness/peer.d.ts.map +1 -0
  497. package/dist/source-harness/peer.js +106 -0
  498. package/dist/source-harness/peer.js.map +1 -0
  499. package/dist/storage.d.ts +6 -2
  500. package/dist/storage.d.ts.map +1 -1
  501. package/dist/storage.js +4 -1
  502. package/dist/storage.js.map +1 -1
  503. package/dist/types.d.ts +33 -5
  504. package/dist/types.d.ts.map +1 -1
  505. package/dist/uncertain-write.d.ts +156 -19
  506. package/dist/uncertain-write.d.ts.map +1 -1
  507. package/dist/uncertain-write.js +90 -31
  508. package/dist/uncertain-write.js.map +1 -1
  509. package/dist/versioning.d.ts +9 -4
  510. package/dist/versioning.d.ts.map +1 -1
  511. package/dist/versioning.js +9 -4
  512. package/dist/versioning.js.map +1 -1
  513. package/dist/write-identity.d.ts +5 -0
  514. package/dist/write-identity.d.ts.map +1 -0
  515. package/dist/write-identity.js +9 -0
  516. package/dist/write-identity.js.map +1 -0
  517. package/package.json +94 -2
@@ -0,0 +1,265 @@
1
+ /**
2
+ * The transport conformance suite. The engine's guard cannot see headers a transport adds after
3
+ * it, so every transport proves against a scripted peer that it sends the credential only when the
4
+ * engine's `credentialHost` and its own exact host match agree (lookalike hosts included), returns
5
+ * redirects unfollowed and refuses a body over the bound, and, behind the engine, that a
6
+ * cross-host or private-address redirect reaches nothing. It returns rows rather than asserting,
7
+ * so it runs under any test runner.
8
+ */
9
+ import { bindSourceFeed, credentialHosts, parseConnectorDoc } from "../connectors.js";
10
+ import { buildKindRegistry } from "../kinds.js";
11
+ import { MemoryMachineState } from "../source-engine/machine-state.js";
12
+ import { observeSource } from "../source-engine/observe.js";
13
+ import { fetchIdentity } from "../source-engine/robots.js";
14
+ import { ScriptedPeer } from "./peer.js";
15
+ export const CONFORMANCE_SCENARIOS = Object.freeze([
16
+ "credential-reaches-its-host",
17
+ "credential-stays-on-its-host",
18
+ "redirect-returned-unfollowed",
19
+ "cross-host-redirect-refused",
20
+ "body-over-bound-refused",
21
+ "private-redirect-refused",
22
+ ]);
23
+ const CREDENTIAL_HOST = "api.github.com";
24
+ const KEYLESS_HOST = "feeds.example.org";
25
+ const OUTSIDE_HOST = "collector.example.net";
26
+ const PROBE = "conformance-probe";
27
+ const IDENTITY = fetchIdentity("SuperbeeConformance/1 (+https://superbee.example.org/conformance)");
28
+ const PRIVATE_TARGETS = Object.freeze([
29
+ "https://127.0.0.1/latest",
30
+ "https://10.0.0.5/internal",
31
+ "https://[::1]/x",
32
+ "https://[::ffff:127.0.0.1]/x",
33
+ "https://169.254.169.254/latest/meta-data/",
34
+ "https://metadata.google.internal/computeMetadata/v1/",
35
+ "https://localhost/x",
36
+ "https://api.github.com:8443/x",
37
+ "http://api.github.com/x",
38
+ ]);
39
+ /**
40
+ * Requests that must never carry the credential: hosts that only look like the credential host,
41
+ * whatever the engine says, and the credential host itself when the engine says it is not one.
42
+ */
43
+ const CREDENTIAL_PROBES = Object.freeze([
44
+ { name: "a declared keyless host", url: `https://${KEYLESS_HOST}/feed.json`, credentialHost: true },
45
+ { name: "an undeclared host", url: `https://${OUTSIDE_HOST}/collect`, credentialHost: true },
46
+ { name: "the credential host over http", url: `http://${CREDENTIAL_HOST}/repos/octo/probe/issues`, credentialHost: true },
47
+ { name: "a host starting with the credential host", url: `https://${CREDENTIAL_HOST}.${OUTSIDE_HOST}/x`, credentialHost: true },
48
+ { name: "a host ending with the credential host without a dot", url: `https://evil${CREDENTIAL_HOST}/x`, credentialHost: true },
49
+ { name: "the credential host with a trailing dot", url: `https://${CREDENTIAL_HOST}./x`, credentialHost: true },
50
+ { name: "the credential host as userinfo", url: `https://${CREDENTIAL_HOST}@${OUTSIDE_HOST}/x`, credentialHost: true },
51
+ { name: "the credential host on another port", url: `https://${CREDENTIAL_HOST}:8443/x`, credentialHost: true },
52
+ { name: "the credential host when the engine says otherwise", url: `https://${CREDENTIAL_HOST}/repos/octo/probe/issues`, credentialHost: false },
53
+ ]);
54
+ const record = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
55
+ /** Requests the probe profile makes: one GET of `spec.url`, its host and `spec.also` declared. */
56
+ const probe = {
57
+ id: PROBE,
58
+ version: 1,
59
+ kind: "generic",
60
+ validateSpec(spec) {
61
+ if (!record(spec) || typeof spec.url !== "string")
62
+ return { ok: false, errors: [{ path: "/url", message: "is a URL" }] };
63
+ const also = Array.isArray(spec.also) ? spec.also.filter((host) => typeof host === "string") : [];
64
+ return { ok: true, spec: { url: spec.url, also } };
65
+ },
66
+ hostsFor: (spec) => [new URL(spec.url).hostname, ...spec.also],
67
+ async observe({ spec, transport }) {
68
+ await transport.request({ url: spec.url, headers: { accept: "application/json" } });
69
+ return { records: [], nextCursor: null, more: false, complete: false };
70
+ },
71
+ };
72
+ let world;
73
+ function probeWorld() {
74
+ if (world)
75
+ return world;
76
+ const registry = buildKindRegistry([{ id: "conventions/probe", body: "", frontmatter: { type: "Convention", title: "Probe", governs: "Probe", fields: { required: ["title"] } } }], [], { okfVersion: "0.2" });
77
+ const parsed = parseConnectorDoc({ id: "connectors/conformance", body: "", frontmatter: {
78
+ type: "Connector", title: "Transport conformance probe", auth: { kind: "token", provider: "github" }, domains: [KEYLESS_HOST],
79
+ record_sources: [{ name: "probe", profile: PROBE, target_kind: "Probe", identity: { resource: `https://${CREDENTIAL_HOST}/repos/{owner}/{repo}`, id: "{id}" }, fields: { title: "title" }, completeness: "complete" }],
80
+ } }, { kinds: registry });
81
+ if (!parsed.ok)
82
+ throw new Error(`conformance connector refused: ${parsed.errors.map((e) => e.code).join(", ")}`);
83
+ const bound = bindSourceFeed(parsed.connector, { id: "source-feeds/conformance", frontmatter: {
84
+ type: "Source Feed", connector: parsed.connector.id, source: "probe", url: `https://${CREDENTIAL_HOST}/repos/octo/probe`, owned_fields: ["title"],
85
+ } }, registry, { okfVersion: "0.2" });
86
+ return (world = { connector: parsed.connector, bound });
87
+ }
88
+ const CREDENTIALS = () => [
89
+ { hosts: credentialHosts({ kind: "token", provider: "github" }), header: "authorization", value: "Bearer conformance-secret-1" },
90
+ // A provider's own header (Vagaro's `accessToken`), so a check on `authorization` alone cannot pass.
91
+ { hosts: credentialHosts({ kind: "token", provider: "github" }), header: "accessToken", value: "conformance-secret-2" },
92
+ ];
93
+ /**
94
+ * Whether a request carries the credential anywhere: a header, the URL (decoded, so an encoded
95
+ * copy counts) or the body. The secret is the value's last word, so `Bearer x` is found as `x`.
96
+ */
97
+ function carries(request, credential) {
98
+ const secret = credential.value.split(/\s+/).at(-1);
99
+ let url = request.url;
100
+ try {
101
+ url = decodeURIComponent(request.url.replaceAll("+", " "));
102
+ }
103
+ catch { /* keep the raw URL */ }
104
+ return [...Object.values(request.headers), url, request.url, request.body ?? ""].some((text) => text.includes(secret));
105
+ }
106
+ /** Every request that carried the credential's value toward a host it does not belong to. */
107
+ function leaks(peer, credential) {
108
+ return peer.received.filter((request) => {
109
+ const url = new URL(request.url);
110
+ const allowed = url.protocol === "https:" && credential.hosts.includes(url.hostname);
111
+ return !allowed && carries(request, credential);
112
+ }).map((request) => `${request.method} ${request.url}`);
113
+ }
114
+ const answer = (routes) => (request) => {
115
+ const url = new URL(request.url);
116
+ if (url.pathname === "/robots.txt")
117
+ return { status: 404, body: "" };
118
+ return routes[`${url.origin}${url.pathname}`] ?? { status: 404, body: "" };
119
+ };
120
+ async function throughEngine(target, credential, routes, spec, maxBytes) {
121
+ const { connector, bound } = probeWorld();
122
+ const peer = new ScriptedPeer(answer(routes));
123
+ const receipt = await observeSource({
124
+ connector, bound, profile: probe, spec, transport: target.create(peer, credential), state: new MemoryMachineState(), identity: IDENTITY,
125
+ mode: "complete", budget: { requests: 20, ...(maxBytes !== undefined ? { maxBytes } : {}) }, commit: async () => { },
126
+ });
127
+ return { receipt, peer };
128
+ }
129
+ async function direct(transport, url, options = {}) {
130
+ try {
131
+ return await transport.request({ url, method: "GET", headers: { accept: "application/json" }, maxBytes: options.maxBytes ?? 4096, credentialHost: options.credentialHost ?? false });
132
+ }
133
+ catch (error) {
134
+ return error instanceof Error ? error : new Error(String(error));
135
+ }
136
+ }
137
+ const CHECKS = {
138
+ async "credential-reaches-its-host"(target) {
139
+ const problems = [];
140
+ for (const credential of CREDENTIALS()) {
141
+ const peer = new ScriptedPeer(() => ({ status: 200, body: "[]" }));
142
+ await direct(target.create(peer, credential), `https://${CREDENTIAL_HOST}/repos/octo/probe/issues`, { credentialHost: true });
143
+ const sent = peer.received[0]?.headers[credential.header.toLowerCase()];
144
+ if (sent !== credential.value)
145
+ problems.push(`the ${credential.header} credential did not reach ${CREDENTIAL_HOST}`);
146
+ const { peer: engine } = await throughEngine(target, credential, { [`https://${CREDENTIAL_HOST}/x`]: { status: 200, body: "{}" } }, { url: `https://${CREDENTIAL_HOST}/x` });
147
+ if (engine.received[0]?.headers[credential.header.toLowerCase()] !== credential.value)
148
+ problems.push(`behind the engine the ${credential.header} credential did not reach ${CREDENTIAL_HOST}`);
149
+ }
150
+ return problems;
151
+ },
152
+ async "credential-stays-on-its-host"(target) {
153
+ const problems = [];
154
+ for (const credential of CREDENTIALS()) {
155
+ const peer = new ScriptedPeer(() => ({ status: 200, body: "[]" }));
156
+ const transport = target.create(peer, credential);
157
+ for (const probe of CREDENTIAL_PROBES) {
158
+ const before = peer.received.length;
159
+ await direct(transport, probe.url, { credentialHost: probe.credentialHost });
160
+ const carried = peer.received.slice(before).filter((request) => carries(request, credential));
161
+ if (carried.length)
162
+ problems.push(`${credential.header} sent toward ${probe.name}`);
163
+ }
164
+ }
165
+ return problems;
166
+ },
167
+ async "redirect-returned-unfollowed"(target) {
168
+ const [credential] = CREDENTIALS();
169
+ const peer = new ScriptedPeer(answer({
170
+ [`https://${CREDENTIAL_HOST}/a`]: { status: 302, headers: { Location: `https://${CREDENTIAL_HOST}/b` }, body: "" },
171
+ [`https://${CREDENTIAL_HOST}/b`]: { status: 200, body: "{}" },
172
+ }));
173
+ const result = await direct(target.create(peer, credential), `https://${CREDENTIAL_HOST}/a`, { credentialHost: true });
174
+ const problems = [];
175
+ if (result instanceof Error || !result.ok || result.status !== 302)
176
+ problems.push("the 302 was not returned as the answer");
177
+ else if (result.headers.location !== `https://${CREDENTIAL_HOST}/b`)
178
+ problems.push("the 302's location header was not returned under a lowercase name");
179
+ if (peer.received.length !== 1)
180
+ problems.push(`the transport sent ${peer.received.length} requests for one call`);
181
+ return problems;
182
+ },
183
+ async "cross-host-redirect-refused"(target) {
184
+ const problems = [];
185
+ const cases = [
186
+ { name: "credential host to an undeclared host", from: `https://${CREDENTIAL_HOST}/x`, to: `https://${OUTSIDE_HOST}/steal` },
187
+ { name: "keyless host to an undeclared host", from: `https://${KEYLESS_HOST}/x`, to: `https://${OUTSIDE_HOST}/steal` },
188
+ { name: "credential host to a declared keyless host", from: `https://${CREDENTIAL_HOST}/x`, to: `https://${KEYLESS_HOST}/y`, also: [KEYLESS_HOST] },
189
+ { name: "declared keyless host to the credential host", from: `https://${KEYLESS_HOST}/x`, to: `https://${CREDENTIAL_HOST}/y`, also: [CREDENTIAL_HOST] },
190
+ ];
191
+ for (const credential of CREDENTIALS()) {
192
+ for (const c of cases) {
193
+ const toHost = new URL(c.to).hostname;
194
+ const { receipt, peer } = await throughEngine(target, credential, {
195
+ [c.from]: { status: 302, headers: { location: c.to }, body: "" },
196
+ [c.to]: { status: 200, body: "{}" },
197
+ }, { url: c.from, ...(c.also ? { also: c.also } : {}) });
198
+ const reached = peer.received.filter((request) => request.url.startsWith(c.to)).length;
199
+ if (receipt.outcome !== "refused")
200
+ problems.push(`${c.name}: the run ended ${receipt.outcome}, not refused`);
201
+ if (reached)
202
+ problems.push(`${c.name}: ${reached} request(s) reached ${toHost}`);
203
+ for (const leak of leaks(peer, credential))
204
+ problems.push(`${c.name}: ${credential.header} sent with ${leak}`);
205
+ }
206
+ }
207
+ return problems;
208
+ },
209
+ async "body-over-bound-refused"(target) {
210
+ const [credential] = CREDENTIALS();
211
+ const problems = [];
212
+ // 600 characters, 1200 bytes: a bound read in characters would pass it.
213
+ const over = "é".repeat(600);
214
+ const exact = "a".repeat(1000);
215
+ const peer = new ScriptedPeer(answer({
216
+ [`https://${CREDENTIAL_HOST}/over`]: { status: 200, body: over },
217
+ [`https://${CREDENTIAL_HOST}/exact`]: { status: 200, body: exact },
218
+ }));
219
+ const transport = target.create(peer, credential);
220
+ const refused = await direct(transport, `https://${CREDENTIAL_HOST}/over`, { maxBytes: 1000, credentialHost: true });
221
+ if (refused instanceof Error || refused.ok || refused.refused !== "too_large")
222
+ problems.push("a 1200-byte body under a 1000-byte bound was not refused as too_large");
223
+ const admitted = await direct(transport, `https://${CREDENTIAL_HOST}/exact`, { maxBytes: 1000, credentialHost: true });
224
+ if (admitted instanceof Error || !admitted.ok || admitted.body !== exact || admitted.bytes !== 1000)
225
+ problems.push("a body exactly at the bound was not returned whole");
226
+ const { receipt } = await throughEngine(target, credential, { [`https://${CREDENTIAL_HOST}/over`]: { status: 200, body: over } }, { url: `https://${CREDENTIAL_HOST}/over` }, 1000);
227
+ if (receipt.outcome !== "too_large")
228
+ problems.push(`behind the engine the run ended ${receipt.outcome}, not too_large`);
229
+ return problems;
230
+ },
231
+ async "private-redirect-refused"(target) {
232
+ const [credential] = CREDENTIALS();
233
+ const problems = [];
234
+ for (const from of [`https://${CREDENTIAL_HOST}/x`, `https://${KEYLESS_HOST}/x`]) {
235
+ for (const to of PRIVATE_TARGETS) {
236
+ const { receipt, peer } = await throughEngine(target, credential, { [from]: { status: 302, headers: { location: to }, body: "" } }, { url: from });
237
+ const toUrl = new URL(to);
238
+ const reached = peer.received.filter((request) => {
239
+ const url = new URL(request.url);
240
+ return url.hostname === toUrl.hostname && url.port === toUrl.port && url.protocol === toUrl.protocol;
241
+ }).length;
242
+ if (receipt.outcome !== "refused")
243
+ problems.push(`${from} to ${to}: the run ended ${receipt.outcome}, not refused`);
244
+ if (reached)
245
+ problems.push(`${from} to ${to}: ${reached} request(s) reached it`);
246
+ }
247
+ }
248
+ return problems;
249
+ },
250
+ };
251
+ /** Run every conformance scenario against one transport. */
252
+ export async function runTransportConformance(target) {
253
+ const rows = [];
254
+ for (const scenario of CONFORMANCE_SCENARIOS) {
255
+ try {
256
+ const problems = await CHECKS[scenario](target);
257
+ rows.push(problems.length ? { scenario, ok: false, detail: problems.join("; ") } : { scenario, ok: true });
258
+ }
259
+ catch (error) {
260
+ rows.push({ scenario, ok: false, detail: `threw: ${error instanceof Error ? error.message : String(error)}` });
261
+ }
262
+ }
263
+ return rows;
264
+ }
265
+ //# sourceMappingURL=conformance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformance.js","sourceRoot":"","sources":["../../src/source-harness/conformance.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAkC,MAAM,kBAAkB,CAAC;AACtH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAsB,MAAM,4BAA4B,CAAC;AAE/E,OAAO,EAAE,YAAY,EAAiE,MAAM,WAAW,CAAC;AAcxG,MAAM,CAAC,MAAM,qBAAqB,GAA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AI,OAAO;oBAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,OAAO,EAAE,KAAK,OAAO,wBAAwB,CAAC,CAAC;YACnF,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC;AAEF,4DAA4D;AAC5D,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,MAAkC;IAC9E,MAAM,IAAI,GAAqB,EAAE,CAAC;IAClC,KAAK,MAAM,QAAQ,IAAI,qBAAqB,EAAE,CAAC;QAC7C,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;YAChD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7G,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QACjH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * The fixture harness: replay a profile's scripted provider answers through the engine, map and
3
+ * write each committed page through record-overlay over a MemoryBackend bundle, and check each
4
+ * required scenario's outcome rule. The rules are profile-independent, so one list holds every
5
+ * profile, generic or extension, to the same behaviour.
6
+ */
7
+ import { type Connector } from "../connectors.js";
8
+ import type { OverlayReceipt, RecordChange } from "../record-overlay/types.js";
9
+ import { type SourceState } from "../source-engine/machine-state.js";
10
+ import { type FetchIdentity } from "../source-engine/robots.js";
11
+ import type { SourceBudget, SourceProfile, SourceRunReceipt } from "../source-engine/types.js";
12
+ import type { ConceptId, Frontmatter, OkfDocument } from "../types.js";
13
+ import { type PeerRequest, type ScriptedExchange, type TransportCredential } from "./peer.js";
14
+ /** Every profile's fixture includes these; a name may add a variant after a dot (`cursor.resume.page-number`). */
15
+ export declare const REQUIRED_SCENARIOS: readonly ["errors.auth", "errors.rate-limit", "errors.server", "errors.malformed", "page.incomplete", "cursor.resume", "cursor.hostile", "complete.disappear", "fields.owned-conflict", "fields.unmapped", "fields.null", "identity.missing", "hosts.redirect", "hosts.undeclared"];
16
+ export type RequiredScenario = (typeof REQUIRED_SCENARIOS)[number];
17
+ /** The required scenario a name counts toward, or undefined. */
18
+ export declare function scenarioBase(name: string): RequiredScenario | undefined;
19
+ /** Required scenarios no name covers. */
20
+ export declare function missingScenarios(names: Iterable<string>): RequiredScenario[];
21
+ export interface SourceFixture {
22
+ connector: Connector;
23
+ profile: SourceProfile<any, any>;
24
+ spec: unknown;
25
+ /**
26
+ * The bundle's starting documents: Conventions for the target Kind, `Signal` and `Source Feed`,
27
+ * the Source Feed, and any overlay documents.
28
+ */
29
+ documents: readonly OkfDocument[];
30
+ feed: ConceptId;
31
+ identity?: FetchIdentity;
32
+ credential?: TransportCredential;
33
+ }
34
+ export interface SourceRunScript {
35
+ mode?: "incremental" | "complete";
36
+ /** The run's observation time; runs default to one hour apart. */
37
+ at?: string;
38
+ exchanges: readonly ScriptedExchange[];
39
+ /** Editor edits applied before the run. */
40
+ edits?: ReadonlyArray<{
41
+ id: ConceptId;
42
+ set: Record<string, unknown>;
43
+ }>;
44
+ budget?: Partial<SourceBudget>;
45
+ }
46
+ export interface SourceScenario {
47
+ name: string;
48
+ /** Replaces the fixture's spec for this scenario. */
49
+ spec?: unknown;
50
+ runs: readonly SourceRunScript[];
51
+ }
52
+ export interface ScenarioRun {
53
+ receipt: SourceRunReceipt;
54
+ /** Every change a commit carried, replays of pending changes included. */
55
+ changes: RecordChange[];
56
+ /** One record-overlay receipt per committed page. */
57
+ overlay: OverlayReceipt[];
58
+ /** The run's findings, written. */
59
+ findings: OverlayReceipt;
60
+ /** Requests that reached the provider. */
61
+ received: PeerRequest[];
62
+ unscripted: string[];
63
+ unused: ScriptedExchange[];
64
+ stateBefore: SourceState | null;
65
+ state: SourceState | null;
66
+ /** Every document's frontmatter after the run. */
67
+ documents: Record<string, Frontmatter>;
68
+ }
69
+ export interface ScenarioResult {
70
+ name: string;
71
+ base: RequiredScenario | undefined;
72
+ /** The declared hosts the scenario's spec may reach. */
73
+ hosts: string[];
74
+ threshold: number;
75
+ edits: Array<{
76
+ run: number;
77
+ id: ConceptId;
78
+ set: Record<string, unknown>;
79
+ }>;
80
+ runs: ScenarioRun[];
81
+ }
82
+ /** Run one scenario's runs in order over one fresh bundle and one machine state. */
83
+ export declare function runSourceScenario(fixture: SourceFixture, scenario: SourceScenario): Promise<ScenarioResult>;
84
+ /**
85
+ * The problems with one scenario's result: its required outcome rule, plus for every scenario no
86
+ * request to a host outside the declared set and no request the fixture did not script.
87
+ */
88
+ export declare function checkScenario(result: ScenarioResult): string[];
89
+ /** Run every scenario of a fixture, check each, and list the required scenarios it lacks. */
90
+ export declare function runSourceFixture(fixture: SourceFixture, scenarios: readonly SourceScenario[]): Promise<{
91
+ results: ScenarioResult[];
92
+ problems: Record<string, string[]>;
93
+ missing: RequiredScenario[];
94
+ }>;
95
+ //# sourceMappingURL=fixture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixture.d.ts","sourceRoot":"","sources":["../../src/source-harness/fixture.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAmD,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAQnG,OAAO,KAAK,EAAiB,cAAc,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAsB,KAAK,WA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