@jini-ai/devops 0.7.3-next.1 → 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 (391) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +16 -0
  3. package/dist/backup/site/archive-extensions.d.ts +73 -0
  4. package/dist/backup/site/archive-extensions.js +129 -0
  5. package/dist/backup/site/archive-manifest.d.ts +85 -0
  6. package/dist/backup/site/archive-manifest.js +176 -0
  7. package/dist/backup/site/archive-media.d.ts +121 -0
  8. package/dist/backup/site/archive-media.js +93 -0
  9. package/dist/backup/site/backup-service.credentials.d.ts +31 -0
  10. package/dist/backup/site/backup-service.credentials.js +161 -0
  11. package/dist/backup/site/backup-service.d.ts +331 -0
  12. package/dist/backup/site/backup-service.js +125 -0
  13. package/dist/backup/site/backup-service.plan.d.ts +64 -0
  14. package/dist/backup/site/backup-service.plan.js +207 -0
  15. package/dist/backup/site/backup-service.push.d.ts +29 -0
  16. package/dist/backup/site/backup-service.push.js +82 -0
  17. package/dist/backup/site/backup-service.shared.d.ts +40 -0
  18. package/dist/backup/site/backup-service.shared.js +37 -0
  19. package/dist/backup/site/bundled-export-file-policy.d.ts +38 -0
  20. package/dist/backup/site/bundled-export-file-policy.js +40 -0
  21. package/dist/backup/site/credential-warnings.d.ts +41 -0
  22. package/dist/backup/site/credential-warnings.js +50 -0
  23. package/dist/backup/site/import-backend-steps.d.ts +167 -0
  24. package/dist/backup/site/import-backend-steps.js +170 -0
  25. package/dist/backup/site/import-backend.d.ts +167 -0
  26. package/dist/backup/site/import-backend.js +298 -0
  27. package/dist/backup/site/import-database.d.ts +118 -0
  28. package/dist/backup/site/import-database.js +167 -0
  29. package/dist/backup/site/import-index/admission.d.ts +54 -0
  30. package/dist/backup/site/import-index/admission.js +46 -0
  31. package/dist/backup/site/import-index/backfill.d.ts +106 -0
  32. package/dist/backup/site/import-index/backfill.js +137 -0
  33. package/dist/backup/site/import-index/errors.d.ts +28 -0
  34. package/dist/backup/site/import-index/errors.js +38 -0
  35. package/dist/backup/site/import-index/migrations/checksums.d.ts +4 -0
  36. package/dist/backup/site/import-index/migrations/checksums.js +4 -0
  37. package/dist/backup/site/import-index/migrations/site-imports-v1.d.ts +2 -0
  38. package/dist/backup/site/import-index/migrations/site-imports-v1.js +10 -0
  39. package/dist/backup/site/import-index/mode.d.ts +191 -0
  40. package/dist/backup/site/import-index/mode.js +272 -0
  41. package/dist/backup/site/import-index/open.d.ts +40 -0
  42. package/dist/backup/site/import-index/open.js +87 -0
  43. package/dist/backup/site/import-index/paging.d.ts +28 -0
  44. package/dist/backup/site/import-index/paging.js +66 -0
  45. package/dist/backup/site/import-index/payload-namespace.d.ts +80 -0
  46. package/dist/backup/site/import-index/payload-namespace.js +156 -0
  47. package/dist/backup/site/import-index/rows.d.ts +32 -0
  48. package/dist/backup/site/import-index/rows.js +61 -0
  49. package/dist/backup/site/import-index/schema.d.ts +8 -0
  50. package/dist/backup/site/import-index/schema.js +31 -0
  51. package/dist/backup/site/import-index/store.d.ts +27 -0
  52. package/dist/backup/site/import-index/store.js +33 -0
  53. package/dist/backup/site/import-index/sweep.d.ts +10 -0
  54. package/dist/backup/site/import-index/sweep.js +26 -0
  55. package/dist/backup/site/import-keep-off.d.ts +128 -0
  56. package/dist/backup/site/import-keep-off.js +204 -0
  57. package/dist/backup/site/import-plugin-state.d.ts +74 -0
  58. package/dist/backup/site/import-plugin-state.js +67 -0
  59. package/dist/backup/site/import-registry.d.ts +110 -0
  60. package/dist/backup/site/import-registry.js +205 -0
  61. package/dist/backup/site/import-restore-placement.d.ts +94 -0
  62. package/dist/backup/site/import-restore-placement.js +158 -0
  63. package/dist/backup/site/import-restore.d.ts +111 -0
  64. package/dist/backup/site/import-restore.js +120 -0
  65. package/dist/backup/site/import-verifier-inventory.d.ts +137 -0
  66. package/dist/backup/site/import-verifier-inventory.js +236 -0
  67. package/dist/backup/site/import-verifier-projection.d.ts +78 -0
  68. package/dist/backup/site/import-verifier-projection.js +100 -0
  69. package/dist/backup/site/import-verifier.d.ts +126 -0
  70. package/dist/backup/site/import-verifier.js +53 -0
  71. package/dist/backup/site/owned-temp-root.d.ts +12 -0
  72. package/dist/backup/site/owned-temp-root.js +2 -0
  73. package/dist/backup/site/package-file-inventory.d.ts +63 -0
  74. package/dist/backup/site/package-file-inventory.js +56 -0
  75. package/dist/backup/site/push-content.d.ts +70 -0
  76. package/dist/backup/site/push-content.js +56 -0
  77. package/dist/backup/site/react/ShowMoreImports.d.ts +21 -0
  78. package/dist/backup/site/react/ShowMoreImports.js +8 -0
  79. package/dist/backup/site/saved-keys-port.d.ts +47 -0
  80. package/dist/backup/site/saved-keys-port.js +3 -0
  81. package/dist/backup/site/saved-keys.d.ts +25 -0
  82. package/dist/backup/site/saved-keys.js +38 -0
  83. package/dist/backup/site/share-backend.d.ts +243 -0
  84. package/dist/backup/site/share-backend.js +284 -0
  85. package/dist/backup/site/share-database/projection.d.ts +195 -0
  86. package/dist/backup/site/share-database/projection.js +90 -0
  87. package/dist/backup/site/share-database/projection.media.d.ts +38 -0
  88. package/dist/backup/site/share-database/projection.media.js +179 -0
  89. package/dist/backup/site/share-database/projection.tables.d.ts +46 -0
  90. package/dist/backup/site/share-database/projection.tables.js +193 -0
  91. package/dist/backup/site/share-expiry.d.ts +75 -0
  92. package/dist/backup/site/share-expiry.js +49 -0
  93. package/dist/backup/site/share-export-failure.d.ts +17 -0
  94. package/dist/backup/site/share-export-failure.js +16 -0
  95. package/dist/backup/site/share-file-policy.d.ts +60 -0
  96. package/dist/backup/site/share-file-policy.js +146 -0
  97. package/dist/backup/site/share-hosting.d.ts +107 -0
  98. package/dist/backup/site/share-hosting.js +148 -0
  99. package/dist/backup/site/share-preparation-steps.d.ts +180 -0
  100. package/dist/backup/site/share-preparation-steps.js +109 -0
  101. package/dist/backup/site/share-preparation.d.ts +122 -0
  102. package/dist/backup/site/share-preparation.js +43 -0
  103. package/dist/backup/site/share-refusal.d.ts +21 -0
  104. package/dist/backup/site/share-refusal.js +20 -0
  105. package/dist/backup/site/share-registry.d.ts +124 -0
  106. package/dist/backup/site/share-registry.js +219 -0
  107. package/dist/backup/site/share-retention.d.ts +62 -0
  108. package/dist/backup/site/share-retention.js +126 -0
  109. package/dist/backup/site/share-service.d.ts +128 -0
  110. package/dist/backup/site/share-service.js +194 -0
  111. package/dist/backup/site/share-zip.d.ts +115 -0
  112. package/dist/backup/site/share-zip.js +144 -0
  113. package/dist/backup/site/sources.d.ts +344 -0
  114. package/dist/backup/site/sources.js +595 -0
  115. package/dist/backup/site/static-copy.d.ts +122 -0
  116. package/dist/backup/site/static-copy.js +165 -0
  117. package/dist/backup/site/static-download-html.d.ts +76 -0
  118. package/dist/backup/site/static-download-html.js +149 -0
  119. package/dist/backup/site/static-download-landing.d.ts +52 -0
  120. package/dist/backup/site/static-download-landing.js +95 -0
  121. package/dist/backup/site/static-download-layout.d.ts +96 -0
  122. package/dist/backup/site/static-download-layout.js +325 -0
  123. package/dist/backup/site/static-export-selection.d.ts +50 -0
  124. package/dist/backup/site/static-export-selection.js +76 -0
  125. package/dist/backup/site/static-site-packager.d.ts +42 -0
  126. package/dist/backup/site/static-site-packager.js +32 -0
  127. package/dist/backup/site/tool-registrations.d.ts +74 -0
  128. package/dist/backup/site/tool-registrations.js +201 -0
  129. package/dist/checks/complexity-debt.d.ts +100 -0
  130. package/dist/checks/complexity-debt.js +131 -0
  131. package/dist/checks/coverage/diff.js +5 -1
  132. package/dist/checks/env-access.d.ts +14 -1
  133. package/dist/checks/env-access.js +92 -6
  134. package/dist/checks/live-verify-checks.d.ts +29 -0
  135. package/dist/checks/live-verify-checks.js +30 -0
  136. package/dist/checks/quality-gates.d.ts +137 -0
  137. package/dist/checks/quality-gates.js +209 -0
  138. package/dist/core/deploy-types.d.ts +2 -0
  139. package/dist/deploy/admin-http/site-update-status.d.ts +8 -0
  140. package/dist/deploy/admin-http/site-update-status.js +15 -0
  141. package/dist/deploy/host-kit.d.ts +3 -0
  142. package/dist/deploy/index.d.ts +6 -0
  143. package/dist/deploy/index.js +6 -0
  144. package/dist/deploy/ops-runner.js +7 -0
  145. package/dist/deploy/ops-tool-contracts.d.ts +10 -1
  146. package/dist/deploy/react/Deployment.d.ts +37 -0
  147. package/dist/deploy/react/Deployment.js +94 -0
  148. package/dist/deploy/react/DockerfileTab.d.ts +72 -0
  149. package/dist/deploy/react/DockerfileTab.js +131 -0
  150. package/dist/deploy/react/HistoryTab.d.ts +43 -0
  151. package/dist/deploy/react/HistoryTab.js +12 -0
  152. package/dist/deploy/react/OverviewTab.d.ts +60 -0
  153. package/dist/deploy/react/OverviewTab.js +75 -0
  154. package/dist/deploy/react/PublishRunResult.d.ts +5 -1
  155. package/dist/deploy/react/PublishRunResult.js +4 -4
  156. package/dist/deploy/react/SiteUpdateNotice.d.ts +22 -0
  157. package/dist/deploy/react/SiteUpdateNotice.js +25 -0
  158. package/dist/deploy/react/StaticCredentialFields.d.ts +36 -0
  159. package/dist/deploy/react/StaticCredentialFields.js +63 -0
  160. package/dist/deploy/react/StaticCredentialSteps.d.ts +23 -0
  161. package/dist/deploy/react/StaticCredentialSteps.js +155 -0
  162. package/dist/deploy/react/StaticExportCard.d.ts +11 -0
  163. package/dist/deploy/react/StaticExportCard.js +97 -0
  164. package/dist/deploy/react/StaticPublishCredentials.d.ts +50 -0
  165. package/dist/deploy/react/StaticPublishCredentials.js +77 -0
  166. package/dist/deploy/react/StaticPublishForm.d.ts +12 -0
  167. package/dist/deploy/react/StaticPublishForm.js +91 -0
  168. package/dist/deploy/react/StaticSiteTab.d.ts +207 -0
  169. package/dist/deploy/react/StaticSiteTab.js +117 -0
  170. package/dist/deploy/react/deployment-visuals.d.ts +207 -0
  171. package/dist/deploy/react/deployment-visuals.js +101 -0
  172. package/dist/deploy/react/download-dockerfile.d.ts +14 -0
  173. package/dist/deploy/react/download-dockerfile.js +15 -0
  174. package/dist/deploy/react/hooks/publish-credential-draft.d.ts +33 -0
  175. package/dist/deploy/react/hooks/publish-credential-draft.js +54 -0
  176. package/dist/deploy/react/hooks/publish-credential-selection.d.ts +13 -0
  177. package/dist/deploy/react/hooks/publish-credential-selection.js +34 -0
  178. package/dist/deploy/react/hooks/publish-credential-writes.d.ts +20 -0
  179. package/dist/deploy/react/hooks/publish-credential-writes.js +99 -0
  180. package/dist/deploy/react/hooks/static-publish-actions.d.ts +10 -0
  181. package/dist/deploy/react/hooks/static-publish-actions.js +62 -0
  182. package/dist/deploy/react/hooks/static-publish-form.hooks.d.ts +38 -0
  183. package/dist/deploy/react/hooks/static-publish-form.hooks.js +103 -0
  184. package/dist/deploy/react/hooks/static-publish-run.hooks.d.ts +28 -0
  185. package/dist/deploy/react/hooks/static-publish-run.hooks.js +92 -0
  186. package/dist/deploy/react/hooks/use-dockerfile-source.hooks.d.ts +148 -0
  187. package/dist/deploy/react/hooks/use-dockerfile-source.hooks.js +155 -0
  188. package/dist/deploy/react/hooks/use-publish-credentials.hooks.d.ts +268 -0
  189. package/dist/deploy/react/hooks/use-publish-credentials.hooks.js +52 -0
  190. package/dist/deploy/react/hooks/use-static-export.hooks.d.ts +128 -0
  191. package/dist/deploy/react/hooks/use-static-export.hooks.js +159 -0
  192. package/dist/deploy/react/hooks/use-static-publish.hooks.d.ts +208 -0
  193. package/dist/deploy/react/hooks/use-static-publish.hooks.js +48 -0
  194. package/dist/deploy/react/index.d.ts +4 -0
  195. package/dist/deploy/react/index.js +2 -0
  196. package/dist/deploy/react/rules.d.ts +363 -0
  197. package/dist/deploy/react/rules.js +314 -0
  198. package/dist/deploy/react/use-deployment-overview.hooks.d.ts +41 -0
  199. package/dist/deploy/react/use-deployment-overview.hooks.js +11 -0
  200. package/dist/deploy/site/agent-tools.d.ts +42 -0
  201. package/dist/deploy/site/agent-tools.js +119 -0
  202. package/dist/deploy/site/deploy-config-registry.d.ts +155 -0
  203. package/dist/deploy/site/deploy-config-registry.js +124 -0
  204. package/dist/deploy/site/deploy-config.d.ts +97 -0
  205. package/dist/deploy/site/deploy-config.js +115 -0
  206. package/dist/deploy/site/deploy-ops/agent-tools.d.ts +22 -0
  207. package/dist/deploy/site/deploy-ops/agent-tools.js +76 -0
  208. package/dist/deploy/site/deploy-ops/registry.d.ts +134 -0
  209. package/dist/deploy/site/deploy-ops/registry.js +106 -0
  210. package/dist/deploy/site/deploy-ops/run-ops.d.ts +66 -0
  211. package/dist/deploy/site/deploy-ops/run-ops.js +34 -0
  212. package/dist/deploy/site/deploy-ops/secret-confirm.d.ts +36 -0
  213. package/dist/deploy/site/deploy-ops/secret-confirm.js +27 -0
  214. package/dist/deploy/site/deploy-targets/host-kit.d.ts +28 -0
  215. package/dist/deploy/site/deploy-targets/host-kit.js +120 -0
  216. package/dist/deploy/site/deploy-targets/registry.d.ts +157 -0
  217. package/dist/deploy/site/deploy-targets/registry.js +132 -0
  218. package/dist/deploy/site/deploy-targets/types.d.ts +27 -0
  219. package/dist/deploy/site/deploy-targets/types.js +2 -0
  220. package/dist/deploy/site/dockerfile.d.ts +137 -0
  221. package/dist/deploy/site/dockerfile.js +101 -0
  222. package/dist/deploy/site/export-run.d.ts +137 -0
  223. package/dist/deploy/site/export-run.js +152 -0
  224. package/dist/deploy/site/ports.d.ts +115 -0
  225. package/dist/deploy/site/ports.js +2 -0
  226. package/dist/deploy/site/publish-agent-tools.d.ts +18 -0
  227. package/dist/deploy/site/publish-agent-tools.js +120 -0
  228. package/dist/deploy/site/publish-candidate.d.ts +26 -0
  229. package/dist/deploy/site/publish-candidate.js +37 -0
  230. package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.d.ts +78 -0
  231. package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.js +88 -0
  232. package/dist/deploy/site/publish-credentials/compatibility-port.d.ts +38 -0
  233. package/dist/deploy/site/publish-credentials/compatibility-port.js +19 -0
  234. package/dist/deploy/site/publish-credentials/execution-mode.d.ts +43 -0
  235. package/dist/deploy/site/publish-credentials/execution-mode.js +19 -0
  236. package/dist/deploy/site/publish-credentials/store-owner.d.ts +11 -0
  237. package/dist/deploy/site/publish-credentials/store-owner.js +9 -0
  238. package/dist/deploy/site/publish-credentials/store-resolution.d.ts +55 -0
  239. package/dist/deploy/site/publish-credentials/store-resolution.js +100 -0
  240. package/dist/deploy/site/publish-credentials/store-validation.d.ts +68 -0
  241. package/dist/deploy/site/publish-credentials/store-validation.js +182 -0
  242. package/dist/deploy/site/publish-credentials/store.d.ts +322 -0
  243. package/dist/deploy/site/publish-credentials/store.js +372 -0
  244. package/dist/deploy/site/publish-credentials/types.d.ts +85 -0
  245. package/dist/deploy/site/publish-credentials/types.js +2 -0
  246. package/dist/deploy/site/publish-tool-capabilities.d.ts +123 -0
  247. package/dist/deploy/site/publish-tool-capabilities.js +175 -0
  248. package/dist/deploy/site/publish-tool-credential.d.ts +48 -0
  249. package/dist/deploy/site/publish-tool-credential.js +284 -0
  250. package/dist/deploy/site/publish-tool-deps.d.ts +205 -0
  251. package/dist/deploy/site/publish-tool-deps.js +15 -0
  252. package/dist/deploy/site/publish-tool-execution.d.ts +78 -0
  253. package/dist/deploy/site/publish-tool-execution.js +313 -0
  254. package/dist/deploy/site/publish-tool-schema.d.ts +29 -0
  255. package/dist/deploy/site/publish-tool-schema.js +38 -0
  256. package/dist/deploy/site/static-publish/adapter-export.d.ts +54 -0
  257. package/dist/deploy/site/static-publish/adapter-export.js +89 -0
  258. package/dist/deploy/site/static-publish/adapter-plan.d.ts +99 -0
  259. package/dist/deploy/site/static-publish/adapter-plan.js +112 -0
  260. package/dist/deploy/site/static-publish/adapter.d.ts +182 -0
  261. package/dist/deploy/site/static-publish/adapter.js +321 -0
  262. package/dist/deploy/site/static-publish/admin-publish-read.d.ts +209 -0
  263. package/dist/deploy/site/static-publish/admin-publish-read.js +116 -0
  264. package/dist/deploy/site/static-publish/credentials.d.ts +110 -0
  265. package/dist/deploy/site/static-publish/credentials.js +290 -0
  266. package/dist/deploy/site/static-publish/domain-publish-rows.d.ts +25 -0
  267. package/dist/deploy/site/static-publish/domain-publish-rows.js +43 -0
  268. package/dist/deploy/site/static-publish/domain-publish-tool.d.ts +19 -0
  269. package/dist/deploy/site/static-publish/domain-publish-tool.js +111 -0
  270. package/dist/deploy/site/static-publish/inspection.d.ts +24 -0
  271. package/dist/deploy/site/static-publish/inspection.js +69 -0
  272. package/dist/deploy/site/static-publish/publish-history.d.ts +197 -0
  273. package/dist/deploy/site/static-publish/publish-history.js +153 -0
  274. package/dist/deploy/site/static-publish/publish-run.d.ts +156 -0
  275. package/dist/deploy/site/static-publish/publish-run.js +186 -0
  276. package/dist/deploy/site/static-publish/types.d.ts +165 -0
  277. package/dist/deploy/site/static-publish/types.js +2 -0
  278. package/dist/deploy/site/static-publish/verify.d.ts +217 -0
  279. package/dist/deploy/site/static-publish/verify.js +248 -0
  280. package/dist/deploy/site/tool-registrations.d.ts +97 -0
  281. package/dist/deploy/site/tool-registrations.js +130 -0
  282. package/dist/deploy/site/types.d.ts +51 -0
  283. package/dist/deploy/site/types.js +2 -0
  284. package/dist/deploy/site-update/check-for-update.d.ts +19 -0
  285. package/dist/deploy/site-update/check-for-update.js +19 -0
  286. package/dist/deploy/site-update/contracts.d.ts +161 -0
  287. package/dist/deploy/site-update/contracts.js +94 -0
  288. package/dist/deploy/site-update/desktop-site-update.d.ts +66 -0
  289. package/dist/deploy/site-update/desktop-site-update.js +43 -0
  290. package/dist/deploy/site-update/fake-site-update.d.ts +39 -0
  291. package/dist/deploy/site-update/fake-site-update.js +52 -0
  292. package/dist/deploy/site-update/run-site-update.d.ts +121 -0
  293. package/dist/deploy/site-update/run-site-update.js +219 -0
  294. package/dist/deploy/site-update/self-hosted-site-update.d.ts +71 -0
  295. package/dist/deploy/site-update/self-hosted-site-update.js +79 -0
  296. package/dist/deploy/target-contracts.d.ts +3 -0
  297. package/dist/deploy/tool.d.ts +5 -8
  298. package/dist/deploy/tool.js +6 -9
  299. package/dist/dns/binding-sweeper.d.ts +72 -0
  300. package/dist/dns/binding-sweeper.js +53 -0
  301. package/dist/dns/index.d.ts +1 -0
  302. package/dist/dns/index.js +1 -0
  303. package/dist/dns/site/binding.repo.d.ts +71 -0
  304. package/dist/dns/site/binding.repo.js +45 -0
  305. package/dist/dns/site/dns-changes.d.ts +90 -0
  306. package/dist/dns/site/dns-changes.js +271 -0
  307. package/dist/dns/site/dns-tools.d.ts +46 -0
  308. package/dist/dns/site/dns-tools.js +204 -0
  309. package/dist/dns/site/mail-dns-status.d.ts +111 -0
  310. package/dist/dns/site/mail-dns-status.js +190 -0
  311. package/dist/dns/site/mail-dns-tools.d.ts +33 -0
  312. package/dist/dns/site/mail-dns-tools.js +62 -0
  313. package/dist/dns/site/mail-requirements.d.ts +30 -0
  314. package/dist/dns/site/mail-requirements.js +78 -0
  315. package/dist/dns/site/tool-deps.d.ts +21 -0
  316. package/dist/dns/site/tool-deps.js +2 -0
  317. package/dist/dns/site/tools.d.ts +74 -0
  318. package/dist/dns/site/tools.js +124 -0
  319. package/dist/local-dev/bind-host.d.ts +80 -0
  320. package/dist/local-dev/bind-host.js +90 -0
  321. package/dist/local-dev/dev-proxy-upstream.d.ts +69 -0
  322. package/dist/local-dev/dev-proxy-upstream.js +63 -0
  323. package/dist/local-dev/index.d.ts +28 -0
  324. package/dist/local-dev/index.js +25 -0
  325. package/dist/packaging/electron/archive.d.ts +2 -9
  326. package/dist/packaging/electron/asar-adapter.d.ts +2 -1
  327. package/dist/packaging/electron/entry.d.ts +2 -0
  328. package/dist/packaging/electron/move-to-applications.d.ts +165 -0
  329. package/dist/packaging/electron/move-to-applications.js +162 -0
  330. package/dist/packaging/electron/policies.d.ts +33 -4
  331. package/dist/packaging/electron/policies.js +29 -10
  332. package/dist/packaging/electron/ports.d.ts +1 -6
  333. package/dist/packaging/electron/staging.d.ts +11 -2
  334. package/dist/packaging/electron/staging.js +15 -5
  335. package/dist/react/site-share-expiry/ShareExpiryControls.d.ts +29 -0
  336. package/dist/react/site-share-expiry/ShareExpiryControls.js +7 -0
  337. package/dist/react/site-share-expiry/index.d.ts +2 -0
  338. package/dist/react/site-share-expiry/index.js +2 -0
  339. package/dist/source-control/react/ProvidersTab.d.ts +98 -0
  340. package/dist/source-control/react/ProvidersTab.js +195 -0
  341. package/dist/source-control/react/SourceControl.d.ts +51 -0
  342. package/dist/source-control/react/SourceControl.js +61 -0
  343. package/dist/source-control/react/hooks/use-source-control-credentials.hooks.d.ts +128 -0
  344. package/dist/source-control/react/hooks/use-source-control-credentials.hooks.js +102 -0
  345. package/dist/source-control/react/rules.d.ts +167 -0
  346. package/dist/source-control/react/rules.js +125 -0
  347. package/dist/source-control/react/source-control-visuals.d.ts +75 -0
  348. package/dist/source-control/react/source-control-visuals.js +48 -0
  349. package/dist/source-control/site/agent-tools.d.ts +5 -0
  350. package/dist/source-control/site/agent-tools.js +30 -0
  351. package/dist/source-control/site/bundled-provider-registry.d.ts +33 -0
  352. package/dist/source-control/site/bundled-provider-registry.js +37 -0
  353. package/dist/source-control/site/commit-schema.d.ts +40 -0
  354. package/dist/source-control/site/commit-schema.js +29 -0
  355. package/dist/source-control/site/commit-target.d.ts +26 -0
  356. package/dist/source-control/site/commit-target.js +58 -0
  357. package/dist/source-control/site/credential-form.d.ts +36 -0
  358. package/dist/source-control/site/credential-form.js +102 -0
  359. package/dist/source-control/site/credential-setup.d.ts +107 -0
  360. package/dist/source-control/site/credential-setup.js +216 -0
  361. package/dist/source-control/site/provider-kit.d.ts +37 -0
  362. package/dist/source-control/site/provider-kit.js +35 -0
  363. package/dist/source-control/site/provider-module.d.ts +251 -0
  364. package/dist/source-control/site/provider-module.js +2 -0
  365. package/dist/source-control/site/saved-key-bindings.d.ts +4 -0
  366. package/dist/source-control/site/saved-key-bindings.js +4 -0
  367. package/dist/source-control/site/static-site-packager-port.d.ts +37 -0
  368. package/dist/source-control/site/static-site-packager-port.js +2 -0
  369. package/dist/source-control/site/store.d.ts +209 -0
  370. package/dist/source-control/site/store.js +374 -0
  371. package/dist/source-control/site/store.validation.d.ts +72 -0
  372. package/dist/source-control/site/store.validation.js +168 -0
  373. package/dist/source-control/site/tool-registrations.d.ts +190 -0
  374. package/dist/source-control/site/tool-registrations.js +379 -0
  375. package/dist/static-export/site/export-preflight.d.ts +48 -0
  376. package/dist/static-export/site/export-preflight.js +82 -0
  377. package/dist/static-export/site/media-original-urls.d.ts +57 -0
  378. package/dist/static-export/site/media-original-urls.js +109 -0
  379. package/dist/static-export/site/ports.d.ts +82 -0
  380. package/dist/static-export/site/ports.js +29 -0
  381. package/dist/static-export/site/public-origin-policy.d.ts +32 -0
  382. package/dist/static-export/site/public-origin-policy.js +68 -0
  383. package/dist/static-export/site/route-manifest.d.ts +65 -0
  384. package/dist/static-export/site/route-manifest.js +139 -0
  385. package/dist/static-export/site/site-exporter.d.ts +158 -0
  386. package/dist/static-export/site/site-exporter.js +112 -0
  387. package/dist/static-export/site/static-security-headers.d.ts +39 -0
  388. package/dist/static-export/site/static-security-headers.js +43 -0
  389. package/dist/static-export/site/theme-preview-manifest.d.ts +35 -0
  390. package/dist/static-export/site/theme-preview-manifest.js +28 -0
  391. package/package.json +912 -8
