failproofai 0.0.6-beta.2 → 0.0.6-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (511) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/required-server-files.json +7 -1
  5. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  6. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
  10. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  11. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  12. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  13. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  14. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  16. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  19. package/.next/standalone/.next/server/app/_not-found.rsc +17 -17
  20. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +17 -17
  21. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  22. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
  23. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  24. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  25. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  26. package/.next/standalone/.next/server/app/index.html +1 -1
  27. package/.next/standalone/.next/server/app/index.rsc +16 -16
  28. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  29. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +16 -16
  30. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  31. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +11 -11
  32. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  33. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  34. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
  37. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  40. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  43. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  44. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  47. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g72weg._.js +1 -1
  50. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +1 -1
  51. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__092s1ta._.js +2 -2
  52. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09icjsf._.js +2 -2
  53. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g.lg8b._.js +2 -2
  54. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h..k-e._.js +2 -2
  55. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0okos0k._.js +2 -2
  56. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0i5kvry._.js → [root-of-the-server]__0om-5pe._.js} +2 -2
  57. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w6l33k._.js +2 -2
  58. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__05akje6._.js → [root-of-the-server]__111.vxi._.js} +2 -2
  59. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11pa2ra._.js +2 -2
  60. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12t-wym._.js +2 -2
  61. package/.next/standalone/.next/server/chunks/ssr/_10lm7or._.js +2 -2
  62. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +1 -1
  63. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +1 -1
  64. package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_0mebn66._.js +1 -1
  65. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  66. package/.next/standalone/.next/server/pages/404.html +2 -2
  67. package/.next/standalone/.next/server/pages/500.html +1 -1
  68. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/server-reference-manifest.json +9 -9
  70. package/.next/standalone/.next/static/chunks/{05j1px0r8yzh6.js → 02dqjyv6_9mhq.js} +2 -2
  71. package/.next/standalone/.next/static/chunks/{14cl9poem30dq.js → 070orfsl6.xal.js} +1 -1
  72. package/.next/standalone/.next/static/chunks/0mir9jdxn35~s.css +1 -0
  73. package/.next/standalone/.next/static/chunks/{00j0rr7rh8ef8.js → 0o547jv-k_k35.js} +1 -1
  74. package/.next/standalone/.next/static/chunks/{0ijk_kek9_wyx.js → 0pk2h2.mjxy.m.js} +1 -1
  75. package/.next/standalone/.next/static/chunks/{0xpl.oscrakvx.js → 0rcwkbh24w38b.js} +1 -1
  76. package/.next/standalone/.next/static/chunks/{1052sguyd-.ka.js → 140xx_tfr~lm_.js} +1 -1
  77. package/.next/standalone/.next/static/chunks/{0npb~873.wvg3.js → 169_e4dq~1~b6.js} +1 -1
  78. package/.next/standalone/.next/static/chunks/{0badv41uxa56..js → 17ne4p.1sw1jy.js} +1 -1
  79. package/.next/standalone/next.config.ts +6 -0
  80. package/.next/standalone/package.json +2 -2
  81. package/.next/standalone/server.js +1 -1
  82. package/bin/failproofai.mjs +91 -4
  83. package/dist/cli.mjs +1155 -54
  84. package/package.json +2 -2
  85. package/scripts/prune-standalone.mjs +128 -0
  86. package/src/auth/login.ts +104 -0
  87. package/src/auth/logout.ts +50 -0
  88. package/src/auth/token-store.ts +64 -0
  89. package/src/hooks/builtin-policies.ts +22 -20
  90. package/src/hooks/handler.ts +35 -15
  91. package/src/relay/daemon.ts +362 -0
  92. package/src/relay/pid.ts +76 -0
  93. package/src/relay/queue.ts +225 -0
  94. package/.next/standalone/.claude/settings.json +0 -316
  95. package/.next/standalone/.failproofai/policies/review-policies.mjs +0 -113
  96. package/.next/standalone/.failproofai/policies/workflow-policies.mjs +0 -63
  97. package/.next/standalone/.failproofai/policies-config.json +0 -39
  98. package/.next/standalone/.next/static/chunks/0gu_a.a80ritd.css +0 -1
  99. package/.next/standalone/AGENTS.md +0 -80
  100. package/.next/standalone/CHANGELOG.md +0 -151
  101. package/.next/standalone/CLAUDE.md +0 -165
  102. package/.next/standalone/CONTRIBUTING.md +0 -76
  103. package/.next/standalone/Dockerfile.docs +0 -12
  104. package/.next/standalone/LICENSE +0 -42
  105. package/.next/standalone/README.md +0 -301
  106. package/.next/standalone/bin/failproofai.mjs +0 -352
  107. package/.next/standalone/bun.lock +0 -1119
  108. package/.next/standalone/components.json +0 -23
  109. package/.next/standalone/dist/cli.mjs +0 -3595
  110. package/.next/standalone/dist/index.js +0 -80
  111. package/.next/standalone/docs/ar/architecture.mdx +0 -334
  112. package/.next/standalone/docs/ar/built-in-policies.mdx +0 -574
  113. package/.next/standalone/docs/ar/cli/dashboard.mdx +0 -28
  114. package/.next/standalone/docs/ar/cli/environment-variables.mdx +0 -34
  115. package/.next/standalone/docs/ar/cli/hook.mdx +0 -31
  116. package/.next/standalone/docs/ar/cli/install-policies.mdx +0 -48
  117. package/.next/standalone/docs/ar/cli/list-policies.mdx +0 -31
  118. package/.next/standalone/docs/ar/cli/remove-policies.mdx +0 -43
  119. package/.next/standalone/docs/ar/cli/version.mdx +0 -13
  120. package/.next/standalone/docs/ar/configuration.mdx +0 -223
  121. package/.next/standalone/docs/ar/custom-policies.mdx +0 -354
  122. package/.next/standalone/docs/ar/dashboard.mdx +0 -142
  123. package/.next/standalone/docs/ar/examples.mdx +0 -307
  124. package/.next/standalone/docs/ar/for-agents.mdx +0 -39
  125. package/.next/standalone/docs/ar/getting-started.mdx +0 -187
  126. package/.next/standalone/docs/ar/introduction.mdx +0 -58
  127. package/.next/standalone/docs/ar/package-aliases.mdx +0 -82
  128. package/.next/standalone/docs/ar/testing.mdx +0 -261
  129. package/.next/standalone/docs/architecture.mdx +0 -332
  130. package/.next/standalone/docs/built-in-policies.mdx +0 -574
  131. package/.next/standalone/docs/cli/dashboard.mdx +0 -28
  132. package/.next/standalone/docs/cli/environment-variables.mdx +0 -34
  133. package/.next/standalone/docs/cli/hook.mdx +0 -30
  134. package/.next/standalone/docs/cli/install-policies.mdx +0 -47
  135. package/.next/standalone/docs/cli/list-policies.mdx +0 -31
  136. package/.next/standalone/docs/cli/remove-policies.mdx +0 -43
  137. package/.next/standalone/docs/cli/version.mdx +0 -12
  138. package/.next/standalone/docs/configuration.mdx +0 -222
  139. package/.next/standalone/docs/custom-policies.mdx +0 -353
  140. package/.next/standalone/docs/dashboard.mdx +0 -142
  141. package/.next/standalone/docs/de/architecture.mdx +0 -332
  142. package/.next/standalone/docs/de/built-in-policies.mdx +0 -574
  143. package/.next/standalone/docs/de/cli/dashboard.mdx +0 -28
  144. package/.next/standalone/docs/de/cli/environment-variables.mdx +0 -34
  145. package/.next/standalone/docs/de/cli/hook.mdx +0 -30
  146. package/.next/standalone/docs/de/cli/install-policies.mdx +0 -47
  147. package/.next/standalone/docs/de/cli/list-policies.mdx +0 -31
  148. package/.next/standalone/docs/de/cli/remove-policies.mdx +0 -43
  149. package/.next/standalone/docs/de/cli/version.mdx +0 -12
  150. package/.next/standalone/docs/de/configuration.mdx +0 -222
  151. package/.next/standalone/docs/de/custom-policies.mdx +0 -353
  152. package/.next/standalone/docs/de/dashboard.mdx +0 -142
  153. package/.next/standalone/docs/de/examples.mdx +0 -307
  154. package/.next/standalone/docs/de/for-agents.mdx +0 -38
  155. package/.next/standalone/docs/de/getting-started.mdx +0 -186
  156. package/.next/standalone/docs/de/introduction.mdx +0 -57
  157. package/.next/standalone/docs/de/package-aliases.mdx +0 -82
  158. package/.next/standalone/docs/de/testing.mdx +0 -260
  159. package/.next/standalone/docs/docs.json +0 -1002
  160. package/.next/standalone/docs/es/architecture.mdx +0 -332
  161. package/.next/standalone/docs/es/built-in-policies.mdx +0 -574
  162. package/.next/standalone/docs/es/cli/dashboard.mdx +0 -28
  163. package/.next/standalone/docs/es/cli/environment-variables.mdx +0 -34
  164. package/.next/standalone/docs/es/cli/hook.mdx +0 -30
  165. package/.next/standalone/docs/es/cli/install-policies.mdx +0 -47
  166. package/.next/standalone/docs/es/cli/list-policies.mdx +0 -31
  167. package/.next/standalone/docs/es/cli/remove-policies.mdx +0 -43
  168. package/.next/standalone/docs/es/cli/version.mdx +0 -12
  169. package/.next/standalone/docs/es/configuration.mdx +0 -222
  170. package/.next/standalone/docs/es/custom-policies.mdx +0 -353
  171. package/.next/standalone/docs/es/dashboard.mdx +0 -142
  172. package/.next/standalone/docs/es/examples.mdx +0 -307
  173. package/.next/standalone/docs/es/for-agents.mdx +0 -38
  174. package/.next/standalone/docs/es/getting-started.mdx +0 -186
  175. package/.next/standalone/docs/es/introduction.mdx +0 -57
  176. package/.next/standalone/docs/es/package-aliases.mdx +0 -82
  177. package/.next/standalone/docs/es/testing.mdx +0 -260
  178. package/.next/standalone/docs/examples.mdx +0 -307
  179. package/.next/standalone/docs/favicon.ico +0 -0
  180. package/.next/standalone/docs/for-agents.mdx +0 -38
  181. package/.next/standalone/docs/fr/architecture.mdx +0 -332
  182. package/.next/standalone/docs/fr/built-in-policies.mdx +0 -574
  183. package/.next/standalone/docs/fr/cli/dashboard.mdx +0 -28
  184. package/.next/standalone/docs/fr/cli/environment-variables.mdx +0 -34
  185. package/.next/standalone/docs/fr/cli/hook.mdx +0 -30
  186. package/.next/standalone/docs/fr/cli/install-policies.mdx +0 -47
  187. package/.next/standalone/docs/fr/cli/list-policies.mdx +0 -31
  188. package/.next/standalone/docs/fr/cli/remove-policies.mdx +0 -43
  189. package/.next/standalone/docs/fr/cli/version.mdx +0 -12
  190. package/.next/standalone/docs/fr/configuration.mdx +0 -222
  191. package/.next/standalone/docs/fr/custom-policies.mdx +0 -353
  192. package/.next/standalone/docs/fr/dashboard.mdx +0 -142
  193. package/.next/standalone/docs/fr/examples.mdx +0 -307
  194. package/.next/standalone/docs/fr/for-agents.mdx +0 -38
  195. package/.next/standalone/docs/fr/getting-started.mdx +0 -186
  196. package/.next/standalone/docs/fr/introduction.mdx +0 -57
  197. package/.next/standalone/docs/fr/package-aliases.mdx +0 -82
  198. package/.next/standalone/docs/fr/testing.mdx +0 -260
  199. package/.next/standalone/docs/getting-started.mdx +0 -186
  200. package/.next/standalone/docs/he/architecture.mdx +0 -333
  201. package/.next/standalone/docs/he/built-in-policies.mdx +0 -574
  202. package/.next/standalone/docs/he/cli/dashboard.mdx +0 -28
  203. package/.next/standalone/docs/he/cli/environment-variables.mdx +0 -34
  204. package/.next/standalone/docs/he/cli/hook.mdx +0 -30
  205. package/.next/standalone/docs/he/cli/install-policies.mdx +0 -47
  206. package/.next/standalone/docs/he/cli/list-policies.mdx +0 -32
  207. package/.next/standalone/docs/he/cli/remove-policies.mdx +0 -43
  208. package/.next/standalone/docs/he/cli/version.mdx +0 -12
  209. package/.next/standalone/docs/he/configuration.mdx +0 -223
  210. package/.next/standalone/docs/he/custom-policies.mdx +0 -353
  211. package/.next/standalone/docs/he/dashboard.mdx +0 -142
  212. package/.next/standalone/docs/he/examples.mdx +0 -307
  213. package/.next/standalone/docs/he/for-agents.mdx +0 -38
  214. package/.next/standalone/docs/he/getting-started.mdx +0 -186
  215. package/.next/standalone/docs/he/introduction.mdx +0 -57
  216. package/.next/standalone/docs/he/package-aliases.mdx +0 -82
  217. package/.next/standalone/docs/he/testing.mdx +0 -260
  218. package/.next/standalone/docs/hi/architecture.mdx +0 -334
  219. package/.next/standalone/docs/hi/built-in-policies.mdx +0 -576
  220. package/.next/standalone/docs/hi/cli/dashboard.mdx +0 -28
  221. package/.next/standalone/docs/hi/cli/environment-variables.mdx +0 -34
  222. package/.next/standalone/docs/hi/cli/hook.mdx +0 -30
  223. package/.next/standalone/docs/hi/cli/install-policies.mdx +0 -47
  224. package/.next/standalone/docs/hi/cli/list-policies.mdx +0 -31
  225. package/.next/standalone/docs/hi/cli/remove-policies.mdx +0 -43
  226. package/.next/standalone/docs/hi/cli/version.mdx +0 -12
  227. package/.next/standalone/docs/hi/configuration.mdx +0 -222
  228. package/.next/standalone/docs/hi/custom-policies.mdx +0 -354
  229. package/.next/standalone/docs/hi/dashboard.mdx +0 -142
  230. package/.next/standalone/docs/hi/examples.mdx +0 -309
  231. package/.next/standalone/docs/hi/for-agents.mdx +0 -38
  232. package/.next/standalone/docs/hi/getting-started.mdx +0 -187
  233. package/.next/standalone/docs/hi/introduction.mdx +0 -57
  234. package/.next/standalone/docs/hi/package-aliases.mdx +0 -82
  235. package/.next/standalone/docs/hi/testing.mdx +0 -260
  236. package/.next/standalone/docs/i18n/README.ar.md +0 -312
  237. package/.next/standalone/docs/i18n/README.de.md +0 -307
  238. package/.next/standalone/docs/i18n/README.es.md +0 -307
  239. package/.next/standalone/docs/i18n/README.fr.md +0 -307
  240. package/.next/standalone/docs/i18n/README.he.md +0 -312
  241. package/.next/standalone/docs/i18n/README.hi.md +0 -307
  242. package/.next/standalone/docs/i18n/README.it.md +0 -307
  243. package/.next/standalone/docs/i18n/README.ja.md +0 -307
  244. package/.next/standalone/docs/i18n/README.ko.md +0 -307
  245. package/.next/standalone/docs/i18n/README.pt-br.md +0 -307
  246. package/.next/standalone/docs/i18n/README.ru.md +0 -308
  247. package/.next/standalone/docs/i18n/README.tr.md +0 -307
  248. package/.next/standalone/docs/i18n/README.vi.md +0 -307
  249. package/.next/standalone/docs/i18n/README.zh.md +0 -307
  250. package/.next/standalone/docs/introduction.mdx +0 -57
  251. package/.next/standalone/docs/it/architecture.mdx +0 -334
  252. package/.next/standalone/docs/it/built-in-policies.mdx +0 -574
  253. package/.next/standalone/docs/it/cli/dashboard.mdx +0 -28
  254. package/.next/standalone/docs/it/cli/environment-variables.mdx +0 -34
  255. package/.next/standalone/docs/it/cli/hook.mdx +0 -30
  256. package/.next/standalone/docs/it/cli/install-policies.mdx +0 -47
  257. package/.next/standalone/docs/it/cli/list-policies.mdx +0 -31
  258. package/.next/standalone/docs/it/cli/remove-policies.mdx +0 -43
  259. package/.next/standalone/docs/it/cli/version.mdx +0 -12
  260. package/.next/standalone/docs/it/configuration.mdx +0 -222
  261. package/.next/standalone/docs/it/custom-policies.mdx +0 -353
  262. package/.next/standalone/docs/it/dashboard.mdx +0 -142
  263. package/.next/standalone/docs/it/examples.mdx +0 -307
  264. package/.next/standalone/docs/it/for-agents.mdx +0 -38
  265. package/.next/standalone/docs/it/getting-started.mdx +0 -186
  266. package/.next/standalone/docs/it/introduction.mdx +0 -57
  267. package/.next/standalone/docs/it/package-aliases.mdx +0 -82
  268. package/.next/standalone/docs/it/testing.mdx +0 -260
  269. package/.next/standalone/docs/ja/architecture.mdx +0 -332
  270. package/.next/standalone/docs/ja/built-in-policies.mdx +0 -572
  271. package/.next/standalone/docs/ja/cli/dashboard.mdx +0 -28
  272. package/.next/standalone/docs/ja/cli/environment-variables.mdx +0 -34
  273. package/.next/standalone/docs/ja/cli/hook.mdx +0 -30
  274. package/.next/standalone/docs/ja/cli/install-policies.mdx +0 -47
  275. package/.next/standalone/docs/ja/cli/list-policies.mdx +0 -31
  276. package/.next/standalone/docs/ja/cli/remove-policies.mdx +0 -43
  277. package/.next/standalone/docs/ja/cli/version.mdx +0 -12
  278. package/.next/standalone/docs/ja/configuration.mdx +0 -222
  279. package/.next/standalone/docs/ja/custom-policies.mdx +0 -353
  280. package/.next/standalone/docs/ja/dashboard.mdx +0 -142
  281. package/.next/standalone/docs/ja/examples.mdx +0 -307
  282. package/.next/standalone/docs/ja/for-agents.mdx +0 -38
  283. package/.next/standalone/docs/ja/getting-started.mdx +0 -186
  284. package/.next/standalone/docs/ja/introduction.mdx +0 -57
  285. package/.next/standalone/docs/ja/package-aliases.mdx +0 -82
  286. package/.next/standalone/docs/ja/testing.mdx +0 -260
  287. package/.next/standalone/docs/ko/architecture.mdx +0 -332
  288. package/.next/standalone/docs/ko/built-in-policies.mdx +0 -572
  289. package/.next/standalone/docs/ko/cli/dashboard.mdx +0 -28
  290. package/.next/standalone/docs/ko/cli/environment-variables.mdx +0 -34
  291. package/.next/standalone/docs/ko/cli/hook.mdx +0 -30
  292. package/.next/standalone/docs/ko/cli/install-policies.mdx +0 -47
  293. package/.next/standalone/docs/ko/cli/list-policies.mdx +0 -31
  294. package/.next/standalone/docs/ko/cli/remove-policies.mdx +0 -43
  295. package/.next/standalone/docs/ko/cli/version.mdx +0 -12
  296. package/.next/standalone/docs/ko/configuration.mdx +0 -222
  297. package/.next/standalone/docs/ko/custom-policies.mdx +0 -353
  298. package/.next/standalone/docs/ko/dashboard.mdx +0 -142
  299. package/.next/standalone/docs/ko/examples.mdx +0 -307
  300. package/.next/standalone/docs/ko/for-agents.mdx +0 -38
  301. package/.next/standalone/docs/ko/getting-started.mdx +0 -186
  302. package/.next/standalone/docs/ko/introduction.mdx +0 -57
  303. package/.next/standalone/docs/ko/package-aliases.mdx +0 -82
  304. package/.next/standalone/docs/ko/testing.mdx +0 -260
  305. package/.next/standalone/docs/logo/dark.svg +0 -21
  306. package/.next/standalone/docs/logo/exosphere-dark.png +0 -0
  307. package/.next/standalone/docs/logo/exosphere-light.png +0 -0
  308. package/.next/standalone/docs/logo/light.svg +0 -21
  309. package/.next/standalone/docs/package-aliases.mdx +0 -82
  310. package/.next/standalone/docs/pt-br/architecture.mdx +0 -332
  311. package/.next/standalone/docs/pt-br/built-in-policies.mdx +0 -574
  312. package/.next/standalone/docs/pt-br/cli/dashboard.mdx +0 -28
  313. package/.next/standalone/docs/pt-br/cli/environment-variables.mdx +0 -34
  314. package/.next/standalone/docs/pt-br/cli/hook.mdx +0 -30
  315. package/.next/standalone/docs/pt-br/cli/install-policies.mdx +0 -47
  316. package/.next/standalone/docs/pt-br/cli/list-policies.mdx +0 -31
  317. package/.next/standalone/docs/pt-br/cli/remove-policies.mdx +0 -43
  318. package/.next/standalone/docs/pt-br/cli/version.mdx +0 -12
  319. package/.next/standalone/docs/pt-br/configuration.mdx +0 -222
  320. package/.next/standalone/docs/pt-br/custom-policies.mdx +0 -353
  321. package/.next/standalone/docs/pt-br/dashboard.mdx +0 -142
  322. package/.next/standalone/docs/pt-br/examples.mdx +0 -307
  323. package/.next/standalone/docs/pt-br/for-agents.mdx +0 -38
  324. package/.next/standalone/docs/pt-br/getting-started.mdx +0 -186
  325. package/.next/standalone/docs/pt-br/introduction.mdx +0 -57
  326. package/.next/standalone/docs/pt-br/package-aliases.mdx +0 -82
  327. package/.next/standalone/docs/pt-br/testing.mdx +0 -260
  328. package/.next/standalone/docs/ru/architecture.mdx +0 -333
  329. package/.next/standalone/docs/ru/built-in-policies.mdx +0 -574
  330. package/.next/standalone/docs/ru/cli/dashboard.mdx +0 -28
  331. package/.next/standalone/docs/ru/cli/environment-variables.mdx +0 -34
  332. package/.next/standalone/docs/ru/cli/hook.mdx +0 -30
  333. package/.next/standalone/docs/ru/cli/install-policies.mdx +0 -48
  334. package/.next/standalone/docs/ru/cli/list-policies.mdx +0 -32
  335. package/.next/standalone/docs/ru/cli/remove-policies.mdx +0 -43
  336. package/.next/standalone/docs/ru/cli/version.mdx +0 -12
  337. package/.next/standalone/docs/ru/configuration.mdx +0 -222
  338. package/.next/standalone/docs/ru/custom-policies.mdx +0 -354
  339. package/.next/standalone/docs/ru/dashboard.mdx +0 -142
  340. package/.next/standalone/docs/ru/examples.mdx +0 -309
  341. package/.next/standalone/docs/ru/for-agents.mdx +0 -38
  342. package/.next/standalone/docs/ru/getting-started.mdx +0 -186
  343. package/.next/standalone/docs/ru/introduction.mdx +0 -57
  344. package/.next/standalone/docs/ru/package-aliases.mdx +0 -82
  345. package/.next/standalone/docs/ru/testing.mdx +0 -260
  346. package/.next/standalone/docs/testing.mdx +0 -260
  347. package/.next/standalone/docs/tr/architecture.mdx +0 -333
  348. package/.next/standalone/docs/tr/built-in-policies.mdx +0 -574
  349. package/.next/standalone/docs/tr/cli/dashboard.mdx +0 -28
  350. package/.next/standalone/docs/tr/cli/environment-variables.mdx +0 -34
  351. package/.next/standalone/docs/tr/cli/hook.mdx +0 -30
  352. package/.next/standalone/docs/tr/cli/install-policies.mdx +0 -47
  353. package/.next/standalone/docs/tr/cli/list-policies.mdx +0 -31
  354. package/.next/standalone/docs/tr/cli/remove-policies.mdx +0 -44
  355. package/.next/standalone/docs/tr/cli/version.mdx +0 -12
  356. package/.next/standalone/docs/tr/configuration.mdx +0 -222
  357. package/.next/standalone/docs/tr/custom-policies.mdx +0 -353
  358. package/.next/standalone/docs/tr/dashboard.mdx +0 -142
  359. package/.next/standalone/docs/tr/examples.mdx +0 -308
  360. package/.next/standalone/docs/tr/for-agents.mdx +0 -38
  361. package/.next/standalone/docs/tr/getting-started.mdx +0 -186
  362. package/.next/standalone/docs/tr/introduction.mdx +0 -57
  363. package/.next/standalone/docs/tr/package-aliases.mdx +0 -82
  364. package/.next/standalone/docs/tr/testing.mdx +0 -260
  365. package/.next/standalone/docs/vi/architecture.mdx +0 -334
  366. package/.next/standalone/docs/vi/built-in-policies.mdx +0 -575
  367. package/.next/standalone/docs/vi/cli/dashboard.mdx +0 -28
  368. package/.next/standalone/docs/vi/cli/environment-variables.mdx +0 -34
  369. package/.next/standalone/docs/vi/cli/hook.mdx +0 -30
  370. package/.next/standalone/docs/vi/cli/install-policies.mdx +0 -47
  371. package/.next/standalone/docs/vi/cli/list-policies.mdx +0 -31
  372. package/.next/standalone/docs/vi/cli/remove-policies.mdx +0 -43
  373. package/.next/standalone/docs/vi/cli/version.mdx +0 -13
  374. package/.next/standalone/docs/vi/configuration.mdx +0 -222
  375. package/.next/standalone/docs/vi/custom-policies.mdx +0 -353
  376. package/.next/standalone/docs/vi/dashboard.mdx +0 -142
  377. package/.next/standalone/docs/vi/examples.mdx +0 -308
  378. package/.next/standalone/docs/vi/for-agents.mdx +0 -38
  379. package/.next/standalone/docs/vi/getting-started.mdx +0 -186
  380. package/.next/standalone/docs/vi/introduction.mdx +0 -57
  381. package/.next/standalone/docs/vi/package-aliases.mdx +0 -82
  382. package/.next/standalone/docs/vi/testing.mdx +0 -260
  383. package/.next/standalone/docs/zh/architecture.mdx +0 -332
  384. package/.next/standalone/docs/zh/built-in-policies.mdx +0 -572
  385. package/.next/standalone/docs/zh/cli/dashboard.mdx +0 -28
  386. package/.next/standalone/docs/zh/cli/environment-variables.mdx +0 -34
  387. package/.next/standalone/docs/zh/cli/hook.mdx +0 -30
  388. package/.next/standalone/docs/zh/cli/install-policies.mdx +0 -47
  389. package/.next/standalone/docs/zh/cli/list-policies.mdx +0 -31
  390. package/.next/standalone/docs/zh/cli/remove-policies.mdx +0 -43
  391. package/.next/standalone/docs/zh/cli/version.mdx +0 -12
  392. package/.next/standalone/docs/zh/configuration.mdx +0 -222
  393. package/.next/standalone/docs/zh/custom-policies.mdx +0 -353
  394. package/.next/standalone/docs/zh/dashboard.mdx +0 -142
  395. package/.next/standalone/docs/zh/examples.mdx +0 -307
  396. package/.next/standalone/docs/zh/for-agents.mdx +0 -38
  397. package/.next/standalone/docs/zh/getting-started.mdx +0 -186
  398. package/.next/standalone/docs/zh/introduction.mdx +0 -57
  399. package/.next/standalone/docs/zh/package-aliases.mdx +0 -82
  400. package/.next/standalone/docs/zh/testing.mdx +0 -260
  401. package/.next/standalone/eslint.config.mjs +0 -15
  402. package/.next/standalone/examples/convention-policies/security-policies.mjs +0 -40
  403. package/.next/standalone/examples/convention-policies/workflow-policies.mjs +0 -41
  404. package/.next/standalone/examples/policies-advanced/index.js +0 -103
  405. package/.next/standalone/examples/policies-advanced/utils.js +0 -35
  406. package/.next/standalone/examples/policies-basic.js +0 -77
  407. package/.next/standalone/examples/policies-notification.js +0 -104
  408. package/.next/standalone/node_modules/@img/colour/color.cjs +0 -1594
  409. package/.next/standalone/node_modules/@img/colour/index.cjs +0 -1
  410. package/.next/standalone/node_modules/@img/colour/package.json +0 -45
  411. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/README.md +0 -46
  412. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +0 -221
  413. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +0 -1
  414. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  415. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/package.json +0 -42
  416. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/versions.json +0 -30
  417. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +0 -46
  418. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +0 -221
  419. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +0 -1
  420. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  421. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +0 -42
  422. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +0 -30
  423. package/.next/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  424. package/.next/standalone/node_modules/@img/sharp-linux-x64/package.json +0 -46
  425. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  426. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +0 -46
  427. package/.next/standalone/node_modules/detect-libc/lib/detect-libc.js +0 -313
  428. package/.next/standalone/node_modules/detect-libc/lib/elf.js +0 -39
  429. package/.next/standalone/node_modules/detect-libc/lib/filesystem.js +0 -51
  430. package/.next/standalone/node_modules/detect-libc/lib/process.js +0 -24
  431. package/.next/standalone/node_modules/detect-libc/package.json +0 -44
  432. package/.next/standalone/node_modules/sharp/lib/channel.js +0 -177
  433. package/.next/standalone/node_modules/sharp/lib/colour.js +0 -195
  434. package/.next/standalone/node_modules/sharp/lib/composite.js +0 -212
  435. package/.next/standalone/node_modules/sharp/lib/constructor.js +0 -499
  436. package/.next/standalone/node_modules/sharp/lib/index.js +0 -16
  437. package/.next/standalone/node_modules/sharp/lib/input.js +0 -809
  438. package/.next/standalone/node_modules/sharp/lib/is.js +0 -143
  439. package/.next/standalone/node_modules/sharp/lib/libvips.js +0 -207
  440. package/.next/standalone/node_modules/sharp/lib/operation.js +0 -1016
  441. package/.next/standalone/node_modules/sharp/lib/output.js +0 -1666
  442. package/.next/standalone/node_modules/sharp/lib/resize.js +0 -595
  443. package/.next/standalone/node_modules/sharp/lib/sharp.js +0 -121
  444. package/.next/standalone/node_modules/sharp/lib/utility.js +0 -291
  445. package/.next/standalone/node_modules/sharp/node_modules/semver/classes/comparator.js +0 -143
  446. package/.next/standalone/node_modules/sharp/node_modules/semver/classes/range.js +0 -557
  447. package/.next/standalone/node_modules/sharp/node_modules/semver/classes/semver.js +0 -333
  448. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/cmp.js +0 -54
  449. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/coerce.js +0 -62
  450. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/compare.js +0 -7
  451. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/eq.js +0 -5
  452. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/gt.js +0 -5
  453. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/gte.js +0 -5
  454. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/lt.js +0 -5
  455. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/lte.js +0 -5
  456. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/neq.js +0 -5
  457. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/parse.js +0 -18
  458. package/.next/standalone/node_modules/sharp/node_modules/semver/functions/satisfies.js +0 -12
  459. package/.next/standalone/node_modules/sharp/node_modules/semver/internal/constants.js +0 -37
  460. package/.next/standalone/node_modules/sharp/node_modules/semver/internal/debug.js +0 -11
  461. package/.next/standalone/node_modules/sharp/node_modules/semver/internal/identifiers.js +0 -29
  462. package/.next/standalone/node_modules/sharp/node_modules/semver/internal/lrucache.js +0 -42
  463. package/.next/standalone/node_modules/sharp/node_modules/semver/internal/parse-options.js +0 -17
  464. package/.next/standalone/node_modules/sharp/node_modules/semver/internal/re.js +0 -223
  465. package/.next/standalone/node_modules/sharp/node_modules/semver/package.json +0 -78
  466. package/.next/standalone/node_modules/sharp/package.json +0 -202
  467. package/.next/standalone/scripts/alias-proxy.js +0 -18
  468. package/.next/standalone/scripts/dev.ts +0 -3
  469. package/.next/standalone/scripts/install-telemetry.mjs +0 -108
  470. package/.next/standalone/scripts/launch.ts +0 -83
  471. package/.next/standalone/scripts/parse-script-args.ts +0 -87
  472. package/.next/standalone/scripts/postinstall.mjs +0 -121
  473. package/.next/standalone/scripts/preuninstall.mjs +0 -131
  474. package/.next/standalone/scripts/publish-aliases.mjs +0 -87
  475. package/.next/standalone/scripts/start.ts +0 -3
  476. package/.next/standalone/scripts/sync-hook-events-prompt.md +0 -60
  477. package/.next/standalone/scripts/translate-docs/cache.ts +0 -62
  478. package/.next/standalone/scripts/translate-docs/cli.ts +0 -357
  479. package/.next/standalone/scripts/translate-docs/config.ts +0 -248
  480. package/.next/standalone/scripts/translate-docs/mdx-translator.ts +0 -153
  481. package/.next/standalone/scripts/translate-docs/mintlify-nav.ts +0 -107
  482. package/.next/standalone/scripts/translate-docs/readme-translator.ts +0 -154
  483. package/.next/standalone/scripts/translate-docs/translator.ts +0 -68
  484. package/.next/standalone/scripts/translate-docs/types.ts +0 -43
  485. package/.next/standalone/src/cli-error.ts +0 -18
  486. package/.next/standalone/src/hooks/builtin-policies.ts +0 -1613
  487. package/.next/standalone/src/hooks/custom-hooks-loader.ts +0 -205
  488. package/.next/standalone/src/hooks/custom-hooks-registry.ts +0 -30
  489. package/.next/standalone/src/hooks/handler.ts +0 -202
  490. package/.next/standalone/src/hooks/hook-activity-store.ts +0 -349
  491. package/.next/standalone/src/hooks/hook-logger.ts +0 -133
  492. package/.next/standalone/src/hooks/hook-telemetry.ts +0 -43
  493. package/.next/standalone/src/hooks/hooks-config.ts +0 -166
  494. package/.next/standalone/src/hooks/install-prompt.ts +0 -357
  495. package/.next/standalone/src/hooks/llm-client.ts +0 -90
  496. package/.next/standalone/src/hooks/loader-utils.ts +0 -178
  497. package/.next/standalone/src/hooks/manager.ts +0 -692
  498. package/.next/standalone/src/hooks/policy-evaluator.ts +0 -224
  499. package/.next/standalone/src/hooks/policy-helpers.ts +0 -16
  500. package/.next/standalone/src/hooks/policy-registry.ts +0 -90
  501. package/.next/standalone/src/hooks/policy-types.ts +0 -77
  502. package/.next/standalone/src/hooks/types.ts +0 -63
  503. package/.next/standalone/src/index.ts +0 -19
  504. package/.next/standalone/src/posthog-key.ts +0 -5
  505. package/.next/standalone/tailwind.config.ts +0 -11
  506. package/.next/standalone/tsconfig.json +0 -42
  507. package/.next/standalone/vitest.config.e2e.mts +0 -24
  508. package/.next/standalone/vitest.config.mts +0 -23
  509. /package/.next/standalone/.next/static/{A9pNTZdoYJTVyPAYwQMx5 → wOkJXoch1UmRAmyIuKZWc}/_buildManifest.js +0 -0
  510. /package/.next/standalone/.next/static/{A9pNTZdoYJTVyPAYwQMx5 → wOkJXoch1UmRAmyIuKZWc}/_clientMiddlewareManifest.js +0 -0
  511. /package/.next/standalone/.next/static/{A9pNTZdoYJTVyPAYwQMx5 → wOkJXoch1UmRAmyIuKZWc}/_ssgManifest.js +0 -0
