@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,93 @@
1
+ import { createHash } from "node:crypto";
2
+ import path from "node:path";
3
+ import { SiteShareRefusal } from "./share-refusal.js";
4
+ const EXTENSIONS = { "video/mp4": "mp4", "video/webm": "webm", "video/quicktime": "mov", "video/x-m4v": "m4v", "audio/wav": "wav", "audio/mpeg": "mp3", "audio/flac": "flac", "audio/mp4": "m4a" };
5
+ /** Picks exactly one public copy per item, in id order, without writing to the source site.
6
+ * @throws SiteShareRefusal naming missing, corrupt or unbounded media; raster failures never fall back to raw bytes.
7
+ * @complexity O(items log items + media bytes); shared caps bound retained output and each input read.
8
+ */
9
+ export async function bufferArchiveMedia(required, optional = {}) {
10
+ const { host } = required;
11
+ const context = { host, blobStore: required.blobStore, imageTransformer: required.imageTransformer };
12
+ const aliases = new Set();
13
+ const copies = [];
14
+ for (const source of [...required.sources].sort((a, b) => a.id < b.id ? -1 : Number(a.id > b.id))) {
15
+ optional.signal?.throwIfAborted();
16
+ const original = await readCopy({ context, source });
17
+ const selected = await publicCopy({ context, source, original });
18
+ const file = mediaPath({ host, source, extension: selected.extension, aliases });
19
+ const sha256 = createHash("sha256").update(selected.bytes).digest("hex");
20
+ const storageKey = host.operations.computeBlobStorageKey({ workspaceId: source.workspaceId, sha256 });
21
+ host.paths.validateSharePath({ path: "uploads/" + storageKey });
22
+ host.sharePolicy.addBuffered({ ledger: required.ledger, file: { path: file, content: selected.bytes } });
23
+ copies.push({ id: source.id, slug: source.slug, path: file, sha256, workspaceId: source.workspaceId, storageKey, contentType: selected.contentType, documentOwned: source.documentOwned, ...(selected.publicVersion === undefined ? {} : { publicVersion: selected.publicVersion }) });
24
+ }
25
+ return copies;
26
+ }
27
+ /** Size and checksum must come from the snapshot/store contract before bytes can be archived. */
28
+ async function readCopy(required) {
29
+ const { host, blobStore } = required.context;
30
+ host.paths.validateSharePath({ path: "uploads/" + required.source.storageKey });
31
+ const size = await host.sharePolicy.reportedBlobSize({ blobStore, storageKey: required.source.storageKey, document: required.source.kind === "document" });
32
+ return host.sharePolicy.fetchVerifiedBlob({ blobStore, media: required.source, size });
33
+ }
34
+ async function publicCopy(required) {
35
+ const { operations } = required.context.host;
36
+ const contentType = operations.sniffContentType({ bytes: required.original });
37
+ if (required.source.kind === "document")
38
+ return { bytes: required.original, contentType, extension: originalExtension(required.source) };
39
+ if (contentType === "image/svg+xml")
40
+ return { bytes: Buffer.from(await operations.sanitizeSvg({ bytes: required.original })), contentType, extension: "svg" };
41
+ if (!contentType.startsWith("image/"))
42
+ return { bytes: required.original, contentType, extension: EXTENSIONS[contentType] ?? originalExtension(required.source) };
43
+ return rasterCopy(required);
44
+ }
45
+ async function rasterCopy(required) {
46
+ const { context } = required;
47
+ const { operations } = context.host;
48
+ const definition = required.source.public;
49
+ if (!definition || definition.params.format !== "webp")
50
+ throw new SiteShareRefusal({ code: "INVALID_MEDIA", message: `Media '${required.source.id}' has no public webp transform.` });
51
+ try {
52
+ const bytes = definition.storageKey
53
+ ? await readCopy({ context, source: { storageKey: definition.storageKey, ...(definition.sha256 ? { sha256: definition.sha256 } : {}) } })
54
+ : Buffer.from((await context.imageTransformer.transform({ bytes: required.original, params: definition.params })).bytes);
55
+ if (operations.sniffContentType({ bytes }) !== "image/webp")
56
+ throw new Error("public rendition is not webp");
57
+ return { bytes, contentType: operations.mimeForTransformFormat({ format: definition.params.format }), extension: "webp", publicVersion: definition.version };
58
+ }
59
+ catch (error) {
60
+ throw new SiteShareRefusal({ code: "INVALID_MEDIA", message: `Cannot export media '${required.source.id}' (${required.source.slug}): ${error instanceof Error ? error.message : "image decode failed"}` });
61
+ }
62
+ }
63
+ function originalExtension(source) {
64
+ const extension = path.extname(source.originalFilename ?? "").slice(1).toLowerCase();
65
+ return /^[a-z0-9]{1,12}$/.test(extension) ? extension : "bin";
66
+ }
67
+ function mediaPath(required) {
68
+ const { paths } = required.host;
69
+ const slug = required.source.slug || required.source.id;
70
+ const extension = portableExtension({ paths, slug, extension: required.extension });
71
+ let candidate = `media/${slug}.${extension}`, suffix = 2;
72
+ while (required.aliases.has(paths.sharePathAlias({ path: candidate }))) {
73
+ candidate = `media/${slug}-${suffix}.${extension}`;
74
+ suffix++;
75
+ }
76
+ paths.validateSharePath({ path: candidate });
77
+ required.aliases.add(paths.sharePathAlias({ path: candidate }));
78
+ return candidate;
79
+ }
80
+ /** A document keeps its own extension, which the share path policy may never publish (Keynote's
81
+ * `.key`). The archive name is cosmetic: the media row keeps the original filename, so `.bin` names it. */
82
+ function portableExtension(required) {
83
+ try {
84
+ required.paths.validateSharePath({ path: `media/${required.slug}.${required.extension}` });
85
+ return required.extension;
86
+ }
87
+ catch (error) {
88
+ if (error instanceof SiteShareRefusal)
89
+ return "bin";
90
+ throw error;
91
+ }
92
+ }
93
+ //# sourceMappingURL=archive-media.js.map
@@ -0,0 +1,31 @@
1
+ import type { SiteBackupSources } from "./sources.js";
2
+ import type { CredentialSetConnectionInput as CustomProviderConnectionInput } from "@jini-ai/core/contracts/credentials";
3
+ import type { CredentialedRepositoryTarget, SourceControlProvider } from "../../source-control/site/provider-module.js";
4
+ import type { SiteBackupRequestDeps, SiteBackupRepositoryPlanContent, SiteBackupToolDeps, Refusal } from "./backup-service.js";
5
+ interface ResolvedBackupCredential {
6
+ readonly ok: true;
7
+ readonly label: string;
8
+ readonly baseUrl: string;
9
+ readonly connection: CustomProviderConnectionInput;
10
+ /** The plugin provider for the credential's host. */
11
+ readonly provider: SourceControlProvider;
12
+ }
13
+ /** A resolved credential's repository target: its API plus the `Authorization` header built from it. */
14
+ export declare function backupTarget({ deps, credential, owner, repo }: {
15
+ deps: SiteBackupToolDeps["deps"];
16
+ credential: ResolvedBackupCredential;
17
+ owner: string;
18
+ repo: string;
19
+ }, _optional?: Record<string, never>): CredentialedRepositoryTarget;
20
+ /**
21
+ * Resolves the credential the backup pushes with. A missing row and an undecryptable one are
22
+ * different codes; the decrypt error's own text is never used (it can quote plaintext).
23
+ *
24
+ * @complexity O(saved credentials) plus one decrypt.
25
+ */
26
+ export declare function resolveBackupCredential<TSource extends SiteBackupSources, TContent extends SiteBackupRepositoryPlanContent, TRequest extends SiteBackupRequestDeps<TSource, TContent>>({ deps, requested }: {
27
+ deps: SiteBackupToolDeps<TSource, TContent, TRequest>;
28
+ requested: string | undefined;
29
+ }, _optional?: Record<string, never>): Promise<ResolvedBackupCredential | Refusal>;
30
+ export {};
31
+ //# sourceMappingURL=backup-service.credentials.d.ts.map
@@ -0,0 +1,161 @@
1
+ import { failureLog } from "./backup-service.shared.js";
2
+ /** A resolved credential's repository target: its API plus the `Authorization` header built from it. */
3
+ export function backupTarget({ deps, credential, owner, repo }, _optional = {}) {
4
+ return { baseUrl: credential.baseUrl, authorization: deps.buildAuthorizationHeader({ connection: credential.connection, schemes: [] }), owner, repo };
5
+ }
6
+ /** Every git-host provider an enabled plugin ships, or the refusal when there is none. */
7
+ async function loadBackupProviders(deps) {
8
+ const built = await deps.buildSourceControlProviders({ deps: deps.request }, {});
9
+ for (const refusal of built.refusals)
10
+ failureLog(deps)(`[site-backup] ${refusal}`);
11
+ if (built.providers.length === 0) {
12
+ return { ok: false, code: "NO_PROVIDER", message: built.noProviderMessage };
13
+ }
14
+ return { ok: true, providers: built.providers, noProviderMessage: built.noProviderMessage };
15
+ }
16
+ function originOf({ url }, _optional = {}) {
17
+ try {
18
+ return new URL(url).origin;
19
+ }
20
+ catch {
21
+ return null;
22
+ }
23
+ }
24
+ function labelList(labels) {
25
+ return labels.length === 0 ? "none are saved" : `saved labels: ${labels.map((label) => "'" + label + "'").join(", ")}`;
26
+ }
27
+ /**
28
+ * Picks the credential's label: the one named, or — when none is — the single saved credential
29
+ * pointing at a provider's API origin. A pure list read; nothing is decrypted here.
30
+ *
31
+ * @complexity O(saved credentials).
32
+ */
33
+ async function pickCredentialLabel({ deps, providers, requested }, _optional = {}) {
34
+ const saved = await deps.listCustomCredentials({ deps: deps.request }, { workspaceId: deps.request.workspaceId });
35
+ const labels = saved.map((credential) => credential.label);
36
+ if (requested !== undefined) {
37
+ if (labels.includes(requested))
38
+ return { ok: true, label: requested };
39
+ return { ok: false, code: "CREDENTIAL_NOT_FOUND", message: `no saved credential is labeled '${requested}' (${labelList(labels)})` };
40
+ }
41
+ const apiOrigins = providers.map((provider) => provider.apiOrigin);
42
+ const where = apiOrigins.join(" or ");
43
+ const matching = saved.filter((credential) => apiOrigins.includes(originOf({ url: credential.baseUrl }) ?? "")).map((credential) => credential.label);
44
+ if (matching.length === 1) {
45
+ const label = matching[0];
46
+ if (label === undefined)
47
+ throw new Error("Backup credential match has no label");
48
+ return { ok: true, label };
49
+ }
50
+ if (matching.length === 0) {
51
+ return {
52
+ ok: false,
53
+ code: "CREDENTIAL_NOT_FOUND",
54
+ message: `no saved credential points at ${where} (${labelList(labels)}). Connect ${providers.map((provider) => provider.label).join(" or ")} with credential_save with kind source-control (a form in this chat), or save a token on the Access Tokens page ('Add custom provider', base URL ${where}), or name one with 'credential'.`,
55
+ };
56
+ }
57
+ return { ok: false, code: "CREDENTIAL_AMBIGUOUS", message: `${matching.length} saved credentials point at ${where} (${labelList(matching)}); name one with 'credential'.` };
58
+ }
59
+ /**
60
+ * This site's own site key status ({@link inspectSiteKeyMaterial}), resolved over THIS site's
61
+ * site-aware source ordering ({@link siteKeySourcesForSiteDir} — site-key plan §A3b, the same
62
+ * composed helper the admin site key route's `resolveSiteKeySources` reuses) rather than the
63
+ * module-wide env-then-legacy-file default `inspectSiteKeyMaterial()` falls back to when called
64
+ * bare. That default cannot see a per-site key file at all (the per-site key folder), so a site
65
+ * whose OWN key is active but has no env var and no legacy shared file would be reported `active:
66
+ * false` — the exact gap {@link unreadableCredentialMessage} used to surface as "this server has no
67
+ * site key" for a site that in fact has one.
68
+ *
69
+ * Falls back to the bare, non-site-aware status only when this runtime has no site folder at all
70
+ * (`deps.siteBackupSources` absent — the in-memory `app.ts` runtime; in practice the plan tool's own
71
+ * `UNAVAILABLE` check already refuses before this is ever reached for that case, but the push path
72
+ * re-resolves the credential independently and must not throw if it ever is).
73
+ *
74
+ * @complexity O(1) — one `.site-meta.json` read plus a fixed-size source list, matching
75
+ * {@link inspectSiteKeyMaterial}'s own cost.
76
+ */
77
+ function unreadableCredentialMessage({ deps, label }, _optional = {}) {
78
+ const status = (deps.request.siteBackupSiteKeyStatus ?? (() => {
79
+ const siteDir = deps.request.siteBackupSources?.siteDir;
80
+ return siteDir === undefined ? deps.serverSiteKeyStatus() : deps.siteBackupSiteKeyStatus({ siteDir });
81
+ }))();
82
+ if (status.active)
83
+ return deps.credentialMessages.active({ label });
84
+ if (status.invalid)
85
+ return deps.credentialMessages.invalid({ label });
86
+ return deps.credentialMessages.missing({ label });
87
+ }
88
+ /**
89
+ * The host's default connection saved through chat's "Connect <host>" form, when no custom
90
+ * credential points at the host. Demo dry run 2026-10-05: that form saves into the source-control
91
+ * store, which this tool never read, so a person who had just filled it in was still told
92
+ * CREDENTIAL_NOT_FOUND. A named `credential` matches the connection's label, which is also how the
93
+ * push re-resolves the plan's credential.
94
+ *
95
+ * @complexity O(providers) repo reads, at most one decrypt each.
96
+ */
97
+ async function resolveHostConnection({ deps, providers, requested }, _optional = {}) {
98
+ const repo = deps.request.sourceControlCredentialSetRepo;
99
+ if (!repo)
100
+ return null;
101
+ for (const provider of providers) {
102
+ const lookup = await findHostConnection({ deps, provider, providerId: provider.id });
103
+ if (!lookup.ok)
104
+ return lookup;
105
+ if (lookup.found && (requested === undefined || requested === lookup.found.label))
106
+ return hostCredential({ found: lookup.found, provider });
107
+ }
108
+ return null;
109
+ }
110
+ /** One host's default saved connection (or null); an unconfigured store is the safe CREDENTIAL_UNREADABLE diagnosis. */
111
+ async function findHostConnection(required) {
112
+ const { deps, provider } = required;
113
+ try {
114
+ return { ok: true, found: await deps.resolveDefaultForSourceControl({ deps: deps.request }, { workspaceId: deps.request.workspaceId, providerId: required.providerId }) };
115
+ }
116
+ catch (err) {
117
+ if (deps.isSourceControlCredentialSecretStoreUnconfiguredError(err))
118
+ return { ok: false, code: "CREDENTIAL_UNREADABLE", message: unreadableCredentialMessage({ deps, label: `${provider.label} connection` }) };
119
+ throw err;
120
+ }
121
+ }
122
+ /** A saved host connection as the backup's credential: its token, plus the username when one was saved. */
123
+ function hostCredential(required) {
124
+ const { found, provider } = required;
125
+ const { token } = found.connection;
126
+ const connection = "username" in found.connection ? { token, username: found.connection.username } : { token };
127
+ return { ok: true, label: found.label, baseUrl: provider.apiOrigin, connection, provider };
128
+ }
129
+ /**
130
+ * Resolves the credential the backup pushes with. A missing row and an undecryptable one are
131
+ * different codes; the decrypt error's own text is never used (it can quote plaintext).
132
+ *
133
+ * @complexity O(saved credentials) plus one decrypt.
134
+ */
135
+ export async function resolveBackupCredential({ deps, requested }, _optional = {}) {
136
+ const providers = await loadBackupProviders(deps);
137
+ if (!providers.ok)
138
+ return providers;
139
+ const picked = await pickCredentialLabel({ deps, providers: providers.providers, requested });
140
+ if (!picked.ok) {
141
+ if (picked.code !== "CREDENTIAL_NOT_FOUND")
142
+ return picked;
143
+ return (await resolveHostConnection({ deps, providers: providers.providers, requested })) ?? picked;
144
+ }
145
+ let resolved;
146
+ try {
147
+ resolved = await deps.resolveCustomCredentialByLabel({ deps: deps.request }, { workspaceId: deps.request.workspaceId, label: picked.label });
148
+ }
149
+ catch (err) {
150
+ if (deps.isCustomCredentialSecretStoreUnconfiguredError(err))
151
+ return { ok: false, code: "CREDENTIAL_UNREADABLE", message: unreadableCredentialMessage({ deps, label: picked.label }) };
152
+ throw err;
153
+ }
154
+ if (!resolved)
155
+ return { ok: false, code: "CREDENTIAL_NOT_FOUND", message: `the credential '${picked.label}' was deleted while the backup was being prepared` };
156
+ const provider = deps.pickSourceControlProviderForApi({ providers: providers.providers, baseUrl: resolved.baseUrl, noProviderMessage: providers.noProviderMessage });
157
+ if (!provider.ok)
158
+ return { ok: false, code: "NO_PROVIDER", message: provider.message };
159
+ return { ok: true, label: picked.label, baseUrl: resolved.baseUrl, connection: resolved.connection, provider: provider.provider };
160
+ }
161
+ //# sourceMappingURL=backup-service.credentials.js.map
@@ -0,0 +1,331 @@
1
+ import type { findReservedPath } from "../../source-control/registry.js";
2
+ import type { AuthorizeFn } from "@jini-ai/core/contracts/events";
3
+ import type { DbOpsPort } from "@jini-ai/core/contracts/site/gated-mutations-ports";
4
+ import type { ObservabilityPort } from "@jini-ai/core/contracts/observability";
5
+ import type { CredentialSetConnectionInput as CustomProviderConnectionInput } from "@jini-ai/core/contracts/credentials";
6
+ import type { SourceControlProvider } from "../../source-control/site/provider-module.js";
7
+ import type { BackupRepositoryState } from "../../source-control/contracts.js";
8
+ import type { resolveDefaultForSourceControl } from "../../source-control/site/store.js";
9
+ import type { pickSourceControlProviderForApi } from "../../source-control/registry.js";
10
+ import type { SourceControlProviderId } from "@jini-ai/core/contracts/site/source-control-credentials";
11
+ import type { SiteImportBackend } from "./import-backend.js";
12
+ import type { SiteShareBackend } from "./share-backend.js";
13
+ import type { ShareDatabaseSanitizer } from "./share-preparation-steps.js";
14
+ import type { SiteBackupPlan as BaseBackupPlan, SiteBackupPlanStore } from "../plan-store.node.js";
15
+ import type { initialPushProgress, uploadBackupPlan, commitBackupPlan } from "./push-content.js";
16
+ import type { SiteBackupPushJobs, SiteBackupPushProgress } from "../push-jobs.js";
17
+ import { type formatByteSize, type skipOversizedFiles, type SiteBackupSources, type SiteBackupHostLimit, type SiteBackupInclude, type PlannedDiskFile, type SkippedSiteBackupFile, type SiteBackupScope, type DatabaseSnapshotResult, type CollectedSiteBackupFiles, type SiteBackupLimitsResult, type ReadPlannedFileResult } from "./sources.js";
18
+ import type { CredentialWarning } from "./credential-warnings.js";
19
+ export { PLAN_TOOL_ID, SITE_BACKUP_PUSH_TOOL_ID, PUSH_WAIT_MS } from "./backup-service.shared.js";
20
+ /**
21
+ * @file The site-backup service behind the agent tools `site_backup_plan` (read-only) and
22
+ * `site_backup_push` (authorized, immediate) AND the admin Git backup route
23
+ * (`admin-http/routes/system/site-backups.ts`): one code path, so the screen and the assistant run
24
+ * the same checks under the same permissions. Together they put the site's content — the database, media, themes, plugins
25
+ * and settings — into ONE folder of a private repository on a plugin-provided git host, in one commit, through a saved
26
+ * custom credential (the same credentials `custom_credential_write_files` uses).
27
+ *
28
+ * Why two calls: the plan does every check that can fail (credential, repository visibility and
29
+ * permissions, branch, folder, database snapshot, sizes) and returns what WOULD be written, so the
30
+ * model can report the planned backup. The push uploads exactly what was planned: the database snapshot is
31
+ * held in memory with the plan (`plan-content.ts`), and each disk file is re-read and refused if it
32
+ * changed since (`readPlannedFile`).
33
+ *
34
+ * A large backup outlasts one tool call: the push runs as a job (`push-jobs.ts`), the call waits for
35
+ * it up to {@link PUSH_WAIT_MS} and otherwise returns its progress; calling the push again with the
36
+ * same planId keeps waiting on the same job. The upload itself is Jini's `backup/site/push-content`.
37
+ *
38
+ * Safety rules, each re-checked at push time where the world can change in between:
39
+ * - The database is the share projection ({@link captureBackupDatabase}): content, themes and
40
+ * settings, never accounts, members, RBAC, sessions or secrets.
41
+ * - Private repositories only (public and "internal" both refused), because the database holds
42
+ * unpublished content. Re-checked before pushing.
43
+ * - Never a force push, and never a surprise overwrite: the push commits on the PLAN's tip, and a
44
+ * branch that moved since is refused (`DIVERGED_BRANCH`) before a single blob is uploaded, and
45
+ * again by the host itself on the non-force ref update.
46
+ * - The token never leaves the server: not in any result, dialog or log line.
47
+ *
48
+ * Credential errors are split so an operator can act on them: a label with no saved row is
49
+ * `CREDENTIAL_NOT_FOUND` (with the labels that do exist), and a saved row this server cannot decrypt
50
+ * is `CREDENTIAL_UNREADABLE`, whose message says WHICH problem it is from THIS SITE's own site key
51
+ * status (`inspectSiteKeyMaterial` run over `siteKeySourcesForSiteDir`'s site-aware source ordering —
52
+ * site-key plan §A3b, the same composed helper the admin site key route reuses, so an active
53
+ * per-site key file is never mistaken for "no site key" — see `unreadableCredentialMessage`) —
54
+ * never from the decrypt error's own text, which can quote plaintext. (The same "unreadable reads as
55
+ * missing" confusion `ADS-memory/.local-artifacts/reports/2026-09-21-byok-triage.md` traced for BYOK
56
+ * keys.)
57
+ *
58
+ * Out of scope: restoring from a backup, and scheduled backups.
59
+ */
60
+ export declare const SITE_BACKUP_DOMAIN = "site-backup";
61
+ /** The one permission that names this feature. Not in any built-in role but the owner's `*`. */
62
+ export declare const PUSH_PERMISSION = "site-backup.push";
63
+ /** What one plan or push call carries: the caller's raw input, who is calling, and when to stop. A
64
+ * tool's `ToolExecutionContext` is one; the admin route builds one from the request. */
65
+ export interface SiteBackupCall {
66
+ readonly input: unknown;
67
+ readonly principal: {
68
+ readonly id: string;
69
+ };
70
+ readonly signal: AbortSignal;
71
+ }
72
+ /** The slice of the route-deps bag these tools read. Structural, so this module never imports
73
+ * `server/routes/types`. */
74
+ export interface SiteBackupRequestDeps<TSource extends SiteBackupSources = SiteBackupSources, TContent extends SiteBackupRepositoryPlanContent = SiteBackupRepositoryPlanContent> {
75
+ readonly authorize: AuthorizeFn;
76
+ readonly workspaceId: string;
77
+ readonly siteImportBackend?: SiteImportBackend;
78
+ readonly siteShareBackend?: SiteShareBackend;
79
+ readonly sourceControlCredentialSetRepo?: unknown;
80
+ readonly observability?: ObservabilityPort;
81
+ readonly dbOps: DbOpsPort;
82
+ readonly siteBackupSources?: TSource | undefined;
83
+ readonly siteBackupSanitize?: ShareDatabaseSanitizer;
84
+ readonly siteBackupPlanStore?: Pick<SiteBackupPlanStore<TContent>, "save" | "take">;
85
+ readonly siteBackupSiteKeyStatus?: () => {
86
+ active: boolean;
87
+ invalid?: boolean;
88
+ };
89
+ readonly siteBackupFailureLog?: (line: string) => void;
90
+ readonly siteBackupNow?: () => Date;
91
+ readonly siteBackupPushJobs?: SiteBackupPushJobs<PushResult>;
92
+ readonly siteBackupPushWaitMs?: number;
93
+ readonly siteBackupSleep?: (ms: number) => Promise<void>;
94
+ }
95
+ export interface SiteBackupToolDeps<TSource extends SiteBackupSources = SiteBackupSources, TContent extends SiteBackupRepositoryPlanContent = SiteBackupRepositoryPlanContent, TRequest extends SiteBackupRequestDeps<TSource, TContent> = SiteBackupRequestDeps<TSource, TContent>> {
96
+ readonly request: TRequest;
97
+ deps: {
98
+ findReservedPath: typeof findReservedPath;
99
+ CustomCredentialValidationError: new (message: string) => Error;
100
+ normalizeWriteFilePath(required: {
101
+ rawPath: string;
102
+ }): string;
103
+ validateBranch(required: {
104
+ value: string;
105
+ }): string;
106
+ validateCommitMessage(required: {
107
+ value: string;
108
+ }): string;
109
+ buildAuthorizationHeader(required: {
110
+ connection: CustomProviderConnectionInput;
111
+ schemes: readonly never[];
112
+ }): string;
113
+ };
114
+ readonly siteBackupSanitize: ShareDatabaseSanitizer;
115
+ readonly siteBackupPlanStore: Pick<SiteBackupPlanStore<TContent>, "save" | "take">;
116
+ readonly siteBackupSiteKeyStatus: (required: {
117
+ siteDir: string;
118
+ }) => {
119
+ active: boolean;
120
+ invalid?: boolean;
121
+ };
122
+ readonly serverSiteKeyStatus: () => {
123
+ active: boolean;
124
+ invalid?: boolean;
125
+ };
126
+ readonly siteBackupFailureLog: (line: string) => void;
127
+ readonly siteBackupNow: () => Date;
128
+ readonly siteBackupPushJobs: SiteBackupPushJobs<PushResult>;
129
+ readonly listCustomCredentials: (required: {
130
+ deps: TRequest;
131
+ }, input: {
132
+ workspaceId: string;
133
+ }) => Promise<readonly {
134
+ label: string;
135
+ baseUrl: string;
136
+ }[]>;
137
+ readonly resolveCustomCredentialByLabel: (required: {
138
+ deps: TRequest;
139
+ }, input: {
140
+ workspaceId: string;
141
+ label: string;
142
+ }) => Promise<{
143
+ baseUrl: string;
144
+ connection: CustomProviderConnectionInput;
145
+ } | null>;
146
+ readonly resolveDefaultForSourceControl: (required: {
147
+ deps: TRequest;
148
+ }, input: {
149
+ workspaceId: string;
150
+ providerId: SourceControlProviderId;
151
+ }) => ReturnType<typeof resolveDefaultForSourceControl>;
152
+ readonly isSourceControlCredentialSecretStoreUnconfiguredError: (error: unknown) => boolean;
153
+ readonly isCustomCredentialSecretStoreUnconfiguredError: (error: unknown) => boolean;
154
+ readonly credentialMessages: Record<"active" | "invalid" | "missing", (required: {
155
+ label: string;
156
+ }) => string>;
157
+ readonly buildSourceControlProviders: (required: {
158
+ deps: TRequest;
159
+ }, optional: Record<string, never>) => Promise<{
160
+ providers: readonly SourceControlProvider[];
161
+ refusals: readonly string[];
162
+ noProviderMessage: string;
163
+ }>;
164
+ readonly pickSourceControlProviderForApi: typeof pickSourceControlProviderForApi<SourceControlProvider>;
165
+ readonly completePlanContent: (required: {
166
+ content: SiteBackupRepositoryPlanContent;
167
+ sources: TSource;
168
+ }, optional: Record<string, never>) => TContent;
169
+ readonly validateRepositoryTarget: (required: {
170
+ owner: unknown;
171
+ repo: unknown;
172
+ }, optional: {
173
+ validateTarget?: SourceControlProvider["validateTarget"];
174
+ }) => {
175
+ owner: string;
176
+ repo: string;
177
+ };
178
+ readonly siteFolderName: (required: {
179
+ siteDir: string;
180
+ }) => string;
181
+ readonly readConfigText: (required: {
182
+ siteDir: string;
183
+ }) => Promise<string>;
184
+ readonly runtimeSchemaVersion: () => {
185
+ index: number;
186
+ tag: string;
187
+ };
188
+ readonly defaultCommitMessage: (required: {
189
+ siteName: string;
190
+ createdAt: string;
191
+ }) => string;
192
+ readonly manifestName: string;
193
+ readonly captureDatabaseSnapshot: (required: {
194
+ dbOps: DbOpsPort;
195
+ scopeId: string;
196
+ }) => Promise<DatabaseSnapshotResult>;
197
+ readonly collectSiteBackupFiles: (required: {
198
+ sources: TSource;
199
+ include: SiteBackupInclude;
200
+ }) => Promise<CollectedSiteBackupFiles>;
201
+ readonly checkSiteBackupLimits: (required: {
202
+ files: readonly {
203
+ path: string;
204
+ bytes: number;
205
+ }[];
206
+ host: SiteBackupHostLimit;
207
+ }) => SiteBackupLimitsResult;
208
+ readonly readPlannedFile: (file: PlannedDiskFile) => Promise<ReadPlannedFileResult>;
209
+ readonly requireShareSecretFree: (required: {
210
+ path: string;
211
+ bytes: Uint8Array;
212
+ }, optional: {
213
+ credentialWarnings: CredentialWarning[];
214
+ }) => unknown;
215
+ readonly backupPushUploadPolicy: (required: {
216
+ plan: SiteBackupPlan<TContent>;
217
+ }) => Pick<Parameters<typeof uploadBackupPlan>[0], "databasePath" | "readPlannedFile" | "buildManifest" | "cancelled">;
218
+ readonly initialPushProgress: typeof initialPushProgress;
219
+ readonly uploadBackupPlan: typeof uploadBackupPlan;
220
+ readonly commitBackupPlan: typeof commitBackupPlan;
221
+ readonly formatByteSize: typeof formatByteSize;
222
+ readonly skipOversizedFiles: typeof skipOversizedFiles;
223
+ readonly siteBackupDatabasePath: string;
224
+ readonly siteBackupScopes: readonly SiteBackupScope[];
225
+ readonly cancelled: Parameters<typeof uploadBackupPlan>[0]["cancelled"];
226
+ }
227
+ export interface SiteBackupRepositoryPlanContent {
228
+ readonly target?: {
229
+ kind: "repository";
230
+ };
231
+ readonly credentialLabel: string;
232
+ readonly owner: string;
233
+ readonly repo: string;
234
+ readonly folder: string;
235
+ readonly commitMessage: string;
236
+ readonly repository: BackupRepositoryState;
237
+ readonly include: SiteBackupInclude;
238
+ readonly database: {
239
+ bytes: Buffer;
240
+ watermarkAtCapture: number;
241
+ } | null;
242
+ readonly files: readonly PlannedDiskFile[];
243
+ readonly skipped: readonly SkippedSiteBackupFile[];
244
+ readonly scopeNotes: Partial<Record<SiteBackupScope, string>>;
245
+ readonly totalBytes: number;
246
+ readonly site: {
247
+ name: string;
248
+ folderName: string;
249
+ };
250
+ readonly schema: {
251
+ index: number;
252
+ tag: string;
253
+ };
254
+ readonly createdAt: string;
255
+ readonly credentialWarnings?: readonly CredentialWarning[];
256
+ }
257
+ export type SiteBackupPlan<TContent extends SiteBackupRepositoryPlanContent = SiteBackupRepositoryPlanContent> = BaseBackupPlan<TContent>;
258
+ /** Every refusal both tools return, as `{code, message}`. */
259
+ export interface Refusal {
260
+ readonly ok: false;
261
+ readonly code: string;
262
+ readonly message: string;
263
+ }
264
+ /**
265
+ * The plan (`site_backup_plan` and `POST …/site-backups/plan`): every check that can fail, in the order that wastes the least — validate, permissions,
266
+ * credential, repository (so a public repository is refused before a snapshot is taken), database
267
+ * snapshot, disk files, limits — then the in-memory plan.
268
+ *
269
+ * @complexity O(site files) for the walk, O(database size) for the snapshot, four GETs.
270
+ */
271
+ export declare function planSiteBackup<TSource extends SiteBackupSources, TContent extends SiteBackupRepositoryPlanContent, TRequest extends SiteBackupRequestDeps<TSource, TContent>>(required: {
272
+ deps: SiteBackupToolDeps<TSource, TContent, TRequest>;
273
+ call: SiteBackupCall;
274
+ }, _optional?: Record<string, never>): Promise<unknown>;
275
+ export type PushResult = {
276
+ pushed: true;
277
+ commitSha: string;
278
+ commitUrl: string;
279
+ repository: string;
280
+ branch: string;
281
+ folder: string;
282
+ filesWritten: number;
283
+ totalBytes: number;
284
+ credentialWarnings?: readonly CredentialWarning[];
285
+ } | {
286
+ pushed: false;
287
+ cancelled: true;
288
+ } | {
289
+ pushed: false;
290
+ cancelled: false;
291
+ reason: "expired" | "abandoned";
292
+ } | {
293
+ pushed: false;
294
+ cancelled: false;
295
+ inProgress: true;
296
+ planId: string;
297
+ progress: SiteBackupPushProgress;
298
+ message: string;
299
+ } | {
300
+ pushed: false;
301
+ cancelled: false;
302
+ code: string;
303
+ message: string;
304
+ };
305
+ /**
306
+ * The push (`site_backup_push` and `POST …/site-backups/push`): consume the principal-bound plan and start its job — or, for a planId whose job is
307
+ * still running, wait on that job — then report its outcome or its progress.
308
+ *
309
+ * @complexity O(1) plan and job lookup; then see {@link pushPlannedBackup}.
310
+ */
311
+ export declare function pushSiteBackup<TSource extends SiteBackupSources, TContent extends SiteBackupRepositoryPlanContent, TRequest extends SiteBackupRequestDeps<TSource, TContent>>(required: {
312
+ deps: SiteBackupToolDeps<TSource, TContent, TRequest>;
313
+ call: SiteBackupCall;
314
+ }, optional?: {
315
+ waitMs?: number;
316
+ }): Promise<PushResult>;
317
+ export declare function createSiteBackupService<TSource extends SiteBackupSources, TContent extends SiteBackupRepositoryPlanContent, TRequest extends SiteBackupRequestDeps<TSource, TContent> = SiteBackupRequestDeps<TSource, TContent>>(required: Omit<SiteBackupToolDeps<TSource, TContent, TRequest>, "request" | "siteBackupPushJobs"> & {
318
+ createSiteBackupPushJobs: () => SiteBackupPushJobs<PushResult>;
319
+ }, _optional?: Record<string, never>): {
320
+ planSiteBackup: ({ deps, call }: {
321
+ deps: TRequest;
322
+ call: SiteBackupCall;
323
+ }, options?: Record<string, never>) => Promise<unknown>;
324
+ pushSiteBackup: ({ deps, call }: {
325
+ deps: TRequest;
326
+ call: SiteBackupCall;
327
+ }, options?: {
328
+ waitMs?: number;
329
+ }) => Promise<PushResult>;
330
+ };
331
+ //# sourceMappingURL=backup-service.d.ts.map