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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (402) hide show
  1. package/CHANGELOG.md +7 -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 +158 -0
  11. package/dist/backup/site/backup-service.d.ts +336 -0
  12. package/dist/backup/site/backup-service.js +127 -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 +94 -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 +39 -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 +197 -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 +210 -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 +107 -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 +75 -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 +204 -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/coverage/lcov.js +1 -1
  133. package/dist/checks/env-access.d.ts +14 -1
  134. package/dist/checks/env-access.js +92 -6
  135. package/dist/checks/live-verify-checks.d.ts +29 -0
  136. package/dist/checks/live-verify-checks.js +30 -0
  137. package/dist/checks/quality-gates.d.ts +137 -0
  138. package/dist/checks/quality-gates.js +209 -0
  139. package/dist/core/deploy-types.d.ts +2 -0
  140. package/dist/deploy/admin-http/site-update-status.d.ts +8 -0
  141. package/dist/deploy/admin-http/site-update-status.js +15 -0
  142. package/dist/deploy/host-kit.d.ts +3 -0
  143. package/dist/deploy/index.d.ts +6 -0
  144. package/dist/deploy/index.js +6 -0
  145. package/dist/deploy/ops-runner.js +7 -0
  146. package/dist/deploy/ops-tool-contracts.d.ts +10 -1
  147. package/dist/deploy/react/Deployment.d.ts +37 -0
  148. package/dist/deploy/react/Deployment.js +94 -0
  149. package/dist/deploy/react/DockerfileTab.d.ts +72 -0
  150. package/dist/deploy/react/DockerfileTab.js +131 -0
  151. package/dist/deploy/react/HistoryTab.d.ts +43 -0
  152. package/dist/deploy/react/HistoryTab.js +12 -0
  153. package/dist/deploy/react/OverviewTab.d.ts +60 -0
  154. package/dist/deploy/react/OverviewTab.js +75 -0
  155. package/dist/deploy/react/PublishRunResult.d.ts +5 -1
  156. package/dist/deploy/react/PublishRunResult.js +4 -4
  157. package/dist/deploy/react/SiteUpdateNotice.d.ts +22 -0
  158. package/dist/deploy/react/SiteUpdateNotice.js +25 -0
  159. package/dist/deploy/react/StaticCredentialFields.d.ts +36 -0
  160. package/dist/deploy/react/StaticCredentialFields.js +63 -0
  161. package/dist/deploy/react/StaticCredentialSteps.d.ts +23 -0
  162. package/dist/deploy/react/StaticCredentialSteps.js +152 -0
  163. package/dist/deploy/react/StaticExportCard.d.ts +11 -0
  164. package/dist/deploy/react/StaticExportCard.js +97 -0
  165. package/dist/deploy/react/StaticPublishCredentials.d.ts +50 -0
  166. package/dist/deploy/react/StaticPublishCredentials.js +77 -0
  167. package/dist/deploy/react/StaticPublishForm.d.ts +12 -0
  168. package/dist/deploy/react/StaticPublishForm.js +91 -0
  169. package/dist/deploy/react/StaticSiteTab.d.ts +207 -0
  170. package/dist/deploy/react/StaticSiteTab.js +117 -0
  171. package/dist/deploy/react/deployment-visuals.d.ts +207 -0
  172. package/dist/deploy/react/deployment-visuals.js +101 -0
  173. package/dist/deploy/react/download-dockerfile.d.ts +14 -0
  174. package/dist/deploy/react/download-dockerfile.js +15 -0
  175. package/dist/deploy/react/hooks/publish-credential-draft.d.ts +33 -0
  176. package/dist/deploy/react/hooks/publish-credential-draft.js +54 -0
  177. package/dist/deploy/react/hooks/publish-credential-selection.d.ts +13 -0
  178. package/dist/deploy/react/hooks/publish-credential-selection.js +34 -0
  179. package/dist/deploy/react/hooks/publish-credential-writes.d.ts +20 -0
  180. package/dist/deploy/react/hooks/publish-credential-writes.js +99 -0
  181. package/dist/deploy/react/hooks/static-publish-actions.d.ts +10 -0
  182. package/dist/deploy/react/hooks/static-publish-actions.js +62 -0
  183. package/dist/deploy/react/hooks/static-publish-form.hooks.d.ts +38 -0
  184. package/dist/deploy/react/hooks/static-publish-form.hooks.js +103 -0
  185. package/dist/deploy/react/hooks/static-publish-run.hooks.d.ts +28 -0
  186. package/dist/deploy/react/hooks/static-publish-run.hooks.js +92 -0
  187. package/dist/deploy/react/hooks/use-dockerfile-source.hooks.d.ts +148 -0
  188. package/dist/deploy/react/hooks/use-dockerfile-source.hooks.js +155 -0
  189. package/dist/deploy/react/hooks/use-publish-credentials.hooks.d.ts +268 -0
  190. package/dist/deploy/react/hooks/use-publish-credentials.hooks.js +52 -0
  191. package/dist/deploy/react/hooks/use-static-export.hooks.d.ts +128 -0
  192. package/dist/deploy/react/hooks/use-static-export.hooks.js +159 -0
  193. package/dist/deploy/react/hooks/use-static-publish.hooks.d.ts +208 -0
  194. package/dist/deploy/react/hooks/use-static-publish.hooks.js +48 -0
  195. package/dist/deploy/react/index.d.ts +4 -0
  196. package/dist/deploy/react/index.js +2 -0
  197. package/dist/deploy/react/rules.d.ts +363 -0
  198. package/dist/deploy/react/rules.js +314 -0
  199. package/dist/deploy/react/use-deployment-overview.hooks.d.ts +41 -0
  200. package/dist/deploy/react/use-deployment-overview.hooks.js +11 -0
  201. package/dist/deploy/site/agent-tools.d.ts +42 -0
  202. package/dist/deploy/site/agent-tools.js +119 -0
  203. package/dist/deploy/site/deploy-config-registry.d.ts +155 -0
  204. package/dist/deploy/site/deploy-config-registry.js +124 -0
  205. package/dist/deploy/site/deploy-config.d.ts +97 -0
  206. package/dist/deploy/site/deploy-config.js +115 -0
  207. package/dist/deploy/site/deploy-ops/agent-tools.d.ts +22 -0
  208. package/dist/deploy/site/deploy-ops/agent-tools.js +76 -0
  209. package/dist/deploy/site/deploy-ops/registry.d.ts +134 -0
  210. package/dist/deploy/site/deploy-ops/registry.js +106 -0
  211. package/dist/deploy/site/deploy-ops/run-ops.d.ts +66 -0
  212. package/dist/deploy/site/deploy-ops/run-ops.js +34 -0
  213. package/dist/deploy/site/deploy-ops/secret-confirm.d.ts +36 -0
  214. package/dist/deploy/site/deploy-ops/secret-confirm.js +27 -0
  215. package/dist/deploy/site/deploy-targets/host-kit.d.ts +28 -0
  216. package/dist/deploy/site/deploy-targets/host-kit.js +120 -0
  217. package/dist/deploy/site/deploy-targets/registry.d.ts +157 -0
  218. package/dist/deploy/site/deploy-targets/registry.js +130 -0
  219. package/dist/deploy/site/deploy-targets/types.d.ts +27 -0
  220. package/dist/deploy/site/deploy-targets/types.js +2 -0
  221. package/dist/deploy/site/dockerfile.d.ts +137 -0
  222. package/dist/deploy/site/dockerfile.js +101 -0
  223. package/dist/deploy/site/export-run.d.ts +137 -0
  224. package/dist/deploy/site/export-run.js +152 -0
  225. package/dist/deploy/site/ports.d.ts +115 -0
  226. package/dist/deploy/site/ports.js +2 -0
  227. package/dist/deploy/site/publish-agent-tools.d.ts +18 -0
  228. package/dist/deploy/site/publish-agent-tools.js +120 -0
  229. package/dist/deploy/site/publish-candidate.d.ts +26 -0
  230. package/dist/deploy/site/publish-candidate.js +37 -0
  231. package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.d.ts +78 -0
  232. package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.js +88 -0
  233. package/dist/deploy/site/publish-credentials/compatibility-port.d.ts +38 -0
  234. package/dist/deploy/site/publish-credentials/compatibility-port.js +19 -0
  235. package/dist/deploy/site/publish-credentials/execution-mode.d.ts +43 -0
  236. package/dist/deploy/site/publish-credentials/execution-mode.js +19 -0
  237. package/dist/deploy/site/publish-credentials/store-owner.d.ts +11 -0
  238. package/dist/deploy/site/publish-credentials/store-owner.js +9 -0
  239. package/dist/deploy/site/publish-credentials/store-resolution.d.ts +55 -0
  240. package/dist/deploy/site/publish-credentials/store-resolution.js +100 -0
  241. package/dist/deploy/site/publish-credentials/store-validation.d.ts +68 -0
  242. package/dist/deploy/site/publish-credentials/store-validation.js +182 -0
  243. package/dist/deploy/site/publish-credentials/store.d.ts +321 -0
  244. package/dist/deploy/site/publish-credentials/store.js +367 -0
  245. package/dist/deploy/site/publish-credentials/types.d.ts +85 -0
  246. package/dist/deploy/site/publish-credentials/types.js +2 -0
  247. package/dist/deploy/site/publish-tool-capabilities.d.ts +123 -0
  248. package/dist/deploy/site/publish-tool-capabilities.js +175 -0
  249. package/dist/deploy/site/publish-tool-credential.d.ts +48 -0
  250. package/dist/deploy/site/publish-tool-credential.js +284 -0
  251. package/dist/deploy/site/publish-tool-deps.d.ts +205 -0
  252. package/dist/deploy/site/publish-tool-deps.js +15 -0
  253. package/dist/deploy/site/publish-tool-execution.d.ts +78 -0
  254. package/dist/deploy/site/publish-tool-execution.js +313 -0
  255. package/dist/deploy/site/publish-tool-schema.d.ts +29 -0
  256. package/dist/deploy/site/publish-tool-schema.js +38 -0
  257. package/dist/deploy/site/static-publish/adapter-export.d.ts +54 -0
  258. package/dist/deploy/site/static-publish/adapter-export.js +89 -0
  259. package/dist/deploy/site/static-publish/adapter-plan.d.ts +99 -0
  260. package/dist/deploy/site/static-publish/adapter-plan.js +112 -0
  261. package/dist/deploy/site/static-publish/adapter.d.ts +182 -0
  262. package/dist/deploy/site/static-publish/adapter.js +321 -0
  263. package/dist/deploy/site/static-publish/admin-publish-read.d.ts +209 -0
  264. package/dist/deploy/site/static-publish/admin-publish-read.js +118 -0
  265. package/dist/deploy/site/static-publish/credentials.d.ts +114 -0
  266. package/dist/deploy/site/static-publish/credentials.js +298 -0
  267. package/dist/deploy/site/static-publish/domain-publish-rows.d.ts +25 -0
  268. package/dist/deploy/site/static-publish/domain-publish-rows.js +43 -0
  269. package/dist/deploy/site/static-publish/domain-publish-tool.d.ts +19 -0
  270. package/dist/deploy/site/static-publish/domain-publish-tool.js +111 -0
  271. package/dist/deploy/site/static-publish/inspection.d.ts +24 -0
  272. package/dist/deploy/site/static-publish/inspection.js +69 -0
  273. package/dist/deploy/site/static-publish/publish-history.d.ts +197 -0
  274. package/dist/deploy/site/static-publish/publish-history.js +153 -0
  275. package/dist/deploy/site/static-publish/publish-run.d.ts +156 -0
  276. package/dist/deploy/site/static-publish/publish-run.js +186 -0
  277. package/dist/deploy/site/static-publish/types.d.ts +168 -0
  278. package/dist/deploy/site/static-publish/types.js +2 -0
  279. package/dist/deploy/site/static-publish/verify.d.ts +237 -0
  280. package/dist/deploy/site/static-publish/verify.js +284 -0
  281. package/dist/deploy/site/tool-registrations.d.ts +97 -0
  282. package/dist/deploy/site/tool-registrations.js +130 -0
  283. package/dist/deploy/site/types.d.ts +51 -0
  284. package/dist/deploy/site/types.js +2 -0
  285. package/dist/deploy/site-update/check-for-update.d.ts +19 -0
  286. package/dist/deploy/site-update/check-for-update.js +19 -0
  287. package/dist/deploy/site-update/contracts.d.ts +161 -0
  288. package/dist/deploy/site-update/contracts.js +94 -0
  289. package/dist/deploy/site-update/desktop-site-update.d.ts +66 -0
  290. package/dist/deploy/site-update/desktop-site-update.js +43 -0
  291. package/dist/deploy/site-update/fake-site-update.d.ts +39 -0
  292. package/dist/deploy/site-update/fake-site-update.js +52 -0
  293. package/dist/deploy/site-update/run-site-update.d.ts +121 -0
  294. package/dist/deploy/site-update/run-site-update.js +219 -0
  295. package/dist/deploy/site-update/self-hosted-site-update.d.ts +71 -0
  296. package/dist/deploy/site-update/self-hosted-site-update.js +79 -0
  297. package/dist/deploy/target-contracts.d.ts +3 -0
  298. package/dist/deploy/tool.d.ts +5 -8
  299. package/dist/deploy/tool.js +6 -9
  300. package/dist/dns/binding-sweeper.d.ts +72 -0
  301. package/dist/dns/binding-sweeper.js +53 -0
  302. package/dist/dns/index.d.ts +1 -0
  303. package/dist/dns/index.js +1 -0
  304. package/dist/dns/site/binding.repo.d.ts +71 -0
  305. package/dist/dns/site/binding.repo.js +45 -0
  306. package/dist/dns/site/dns-changes.d.ts +90 -0
  307. package/dist/dns/site/dns-changes.js +271 -0
  308. package/dist/dns/site/dns-tools.d.ts +46 -0
  309. package/dist/dns/site/dns-tools.js +204 -0
  310. package/dist/dns/site/mail-dns-status.d.ts +111 -0
  311. package/dist/dns/site/mail-dns-status.js +190 -0
  312. package/dist/dns/site/mail-dns-tools.d.ts +33 -0
  313. package/dist/dns/site/mail-dns-tools.js +62 -0
  314. package/dist/dns/site/mail-requirements.d.ts +30 -0
  315. package/dist/dns/site/mail-requirements.js +78 -0
  316. package/dist/dns/site/tool-deps.d.ts +21 -0
  317. package/dist/dns/site/tool-deps.js +2 -0
  318. package/dist/dns/site/tools.d.ts +74 -0
  319. package/dist/dns/site/tools.js +124 -0
  320. package/dist/local-dev/bind-host.d.ts +80 -0
  321. package/dist/local-dev/bind-host.js +90 -0
  322. package/dist/local-dev/dev-proxy-upstream.d.ts +69 -0
  323. package/dist/local-dev/dev-proxy-upstream.js +63 -0
  324. package/dist/local-dev/index.d.ts +28 -0
  325. package/dist/local-dev/index.js +25 -0
  326. package/dist/packaging/electron/archive.d.ts +2 -9
  327. package/dist/packaging/electron/asar-adapter.d.ts +2 -1
  328. package/dist/packaging/electron/entry.d.ts +2 -0
  329. package/dist/packaging/electron/move-to-applications.d.ts +165 -0
  330. package/dist/packaging/electron/move-to-applications.js +162 -0
  331. package/dist/packaging/electron/policies.d.ts +33 -4
  332. package/dist/packaging/electron/policies.js +29 -10
  333. package/dist/packaging/electron/ports.d.ts +1 -6
  334. package/dist/packaging/electron/staging.d.ts +11 -2
  335. package/dist/packaging/electron/staging.js +15 -5
  336. package/dist/packaging/electron/update-manifest-merge.js +0 -2
  337. package/dist/react/site-share-expiry/ShareExpiryControls.d.ts +29 -0
  338. package/dist/react/site-share-expiry/ShareExpiryControls.js +7 -0
  339. package/dist/react/site-share-expiry/index.d.ts +2 -0
  340. package/dist/react/site-share-expiry/index.js +2 -0
  341. package/dist/source-control/react/ProvidersTab.d.ts +98 -0
  342. package/dist/source-control/react/ProvidersTab.js +195 -0
  343. package/dist/source-control/react/SourceControl.d.ts +51 -0
  344. package/dist/source-control/react/SourceControl.js +61 -0
  345. package/dist/source-control/react/hooks/use-source-control-credentials.hooks.d.ts +128 -0
  346. package/dist/source-control/react/hooks/use-source-control-credentials.hooks.js +102 -0
  347. package/dist/source-control/react/rules.d.ts +167 -0
  348. package/dist/source-control/react/rules.js +125 -0
  349. package/dist/source-control/react/source-control-visuals.d.ts +75 -0
  350. package/dist/source-control/react/source-control-visuals.js +48 -0
  351. package/dist/source-control/site/agent-tools.d.ts +5 -0
  352. package/dist/source-control/site/agent-tools.js +30 -0
  353. package/dist/source-control/site/bundled-provider-registry.d.ts +33 -0
  354. package/dist/source-control/site/bundled-provider-registry.js +37 -0
  355. package/dist/source-control/site/commit-schema.d.ts +40 -0
  356. package/dist/source-control/site/commit-schema.js +29 -0
  357. package/dist/source-control/site/commit-target.d.ts +26 -0
  358. package/dist/source-control/site/commit-target.js +58 -0
  359. package/dist/source-control/site/credential-form.d.ts +36 -0
  360. package/dist/source-control/site/credential-form.js +102 -0
  361. package/dist/source-control/site/credential-setup.d.ts +107 -0
  362. package/dist/source-control/site/credential-setup.js +216 -0
  363. package/dist/source-control/site/provider-kit.d.ts +37 -0
  364. package/dist/source-control/site/provider-kit.js +35 -0
  365. package/dist/source-control/site/provider-module.d.ts +251 -0
  366. package/dist/source-control/site/provider-module.js +2 -0
  367. package/dist/source-control/site/saved-key-bindings.d.ts +4 -0
  368. package/dist/source-control/site/saved-key-bindings.js +4 -0
  369. package/dist/source-control/site/static-site-packager-port.d.ts +37 -0
  370. package/dist/source-control/site/static-site-packager-port.js +2 -0
  371. package/dist/source-control/site/store.d.ts +209 -0
  372. package/dist/source-control/site/store.js +374 -0
  373. package/dist/source-control/site/store.validation.d.ts +72 -0
  374. package/dist/source-control/site/store.validation.js +168 -0
  375. package/dist/source-control/site/tool-registrations.d.ts +190 -0
  376. package/dist/source-control/site/tool-registrations.js +379 -0
  377. package/dist/static-export/asset-crawl.d.ts +30 -0
  378. package/dist/static-export/asset-crawl.js +71 -0
  379. package/dist/static-export/dynamic-asset-locations.d.ts +23 -0
  380. package/dist/static-export/dynamic-asset-locations.js +34 -0
  381. package/dist/static-export/html-url-locations.d.ts +3 -1
  382. package/dist/static-export/html-url-locations.js +43 -9
  383. package/dist/static-export/runner.js +26 -27
  384. package/dist/static-export/site/export-preflight.d.ts +48 -0
  385. package/dist/static-export/site/export-preflight.js +82 -0
  386. package/dist/static-export/site/media-original-urls.d.ts +57 -0
  387. package/dist/static-export/site/media-original-urls.js +109 -0
  388. package/dist/static-export/site/ports.d.ts +82 -0
  389. package/dist/static-export/site/ports.js +29 -0
  390. package/dist/static-export/site/public-origin-policy.d.ts +32 -0
  391. package/dist/static-export/site/public-origin-policy.js +68 -0
  392. package/dist/static-export/site/route-manifest.d.ts +65 -0
  393. package/dist/static-export/site/route-manifest.js +139 -0
  394. package/dist/static-export/site/site-exporter.d.ts +158 -0
  395. package/dist/static-export/site/site-exporter.js +112 -0
  396. package/dist/static-export/site/static-security-headers.d.ts +39 -0
  397. package/dist/static-export/site/static-security-headers.js +43 -0
  398. package/dist/static-export/site/theme-preview-manifest.d.ts +35 -0
  399. package/dist/static-export/site/theme-preview-manifest.js +28 -0
  400. package/dist/static-export/transforms.d.ts +1 -1
  401. package/dist/static-export/transforms.js +3 -3
  402. package/package.json +911 -7
