@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,248 @@
1
+ import { DEPLOY_FETCH_TIMEOUTS } from "@jini-ai/devops/deploy/site/deploy-targets/host-kit";
2
+ import { projectConnectionForPublish, toDeployTargetCredential } from "./credentials.js";
3
+ /**
4
+ * @file Verifies a static-publish credential against its REAL host — the fix for "ready means a
5
+ * row exists, not a working credential" (2026-08-16, live-publish finding: a saved token the host
6
+ * rejected outright with 401 still reported `ready: true`/`credentialsConfigured: true`).
7
+ *
8
+ * Purpose:
9
+ * `PublishCredentialSource.isConfigured()` (`./types.ts`) only ever answers "does a row/env-var
10
+ * exist" — deliberately, since it must never decrypt (see that interface's own header). This module
11
+ * is the SECOND legitimate caller of `PublishCredentialSource.resolve()` (which DOES decrypt),
12
+ * alongside a real publish attempt — never the agent-facing capabilities/preview tools
13
+ * (`publish-agent-tools.ts`), which only ever read this module's CACHED, already-non-secret result.
14
+ * See `ADS-memory/reports/2026-08-16-publish-correctness-findings.md`'s Defect B section for the
15
+ * full design reasoning, including why this caches in-memory rather than adding a DB column/migration.
16
+ *
17
+ * The request itself belongs to the host: each deploy module (shipped in the `deploy` Agent Plugin,
18
+ * loaded through the workspace's deploy registry) exports `verifyCredential`, which makes ONE
19
+ * lightweight, read-only, authenticated request against its own API and returns a
20
+ * {@link DeployCredentialCheck}. This module resolves whichever credential a REAL publish would use,
21
+ * hands it to that check, and caches only the outcome (`status`/`message`/`checkedAt`, plus a public
22
+ * `accountLabel`) — never the credential itself, and never the host's raw response body.
23
+ *
24
+ * `PublishCredentialVerificationResult.status` is a closed THREE-way enum
25
+ * (`"valid" | "invalid" | "unreachable"`), never a plain boolean — a hard requirement from code
26
+ * review: `"unreachable"` (a network failure, timeout, or host 5xx) must never collapse into the same
27
+ * shape as `"invalid"` (the host affirmatively rejected the credential), because the two demand
28
+ * opposite guidance: try again later vs. replace the credential.
29
+ *
30
+ * `accountLabel` (2026-08-16, Defect 1: "the assistant has to guess the owner") is the ONE body field
31
+ * a check may read back, and only a host whose descriptor sets `yieldsAccountLabel`: the account's
32
+ * public handle, which a real publish is about to print in a public URL anyway. Never an email,
33
+ * plan, billing or org membership.
34
+ *
35
+ * Architectural role:
36
+ * `features/deployments/static-publish` domain logic. `publish-agent-tools.ts`'s capabilities
37
+ * handler reads `PublishCredentialVerificationCache.get()` directly (a plain in-memory lookup, no
38
+ * decrypt, no network call) — it must NEVER call `verifyPublishCredential` itself. Only human-gated
39
+ * callers (the admin credential-CRUD route) may call `verifyPublishCredential`.
40
+ */
41
+ /** One bounded probe per host. Short because a human is waiting on a form submit or an explicit
42
+ * "Verify" click, not a background job. Handed to modules as their kit's `QUICK` timeout. */
43
+ const VERIFY_TIMEOUT_MS = 10_000;
44
+ /**
45
+ * Whether a saved credential for `target` can ever produce an `accountLabel`, per the host's declared
46
+ * `yieldsAccountLabel`. Lets `publish-credentials/account-label-heal-scheduler.ts`'s background
47
+ * backfill skip a host that never can, instead of probing it on every list.
48
+ *
49
+ * @complexity O(1) — one registry lookup.
50
+ */
51
+ export function canYieldAccountLabel({ registry, target }, _optional = {}) {
52
+ return registry.get(target)?.descriptor.credential?.yieldsAccountLabel === true;
53
+ }
54
+ /** The optional `(HTTP <code>)` suffix shared by both failure messages in {@link buildVerificationMessage}. */
55
+ function statusCodeSuffix({ statusCode }, _options = {}) {
56
+ return statusCode ? ` (HTTP ${statusCode})` : "";
57
+ }
58
+ /** Human-facing text for one check outcome — built centrally (not per module) so every host's
59
+ * wording stays consistent. Never includes the credential, a raw response body, or any
60
+ * request/account detail beyond a bare HTTP status. */
61
+ function buildVerificationMessage({ label, check, credentialText }, _options = {}) {
62
+ if (check.ok)
63
+ return `${label} accepted this credential.`;
64
+ if (check.statusCode === 401 || check.statusCode === 403)
65
+ return credentialText({ id: "auth" });
66
+ if (check.statusCode === 408 || check.statusCode === 504)
67
+ return credentialText({ id: "timeout" });
68
+ if (check.reason === "rejected") {
69
+ return `${label} rejected this credential${statusCodeSuffix({ statusCode: check.statusCode })} — it is invalid, expired, or missing the required permissions.`;
70
+ }
71
+ return `Could not reach ${label} to verify this credential${statusCodeSuffix({ statusCode: check.statusCode })} — this does not necessarily mean the credential is bad.`;
72
+ }
73
+ /**
74
+ * The real, in-process implementation — a plain `Map`, no TTL/expiry (see this feature's design doc
75
+ * for why: an auto-expiring cache would make `ready` flip back to `false` from time alone, which
76
+ * reads as flakiness; `checkedAt` lets a caller judge staleness itself instead). Lost on process
77
+ * restart — an accepted trade-off, see the same doc.
78
+ *
79
+ * @complexity O(1) per operation — a single `Map` key lookup/write.
80
+ * @overallScore 100
81
+ */
82
+ export class InMemoryPublishCredentialVerificationCache {
83
+ entries = new Map();
84
+ static key(input) {
85
+ return `${input.workspaceId}::${input.target}`;
86
+ }
87
+ get(input) {
88
+ const entry = this.entries.get(InMemoryPublishCredentialVerificationCache.key(input));
89
+ if (!entry)
90
+ return undefined;
91
+ const matches = "kind" in input.basis
92
+ ? "kind" in entry.basis
93
+ : !("kind" in entry.basis) && entry.basis.id === input.basis.id && entry.basis.revision === input.basis.revision;
94
+ return matches ? entry.result : undefined;
95
+ }
96
+ set(input, result) {
97
+ this.entries.set(InMemoryPublishCredentialVerificationCache.key(input), { basis: input.basis, result });
98
+ }
99
+ delete(input) {
100
+ this.entries.delete(InMemoryPublishCredentialVerificationCache.key(input));
101
+ }
102
+ }
103
+ /** The kit a check runs with: `fetchFn` (tests), the observability port, and a `QUICK` timeout sized for a waiting human. */
104
+ function verificationKit(deps) {
105
+ return deps.hostKit ?? deps.createDeployHostKit({
106
+ ...(deps.fetchFn !== undefined ? { fetchFn: deps.fetchFn } : {}),
107
+ ...(deps.observability !== undefined ? { observability: deps.observability } : {}),
108
+ timeouts: { ...DEPLOY_FETCH_TIMEOUTS, QUICK: VERIFY_TIMEOUT_MS },
109
+ });
110
+ }
111
+ function noCheckReason(target) {
112
+ return `no turned-on hosting plugin can check '${target}' credentials`;
113
+ }
114
+ /** An `unreachable` result for a credential nothing here could check (no module, no check, or a saved
115
+ * row missing its token field): not `invalid`, since no host said so. */
116
+ function cannotVerify({ reason, clock }, _options = {}) {
117
+ return { status: "unreachable", message: `Could not verify this credential: ${reason}.`, checkedAt: clock.nowIso() };
118
+ }
119
+ /** Apply the existing token policy to the primary token and present, descriptor-declared secrets. */
120
+ function assertVerificationCredential({ credential, spec, assertCredentialToken }, _options = {}) {
121
+ assertCredentialToken({ value: credential.token });
122
+ for (const field of spec?.fields ?? []) {
123
+ if (field.secret && field.name !== spec?.tokenField && credential[field.name] !== undefined) {
124
+ assertCredentialToken({ value: credential[field.name], field: field.name });
125
+ }
126
+ }
127
+ }
128
+ /** Authentication HTTP statuses override an unreachable reason, while acceptance wins first. */
129
+ function verificationStatus({ check }, _options = {}) {
130
+ if (check.ok)
131
+ return "valid";
132
+ return check.reason === "rejected" || check.statusCode === 401 || check.statusCode === 403 ? "invalid" : "unreachable";
133
+ }
134
+ /**
135
+ * Shared tail of both entry points below: runs the host's own check and stamps `checkedAt` — kept as
136
+ * one function so a THIRD entry point can never build this result shape differently. A target with
137
+ * no loaded module (its plugin is off or missing) or a module with no `verifyCredential` is
138
+ * `unreachable` with a hint, since nothing here can say whether the credential is good. A check that
139
+ * throws is `unreachable` too: a check never propagates an error.
140
+ *
141
+ * @complexity O(1) — one registry lookup plus the module's one bounded request.
142
+ */
143
+ async function computeVerificationResult({ context, target, credential }, _options = {}) {
144
+ const loaded = context.registry.get(target);
145
+ if (loaded?.module.verifyCredential === undefined)
146
+ return cannotVerify({ reason: noCheckReason(target), clock: context.clock });
147
+ try {
148
+ assertVerificationCredential({ credential, spec: loaded.descriptor.credential, assertCredentialToken: context.assertCredentialToken });
149
+ }
150
+ catch (error) {
151
+ return { status: "invalid", message: error instanceof context.CredentialInputError ? error.message : context.credentialText({ id: "unreachable" }), checkedAt: context.clock.nowIso() };
152
+ }
153
+ let check;
154
+ try {
155
+ check = await loaded.module.verifyCredential({ credential, kit: context.kit });
156
+ }
157
+ catch {
158
+ check = { ok: false, reason: "unreachable" };
159
+ }
160
+ return checkedVerificationResult({ context, loaded, check });
161
+ }
162
+ function checkedVerificationResult({ context, loaded, check }) {
163
+ const status = verificationStatus({ check });
164
+ return {
165
+ status,
166
+ message: buildVerificationMessage({ label: loaded.descriptor.credential?.vendorLabel ?? loaded.descriptor.label, check, credentialText: context.credentialText }),
167
+ checkedAt: context.clock.nowIso(),
168
+ ...(check.ok && check.accountLabel !== undefined ? { accountLabel: check.accountLabel } : {}),
169
+ };
170
+ }
171
+ /**
172
+ * Resolves whichever credential a real publish to `input.target` would use, has that host's module
173
+ * check it with one bounded, read-only authenticated request, and caches the outcome under
174
+ * `(workspaceId, target)` — this is what `deployment_get_static_publish_capabilities`'s
175
+ * `ready`/`verified` fields read. The ONE non-test caller of this module allowed to trigger it is a
176
+ * human action (the admin credential-CRUD route, after a save, or via an explicit "Verify" trigger)
177
+ * — never an agent tool.
178
+ *
179
+ * @returns The freshly-computed result (also now cached). `null` when no credential is configured at
180
+ * all — clears any stale cached entry and makes NO network call, matching
181
+ * {@link verifyPublishCredentialById}'s own "nothing to verify" contract for a missing row.
182
+ * Deliberately not folded into `status: "invalid"`/`"unreachable"`: neither word honestly describes
183
+ * "there was nothing here to check".
184
+ * @complexity O(1) — one `resolve()` call (one repo read plus, for a DB-backed credential, one
185
+ * decrypt), one registry load, plus one bounded outbound HTTP request.
186
+ */
187
+ export async function verifyPublishCredential(deps, input) {
188
+ const resolved = await deps.credentialSource.resolve(input);
189
+ if (!resolved.ok) {
190
+ deps.cache.delete(input);
191
+ return null;
192
+ }
193
+ const context = { assertCredentialToken: deps.assertCredentialToken, CredentialInputError: deps.CredentialInputError, credentialText: deps.credentialText, registry: await deps.loadDeployTargets({ workspaceId: input.workspaceId }), kit: verificationKit(deps), clock: deps.clock };
194
+ const result = await computeVerificationResult({ context, target: input.target, credential: toDeployTargetCredential(resolved) });
195
+ deps.cache.set({ ...input, basis: resolved.basis }, result);
196
+ return result;
197
+ }
198
+ /**
199
+ * Verifies ONE specific saved connection by id — what the admin's per-row "Verify" action and the
200
+ * post-save check both actually mean ("check the thing I just clicked/saved"), distinct from
201
+ * {@link verifyPublishCredential}'s "check whichever credential is currently active for this target"
202
+ * (which always resolves the group's DEFAULT — Contract v2 Correction B — regardless of which row a
203
+ * caller has in mind).
204
+ *
205
+ * Only updates the `(workspaceId, target)` cache — the one `deployment_get_static_publish_
206
+ * capabilities` reads — when `id` IS its provider's current default. A non-default row's result is
207
+ * still computed and returned (so the human sees an honest answer for the row they actually asked
208
+ * about), but never overwrites the `ready` signal for a DIFFERENT, unrelated row sharing the same
209
+ * provider.
210
+ *
211
+ * The decrypted connection is projected through the host's declared credential spec, the same
212
+ * projection a real publish uses (`credentials.ts`'s `projectConnectionForPublish`), so the check sees
213
+ * exactly what the module's `create` would.
214
+ *
215
+ * @returns `null` if no row exists for `(workspaceId, id)` — the caller (the admin route) is
216
+ * expected to have already checked existence and map this to its own 404, matching
217
+ * `resolveForPublish`'s own "no such row is `null`, not thrown" contract.
218
+ * @complexity O(1) — one decrypting read (`resolveForPublish`), one registry load, plus one bounded
219
+ * outbound HTTP request.
220
+ */
221
+ export async function verifyPublishCredentialById(deps, input) {
222
+ const resolved = await deps.resolveForPublish(deps, input);
223
+ if (!resolved)
224
+ return null;
225
+ const context = { assertCredentialToken: deps.assertCredentialToken, CredentialInputError: deps.CredentialInputError, credentialText: deps.credentialText, registry: await deps.loadDeployTargets({ workspaceId: input.workspaceId }), kit: verificationKit(deps), clock: deps.clock };
226
+ const spec = context.registry.get(resolved.providerId)?.descriptor.credential;
227
+ const projected = spec === undefined ? undefined : projectConnectionForPublish(resolved.connection, spec);
228
+ const result = projected?.ok
229
+ ? await computeVerificationResult({ context, target: resolved.providerId, credential: toDeployTargetCredential(projected) })
230
+ : cannotVerify({ reason: projected?.reason ?? noCheckReason(resolved.providerId), clock: deps.clock });
231
+ if (resolved.isDefault) {
232
+ deps.cache.set({ workspaceId: input.workspaceId, target: resolved.providerId, basis: { id: input.id, revision: resolved.revision } }, result);
233
+ }
234
+ return result;
235
+ }
236
+ /** Check a human-submitted replacement through the existing host verifier before overwriting.
237
+ * @returns The normal safe verification result; does not write credentials or cache results.
238
+ * @complexity One registry load and one bounded host check.
239
+ * @example verifySubmittedPublishCredential({ deps, workspaceId, target, connection, spec });
240
+ */
241
+ export async function verifySubmittedPublishCredential({ deps, workspaceId, target, connection, spec }, _options = {}) {
242
+ const projected = projectConnectionForPublish(connection, spec);
243
+ if (!projected.ok)
244
+ return cannotVerify({ reason: 'the submitted connection is incomplete', clock: deps.clock });
245
+ const registry = await deps.loadDeployTargets({ workspaceId });
246
+ return computeVerificationResult({ context: { assertCredentialToken: deps.assertCredentialToken, CredentialInputError: deps.CredentialInputError, credentialText: deps.credentialText, registry, kit: verificationKit(deps), clock: deps.clock }, target, credential: toDeployTargetCredential(projected) });
247
+ }
248
+ //# sourceMappingURL=verify.js.map
@@ -0,0 +1,97 @@
1
+ import type { Tracker } from "@jini-ai/core/contracts/site/diagnostics-observability";
2
+ import { type Clock } from "@jini-ai/core/primitives";
3
+ import { type AgentToolSideEffect, type ToolRegistration } from "@jini-ai/core";
4
+ import type { requireToolPermission } from "@jini-ai/core";
5
+ import type { AuthorizeFn } from "@jini-ai/core/contracts/events";
6
+ import type { ToolContributor } from "@jini-ai/core";
7
+ import type { readDockerfileSource, writeDockerfileSourceWithIfMatch } from "@jini-ai/devops/deploy/site/dockerfile";
8
+ import type { ExportRunner } from "./export-run.js";
9
+ import type { ExportRunReportLike } from "@jini-ai/devops/deploy/site/export-run";
10
+ /**
11
+ * @file The Deployments domain's half of the agent-tool wiring split — maps
12
+ * `agent-tools.ts`'s five catalog entries onto the same domain logic the admin HTTP routes already
13
+ * use, as `ToolRegistration`s. All five are wired; none is excluded (see `agent-tools.ts`'s file
14
+ * header for why this domain, unlike Recovery/Database, has no token-gated/human-only entry).
15
+ *
16
+ * Authorization shape: none of `startExportRun`/`getExportRunSnapshot`/`readDockerfileSource`/
17
+ * `writeDockerfileSourceWithIfMatch` call `authorize()`
18
+ * internally (they mirror the plain domain functions the admin routes already call inline), so
19
+ * every handler below calls the kit's `requireToolPermission` itself — the same shape
20
+ * `recovery`/`database` already use.
21
+ *
22
+ * deployment_set_dockerfile requires an ifMatch etag through writeDockerfileSourceWithIfMatch,
23
+ * so concurrent admin/tool edits cannot silently overwrite each other; dockerfile.ts owns the rationale.
24
+ */
25
+ /**
26
+ * The exact slice of the route-deps bag this domain's tool handlers read. Declared structurally,
27
+ * never naming `server/routes/types`'s `RouteDeps` — same discipline every OTHER domain's
28
+ * `tool-registrations.ts` already follows (see `features/recovery/tool-registrations.ts`'s file
29
+ * header), now including this one.
30
+ *
31
+ * exportSiteBound captures full application dependencies at the composition root. The export-run
32
+ * adapter must destructure only outputDir/clean/basePath instead of forwarding ExportEngine's
33
+ * routeDeps field: an excess field on a non-literal argument can pass TypeScript and replace the
34
+ * full application bag with this narrow tool bag. The root's spread order and this adapter both
35
+ * enforce that boundary; the owning integration test covers it.
36
+ */
37
+ export interface DeploymentsToolDeps extends ExportRunner {
38
+ readonly requireToolPermission: typeof requireToolPermission;
39
+ readonly readDockerfileSource: typeof readDockerfileSource;
40
+ readonly writeDockerfileSourceWithIfMatch: typeof writeDockerfileSourceWithIfMatch;
41
+ readonly tracker?: Tracker;
42
+ readonly idGen?: {
43
+ newId(): string;
44
+ };
45
+ readonly authorize: AuthorizeFn;
46
+ readonly workspaceId: string;
47
+ readonly clock: Clock;
48
+ readonly exportOutputRootDir: string;
49
+ /**
50
+ * The pre-bound export call this domain uses for `deployment_trigger_export` — see this
51
+ * interface's own doc above for the fuller design reasoning, and `routes/types.ts`'s
52
+ * `exportSiteBound` for what this really is and why it is named differently from
53
+ * `RouteDeps.runExportSite`. Returns `ExportRunReportLike` (`export-run.ts`'s own structural
54
+ * mirror of the real `ExportReport`) rather than the real type, deliberately: this domain already
55
+ * imports `ExportRunReportLike` from its sibling `export-run.ts`, so reusing it here avoids a
56
+ * fresh `site-export/index` type import — the real `RouteDeps.exportSiteBound` (which returns the
57
+ * real `ExportReport`) already satisfies this structurally (same reasoning `ExportEngine`'s own
58
+ * doc gives for its return type).
59
+ */
60
+ readonly exportSiteBound: (options: {
61
+ outputDir: string;
62
+ clean?: boolean;
63
+ basePath?: string;
64
+ }) => Promise<ExportRunReportLike>;
65
+ }
66
+ /**
67
+ * This wiring layer's OWN risk classification, authored from what each handler below actually
68
+ * calls. See `DerivedRiskByToolId` in the kit for why it is independent of the catalog's own
69
+ * `sideEffects` declaration.
70
+ */
71
+ export declare const deploymentsDerivedRisk: ReadonlyMap<string, AgentToolSideEffect>;
72
+ /**
73
+ * Picks only the three fields `exportSiteBound` declares from an `ExportEngine` call, omitting an
74
+ * absent `clean`/`basePath` rather than forwarding it as an explicit `undefined` key. Never copies
75
+ * the engine options' `routeDeps` field (see `buildDeploymentsRegistrations`'s comment for why).
76
+ * Exported so the omission contract is testable directly: this module's own callers in
77
+ * `export-run.ts` always pass a boolean `clean`, but `ExportEngine` declares it optional.
78
+ * @complexity O(1).
79
+ */
80
+ export declare function pickExportSiteOptions({ outputDir, clean, basePath }: {
81
+ outputDir: string;
82
+ clean?: boolean | undefined;
83
+ basePath?: string | undefined;
84
+ }): {
85
+ outputDir: string;
86
+ clean?: boolean;
87
+ basePath?: string;
88
+ };
89
+ export declare function buildDeploymentsRegistrations(routeDeps: DeploymentsToolDeps): ToolRegistration[];
90
+ /**
91
+ * Contributes Deployments's AI tools; called once by the composition root's
92
+ * `installFirstPartyToolContributors()`, never as an import side effect.
93
+ * Credential lookup and GitHub-login extraction are injected into credential owners so this
94
+ * feature does not acquire a runtime path back to the assistant through credential discovery.
95
+ */
96
+ export declare function contributeDeploymentsTools(): ToolContributor<DeploymentsToolDeps, unknown>;
97
+ //# sourceMappingURL=tool-registrations.d.ts.map
@@ -0,0 +1,130 @@
1
+ import { toolMetadata } from '@jini-ai/core/tool-metadata/deployments';
2
+ import {} from "@jini-ai/core/primitives";
3
+ import { adaptLegacyAuthorize } from "@jini-ai/core";
4
+ import { buildDomainRegistrations, indexCatalogById, isRecord, optionalBoolean, optionalString, requireInputRecord, requireNoInput, requireString } from "@jini-ai/core";
5
+ // `ToolInputError` specifically — see `features/post/tool-registrations.ts`'s identical import for
6
+ // why: the marker `@jini-ai/daemon`'s `ToolExecutor` reads to classify a rejection 400 rather than
7
+ // redacting it into a message-stripped 500.
8
+ import { ToolInputError } from "@jini-ai/core";
9
+ import { deploymentsAgentToolCatalog } from "@jini-ai/devops/deploy/site/agent-tools";
10
+ const CATALOG_BY_ID = indexCatalogById({ catalog: deploymentsAgentToolCatalog });
11
+ /**
12
+ * This wiring layer's OWN risk classification, authored from what each handler below actually
13
+ * calls. See `DerivedRiskByToolId` in the kit for why it is independent of the catalog's own
14
+ * `sideEffects` declaration.
15
+ */
16
+ export const deploymentsDerivedRisk = new Map([
17
+ // -> startExportRun (export-run.ts) -> exportSite: writes a folder of HTML/CSS/JS/asset files to
18
+ // disk. A real mutation, same classification as `backup_create_restore_point`.
19
+ ["deployment_trigger_export", "mutates-durable-state"],
20
+ // -> routeDeps.getExportRunSnapshot(): reads a process-local in-memory variable. No I/O of any kind.
21
+ ["deployment_get_export_status", "none"],
22
+ // -> disposable export: no persistent artifacts, credentials or publish calls.
23
+ ["deployment_diagnose_static_export", "none"],
24
+ // -> readDockerfileSource (dockerfile.ts): one existence check, one file read. No write.
25
+ ["deployment_get_dockerfile", "none"],
26
+ // -> writeDockerfileSource (dockerfile.ts): one file write to the repo-root Dockerfile.
27
+ ["deployment_set_dockerfile", "mutates-durable-state"],
28
+ ]);
29
+ /**
30
+ * Picks only the three fields `exportSiteBound` declares from an `ExportEngine` call, omitting an
31
+ * absent `clean`/`basePath` rather than forwarding it as an explicit `undefined` key. Never copies
32
+ * the engine options' `routeDeps` field (see `buildDeploymentsRegistrations`'s comment for why).
33
+ * Exported so the omission contract is testable directly: this module's own callers in
34
+ * `export-run.ts` always pass a boolean `clean`, but `ExportEngine` declares it optional.
35
+ * @complexity O(1).
36
+ */
37
+ export function pickExportSiteOptions({ outputDir, clean, basePath }) {
38
+ return { outputDir, ...(clean !== undefined ? { clean } : {}), ...(basePath !== undefined ? { basePath } : {}) };
39
+ }
40
+ async function triggerExportTool(required, _optional = {}) {
41
+ const { routeDeps, engine, ctx } = required;
42
+ const candidate = { value: ctx.input };
43
+ if (ctx.input !== undefined && !isRecord(candidate))
44
+ throw new ToolInputError({ message: "input must be an object" });
45
+ const input = isRecord(candidate) ? candidate.value : {};
46
+ await routeDeps.requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: routeDeps.authorize }), workspaceId: routeDeps.workspaceId, principalId: ctx.principal.id, permission: "system.export" }, { entityType: "site-export" });
47
+ // No `await` between this check and `startExportRun` below — matches `export-site.ts`'s own
48
+ // "no await between check and set" atomicity comment exactly, so a tool call and a concurrent
49
+ // HTTP trigger in this SAME process can never both observe "not running" (see `export-run.ts`'s
50
+ // file header for the one case where this process is not the same one: the standalone daemon).
51
+ routeDeps.assertExportNotRunning({});
52
+ const clean = optionalBoolean({ input: input, key: "clean" }) ?? false;
53
+ const basePath = optionalString({ input: input, key: "basePath" });
54
+ return routeDeps.startExportRun({ routeDeps, runExportSite: engine, clean }, { ...(basePath === undefined ? {} : { basePath }), ...(routeDeps.tracker && routeDeps.idGen ? { productEvent: { tracker: routeDeps.tracker, userId: ctx.principal.id, operationId: routeDeps.idGen.newId(), source: "assistant" } } : {}) });
55
+ }
56
+ export function buildDeploymentsRegistrations(routeDeps) {
57
+ // Explicit destructuring, not `(opts) => routeDeps.exportSiteBound(opts)` — `ExportEngine`'s
58
+ // own options object always carries a `routeDeps` field (`export-run.ts`), and forwarding it
59
+ // wholesale would let that narrow `DeploymentsToolDeps` value reach `exportSiteBound` under a
60
+ // `routeDeps` key nobody asked for (its own type has no such parameter, so `tsc` would not
61
+ // catch the excess property on this non-literal argument). Picking only the three fields
62
+ // `exportSiteBound` actually declares means the narrow deps here never travel at all — see
63
+ // `DeploymentsToolDeps`'s own doc above and this file's regression test.
64
+ const engine = (options, _optional = {}) => routeDeps.exportSiteBound(pickExportSiteOptions(options));
65
+ const handlers = {
66
+ deployment_trigger_export: (ctx) => triggerExportTool({ routeDeps, engine, ctx }),
67
+ deployment_diagnose_static_export: async (ctx) => {
68
+ requireNoInput({ input: ctx.input });
69
+ await routeDeps.requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: routeDeps.authorize }), workspaceId: routeDeps.workspaceId, principalId: ctx.principal.id, permission: "system.read" }, { entityType: "site-export" });
70
+ return routeDeps.diagnoseStaticExport({ routeDeps, runExportSite: engine });
71
+ },
72
+ deployment_get_export_status: async (ctx) => {
73
+ requireNoInput({ input: ctx.input });
74
+ await routeDeps.requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: routeDeps.authorize }), workspaceId: routeDeps.workspaceId, principalId: ctx.principal.id, permission: "system.read" }, { entityType: "site-export" });
75
+ return routeDeps.getExportRunSnapshot();
76
+ },
77
+ deployment_get_dockerfile: async (ctx) => {
78
+ requireNoInput({ input: ctx.input });
79
+ await routeDeps.requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: routeDeps.authorize }), workspaceId: routeDeps.workspaceId, principalId: ctx.principal.id, permission: "system.read" }, { entityType: "dockerfile-source" });
80
+ return routeDeps.readDockerfileSource();
81
+ },
82
+ deployment_set_dockerfile: async (ctx) => {
83
+ // Both fields validated before the permission check, same order `deployment_trigger_export`
84
+ // above already uses — a shape rejection should never need an authorize() round trip first.
85
+ const input = requireInputRecord({ input: ctx.input });
86
+ const contents = requireString({ input: input, key: "contents" });
87
+ const ifMatch = requireString({ input: input, key: "ifMatch" });
88
+ await routeDeps.requireToolPermission({ authorize: adaptLegacyAuthorize({ authorize: routeDeps.authorize }), workspaceId: routeDeps.workspaceId, principalId: ctx.principal.id, permission: "system.write" }, { entityType: "dockerfile-source" });
89
+ ctx.signal.throwIfAborted();
90
+ const result = routeDeps.writeDockerfileSourceWithIfMatch({ contents, ifMatch });
91
+ if (!result.ok) {
92
+ // Thrown, not returned — `ToolExecutor` reads a thrown error as the failed execution and
93
+ // surfaces its `.message` to the model, so the message itself IS the model's only channel
94
+ // for "what happened and what to do next" (Terra audit finding C5's "agent check and fix"
95
+ // requirement). Names the concrete recovery path (re-read, reconcile, retry) rather than a
96
+ // bare "conflict" — and includes the current contents inline so the model can reconcile in
97
+ // the same turn instead of spending a second tool call on deployment_get_dockerfile first
98
+ // (it MAY still call it, e.g. to double-check nothing changed again in the meantime).
99
+ //
100
+ // `ToolInputError`, not a bare `Error` — same reclassification `features/post/
101
+ // tool-registrations.ts`'s `toModelFacingUpdateError` applies to `PostVersionConflictError`:
102
+ // a stale `ifMatch` is exactly "the caller's input was the problem and a DIFFERENT input (the
103
+ // fresh etag echoed below) fixes it," which is what the marker means, not a trick to defeat
104
+ // the redaction. A bare `Error` here would reach the model as a message-stripped 500,
105
+ // discarding the one thing it needs — the current contents/etag to reconcile against.
106
+ throw new ToolInputError({ message: `deployment_set_dockerfile: refused — the Dockerfile changed on the server since your 'ifMatch' ('${ifMatch}') was read; its current etag is now '${result.current.etag}'. ` +
107
+ `The file's CURRENT contents (as of right now, echoed here so you don't have to call deployment_get_dockerfile again just to see them) are:\n\n${result.current.exists ? result.current.contents : "(the file does not exist)"}\n\n` +
108
+ `Reconcile your intended change against these current contents, then retry deployment_set_dockerfile with contents built on top of them and ifMatch set to '${result.current.etag}'. If you want to confirm nothing has changed a second time before retrying, call deployment_get_dockerfile again first. This will not resolve on retry with the same ifMatch.` });
109
+ }
110
+ return result.snapshot;
111
+ },
112
+ };
113
+ return buildDomainRegistrations({ metadata: toolMetadata,
114
+ domain: "deployments",
115
+ catalogModule: "@jini-ai/devops/deploy/site/agent-tools.ts",
116
+ catalog: CATALOG_BY_ID,
117
+ handlers,
118
+ derivedRisk: deploymentsDerivedRisk,
119
+ });
120
+ }
121
+ /**
122
+ * Contributes Deployments's AI tools; called once by the composition root's
123
+ * `installFirstPartyToolContributors()`, never as an import side effect.
124
+ * Credential lookup and GitHub-login extraction are injected into credential owners so this
125
+ * feature does not acquire a runtime path back to the assistant through credential discovery.
126
+ */
127
+ export function contributeDeploymentsTools() {
128
+ return { domain: "deployments", build: buildDeploymentsRegistrations, risk: deploymentsDerivedRisk };
129
+ }
130
+ //# sourceMappingURL=tool-registrations.js.map
@@ -0,0 +1,51 @@
1
+ import type { ISODateTime, UUID } from "@jini-ai/core/primitives";
2
+ /**
3
+ * @file GitHub provider input records: in-memory contracts, not persisted records.
4
+ * Releases name existing artifacts for promotion; the provider does not build those artifacts.
5
+ */
6
+ /** Open string, not a closed union — see `Jini packages/commerce/src/payments/ports.ts`'s `PaymentProviderId`
7
+ * for why (a closed union makes every new provider a core edit). `"github"` is the only value with
8
+ * a real adapter this pass (`@jini-ai/agent-plugins/github/deployments/github.mjs`). */
9
+ export type DeploymentProviderId = DeploymentTargetRecord["providerId"];
10
+ /** One provider connection, scoped to a single environment. `config` carries non-secret provider
11
+ * config only (repo owner/name, GitHub environment name); the adapter receives credentials
12
+ * separately through DeploymentProviderContext. This contract has no table writer. */
13
+ export interface DeploymentTargetRecord {
14
+ readonly workspaceId: UUID;
15
+ readonly id: UUID;
16
+ readonly environmentId: UUID;
17
+ readonly providerId: string;
18
+ readonly label: string;
19
+ readonly config: Readonly<Record<string, unknown>>;
20
+ readonly enabled: boolean;
21
+ readonly createdAtIso: ISODateTime;
22
+ readonly version: number;
23
+ }
24
+ /** What a release promotes. `git-revision` is the only kind a first-party adapter accepts this
25
+ * adapter — its role is to promote a commit that already exists. `external-artifact` is declared for a future non-GitHub provider (e.g. one
26
+ * that accepts a pre-built tarball URL) and is deliberately rejected by `@jini-ai/agent-plugins/github/deployments/github.mjs`. */
27
+ export type ReleaseSource = {
28
+ readonly kind: "git-revision";
29
+ readonly repoUrl: string;
30
+ readonly commitSha: string;
31
+ } | {
32
+ readonly kind: "external-artifact";
33
+ readonly uri: string;
34
+ readonly checksum?: string;
35
+ };
36
+ /** An immutable, workspace-scoped artifact IDENTITY — "this is the thing that gets promoted". It
37
+ * records a reference to an artifact that already exists; it does not construct one. */
38
+ export interface ReleaseRecord {
39
+ readonly workspaceId: UUID;
40
+ readonly id: UUID;
41
+ readonly label: string;
42
+ readonly source: ReleaseSource;
43
+ readonly createdByPrincipalId: UUID;
44
+ readonly createdAtIso: ISODateTime;
45
+ readonly version: number;
46
+ }
47
+ /** The host's own normalized run status. Providers report a wider, provider-specific state (GitHub's
48
+ * real deployment-status enum has seven values — see `@jini-ai/agent-plugins/github/deployments/github.mjs`'s
49
+ * `mapGitHubDeploymentStatus`) and every adapter narrows it down to this closed set. */
50
+ export type DeploymentRunStatus = "queued" | "running" | "succeeded" | "failed" | "cancelled";
51
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,19 @@
1
+ import { type CompareSiteVersionsOptions, type ReleaseFeedPort, type SiteUpdateAvailable, type SiteUpdateCallOptions } from './contracts.js';
2
+ /** Options of {@link checkForUpdateFromFeed}. */
3
+ export interface CheckForUpdateFromFeedOptions extends SiteUpdateCallOptions, CompareSiteVersionsOptions {
4
+ }
5
+ /**
6
+ * The shared "Update available?" answer an adapter can delegate its `checkForUpdate` to: asks the
7
+ * feed for its newest release and reports it only when it is strictly newer than what is running.
8
+ *
9
+ * @param required.runningVersion - Version the live site reports.
10
+ * @param required.feed - Where releases are announced.
11
+ * @returns The newer release and its notes, or null when the site is current, ahead, or the feed is empty.
12
+ * @throws SiteUpdateError when either version is not a semver version.
13
+ * @complexity One feed call plus an O(n) version compare.
14
+ */
15
+ export declare function checkForUpdateFromFeed(required: {
16
+ runningVersion: string;
17
+ feed: ReleaseFeedPort;
18
+ }, _optional?: CheckForUpdateFromFeedOptions): Promise<SiteUpdateAvailable | null>;
19
+ //# sourceMappingURL=check-for-update.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { compareSiteVersions } from './contracts.js';
2
+ /**
3
+ * The shared "Update available?" answer an adapter can delegate its `checkForUpdate` to: asks the
4
+ * feed for its newest release and reports it only when it is strictly newer than what is running.
5
+ *
6
+ * @param required.runningVersion - Version the live site reports.
7
+ * @param required.feed - Where releases are announced.
8
+ * @returns The newer release and its notes, or null when the site is current, ahead, or the feed is empty.
9
+ * @throws SiteUpdateError when either version is not a semver version.
10
+ * @complexity One feed call plus an O(n) version compare.
11
+ */
12
+ export async function checkForUpdateFromFeed(required, _optional = {}) {
13
+ const release = await required.feed.latestRelease({}, { signal: _optional.signal });
14
+ if (!release)
15
+ return null;
16
+ const order = compareSiteVersions({ left: required.runningVersion, right: release.version }, { ids: _optional.ids });
17
+ return order < 0 ? { latest: release.version, notes: release.notes } : null;
18
+ }
19
+ //# sourceMappingURL=check-for-update.js.map