nuxt-ai-ready 2.5.3 → 3.0.1

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 (287) hide show
  1. package/README.md +13 -12
  2. package/dist/chunks/agent-skills.mjs +35 -12
  3. package/dist/chunks/prerender.mjs +35 -24
  4. package/dist/cli.mjs +5 -2
  5. package/dist/module.d.mts +4 -0
  6. package/dist/module.json +2 -2
  7. package/dist/module.mjs +8 -4
  8. package/dist/runtime/app/index.d.ts +3 -0
  9. package/dist/runtime/app/index.js +2 -0
  10. package/dist/runtime/cache-control.d.ts +2 -0
  11. package/dist/runtime/cache-control.js +11 -0
  12. package/dist/runtime/llms-txt-utils.js +1 -1
  13. package/dist/runtime/server/db/context.d.ts +13 -0
  14. package/dist/runtime/server/db/drizzle/client.d.ts +6 -7
  15. package/dist/runtime/server/db/drizzle/client.js +13 -2
  16. package/dist/runtime/server/db/drizzle/providers/bun.d.ts +2 -2
  17. package/dist/runtime/server/db/drizzle/providers/bun.js +2 -2
  18. package/dist/runtime/server/db/drizzle/providers/d1.d.ts +2 -2
  19. package/dist/runtime/server/db/drizzle/providers/d1.js +3 -2
  20. package/dist/runtime/server/db/drizzle/providers/libsql.d.ts +2 -2
  21. package/dist/runtime/server/db/drizzle/providers/libsql.js +2 -2
  22. package/dist/runtime/server/db/drizzle/providers/neon.d.ts +2 -2
  23. package/dist/runtime/server/db/drizzle/providers/neon.js +2 -2
  24. package/dist/runtime/server/db/drizzle/providers/node-sqlite.d.ts +2 -2
  25. package/dist/runtime/server/db/drizzle/providers/node-sqlite.js +2 -2
  26. package/dist/runtime/server/db/drizzle/providers/postgres.d.ts +2 -2
  27. package/dist/runtime/server/db/drizzle/providers/postgres.js +2 -2
  28. package/dist/runtime/server/db/drizzle/queries.d.ts +27 -27
  29. package/dist/runtime/server/db/drizzle/queries.js +6 -5
  30. package/dist/runtime/server/db/drizzle/raw.d.ts +2 -6
  31. package/dist/runtime/server/db/index.d.ts +1 -1
  32. package/dist/runtime/server/db/index.js +1 -1
  33. package/dist/runtime/server/db/queries.d.ts +36 -36
  34. package/dist/runtime/server/db/queries.js +8 -9
  35. package/dist/runtime/server/db/seed.d.ts +2 -2
  36. package/dist/runtime/server/db/seed.js +4 -3
  37. package/dist/runtime/server/db/shared.d.ts +8 -0
  38. package/dist/runtime/server/db/shared.js +8 -2
  39. package/dist/runtime/server/index.d.ts +2 -0
  40. package/dist/runtime/server/index.js +17 -0
  41. package/dist/runtime/server/mcp/cache-key.js +4 -0
  42. package/dist/runtime/server/mcp/tools/get-page-markdown.js +3 -2
  43. package/dist/runtime/server/mcp/tools/list-pages.js +3 -2
  44. package/dist/runtime/server/mcp/tools/search-pages.js +3 -2
  45. package/dist/runtime/server/middleware/markdown.prerender.js +1 -1
  46. package/dist/runtime/server/plugins/db-lifecycle-nitro3.d.ts +2 -0
  47. package/dist/runtime/server/plugins/db-lifecycle-nitro3.js +16 -0
  48. package/dist/runtime/server/plugins/html-capture.prerender.js +6 -4
  49. package/dist/runtime/server/plugins/link-header-nitro3.d.ts +2 -0
  50. package/dist/runtime/server/plugins/link-header-nitro3.js +20 -0
  51. package/dist/runtime/server/plugins/link-header.d.ts +6 -0
  52. package/dist/runtime/server/plugins/link-header.js +7 -11
  53. package/dist/runtime/server/plugins/markdown-negotiation.js +8 -1
  54. package/dist/runtime/server/plugins/sitemap-seeder.js +3 -3
  55. package/dist/runtime/server/routes/agent-skills-artifact.d.ts +1 -1
  56. package/dist/runtime/server/routes/agent-skills-artifact.js +10 -10
  57. package/dist/runtime/server/routes/agent-skills-index.d.ts +1 -1
  58. package/dist/runtime/server/routes/agent-skills-index.js +7 -6
  59. package/dist/runtime/server/routes/ai-catalog.d.ts +2 -1
  60. package/dist/runtime/server/routes/ai-catalog.js +7 -8
  61. package/dist/runtime/server/routes/api-catalog.d.ts +3 -1
  62. package/dist/runtime/server/routes/api-catalog.js +12 -12
  63. package/dist/runtime/server/routes/llms-full.txt.get.js +1 -1
  64. package/dist/runtime/server/routes/mcp-server-card.d.ts +1 -1
  65. package/dist/runtime/server/routes/mcp-server-card.js +7 -8
  66. package/dist/runtime/server/utils/checkStale.d.ts +2 -2
  67. package/dist/runtime/server/utils/cloudflare-prerendered.d.ts +3 -0
  68. package/dist/runtime/server/utils/cloudflare-prerendered.js +23 -0
  69. package/dist/runtime/server/utils/cloudflare.d.ts +5 -5
  70. package/dist/runtime/server/utils/cloudflare.js +31 -7
  71. package/dist/runtime/server/utils/content-negotiation.d.ts +5 -3
  72. package/dist/runtime/server/utils/content-negotiation.js +8 -7
  73. package/dist/runtime/server/utils/context.d.ts +3 -3
  74. package/dist/runtime/server/utils/context.js +1 -1
  75. package/dist/runtime/server/utils/discovery-response.d.ts +2 -0
  76. package/dist/runtime/server/utils/link-header.d.ts +5 -3
  77. package/dist/runtime/server/utils/link-header.js +26 -2
  78. package/dist/runtime/server/utils/markdown-request.d.ts +4 -3
  79. package/dist/runtime/server/utils/markdown-request.js +15 -13
  80. package/dist/runtime/server/utils/negotiation-decision.d.ts +4 -0
  81. package/dist/runtime/server/utils/negotiation-decision.js +6 -5
  82. package/dist/runtime/server/utils/negotiation-response.js +47 -22
  83. package/dist/runtime/server/utils/prerender-html.d.ts +2 -1
  84. package/dist/runtime/server/utils/prerender-html.js +3 -1
  85. package/dist/runtime/types.d.ts +15 -7
  86. package/dist/shared/nuxt-ai-ready.B3hAuOLQ.mjs +29 -0
  87. package/dist/shared/{nuxt-ai-ready.CLSWou20.mjs → nuxt-ai-ready.C34F0LJo.mjs} +560 -219
  88. package/package.json +86 -20
  89. package/skills/nuxt-ai-ready/SKILL.md +26 -12
  90. package/skills/nuxt-ai-ready/references/runtime-indexing.md +7 -6
  91. package/dist/runtime/server/db/drizzle/providers/sqlite.d.ts +0 -8
  92. package/dist/runtime/server/db/drizzle/providers/sqlite.js +0 -15
  93. package/node_modules/@mdream/js/LICENSE.md +0 -9
  94. package/node_modules/@mdream/js/README.md +0 -792
  95. package/node_modules/@mdream/js/bin/mdream.mjs +0 -2
  96. package/node_modules/@mdream/js/dist/_chunks/const.mjs +0 -134
  97. package/node_modules/@mdream/js/dist/_chunks/index.d.mts +0 -9
  98. package/node_modules/@mdream/js/dist/_chunks/markdown-processor.mjs +0 -1968
  99. package/node_modules/@mdream/js/dist/_chunks/minimal.d.mts +0 -6
  100. package/node_modules/@mdream/js/dist/_chunks/parse.mjs +0 -2756
  101. package/node_modules/@mdream/js/dist/_chunks/plugins.mjs +0 -725
  102. package/node_modules/@mdream/js/dist/_chunks/resolve-plugins.mjs +0 -44
  103. package/node_modules/@mdream/js/dist/_chunks/stream.mjs +0 -37
  104. package/node_modules/@mdream/js/dist/_chunks/types.d.mts +0 -473
  105. package/node_modules/@mdream/js/dist/cli.d.mts +0 -1
  106. package/node_modules/@mdream/js/dist/cli.mjs +0 -32
  107. package/node_modules/@mdream/js/dist/core.d.mts +0 -15
  108. package/node_modules/@mdream/js/dist/core.mjs +0 -28
  109. package/node_modules/@mdream/js/dist/index.d.mts +0 -4
  110. package/node_modules/@mdream/js/dist/index.mjs +0 -58
  111. package/node_modules/@mdream/js/dist/llms-txt.d.mts +0 -86
  112. package/node_modules/@mdream/js/dist/llms-txt.mjs +0 -308
  113. package/node_modules/@mdream/js/dist/negotiate.d.mts +0 -35
  114. package/node_modules/@mdream/js/dist/negotiate.mjs +0 -121
  115. package/node_modules/@mdream/js/dist/parse.d.mts +0 -90
  116. package/node_modules/@mdream/js/dist/parse.mjs +0 -2
  117. package/node_modules/@mdream/js/dist/plugins.d.mts +0 -85
  118. package/node_modules/@mdream/js/dist/plugins.mjs +0 -2
  119. package/node_modules/@mdream/js/dist/preset/minimal.d.mts +0 -2
  120. package/node_modules/@mdream/js/dist/preset/minimal.mjs +0 -33
  121. package/node_modules/@mdream/js/dist/splitter.d.mts +0 -18
  122. package/node_modules/@mdream/js/dist/splitter.mjs +0 -194
  123. package/node_modules/@mdream/js/package.json +0 -103
  124. package/node_modules/cac/LICENSE +0 -21
  125. package/node_modules/cac/README.md +0 -492
  126. package/node_modules/cac/dist/index.d.ts +0 -196
  127. package/node_modules/cac/dist/index.js +0 -638
  128. package/node_modules/cac/package.json +0 -72
  129. package/node_modules/mdream/LICENSE.md +0 -9
  130. package/node_modules/mdream/README.md +0 -1091
  131. package/node_modules/mdream/bin/mdream.mjs +0 -46
  132. package/node_modules/mdream/dist/browser.d.mts +0 -105
  133. package/node_modules/mdream/dist/browser.mjs +0 -262
  134. package/node_modules/mdream/dist/edge.d.mts +0 -100
  135. package/node_modules/mdream/dist/edge.mjs +0 -250
  136. package/node_modules/mdream/dist/iife.js +0 -605
  137. package/node_modules/mdream/dist/index.d.mts +0 -89
  138. package/node_modules/mdream/dist/index.mjs +0 -184
  139. package/node_modules/mdream/dist/wasm.d.mts +0 -100
  140. package/node_modules/mdream/dist/wasm.mjs +0 -140
  141. package/node_modules/mdream/dist/worker.d.mts +0 -101
  142. package/node_modules/mdream/dist/worker.mjs +0 -217
  143. package/node_modules/mdream/napi/index.d.mts +0 -127
  144. package/node_modules/mdream/napi/index.d.ts +0 -127
  145. package/node_modules/mdream/napi/index.mjs +0 -725
  146. package/node_modules/mdream/napi/rust.android-arm-eabi.node +0 -0
  147. package/node_modules/mdream/napi/rust.android-arm64.node +0 -0
  148. package/node_modules/mdream/napi/rust.darwin-arm64.node +0 -0
  149. package/node_modules/mdream/napi/rust.darwin-x64.node +0 -0
  150. package/node_modules/mdream/napi/rust.freebsd-x64.node +0 -0
  151. package/node_modules/mdream/napi/rust.linux-arm-gnueabihf.node +0 -0
  152. package/node_modules/mdream/napi/rust.linux-arm64-gnu.node +0 -0
  153. package/node_modules/mdream/napi/rust.linux-arm64-musl.node +0 -0
  154. package/node_modules/mdream/napi/rust.linux-x64-gnu.node +0 -0
  155. package/node_modules/mdream/napi/rust.linux-x64-musl.node +0 -0
  156. package/node_modules/mdream/napi/rust.wasi.cjs +0 -2144
  157. package/node_modules/mdream/napi/rust.wasm32-wasi.wasm +0 -0
  158. package/node_modules/mdream/napi/rust.win32-arm64-msvc.node +0 -0
  159. package/node_modules/mdream/napi/rust.win32-x64-msvc.node +0 -0
  160. package/node_modules/mdream/node_modules/@emnapi/core/LICENSE +0 -21
  161. package/node_modules/mdream/node_modules/@emnapi/core/README.md +0 -1
  162. package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.d.ts +0 -392
  163. package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.full.d.ts +0 -392
  164. package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.full.js +0 -8351
  165. package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.js +0 -7268
  166. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/async-work.d.ts +0 -5
  167. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/async-work.js +0 -843
  168. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/index.d.ts +0 -4
  169. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/index.js +0 -3
  170. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/threadsafe-function.d.ts +0 -5
  171. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/threadsafe-function.js +0 -1010
  172. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/v8.d.ts +0 -5
  173. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/v8.js +0 -1446
  174. package/node_modules/mdream/node_modules/@emnapi/core/node_modules/@emnapi/wasi-threads/LICENSE +0 -21
  175. package/node_modules/mdream/node_modules/@emnapi/core/node_modules/@emnapi/wasi-threads/README.md +0 -203
  176. package/node_modules/mdream/node_modules/@emnapi/core/node_modules/@emnapi/wasi-threads/dist/wasi-threads.d.ts +0 -236
  177. package/node_modules/mdream/node_modules/@emnapi/core/node_modules/@emnapi/wasi-threads/dist/wasi-threads.js +0 -1086
  178. package/node_modules/mdream/node_modules/@emnapi/core/node_modules/@emnapi/wasi-threads/package.json +0 -35
  179. package/node_modules/mdream/node_modules/@emnapi/core/node_modules/@emnapi/wasi-threads/rollup.config.js +0 -6
  180. package/node_modules/mdream/node_modules/@emnapi/core/package.json +0 -39
  181. package/node_modules/mdream/node_modules/@emnapi/core/rollup.config.js +0 -60
  182. package/node_modules/mdream/node_modules/@emnapi/runtime/LICENSE +0 -21
  183. package/node_modules/mdream/node_modules/@emnapi/runtime/README.md +0 -1
  184. package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.d.ts +0 -833
  185. package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.js +0 -2306
  186. package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.js.map +0 -1
  187. package/node_modules/mdream/node_modules/@emnapi/runtime/index.cjs +0 -63
  188. package/node_modules/mdream/node_modules/@emnapi/runtime/package.json +0 -39
  189. package/node_modules/mdream/node_modules/@emnapi/runtime/rollup.config.js +0 -25
  190. package/node_modules/mdream/node_modules/@emnapi/wasi-threads/LICENSE +0 -21
  191. package/node_modules/mdream/node_modules/@emnapi/wasi-threads/README.md +0 -203
  192. package/node_modules/mdream/node_modules/@emnapi/wasi-threads/dist/wasi-threads.d.ts +0 -240
  193. package/node_modules/mdream/node_modules/@emnapi/wasi-threads/dist/wasi-threads.js +0 -1118
  194. package/node_modules/mdream/node_modules/@emnapi/wasi-threads/package.json +0 -35
  195. package/node_modules/mdream/node_modules/@emnapi/wasi-threads/rollup.config.js +0 -6
  196. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.cjs +0 -1472
  197. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.js +0 -1470
  198. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs +0 -237
  199. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/fs.js +0 -17578
  200. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/fs-proxy.js +0 -317
  201. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/package.json +0 -67
  202. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/runtime.cjs +0 -39
  203. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/runtime.js +0 -36
  204. package/node_modules/mdream/node_modules/@tybys/wasm-util/LICENSE +0 -21
  205. package/node_modules/mdream/node_modules/@tybys/wasm-util/README.md +0 -193
  206. package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/tsdoc-metadata.json +0 -11
  207. package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.d.ts +0 -423
  208. package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js +0 -2932
  209. package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm.js +0 -2932
  210. package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm.min.js +0 -1
  211. package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.js +0 -2954
  212. package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.min.js +0 -1
  213. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/asyncify.js +0 -158
  214. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/index.js +0 -13
  215. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/jspi.js +0 -46
  216. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/load.js +0 -97
  217. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/memory.js +0 -35
  218. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/error.js +0 -103
  219. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/fd.js +0 -268
  220. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/fs.js +0 -3
  221. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/index.js +0 -192
  222. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/path.js +0 -316
  223. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/preview1.js +0 -1599
  224. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/rights.js +0 -141
  225. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/types.js +0 -220
  226. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/util.js +0 -128
  227. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/webassembly.js +0 -13
  228. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/asyncify.mjs +0 -153
  229. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/index.mjs +0 -9
  230. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/jspi.mjs +0 -39
  231. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/load.mjs +0 -89
  232. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/memory.mjs +0 -28
  233. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/error.mjs +0 -97
  234. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/fd.mjs +0 -256
  235. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/fs.mjs +0 -1
  236. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/index.mjs +0 -186
  237. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/path.mjs +0 -310
  238. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/preview1.mjs +0 -1593
  239. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/rights.mjs +0 -135
  240. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/types.mjs +0 -216
  241. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/util.mjs +0 -113
  242. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/webassembly.mjs +0 -9
  243. package/node_modules/mdream/node_modules/@tybys/wasm-util/package.json +0 -58
  244. package/node_modules/mdream/node_modules/tslib/CopyrightNotice.txt +0 -15
  245. package/node_modules/mdream/node_modules/tslib/LICENSE.txt +0 -12
  246. package/node_modules/mdream/node_modules/tslib/README.md +0 -164
  247. package/node_modules/mdream/node_modules/tslib/SECURITY.md +0 -41
  248. package/node_modules/mdream/node_modules/tslib/modules/index.d.ts +0 -38
  249. package/node_modules/mdream/node_modules/tslib/modules/index.js +0 -70
  250. package/node_modules/mdream/node_modules/tslib/modules/package.json +0 -3
  251. package/node_modules/mdream/node_modules/tslib/package.json +0 -47
  252. package/node_modules/mdream/node_modules/tslib/tslib.d.ts +0 -460
  253. package/node_modules/mdream/node_modules/tslib/tslib.es6.html +0 -1
  254. package/node_modules/mdream/node_modules/tslib/tslib.es6.js +0 -402
  255. package/node_modules/mdream/node_modules/tslib/tslib.es6.mjs +0 -401
  256. package/node_modules/mdream/node_modules/tslib/tslib.html +0 -1
  257. package/node_modules/mdream/node_modules/tslib/tslib.js +0 -484
  258. package/node_modules/mdream/package.json +0 -110
  259. package/node_modules/mdream/skills/mdream/SKILL.md +0 -124
  260. package/node_modules/mdream/skills/mdream/references/runtimes.md +0 -49
  261. package/node_modules/mdream/wasm/mdream_edge.d.ts +0 -90
  262. package/node_modules/mdream/wasm/mdream_edge.js +0 -517
  263. package/node_modules/mdream/wasm/mdream_edge_bg.wasm +0 -0
  264. package/node_modules/mdream/wasm/mdream_edge_bg.wasm.d.ts +0 -20
  265. package/node_modules/mdream/wasm/package.json +0 -17
  266. package/node_modules/mdream/wasm-bundler/mdream_edge.d.ts +0 -45
  267. package/node_modules/mdream/wasm-bundler/mdream_edge.js +0 -13
  268. package/node_modules/mdream/wasm-bundler/mdream_edge_bg.js +0 -413
  269. package/node_modules/mdream/wasm-bundler/mdream_edge_bg.wasm +0 -0
  270. package/node_modules/mdream/wasm-bundler/mdream_edge_bg.wasm.d.ts +0 -20
  271. package/node_modules/mdream/wasm-bundler/package.json +0 -19
  272. package/node_modules/pathe/LICENSE +0 -70
  273. package/node_modules/pathe/README.md +0 -73
  274. package/node_modules/pathe/dist/index.cjs +0 -39
  275. package/node_modules/pathe/dist/index.d.cts +0 -47
  276. package/node_modules/pathe/dist/index.d.mts +0 -47
  277. package/node_modules/pathe/dist/index.d.ts +0 -47
  278. package/node_modules/pathe/dist/index.mjs +0 -19
  279. package/node_modules/pathe/dist/shared/pathe.BSlhyZSM.cjs +0 -266
  280. package/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +0 -249
  281. package/node_modules/pathe/dist/utils.cjs +0 -82
  282. package/node_modules/pathe/dist/utils.d.cts +0 -32
  283. package/node_modules/pathe/dist/utils.d.mts +0 -32
  284. package/node_modules/pathe/dist/utils.d.ts +0 -32
  285. package/node_modules/pathe/dist/utils.mjs +0 -77
  286. package/node_modules/pathe/package.json +0 -61
  287. package/node_modules/pathe/utils.d.ts +0 -1