@@ -1,595 +0,0 @@
1
- /*!
2
- Copyright 2013 Lovell Fuller and others.
3
- SPDX-License-Identifier: Apache-2.0
4
- */
5
-
6
- const is = require('./is');
7
-
8
- /**
9
- * Weighting to apply when using contain/cover fit.
10
- * @member
11
- * @private
12
- */
13
- const gravity = {
14
- center: 0,
15
- centre: 0,
16
- north: 1,
17
- east: 2,
18
- south: 3,
19
- west: 4,
20
- northeast: 5,
21
- southeast: 6,
22
- southwest: 7,
23
- northwest: 8
24
- };
25
-
26
- /**
27
- * Position to apply when using contain/cover fit.
28
- * @member
29
- * @private
30
- */
31
- const position = {
32
- top: 1,
33
- right: 2,
34
- bottom: 3,
35
- left: 4,
36
- 'right top': 5,
37
- 'right bottom': 6,
38
- 'left bottom': 7,
39
- 'left top': 8
40
- };
41
-
42
- /**
43
- * How to extend the image.
44
- * @member
45
- * @private
46
- */
47
- const extendWith = {
48
- background: 'background',
49
- copy: 'copy',
50
- repeat: 'repeat',
51
- mirror: 'mirror'
52
- };
53
-
54
- /**
55
- * Strategies for automagic cover behaviour.
56
- * @member
57
- * @private
58
- */
59
- const strategy = {
60
- entropy: 16,
61
- attention: 17
62
- };
63
-
64
- /**
65
- * Reduction kernels.
66
- * @member
67
- * @private
68
- */
69
- const kernel = {
70
- nearest: 'nearest',
71
- linear: 'linear',
72
- cubic: 'cubic',
73
- mitchell: 'mitchell',
74
- lanczos2: 'lanczos2',
75
- lanczos3: 'lanczos3',
76
- mks2013: 'mks2013',
77
- mks2021: 'mks2021'
78
- };
79
-
80
- /**
81
- * Methods by which an image can be resized to fit the provided dimensions.
82
- * @member
83
- * @private
84
- */
85
- const fit = {
86
- contain: 'contain',
87
- cover: 'cover',
88
- fill: 'fill',
89
- inside: 'inside',
90
- outside: 'outside'
91
- };
92
-
93
- /**
94
- * Map external fit property to internal canvas property.
95
- * @member
96
- * @private
97
- */
98
- const mapFitToCanvas = {
99
- contain: 'embed',
100
- cover: 'crop',
101
- fill: 'ignore_aspect',
102
- inside: 'max',
103
- outside: 'min'
104
- };
105
-
106
- /**
107
- * @private
108
- */
109
- function isRotationExpected (options) {
110
- return (options.angle % 360) !== 0 || options.rotationAngle !== 0;
111
- }
112
-
113
- /**
114
- * @private
115
- */
116
- function isResizeExpected (options) {
117
- return options.width !== -1 || options.height !== -1;
118
- }
119
-
120
- /**
121
- * Resize image to `width`, `height` or `width x height`.
122
- *
123
- * When both a `width` and `height` are provided, the possible methods by which the image should **fit** these are:
124
- * - `cover`: (default) Preserving aspect ratio, attempt to ensure the image covers both provided dimensions by cropping/clipping to fit.
125
- * - `contain`: Preserving aspect ratio, contain within both provided dimensions using "letterboxing" where necessary.
126
- * - `fill`: Ignore the aspect ratio of the input and stretch to both provided dimensions.
127
- * - `inside`: Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to both those specified.
128
- * - `outside`: Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to both those specified.
129
- *
130
- * Some of these values are based on the [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) CSS property.
131
- *
132
- * <img alt="Examples of various values for the fit property when resizing" width="100%" style="aspect-ratio: 998/243" src="/api-resize-fit.svg">
133
- *
134
- * When using a **fit** of `cover` or `contain`, the default **position** is `centre`. Other options are:
135
- * - `sharp.position`: `top`, `right top`, `right`, `right bottom`, `bottom`, `left bottom`, `left`, `left top`.
136
- * - `sharp.gravity`: `north`, `northeast`, `east`, `southeast`, `south`, `southwest`, `west`, `northwest`, `center` or `centre`.
137
- * - `sharp.strategy`: `cover` only, dynamically crop using either the `entropy` or `attention` strategy.
138
- *
139
- * Some of these values are based on the [object-position](https://developer.mozilla.org/en-US/docs/Web/CSS/object-position) CSS property.
140
- *
141
- * The strategy-based approach initially resizes so one dimension is at its target length
142
- * then repeatedly ranks edge regions, discarding the edge with the lowest score based on the selected strategy.
143
- * - `entropy`: focus on the region with the highest [Shannon entropy](https://en.wikipedia.org/wiki/Entropy_%28information_theory%29).
144
- * - `attention`: focus on the region with the highest luminance frequency, colour saturation and presence of skin tones.
145
- *
146
- * Possible downsizing kernels are:
147
- * - `nearest`: Use [nearest neighbour interpolation](http://en.wikipedia.org/wiki/Nearest-neighbor_interpolation).
148
- * - `linear`: Use a [triangle filter](https://en.wikipedia.org/wiki/Triangular_function).
149
- * - `cubic`: Use a [Catmull-Rom spline](https://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline).
150
- * - `mitchell`: Use a [Mitchell-Netravali spline](https://www.cs.utexas.edu/~fussell/courses/cs384g-fall2013/lectures/mitchell/Mitchell.pdf).
151
- * - `lanczos2`: Use a [Lanczos kernel](https://en.wikipedia.org/wiki/Lanczos_resampling#Lanczos_kernel) with `a=2`.
152
- * - `lanczos3`: Use a Lanczos kernel with `a=3` (the default).
153
- * - `mks2013`: Use a [Magic Kernel Sharp](https://johncostella.com/magic/mks.pdf) 2013 kernel, as adopted by Facebook.
154
- * - `mks2021`: Use a Magic Kernel Sharp 2021 kernel, with more accurate (reduced) sharpening than the 2013 version.
155
- *
156
- * When upsampling, these kernels map to `nearest`, `linear` and `cubic` interpolators.
157
- * Downsampling kernels without a matching upsampling interpolator map to `cubic`.
158
- *
159
- * Only one resize can occur per pipeline.
160
- * Previous calls to `resize` in the same pipeline will be ignored.
161
- *
162
- * @example
163
- * sharp(input)
164
- * .resize({ width: 100 })
165
- * .toBuffer()
166
- * .then(data => {
167
- * // 100 pixels wide, auto-scaled height
168
- * });
169
- *
170
- * @example
171
- * sharp(input)
172
- * .resize({ height: 100 })
173
- * .toBuffer()
174
- * .then(data => {
175
- * // 100 pixels high, auto-scaled width
176
- * });
177
- *
178
- * @example
179
- * sharp(input)
180
- * .resize(200, 300, {
181
- * kernel: sharp.kernel.nearest,
182
- * fit: 'contain',
183
- * position: 'right top',
184
- * background: { r: 255, g: 255, b: 255, alpha: 0.5 }
185
- * })
186
- * .toFile('output.png')
187
- * .then(() => {
188
- * // output.png is a 200 pixels wide and 300 pixels high image
189
- * // containing a nearest-neighbour scaled version
190
- * // contained within the north-east corner of a semi-transparent white canvas
191
- * });
192
- *
193
- * @example
194
- * const transformer = sharp()
195
- * .resize({
196
- * width: 200,
197
- * height: 200,
198
- * fit: sharp.fit.cover,
199
- * position: sharp.strategy.entropy
200
- * });
201
- * // Read image data from readableStream
202
- * // Write 200px square auto-cropped image data to writableStream
203
- * readableStream
204
- * .pipe(transformer)
205
- * .pipe(writableStream);
206
- *
207
- * @example
208
- * sharp(input)
209
- * .resize(200, 200, {
210
- * fit: sharp.fit.inside,
211
- * withoutEnlargement: true
212
- * })
213
- * .toFormat('jpeg')
214
- * .toBuffer()
215
- * .then(function(outputBuffer) {
216
- * // outputBuffer contains JPEG image data
217
- * // no wider and no higher than 200 pixels
218
- * // and no larger than the input image
219
- * });
220
- *
221
- * @example
222
- * sharp(input)
223
- * .resize(200, 200, {
224
- * fit: sharp.fit.outside,
225
- * withoutReduction: true
226
- * })
227
- * .toFormat('jpeg')
228
- * .toBuffer()
229
- * .then(function(outputBuffer) {
230
- * // outputBuffer contains JPEG image data
231
- * // of at least 200 pixels wide and 200 pixels high while maintaining aspect ratio
232
- * // and no smaller than the input image
233
- * });
234
- *
235
- * @example
236
- * const scaleByHalf = await sharp(input)
237
- * .metadata()
238
- * .then(({ width }) => sharp(input)
239
- * .resize(Math.round(width * 0.5))
240
- * .toBuffer()
241
- * );
242
- *
243
- * @param {number} [width] - How many pixels wide the resultant image should be. Use `null` or `undefined` to auto-scale the width to match the height.
244
- * @param {number} [height] - How many pixels high the resultant image should be. Use `null` or `undefined` to auto-scale the height to match the width.
245
- * @param {Object} [options]
246
- * @param {number} [options.width] - An alternative means of specifying `width`. If both are present this takes priority.
247
- * @param {number} [options.height] - An alternative means of specifying `height`. If both are present this takes priority.
248
- * @param {String} [options.fit='cover'] - How the image should be resized/cropped to fit the target dimension(s), one of `cover`, `contain`, `fill`, `inside` or `outside`.
249
- * @param {String} [options.position='centre'] - A position, gravity or strategy to use when `fit` is `cover` or `contain`.
250
- * @param {String|Object} [options.background={r: 0, g: 0, b: 0, alpha: 1}] - background colour when `fit` is `contain`, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to black without transparency.
251
- * @param {String} [options.kernel='lanczos3'] - The kernel to use for image reduction and the inferred interpolator to use for upsampling. Use the `fastShrinkOnLoad` option to control kernel vs shrink-on-load.
252
- * @param {Boolean} [options.withoutEnlargement=false] - Do not scale up if the width *or* height are already less than the target dimensions, equivalent to GraphicsMagick's `>` geometry option. This may result in output dimensions smaller than the target dimensions.
253
- * @param {Boolean} [options.withoutReduction=false] - Do not scale down if the width *or* height are already greater than the target dimensions, equivalent to GraphicsMagick's `<` geometry option. This may still result in a crop to reach the target dimensions.
254
- * @param {Boolean} [options.fastShrinkOnLoad=true] - Take greater advantage of the JPEG and WebP shrink-on-load feature, which can lead to a slight moiré pattern or round-down of an auto-scaled dimension.
255
- * @returns {Sharp}
256
- * @throws {Error} Invalid parameters
257
- */
258
- function resize (widthOrOptions, height, options) {
259
- if (isResizeExpected(this.options)) {
260
- this.options.debuglog('ignoring previous resize options');
261
- }
262
- if (this.options.widthPost !== -1) {
263
- this.options.debuglog('operation order will be: extract, resize, extract');
264
- }
265
- if (is.defined(widthOrOptions)) {
266
- if (is.object(widthOrOptions) && !is.defined(options)) {
267
- options = widthOrOptions;
268
- } else if (is.integer(widthOrOptions) && widthOrOptions > 0) {
269
- this.options.width = widthOrOptions;
270
- } else {
271
- throw is.invalidParameterError('width', 'positive integer', widthOrOptions);
272
- }
273
- } else {
274
- this.options.width = -1;
275
- }
276
- if (is.defined(height)) {
277
- if (is.integer(height) && height > 0) {
278
- this.options.height = height;
279
- } else {
280
- throw is.invalidParameterError('height', 'positive integer', height);
281
- }
282
- } else {
283
- this.options.height = -1;
284
- }
285
- if (is.object(options)) {
286
- // Width
287
- if (is.defined(options.width)) {
288
- if (is.integer(options.width) && options.width > 0) {
289
- this.options.width = options.width;
290
- } else {
291
- throw is.invalidParameterError('width', 'positive integer', options.width);
292
- }
293
- }
294
- // Height
295
- if (is.defined(options.height)) {
296
- if (is.integer(options.height) && options.height > 0) {
297
- this.options.height = options.height;
298
- } else {
299
- throw is.invalidParameterError('height', 'positive integer', options.height);
300
- }
301
- }
302
- // Fit
303
- if (is.defined(options.fit)) {
304
- const canvas = mapFitToCanvas[options.fit];
305
- if (is.string(canvas)) {
306
- this.options.canvas = canvas;
307
- } else {
308
- throw is.invalidParameterError('fit', 'valid fit', options.fit);
309
- }
310
- }
311
- // Position
312
- if (is.defined(options.position)) {
313
- const pos = is.integer(options.position)
314
- ? options.position
315
- : strategy[options.position] || position[options.position] || gravity[options.position];
316
- if (is.integer(pos) && (is.inRange(pos, 0, 8) || is.inRange(pos, 16, 17))) {
317
- this.options.position = pos;
318
- } else {
319
- throw is.invalidParameterError('position', 'valid position/gravity/strategy', options.position);
320
- }
321
- }
322
- // Background
323
- this._setBackgroundColourOption('resizeBackground', options.background);
324
- // Kernel
325
- if (is.defined(options.kernel)) {
326
- if (is.string(kernel[options.kernel])) {
327
- this.options.kernel = kernel[options.kernel];
328
- } else {
329
- throw is.invalidParameterError('kernel', 'valid kernel name', options.kernel);
330
- }
331
- }
332
- // Without enlargement
333
- if (is.defined(options.withoutEnlargement)) {
334
- this._setBooleanOption('withoutEnlargement', options.withoutEnlargement);
335
- }
336
- // Without reduction
337
- if (is.defined(options.withoutReduction)) {
338
- this._setBooleanOption('withoutReduction', options.withoutReduction);
339
- }
340
- // Shrink on load
341
- if (is.defined(options.fastShrinkOnLoad)) {
342
- this._setBooleanOption('fastShrinkOnLoad', options.fastShrinkOnLoad);
343
- }
344
- }
345
- if (isRotationExpected(this.options) && isResizeExpected(this.options)) {
346
- this.options.rotateBefore = true;
347
- }
348
- return this;
349
- }
350
-
351
- /**
352
- * Extend / pad / extrude one or more edges of the image with either
353
- * the provided background colour or pixels derived from the image.
354
- * This operation will always occur after resizing and extraction, if any.
355
- *
356
- * @example
357
- * // Resize to 140 pixels wide, then add 10 transparent pixels
358
- * // to the top, left and right edges and 20 to the bottom edge
359
- * sharp(input)
360
- * .resize(140)
361
- * .extend({
362
- * top: 10,
363
- * bottom: 20,
364
- * left: 10,
365
- * right: 10,
366
- * background: { r: 0, g: 0, b: 0, alpha: 0 }
367
- * })
368
- * ...
369
- *
370
- * @example
371
- * // Add a row of 10 red pixels to the bottom
372
- * sharp(input)
373
- * .extend({
374
- * bottom: 10,
375
- * background: 'red'
376
- * })
377
- * ...
378
- *
379
- * @example
380
- * // Extrude image by 8 pixels to the right, mirroring existing right hand edge
381
- * sharp(input)
382
- * .extend({
383
- * right: 8,
384
- * background: 'mirror'
385
- * })
386
- * ...
387
- *
388
- * @param {(number|Object)} extend - single pixel count to add to all edges or an Object with per-edge counts
389
- * @param {number} [extend.top=0]
390
- * @param {number} [extend.left=0]
391
- * @param {number} [extend.bottom=0]
392
- * @param {number} [extend.right=0]
393
- * @param {String} [extend.extendWith='background'] - populate new pixels using this method, one of: background, copy, repeat, mirror.
394
- * @param {String|Object} [extend.background={r: 0, g: 0, b: 0, alpha: 1}] - background colour, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to black without transparency.
395
- * @returns {Sharp}
396
- * @throws {Error} Invalid parameters
397
- */
398
- function extend (extend) {
399
- if (is.integer(extend) && extend > 0) {
400
- this.options.extendTop = extend;
401
- this.options.extendBottom = extend;
402
- this.options.extendLeft = extend;
403
- this.options.extendRight = extend;
404
- } else if (is.object(extend)) {
405
- if (is.defined(extend.top)) {
406
- if (is.integer(extend.top) && extend.top >= 0) {
407
- this.options.extendTop = extend.top;
408
- } else {
409
- throw is.invalidParameterError('top', 'positive integer', extend.top);
410
- }
411
- }
412
- if (is.defined(extend.bottom)) {
413
- if (is.integer(extend.bottom) && extend.bottom >= 0) {
414
- this.options.extendBottom = extend.bottom;
415
- } else {
416
- throw is.invalidParameterError('bottom', 'positive integer', extend.bottom);
417
- }
418
- }
419
- if (is.defined(extend.left)) {
420
- if (is.integer(extend.left) && extend.left >= 0) {
421
- this.options.extendLeft = extend.left;
422
- } else {
423
- throw is.invalidParameterError('left', 'positive integer', extend.left);
424
- }
425
- }
426
- if (is.defined(extend.right)) {
427
- if (is.integer(extend.right) && extend.right >= 0) {
428
- this.options.extendRight = extend.right;
429
- } else {
430
- throw is.invalidParameterError('right', 'positive integer', extend.right);
431
- }
432
- }
433
- this._setBackgroundColourOption('extendBackground', extend.background);
434
- if (is.defined(extend.extendWith)) {
435
- if (is.string(extendWith[extend.extendWith])) {
436
- this.options.extendWith = extendWith[extend.extendWith];
437
- } else {
438
- throw is.invalidParameterError('extendWith', 'one of: background, copy, repeat, mirror', extend.extendWith);
439
- }
440
- }
441
- } else {
442
- throw is.invalidParameterError('extend', 'integer or object', extend);
443
- }
444
- return this;
445
- }
446
-
447
- /**
448
- * Extract/crop a region of the image.
449
- *
450
- * - Use `extract` before `resize` for pre-resize extraction.
451
- * - Use `extract` after `resize` for post-resize extraction.
452
- * - Use `extract` twice and `resize` once for extract-then-resize-then-extract in a fixed operation order.
453
- *
454
- * @example
455
- * sharp(input)
456
- * .extract({ left: left, top: top, width: width, height: height })
457
- * .toFile(output, function(err) {
458
- * // Extract a region of the input image, saving in the same format.
459
- * });
460
- * @example
461
- * sharp(input)
462
- * .extract({ left: leftOffsetPre, top: topOffsetPre, width: widthPre, height: heightPre })
463
- * .resize(width, height)
464
- * .extract({ left: leftOffsetPost, top: topOffsetPost, width: widthPost, height: heightPost })
465
- * .toFile(output, function(err) {
466
- * // Extract a region, resize, then extract from the resized image
467
- * });
468
- *
469
- * @param {Object} options - describes the region to extract using integral pixel values
470
- * @param {number} options.left - zero-indexed offset from left edge
471
- * @param {number} options.top - zero-indexed offset from top edge
472
- * @param {number} options.width - width of region to extract
473
- * @param {number} options.height - height of region to extract
474
- * @returns {Sharp}
475
- * @throws {Error} Invalid parameters
476
- */
477
- function extract (options) {
478
- const suffix = isResizeExpected(this.options) || this.options.widthPre !== -1 ? 'Post' : 'Pre';
479
- if (this.options[`width${suffix}`] !== -1) {
480
- this.options.debuglog('ignoring previous extract options');
481
- }
482
- ['left', 'top', 'width', 'height'].forEach(function (name) {
483
- const value = options[name];
484
- if (is.integer(value) && value >= 0) {
485
- this.options[name + (name === 'left' || name === 'top' ? 'Offset' : '') + suffix] = value;
486
- } else {
487
- throw is.invalidParameterError(name, 'integer', value);
488
- }
489
- }, this);
490
- // Ensure existing rotation occurs before pre-resize extraction
491
- if (isRotationExpected(this.options) && !isResizeExpected(this.options)) {
492
- if (this.options.widthPre === -1 || this.options.widthPost === -1) {
493
- this.options.rotateBefore = true;
494
- }
495
- }
496
- if (this.options.input.autoOrient) {
497
- this.options.orientBefore = true;
498
- }
499
- return this;
500
- }
501
-
502
- /**
503
- * Trim pixels from all edges that contain values similar to the given background colour, which defaults to that of the top-left pixel.
504
- *
505
- * Images with an alpha channel will use the combined bounding box of alpha and non-alpha channels.
506
- *
507
- * If the result of this operation would trim an image to nothing then no change is made.
508
- *
509
- * The `info` response Object will contain `trimOffsetLeft` and `trimOffsetTop` properties.
510
- *
511
- * @example
512
- * // Trim pixels with a colour similar to that of the top-left pixel.
513
- * await sharp(input)
514
- * .trim()
515
- * .toFile(output);
516
- *
517
- * @example
518
- * // Trim pixels with the exact same colour as that of the top-left pixel.
519
- * await sharp(input)
520
- * .trim({
521
- * threshold: 0
522
- * })
523
- * .toFile(output);
524
- *
525
- * @example
526
- * // Assume input is line art and trim only pixels with a similar colour to red.
527
- * const output = await sharp(input)
528
- * .trim({
529
- * background: "#FF0000",
530
- * lineArt: true
531
- * })
532
- * .toBuffer();
533
- *
534
- * @example
535
- * // Trim all "yellow-ish" pixels, being more lenient with the higher threshold.
536
- * const output = await sharp(input)
537
- * .trim({
538
- * background: "yellow",
539
- * threshold: 42,
540
- * })
541
- * .toBuffer();
542
- *
543
- * @param {Object} [options]
544
- * @param {string|Object} [options.background='top-left pixel'] - Background colour, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to that of the top-left pixel.
545
- * @param {number} [options.threshold=10] - Allowed difference from the above colour, a positive number.
546
- * @param {boolean} [options.lineArt=false] - Does the input more closely resemble line art (e.g. vector) rather than being photographic?
547
- * @returns {Sharp}
548
- * @throws {Error} Invalid parameters
549
- */
550
- function trim (options) {
551
- this.options.trimThreshold = 10;
552
- if (is.defined(options)) {
553
- if (is.object(options)) {
554
- if (is.defined(options.background)) {
555
- this._setBackgroundColourOption('trimBackground', options.background);
556
- }
557
- if (is.defined(options.threshold)) {
558
- if (is.number(options.threshold) && options.threshold >= 0) {
559
- this.options.trimThreshold = options.threshold;
560
- } else {
561
- throw is.invalidParameterError('threshold', 'positive number', options.threshold);
562
- }
563
- }
564
- if (is.defined(options.lineArt)) {
565
- this._setBooleanOption('trimLineArt', options.lineArt);
566
- }
567
- } else {
568
- throw is.invalidParameterError('trim', 'object', options);
569
- }
570
- }
571
- if (isRotationExpected(this.options)) {
572
- this.options.rotateBefore = true;
573
- }
574
- return this;
575
- }
576
-
577
- /**
578
- * Decorate the Sharp prototype with resize-related functions.
579
- * @module Sharp
580
- * @private
581
- */
582
- module.exports = (Sharp) => {
583
- Object.assign(Sharp.prototype, {
584
- resize,
585
- extend,
586
- extract,
587
- trim
588
- });
589
- // Class attributes
590
- Sharp.gravity = gravity;
591
- Sharp.strategy = strategy;
592
- Sharp.kernel = kernel;
593
- Sharp.fit = fit;
594
- Sharp.position = position;
595
- };