@jini-ai/devops 0.7.3-next.2 → 0.7.3-next.3

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 (390) hide show
  1. package/README.md +16 -0
  2. package/dist/backup/site/archive-extensions.d.ts +73 -0
  3. package/dist/backup/site/archive-extensions.js +129 -0
  4. package/dist/backup/site/archive-manifest.d.ts +85 -0
  5. package/dist/backup/site/archive-manifest.js +176 -0
  6. package/dist/backup/site/archive-media.d.ts +121 -0
  7. package/dist/backup/site/archive-media.js +93 -0
  8. package/dist/backup/site/backup-service.credentials.d.ts +31 -0
  9. package/dist/backup/site/backup-service.credentials.js +161 -0
  10. package/dist/backup/site/backup-service.d.ts +331 -0
  11. package/dist/backup/site/backup-service.js +125 -0
  12. package/dist/backup/site/backup-service.plan.d.ts +64 -0
  13. package/dist/backup/site/backup-service.plan.js +207 -0
  14. package/dist/backup/site/backup-service.push.d.ts +29 -0
  15. package/dist/backup/site/backup-service.push.js +82 -0
  16. package/dist/backup/site/backup-service.shared.d.ts +40 -0
  17. package/dist/backup/site/backup-service.shared.js +37 -0
  18. package/dist/backup/site/bundled-export-file-policy.d.ts +38 -0
  19. package/dist/backup/site/bundled-export-file-policy.js +40 -0
  20. package/dist/backup/site/credential-warnings.d.ts +41 -0
  21. package/dist/backup/site/credential-warnings.js +50 -0
  22. package/dist/backup/site/import-backend-steps.d.ts +167 -0
  23. package/dist/backup/site/import-backend-steps.js +170 -0
  24. package/dist/backup/site/import-backend.d.ts +167 -0
  25. package/dist/backup/site/import-backend.js +298 -0
  26. package/dist/backup/site/import-database.d.ts +118 -0
  27. package/dist/backup/site/import-database.js +167 -0
  28. package/dist/backup/site/import-index/admission.d.ts +54 -0
  29. package/dist/backup/site/import-index/admission.js +46 -0
  30. package/dist/backup/site/import-index/backfill.d.ts +106 -0
  31. package/dist/backup/site/import-index/backfill.js +137 -0
  32. package/dist/backup/site/import-index/errors.d.ts +28 -0
  33. package/dist/backup/site/import-index/errors.js +38 -0
  34. package/dist/backup/site/import-index/migrations/checksums.d.ts +4 -0
  35. package/dist/backup/site/import-index/migrations/checksums.js +4 -0
  36. package/dist/backup/site/import-index/migrations/site-imports-v1.d.ts +2 -0
  37. package/dist/backup/site/import-index/migrations/site-imports-v1.js +10 -0
  38. package/dist/backup/site/import-index/mode.d.ts +191 -0
  39. package/dist/backup/site/import-index/mode.js +272 -0
  40. package/dist/backup/site/import-index/open.d.ts +40 -0
  41. package/dist/backup/site/import-index/open.js +87 -0
  42. package/dist/backup/site/import-index/paging.d.ts +28 -0
  43. package/dist/backup/site/import-index/paging.js +66 -0
  44. package/dist/backup/site/import-index/payload-namespace.d.ts +80 -0
  45. package/dist/backup/site/import-index/payload-namespace.js +156 -0
  46. package/dist/backup/site/import-index/rows.d.ts +32 -0
  47. package/dist/backup/site/import-index/rows.js +61 -0
  48. package/dist/backup/site/import-index/schema.d.ts +8 -0
  49. package/dist/backup/site/import-index/schema.js +31 -0
  50. package/dist/backup/site/import-index/store.d.ts +27 -0
  51. package/dist/backup/site/import-index/store.js +33 -0
  52. package/dist/backup/site/import-index/sweep.d.ts +10 -0
  53. package/dist/backup/site/import-index/sweep.js +26 -0
  54. package/dist/backup/site/import-keep-off.d.ts +128 -0
  55. package/dist/backup/site/import-keep-off.js +204 -0
  56. package/dist/backup/site/import-plugin-state.d.ts +74 -0
  57. package/dist/backup/site/import-plugin-state.js +67 -0
  58. package/dist/backup/site/import-registry.d.ts +110 -0
  59. package/dist/backup/site/import-registry.js +205 -0
  60. package/dist/backup/site/import-restore-placement.d.ts +94 -0
  61. package/dist/backup/site/import-restore-placement.js +158 -0
  62. package/dist/backup/site/import-restore.d.ts +111 -0
  63. package/dist/backup/site/import-restore.js +120 -0
  64. package/dist/backup/site/import-verifier-inventory.d.ts +137 -0
  65. package/dist/backup/site/import-verifier-inventory.js +236 -0
  66. package/dist/backup/site/import-verifier-projection.d.ts +78 -0
  67. package/dist/backup/site/import-verifier-projection.js +100 -0
  68. package/dist/backup/site/import-verifier.d.ts +126 -0
  69. package/dist/backup/site/import-verifier.js +53 -0
  70. package/dist/backup/site/owned-temp-root.d.ts +12 -0
  71. package/dist/backup/site/owned-temp-root.js +2 -0
  72. package/dist/backup/site/package-file-inventory.d.ts +63 -0
  73. package/dist/backup/site/package-file-inventory.js +56 -0
  74. package/dist/backup/site/push-content.d.ts +70 -0
  75. package/dist/backup/site/push-content.js +56 -0
  76. package/dist/backup/site/react/ShowMoreImports.d.ts +21 -0
  77. package/dist/backup/site/react/ShowMoreImports.js +8 -0
  78. package/dist/backup/site/saved-keys-port.d.ts +47 -0
  79. package/dist/backup/site/saved-keys-port.js +3 -0
  80. package/dist/backup/site/saved-keys.d.ts +25 -0
  81. package/dist/backup/site/saved-keys.js +38 -0
  82. package/dist/backup/site/share-backend.d.ts +243 -0
  83. package/dist/backup/site/share-backend.js +284 -0
  84. package/dist/backup/site/share-database/projection.d.ts +195 -0
  85. package/dist/backup/site/share-database/projection.js +90 -0
  86. package/dist/backup/site/share-database/projection.media.d.ts +38 -0
  87. package/dist/backup/site/share-database/projection.media.js +179 -0
  88. package/dist/backup/site/share-database/projection.tables.d.ts +46 -0
  89. package/dist/backup/site/share-database/projection.tables.js +193 -0
  90. package/dist/backup/site/share-expiry.d.ts +75 -0
  91. package/dist/backup/site/share-expiry.js +49 -0
  92. package/dist/backup/site/share-export-failure.d.ts +17 -0
  93. package/dist/backup/site/share-export-failure.js +16 -0
  94. package/dist/backup/site/share-file-policy.d.ts +60 -0
  95. package/dist/backup/site/share-file-policy.js +146 -0
  96. package/dist/backup/site/share-hosting.d.ts +107 -0
  97. package/dist/backup/site/share-hosting.js +148 -0
  98. package/dist/backup/site/share-preparation-steps.d.ts +180 -0
  99. package/dist/backup/site/share-preparation-steps.js +109 -0
  100. package/dist/backup/site/share-preparation.d.ts +122 -0
  101. package/dist/backup/site/share-preparation.js +43 -0
  102. package/dist/backup/site/share-refusal.d.ts +21 -0
  103. package/dist/backup/site/share-refusal.js +20 -0
  104. package/dist/backup/site/share-registry.d.ts +124 -0
  105. package/dist/backup/site/share-registry.js +219 -0
  106. package/dist/backup/site/share-retention.d.ts +62 -0
  107. package/dist/backup/site/share-retention.js +126 -0
  108. package/dist/backup/site/share-service.d.ts +128 -0
  109. package/dist/backup/site/share-service.js +194 -0
  110. package/dist/backup/site/share-zip.d.ts +115 -0
  111. package/dist/backup/site/share-zip.js +144 -0
  112. package/dist/backup/site/sources.d.ts +344 -0
  113. package/dist/backup/site/sources.js +595 -0
  114. package/dist/backup/site/static-copy.d.ts +122 -0
  115. package/dist/backup/site/static-copy.js +165 -0
  116. package/dist/backup/site/static-download-html.d.ts +76 -0
  117. package/dist/backup/site/static-download-html.js +149 -0
  118. package/dist/backup/site/static-download-landing.d.ts +52 -0
  119. package/dist/backup/site/static-download-landing.js +95 -0
  120. package/dist/backup/site/static-download-layout.d.ts +96 -0
  121. package/dist/backup/site/static-download-layout.js +325 -0
  122. package/dist/backup/site/static-export-selection.d.ts +50 -0
  123. package/dist/backup/site/static-export-selection.js +76 -0
  124. package/dist/backup/site/static-site-packager.d.ts +42 -0
  125. package/dist/backup/site/static-site-packager.js +32 -0
  126. package/dist/backup/site/tool-registrations.d.ts +74 -0
  127. package/dist/backup/site/tool-registrations.js +201 -0
  128. package/dist/checks/complexity-debt.d.ts +100 -0
  129. package/dist/checks/complexity-debt.js +131 -0
  130. package/dist/checks/coverage/diff.js +5 -1
  131. package/dist/checks/env-access.d.ts +14 -1
  132. package/dist/checks/env-access.js +92 -6
  133. package/dist/checks/live-verify-checks.d.ts +29 -0
  134. package/dist/checks/live-verify-checks.js +30 -0
  135. package/dist/checks/quality-gates.d.ts +137 -0
  136. package/dist/checks/quality-gates.js +209 -0
  137. package/dist/core/deploy-types.d.ts +2 -0
  138. package/dist/deploy/admin-http/site-update-status.d.ts +8 -0
  139. package/dist/deploy/admin-http/site-update-status.js +15 -0
  140. package/dist/deploy/host-kit.d.ts +3 -0
  141. package/dist/deploy/index.d.ts +6 -0
  142. package/dist/deploy/index.js +6 -0
  143. package/dist/deploy/ops-runner.js +7 -0
  144. package/dist/deploy/ops-tool-contracts.d.ts +10 -1
  145. package/dist/deploy/react/Deployment.d.ts +37 -0
  146. package/dist/deploy/react/Deployment.js +94 -0
  147. package/dist/deploy/react/DockerfileTab.d.ts +72 -0
  148. package/dist/deploy/react/DockerfileTab.js +131 -0
  149. package/dist/deploy/react/HistoryTab.d.ts +43 -0
  150. package/dist/deploy/react/HistoryTab.js +12 -0
  151. package/dist/deploy/react/OverviewTab.d.ts +60 -0
  152. package/dist/deploy/react/OverviewTab.js +75 -0
  153. package/dist/deploy/react/PublishRunResult.d.ts +5 -1
  154. package/dist/deploy/react/PublishRunResult.js +4 -4
  155. package/dist/deploy/react/SiteUpdateNotice.d.ts +22 -0
  156. package/dist/deploy/react/SiteUpdateNotice.js +25 -0
  157. package/dist/deploy/react/StaticCredentialFields.d.ts +36 -0
  158. package/dist/deploy/react/StaticCredentialFields.js +63 -0
  159. package/dist/deploy/react/StaticCredentialSteps.d.ts +23 -0
  160. package/dist/deploy/react/StaticCredentialSteps.js +155 -0
  161. package/dist/deploy/react/StaticExportCard.d.ts +11 -0
  162. package/dist/deploy/react/StaticExportCard.js +97 -0
  163. package/dist/deploy/react/StaticPublishCredentials.d.ts +50 -0
  164. package/dist/deploy/react/StaticPublishCredentials.js +77 -0
  165. package/dist/deploy/react/StaticPublishForm.d.ts +12 -0
  166. package/dist/deploy/react/StaticPublishForm.js +91 -0
  167. package/dist/deploy/react/StaticSiteTab.d.ts +207 -0
  168. package/dist/deploy/react/StaticSiteTab.js +117 -0
  169. package/dist/deploy/react/deployment-visuals.d.ts +207 -0
  170. package/dist/deploy/react/deployment-visuals.js +101 -0
  171. package/dist/deploy/react/download-dockerfile.d.ts +14 -0
  172. package/dist/deploy/react/download-dockerfile.js +15 -0
  173. package/dist/deploy/react/hooks/publish-credential-draft.d.ts +33 -0
  174. package/dist/deploy/react/hooks/publish-credential-draft.js +54 -0
  175. package/dist/deploy/react/hooks/publish-credential-selection.d.ts +13 -0
  176. package/dist/deploy/react/hooks/publish-credential-selection.js +34 -0
  177. package/dist/deploy/react/hooks/publish-credential-writes.d.ts +20 -0
  178. package/dist/deploy/react/hooks/publish-credential-writes.js +99 -0
  179. package/dist/deploy/react/hooks/static-publish-actions.d.ts +10 -0
  180. package/dist/deploy/react/hooks/static-publish-actions.js +62 -0
  181. package/dist/deploy/react/hooks/static-publish-form.hooks.d.ts +38 -0
  182. package/dist/deploy/react/hooks/static-publish-form.hooks.js +103 -0
  183. package/dist/deploy/react/hooks/static-publish-run.hooks.d.ts +28 -0
  184. package/dist/deploy/react/hooks/static-publish-run.hooks.js +92 -0
  185. package/dist/deploy/react/hooks/use-dockerfile-source.hooks.d.ts +148 -0
  186. package/dist/deploy/react/hooks/use-dockerfile-source.hooks.js +155 -0
  187. package/dist/deploy/react/hooks/use-publish-credentials.hooks.d.ts +268 -0
  188. package/dist/deploy/react/hooks/use-publish-credentials.hooks.js +52 -0
  189. package/dist/deploy/react/hooks/use-static-export.hooks.d.ts +128 -0
  190. package/dist/deploy/react/hooks/use-static-export.hooks.js +159 -0
  191. package/dist/deploy/react/hooks/use-static-publish.hooks.d.ts +208 -0
  192. package/dist/deploy/react/hooks/use-static-publish.hooks.js +48 -0
  193. package/dist/deploy/react/index.d.ts +4 -0
  194. package/dist/deploy/react/index.js +2 -0
  195. package/dist/deploy/react/rules.d.ts +363 -0
  196. package/dist/deploy/react/rules.js +314 -0
  197. package/dist/deploy/react/use-deployment-overview.hooks.d.ts +41 -0
  198. package/dist/deploy/react/use-deployment-overview.hooks.js +11 -0
  199. package/dist/deploy/site/agent-tools.d.ts +42 -0
  200. package/dist/deploy/site/agent-tools.js +119 -0
  201. package/dist/deploy/site/deploy-config-registry.d.ts +155 -0
  202. package/dist/deploy/site/deploy-config-registry.js +124 -0
  203. package/dist/deploy/site/deploy-config.d.ts +97 -0
  204. package/dist/deploy/site/deploy-config.js +115 -0
  205. package/dist/deploy/site/deploy-ops/agent-tools.d.ts +22 -0
  206. package/dist/deploy/site/deploy-ops/agent-tools.js +76 -0
  207. package/dist/deploy/site/deploy-ops/registry.d.ts +134 -0
  208. package/dist/deploy/site/deploy-ops/registry.js +106 -0
  209. package/dist/deploy/site/deploy-ops/run-ops.d.ts +66 -0
  210. package/dist/deploy/site/deploy-ops/run-ops.js +34 -0
  211. package/dist/deploy/site/deploy-ops/secret-confirm.d.ts +36 -0
  212. package/dist/deploy/site/deploy-ops/secret-confirm.js +27 -0
  213. package/dist/deploy/site/deploy-targets/host-kit.d.ts +28 -0
  214. package/dist/deploy/site/deploy-targets/host-kit.js +120 -0
  215. package/dist/deploy/site/deploy-targets/registry.d.ts +157 -0
  216. package/dist/deploy/site/deploy-targets/registry.js +132 -0
  217. package/dist/deploy/site/deploy-targets/types.d.ts +27 -0
  218. package/dist/deploy/site/deploy-targets/types.js +2 -0
  219. package/dist/deploy/site/dockerfile.d.ts +137 -0
  220. package/dist/deploy/site/dockerfile.js +101 -0
  221. package/dist/deploy/site/export-run.d.ts +137 -0
  222. package/dist/deploy/site/export-run.js +152 -0
  223. package/dist/deploy/site/ports.d.ts +115 -0
  224. package/dist/deploy/site/ports.js +2 -0
  225. package/dist/deploy/site/publish-agent-tools.d.ts +18 -0
  226. package/dist/deploy/site/publish-agent-tools.js +120 -0
  227. package/dist/deploy/site/publish-candidate.d.ts +26 -0
  228. package/dist/deploy/site/publish-candidate.js +37 -0
  229. package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.d.ts +78 -0
  230. package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.js +88 -0
  231. package/dist/deploy/site/publish-credentials/compatibility-port.d.ts +38 -0
  232. package/dist/deploy/site/publish-credentials/compatibility-port.js +19 -0
  233. package/dist/deploy/site/publish-credentials/execution-mode.d.ts +43 -0
  234. package/dist/deploy/site/publish-credentials/execution-mode.js +19 -0
  235. package/dist/deploy/site/publish-credentials/store-owner.d.ts +11 -0
  236. package/dist/deploy/site/publish-credentials/store-owner.js +9 -0
  237. package/dist/deploy/site/publish-credentials/store-resolution.d.ts +55 -0
  238. package/dist/deploy/site/publish-credentials/store-resolution.js +100 -0
  239. package/dist/deploy/site/publish-credentials/store-validation.d.ts +68 -0
  240. package/dist/deploy/site/publish-credentials/store-validation.js +182 -0
  241. package/dist/deploy/site/publish-credentials/store.d.ts +322 -0
  242. package/dist/deploy/site/publish-credentials/store.js +372 -0
  243. package/dist/deploy/site/publish-credentials/types.d.ts +85 -0
  244. package/dist/deploy/site/publish-credentials/types.js +2 -0
  245. package/dist/deploy/site/publish-tool-capabilities.d.ts +123 -0
  246. package/dist/deploy/site/publish-tool-capabilities.js +175 -0
  247. package/dist/deploy/site/publish-tool-credential.d.ts +48 -0
  248. package/dist/deploy/site/publish-tool-credential.js +284 -0
  249. package/dist/deploy/site/publish-tool-deps.d.ts +205 -0
  250. package/dist/deploy/site/publish-tool-deps.js +15 -0
  251. package/dist/deploy/site/publish-tool-execution.d.ts +78 -0
  252. package/dist/deploy/site/publish-tool-execution.js +313 -0
  253. package/dist/deploy/site/publish-tool-schema.d.ts +29 -0
  254. package/dist/deploy/site/publish-tool-schema.js +38 -0
  255. package/dist/deploy/site/static-publish/adapter-export.d.ts +54 -0
  256. package/dist/deploy/site/static-publish/adapter-export.js +89 -0
  257. package/dist/deploy/site/static-publish/adapter-plan.d.ts +99 -0
  258. package/dist/deploy/site/static-publish/adapter-plan.js +112 -0
  259. package/dist/deploy/site/static-publish/adapter.d.ts +182 -0
  260. package/dist/deploy/site/static-publish/adapter.js +321 -0
  261. package/dist/deploy/site/static-publish/admin-publish-read.d.ts +209 -0
  262. package/dist/deploy/site/static-publish/admin-publish-read.js +116 -0
  263. package/dist/deploy/site/static-publish/credentials.d.ts +110 -0
  264. package/dist/deploy/site/static-publish/credentials.js +290 -0
  265. package/dist/deploy/site/static-publish/domain-publish-rows.d.ts +25 -0
  266. package/dist/deploy/site/static-publish/domain-publish-rows.js +43 -0
  267. package/dist/deploy/site/static-publish/domain-publish-tool.d.ts +19 -0
  268. package/dist/deploy/site/static-publish/domain-publish-tool.js +111 -0
  269. package/dist/deploy/site/static-publish/inspection.d.ts +24 -0
  270. package/dist/deploy/site/static-publish/inspection.js +69 -0
  271. package/dist/deploy/site/static-publish/publish-history.d.ts +197 -0
  272. package/dist/deploy/site/static-publish/publish-history.js +153 -0
  273. package/dist/deploy/site/static-publish/publish-run.d.ts +156 -0
  274. package/dist/deploy/site/static-publish/publish-run.js +186 -0
  275. package/dist/deploy/site/static-publish/types.d.ts +165 -0
  276. package/dist/deploy/site/static-publish/types.js +2 -0
  277. package/dist/deploy/site/static-publish/verify.d.ts +217 -0
  278. package/dist/deploy/site/static-publish/verify.js +248 -0
  279. package/dist/deploy/site/tool-registrations.d.ts +97 -0
  280. package/dist/deploy/site/tool-registrations.js +130 -0
  281. package/dist/deploy/site/types.d.ts +51 -0
  282. package/dist/deploy/site/types.js +2 -0
  283. package/dist/deploy/site-update/check-for-update.d.ts +19 -0
  284. package/dist/deploy/site-update/check-for-update.js +19 -0
  285. package/dist/deploy/site-update/contracts.d.ts +161 -0
  286. package/dist/deploy/site-update/contracts.js +94 -0
  287. package/dist/deploy/site-update/desktop-site-update.d.ts +66 -0
  288. package/dist/deploy/site-update/desktop-site-update.js +43 -0
  289. package/dist/deploy/site-update/fake-site-update.d.ts +39 -0
  290. package/dist/deploy/site-update/fake-site-update.js +52 -0
  291. package/dist/deploy/site-update/run-site-update.d.ts +121 -0
  292. package/dist/deploy/site-update/run-site-update.js +219 -0
  293. package/dist/deploy/site-update/self-hosted-site-update.d.ts +71 -0
  294. package/dist/deploy/site-update/self-hosted-site-update.js +79 -0
  295. package/dist/deploy/target-contracts.d.ts +3 -0
  296. package/dist/deploy/tool.d.ts +5 -8
  297. package/dist/deploy/tool.js +6 -9
  298. package/dist/dns/binding-sweeper.d.ts +72 -0
  299. package/dist/dns/binding-sweeper.js +53 -0
  300. package/dist/dns/index.d.ts +1 -0
  301. package/dist/dns/index.js +1 -0
  302. package/dist/dns/site/binding.repo.d.ts +71 -0
  303. package/dist/dns/site/binding.repo.js +45 -0
  304. package/dist/dns/site/dns-changes.d.ts +90 -0
  305. package/dist/dns/site/dns-changes.js +271 -0
  306. package/dist/dns/site/dns-tools.d.ts +46 -0
  307. package/dist/dns/site/dns-tools.js +204 -0
  308. package/dist/dns/site/mail-dns-status.d.ts +111 -0
  309. package/dist/dns/site/mail-dns-status.js +190 -0
  310. package/dist/dns/site/mail-dns-tools.d.ts +33 -0
  311. package/dist/dns/site/mail-dns-tools.js +62 -0
  312. package/dist/dns/site/mail-requirements.d.ts +30 -0
  313. package/dist/dns/site/mail-requirements.js +78 -0
  314. package/dist/dns/site/tool-deps.d.ts +21 -0
  315. package/dist/dns/site/tool-deps.js +2 -0
  316. package/dist/dns/site/tools.d.ts +74 -0
  317. package/dist/dns/site/tools.js +124 -0
  318. package/dist/local-dev/bind-host.d.ts +80 -0
  319. package/dist/local-dev/bind-host.js +90 -0
  320. package/dist/local-dev/dev-proxy-upstream.d.ts +69 -0
  321. package/dist/local-dev/dev-proxy-upstream.js +63 -0
  322. package/dist/local-dev/index.d.ts +28 -0
  323. package/dist/local-dev/index.js +25 -0
  324. package/dist/packaging/electron/archive.d.ts +2 -9
  325. package/dist/packaging/electron/asar-adapter.d.ts +2 -1
  326. package/dist/packaging/electron/entry.d.ts +2 -0
  327. package/dist/packaging/electron/move-to-applications.d.ts +165 -0
  328. package/dist/packaging/electron/move-to-applications.js +162 -0
  329. package/dist/packaging/electron/policies.d.ts +33 -4
  330. package/dist/packaging/electron/policies.js +29 -10
  331. package/dist/packaging/electron/ports.d.ts +1 -6
  332. package/dist/packaging/electron/staging.d.ts +11 -2
  333. package/dist/packaging/electron/staging.js +15 -5
  334. package/dist/react/site-share-expiry/ShareExpiryControls.d.ts +29 -0
  335. package/dist/react/site-share-expiry/ShareExpiryControls.js +7 -0
  336. package/dist/react/site-share-expiry/index.d.ts +2 -0
  337. package/dist/react/site-share-expiry/index.js +2 -0
  338. package/dist/source-control/react/ProvidersTab.d.ts +98 -0
  339. package/dist/source-control/react/ProvidersTab.js +195 -0
  340. package/dist/source-control/react/SourceControl.d.ts +51 -0
  341. package/dist/source-control/react/SourceControl.js +61 -0
  342. package/dist/source-control/react/hooks/use-source-control-credentials.hooks.d.ts +128 -0
  343. package/dist/source-control/react/hooks/use-source-control-credentials.hooks.js +102 -0
  344. package/dist/source-control/react/rules.d.ts +167 -0
  345. package/dist/source-control/react/rules.js +125 -0
  346. package/dist/source-control/react/source-control-visuals.d.ts +75 -0
  347. package/dist/source-control/react/source-control-visuals.js +48 -0
  348. package/dist/source-control/site/agent-tools.d.ts +5 -0
  349. package/dist/source-control/site/agent-tools.js +30 -0
  350. package/dist/source-control/site/bundled-provider-registry.d.ts +33 -0
  351. package/dist/source-control/site/bundled-provider-registry.js +37 -0
  352. package/dist/source-control/site/commit-schema.d.ts +40 -0
  353. package/dist/source-control/site/commit-schema.js +29 -0
  354. package/dist/source-control/site/commit-target.d.ts +26 -0
  355. package/dist/source-control/site/commit-target.js +58 -0
  356. package/dist/source-control/site/credential-form.d.ts +36 -0
  357. package/dist/source-control/site/credential-form.js +102 -0
  358. package/dist/source-control/site/credential-setup.d.ts +107 -0
  359. package/dist/source-control/site/credential-setup.js +216 -0
  360. package/dist/source-control/site/provider-kit.d.ts +37 -0
  361. package/dist/source-control/site/provider-kit.js +35 -0
  362. package/dist/source-control/site/provider-module.d.ts +251 -0
  363. package/dist/source-control/site/provider-module.js +2 -0
  364. package/dist/source-control/site/saved-key-bindings.d.ts +4 -0
  365. package/dist/source-control/site/saved-key-bindings.js +4 -0
  366. package/dist/source-control/site/static-site-packager-port.d.ts +37 -0
  367. package/dist/source-control/site/static-site-packager-port.js +2 -0
  368. package/dist/source-control/site/store.d.ts +209 -0
  369. package/dist/source-control/site/store.js +374 -0
  370. package/dist/source-control/site/store.validation.d.ts +72 -0
  371. package/dist/source-control/site/store.validation.js +168 -0
  372. package/dist/source-control/site/tool-registrations.d.ts +190 -0
  373. package/dist/source-control/site/tool-registrations.js +379 -0
  374. package/dist/static-export/site/export-preflight.d.ts +48 -0
  375. package/dist/static-export/site/export-preflight.js +82 -0
  376. package/dist/static-export/site/media-original-urls.d.ts +57 -0
  377. package/dist/static-export/site/media-original-urls.js +109 -0
  378. package/dist/static-export/site/ports.d.ts +82 -0
  379. package/dist/static-export/site/ports.js +29 -0
  380. package/dist/static-export/site/public-origin-policy.d.ts +32 -0
  381. package/dist/static-export/site/public-origin-policy.js +68 -0
  382. package/dist/static-export/site/route-manifest.d.ts +65 -0
  383. package/dist/static-export/site/route-manifest.js +139 -0
  384. package/dist/static-export/site/site-exporter.d.ts +158 -0
  385. package/dist/static-export/site/site-exporter.js +112 -0
  386. package/dist/static-export/site/static-security-headers.d.ts +39 -0
  387. package/dist/static-export/site/static-security-headers.js +43 -0
  388. package/dist/static-export/site/theme-preview-manifest.d.ts +35 -0
  389. package/dist/static-export/site/theme-preview-manifest.js +28 -0
  390. package/package.json +911 -7