@@ -1,217 +0,0 @@
1
- const MINIMAL_FILTER_EXCLUDE = [
2
- "form",
3
- "fieldset",
4
- "object",
5
- "embed",
6
- "footer",
7
- "aside",
8
- "iframe",
9
- "input",
10
- "textarea",
11
- "select",
12
- "button",
13
- "nav"
14
- ];
15
- const CLEAN_ALL = {
16
- urls: true,
17
- fragments: true,
18
- emptyLinks: true,
19
- redundantLinks: true,
20
- selfLinkHeadings: true,
21
- emptyImages: true,
22
- emptyLinkText: true
23
- };
24
- function resolveCleanConfig(options, minimal) {
25
- const cleanUrls = options.cleanUrls === true;
26
- let cleanOpt = options.clean;
27
- if (cleanOpt === void 0) {
28
- if (!minimal) return { cleanUrls };
29
- cleanOpt = true;
30
- }
31
- if (!cleanOpt) return { cleanUrls };
32
- const resolved = cleanOpt === true ? CLEAN_ALL : cleanOpt;
33
- return {
34
- cleanUrls: cleanUrls || resolved.urls === true,
35
- clean: resolved
36
- };
37
- }
38
- function resolveFrontmatter(opt) {
39
- if (typeof opt === "function") return {
40
- config: {},
41
- callback: opt
42
- };
43
- if (opt && typeof opt === "object") {
44
- const { onExtract, ...config } = opt;
45
- return {
46
- config,
47
- callback: onExtract
48
- };
49
- }
50
- return { config: {} };
51
- }
52
- function resolveOptions(options) {
53
- if (Array.isArray(options.plugins)) throw new TypeError("Custom hook plugins require @mdream/js. Pass declarative config (e.g. { frontmatter: true }) to the Rust engine, or import { htmlToMarkdown } from '@mdream/js' for hook-based plugins. See https://mdream.dev/v1-migration#custom-plugins");
54
- const minimal = options.minimal === true;
55
- const plugins = options.plugins ? { ...options.plugins } : {};
56
- let frontmatterCallback;
57
- const frontmatterDisabled = options.frontmatter === false;
58
- if (minimal ? !frontmatterDisabled : !!options.frontmatter) {
59
- const fm = resolveFrontmatter(options.frontmatter);
60
- plugins.frontmatter = fm.config;
61
- frontmatterCallback = fm.callback;
62
- } else if (frontmatterDisabled) delete plugins.frontmatter;
63
- const isolateMainDisabled = options.isolateMain === false;
64
- if (minimal ? !isolateMainDisabled : options.isolateMain) plugins.isolateMain = true;
65
- else if (isolateMainDisabled) delete plugins.isolateMain;
66
- const tailwindDisabled = options.tailwind === false;
67
- if (minimal ? !tailwindDisabled : options.tailwind) plugins.tailwind = true;
68
- else if (tailwindDisabled) delete plugins.tailwind;
69
- if (options.filter === false) delete plugins.filter;
70
- else if (minimal) plugins.filter = {
71
- ...options.filter,
72
- exclude: [...MINIMAL_FILTER_EXCLUDE, ...options.filter?.exclude ?? []]
73
- };
74
- else if (options.filter) plugins.filter = options.filter;
75
- const extraction = options.extraction;
76
- let extractionHandlers;
77
- if (extraction) {
78
- plugins.extraction = { selectors: Object.keys(extraction) };
79
- extractionHandlers = extraction;
80
- }
81
- const tagOverrides = options.tagOverrides;
82
- if (tagOverrides) {
83
- const overrides = {};
84
- for (const tag in tagOverrides) {
85
- const value = tagOverrides[tag];
86
- if (value) overrides[tag] = typeof value === "string" ? { alias: value } : value;
87
- }
88
- plugins.tagOverrides = overrides;
89
- }
90
- const { cleanUrls, clean } = resolveCleanConfig(options, minimal);
91
- return {
92
- napiOpts: {
93
- origin: options.origin,
94
- cleanUrls,
95
- clean,
96
- plugins,
97
- wrapWidth: options.wrapWidth,
98
- format: options.format
99
- },
100
- extractionHandlers,
101
- frontmatterCallback
102
- };
103
- }
104
- function deliverPluginData(data, { frontmatterCallback, extractionHandlers }) {
105
- if (data.frontmatter && frontmatterCallback) frontmatterCallback(data.frontmatter);
106
- if (data.extracted?.length && extractionHandlers) for (const element of data.extracted) extractionHandlers[element.selector]?.(element);
107
- }
108
- let _worker = null;
109
- let _ready = null;
110
- let _idCounter = 0;
111
- const _pending = /* @__PURE__ */ new Map();
112
- const WASM_RE = /\.wasm$/;
113
- function getWorkerBlob(wasmUrl) {
114
- const code = `
115
- // namespace import: the URL is caller-supplied and may point at an older build
116
- import init, * as engine from '${wasmUrl.replace(WASM_RE, ".js")}';
117
- const { htmlToMarkdownResult } = engine;
118
-
119
- let ready = false;
120
-
121
- async function initialize() {
122
- await init('${wasmUrl}');
123
- ready = true;
124
- self.postMessage({ type: 'ready' });
125
- }
126
-
127
- initialize().catch(e => {
128
- self.postMessage({ type: 'error', id: -1, message: 'WASM init failed: ' + e.message });
129
- });
130
-
131
- self.onmessage = function(e) {
132
- const msg = e.data;
133
- if (msg.type === 'convert') {
134
- if (!ready) {
135
- self.postMessage({ id: msg.id, type: 'error', message: 'Worker not ready' });
136
- return;
137
- }
138
- try {
139
- const result = htmlToMarkdownResult(msg.html, msg.options || {});
140
- self.postMessage({ id: msg.id, type: 'result', data: result });
141
- } catch (err) {
142
- // WASM aborts on panic (#195): the message is stashed by the panic hook
143
- const panic = engine.__mdreamTakePanicMessage?.();
144
- self.postMessage({ id: msg.id, type: 'error', message: panic || err.message });
145
- }
146
- }
147
- };`;
148
- return new Blob([code], { type: "application/javascript" });
149
- }
150
- function onMessage(e) {
151
- const msg = e.data;
152
- if (msg.type === "ready") return;
153
- if ("id" in msg) {
154
- const pending = _pending.get(msg.id);
155
- if (!pending) return;
156
- _pending.delete(msg.id);
157
- if (msg.type === "result") try {
158
- deliverPluginData(msg.data, pending.callbacks);
159
- pending.resolve(msg.data.markdown || "");
160
- } catch (error) {
161
- pending.reject(error);
162
- }
163
- else pending.reject(new Error(msg.message));
164
- }
165
- }
166
- function initWorker(wasmUrl) {
167
- if (_ready) return _ready;
168
- _ready = new Promise((resolve, reject) => {
169
- const blob = getWorkerBlob(wasmUrl);
170
- const url = URL.createObjectURL(blob);
171
- _worker = new Worker(url, { type: "module" });
172
- _worker.onmessage = (e) => {
173
- if (e.data.type === "ready") {
174
- _worker.onmessage = onMessage;
175
- URL.revokeObjectURL(url);
176
- resolve();
177
- } else if (e.data.type === "error") reject(new Error(e.data.message));
178
- };
179
- _worker.onerror = (e) => {
180
- reject(/* @__PURE__ */ new Error(`Worker error: ${e.message}`));
181
- };
182
- });
183
- return _ready;
184
- }
185
- function htmlToMarkdown(html, options) {
186
- if (!_worker || !_ready) return Promise.reject(/* @__PURE__ */ new Error("Call initWorker() before htmlToMarkdown()"));
187
- return _ready.then(() => {
188
- const { napiOpts, frontmatterCallback, extractionHandlers } = resolveOptions(options ?? {});
189
- const id = _idCounter++;
190
- return new Promise((resolve, reject) => {
191
- _pending.set(id, {
192
- resolve,
193
- reject,
194
- callbacks: {
195
- frontmatterCallback,
196
- extractionHandlers
197
- }
198
- });
199
- _worker.postMessage({
200
- id,
201
- type: "convert",
202
- html,
203
- options: napiOpts
204
- });
205
- });
206
- });
207
- }
208
- function terminateWorker() {
209
- if (_worker) {
210
- _worker.terminate();
211
- _worker = null;
212
- }
213
- _ready = null;
214
- for (const [, pending] of _pending) pending.reject(/* @__PURE__ */ new Error("Worker terminated"));
215
- _pending.clear();
216
- }
217
- export { htmlToMarkdown, initWorker, terminateWorker };
@@ -1,127 +0,0 @@
1
- /* auto-generated by NAPI-RS */
2
- /* eslint-disable */
3
-
4
- /**
5
- * Which binding artifact the generated loader actually loaded: `'native'` for
6
- * a native addon, otherwise the `platformArchABI` of the WASI flavor. Every
7
- * flavor napi-rs can build is listed, because `NAPI_RS_NATIVE_LIBRARY_PATH`
8
- * can point the loader at a WASI artifact this package does not build itself.
9
- */
10
- export declare const __napiBindingTarget: 'native' | 'wasm32-wasi' | 'wasm32-wasip1'
11
-
12
- export declare class MarkdownStream {
13
- constructor(options?: HtmlToMarkdownOptions | undefined | null)
14
- processChunk(chunk: string): string
15
- processChunkBytes(chunk: Uint8Array): string
16
- finish(): string
17
- /**
18
- * Frontmatter and extracted elements collected so far. Call after
19
- * `finish()` for the complete data. Extracted elements drain on each call.
20
- */
21
- takeData(): MdreamStreamData
22
- }
23
-
24
- export interface ChunkLocNapi {
25
- from: number
26
- to: number
27
- }
28
-
29
- export interface ChunkMetadataNapi {
30
- headers?: Record<string, string>
31
- code?: string
32
- loc?: ChunkLocNapi
33
- }
34
-
35
- export interface CleanOptionsNapi {
36
- urls?: boolean
37
- fragments?: boolean
38
- emptyLinks?: boolean
39
- blankLines?: boolean
40
- redundantLinks?: boolean
41
- selfLinkHeadings?: boolean
42
- emptyImages?: boolean
43
- emptyLinkText?: boolean
44
- }
45
-
46
- export interface ExtractedElementNapi {
47
- selector: string
48
- tagName: string
49
- textContent: string
50
- attributes: Record<string, string>
51
- }
52
-
53
- export interface ExtractionOptions {
54
- selectors: Array<string>
55
- }
56
-
57
- export interface FilterOptions {
58
- include?: Array<string>
59
- exclude?: Array<string>
60
- processChildren?: boolean
61
- }
62
-
63
- export interface FrontmatterOptions {
64
- additionalFields?: Record<string, string>
65
- metaFields?: Array<string>
66
- }
67
-
68
- export declare function htmlToMarkdown(html: string, options?: HtmlToMarkdownOptions | undefined | null): MdreamNapiResult
69
-
70
- export declare function htmlToMarkdownBytes(html: Uint8Array, options?: HtmlToMarkdownOptions | undefined | null): MdreamNapiResult
71
-
72
- export declare function htmlToMarkdownChunks(html: string, options?: HtmlToMarkdownOptions | undefined | null, splitterOptions?: SplitterOptionsNapi | undefined | null): Array<MarkdownChunkNapi>
73
-
74
- export interface HtmlToMarkdownOptions {
75
- origin?: string
76
- cleanUrls?: boolean
77
- clean?: CleanOptionsNapi
78
- plugins?: PluginOptions
79
- wrapWidth?: number
80
- format?: "markdown" | "text" | "html"
81
- }
82
-
83
- export interface MarkdownChunkNapi {
84
- content: string
85
- metadata: ChunkMetadataNapi
86
- }
87
-
88
- export interface MdreamNapiResult {
89
- markdown: string
90
- extracted?: Array<ExtractedElementNapi>
91
- frontmatter?: Record<string, string>
92
- }
93
-
94
- /** Plugin data a stream collected: frontmatter and extracted elements. */
95
- export interface MdreamStreamData {
96
- extracted?: Array<ExtractedElementNapi>
97
- frontmatter?: Record<string, string>
98
- }
99
-
100
- export interface PluginOptions {
101
- filter?: FilterOptions
102
- isolateMain?: boolean
103
- frontmatter?: FrontmatterOptions
104
- tailwind?: boolean
105
- extraction?: ExtractionOptions
106
- tagOverrides?: Record<string, TagOverrideNapi>
107
- }
108
-
109
- export declare function splitMarkdown(markdown: string, options?: SplitterOptionsNapi | undefined | null): Array<MarkdownChunkNapi>
110
-
111
- export interface SplitterOptionsNapi {
112
- headersToSplitOn?: Array<number>
113
- returnEachLine?: boolean
114
- stripHeaders?: boolean
115
- chunkSize?: number
116
- chunkOverlap?: number
117
- }
118
-
119
- export interface TagOverrideNapi {
120
- enter?: string
121
- exit?: string
122
- spacing?: Array<number>
123
- isInline?: boolean
124
- isSelfClosing?: boolean
125
- collapsesInnerWhiteSpace?: boolean
126
- alias?: string
127
- }
@@ -1,127 +0,0 @@
1
- /* auto-generated by NAPI-RS */
2
- /* eslint-disable */
3
-
4
- /**
5
- * Which binding artifact the generated loader actually loaded: `'native'` for
6
- * a native addon, otherwise the `platformArchABI` of the WASI flavor. Every
7
- * flavor napi-rs can build is listed, because `NAPI_RS_NATIVE_LIBRARY_PATH`
8
- * can point the loader at a WASI artifact this package does not build itself.
9
- */
10
- export declare const __napiBindingTarget: 'native' | 'wasm32-wasi' | 'wasm32-wasip1'
11
-
12
- export declare class MarkdownStream {
13
- constructor(options?: HtmlToMarkdownOptions | undefined | null)
14
- processChunk(chunk: string): string
15
- processChunkBytes(chunk: Uint8Array): string
16
- finish(): string
17
- /**
18
- * Frontmatter and extracted elements collected so far. Call after
19
- * `finish()` for the complete data. Extracted elements drain on each call.
20
- */
21
- takeData(): MdreamStreamData
22
- }
23
-
24
- export interface ChunkLocNapi {
25
- from: number
26
- to: number
27
- }
28
-
29
- export interface ChunkMetadataNapi {
30
- headers?: Record<string, string>
31
- code?: string
32
- loc?: ChunkLocNapi
33
- }
34
-
35
- export interface CleanOptionsNapi {
36
- urls?: boolean
37
- fragments?: boolean
38
- emptyLinks?: boolean
39
- blankLines?: boolean
40
- redundantLinks?: boolean
41
- selfLinkHeadings?: boolean
42
- emptyImages?: boolean
43
- emptyLinkText?: boolean
44
- }
45
-
46
- export interface ExtractedElementNapi {
47
- selector: string
48
- tagName: string
49
- textContent: string
50
- attributes: Record<string, string>
51
- }
52
-
53
- export interface ExtractionOptions {
54
- selectors: Array<string>
55
- }
56
-
57
- export interface FilterOptions {
58
- include?: Array<string>
59
- exclude?: Array<string>
60
- processChildren?: boolean
61
- }
62
-
63
- export interface FrontmatterOptions {
64
- additionalFields?: Record<string, string>
65
- metaFields?: Array<string>
66
- }
67
-
68
- export declare function htmlToMarkdown(html: string, options?: HtmlToMarkdownOptions | undefined | null): MdreamNapiResult
69
-
70
- export declare function htmlToMarkdownBytes(html: Uint8Array, options?: HtmlToMarkdownOptions | undefined | null): MdreamNapiResult
71
-
72
- export declare function htmlToMarkdownChunks(html: string, options?: HtmlToMarkdownOptions | undefined | null, splitterOptions?: SplitterOptionsNapi | undefined | null): Array<MarkdownChunkNapi>
73
-
74
- export interface HtmlToMarkdownOptions {
75
- origin?: string
76
- cleanUrls?: boolean
77
- clean?: CleanOptionsNapi
78
- plugins?: PluginOptions
79
- wrapWidth?: number
80
- format?: "markdown" | "text" | "html"
81
- }
82
-
83
- export interface MarkdownChunkNapi {
84
- content: string
85
- metadata: ChunkMetadataNapi
86
- }
87
-
88
- export interface MdreamNapiResult {
89
- markdown: string
90
- extracted?: Array<ExtractedElementNapi>
91
- frontmatter?: Record<string, string>
92
- }
93
-
94
- /** Plugin data a stream collected: frontmatter and extracted elements. */
95
- export interface MdreamStreamData {
96
- extracted?: Array<ExtractedElementNapi>
97
- frontmatter?: Record<string, string>
98
- }
99
-
100
- export interface PluginOptions {
101
- filter?: FilterOptions
102
- isolateMain?: boolean
103
- frontmatter?: FrontmatterOptions
104
- tailwind?: boolean
105
- extraction?: ExtractionOptions
106
- tagOverrides?: Record<string, TagOverrideNapi>
107
- }
108
-
109
- export declare function splitMarkdown(markdown: string, options?: SplitterOptionsNapi | undefined | null): Array<MarkdownChunkNapi>
110
-
111
- export interface SplitterOptionsNapi {
112
- headersToSplitOn?: Array<number>
113
- returnEachLine?: boolean
114
- stripHeaders?: boolean
115
- chunkSize?: number
116
- chunkOverlap?: number
117
- }
118
-
119
- export interface TagOverrideNapi {
120
- enter?: string
121
- exit?: string
122
- spacing?: Array<number>
123
- isInline?: boolean
124
- isSelfClosing?: boolean
125
- collapsesInnerWhiteSpace?: boolean
126
- alias?: string
127
- }