@@ -0,0 +1,45 @@
1
+ const COLUMN_LIST = "hostname, provider_id, zone, requirements_json, status, delegation_state, attempt, started_at, next_check_at, last_checked_at, last_result_json, version";
2
+ function fromRow(row) {
3
+ return {
4
+ hostname: row.hostname, providerId: row.provider_id, zone: row.zone,
5
+ requirements: JSON.parse(row.requirements_json),
6
+ status: row.status, delegation: row.delegation_state,
7
+ // Postgres drivers may hand integers back as strings; the column is integer on both dialects.
8
+ attempt: Number(row.attempt), startedAt: row.started_at, nextCheckAt: row.next_check_at,
9
+ lastCheckedAt: row.last_checked_at, lastResult: row.last_result_json === null ? null : JSON.parse(row.last_result_json),
10
+ version: Number(row.version),
11
+ };
12
+ }
13
+ /**
14
+ * Bind the store to one workspace; every statement is tenant scoped.
15
+ * @complexity O(1) keyed reads/writes; `listDue` O(limit) over the (workspace, next_check_at) index.
16
+ * @example createDomainBindingStore({ kernel, sql, workspaceId: "site-a" })
17
+ */
18
+ export function createDomainBindingStore({ kernel, sql, workspaceId }, _options = {}) {
19
+ const COLUMNS = sql.raw(COLUMN_LIST);
20
+ return {
21
+ async get({ hostname }) {
22
+ const [row] = await kernel.query(sql `SELECT ${COLUMNS} FROM domain_binding WHERE workspace_id = ${workspaceId} AND hostname = ${hostname}`);
23
+ return row ? fromRow(row) : null;
24
+ },
25
+ async put({ binding: b, now, expectedVersion }) {
26
+ const requirements = JSON.stringify(b.requirements);
27
+ const lastResult = b.lastResult === null ? null : JSON.stringify(b.lastResult);
28
+ // RETURNING tells a write that happened from one that lost the race (no row matched).
29
+ const written = expectedVersion === null
30
+ ? await kernel.query(sql `INSERT INTO domain_binding (workspace_id, hostname, provider_id, zone, requirements_json, status, delegation_state, attempt, started_at, next_check_at, last_checked_at, last_result_json, version, created_at, updated_at)
31
+ VALUES (${workspaceId}, ${b.hostname}, ${b.providerId}, ${b.zone}, ${requirements}, ${b.status}, ${b.delegation}, ${b.attempt}, ${b.startedAt}, ${b.nextCheckAt}, ${b.lastCheckedAt}, ${lastResult}, ${b.version}, ${now}, ${now})
32
+ ON CONFLICT (workspace_id, hostname) DO NOTHING RETURNING version`)
33
+ : await kernel.query(sql `UPDATE domain_binding SET provider_id = ${b.providerId}, zone = ${b.zone}, requirements_json = ${requirements}, status = ${b.status},
34
+ delegation_state = ${b.delegation}, attempt = ${b.attempt}, started_at = ${b.startedAt}, next_check_at = ${b.nextCheckAt},
35
+ last_checked_at = ${b.lastCheckedAt}, last_result_json = ${lastResult}, version = ${b.version}, updated_at = ${now}
36
+ WHERE workspace_id = ${workspaceId} AND hostname = ${b.hostname} AND version = ${expectedVersion} RETURNING version`);
37
+ return written.length === 1;
38
+ },
39
+ async listDue({ now, limit }) {
40
+ const rows = await kernel.query(sql `SELECT ${COLUMNS} FROM domain_binding WHERE workspace_id = ${workspaceId} AND next_check_at IS NOT NULL AND next_check_at <= ${now} ORDER BY next_check_at, hostname LIMIT ${limit}`);
41
+ return rows.map(fromRow);
42
+ },
43
+ };
44
+ }
45
+ //# sourceMappingURL=binding.repo.js.map
@@ -0,0 +1,90 @@
1
+ import { type AuthoritativeDnsPort, type DelegationCheck, type DnsChangePlan, type DnsInstructions, type DnsPlanRequirement, type DnsProviderContext, type DnsProviderRegistry, type DnsVerification } from "../index.js";
2
+ import type { DomainBinding, DomainBindingStore } from "./binding.repo.js";
3
+ import { type DnsRequirementInclude, type MailRequirementsPort } from "./mail-requirements.js";
4
+ /** Kernel blockers plus the host-level ones found before a plan can be trusted. */
5
+ export interface DomainDnsBlocker {
6
+ code: string;
7
+ name: string;
8
+ message: string;
9
+ suggestion?: string;
10
+ }
11
+ export interface DomainDnsPlan {
12
+ hostname: string;
13
+ providerId: string;
14
+ zone: string;
15
+ /** False when no zone could be located; the zone shown is then the hostname itself. */
16
+ zoneFound: boolean;
17
+ delegation: DelegationCheck | null;
18
+ plan: DnsChangePlan;
19
+ blockers: DomainDnsBlocker[];
20
+ }
21
+ /** Ports for one workspace. `context` carries the pre-resolved provider credentials. */
22
+ export interface DnsChangePorts {
23
+ registry: DnsProviderRegistry;
24
+ resolver: AuthoritativeDnsPort;
25
+ context: DnsProviderContext;
26
+ bindings?: DomainBindingStore;
27
+ /** The resolved mailer's `domainRequirements`, read for `include: ["mail"]`. Absent: that include refuses. */
28
+ mailRequirements?: MailRequirementsPort;
29
+ }
30
+ /** A hostname, optionally its requirements, and what to add to them. */
31
+ export interface DnsChangeRequest {
32
+ hostname: string;
33
+ requirements?: DnsPlanRequirement[];
34
+ include?: DnsRequirementInclude[];
35
+ }
36
+ /**
37
+ * Plan the record changes that would satisfy the hostname's requirements. Read-only.
38
+ * @complexity O(names · types) DNS reads for the manual provider, then the kernel's O(r·c) plan.
39
+ */
40
+ export declare function planDomainDns(required: DnsChangeRequest, ports: DnsChangePorts): Promise<DomainDnsPlan>;
41
+ /** Copyable rows for a person to enter at their DNS host. A blocked plan still lists what is required. */
42
+ export declare function domainDnsInstructions(required: DnsChangeRequest, ports: DnsChangePorts): Promise<{
43
+ planned: DomainDnsPlan;
44
+ instructions: DnsInstructions;
45
+ }>;
46
+ /** A read-only look: the plan and rows plus one unsaved check and the last saved binding. */
47
+ export interface DomainDnsInspection {
48
+ planned: DomainDnsPlan;
49
+ instructions: DnsInstructions;
50
+ /** `null` when no zone was found, so there are no authoritative nameservers to ask. */
51
+ verification: DnsVerification | null;
52
+ /** The saved tracking state (status, timestamps), or `null` when `dns_verify` never ran for it. */
53
+ binding: DomainBinding | null;
54
+ }
55
+ /**
56
+ * Plan, rows and one authoritative check of every required record, WITHOUT saving anything
57
+ * (the read-permission view; `verifyDomainDns` stays the single writer of `domain_binding.status`).
58
+ * @complexity The plan's reads plus O(records · nameservers) DNS queries.
59
+ */
60
+ export declare function inspectDomainDns(required: DnsChangeRequest, ports: DnsChangePorts): Promise<DomainDnsInspection>;
61
+ export interface DomainDnsVerifyResult {
62
+ binding: DomainBinding;
63
+ delegation: DelegationCheck;
64
+ verification: DnsVerification;
65
+ }
66
+ type VerifyPorts = DnsChangePorts & {
67
+ bindings: DomainBindingStore;
68
+ now: () => number;
69
+ };
70
+ /** How often `dns_verify` recomputes after losing a write race before giving up. */
71
+ export declare const VERIFY_WRITE_ATTEMPTS = 3;
72
+ /**
73
+ * Start or continue propagation tracking: save the requirements, check every authoritative
74
+ * nameserver once now, and schedule the next check (30 s doubling to 10 min, 48 h cap).
75
+ * The save is compare-and-swap: when a concurrent check saved first, this one is recomputed from
76
+ * the newer binding (up to {@link VERIFY_WRITE_ATTEMPTS} times) instead of overwriting it.
77
+ * @complexity O(records · nameservers) DNS queries plus one keyed write, per attempt.
78
+ */
79
+ export declare function verifyDomainDns(required: DnsChangeRequest, ports: VerifyPorts): Promise<DomainDnsVerifyResult>;
80
+ /**
81
+ * One sweep over this workspace's due bindings, oldest first and one at a time (each check is
82
+ * already O(records · nameservers) concurrent queries). Returns the hostnames checked and saved;
83
+ * a binding another writer (e.g. `dns_verify` with new requirements) saved meanwhile is skipped,
84
+ * its newer state standing, and comes due again on its own schedule.
85
+ */
86
+ export declare function verifyDueDomainBindings(required: {
87
+ limit: number;
88
+ }, ports: VerifyPorts): Promise<string[]>;
89
+ export {};
90
+ //# sourceMappingURL=dns-changes.d.ts.map
@@ -0,0 +1,271 @@
1
+ /**
2
+ * @file DNS plan / instructions / verify over the Jini DNS kernel (`@jini-ai/devops/dns`, lots D1–D3).
3
+ *
4
+ * Planning and verification are the kernel's; this file only orders the steps for one host
5
+ * workspace: requirements (from the caller or the saved `domain_binding`) → zone → NS delegation
6
+ * → current records → plan. Nothing here writes DNS (no apply engine in v1): a person enters the
7
+ * `dns_instructions` rows at their DNS host, then `dns_verify` checks the authoritative servers.
8
+ *
9
+ * `verifyDomainDns` is the single writer of `domain_binding.status`.
10
+ */
11
+ import { ToolInputError } from "@jini-ai/core";
12
+ import { canonicalJson, checkDelegation, isExpired, MANUAL_DNS_PROVIDER_ID, nextCheckDelayMs, normalizeDnsName, planDnsChanges, renderDnsInstructions, settlePort, verifyRequirements, } from "../index.js";
13
+ import { withMailRequirements } from "./mail-requirements.js";
14
+ /** The registered provider, or a caller error naming the saved id. */
15
+ function providerFor(required, ports) {
16
+ const provider = ports.registry.get({ id: required.providerId })?.provider;
17
+ if (provider === undefined)
18
+ throw new ToolInputError({ message: `${required.errorPrefix}: the DNS provider '${required.providerId}' saved for ${required.hostname} is not installed.` });
19
+ return provider;
20
+ }
21
+ /**
22
+ * Caller requirements win; otherwise the binding's persisted ones. `include: ["mail"]` then adds the
23
+ * active mail provider's records (through the port). No requirements is a caller error.
24
+ */
25
+ async function resolveTarget(required, ports) {
26
+ const binding = (await ports.bindings?.get({ hostname: required.hostname })) ?? null;
27
+ const providerId = binding?.providerId ?? MANUAL_DNS_PROVIDER_ID;
28
+ const provider = providerFor({ ...required, providerId }, ports);
29
+ const base = requestedRequirements({ required, binding });
30
+ const requirements = required.include?.includes("mail") ? await withMailRequirements({ ...required, requirements: base }, { ...ports, provider }) : base;
31
+ if (requirements.length === 0) {
32
+ throw new ToolInputError({ message: `${required.errorPrefix}: no DNS requirements are saved for ${required.hostname}; pass requirements (the records the host or mail provider asked for).` });
33
+ }
34
+ return { hostname: required.hostname, providerId, provider, requirements, binding };
35
+ }
36
+ /** Explicit requirements, including an empty list, take precedence over a saved binding. */
37
+ function requestedRequirements({ required, binding }, _options = {}) {
38
+ return required.requirements ?? binding?.requirements ?? [];
39
+ }
40
+ /** The provider's zone for the hostname; the saved zone (or the hostname) when none answers. */
41
+ async function locateZone(target, ports) {
42
+ const result = await settlePort({ call: () => target.provider.findZone(ports.context, { hostname: target.hostname }) });
43
+ if (result.status === "ok" && result.value !== null)
44
+ return { zone: result.value.zone, ref: result.value.ref, found: true };
45
+ const fallback = target.binding?.zone ?? target.hostname;
46
+ return { zone: fallback, ref: fallback, found: false };
47
+ }
48
+ const INVENTORY_RANK = { complete: 0, partial: 1, unknown: 2 };
49
+ /** The least complete of several inventories: one unread part makes the whole view that unread. */
50
+ const worstInventory = (inventories) => inventories.reduce((worst, next) => (INVENTORY_RANK[next] > INVENTORY_RANK[worst] ? next : worst), "complete");
51
+ /** Distinct normalized record names the requirements ask for. */
52
+ function requirementNames(target) {
53
+ return [...new Set(target.requirements.flatMap(requirement => requirement.records).map(record => normalizeDnsName({ name: record.name })))];
54
+ }
55
+ const inZone = ({ name, zone }, _options = {}) => name === zone || name.endsWith(`.${zone}`);
56
+ /** `a.b.example.com` → itself and each parent below the TLD (a wildcard label is dropped). */
57
+ function selfAndAncestors({ name }, _options = {}) {
58
+ const names = [];
59
+ for (let candidate = normalizeDnsName({ name }).replace(/^\*\./, ""); candidate.includes("."); candidate = candidate.slice(candidate.indexOf(".") + 1))
60
+ names.push(candidate);
61
+ return names;
62
+ }
63
+ /**
64
+ * Names whose CAA set can cover a requirement (RFC 8659 tree climbing) and are not already listed:
65
+ * the zone apex and every ancestor up to (not including) the TLD. Only read when a requirement
66
+ * names a CA, since only then does the planner check CAA.
67
+ */
68
+ function caaNames(target) {
69
+ if (!target.requirements.some(requirement => requirement.caa !== undefined))
70
+ return [];
71
+ const listed = new Set(requirementNames(target));
72
+ const covered = target.requirements.flatMap(requirement => [requirement.domain, ...requirement.records.map(record => record.name)]);
73
+ return [...new Set(covered.flatMap(name => selfAndAncestors({ name })))].filter(name => !listed.has(name));
74
+ }
75
+ /** The provider's zone ref for a name outside the target zone; `null` when no zone serves it, `undefined` when unreadable. */
76
+ async function zoneRefOf({ name, target, ports }, _options = {}) {
77
+ const result = await settlePort({ call: () => target.provider.findZone(ports.context, { hostname: name }) });
78
+ return result.status === "ok" ? (result.value?.ref ?? null) : undefined;
79
+ }
80
+ /** The CAA set at one ancestor, read from whichever zone serves it (a parent zone above a delegated child included). */
81
+ async function caaAt({ name, zone, target, ports }, _options = {}) {
82
+ const ref = inZone({ name, zone: zone.zone }) ? zone.ref : await zoneRefOf({ name, target, ports });
83
+ // No zone serves the name: nothing there can restrict issuance.
84
+ if (ref === null)
85
+ return { records: [], inventory: "complete" };
86
+ if (ref === undefined)
87
+ return { records: [], inventory: "unknown" };
88
+ const result = await settlePort({ call: () => target.provider.listRecords(ports.context, { zoneRef: ref, names: [name] }) });
89
+ if (result.status !== "ok")
90
+ return { records: [], inventory: "unknown" };
91
+ return { records: result.value.records.filter(record => record.type === "CAA"), inventory: result.value.inventory };
92
+ }
93
+ /**
94
+ * Current records at the required names, plus the CAA sets of their ancestors; anything unreadable
95
+ * is `unknown`, never "empty" (an unread CAA restriction must not pass as no restriction).
96
+ */
97
+ async function listCurrent({ target, zone, ports }, _options = {}) {
98
+ const names = requirementNames(target);
99
+ const [result, ancestors] = await Promise.all([
100
+ settlePort({ call: () => target.provider.listRecords(ports.context, { zoneRef: zone.ref, names }) }),
101
+ Promise.all(caaNames(target).map(name => caaAt({ name, zone, target, ports }))),
102
+ ]);
103
+ const own = result.status === "ok" ? result.value : { records: [], inventory: "unknown" };
104
+ return { records: [...own.records, ...ancestors.flatMap(read => read.records)], inventory: worstInventory([own.inventory, ...ancestors.map(read => read.inventory)]) };
105
+ }
106
+ /** Which zone serves `name`, as far as can be read: the target zone unless proven otherwise. */
107
+ async function authorityOf({ name, zone, target, ports }, _options = {}) {
108
+ if (!inZone({ name, zone: zone.zone }))
109
+ return undefined;
110
+ if (name === zone.zone || name === normalizeDnsName({ name: target.hostname }))
111
+ return zone.zone;
112
+ const result = await settlePort({ call: () => target.provider.findZone(ports.context, { hostname: name }) });
113
+ // An unreadable lookup is not proof of another zone.
114
+ return result.status === "ok" && result.value !== null ? result.value.zone : zone.zone;
115
+ }
116
+ /**
117
+ * Every requirement name must be served by the hostname's zone: outside it, or inside a child zone
118
+ * delegated elsewhere, its records would be read from and entered at the wrong DNS host. Such a
119
+ * request is refused; each zone is planned on its own.
120
+ */
121
+ async function assertSingleZone(required, ports) {
122
+ const { target, zone } = required;
123
+ const misplaced = [];
124
+ for (const name of requirementNames(target)) {
125
+ const authority = await authorityOf({ name, zone, target, ports });
126
+ if (authority !== zone.zone)
127
+ misplaced.push(authority === undefined ? `${name} (outside it)` : `${name} (served by the delegated zone ${authority})`);
128
+ }
129
+ if (misplaced.length === 0)
130
+ return;
131
+ throw new ToolInputError({ message: `${required.errorPrefix}: ${misplaced.join(", ")} is not in the zone ${zone.zone} that serves ${target.hostname}; plan and verify each zone separately.` });
132
+ }
133
+ /** The zone serving the target, after checking every requirement belongs to it (when one was found). */
134
+ async function locateCheckedZone(required, ports) {
135
+ const zone = await locateZone(required.target, ports);
136
+ if (zone.found)
137
+ await assertSingleZone({ ...required, zone }, ports);
138
+ return zone;
139
+ }
140
+ function hostBlockers({ hostname, delegation }, _options = {}) {
141
+ // No delegation is read only when no zone was found.
142
+ if (delegation === null) {
143
+ return [{ code: "zone_not_found", name: hostname, message: `No DNS zone serving ${hostname} could be found, so its current records were not read.`, suggestion: "Check that the domain is registered and has nameservers, then plan again." }];
144
+ }
145
+ if (delegation.state === "delegated")
146
+ return [];
147
+ // Registrar vs DNS host split: records edited at a host the zone is not delegated to resolve nowhere.
148
+ return [{ code: delegation.state === "not_delegated" ? "not_delegated" : "delegation_unknown", name: delegation.zone, message: delegation.reason }];
149
+ }
150
+ async function planTarget(required, ports) {
151
+ const { target } = required;
152
+ const zone = await locateCheckedZone(required, ports);
153
+ const delegation = zone.found ? await checkDelegation({ zone: zone.zone, resolver: ports.resolver }) : null;
154
+ const current = delegation?.state === "delegated" ? await listCurrent({ target, zone, ports }) : { records: [], inventory: "unknown" };
155
+ const { capabilities } = target.provider;
156
+ const plan = planDnsChanges({ providerId: target.providerId, zone: zone.zone, current: current.records, requirements: target.requirements, inventory: current.inventory }, { apexFlattening: capabilities.apexFlattening, recordTypes: capabilities.recordTypes });
157
+ return { hostname: target.hostname, providerId: target.providerId, zone: zone.zone, zoneFound: zone.found, delegation, plan, blockers: [...hostBlockers({ hostname: target.hostname, delegation }), ...plan.blockers] };
158
+ }
159
+ /**
160
+ * Plan the record changes that would satisfy the hostname's requirements. Read-only.
161
+ * @complexity O(names · types) DNS reads for the manual provider, then the kernel's O(r·c) plan.
162
+ */
163
+ export async function planDomainDns(required, ports) {
164
+ const errorPrefix = "dns_plan";
165
+ return planTarget({ target: await resolveTarget({ ...required, errorPrefix }, ports), errorPrefix }, ports);
166
+ }
167
+ /** Copyable rows for a person to enter at their DNS host. A blocked plan still lists what is required. */
168
+ export async function domainDnsInstructions(required, ports) {
169
+ const errorPrefix = "dns_instructions";
170
+ const target = await resolveTarget({ ...required, errorPrefix }, ports);
171
+ const planned = await planTarget({ target, errorPrefix }, ports);
172
+ return { planned, instructions: instructionsFor(target, planned) };
173
+ }
174
+ /** The provider's own rendering of the rows when it has one, else the kernel's. */
175
+ function instructionsFor(target, planned) {
176
+ const input = [{ plan: planned.plan }, { requirements: target.requirements }];
177
+ return target.provider.instructions ? target.provider.instructions(...input) : renderDnsInstructions(...input);
178
+ }
179
+ /**
180
+ * Plan, rows and one authoritative check of every required record, WITHOUT saving anything
181
+ * (the read-permission view; `verifyDomainDns` stays the single writer of `domain_binding.status`).
182
+ * @complexity The plan's reads plus O(records · nameservers) DNS queries.
183
+ */
184
+ export async function inspectDomainDns(required, ports) {
185
+ const errorPrefix = "dns_status";
186
+ const target = await resolveTarget({ ...required, errorPrefix }, ports);
187
+ const planned = await planTarget({ target, errorPrefix }, ports);
188
+ const verification = planned.zoneFound ? await verifyRequirements({ zone: planned.zone, requirements: target.requirements, resolver: ports.resolver }) : null;
189
+ return { planned, instructions: instructionsFor(target, planned), verification, binding: target.binding };
190
+ }
191
+ const iso = ({ ms }, _options = {}) => new Date(ms).toISOString();
192
+ /** A propagated check is final; past the 48 h cap anything else is a timeout, reported not hidden. */
193
+ function statusFor(required) {
194
+ if (required.state === "propagated")
195
+ return "propagated";
196
+ return isExpired({ startedAt: Date.parse(required.startedAt), now: required.now }) ? "timeout" : required.state;
197
+ }
198
+ /** New requirements, a new zone or a timed-out binding start a fresh propagation window. */
199
+ function restarts({ previous, requirements, zone }, _options = {}) {
200
+ return previous === null || previous.status === "timeout" || previous.zone !== zone
201
+ || canonicalJson({ value: previous.requirements }) !== canonicalJson({ value: requirements });
202
+ }
203
+ /** Compact, persisted evidence of the last check (no per-nameserver answer dump). */
204
+ function summarize(verification, delegation) {
205
+ return {
206
+ state: verification.state, nameservers: verification.nameservers, delegation: delegation.reason,
207
+ ...(verification.reason === undefined ? {} : { reason: verification.reason }),
208
+ records: verification.records.map(({ record, state }) => ({ type: record.type, name: record.name, value: record.value, state })),
209
+ };
210
+ }
211
+ function nextBinding(required) {
212
+ const { target, zone, delegation, verification, now } = required;
213
+ const previous = restarts({ previous: target.binding, requirements: target.requirements, zone }) ? null : target.binding;
214
+ const attempt = previous === null ? 0 : previous.attempt + 1;
215
+ const startedAt = previous === null ? iso({ ms: now }) : previous.startedAt;
216
+ const status = statusFor({ state: verification.state, startedAt, now });
217
+ const done = status === "propagated" || status === "timeout";
218
+ return {
219
+ hostname: target.hostname, providerId: target.providerId, zone, requirements: target.requirements, status,
220
+ delegation: delegation.state, attempt, startedAt, nextCheckAt: done ? null : iso({ ms: now + nextCheckDelayMs({ attempt }) }),
221
+ lastCheckedAt: iso({ ms: now }), lastResult: summarize(verification, delegation), version: (target.binding?.version ?? 0) + 1,
222
+ };
223
+ }
224
+ /** How often `dns_verify` recomputes after losing a write race before giving up. */
225
+ export const VERIFY_WRITE_ATTEMPTS = 3;
226
+ /**
227
+ * One check and one compare-and-swap save against the binding version read at the start. `null`
228
+ * when another writer saved the binding while DNS was being read: this observation is stale.
229
+ */
230
+ async function verifyOnce(required, ports) {
231
+ const errorPrefix = "dns_verify";
232
+ const target = await resolveTarget({ ...required, errorPrefix }, ports);
233
+ const { zone } = await locateCheckedZone({ target, errorPrefix }, ports);
234
+ const delegation = await checkDelegation({ zone, resolver: ports.resolver });
235
+ const verification = await verifyRequirements({ zone, requirements: target.requirements, resolver: ports.resolver });
236
+ const now = ports.now();
237
+ const binding = nextBinding({ target, zone, delegation, verification, now });
238
+ const saved = await ports.bindings.put({ binding, now: iso({ ms: now }), expectedVersion: target.binding?.version ?? null });
239
+ return saved ? { binding, delegation, verification } : null;
240
+ }
241
+ /**
242
+ * Start or continue propagation tracking: save the requirements, check every authoritative
243
+ * nameserver once now, and schedule the next check (30 s doubling to 10 min, 48 h cap).
244
+ * The save is compare-and-swap: when a concurrent check saved first, this one is recomputed from
245
+ * the newer binding (up to {@link VERIFY_WRITE_ATTEMPTS} times) instead of overwriting it.
246
+ * @complexity O(records · nameservers) DNS queries plus one keyed write, per attempt.
247
+ */
248
+ export async function verifyDomainDns(required, ports) {
249
+ for (let attempt = 1; attempt <= VERIFY_WRITE_ATTEMPTS; attempt += 1) {
250
+ const result = await verifyOnce(required, ports);
251
+ if (result !== null)
252
+ return result;
253
+ }
254
+ throw new ToolInputError({ message: `dns_verify: ${required.hostname} kept changing while it was being checked (${VERIFY_WRITE_ATTEMPTS} attempts); try again.` });
255
+ }
256
+ /**
257
+ * One sweep over this workspace's due bindings, oldest first and one at a time (each check is
258
+ * already O(records · nameservers) concurrent queries). Returns the hostnames checked and saved;
259
+ * a binding another writer (e.g. `dns_verify` with new requirements) saved meanwhile is skipped,
260
+ * its newer state standing, and comes due again on its own schedule.
261
+ */
262
+ export async function verifyDueDomainBindings(required, ports) {
263
+ const due = await ports.bindings.listDue({ now: iso({ ms: ports.now() }), limit: required.limit });
264
+ const checked = [];
265
+ for (const binding of due) {
266
+ if (await verifyOnce({ hostname: binding.hostname }, ports))
267
+ checked.push(binding.hostname);
268
+ }
269
+ return checked;
270
+ }
271
+ //# sourceMappingURL=dns-changes.js.map
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @file The `dns_plan`, `dns_instructions` and `dns_verify` agent tools (domains & DNS lots D1–D3).
3
+ *
4
+ * Same contributor domain as the three read-only diagnostics in `tools.ts` (`domain-dns`), which
5
+ * stay untouched; {@link contributeDomainDnsAndChangeTools} builds both sets. No tool here writes
6
+ * DNS: there is no apply engine in v1, so `dns_instructions` hands a person copyable rows and
7
+ * `dns_verify` checks the zone's authoritative nameservers afterwards.
8
+ */
9
+ import type { AgentToolDefinition as SharedAgentToolDefinition } from "@jini-ai/core";
10
+ import { type AgentToolSideEffect, type ToolRegistration } from "@jini-ai/core";
11
+ import type { ToolContributor } from "@jini-ai/core";
12
+ import { type DnsChangeRequest } from "./dns-changes.js";
13
+ import { type DomainDnsToolDeps, type PublicNameValidators } from "./tools.js";
14
+ import type { DnsChangeToolDeps } from "./tool-deps.js";
15
+ type AgentToolDefinition = SharedAgentToolDefinition & {
16
+ inputSchema: Readonly<Record<string, unknown>>;
17
+ };
18
+ export declare const dnsChangeAgentToolCatalog: AgentToolDefinition[];
19
+ export declare const dnsChangeDerivedRisk: ReadonlyMap<string, AgentToolSideEffect>;
20
+ /** Validate untrusted tool input before any authorization or network effect, with the host's injected
21
+ * public-name validators (refusals surface as ToolInputError). O(records). */
22
+ export declare function readDnsChangeInput(required: {
23
+ input: unknown;
24
+ errorPrefix: string;
25
+ publicNames: PublicNameValidators;
26
+ }, _optional?: Record<string, never>): DnsChangeRequest;
27
+ /**
28
+ * Wire the three DNS change tools to tool permissions for this invocation's principal.
29
+ * @complexity O(1) registration; effects happen only when a handler runs.
30
+ * @example buildDnsChangeRegistrations(deps)
31
+ */
32
+ export declare function buildDnsChangeRegistrations(deps: DnsChangeToolDeps & Pick<DomainDnsToolDeps, "publicNames">, _optional?: Record<string, never>): ToolRegistration[];
33
+ /**
34
+ * One `domain-dns` contributor for the read-only diagnostics, the DNS change tools and the two
35
+ * mail DNS status tools (`mail-dns-tools.ts`).
36
+ * Takes the host's ports from its composition root without constructing network clients here.
37
+ * @param required Host dependency factories; invoked only during tool catalog assembly.
38
+ * @complexity O(1).
39
+ * @example contributeDomainDnsAndChangeTools({ createDeps, createDnsDeps })
40
+ */
41
+ export declare function contributeDomainDnsAndChangeTools<TDeps>({ createDeps, createDnsDeps }: {
42
+ createDeps: (routeDeps: TDeps) => DomainDnsToolDeps;
43
+ createDnsDeps: (routeDeps: TDeps) => DnsChangeToolDeps;
44
+ }, _optional?: Record<string, never>): ToolContributor<TDeps, unknown>;
45
+ export {};
46
+ //# sourceMappingURL=dns-tools.d.ts.map