@@ -0,0 +1,144 @@
1
+ import { createHash } from "node:crypto";
2
+ import { ARCHIVE_DATABASE_PATH as SITE_BACKUP_DATABASE_PATH, ARCHIVE_MANIFEST_PATH as SITE_BACKUP_MANIFEST_PATH } from "./archive-manifest.js";
3
+ import { SiteShareRefusal } from "./share-refusal.js";
4
+ import { SAVED_KEYS_PATH } from "./saved-keys-port.js";
5
+ /** Buffered media/documents first, then the sanitized database projection when the plan has one. O(entries). */
6
+ function inMemoryEntries(required) {
7
+ const { plan } = required;
8
+ return [...(plan.bufferedFiles ?? []), ...(plan.database ? [{ path: SITE_BACKUP_DATABASE_PATH, content: plan.database.bytes }] : [])];
9
+ }
10
+ /** Claims every entry in one alias set for ZIPs and commits; only backups reserve the manifest path. */
11
+ export function claimArchivePaths(required, optional = {}) {
12
+ const aliases = new Map(), fileAliases = new Set();
13
+ if (optional.manifest !== false)
14
+ required.host.claimSharePath({ path: SITE_BACKUP_MANIFEST_PATH, directory: false, aliases, files: fileAliases });
15
+ for (const file of required.entries)
16
+ required.host.claimSharePath({ path: file.path, directory: false, aliases, files: fileAliases });
17
+ }
18
+ /** Abort-checks and secret-scans one entry, then records its picked File, inventory row and progress. O(entry bytes). */
19
+ function addEntry(required, optional = {}) {
20
+ const { entry, collected } = required;
21
+ optional.signal?.throwIfAborted();
22
+ // SQLite is rebuilt by the projection owner; ciphertext is authenticated by Job 2 on restore.
23
+ const structured = entry.path === SITE_BACKUP_DATABASE_PATH || entry.path === SAVED_KEYS_PATH;
24
+ if (!structured && !optional.skipCredentialScan)
25
+ required.host.requireShareSecretFree({ path: required.host.archiveSecretScanPath({ path: entry.path, plugins: collected.plugins }), bytes: entry.content }, { shownPath: entry.path, credentialWarnings: collected.credentialWarnings });
26
+ // Node File accepts Buffer directly; the DOM type omits potentially shared-backed views.
27
+ // This assertion preserves the bytes without allocating a second Uint8Array.
28
+ const name = entry.path.split("/").at(-1);
29
+ if (name === undefined)
30
+ throw new Error("Share ZIP entry has no filename");
31
+ const picked = new File([entry.content], name);
32
+ // Jini's picker encoder strips the selected folder's name. Supply that same picker contract
33
+ // explicitly so archive paths keep their first scope segment (media/, themes/, plugins/).
34
+ Object.defineProperty(picked, "webkitRelativePath", { value: `share/${entry.path}` });
35
+ collected.files.push(picked);
36
+ collected.inventory.push({ path: entry.path, bytes: entry.content.length, sha256: createHash("sha256").update(entry.content).digest("hex") });
37
+ if (optional.progress) {
38
+ optional.progress.filesDone++;
39
+ optional.progress.bytesDone += entry.content.length;
40
+ }
41
+ }
42
+ /** Compare the exact backup bytes being encoded, without changing static exports or execution trust.
43
+ * @complexity O(entry bytes); one installed-file read. All bytes count toward progress/inventory.
44
+ */
45
+ async function addBackupEntry(required, optional) {
46
+ optional.signal?.throwIfAborted();
47
+ const disposition = await optional.bundledFilePolicy?.({ path: required.entry.path, bytes: required.entry.content });
48
+ optional.signal?.throwIfAborted();
49
+ addEntry(required, { ...optional, skipCredentialScan: disposition === 'skip' });
50
+ }
51
+ /** Reads each planned disk file in order and adds it; refuses PLAN_STALE when one changed since the plan. */
52
+ async function addDiskFiles(required, optional = {}) {
53
+ for (const file of required.files) {
54
+ const loaded = await required.host.readPlannedFile(file);
55
+ if (!loaded.ok)
56
+ throw new SiteShareRefusal({ code: "PLAN_STALE", message: loaded.message });
57
+ const archivePath = required.host.runtimeToArchivePath({ path: file.path });
58
+ if (archivePath !== null)
59
+ await addBackupEntry({ entry: { path: archivePath, content: loaded.bytes }, collected: required.collected, host: required.host }, optional);
60
+ }
61
+ }
62
+ /** The manifest File over the final inventory; refused when it exceeds 2 MiB or, counted in, the archive caps. */
63
+ function buildManifestFile(required) {
64
+ // Count the manifest as an entry first: the manifest validator would otherwise refuse a full
65
+ // share as INVALID_ARCHIVE instead of telling the owner it is over the file cap.
66
+ required.host.checkShareLimits({ files: [...required.inventory, { path: SITE_BACKUP_MANIFEST_PATH, bytes: 0 }] });
67
+ const manifest = Buffer.from(required.host.buildArchiveManifest({ schema: required.plan.schema, site: { name: required.plan.site.name }, scopes: required.plan.include, media: required.plan.media ?? [], plugins: retainedPlugins({ plan: required.plan, inventory: required.inventory }), files: required.inventory,
68
+ ...(required.plan.encryptedKeys ? { encryptedKeys: required.plan.encryptedKeys } : {}),
69
+ ...(required.plan.staticSiteOmitted ? { staticSiteOmitted: required.plan.staticSiteOmitted } : {}) }));
70
+ if (manifest.length > required.host.limits.maxManifestBytes)
71
+ throw new SiteShareRefusal({ code: "LIMIT_EXCEEDED", message: required.host.manifestTooLargeMessage });
72
+ required.host.checkShareLimits({ files: [...required.inventory, { path: SITE_BACKUP_MANIFEST_PATH, bytes: manifest.length }] });
73
+ return new File([manifest], SITE_BACKUP_MANIFEST_PATH);
74
+ }
75
+ function retainedPlugins(required, _options = {}) {
76
+ return (required.plan.plugins ?? []).filter(plugin => required.inventory.some(file => file.path.startsWith(`${plugin.kind === "agent" ? "agent-plugins" : "plugins"}/${plugin.id}/package/`)));
77
+ }
78
+ /** Encodes the picked Files with Jini, reporting its size/count failures as the archive cap. */
79
+ async function encodeShareZip(required) {
80
+ // Jini adds ZIP header overhead to the same archive cap before allocating the final File.
81
+ try {
82
+ return Buffer.from(await (await required.zip({ files: required.files, maxBytes: required.host.limits.maxArchiveBytes })).arrayBuffer());
83
+ }
84
+ catch (error) {
85
+ if (error instanceof Error && /limit|large|many/i.test(error.message))
86
+ throw new SiteShareRefusal({ code: "LIMIT_EXCEEDED", message: required.host.archiveTooLargeMessage });
87
+ throw error;
88
+ }
89
+ }
90
+ /**
91
+ * The ZIP target of the common backup content plan. Calls Jini's buffered binary-safe encoder;
92
+ * checks the exact sanitized bytes and builds the v2 ZIP manifest over its exact bytes. The repository target retains its contract.
93
+ * @throws SiteShareRefusal for stale files, unsafe aliases, cancellation, and archive caps. Credential-looking files are included with warnings.
94
+ * @complexity O(payload bytes + paths²), at most 2,000 paths; O(payload bytes) memory, bounded to 300 MiB.
95
+ */
96
+ async function buildShareZipContent(required, optional = {}) {
97
+ const { plan, host } = required;
98
+ const memory = inMemoryEntries({ plan });
99
+ const sizes = [...plan.files, ...memory.map(file => ({ path: file.path, bytes: file.content.length }))];
100
+ host.checkShareLimits({ files: sizes, totalBytes: plan.totalBytes });
101
+ const paths = [...plan.files.flatMap(file => { const path = host.runtimeToArchivePath({ path: file.path }); return path === null ? [] : [{ path }]; }), ...memory];
102
+ claimArchivePaths({ entries: paths, host });
103
+ if (optional.progress)
104
+ Object.assign(optional.progress, { filesTotal: paths.length, bytesTotal: sizes.reduce((sum, file) => sum + file.bytes, 0) });
105
+ const collected = { files: [], inventory: [], plugins: plan.plugins ?? [], credentialWarnings: optional.credentialWarnings ?? [] };
106
+ const entryOptions = { ...optional, bundledFilePolicy: optional.bundledFilePolicy ?? host.defaultBundledFilePolicy() };
107
+ for (const entry of memory)
108
+ await addBackupEntry({ entry, collected, host }, entryOptions);
109
+ await addDiskFiles({ files: plan.files, collected, host }, entryOptions);
110
+ collected.files.push(buildManifestFile({ plan, inventory: collected.inventory, host }));
111
+ optional.signal?.throwIfAborted();
112
+ return encodeShareZip({ files: collected.files, zip: required.zip, host });
113
+ }
114
+ /** Full backups contain portable source content only. Legacy callers may still supply a
115
+ * capture for omission diagnostics; its render/scan/size failures must never block the backup.
116
+ * Reuses the existing collector and encoder, including every path, secret and archive limit check. */
117
+ export async function buildShareZip(required, optional = {}) {
118
+ const omitted = staticCopyOmission({ copy: optional.staticCopy });
119
+ const plan = omitted ? { ...required.plan, staticSiteOmitted: omitted } : required.plan;
120
+ return buildShareZipContent({ ...required, plan }, optional);
121
+ }
122
+ /** Preserve older callers' omission explanations without adding any rendered file or inventory row. */
123
+ function staticCopyOmission({ copy }, _options = {}) {
124
+ if (!copy)
125
+ return undefined;
126
+ if ("reason" in copy)
127
+ return copy.reason;
128
+ return undefined;
129
+ }
130
+ /** Static-only ZIP uses the same picked-file path/scanning pipeline and Jini encoder, without a backup manifest. */
131
+ export async function buildStaticSiteZip(required, optional = {}) {
132
+ const folder = required.copy.filename.replace(/\.zip$/i, "");
133
+ const { host, zip, ...layout } = required;
134
+ const entries = host.staticDownloadLayout(layout).map(file => ({ ...file, path: `${folder}/${file.path}` }));
135
+ host.checkShareLimits({ files: entries.map(file => ({ path: file.path, bytes: file.content.length })) });
136
+ claimArchivePaths({ entries, host }, { manifest: false });
137
+ if (optional.progress)
138
+ Object.assign(optional.progress, { filesTotal: entries.length, bytesTotal: entries.reduce((sum, file) => sum + file.content.length, 0) });
139
+ const collected = { files: [], inventory: [], plugins: [], credentialWarnings: optional.credentialWarnings ?? [] };
140
+ for (const entry of entries)
141
+ addEntry({ entry, collected, host }, optional);
142
+ return encodeShareZip({ files: collected.files, zip, host });
143
+ }
144
+ //# sourceMappingURL=share-zip.js.map
@@ -0,0 +1,344 @@
1
+ import type { BigIntStats, Dirent, Stats } from "node:fs";
2
+ import type { OwnedTempRootScope } from "./owned-temp-root.js";
3
+ import type { DbOpsPort } from "@jini-ai/core/contracts/site/gated-mutations-ports";
4
+ import type { PluginDiscoveryRecord } from "@jini-ai/core/contracts/site/host-node";
5
+ import type { AgentPluginLayout } from "@jini-ai/core/contracts/headless/plugin-host";
6
+ /**
7
+ * @file What a site backup is made of, read from this machine: which files on disk each scope switch
8
+ * picks up, the database snapshot, the size limits, re-reading a planned file at push time, and the
9
+ * backup manifest a future restore reads first. No network here — the git-host plugin provider (`source-control/provider-module.ts`) owns
10
+ * GitHub, `tool-registrations.ts` owns the order these run in.
11
+ *
12
+ * The backup folder's layout (paths relative to the folder root):
13
+ * - the manifest file (its name is the host's) — the manifest ({@link buildSiteBackupManifest}).
14
+ * - `database/content.db` — the snapshot ({@link captureDatabaseSnapshot}), rebuilt through the share
15
+ * policy before upload (`backup-service.ts` `captureBackupDatabase`: no accounts or secrets). NEVER the live
16
+ * `content.db` file: a plain read of a WAL-mode database can miss committed pages still in
17
+ * `content.db-wal`. The snapshot comes only from `DbOpsPort.captureRestorePoint` (SQLite's online
18
+ * backup API), the same consistent copy the gated-mutation restore points use.
19
+ * - `uploads/**` (media), `themes/**` (themes), `agent-plugins/**` and `skills/**` (plugins),
20
+ * `settings/config.json` and `settings/.site-meta.json` (settings).
21
+ *
22
+ * Deliberately never included, by construction (each scope walks only its own subtree):
23
+ * - `chat.db` and `uploads/chat-attachments/` — chat history, not site content.
24
+ * - `ops/` (the database journal), `out/` (the rendered export, which `source_control_execute_commit`
25
+ * already pushes), `content.seed.db` and stray `restore-point-*.db` files.
26
+ * - `.mcp.*.json` (MCP server env, can hold tokens) and `.fs-custom-root.json` (a local path).
27
+ * - `agent-plugins/ws/<id>/<plugin>/data/` and the legacy `agent-plugins/ws/<id>/data/` (plugin OAuth
28
+ * tokens), `staging/` and `packages/superseded-*`.
29
+ * - `.DS_Store` and any `.git` segment.
30
+ * - Symbolic links, never followed: a link to `~/.ssh` inside `themes/` must not ride along. Each
31
+ * one is reported in `skipped` so the human sees it was left out.
32
+ */
33
+ /** One switch in a backup's `include`. */
34
+ export type SiteBackupScope = "database" | "media" | "themes" | "plugins" | "settings";
35
+ /** Every scope, in the fixed order the manifest and the confirmation dialog list them. */
36
+ export declare const SITE_BACKUP_SCOPES: readonly SiteBackupScope[];
37
+ /** Which scopes a backup includes. */
38
+ export type SiteBackupInclude = Record<SiteBackupScope, boolean>;
39
+ /** The repository host a backup goes to, as its plugin declares it (`SourceControlHostFacts`): its
40
+ * name, and the largest single file it accepts in a push (a push with a larger blob is rejected). */
41
+ export interface SiteBackupHostLimit {
42
+ readonly label: string;
43
+ readonly maxFileBytes?: number;
44
+ }
45
+ export interface SiteBackupLimits {
46
+ readonly maxTotalBytes: number;
47
+ readonly maxFiles: number;
48
+ }
49
+ /** Where the database snapshot lives inside the backup folder (the manifest's own path is the host's). */
50
+ export declare const SITE_BACKUP_DATABASE_PATH = "database/content.db";
51
+ /** Structural mirror of the platform's reviewed-file contract: metadata captured when a caller reviews
52
+ * a file, before its later read. */
53
+ export interface ReviewedFile {
54
+ readonly root: string;
55
+ readonly absPath: string;
56
+ readonly bytes: number;
57
+ readonly mtimeMs: number;
58
+ readonly identity: string | null;
59
+ readonly nlink: number;
60
+ }
61
+ /** Metadata and bytes must come from the same open descriptor. */
62
+ export interface ReviewedFileHandle {
63
+ stat(): Promise<Pick<Stats, "isFile" | "size" | "mtimeMs">>;
64
+ stat(options: {
65
+ bigint: true;
66
+ }): Promise<Pick<BigIntStats, "dev" | "ino">>;
67
+ readFile(): Promise<Buffer>;
68
+ close(): Promise<void>;
69
+ }
70
+ /** Injectable filesystem boundary for deterministic path-swap probes. */
71
+ export interface ReviewedFileSystem {
72
+ open(file: string, flags: number): Promise<ReviewedFileHandle>;
73
+ lstat(file: string): Promise<Pick<BigIntStats, "dev" | "ino" | "nlink" | "isSymbolicLink" | "isDirectory">>;
74
+ realpath(file: string): Promise<string>;
75
+ }
76
+ /** What a site plugin's package lists for a valid, pinned discovery record. */
77
+ export interface SitePluginPackageListing {
78
+ readonly rootDir: string;
79
+ readonly files: readonly {
80
+ readonly relativePath: string;
81
+ readonly sha256: string | null;
82
+ }[];
83
+ }
84
+ /** Everything the walk and the reads take from the host. Every member is REQUIRED: the engine carries no host defaults. */
85
+ export interface SiteBackupSourceDeps {
86
+ /** The host's share file rules, applied only to the share profile. */
87
+ readonly sharePolicy: {
88
+ readonly excludedSharePath: (required: {
89
+ path: string;
90
+ }, optional?: {
91
+ notices?: string[] | undefined;
92
+ }) => boolean;
93
+ readonly validateSharePath: (required: {
94
+ path: string;
95
+ }) => void;
96
+ readonly checkShareLimits: (required: {
97
+ files: readonly {
98
+ path: string;
99
+ bytes: number;
100
+ }[];
101
+ }) => void;
102
+ };
103
+ /** Lists a site plugin's package files for a valid record; rejects with the host's path error for an invalid one. */
104
+ readonly listSitePluginPackage: (required: {
105
+ installDir: string;
106
+ record: PluginDiscoveryRecord;
107
+ }) => Promise<SitePluginPackageListing>;
108
+ /** True for the error `listSitePluginPackage` rejects with for a damaged or missing package (expected, not logged). */
109
+ readonly isPluginPackagePathError: (error: unknown) => boolean;
110
+ /** Reads a reviewed file's bytes, or `null` when it is no longer the file that was reviewed. */
111
+ readonly readReviewedFile: (required: {
112
+ file: ReviewedFile;
113
+ }, optional?: {
114
+ fileSystem?: ReviewedFileSystem | undefined;
115
+ }) => Promise<Buffer | null>;
116
+ /** The `dev:ino` identity of a file, or `null` when the filesystem has none. */
117
+ readonly reviewedFileIdentity: (required: {
118
+ info: Pick<BigIntStats, "dev" | "ino">;
119
+ }) => string | null;
120
+ /** The one media note a backup can carry, and why: the bytes are not on this machine. */
121
+ readonly mediaInObjectStorageNote: string;
122
+ }
123
+ /** Where each scope's bytes live on this machine — resolved once by the composition root
124
+ * (`server/runtime/composition/deps.ts`'s `createSiteRouteDeps`), so this file never re-derives a
125
+ * site path itself. */
126
+ export interface SiteBackupSources {
127
+ readonly siteDir: string;
128
+ /** `null` when media lives in object storage (the host's media-store override): there is no folder on
129
+ * this machine to back up, and {@link collectSiteBackupFiles} says so instead of backing up
130
+ * nothing silently. */
131
+ readonly mediaUploadsDir: string | null;
132
+ /** The effective media provider is remote — read at backup time, since a site-setting choice
133
+ * (`core.storage.mediaObjectStore`) is not known at boot the way the env override is. When it
134
+ * answers `true` the uploads folder is not walked (it is not where media lives) and the scope
135
+ * note is written, exactly as for a `null` {@link mediaUploadsDir}. */
136
+ readonly isMediaRemote?: () => Promise<boolean>;
137
+ readonly themesDir: string;
138
+ /** The installer's own layout (`features/agent-plugins/layout.ts`), never a re-derived path: every
139
+ * plugin folder the backup reads comes from the same helpers `install.ts` writes through, so a
140
+ * layout move cannot silently drop installed packages from a backup again. */
141
+ readonly agentPlugins: AgentPluginLayout;
142
+ readonly skillsDir: string;
143
+ /** The site plugin install folder and Jini's discovery of it with the activation pins (the version
144
+ * boot runs): a share ships only what Jini lists for a valid record. Absent: no plugin ships. */
145
+ readonly sitePlugins?: () => Promise<{
146
+ installDir: string;
147
+ records: readonly PluginDiscoveryRecord[];
148
+ }>;
149
+ }
150
+ /** One file on disk a backup will upload. Jini verifies its bigint identity, link count, ancestry,
151
+ * `bytes` and `mtimeMs` again at push time. */
152
+ export interface PlannedDiskFile extends ReviewedFile {
153
+ /** Relative to the backup folder, `/`-separated. A share's site plugin file is already its archive
154
+ * path (`plugins/<id>/package/<path in the package>`); `absPath` is still the file on disk. */
155
+ readonly path: string;
156
+ readonly bytes: number;
157
+ readonly scope: SiteBackupScope;
158
+ readonly absPath: string;
159
+ readonly mtimeMs: number;
160
+ /** A share's theme or site plugin package file: the sha256 hex of the bytes checked when it was planned, at an
161
+ * `absPath` reached through no link. {@link readPlannedFile} then returns only those exact bytes, so
162
+ * what ships is what was checked (size and mtime alone cannot tell a same-size swap). */
163
+ readonly sha256?: string;
164
+ }
165
+ export interface SkippedSiteBackupFile {
166
+ readonly path: string;
167
+ readonly reason: string;
168
+ }
169
+ export interface CollectedSiteBackupFiles {
170
+ readonly files: PlannedDiskFile[];
171
+ readonly skipped: SkippedSiteBackupFile[];
172
+ readonly scopeNotes: Partial<Record<SiteBackupScope, string>>;
173
+ readonly notices?: readonly string[];
174
+ }
175
+ /** The filesystem reads used by backup collection, including files removed during the walk. */
176
+ export interface SiteBackupWalkFileSystem {
177
+ readonly lstat: (required: {
178
+ file: string;
179
+ }) => Promise<Stats>;
180
+ readonly lstatBigInt: (required: {
181
+ file: string;
182
+ }, optional?: Record<string, never>) => Promise<Pick<BigIntStats, "dev" | "ino">>;
183
+ readonly readdir: (required: {
184
+ dir: string;
185
+ }, optional?: Record<string, never>) => Promise<Dirent[]>;
186
+ }
187
+ /**
188
+ * Every file on disk the switched-on scopes pick up. The database scope is never a disk walk — see
189
+ * {@link captureDatabaseSnapshot}.
190
+ *
191
+ * @returns `files` sorted by path, `skipped` (symlinks and non-regular files, each with its reason),
192
+ * and `scopeNotes` for a scope whose content could not be collected here at all.
193
+ * @throws SiteShareRefusal for unsafe share files or stale themes, or an unexpected filesystem error
194
+ * (a missing folder is treated as empty).
195
+ * @complexity O(entries + shared theme bytes), plus O(n log n) to sort n files.
196
+ */
197
+ export declare function collectSiteBackupFiles(input: {
198
+ sources: SiteBackupSources;
199
+ include: SiteBackupInclude;
200
+ deps: SiteBackupSourceDeps;
201
+ }, optional?: {
202
+ fileSystem?: SiteBackupWalkFileSystem;
203
+ profile?: "share";
204
+ }): Promise<CollectedSiteBackupFiles>;
205
+ export type DatabaseSnapshotResult = {
206
+ ok: true;
207
+ bytes: Buffer;
208
+ watermarkAtCapture: number;
209
+ } | {
210
+ ok: false;
211
+ message: string;
212
+ logDetail?: string;
213
+ };
214
+ /**
215
+ * A consistent copy of the whole site database, held in memory.
216
+ *
217
+ * Only a cheap file snapshot (SQLite) is accepted: that is the only restore mechanism whose artifact
218
+ * is a single file this process can read back. Anything else is refused BEFORE a capture is attempted.
219
+ * The restore-point file `captureRestorePoint` writes (beside `content.db`, or inside a fresh private
220
+ * folder under `optional.snapshotRoot`) is deleted as soon as it is read, success or not, so a backup
221
+ * never leaves one behind. A site export passes `snapshotRoot` so it never writes into source-site storage.
222
+ *
223
+ * @returns The snapshot bytes and the watermark stamped at capture, or a caller-safe `message` (a
224
+ * capture failure's own text stays in `logDetail`, which is for the server log only).
225
+ * @complexity O(database size) — one full copy, one read, one unlink.
226
+ */
227
+ export declare function captureDatabaseSnapshot(input: {
228
+ dbOps: DbOpsPort;
229
+ scopeId: string;
230
+ snapshotDirPrefix: string;
231
+ }, optional?: {
232
+ maxBytes?: number;
233
+ snapshotRoot?: string;
234
+ tempRoot?: OwnedTempRootScope;
235
+ }): Promise<DatabaseSnapshotResult>;
236
+ /** `123 B`, `4.2 KiB`, `12.5 MiB`, `1 GiB` — for messages and the confirmation dialog. */
237
+ export declare function formatByteSize({ bytes }: {
238
+ bytes: number;
239
+ }, _optional?: Record<string, never>): string;
240
+ /**
241
+ * Leaves out every disk file over the host's per-file limit, each named in `skipped` with its size,
242
+ * so one huge video does not cost the whole backup (2026-10-06: the owner asked for a full backup
243
+ * that just works). The database is not a disk file here: an oversized snapshot still fails the plan
244
+ * in {@link checkSiteBackupLimits}, because a backup without its database is not a backup.
245
+ *
246
+ * @complexity O(n).
247
+ */
248
+ export declare function skipOversizedFiles({ files, host }: {
249
+ files: readonly PlannedDiskFile[];
250
+ host: SiteBackupHostLimit;
251
+ }, _optional?: Record<string, never>): {
252
+ files: PlannedDiskFile[];
253
+ skipped: SkippedSiteBackupFile[];
254
+ };
255
+ export type SiteBackupLimitsResult = {
256
+ ok: true;
257
+ totalBytes: number;
258
+ } | {
259
+ ok: false;
260
+ message: string;
261
+ };
262
+ /**
263
+ * Checks a backup against `limits` (the host's own caps) and the host's own per-file limit (when its
264
+ * plugin declares one) before anything is uploaded. A file over the per-file limit is refused, never truncated or split — and EVERY such file is named, so one retry
265
+ * after removing them is enough. The plan runs {@link skipOversizedFiles} over the disk files first,
266
+ * so in practice only an oversized database snapshot reaches this refusal.
267
+ *
268
+ * @complexity O(n) in the file count.
269
+ */
270
+ export declare function checkSiteBackupLimits({ files, host, limits }: {
271
+ files: readonly {
272
+ path: string;
273
+ bytes: number;
274
+ }[];
275
+ host: SiteBackupHostLimit;
276
+ limits: SiteBackupLimits;
277
+ }, _optional?: Record<string, never>): SiteBackupLimitsResult;
278
+ export type ReadPlannedFileResult = {
279
+ ok: true;
280
+ bytes: Buffer;
281
+ } | {
282
+ ok: false;
283
+ message: string;
284
+ };
285
+ /** The generic descriptor contract belongs to Jini; backup retains its existing test seam. */
286
+ export type SiteBackupReadHandle = ReviewedFileHandle;
287
+ type ReadPlannedFileOptions = {
288
+ fileSystem?: ReviewedFileSystem;
289
+ openFile?: ReviewedFileSystem["open"];
290
+ };
291
+ type ReadDiskFileOptions = ReadPlannedFileOptions & {
292
+ deps: Pick<SiteBackupSourceDeps, "readReviewedFile">;
293
+ unlinkedPath?: boolean;
294
+ };
295
+ /**
296
+ * Reads a planned file at push time, refusing it if it is no longer the file the human reviewed.
297
+ *
298
+ * Opened with `O_NOFOLLOW` and checked through the SAME handle it is read from, so a file swapped
299
+ * for a symlink after the plan cannot be followed, and the size/mtime compared are the bytes
300
+ * actually read. A file planned with a `sha256` must also still be reached through no linked folder
301
+ * and hash to exactly that digest.
302
+ *
303
+ * @complexity O(file size + path depth) — Jini proves identity and plain ancestry; pinned files add a hash.
304
+ */
305
+ export declare function readPlannedFile(file: PlannedDiskFile, optional: ReadDiskFileOptions): Promise<ReadPlannedFileResult>;
306
+ /** How the host names itself in the manifest: the `format` string and the key its version sits under. */
307
+ export interface SiteBackupManifestIdentity {
308
+ readonly format: string;
309
+ readonly producerKey: string;
310
+ }
311
+ export interface SiteBackupManifestInput {
312
+ readonly createdAt: string;
313
+ /** The producing host's own version string. */
314
+ readonly hostVersion: string;
315
+ readonly schema: {
316
+ readonly index: number;
317
+ readonly tag: string;
318
+ };
319
+ readonly site: {
320
+ readonly name: string;
321
+ readonly folderName: string;
322
+ };
323
+ /** `null` when the database scope is off. */
324
+ readonly database: {
325
+ readonly watermarkAtCapture: number;
326
+ } | null;
327
+ readonly include: SiteBackupInclude;
328
+ readonly scopeNotes: Partial<Record<SiteBackupScope, string>>;
329
+ readonly files: readonly {
330
+ readonly path: string;
331
+ readonly bytes: number;
332
+ readonly sha256: string;
333
+ }[];
334
+ }
335
+ /**
336
+ * The backup's manifest file: what produced it (the host's version, migration schema), when, which
337
+ * scopes it holds and why any is incomplete, and every file with its sha256 — what a future restore
338
+ * checks before touching anything.
339
+ *
340
+ * @complexity O(n) in the file count.
341
+ */
342
+ export declare function buildSiteBackupManifest(input: SiteBackupManifestInput, identity: SiteBackupManifestIdentity): string;
343
+ export {};
344
+ //# sourceMappingURL=sources.d.ts.map