@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,219 @@
1
+ import { compareSiteVersions, SiteUpdateError, } from './contracts.js';
2
+ function log(ctx, step, status, detail) {
3
+ ctx.steps.push({ step, status, detail });
4
+ }
5
+ function finish(ctx, result) {
6
+ return { ...result, steps: ctx.steps };
7
+ }
8
+ function messageOf(error) {
9
+ return error instanceof Error ? error.message : String(error);
10
+ }
11
+ function refuse(ctx, detail, errorId) {
12
+ log(ctx, 'approval', 'refused', detail);
13
+ return finish(ctx, { outcome: 'refused', summary: detail, ...(errorId ? { errorId } : {}) });
14
+ }
15
+ /** "Never auto-update": the owner's token must exist, name an approver, and match this exact version. */
16
+ function checkApproval(ctx, approval) {
17
+ const { plan } = ctx;
18
+ if (!approval || approval.kind !== 'owner-approval' || approval.approvedBy.trim() === '') {
19
+ return refuse(ctx, 'The owner has not approved this update, so nothing was changed.');
20
+ }
21
+ if (approval.toVersion !== plan.toVersion) {
22
+ return refuse(ctx, `The owner approved ${approval.toVersion}, not ${plan.toVersion}, so nothing was changed.`);
23
+ }
24
+ try {
25
+ if (compareSiteVersions({ left: plan.toVersion, right: plan.fromVersion }, { ids: ctx.ports.ids }) <= 0) {
26
+ return refuse(ctx, `${plan.toVersion} is not newer than the running ${plan.fromVersion}, so nothing was changed.`);
27
+ }
28
+ }
29
+ catch (error) {
30
+ if (!(error instanceof SiteUpdateError))
31
+ throw error;
32
+ return refuse(ctx, error.message, error.errorId);
33
+ }
34
+ log(ctx, 'approval', 'done', `Approved by ${approval.approvedBy} for ${plan.toVersion}.`);
35
+ return null;
36
+ }
37
+ /** Checked before every step that writes, so a cancelled update never starts one. */
38
+ function stopIfAborted(ctx, step, before, backupId) {
39
+ if (!ctx.signal?.aborted)
40
+ return null;
41
+ const detail = `Stopped before ${before} because the update was cancelled. The site was not changed.`;
42
+ log(ctx, step, 'skipped', detail);
43
+ return finish(ctx, { outcome: 'aborted', summary: detail, ...(backupId ? { backupId } : {}) });
44
+ }
45
+ async function backupStep(ctx) {
46
+ const stopped = stopIfAborted(ctx, 'backup', 'the backup');
47
+ if (stopped)
48
+ return stopped;
49
+ try {
50
+ const { backupId } = await ctx.ports.backup.createBackup({ fromVersion: ctx.plan.fromVersion }, { signal: ctx.signal });
51
+ log(ctx, 'backup', 'done', `Backup ${backupId} made of ${ctx.plan.fromVersion}.`);
52
+ return { backupId };
53
+ }
54
+ catch (error) {
55
+ const errorId = ctx.ports.ids.newId();
56
+ const summary = `${errorId}: The backup could not be made, so nothing was changed. ${messageOf(error)}`;
57
+ log(ctx, 'backup', 'failed', summary);
58
+ return finish(ctx, { outcome: 'failed', summary, errorId });
59
+ }
60
+ }
61
+ /**
62
+ * The gate between backup and deploy: a blocked or broken check means nothing is deployed. The check
63
+ * is told which backup exists and which version it was taken of, so it can judge the data that backup covers.
64
+ */
65
+ async function readinessStep(ctx, backupId) {
66
+ try {
67
+ const readiness = await ctx.ports.readiness.check({ toVersion: ctx.plan.toVersion }, { signal: ctx.signal, backupId, fromVersion: ctx.plan.fromVersion });
68
+ if (readiness.status === 'ok') {
69
+ log(ctx, 'readiness', 'done', `Stored data is ready for ${ctx.plan.toVersion}.`);
70
+ return null;
71
+ }
72
+ log(ctx, 'readiness', 'blocked', readiness.reason);
73
+ return finish(ctx, { outcome: 'blocked', summary: `Not updated: ${readiness.reason}`, backupId });
74
+ }
75
+ catch (error) {
76
+ const errorId = ctx.ports.ids.newId();
77
+ const summary = `${errorId}: The readiness check could not run, so nothing was deployed. ${messageOf(error)}`;
78
+ log(ctx, 'readiness', 'failed', summary);
79
+ return finish(ctx, { outcome: 'failed', summary, backupId, errorId });
80
+ }
81
+ }
82
+ /**
83
+ * Puts the kept previous version back. Deliberately NOT gated on, nor given, the run's abort signal:
84
+ * by now the new version is (maybe half) live and failing, and stopping here would leave the owner's
85
+ * site broken. It runs under its own `rollbackSignal` lifetime instead.
86
+ */
87
+ async function rollbackStep(ctx, backupId, cause) {
88
+ const to = ctx.plan.fromVersion;
89
+ const idPart = cause.errorId ? { errorId: cause.errorId } : {};
90
+ try {
91
+ await ctx.ports.site.rollback({ to, backupId }, { signal: ctx.rollbackSignal });
92
+ log(ctx, 'rollback', 'done', `Back on ${to}.`);
93
+ return finish(ctx, { outcome: 'rolled-back', summary: cause.summary, backupId, ...idPart });
94
+ }
95
+ catch (error) {
96
+ const errorId = cause.errorId ?? ctx.ports.ids.newId();
97
+ const summary = `${errorId}: ${cause.what} and going back to ${to} also failed. Restore backup ${backupId} by hand.`;
98
+ log(ctx, 'rollback', 'failed', `${summary} ${messageOf(error)}`);
99
+ return finish(ctx, { outcome: 'rollback-failed', summary, backupId, errorId });
100
+ }
101
+ }
102
+ async function verifyStep(ctx, backupId) {
103
+ const { plan } = ctx;
104
+ let reason;
105
+ try {
106
+ const verification = await ctx.ports.site.verifyUpdate({ plan }, { signal: ctx.signal });
107
+ reason = verification.status === 'healthy' ? null : verification.reason;
108
+ }
109
+ catch (error) {
110
+ // A live check that cannot run proves nothing about the new version, so it counts as a failure.
111
+ reason = messageOf(error);
112
+ }
113
+ if (reason !== null) {
114
+ log(ctx, 'verify', 'failed', reason);
115
+ const summary = `The new version did not pass its live check (${reason}), so the site was rolled back to ${plan.fromVersion}.`;
116
+ return rollbackStep(ctx, backupId, { what: 'The new version failed its live check', summary });
117
+ }
118
+ log(ctx, 'verify', 'done', `The live site works on ${plan.toVersion}.`);
119
+ const notes = plan.notes.trim() ? ` What changed: ${plan.notes.trim()}` : '';
120
+ return finish(ctx, { outcome: 'updated', summary: `Updated from ${plan.fromVersion} to ${plan.toVersion}.${notes}`, changes: plan, backupId });
121
+ }
122
+ async function deployStep(ctx, backupId) {
123
+ const stopped = stopIfAborted(ctx, 'apply', 'deploying', backupId);
124
+ if (stopped)
125
+ return stopped;
126
+ try {
127
+ const { summary } = await ctx.ports.site.applyUpdate({ plan: ctx.plan, backupId }, { signal: ctx.signal });
128
+ log(ctx, 'apply', 'done', summary);
129
+ }
130
+ catch (error) {
131
+ // The deploy may have half-landed, so a failed apply is undone like a failed live check.
132
+ return applyFailedStep(ctx, backupId, messageOf(error));
133
+ }
134
+ return verifyStep(ctx, backupId);
135
+ }
136
+ /** Logs a failed apply under a fresh `ERR-` id and undoes it with the kept previous version. */
137
+ function applyFailedStep(ctx, backupId, reason) {
138
+ const errorId = ctx.ports.ids.newId();
139
+ log(ctx, 'apply', 'failed', `${errorId}: ${reason}`);
140
+ const summary = `${errorId}: The deploy failed (${reason}), so the site was rolled back to ${ctx.plan.fromVersion}.`;
141
+ return rollbackStep(ctx, backupId, { what: 'The deploy failed', summary, errorId });
142
+ }
143
+ /**
144
+ * The first half of an update: owner approval, backup, and the readiness gate. Never applies, verifies
145
+ * or rolls back, so a host can persist the result and replace the site (restarting this process).
146
+ *
147
+ * @param required.ports - Backup, readiness and error-id ports.
148
+ * @param required.plan - The planned move; `fromVersion` is the version kept to roll back to.
149
+ * @param required.approval - The owner's token for exactly `plan.toVersion`; missing means stopped with no port called.
150
+ * @returns `prepared` with the plan, backup id and step log, or `stopped` with the same result `runSiteUpdate` returns.
151
+ * @throws Only what the `ids` port itself throws.
152
+ * @complexity At most two sequential port calls.
153
+ */
154
+ export async function prepareSiteUpdate(required, _optional = {}) {
155
+ const ctx = {
156
+ ports: required.ports, plan: required.plan, signal: _optional.signal, rollbackSignal: undefined, steps: [],
157
+ };
158
+ const refused = checkApproval(ctx, required.approval);
159
+ if (refused)
160
+ return { status: 'stopped', result: refused };
161
+ const backup = await backupStep(ctx);
162
+ if ('outcome' in backup)
163
+ return { status: 'stopped', result: backup };
164
+ const blocked = await readinessStep(ctx, backup.backupId);
165
+ if (blocked)
166
+ return { status: 'stopped', result: blocked };
167
+ return { status: 'prepared', prepared: { plan: required.plan, backupId: backup.backupId, steps: [...ctx.steps] } };
168
+ }
169
+ /**
170
+ * The second half of an update, after the host replaced the site: the live check, and the rollback to the
171
+ * kept previous version when the replacement failed or the check fails. Resuming must never repeat apply:
172
+ * this has no apply, backup or approval port, and a landed replacement still needs the live check before
173
+ * it counts as updated. Hosts call it only with a durable operation they claimed and reloaded themselves,
174
+ * never with receipt data a request supplied. The rollback runs on `rollbackSignal`, never the caller's signal.
175
+ *
176
+ * @param required.prepared - What {@link prepareSiteUpdate} returned, as the host persisted it; its log is copied, not changed.
177
+ * @param required.ports - The live-check and rollback ports, plus the error-id port.
178
+ * @param required.apply - Whether the host's replacement landed (with what it did) or failed.
179
+ * @returns The outcome, a plain-words summary, the full step log, and on success what changed. Never throws for port failures.
180
+ * @throws Only what the `ids` port itself throws.
181
+ * @complexity At most two sequential port calls.
182
+ */
183
+ export async function finishPreparedSiteUpdate(required, _optional = {}) {
184
+ const { prepared, apply } = required;
185
+ const ctx = {
186
+ ports: required.ports, plan: prepared.plan, signal: _optional.signal, rollbackSignal: _optional.rollbackSignal,
187
+ steps: prepared.steps.map((entry) => ({ ...entry })),
188
+ };
189
+ // A confirmed failure may still have half-landed, so it is undone exactly like a failed inline apply.
190
+ if (apply.status === 'failed')
191
+ return applyFailedStep(ctx, prepared.backupId, 'The new version did not land.');
192
+ log(ctx, 'apply', 'done', apply.summary);
193
+ return verifyStep(ctx, prepared.backupId);
194
+ }
195
+ /**
196
+ * Updates a live site to `plan.toVersion`, only with the owner's explicit approval for that version.
197
+ *
198
+ * Order: approval -> backup -> migration readiness gate -> apply -> live check -> (rollback to
199
+ * `plan.fromVersion` on a failed apply or check). The abort signal is checked before the backup and
200
+ * before the deploy, and passed to every port call except the rollback, which gets `rollbackSignal`.
201
+ *
202
+ * @param required.ports - Platform, backup, readiness and error-id ports.
203
+ * @param required.plan - The planned move; `fromVersion` is the version kept to roll back to.
204
+ * @param required.approval - The owner's token for exactly `plan.toVersion`; missing means refused with no port called.
205
+ * @returns The outcome, a plain-words summary, the step log, and on success what changed. Never throws for port failures.
206
+ * @throws Only what the `ids` port itself throws: with no way to mint an id, no failure could be reported.
207
+ * @complexity At most five sequential port calls.
208
+ */
209
+ export async function runSiteUpdate(required, _optional = {}) {
210
+ const preparation = await prepareSiteUpdate({ ports: required.ports, plan: required.plan, approval: required.approval }, { signal: _optional.signal });
211
+ if (preparation.status === 'stopped')
212
+ return preparation.result;
213
+ const { prepared } = preparation;
214
+ const ctx = {
215
+ ports: required.ports, plan: prepared.plan, signal: _optional.signal, rollbackSignal: _optional.rollbackSignal, steps: [...prepared.steps],
216
+ };
217
+ return deployStep(ctx, prepared.backupId);
218
+ }
219
+ //# sourceMappingURL=run-site-update.js.map
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @file `SiteUpdatePort` for a self-hosted site that runs as a container image: an update is a tag
3
+ * bump plus a redeploy, and rollback puts the previous tag back. The adapter only says HOW; WHEN is
4
+ * decided by `runSiteUpdate`, which refuses without the owner's approval for that exact version.
5
+ * Checking for an update never reads or writes the tag.
6
+ */
7
+ import type { IdGenerator } from '@jini-ai/core/primitives';
8
+ import { type ReleaseFeedPort, type SiteDataRestorePort, type SiteHealthPort, type SiteUpdateCallOptions, type SiteUpdatePort } from './contracts.js';
9
+ /** Where the host keeps the site's image tag and how it restarts the site on it. */
10
+ export interface ImageTagPort {
11
+ /** The tag the site is running on right now. */
12
+ currentTag(required: Record<string, never>, optional?: SiteUpdateCallOptions): Promise<string>;
13
+ /** Records `tag` as the one to run (compose file, service spec, ...). */
14
+ setTag(required: {
15
+ tag: string;
16
+ }, optional?: SiteUpdateCallOptions): Promise<void>;
17
+ /** Restarts or redeploys the site on `tag` and waits until it is up. */
18
+ redeploy(required: {
19
+ tag: string;
20
+ }, optional?: SiteUpdateCallOptions): Promise<void>;
21
+ }
22
+ /** Options of {@link imageTagForVersion}. */
23
+ export interface ImageTagForVersionOptions {
24
+ /** Text put before the version, e.g. `v` for `v1.2.3` tags. Default none. */
25
+ prefix?: string | undefined;
26
+ /** Mints the `ERR-` id of a refused tag; without it the reserved unavailable id is used. */
27
+ ids?: IdGenerator | undefined;
28
+ }
29
+ /**
30
+ * Derives the image tag for a release version. Only release versions are accepted, so a moving tag
31
+ * like `latest` (which cannot be rolled back) or text carrying shell characters never becomes a tag.
32
+ *
33
+ * @param required.version - The release version, e.g. `1.2.3`.
34
+ * @returns `prefix + version`.
35
+ * @throws SiteUpdateError (`invalid-image-tag`) in plain words, message prefixed by its `ERR-` id.
36
+ * @complexity O(n) in the length of the version.
37
+ */
38
+ export declare function imageTagForVersion(required: {
39
+ version: string;
40
+ }, _optional?: ImageTagForVersionOptions): string;
41
+ /** Options of {@link createSelfHostedSiteUpdate}. */
42
+ export interface SelfHostedSiteUpdateOptions extends ImageTagForVersionOptions {
43
+ /** Pass when the new image migrates data on start, so a rollback also restores the data backup. */
44
+ data?: SiteDataRestorePort | undefined;
45
+ /**
46
+ * The host's managed recovery: stop the site, restore the data backup, restart on `previousTag`, and
47
+ * check the old version is healthy, as one operation. When given it replaces the legacy tag switch and
48
+ * `data` restore entirely; managed production updates always pass it.
49
+ */
50
+ rollbackDeployment?: SelfHostedRollbackDeploymentPort | undefined;
51
+ }
52
+ /** Puts the kept previous image and its data back together; see {@link SelfHostedSiteUpdateOptions.rollbackDeployment}. */
53
+ export type SelfHostedRollbackDeploymentPort = (required: {
54
+ previousTag: string;
55
+ backupId: string;
56
+ }, optional?: SiteUpdateCallOptions) => Promise<void>;
57
+ /**
58
+ * Builds the self-hosted adapter.
59
+ *
60
+ * @param required.feed - Where releases are announced.
61
+ * @param required.images - Reads, sets and redeploys the site's image tag.
62
+ * @param required.health - The live check of the site on the new version.
63
+ * @returns A `SiteUpdatePort` to hand to `runSiteUpdate`.
64
+ * @complexity O(1) port calls per method.
65
+ */
66
+ export declare function createSelfHostedSiteUpdate(required: {
67
+ feed: ReleaseFeedPort;
68
+ images: ImageTagPort;
69
+ health: SiteHealthPort;
70
+ }, _optional?: SelfHostedSiteUpdateOptions): SiteUpdatePort;
71
+ //# sourceMappingURL=self-hosted-site-update.d.ts.map
@@ -0,0 +1,79 @@
1
+ import { UNAVAILABLE_ERROR_ID } from '@jini-ai/core/errors/reporter';
2
+ import { checkForUpdateFromFeed } from './check-for-update.js';
3
+ import { isSiteVersion, SiteUpdateError, } from './contracts.js';
4
+ // The image-reference tag grammar: one word character first, then up to 127 of [word . -].
5
+ const IMAGE_TAG_PATTERN = /^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$/;
6
+ /**
7
+ * Derives the image tag for a release version. Only release versions are accepted, so a moving tag
8
+ * like `latest` (which cannot be rolled back) or text carrying shell characters never becomes a tag.
9
+ *
10
+ * @param required.version - The release version, e.g. `1.2.3`.
11
+ * @returns `prefix + version`.
12
+ * @throws SiteUpdateError (`invalid-image-tag`) in plain words, message prefixed by its `ERR-` id.
13
+ * @complexity O(n) in the length of the version.
14
+ */
15
+ export function imageTagForVersion(required, _optional = {}) {
16
+ const tag = `${_optional.prefix ?? ''}${required.version}`;
17
+ const fail = (detail) => {
18
+ throw new SiteUpdateError({ code: 'invalid-image-tag', errorId: _optional.ids?.newId() ?? UNAVAILABLE_ERROR_ID, detail });
19
+ };
20
+ if (!isSiteVersion({ version: required.version })) {
21
+ fail(`"${required.version}" is not a release version like 1.2.3, so it cannot name the site image. Moving tags such as "latest" are refused because they cannot be rolled back.`);
22
+ }
23
+ if (!IMAGE_TAG_PATTERN.test(tag))
24
+ fail(`"${tag}" has characters an image tag cannot hold. Use only letters, digits, ".", "_" and "-".`);
25
+ return tag;
26
+ }
27
+ /**
28
+ * Builds the self-hosted adapter.
29
+ *
30
+ * @param required.feed - Where releases are announced.
31
+ * @param required.images - Reads, sets and redeploys the site's image tag.
32
+ * @param required.health - The live check of the site on the new version.
33
+ * @returns A `SiteUpdatePort` to hand to `runSiteUpdate`.
34
+ * @complexity O(1) port calls per method.
35
+ */
36
+ export function createSelfHostedSiteUpdate(required, _optional = {}) {
37
+ const { feed, images, health } = required;
38
+ const tagOptions = { prefix: _optional.prefix, ids: _optional.ids };
39
+ const tagFor = (version) => imageTagForVersion({ version }, tagOptions);
40
+ // The tag actually running before each apply, by backup id: the truest "previous tag" to go back to.
41
+ const previousTags = new Map();
42
+ const switchTo = async (tag, optional) => {
43
+ await images.setTag({ tag }, optional);
44
+ await images.redeploy({ tag }, optional);
45
+ };
46
+ return {
47
+ checkForUpdate: ({ runningVersion }, optional) => checkForUpdateFromFeed({ runningVersion, feed }, { signal: optional?.signal, ids: _optional.ids }),
48
+ planUpdate: async ({ runningVersion, update }) => {
49
+ tagFor(update.latest); // Refuse a bad tag before the owner is ever asked to approve it.
50
+ return { fromVersion: runningVersion, toVersion: update.latest, notes: update.notes };
51
+ },
52
+ applyUpdate: async ({ plan, backupId }, optional) => {
53
+ const tag = tagFor(plan.toVersion);
54
+ const previous = await images.currentTag({}, optional);
55
+ previousTags.set(backupId, previous);
56
+ await switchTo(tag, optional);
57
+ return { summary: `Switched the site image from ${previous} to ${tag} and restarted it.` };
58
+ },
59
+ verifyUpdate: async ({ plan }, optional) => {
60
+ const expected = tagFor(plan.toVersion);
61
+ const running = await images.currentTag({}, optional);
62
+ if (running !== expected)
63
+ return { status: 'unhealthy', reason: `The site image is ${running}, not ${expected}.` };
64
+ return health.check({ expectedVersion: plan.toVersion }, optional);
65
+ },
66
+ rollback: async ({ to, backupId }, optional) => {
67
+ // Without a recorded apply (e.g. the adapter was rebuilt after a restart) the kept version names the tag.
68
+ const previousTag = previousTags.get(backupId) ?? tagFor(to);
69
+ // The online database adapter cannot choose when to replace a live database file, so managed
70
+ // rollback delegates image and data recovery together instead of running the legacy pair first.
71
+ const { rollbackDeployment } = _optional;
72
+ if (rollbackDeployment)
73
+ return rollbackDeployment({ previousTag, backupId }, optional);
74
+ await switchTo(previousTag, optional);
75
+ await _optional.data?.restore({ backupId }, optional);
76
+ },
77
+ };
78
+ }
79
+ //# sourceMappingURL=self-hosted-site-update.js.map
@@ -21,6 +21,9 @@ export interface PluginSigV4Client {
21
21
  sign(input: string, init?: RequestInit): Promise<Request>;
22
22
  }