@@ -0,0 +1,161 @@
1
+ /**
2
+ * @file Vendor-neutral contract for updating a deployed site to a newer release from the site itself.
3
+ *
4
+ * Every platform (a hosted deploy, a desktop-made site, a self-hosted box) supplies the same four
5
+ * ports; `runSiteUpdate` owns the safety order (owner approval, backup, migration readiness gate,
6
+ * apply, live check, rollback). Nothing here touches the network: adapters do.
7
+ */
8
+ import type { IdGenerator } from '@jini-ai/core/primitives';
9
+ /** Options every port call accepts. */
10
+ export interface SiteUpdateCallOptions {
11
+ signal?: AbortSignal | undefined;
12
+ }
13
+ /** One published release as a feed reports it. `notes` is plain text the owner reads. */
14
+ export interface SiteRelease {
15
+ version: string;
16
+ notes: string;
17
+ }
18
+ /** What `checkForUpdate` reports when a newer release exists. */
19
+ export interface SiteUpdateAvailable {
20
+ latest: string;
21
+ notes: string;
22
+ }
23
+ /** The approved move. `fromVersion` is the version kept to roll back to. */
24
+ export interface SiteUpdatePlan {
25
+ fromVersion: string;
26
+ toVersion: string;
27
+ notes: string;
28
+ }
29
+ /** Result of the migration readiness gate. `reason` is plain words shown to the owner. */
30
+ export type MigrationReadiness = {
31
+ status: 'ok';
32
+ } | {
33
+ status: 'blocked';
34
+ reason: string;
35
+ };
36
+ /** Result of the post-deploy live check. */
37
+ export type SiteUpdateVerification = {
38
+ status: 'healthy';
39
+ } | {
40
+ status: 'unhealthy';
41
+ reason: string;
42
+ };
43
+ /**
44
+ * The owner's explicit OK for one specific target version. There is no default and no "always":
45
+ * a token for another version is refused, so an approval can never be replayed onto a later release.
46
+ */
47
+ export interface SiteUpdateApproval {
48
+ kind: 'owner-approval';
49
+ approvedBy: string;
50
+ toVersion: string;
51
+ }
52
+ /** Where the newest release is announced. */
53
+ export interface ReleaseFeedPort {
54
+ latestRelease(required: Record<string, never>, optional?: SiteUpdateCallOptions): Promise<SiteRelease | null>;
55
+ }
56
+ /** Makes a restorable backup of the running site before anything changes. */
57
+ export interface SiteBackupPort {
58
+ createBackup(required: {
59
+ fromVersion: string;
60
+ }, optional?: SiteUpdateCallOptions): Promise<{
61
+ backupId: string;
62
+ }>;
63
+ }
64
+ /** Options of {@link MigrationReadinessPort.check}: the backup just captured and the version it was taken of. */
65
+ export interface SiteUpdateReadinessOptions extends SiteUpdateCallOptions {
66
+ backupId?: string | undefined;
67
+ fromVersion?: string | undefined;
68
+ }
69
+ /** Answers whether stored data is ready for `toVersion` (pending migrations, incompatible schema). */
70
+ export interface MigrationReadinessPort {
71
+ check(required: {
72
+ toVersion: string;
73
+ }, optional?: SiteUpdateReadinessOptions): Promise<MigrationReadiness>;
74
+ }
75
+ /** The platform side: find, plan, deploy, check and undo an update. */
76
+ export interface SiteUpdatePort {
77
+ checkForUpdate(required: {
78
+ runningVersion: string;
79
+ }, optional?: SiteUpdateCallOptions): Promise<SiteUpdateAvailable | null>;
80
+ planUpdate(required: {
81
+ runningVersion: string;
82
+ update: SiteUpdateAvailable;
83
+ }, optional?: SiteUpdateCallOptions): Promise<SiteUpdatePlan>;
84
+ /** Triggers the platform deploy and waits until it has landed. `summary` says what the platform did. */
85
+ applyUpdate(required: {
86
+ plan: SiteUpdatePlan;
87
+ backupId: string;
88
+ }, optional?: SiteUpdateCallOptions): Promise<{
89
+ summary: string;
90
+ }>;
91
+ /** Checks the live site actually serves the new version and works. */
92
+ verifyUpdate(required: {
93
+ plan: SiteUpdatePlan;
94
+ }, optional?: SiteUpdateCallOptions): Promise<SiteUpdateVerification>;
95
+ /** Puts `to` (the kept previous version) back live; `backupId` lets the adapter restore data too. */
96
+ rollback(required: {
97
+ to: string;
98
+ backupId: string;
99
+ }, optional?: SiteUpdateCallOptions): Promise<void>;
100
+ }
101
+ /** The live check an adapter runs after the new version is up: does the site work on `expectedVersion`? */
102
+ export interface SiteHealthPort {
103
+ check(required: {
104
+ expectedVersion: string;
105
+ }, optional?: SiteUpdateCallOptions): Promise<SiteUpdateVerification>;
106
+ }
107
+ /** Puts the site's stored data back from a backup made by {@link SiteBackupPort}. */
108
+ export interface SiteDataRestorePort {
109
+ restore(required: {
110
+ backupId: string;
111
+ }, optional?: SiteUpdateCallOptions): Promise<void>;
112
+ }
113
+ export type SiteUpdateStep = 'approval' | 'backup' | 'readiness' | 'apply' | 'verify' | 'rollback';
114
+ export type SiteUpdateStepStatus = 'done' | 'refused' | 'blocked' | 'failed' | 'skipped';
115
+ export type SiteUpdateOutcome = 'updated' | 'refused' | 'blocked' | 'aborted' | 'failed' | 'rolled-back' | 'rollback-failed';
116
+ /** One line of the step log, in the order the steps ran. */
117
+ export interface SiteUpdateStepLog {
118
+ step: SiteUpdateStep;
119
+ status: SiteUpdateStepStatus;
120
+ detail: string;
121
+ }
122
+ export type SiteUpdateErrorCode = 'invalid-version' | 'invalid-image-tag';
123
+ /** A plain-words failure whose message starts with its `ERR-` id. */
124
+ export declare class SiteUpdateError extends Error {
125
+ readonly code: SiteUpdateErrorCode;
126
+ readonly errorId: string;
127
+ constructor(required: {
128
+ code: SiteUpdateErrorCode;
129
+ errorId: string;
130
+ detail: string;
131
+ });
132
+ }
133
+ /** Options of {@link compareSiteVersions}. */
134
+ export interface CompareSiteVersionsOptions {
135
+ /** Mints the `ERR-` id for an invalid version; without it the reserved unavailable id is used. */
136
+ ids?: IdGenerator | undefined;
137
+ }
138
+ /**
139
+ * Says whether text is a semver version that {@link compareSiteVersions} accepts, without throwing.
140
+ *
141
+ * @param required.version - Candidate text, e.g. `1.2.3` or `v1.2.3-rc.1`.
142
+ * @returns true for a valid version.
143
+ * @complexity O(n) in the length of the text.
144
+ */
145
+ export declare function isSiteVersion(required: {
146
+ version: string;
147
+ }, _optional?: Record<string, never>): boolean;
148
+ /**
149
+ * Orders two semver versions.
150
+ *
151
+ * @param required.left - First version, e.g. `0.7.3-next.2`.
152
+ * @param required.right - Second version.
153
+ * @returns -1 when left is older, 0 when equal in precedence, 1 when left is newer.
154
+ * @throws SiteUpdateError (`invalid-version`) naming the bad input, message prefixed by its `ERR-` id.
155
+ * @complexity O(n) in the number of prerelease identifiers.
156
+ */
157
+ export declare function compareSiteVersions(required: {
158
+ left: string;
159
+ right: string;
160
+ }, _optional?: CompareSiteVersionsOptions): -1 | 0 | 1;
161
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1,94 @@
1
+ import { UNAVAILABLE_ERROR_ID } from '@jini-ai/core/errors/reporter';
2
+ /** A plain-words failure whose message starts with its `ERR-` id. */
3
+ export class SiteUpdateError extends Error {
4
+ code;
5
+ errorId;
6
+ constructor(required) {
7
+ super(`${required.errorId}: ${required.detail}`);
8
+ this.name = 'SiteUpdateError';
9
+ this.code = required.code;
10
+ this.errorId = required.errorId;
11
+ }
12
+ }
13
+ const CORE_PATTERN = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
14
+ const IDENTIFIER_PATTERN = /^[0-9A-Za-z-]+$/;
15
+ const NUMERIC_IDENTIFIER = /^\d+$/;
16
+ const isIdentifier = (part) => IDENTIFIER_PATTERN.test(part);
17
+ /**
18
+ * Splits semver 2.0 text into its core and prerelease identifiers, or null when the shape is wrong.
19
+ * Accepts a leading "v" (release tags are often "v1.2.3"). Build metadata after "+" is checked and
20
+ * then dropped, because semver says it carries no precedence.
21
+ */
22
+ function splitVersion(version) {
23
+ const [main = '', build, ...extra] = version.replace(/^v/, '').split('+');
24
+ if (extra.length > 0 || (build !== undefined && !build.split('.').every(isIdentifier)))
25
+ return null;
26
+ const dash = main.indexOf('-');
27
+ if (dash === -1)
28
+ return { core: main, prerelease: [] };
29
+ const prerelease = main.slice(dash + 1).split('.');
30
+ return prerelease.every(isIdentifier) ? { core: main.slice(0, dash), prerelease } : null;
31
+ }
32
+ /**
33
+ * Says whether text is a semver version that {@link compareSiteVersions} accepts, without throwing.
34
+ *
35
+ * @param required.version - Candidate text, e.g. `1.2.3` or `v1.2.3-rc.1`.
36
+ * @returns true for a valid version.
37
+ * @complexity O(n) in the length of the text.
38
+ */
39
+ export function isSiteVersion(required, _optional = {}) {
40
+ const parts = splitVersion(required.version);
41
+ return parts !== null && CORE_PATTERN.test(parts.core);
42
+ }
43
+ function parseVersion(required) {
44
+ const parts = splitVersion(required.version);
45
+ const match = parts ? CORE_PATTERN.exec(parts.core) : null;
46
+ if (!parts || !match) {
47
+ const errorId = required.ids?.newId() ?? UNAVAILABLE_ERROR_ID;
48
+ throw new SiteUpdateError({ code: 'invalid-version', errorId, detail: `"${required.version}" is not a version number like 1.2.3.` });
49
+ }
50
+ return { core: [Number(match[1]), Number(match[2]), Number(match[3])], prerelease: parts.prerelease };
51
+ }
52
+ function compareIdentifier(left, right) {
53
+ const leftNumeric = NUMERIC_IDENTIFIER.test(left);
54
+ const rightNumeric = NUMERIC_IDENTIFIER.test(right);
55
+ if (leftNumeric && rightNumeric)
56
+ return Math.sign(Number(left) - Number(right));
57
+ // Semver: numeric identifiers always sort below alphanumeric ones.
58
+ if (leftNumeric !== rightNumeric)
59
+ return leftNumeric ? -1 : 1;
60
+ if (left === right)
61
+ return 0;
62
+ return left < right ? -1 : 1;
63
+ }
64
+ function comparePrerelease(left, right) {
65
+ // A release without a prerelease tag outranks any prerelease of the same core (0.7.3-next.2 < 0.7.3).
66
+ if (left.length === 0 || right.length === 0)
67
+ return Math.sign(right.length - left.length);
68
+ for (let index = 0; index < Math.min(left.length, right.length); index += 1) {
69
+ const order = compareIdentifier(left[index], right[index]);
70
+ if (order !== 0)
71
+ return order;
72
+ }
73
+ return Math.sign(left.length - right.length);
74
+ }
75
+ /**
76
+ * Orders two semver versions.
77
+ *
78
+ * @param required.left - First version, e.g. `0.7.3-next.2`.
79
+ * @param required.right - Second version.
80
+ * @returns -1 when left is older, 0 when equal in precedence, 1 when left is newer.
81
+ * @throws SiteUpdateError (`invalid-version`) naming the bad input, message prefixed by its `ERR-` id.
82
+ * @complexity O(n) in the number of prerelease identifiers.
83
+ */
84
+ export function compareSiteVersions(required, _optional = {}) {
85
+ const left = parseVersion({ version: required.left, ids: _optional.ids });
86
+ const right = parseVersion({ version: required.right, ids: _optional.ids });
87
+ for (let index = 0; index < 3; index += 1) {
88
+ const order = Math.sign(left.core[index] - right.core[index]);
89
+ if (order !== 0)
90
+ return order;
91
+ }
92
+ return comparePrerelease(left.prerelease, right.prerelease);
93
+ }
94
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1,66 @@
1
+ /**
2
+ * @file `SiteUpdatePort` for a site run by the desktop app: the app binary and the site's database
3
+ * move together. The adapter only says HOW to update; WHEN is decided by `runSiteUpdate`, which
4
+ * refuses without the owner's approval for that exact version. Nothing here starts on its own: no
5
+ * timers, and checking for an update never downloads, stages or migrates anything.
6
+ */
7
+ import type { IdGenerator } from '@jini-ai/core/primitives';
8
+ import type { ReleaseFeedPort, SiteDataRestorePort, SiteHealthPort, SiteUpdateCallOptions, SiteUpdatePort } from './contracts.js';
9
+ /** The desktop app's own updater (download, stage, swap in, undo). */
10
+ export interface DesktopAppUpdaterPort {
11
+ /** The app version actually running now. */
12
+ currentVersion(required: Record<string, never>, optional?: SiteUpdateCallOptions): Promise<string>;
13
+ /** Downloads and stages `version` without running it. */
14
+ stage(required: {
15
+ version: string;
16
+ }, optional?: SiteUpdateCallOptions): Promise<void>;
17
+ /** Swaps the staged `version` in (relaunching as needed). */
18
+ applyStaged(required: {
19
+ version: string;
20
+ }, optional?: SiteUpdateCallOptions): Promise<void>;
21
+ /** Puts the kept previous `version` back. Must be safe when the swap never happened. */
22
+ rollbackTo(required: {
23
+ version: string;
24
+ }, optional?: SiteUpdateCallOptions): Promise<void>;
25
+ }
26
+ /** The site's database side: run the migrations of a new version, or restore the pre-update backup. */
27
+ export interface DesktopSiteMigratePort extends SiteDataRestorePort {
28
+ migrate(required: {
29
+ toVersion: string;
30
+ backupId: string;
31
+ }, optional?: SiteUpdateCallOptions): Promise<void>;
32
+ }
33
+ /** Options of {@link createDesktopSiteUpdate}. */
34
+ export interface DesktopSiteUpdateOptions {
35
+ /** Mints the `ERR-` id when a feed or running version is not a version number. */
36
+ ids?: IdGenerator | undefined;
37
+ /**
38
+ * The host's managed recovery: stop the app, restore the data backup, restart on `previousVersion`, and
39
+ * check the old version is healthy, as one operation. When given it replaces the legacy app-then-data
40
+ * rollback entirely; managed production updates always pass it.
41
+ */
42
+ rollbackDeployment?: DesktopRollbackDeploymentPort | undefined;
43
+ }
44
+ /** Puts the kept previous app binary and its data back together; see {@link DesktopSiteUpdateOptions.rollbackDeployment}. */
45
+ export type DesktopRollbackDeploymentPort = (required: {
46
+ previousVersion: string;
47
+ backupId: string;
48
+ }, optional?: SiteUpdateCallOptions) => Promise<void>;
49
+ /**
50
+ * Builds the desktop adapter. Apply order is stage app -> migrate site data -> swap app in, so a
51
+ * failed migration never leaves the new app running on old data; rollback undoes both sides.
52
+ *
53
+ * @param required.feed - Where app releases are announced.
54
+ * @param required.app - The app updater.
55
+ * @param required.migrate - Runs the site's migrations and restores its data backup.
56
+ * @param required.health - The live check of the site on the new version.
57
+ * @returns A `SiteUpdatePort` to hand to `runSiteUpdate`.
58
+ * @complexity O(1) port calls per method.
59
+ */
60
+ export declare function createDesktopSiteUpdate(required: {
61
+ feed: ReleaseFeedPort;
62
+ app: DesktopAppUpdaterPort;
63
+ migrate: DesktopSiteMigratePort;
64
+ health: SiteHealthPort;
65
+ }, _optional?: DesktopSiteUpdateOptions): SiteUpdatePort;
66
+ //# sourceMappingURL=desktop-site-update.d.ts.map
@@ -0,0 +1,43 @@
1
+ import { checkForUpdateFromFeed } from './check-for-update.js';
2
+ /**
3
+ * Builds the desktop adapter. Apply order is stage app -> migrate site data -> swap app in, so a
4
+ * failed migration never leaves the new app running on old data; rollback undoes both sides.
5
+ *
6
+ * @param required.feed - Where app releases are announced.
7
+ * @param required.app - The app updater.
8
+ * @param required.migrate - Runs the site's migrations and restores its data backup.
9
+ * @param required.health - The live check of the site on the new version.
10
+ * @returns A `SiteUpdatePort` to hand to `runSiteUpdate`.
11
+ * @complexity O(1) port calls per method.
12
+ */
13
+ export function createDesktopSiteUpdate(required, _optional = {}) {
14
+ const { feed, app, migrate, health } = required;
15
+ return {
16
+ checkForUpdate: ({ runningVersion }, optional) => checkForUpdateFromFeed({ runningVersion, feed }, { signal: optional?.signal, ids: _optional.ids }),
17
+ planUpdate: async ({ runningVersion, update }) => ({ fromVersion: runningVersion, toVersion: update.latest, notes: update.notes }),
18
+ applyUpdate: async ({ plan, backupId }, optional) => {
19
+ const version = plan.toVersion;
20
+ await app.stage({ version }, optional);
21
+ await migrate.migrate({ toVersion: version, backupId }, optional);
22
+ await app.applyStaged({ version }, optional);
23
+ return { summary: `Installed app ${version} and moved the site data to ${version}.` };
24
+ },
25
+ verifyUpdate: async ({ plan }, optional) => {
26
+ // An updater can report success yet relaunch the old app; asking the site then would test the wrong version.
27
+ const running = await app.currentVersion({}, optional);
28
+ if (running !== plan.toVersion)
29
+ return { status: 'unhealthy', reason: `The app is still on ${running}, not ${plan.toVersion}.` };
30
+ return health.check({ expectedVersion: plan.toVersion }, optional);
31
+ },
32
+ rollback: async ({ to, backupId }, optional) => {
33
+ // The online database adapter cannot choose when to replace a live database file, so managed
34
+ // rollback delegates binary and data recovery together instead of running the legacy pair first.
35
+ const { rollbackDeployment } = _optional;
36
+ if (rollbackDeployment)
37
+ return rollbackDeployment({ previousVersion: to, backupId }, optional);
38
+ await app.rollbackTo({ version: to }, optional);
39
+ await migrate.restore({ backupId }, optional);
40
+ },
41
+ };
42
+ }
43
+ //# sourceMappingURL=desktop-site-update.js.map
@@ -0,0 +1,39 @@
1
+ import type { MigrationReadiness, ReleaseFeedPort, SiteRelease, SiteUpdateVerification } from './contracts.js';
2
+ import type { SiteUpdatePorts } from './run-site-update.js';
3
+ export type FakeSiteUpdateFailPoint = 'createBackup' | 'check' | 'applyUpdate' | 'verifyUpdate' | 'rollback';
4
+ /** Options of {@link createFakeSiteUpdate}. */
5
+ export interface FakeSiteUpdateOptions {
6
+ /** What the readiness gate answers. Default ok. */
7
+ readiness?: MigrationReadiness;
8
+ /** What the live check answers. Default healthy. */
9
+ verify?: SiteUpdateVerification;
10
+ /** A port that throws `fake <name> failed` after recording its call. */
11
+ failOn?: FakeSiteUpdateFailPoint;
12
+ /** Runs after each call is recorded, e.g. to abort mid-run. Receives the recorded call text. */
13
+ onCall?: (call: string) => void;
14
+ }
15
+ /** The fake and its inspection handles. */
16
+ export interface FakeSiteUpdate {
17
+ ports: SiteUpdatePorts;
18
+ feed: ReleaseFeedPort;
19
+ /** Calls to the backup, readiness and platform write/check ports, in order. */
20
+ calls: string[];
21
+ /** The abort signal each recorded call received, in the same order as `calls`. */
22
+ signals: Array<AbortSignal | undefined>;
23
+ state: {
24
+ liveVersion: string;
25
+ };
26
+ }
27
+ /**
28
+ * Builds an in-memory adapter whose feed always offers `latest`.
29
+ *
30
+ * @param required.runningVersion - The pretend live version at start.
31
+ * @param required.latest - The release the feed announces.
32
+ * @returns Ports for `runSiteUpdate`, the feed, and the recorded calls/signals/state.
33
+ * @complexity O(1) per call.
34
+ */
35
+ export declare function createFakeSiteUpdate(required: {
36
+ runningVersion: string;
37
+ latest: SiteRelease;
38
+ }, _optional?: FakeSiteUpdateOptions): FakeSiteUpdate;
39
+ //# sourceMappingURL=fake-site-update.d.ts.map
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @file In-memory site-update adapter for tests and for hosts wiring the update flow before a real
3
+ * platform adapter exists. It records every call, keeps a pretend live version, and can be told to
4
+ * block, fail a check, or throw at any port so each safety branch can be exercised.
5
+ */
6
+ import { checkForUpdateFromFeed } from './check-for-update.js';
7
+ /**
8
+ * Builds an in-memory adapter whose feed always offers `latest`.
9
+ *
10
+ * @param required.runningVersion - The pretend live version at start.
11
+ * @param required.latest - The release the feed announces.
12
+ * @returns Ports for `runSiteUpdate`, the feed, and the recorded calls/signals/state.
13
+ * @complexity O(1) per call.
14
+ */
15
+ export function createFakeSiteUpdate(required, _optional = {}) {
16
+ const fake = { ports: undefined, feed: { latestRelease: async () => required.latest }, calls: [], signals: [], state: { liveVersion: required.runningVersion } };
17
+ let errorCount = 0;
18
+ let backupCount = 0;
19
+ const nextErrorId = () => {
20
+ errorCount += 1;
21
+ return `ERR-FAKE-0000-0000-${String(errorCount).padStart(4, '0')}`;
22
+ };
23
+ const record = (failPoint, call, optional) => {
24
+ fake.calls.push(call);
25
+ fake.signals.push(optional?.signal);
26
+ _optional.onCall?.(call);
27
+ if (_optional.failOn === failPoint)
28
+ throw new Error(`fake ${failPoint} failed`);
29
+ };
30
+ fake.ports = {
31
+ ids: { newId: nextErrorId },
32
+ backup: {
33
+ createBackup: async (_required, optional) => { record('createBackup', 'createBackup', optional); backupCount += 1; return { backupId: `backup-${backupCount}` }; },
34
+ },
35
+ readiness: {
36
+ check: async ({ toVersion }, optional) => { record('check', `check:${toVersion}`, optional); return _optional.readiness ?? { status: 'ok' }; },
37
+ },
38
+ site: {
39
+ checkForUpdate: ({ runningVersion }, optional) => checkForUpdateFromFeed({ runningVersion, feed: fake.feed }, optional),
40
+ planUpdate: async ({ runningVersion, update }) => ({ fromVersion: runningVersion, toVersion: update.latest, notes: update.notes }),
41
+ applyUpdate: async ({ plan, backupId }, optional) => {
42
+ record('applyUpdate', `applyUpdate:${plan.toVersion}:${backupId}`, optional);
43
+ fake.state.liveVersion = plan.toVersion;
44
+ return { summary: `Deployed ${plan.toVersion}.` };
45
+ },
46
+ verifyUpdate: async ({ plan }, optional) => { record('verifyUpdate', `verifyUpdate:${plan.toVersion}`, optional); return _optional.verify ?? { status: 'healthy' }; },
47
+ rollback: async ({ to, backupId }, optional) => { record('rollback', `rollback:${to}:${backupId}`, optional); fake.state.liveVersion = to; },
48
+ },
49
+ };
50
+ return fake;
51
+ }
52
+ //# sourceMappingURL=fake-site-update.js.map
@@ -0,0 +1,121 @@
1
+ /**
2
+ * @file The safety order for updating a live site: owner approval, backup, migration readiness
3
+ * gate, deploy, live check, and rollback to the kept previous version when the check fails.
4
+ * Pure orchestration over injected ports; no network, no clock, no globals.
5
+ */
6
+ import type { IdGenerator } from '@jini-ai/core/primitives';
7
+ import { type MigrationReadinessPort, type SiteBackupPort, type SiteUpdateApproval, type SiteUpdateOutcome, type SiteUpdatePlan, type SiteUpdatePort, type SiteUpdateStepLog } from './contracts.js';
8
+ /** Everything `runSiteUpdate` calls. `ids` mints the `ERR-` id of every failure the owner sees. */
9
+ export interface SiteUpdatePorts {
10
+ site: SiteUpdatePort;
11
+ backup: SiteBackupPort;
12
+ readiness: MigrationReadinessPort;
13
+ ids: IdGenerator;
14
+ }
15
+ /** Options of {@link runSiteUpdate}. */
16
+ export interface RunSiteUpdateOptions {
17
+ /** Cancels the update before it writes; never reaches the rollback (see `rollbackSignal`). */
18
+ signal?: AbortSignal | undefined;
19
+ /**
20
+ * The rollback's own lifetime, e.g. a host deadline. Deliberately separate from `signal`: the run is
21
+ * usually cancelled exactly when something went wrong, and a rollback that honoured that cancellation
22
+ * would leave the owner's site on a broken half-deployed version. Omitted means no deadline.
23
+ */
24
+ rollbackSignal?: AbortSignal | undefined;
25
+ }
26
+ /** What happened, in plain words, with the full step log. */
27
+ export interface SiteUpdateRunResult {
28
+ outcome: SiteUpdateOutcome;
29
+ summary: string;
30
+ steps: SiteUpdateStepLog[];
31
+ /** Present only when the update landed and passed its live check. */
32
+ changes?: SiteUpdatePlan;
33
+ /** Present once a backup exists, so the owner can always restore from it. */
34
+ backupId?: string;
35
+ errorId?: string;
36
+ }
37
+ /**
38
+ * What a host persists between preparing and finishing an update. The process that accepted the update
39
+ * may not be the one that verifies it: a desktop or self-hosted replacement restarts the very process
40
+ * that ran the approval, backup and readiness gate.
41
+ */
42
+ export interface PreparedSiteUpdate {
43
+ plan: SiteUpdatePlan;
44
+ backupId: string;
45
+ steps: readonly SiteUpdateStepLog[];
46
+ }
47
+ /** Result of {@link prepareSiteUpdate}: ready for the host to replace the site, or stopped with the inline result. */
48
+ export type SiteUpdatePreparation = {
49
+ status: 'prepared';
50
+ prepared: PreparedSiteUpdate;
51
+ } | {
52
+ status: 'stopped';
53
+ result: SiteUpdateRunResult;
54
+ };
55
+ /** How the host-driven replacement ended, as observed by the process that finishes the update. */
56
+ export type PreparedSiteUpdateApply = {
57
+ status: 'landed';
58
+ summary: string;
59
+ } | {
60
+ status: 'failed';
61
+ };
62
+ /** The ports {@link finishPreparedSiteUpdate} may use: only the live check and the rollback. */
63
+ export interface FinishSiteUpdatePorts {
64
+ site: Pick<SiteUpdatePort, 'verifyUpdate' | 'rollback'>;
65
+ ids: IdGenerator;
66
+ }
67
+ /**
68
+ * The first half of an update: owner approval, backup, and the readiness gate. Never applies, verifies
69
+ * or rolls back, so a host can persist the result and replace the site (restarting this process).
70
+ *
71
+ * @param required.ports - Backup, readiness and error-id ports.
72
+ * @param required.plan - The planned move; `fromVersion` is the version kept to roll back to.
73
+ * @param required.approval - The owner's token for exactly `plan.toVersion`; missing means stopped with no port called.
74
+ * @returns `prepared` with the plan, backup id and step log, or `stopped` with the same result `runSiteUpdate` returns.
75
+ * @throws Only what the `ids` port itself throws.
76
+ * @complexity At most two sequential port calls.
77
+ */
78
+ export declare function prepareSiteUpdate(required: {
79
+ ports: Pick<SiteUpdatePorts, 'backup' | 'readiness' | 'ids'>;
80
+ plan: SiteUpdatePlan;
81
+ approval: SiteUpdateApproval | undefined;
82
+ }, _optional?: Pick<RunSiteUpdateOptions, 'signal'>): Promise<SiteUpdatePreparation>;
83
+ /**
84
+ * The second half of an update, after the host replaced the site: the live check, and the rollback to the
85
+ * kept previous version when the replacement failed or the check fails. Resuming must never repeat apply:
86
+ * this has no apply, backup or approval port, and a landed replacement still needs the live check before
87
+ * it counts as updated. Hosts call it only with a durable operation they claimed and reloaded themselves,
88
+ * never with receipt data a request supplied. The rollback runs on `rollbackSignal`, never the caller's signal.
89
+ *
90
+ * @param required.prepared - What {@link prepareSiteUpdate} returned, as the host persisted it; its log is copied, not changed.
91
+ * @param required.ports - The live-check and rollback ports, plus the error-id port.
92
+ * @param required.apply - Whether the host's replacement landed (with what it did) or failed.
93
+ * @returns The outcome, a plain-words summary, the full step log, and on success what changed. Never throws for port failures.
94
+ * @throws Only what the `ids` port itself throws.
95
+ * @complexity At most two sequential port calls.
96
+ */
97
+ export declare function finishPreparedSiteUpdate(required: {
98
+ prepared: PreparedSiteUpdate;
99
+ ports: FinishSiteUpdatePorts;
100
+ apply: PreparedSiteUpdateApply;
101
+ }, _optional?: RunSiteUpdateOptions): Promise<SiteUpdateRunResult>;
102
+ /**
103
+ * Updates a live site to `plan.toVersion`, only with the owner's explicit approval for that version.
104
+ *
105
+ * Order: approval -> backup -> migration readiness gate -> apply -> live check -> (rollback to
106
+ * `plan.fromVersion` on a failed apply or check). The abort signal is checked before the backup and
107
+ * before the deploy, and passed to every port call except the rollback, which gets `rollbackSignal`.
108
+ *
109
+ * @param required.ports - Platform, backup, readiness and error-id ports.
110
+ * @param required.plan - The planned move; `fromVersion` is the version kept to roll back to.
111
+ * @param required.approval - The owner's token for exactly `plan.toVersion`; missing means refused with no port called.
112
+ * @returns The outcome, a plain-words summary, the step log, and on success what changed. Never throws for port failures.
113
+ * @throws Only what the `ids` port itself throws: with no way to mint an id, no failure could be reported.
114
+ * @complexity At most five sequential port calls.
115
+ */
116
+ export declare function runSiteUpdate(required: {
117
+ ports: SiteUpdatePorts;
118
+ plan: SiteUpdatePlan;
119
+ approval: SiteUpdateApproval | undefined;
120
+ }, _optional?: RunSiteUpdateOptions): Promise<SiteUpdateRunResult>;
121
+ //# sourceMappingURL=run-site-update.d.ts.map