23
23
  export interface PluginDeployHostKit {
24
+ readonly isShareArtifactKey?: (required: {
25
+ readonly key: string;
26
+ }, optional?: Record<string, never>) => boolean;
24
27
  /** Optional newer plugin ports; installed older modules keep their existing ABI. */
25
28
  now?(): number;
26
29
  probeContent?(required: {
@@ -92,14 +92,11 @@ export interface CreateDeployPublishToolRegistrationOptions {
92
92
  * input, signal)` — never by a route or agent calling `publishDeploy`
93
93
  * directly, which would bypass authorization and the audit trail entirely.
94
94
  *
95
- * The handler ignores the `ToolExecutionContext.signal` `ToolExecutor`
96
- * supplies: `DeployTarget.publish`/`checkReachability` (`types.ts`) take no
97
- * `AbortSignal` today, so there is nothing to forward it to. A `ToolExecutor`
98
- * `timeoutMs`/external cancellation still aborts the *call* from the
99
- * executor's perspective (the audit trail records `timed-out`/`cancelled`),
100
- * it just cannot interrupt an in-flight HTTP request inside a target's own
101
- * `publish` implementation — flagged as a follow-up in the archived extraction source map
102
- * rather than silently assumed away.
95
+ * The handler forwards the `ToolExecutionContext.signal` `ToolExecutor`
96
+ * supplies as `DeployPublishOptions.signal`, so a `timeoutMs`/external
97
+ * cancellation reaches the target before it publishes, not only the executor's
98
+ * view of the call (the audit trail records `timed-out`/`cancelled`). A target
99
+ * that never checks the signal still publishes; `checkReachability` takes none.
103
100
  *
104
101
  * @complexity O(1) to build the registration; the handler's own cost is `publishDeploy`'s (O(targets) dispatch plus the matched target's `publish`).
105
102
  * @overallScore 100/100
@@ -69,14 +69,11 @@ export function createRoleGatedDeployPublishPolicy(_requiredArgs, { allowedRoles
69
69
  * input, signal)` — never by a route or agent calling `publishDeploy`
70
70
  * directly, which would bypass authorization and the audit trail entirely.
71
71
  *
72
- * The handler ignores the `ToolExecutionContext.signal` `ToolExecutor`
73
- * supplies: `DeployTarget.publish`/`checkReachability` (`types.ts`) take no
74
- * `AbortSignal` today, so there is nothing to forward it to. A `ToolExecutor`
75
- * `timeoutMs`/external cancellation still aborts the *call* from the
76
- * executor's perspective (the audit trail records `timed-out`/`cancelled`),
77
- * it just cannot interrupt an in-flight HTTP request inside a target's own
78
- * `publish` implementation — flagged as a follow-up in the archived extraction source map
79
- * rather than silently assumed away.
72
+ * The handler forwards the `ToolExecutionContext.signal` `ToolExecutor`
73
+ * supplies as `DeployPublishOptions.signal`, so a `timeoutMs`/external
74
+ * cancellation reaches the target before it publishes, not only the executor's
75
+ * view of the call (the audit trail records `timed-out`/`cancelled`). A target
76
+ * that never checks the signal still publishes; `checkReachability` takes none.
80
77
  *
81
78
  * @complexity O(1) to build the registration; the handler's own cost is `publishDeploy`'s (O(targets) dispatch plus the matched target's `publish`).
82
79
  * @overallScore 100/100
@@ -100,7 +97,7 @@ export function createDeployPublishToolRegistration({ targets }, { policy = deny
100
97
  // already reject a malformed `targetId`/`files`/`projectName` on
101
98
  // their own terms (e.g. `DeployError` for an unknown target).
102
99
  const { metadata, ...input } = ctx.input;
103
- return publishDeploy({ ...input, targets }, metadata === undefined ? {} : { metadata });
100
+ return publishDeploy({ ...input, targets }, { ...(metadata === undefined ? {} : { metadata }), signal: ctx.signal });
104
101
  },
105
102
  };
106
103
  }
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @file The due-bindings loop: every {@link DOMAIN_BINDING_SWEEP_INTERVAL_MS} it runs the host's
3
+ * pre-bound due-bindings sweep once, which re-checks a bounded batch of saved domain bindings whose
4
+ * next check time has passed (30 s doubling to 10 min, 48 h cap — `nextCheckDelayMs` in `./verify.ts`).
5
+ *
6
+ * Why it exists: a one-shot verify checks once and schedules the next check, but until this loop
7
+ * nothing ran the schedule, so a binding stayed `pending` until someone asked again.
8
+ *
9
+ * Only the host's serving process should start it, for the webhook loop's reason: that is the one
10
+ * process pair that serves a site, and a DNS sweep from an exporter or an agent daemon would write a
11
+ * site's tracking state from a process nobody is watching. A root without the pre-bound sweep (a
12
+ * hermetic test root, or one with no content database) gets an idle handle: off by injection.
13
+ *
14
+ * Mirrors the webhook delivery worker: unref'd timers (the injected scheduler), single flight (a tick
15
+ * that finds the previous one running does nothing — a slow nameserver never stacks sweeps), a failed
16
+ * sweep is logged and retried next interval, never thrown, and `stop` waits a short grace.
17
+ */
18
+ import type { Logger } from "@jini-ai/core/primitives";
19
+ /** Idle wait between sweeps. The shortest backoff step is 30 s, so a minute keeps a check at most
20
+ * one interval late while an idle site costs one indexed `SELECT` per minute. */
21
+ export declare const DOMAIN_BINDING_SWEEP_INTERVAL_MS = 60000;
22
+ /** Bindings re-checked per sweep, oldest due first; the rest wait for the next interval. */
23
+ export declare const DOMAIN_BINDING_SWEEP_LIMIT = 10;
24
+ /** How long `stop` waits for a running sweep; shares the 4 s shutdown budget with the other loops. */
25
+ export declare const DOMAIN_BINDING_SWEEP_STOP_GRACE_MS = 1000;
26
+ export declare const DOMAIN_BINDING_SWEEP_FAILED_LINE = "[domain-dns] due-bindings sweep failed; retrying after the interval";
27
+ export declare const DOMAIN_BINDING_SWEEP_STOP_LATE_LINE = "[domain-dns] a due-bindings sweep was still running at shutdown; it was abandoned";
28
+ /** A cancellable timer. The host's implementation should never keep the process alive. */
29
+ export interface DomainBindingSweepTimer {
30
+ cancel(): void;
31
+ }
32
+ /** Timer port (structurally the webhook delivery worker's), injected so tests drive ticks with a fake clock. */
33
+ export interface DomainBindingSweepScheduler {
34
+ every(required: {
35
+ ms: number;
36
+ run: () => void;
37
+ }): DomainBindingSweepTimer;
38
+ after(required: {
39
+ ms: number;
40
+ run: () => void;
41
+ }): DomainBindingSweepTimer;
42
+ }
43
+ export interface DomainBindingSweeper {
44
+ /** Runs one sweep now, unless one is already running (then resolves with that one). Never rejects. */
45
+ tick(): Promise<void>;
46
+ /** Stops scheduling sweeps and waits up to {@link DOMAIN_BINDING_SWEEP_STOP_GRACE_MS} for a running one. Idempotent. */
47
+ stop(): Promise<void>;
48
+ }
49
+ export interface DomainBindingSweeperOptional {
50
+ intervalMs?: number;
51
+ limit?: number;
52
+ }
53
+ /**
54
+ * Starts the loop over the pre-bound sweep; the first sweep runs one interval after start.
55
+ *
56
+ * @param required.sweep the host's pre-bound due-bindings sweep; absent → an idle handle, no timer.
57
+ * @param required.scheduler the host's (unref'd) timer port.
58
+ * @param required.logger the host's log channel. A failed sweep goes in its error bag, never as line
59
+ * text: the error's own message can quote a nameserver answer, so the logger describes it.
60
+ * @param optional.intervalMs idle wait between sweeps; default {@link DOMAIN_BINDING_SWEEP_INTERVAL_MS}.
61
+ * @throws RangeError when `intervalMs` is not a positive finite number.
62
+ * @example const sweeper = startDomainBindingSweeper({ sweep: verifyDue, scheduler, logger }); await sweeper.stop();
63
+ * @complexity O(1) per tick, beyond the sweep's own O(limit · records · nameservers) DNS reads.
64
+ */
65
+ export declare function startDomainBindingSweeper(required: {
66
+ sweep: ((required: {
67
+ limit: number;
68
+ }) => Promise<string[]>) | undefined;
69
+ scheduler: DomainBindingSweepScheduler;
70
+ logger: Logger;
71
+ }, optional?: DomainBindingSweeperOptional): DomainBindingSweeper;
72
+ //# sourceMappingURL=binding-sweeper.d.ts.map
@@ -0,0 +1,53 @@
1
+ /** Idle wait between sweeps. The shortest backoff step is 30 s, so a minute keeps a check at most
2
+ * one interval late while an idle site costs one indexed `SELECT` per minute. */
3
+ export const DOMAIN_BINDING_SWEEP_INTERVAL_MS = 60_000;
4
+ /** Bindings re-checked per sweep, oldest due first; the rest wait for the next interval. */
5
+ export const DOMAIN_BINDING_SWEEP_LIMIT = 10;
6
+ /** How long `stop` waits for a running sweep; shares the 4 s shutdown budget with the other loops. */
7
+ export const DOMAIN_BINDING_SWEEP_STOP_GRACE_MS = 1_000;
8
+ export const DOMAIN_BINDING_SWEEP_FAILED_LINE = '[domain-dns] due-bindings sweep failed; retrying after the interval';
9
+ export const DOMAIN_BINDING_SWEEP_STOP_LATE_LINE = '[domain-dns] a due-bindings sweep was still running at shutdown; it was abandoned';
10
+ const IDLE = { tick: async () => { }, stop: async () => { } };
11
+ /**
12
+ * Starts the loop over the pre-bound sweep; the first sweep runs one interval after start.
13
+ *
14
+ * @param required.sweep the host's pre-bound due-bindings sweep; absent → an idle handle, no timer.
15
+ * @param required.scheduler the host's (unref'd) timer port.
16
+ * @param required.logger the host's log channel. A failed sweep goes in its error bag, never as line
17
+ * text: the error's own message can quote a nameserver answer, so the logger describes it.
18
+ * @param optional.intervalMs idle wait between sweeps; default {@link DOMAIN_BINDING_SWEEP_INTERVAL_MS}.
19
+ * @throws RangeError when `intervalMs` is not a positive finite number.
20
+ * @example const sweeper = startDomainBindingSweeper({ sweep: verifyDue, scheduler, logger }); await sweeper.stop();
21
+ * @complexity O(1) per tick, beyond the sweep's own O(limit · records · nameservers) DNS reads.
22
+ */
23
+ export function startDomainBindingSweeper(required, optional = {}) {
24
+ const { sweep, scheduler, logger } = required;
25
+ if (sweep === undefined)
26
+ return IDLE;
27
+ const { intervalMs = DOMAIN_BINDING_SWEEP_INTERVAL_MS, limit = DOMAIN_BINDING_SWEEP_LIMIT } = optional;
28
+ if (!(Number.isFinite(intervalMs) && intervalMs > 0))
29
+ throw new RangeError('domain binding sweep intervalMs must be a positive finite number');
30
+ let running;
31
+ let stopped = false;
32
+ const tick = () => {
33
+ if (stopped)
34
+ return Promise.resolve();
35
+ running ??= sweep({ limit }).then(() => undefined, (error) => logger.error({ message: DOMAIN_BINDING_SWEEP_FAILED_LINE }, { error })).finally(() => { running = undefined; });
36
+ return running;
37
+ };
38
+ const timer = scheduler.every({ ms: intervalMs, run: () => { void tick(); } });
39
+ const stop = async () => {
40
+ stopped = true;
41
+ timer.cancel();
42
+ if (running === undefined)
43
+ return;
44
+ let grace;
45
+ const late = new Promise((resolve) => { grace = scheduler.after({ ms: DOMAIN_BINDING_SWEEP_STOP_GRACE_MS, run: () => resolve('late') }); });
46
+ const outcome = await Promise.race([running, late]);
47
+ grace.cancel();
48
+ if (outcome === 'late')
49
+ logger.error({ message: DOMAIN_BINDING_SWEEP_STOP_LATE_LINE });
50
+ };
51
+ return { tick, stop };
52
+ }
53
+ //# sourceMappingURL=binding-sweeper.js.map
@@ -12,4 +12,5 @@ export * from './verify.js';
12
12
  export * from './approval.js';
13
13
  export * from './manual.js';
14
14
  export * from './registry.js';
15
+ export * from './binding-sweeper.js';
15
16
  //# sourceMappingURL=index.d.ts.map
package/dist/dns/index.js CHANGED
@@ -12,4 +12,5 @@ export * from './verify.js';
12
12
  export * from './approval.js';
13
13
  export * from './manual.js';
14
14
  export * from './registry.js';
15
+ export * from './binding-sweeper.js';
15
16
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @file Thin SQL adapter for `domain_binding` (host migrations that create the table and add its
3
+ * `version` column), on the host's instrumented kernel.
4
+ *
5
+ * The SQL template tag and the kernel are injected: this package carries no SQL driver, so the host
6
+ * passes the same tag its kernel accepts (for a Kysely kernel, Kysely's `sql`). Statements are
7
+ * opaque here; only the host's kernel interprets them.
8
+ */
9
+ import type { DelegationState, DnsPlanRequirement } from "../index.js";
10
+ /** `unknown` = transport failure, retried; `timeout` = the 48 h propagation cap was reached. */
11
+ export type DomainBindingStatus = "pending" | "propagated" | "mismatch" | "timeout" | "unknown";
12
+ /** One hostname the workspace wants served, with the records it needs and the last check. */
13
+ export interface DomainBinding {
14
+ hostname: string;
15
+ providerId: string;
16
+ zone: string;
17
+ requirements: DnsPlanRequirement[];
18
+ status: DomainBindingStatus;
19
+ delegation: DelegationState | null;
20
+ attempt: number;
21
+ startedAt: string;
22
+ nextCheckAt: string | null;
23
+ lastCheckedAt: string | null;
24
+ lastResult: unknown;
25
+ /** Compare-and-swap counter (the host's `version` column migration): bumped by every write; 0 for rows that predate it. */
26
+ version: number;
27
+ }
28
+ /** Workspace-scoped store. `put` is the verify path's alone: it is the single writer of `status`. */
29
+ export interface DomainBindingStore {
30
+ get(required: {
31
+ hostname: string;
32
+ }): Promise<DomainBinding | null>;
33
+ /**
34
+ * Compare-and-swap write: succeeds only while the stored row is still at `expectedVersion`
35
+ * (`null` = no row yet), storing `binding.version`. False means another writer got there first;
36
+ * nothing was changed and the caller's observation is stale.
37
+ */
38
+ put(required: {
39
+ binding: DomainBinding;
40
+ now: string;
41
+ expectedVersion: number | null;
42
+ }): Promise<boolean>;
43
+ /** Bindings whose next check is due at `now`, earliest first. */
44
+ listDue(required: {
45
+ now: string;
46
+ limit: number;
47
+ }): Promise<DomainBinding[]>;
48
+ }
49
+ /** A SQL template tag with a raw-fragment escape hatch; `Statement` is whatever the kernel runs. */
50
+ export interface DomainBindingSqlTag<Statement> {
51
+ (strings: TemplateStringsArray, ...values: unknown[]): Statement;
52
+ raw(text: string): Statement;
53
+ }
54
+ /**
55
+ * The kernel surface the store needs: one parameterised statement in, rows out. Rows come back
56
+ * untyped because the statement is opaque here; the store owns the `domain_binding` row shape.
57
+ */
58
+ export interface DomainBindingKernel<Statement> {
59
+ query(statement: Statement): Promise<unknown[]>;
60
+ }
61
+ /**
62
+ * Bind the store to one workspace; every statement is tenant scoped.
63
+ * @complexity O(1) keyed reads/writes; `listDue` O(limit) over the (workspace, next_check_at) index.
64
+ * @example createDomainBindingStore({ kernel, sql, workspaceId: "site-a" })
65
+ */
66
+ export declare function createDomainBindingStore<Statement>({ kernel, sql, workspaceId }: {
67
+ kernel: DomainBindingKernel<Statement>;
68
+ sql: DomainBindingSqlTag<Statement>;
69
+ workspaceId: string;
70
+ }, _options?: {}): DomainBindingStore;
71
+ //# sourceMappingURL=binding.repo.d.ts.map