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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/README.md +16 -0
  2. package/dist/backup/site/archive-extensions.d.ts +73 -0
  3. package/dist/backup/site/archive-extensions.js +129 -0
  4. package/dist/backup/site/archive-manifest.d.ts +85 -0
  5. package/dist/backup/site/archive-manifest.js +176 -0
  6. package/dist/backup/site/archive-media.d.ts +121 -0
  7. package/dist/backup/site/archive-media.js +93 -0
  8. package/dist/backup/site/backup-service.credentials.d.ts +31 -0
  9. package/dist/backup/site/backup-service.credentials.js +161 -0
  10. package/dist/backup/site/backup-service.d.ts +331 -0
  11. package/dist/backup/site/backup-service.js +125 -0
  12. package/dist/backup/site/backup-service.plan.d.ts +64 -0
  13. package/dist/backup/site/backup-service.plan.js +207 -0
  14. package/dist/backup/site/backup-service.push.d.ts +29 -0
  15. package/dist/backup/site/backup-service.push.js +82 -0
  16. package/dist/backup/site/backup-service.shared.d.ts +40 -0
  17. package/dist/backup/site/backup-service.shared.js +37 -0
  18. package/dist/backup/site/bundled-export-file-policy.d.ts +38 -0
  19. package/dist/backup/site/bundled-export-file-policy.js +40 -0
  20. package/dist/backup/site/credential-warnings.d.ts +41 -0
  21. package/dist/backup/site/credential-warnings.js +50 -0
  22. package/dist/backup/site/import-backend-steps.d.ts +167 -0
  23. package/dist/backup/site/import-backend-steps.js +170 -0
  24. package/dist/backup/site/import-backend.d.ts +167 -0
  25. package/dist/backup/site/import-backend.js +298 -0
  26. package/dist/backup/site/import-database.d.ts +118 -0
  27. package/dist/backup/site/import-database.js +167 -0
  28. package/dist/backup/site/import-index/admission.d.ts +54 -0
  29. package/dist/backup/site/import-index/admission.js +46 -0
  30. package/dist/backup/site/import-index/backfill.d.ts +106 -0
  31. package/dist/backup/site/import-index/backfill.js +137 -0
  32. package/dist/backup/site/import-index/errors.d.ts +28 -0
  33. package/dist/backup/site/import-index/errors.js +38 -0
  34. package/dist/backup/site/import-index/migrations/checksums.d.ts +4 -0
  35. package/dist/backup/site/import-index/migrations/checksums.js +4 -0
  36. package/dist/backup/site/import-index/migrations/site-imports-v1.d.ts +2 -0
  37. package/dist/backup/site/import-index/migrations/site-imports-v1.js +10 -0
  38. package/dist/backup/site/import-index/mode.d.ts +191 -0
  39. package/dist/backup/site/import-index/mode.js +272 -0
  40. package/dist/backup/site/import-index/open.d.ts +40 -0
  41. package/dist/backup/site/import-index/open.js +87 -0
  42. package/dist/backup/site/import-index/paging.d.ts +28 -0
  43. package/dist/backup/site/import-index/paging.js +66 -0
  44. package/dist/backup/site/import-index/payload-namespace.d.ts +80 -0
  45. package/dist/backup/site/import-index/payload-namespace.js +156 -0
  46. package/dist/backup/site/import-index/rows.d.ts +32 -0
  47. package/dist/backup/site/import-index/rows.js +61 -0
  48. package/dist/backup/site/import-index/schema.d.ts +8 -0
  49. package/dist/backup/site/import-index/schema.js +31 -0
  50. package/dist/backup/site/import-index/store.d.ts +27 -0
  51. package/dist/backup/site/import-index/store.js +33 -0
  52. package/dist/backup/site/import-index/sweep.d.ts +10 -0
  53. package/dist/backup/site/import-index/sweep.js +26 -0
  54. package/dist/backup/site/import-keep-off.d.ts +128 -0
  55. package/dist/backup/site/import-keep-off.js +204 -0
  56. package/dist/backup/site/import-plugin-state.d.ts +74 -0
  57. package/dist/backup/site/import-plugin-state.js +67 -0
  58. package/dist/backup/site/import-registry.d.ts +110 -0
  59. package/dist/backup/site/import-registry.js +205 -0
  60. package/dist/backup/site/import-restore-placement.d.ts +94 -0
  61. package/dist/backup/site/import-restore-placement.js +158 -0
  62. package/dist/backup/site/import-restore.d.ts +111 -0
  63. package/dist/backup/site/import-restore.js +120 -0
  64. package/dist/backup/site/import-verifier-inventory.d.ts +137 -0
  65. package/dist/backup/site/import-verifier-inventory.js +236 -0
  66. package/dist/backup/site/import-verifier-projection.d.ts +78 -0
  67. package/dist/backup/site/import-verifier-projection.js +100 -0
  68. package/dist/backup/site/import-verifier.d.ts +126 -0
  69. package/dist/backup/site/import-verifier.js +53 -0
  70. package/dist/backup/site/owned-temp-root.d.ts +12 -0
  71. package/dist/backup/site/owned-temp-root.js +2 -0
  72. package/dist/backup/site/package-file-inventory.d.ts +63 -0
  73. package/dist/backup/site/package-file-inventory.js +56 -0
  74. package/dist/backup/site/push-content.d.ts +70 -0
  75. package/dist/backup/site/push-content.js +56 -0
  76. package/dist/backup/site/react/ShowMoreImports.d.ts +21 -0
  77. package/dist/backup/site/react/ShowMoreImports.js +8 -0
  78. package/dist/backup/site/saved-keys-port.d.ts +47 -0
  79. package/dist/backup/site/saved-keys-port.js +3 -0
  80. package/dist/backup/site/saved-keys.d.ts +25 -0
  81. package/dist/backup/site/saved-keys.js +38 -0
  82. package/dist/backup/site/share-backend.d.ts +243 -0
  83. package/dist/backup/site/share-backend.js +284 -0
  84. package/dist/backup/site/share-database/projection.d.ts +195 -0
  85. package/dist/backup/site/share-database/projection.js +90 -0
  86. package/dist/backup/site/share-database/projection.media.d.ts +38 -0
  87. package/dist/backup/site/share-database/projection.media.js +179 -0
  88. package/dist/backup/site/share-database/projection.tables.d.ts +46 -0
  89. package/dist/backup/site/share-database/projection.tables.js +193 -0
  90. package/dist/backup/site/share-expiry.d.ts +75 -0
  91. package/dist/backup/site/share-expiry.js +49 -0
  92. package/dist/backup/site/share-export-failure.d.ts +17 -0
  93. package/dist/backup/site/share-export-failure.js +16 -0
  94. package/dist/backup/site/share-file-policy.d.ts +60 -0
  95. package/dist/backup/site/share-file-policy.js +146 -0
  96. package/dist/backup/site/share-hosting.d.ts +107 -0
  97. package/dist/backup/site/share-hosting.js +148 -0
  98. package/dist/backup/site/share-preparation-steps.d.ts +180 -0
  99. package/dist/backup/site/share-preparation-steps.js +109 -0
  100. package/dist/backup/site/share-preparation.d.ts +122 -0
  101. package/dist/backup/site/share-preparation.js +43 -0
  102. package/dist/backup/site/share-refusal.d.ts +21 -0
  103. package/dist/backup/site/share-refusal.js +20 -0
  104. package/dist/backup/site/share-registry.d.ts +124 -0
  105. package/dist/backup/site/share-registry.js +219 -0
  106. package/dist/backup/site/share-retention.d.ts +62 -0
  107. package/dist/backup/site/share-retention.js +126 -0
  108. package/dist/backup/site/share-service.d.ts +128 -0
  109. package/dist/backup/site/share-service.js +194 -0
  110. package/dist/backup/site/share-zip.d.ts +115 -0
  111. package/dist/backup/site/share-zip.js +144 -0
  112. package/dist/backup/site/sources.d.ts +344 -0
  113. package/dist/backup/site/sources.js +595 -0
  114. package/dist/backup/site/static-copy.d.ts +122 -0
  115. package/dist/backup/site/static-copy.js +165 -0
  116. package/dist/backup/site/static-download-html.d.ts +76 -0
  117. package/dist/backup/site/static-download-html.js +149 -0
  118. package/dist/backup/site/static-download-landing.d.ts +52 -0
  119. package/dist/backup/site/static-download-landing.js +95 -0
  120. package/dist/backup/site/static-download-layout.d.ts +96 -0
  121. package/dist/backup/site/static-download-layout.js +325 -0
  122. package/dist/backup/site/static-export-selection.d.ts +50 -0
  123. package/dist/backup/site/static-export-selection.js +76 -0
  124. package/dist/backup/site/static-site-packager.d.ts +42 -0
  125. package/dist/backup/site/static-site-packager.js +32 -0
  126. package/dist/backup/site/tool-registrations.d.ts +74 -0
  127. package/dist/backup/site/tool-registrations.js +201 -0
  128. package/dist/checks/complexity-debt.d.ts +100 -0
  129. package/dist/checks/complexity-debt.js +131 -0
  130. package/dist/checks/coverage/diff.js +5 -1
  131. package/dist/checks/env-access.d.ts +14 -1
  132. package/dist/checks/env-access.js +92 -6
  133. package/dist/checks/live-verify-checks.d.ts +29 -0
  134. package/dist/checks/live-verify-checks.js +30 -0
  135. package/dist/checks/quality-gates.d.ts +137 -0
  136. package/dist/checks/quality-gates.js +209 -0
  137. package/dist/core/deploy-types.d.ts +2 -0
  138. package/dist/deploy/admin-http/site-update-status.d.ts +8 -0
  139. package/dist/deploy/admin-http/site-update-status.js +15 -0
  140. package/dist/deploy/host-kit.d.ts +3 -0
  141. package/dist/deploy/index.d.ts +6 -0
  142. package/dist/deploy/index.js +6 -0
  143. package/dist/deploy/ops-runner.js +7 -0
  144. package/dist/deploy/ops-tool-contracts.d.ts +10 -1
  145. package/dist/deploy/react/Deployment.d.ts +37 -0
  146. package/dist/deploy/react/Deployment.js +94 -0
  147. package/dist/deploy/react/DockerfileTab.d.ts +72 -0
  148. package/dist/deploy/react/DockerfileTab.js +131 -0
  149. package/dist/deploy/react/HistoryTab.d.ts +43 -0
  150. package/dist/deploy/react/HistoryTab.js +12 -0
  151. package/dist/deploy/react/OverviewTab.d.ts +60 -0
  152. package/dist/deploy/react/OverviewTab.js +75 -0
  153. package/dist/deploy/react/PublishRunResult.d.ts +5 -1
  154. package/dist/deploy/react/PublishRunResult.js +4 -4
  155. package/dist/deploy/react/SiteUpdateNotice.d.ts +22 -0
  156. package/dist/deploy/react/SiteUpdateNotice.js +25 -0
  157. package/dist/deploy/react/StaticCredentialFields.d.ts +36 -0
  158. package/dist/deploy/react/StaticCredentialFields.js +63 -0
  159. package/dist/deploy/react/StaticCredentialSteps.d.ts +23 -0
  160. package/dist/deploy/react/StaticCredentialSteps.js +155 -0
  161. package/dist/deploy/react/StaticExportCard.d.ts +11 -0
  162. package/dist/deploy/react/StaticExportCard.js +97 -0
  163. package/dist/deploy/react/StaticPublishCredentials.d.ts +50 -0
  164. package/dist/deploy/react/StaticPublishCredentials.js +77 -0
  165. package/dist/deploy/react/StaticPublishForm.d.ts +12 -0
  166. package/dist/deploy/react/StaticPublishForm.js +91 -0
  167. package/dist/deploy/react/StaticSiteTab.d.ts +207 -0
  168. package/dist/deploy/react/StaticSiteTab.js +117 -0
  169. package/dist/deploy/react/deployment-visuals.d.ts +207 -0
  170. package/dist/deploy/react/deployment-visuals.js +101 -0
  171. package/dist/deploy/react/download-dockerfile.d.ts +14 -0
  172. package/dist/deploy/react/download-dockerfile.js +15 -0
  173. package/dist/deploy/react/hooks/publish-credential-draft.d.ts +33 -0
  174. package/dist/deploy/react/hooks/publish-credential-draft.js +54 -0
  175. package/dist/deploy/react/hooks/publish-credential-selection.d.ts +13 -0
  176. package/dist/deploy/react/hooks/publish-credential-selection.js +34 -0
  177. package/dist/deploy/react/hooks/publish-credential-writes.d.ts +20 -0
  178. package/dist/deploy/react/hooks/publish-credential-writes.js +99 -0
  179. package/dist/deploy/react/hooks/static-publish-actions.d.ts +10 -0
  180. package/dist/deploy/react/hooks/static-publish-actions.js +62 -0
  181. package/dist/deploy/react/hooks/static-publish-form.hooks.d.ts +38 -0
  182. package/dist/deploy/react/hooks/static-publish-form.hooks.js +103 -0
  183. package/dist/deploy/react/hooks/static-publish-run.hooks.d.ts +28 -0
  184. package/dist/deploy/react/hooks/static-publish-run.hooks.js +92 -0
  185. package/dist/deploy/react/hooks/use-dockerfile-source.hooks.d.ts +148 -0
  186. package/dist/deploy/react/hooks/use-dockerfile-source.hooks.js +155 -0
  187. package/dist/deploy/react/hooks/use-publish-credentials.hooks.d.ts +268 -0
  188. package/dist/deploy/react/hooks/use-publish-credentials.hooks.js +52 -0
  189. package/dist/deploy/react/hooks/use-static-export.hooks.d.ts +128 -0
  190. package/dist/deploy/react/hooks/use-static-export.hooks.js +159 -0
  191. package/dist/deploy/react/hooks/use-static-publish.hooks.d.ts +208 -0
  192. package/dist/deploy/react/hooks/use-static-publish.hooks.js +48 -0
  193. package/dist/deploy/react/index.d.ts +4 -0
  194. package/dist/deploy/react/index.js +2 -0
  195. package/dist/deploy/react/rules.d.ts +363 -0
  196. package/dist/deploy/react/rules.js +314 -0
  197. package/dist/deploy/react/use-deployment-overview.hooks.d.ts +41 -0
  198. package/dist/deploy/react/use-deployment-overview.hooks.js +11 -0
  199. package/dist/deploy/site/agent-tools.d.ts +42 -0
  200. package/dist/deploy/site/agent-tools.js +119 -0
  201. package/dist/deploy/site/deploy-config-registry.d.ts +155 -0
  202. package/dist/deploy/site/deploy-config-registry.js +124 -0
  203. package/dist/deploy/site/deploy-config.d.ts +97 -0
  204. package/dist/deploy/site/deploy-config.js +115 -0
  205. package/dist/deploy/site/deploy-ops/agent-tools.d.ts +22 -0
  206. package/dist/deploy/site/deploy-ops/agent-tools.js +76 -0
  207. package/dist/deploy/site/deploy-ops/registry.d.ts +134 -0
  208. package/dist/deploy/site/deploy-ops/registry.js +106 -0
  209. package/dist/deploy/site/deploy-ops/run-ops.d.ts +66 -0
  210. package/dist/deploy/site/deploy-ops/run-ops.js +34 -0
  211. package/dist/deploy/site/deploy-ops/secret-confirm.d.ts +36 -0
  212. package/dist/deploy/site/deploy-ops/secret-confirm.js +27 -0
  213. package/dist/deploy/site/deploy-targets/host-kit.d.ts +28 -0
  214. package/dist/deploy/site/deploy-targets/host-kit.js +120 -0
  215. package/dist/deploy/site/deploy-targets/registry.d.ts +157 -0
  216. package/dist/deploy/site/deploy-targets/registry.js +132 -0
  217. package/dist/deploy/site/deploy-targets/types.d.ts +27 -0
  218. package/dist/deploy/site/deploy-targets/types.js +2 -0
  219. package/dist/deploy/site/dockerfile.d.ts +137 -0
  220. package/dist/deploy/site/dockerfile.js +101 -0
  221. package/dist/deploy/site/export-run.d.ts +137 -0
  222. package/dist/deploy/site/export-run.js +152 -0
  223. package/dist/deploy/site/ports.d.ts +115 -0
  224. package/dist/deploy/site/ports.js +2 -0
  225. package/dist/deploy/site/publish-agent-tools.d.ts +18 -0
  226. package/dist/deploy/site/publish-agent-tools.js +120 -0
  227. package/dist/deploy/site/publish-candidate.d.ts +26 -0
  228. package/dist/deploy/site/publish-candidate.js +37 -0
  229. package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.d.ts +78 -0
  230. package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.js +88 -0
  231. package/dist/deploy/site/publish-credentials/compatibility-port.d.ts +38 -0
  232. package/dist/deploy/site/publish-credentials/compatibility-port.js +19 -0
  233. package/dist/deploy/site/publish-credentials/execution-mode.d.ts +43 -0
  234. package/dist/deploy/site/publish-credentials/execution-mode.js +19 -0
  235. package/dist/deploy/site/publish-credentials/store-owner.d.ts +11 -0
  236. package/dist/deploy/site/publish-credentials/store-owner.js +9 -0
  237. package/dist/deploy/site/publish-credentials/store-resolution.d.ts +55 -0
  238. package/dist/deploy/site/publish-credentials/store-resolution.js +100 -0
  239. package/dist/deploy/site/publish-credentials/store-validation.d.ts +68 -0
  240. package/dist/deploy/site/publish-credentials/store-validation.js +182 -0
  241. package/dist/deploy/site/publish-credentials/store.d.ts +322 -0
  242. package/dist/deploy/site/publish-credentials/store.js +372 -0
  243. package/dist/deploy/site/publish-credentials/types.d.ts +85 -0
  244. package/dist/deploy/site/publish-credentials/types.js +2 -0
  245. package/dist/deploy/site/publish-tool-capabilities.d.ts +123 -0
  246. package/dist/deploy/site/publish-tool-capabilities.js +175 -0
  247. package/dist/deploy/site/publish-tool-credential.d.ts +48 -0
  248. package/dist/deploy/site/publish-tool-credential.js +284 -0
  249. package/dist/deploy/site/publish-tool-deps.d.ts +205 -0
  250. package/dist/deploy/site/publish-tool-deps.js +15 -0
  251. package/dist/deploy/site/publish-tool-execution.d.ts +78 -0
  252. package/dist/deploy/site/publish-tool-execution.js +313 -0
  253. package/dist/deploy/site/publish-tool-schema.d.ts +29 -0
  254. package/dist/deploy/site/publish-tool-schema.js +38 -0
  255. package/dist/deploy/site/static-publish/adapter-export.d.ts +54 -0
  256. package/dist/deploy/site/static-publish/adapter-export.js +89 -0
  257. package/dist/deploy/site/static-publish/adapter-plan.d.ts +99 -0
  258. package/dist/deploy/site/static-publish/adapter-plan.js +112 -0
  259. package/dist/deploy/site/static-publish/adapter.d.ts +182 -0
  260. package/dist/deploy/site/static-publish/adapter.js +321 -0
  261. package/dist/deploy/site/static-publish/admin-publish-read.d.ts +209 -0
  262. package/dist/deploy/site/static-publish/admin-publish-read.js +116 -0
  263. package/dist/deploy/site/static-publish/credentials.d.ts +110 -0
  264. package/dist/deploy/site/static-publish/credentials.js +290 -0
  265. package/dist/deploy/site/static-publish/domain-publish-rows.d.ts +25 -0
  266. package/dist/deploy/site/static-publish/domain-publish-rows.js +43 -0
  267. package/dist/deploy/site/static-publish/domain-publish-tool.d.ts +19 -0
  268. package/dist/deploy/site/static-publish/domain-publish-tool.js +111 -0
  269. package/dist/deploy/site/static-publish/inspection.d.ts +24 -0
  270. package/dist/deploy/site/static-publish/inspection.js +69 -0
  271. package/dist/deploy/site/static-publish/publish-history.d.ts +197 -0
  272. package/dist/deploy/site/static-publish/publish-history.js +153 -0
  273. package/dist/deploy/site/static-publish/publish-run.d.ts +156 -0
  274. package/dist/deploy/site/static-publish/publish-run.js +186 -0
  275. package/dist/deploy/site/static-publish/types.d.ts +165 -0
  276. package/dist/deploy/site/static-publish/types.js +2 -0
  277. package/dist/deploy/site/static-publish/verify.d.ts +217 -0
  278. package/dist/deploy/site/static-publish/verify.js +248 -0
  279. package/dist/deploy/site/tool-registrations.d.ts +97 -0
  280. package/dist/deploy/site/tool-registrations.js +130 -0
  281. package/dist/deploy/site/types.d.ts +51 -0
  282. package/dist/deploy/site/types.js +2 -0
  283. package/dist/deploy/site-update/check-for-update.d.ts +19 -0
  284. package/dist/deploy/site-update/check-for-update.js +19 -0
  285. package/dist/deploy/site-update/contracts.d.ts +161 -0
  286. package/dist/deploy/site-update/contracts.js +94 -0
  287. package/dist/deploy/site-update/desktop-site-update.d.ts +66 -0
  288. package/dist/deploy/site-update/desktop-site-update.js +43 -0
  289. package/dist/deploy/site-update/fake-site-update.d.ts +39 -0
  290. package/dist/deploy/site-update/fake-site-update.js +52 -0
  291. package/dist/deploy/site-update/run-site-update.d.ts +121 -0
  292. package/dist/deploy/site-update/run-site-update.js +219 -0
  293. package/dist/deploy/site-update/self-hosted-site-update.d.ts +71 -0
  294. package/dist/deploy/site-update/self-hosted-site-update.js +79 -0
  295. package/dist/deploy/target-contracts.d.ts +3 -0
  296. package/dist/deploy/tool.d.ts +5 -8
  297. package/dist/deploy/tool.js +6 -9
  298. package/dist/dns/binding-sweeper.d.ts +72 -0
  299. package/dist/dns/binding-sweeper.js +53 -0
  300. package/dist/dns/index.d.ts +1 -0
  301. package/dist/dns/index.js +1 -0
  302. package/dist/dns/site/binding.repo.d.ts +71 -0
  303. package/dist/dns/site/binding.repo.js +45 -0
  304. package/dist/dns/site/dns-changes.d.ts +90 -0
  305. package/dist/dns/site/dns-changes.js +271 -0
  306. package/dist/dns/site/dns-tools.d.ts +46 -0
  307. package/dist/dns/site/dns-tools.js +204 -0
  308. package/dist/dns/site/mail-dns-status.d.ts +111 -0
  309. package/dist/dns/site/mail-dns-status.js +190 -0
  310. package/dist/dns/site/mail-dns-tools.d.ts +33 -0
  311. package/dist/dns/site/mail-dns-tools.js +62 -0
  312. package/dist/dns/site/mail-requirements.d.ts +30 -0
  313. package/dist/dns/site/mail-requirements.js +78 -0
  314. package/dist/dns/site/tool-deps.d.ts +21 -0
  315. package/dist/dns/site/tool-deps.js +2 -0
  316. package/dist/dns/site/tools.d.ts +74 -0
  317. package/dist/dns/site/tools.js +124 -0
  318. package/dist/local-dev/bind-host.d.ts +80 -0
  319. package/dist/local-dev/bind-host.js +90 -0
  320. package/dist/local-dev/dev-proxy-upstream.d.ts +69 -0
  321. package/dist/local-dev/dev-proxy-upstream.js +63 -0
  322. package/dist/local-dev/index.d.ts +28 -0
  323. package/dist/local-dev/index.js +25 -0
  324. package/dist/packaging/electron/archive.d.ts +2 -9
  325. package/dist/packaging/electron/asar-adapter.d.ts +2 -1
  326. package/dist/packaging/electron/entry.d.ts +2 -0
  327. package/dist/packaging/electron/move-to-applications.d.ts +165 -0
  328. package/dist/packaging/electron/move-to-applications.js +162 -0
  329. package/dist/packaging/electron/policies.d.ts +33 -4
  330. package/dist/packaging/electron/policies.js +29 -10
  331. package/dist/packaging/electron/ports.d.ts +1 -6
  332. package/dist/packaging/electron/staging.d.ts +11 -2
  333. package/dist/packaging/electron/staging.js +15 -5
  334. package/dist/react/site-share-expiry/ShareExpiryControls.d.ts +29 -0
  335. package/dist/react/site-share-expiry/ShareExpiryControls.js +7 -0
  336. package/dist/react/site-share-expiry/index.d.ts +2 -0
  337. package/dist/react/site-share-expiry/index.js +2 -0
  338. package/dist/source-control/react/ProvidersTab.d.ts +98 -0
  339. package/dist/source-control/react/ProvidersTab.js +195 -0
  340. package/dist/source-control/react/SourceControl.d.ts +51 -0
  341. package/dist/source-control/react/SourceControl.js +61 -0
  342. package/dist/source-control/react/hooks/use-source-control-credentials.hooks.d.ts +128 -0
  343. package/dist/source-control/react/hooks/use-source-control-credentials.hooks.js +102 -0
  344. package/dist/source-control/react/rules.d.ts +167 -0
  345. package/dist/source-control/react/rules.js +125 -0
  346. package/dist/source-control/react/source-control-visuals.d.ts +75 -0
  347. package/dist/source-control/react/source-control-visuals.js +48 -0
  348. package/dist/source-control/site/agent-tools.d.ts +5 -0
  349. package/dist/source-control/site/agent-tools.js +30 -0
  350. package/dist/source-control/site/bundled-provider-registry.d.ts +33 -0
  351. package/dist/source-control/site/bundled-provider-registry.js +37 -0
  352. package/dist/source-control/site/commit-schema.d.ts +40 -0
  353. package/dist/source-control/site/commit-schema.js +29 -0
  354. package/dist/source-control/site/commit-target.d.ts +26 -0
  355. package/dist/source-control/site/commit-target.js +58 -0
  356. package/dist/source-control/site/credential-form.d.ts +36 -0
  357. package/dist/source-control/site/credential-form.js +102 -0
  358. package/dist/source-control/site/credential-setup.d.ts +107 -0
  359. package/dist/source-control/site/credential-setup.js +216 -0
  360. package/dist/source-control/site/provider-kit.d.ts +37 -0
  361. package/dist/source-control/site/provider-kit.js +35 -0
  362. package/dist/source-control/site/provider-module.d.ts +251 -0
  363. package/dist/source-control/site/provider-module.js +2 -0
  364. package/dist/source-control/site/saved-key-bindings.d.ts +4 -0
  365. package/dist/source-control/site/saved-key-bindings.js +4 -0
  366. package/dist/source-control/site/static-site-packager-port.d.ts +37 -0
  367. package/dist/source-control/site/static-site-packager-port.js +2 -0
  368. package/dist/source-control/site/store.d.ts +209 -0
  369. package/dist/source-control/site/store.js +374 -0
  370. package/dist/source-control/site/store.validation.d.ts +72 -0
  371. package/dist/source-control/site/store.validation.js +168 -0
  372. package/dist/source-control/site/tool-registrations.d.ts +190 -0
  373. package/dist/source-control/site/tool-registrations.js +379 -0
  374. package/dist/static-export/site/export-preflight.d.ts +48 -0
  375. package/dist/static-export/site/export-preflight.js +82 -0
  376. package/dist/static-export/site/media-original-urls.d.ts +57 -0
  377. package/dist/static-export/site/media-original-urls.js +109 -0
  378. package/dist/static-export/site/ports.d.ts +82 -0
  379. package/dist/static-export/site/ports.js +29 -0
  380. package/dist/static-export/site/public-origin-policy.d.ts +32 -0
  381. package/dist/static-export/site/public-origin-policy.js +68 -0
  382. package/dist/static-export/site/route-manifest.d.ts +65 -0
  383. package/dist/static-export/site/route-manifest.js +139 -0
  384. package/dist/static-export/site/site-exporter.d.ts +158 -0
  385. package/dist/static-export/site/site-exporter.js +112 -0
  386. package/dist/static-export/site/static-security-headers.d.ts +39 -0
  387. package/dist/static-export/site/static-security-headers.js +43 -0
  388. package/dist/static-export/site/theme-preview-manifest.d.ts +35 -0
  389. package/dist/static-export/site/theme-preview-manifest.js +28 -0
  390. package/package.json +911 -7
@@ -0,0 +1,321 @@
1
+ import { planStaticPublish, publishOutputDir, resolvePublishPlan } from './adapter-plan.js';
2
+ import { runExportForPublish, buildDeployFilesForPublish } from './adapter-export.js';
3
+ export { planStaticPublish, missingRequiredFieldMessage, unknownTargetMessage, readStaticPublishConfig, publishOutputDir } from './adapter-plan.js';
4
+ export { toDeployFile } from './adapter-export.js';
5
+ import { describeErrorForLog } from "@jini-ai/core/model-facing-tool-errors";
6
+ import { createHash } from "node:crypto";
7
+ import { DeployError } from "@jini-ai/devops/deploy";
8
+ import { withDeclaredHosts } from "@jini-ai/core/contracts/server/security-headers";
9
+ import { redactDeployTargetMessage, toDeployTargetCredential } from "./credentials.js";
10
+ /**
11
+ * @file Publishes the host's own static export through a deploy target that an Agent Plugin contributes
12
+ * (`deploy-targets/registry.ts`). Core names no hosting vendor: which targets exist, which config
13
+ * fields each takes, how each validates them, which base path each serves from, and what extra files
14
+ * each host needs all come from the plugin's descriptor and module (deploy plan T7).
15
+ *
16
+ * Purpose:
17
+ * "Wrap it, do not reimplement" — this module does no host HTTP itself. It (a) resolves the target
18
+ * and checks its config ({@link planStaticPublish}), (b) runs the host's real static exporter with the
19
+ * base path the target's module computes, (c) maps the resulting `ExportReport` into `DeployFile[]`,
20
+ * and (d) hands the file set, plus the live security headers as data (`responseHeaders`), to the
21
+ * `DeployTarget` the module builds.
22
+ *
23
+ * Base-path/target mismatch, made structurally impossible rather than merely documented:
24
+ * `StaticPublishConfig` has NO `basePath` field — a caller can never supply one. The target module
25
+ * derives it from the config, and {@link publishStaticSite} always runs a FRESH `exportSite` with
26
+ * that exact value immediately before publishing, so no previously-produced export (built with some
27
+ * other or no base path) can reach a target. The cost is a full re-export per publish, accepted
28
+ * deliberately: a stale base path silently 404ing every asset on a live site is strictly worse.
29
+ *
30
+ * A refused export (any route or asset failed) never reaches a target at all — this module will not
31
+ * publish a known-incomplete site, mirroring `cli/commands/export.ts`'s own honesty contract.
32
+ *
33
+ * Architectural role:
34
+ * `features/deployments/static-publish` domain logic. Depends on `deploy-targets/` for the target
35
+ * registry and host kit. No dependency on `../ports.ts`/`@jini-ai/agent-plugins/github/deployments/github.mjs` (the sibling
36
+ * continuous-deployment feature) — see `./types.ts`'s header for why these stay separate.
37
+ */
38
+ const MAX_PROJECT_NAME_LENGTH = 200;
39
+ /**
40
+ * Resolves `input.config.target`'s credential via `deps.credentialSource.resolve()`, translating
41
+ * both a thrown decrypt failure and an `{ok:false}` "not configured" result into
42
+ * {@link publishStaticSite}'s own `{ok:false, code, message}` channel — see that function's own
43
+ * header doc for the full "never throws" contract this step upholds.
44
+ *
45
+ * `PublishCredentialSource.resolve()`'s own doc documents a throw as a real, DELIBERATE possibility
46
+ * for the DB-backed source (`publish-credentials/store.ts`'s `resolveForPublish`/
47
+ * `resolveDefaultForPublish`: "a decrypt failure here should surface, not degrade" — a corrupted row
48
+ * or a missing site key throws rather than resolving a silent `null`). `publishStaticSite`'s own
49
+ * contract is that IT never throws regardless — so a genuine decrypt failure still needs to
50
+ * "surface", just through the established `{ok:false, code, message}` channel instead of an uncaught
51
+ * exception, exactly like every other failure mode in that function. `err.message` only, same
52
+ * boundary {@link publishAndMapOutcome}'s own catch documents — a decrypt failure's message names the
53
+ * mechanism (bad AAD, tampered ciphertext, missing key), never the ciphertext or a derived secret
54
+ * itself.
55
+ */
56
+ async function resolvePublishCredentialForSite(deps, input) {
57
+ let credential;
58
+ try {
59
+ credential = await deps.credentialSource.resolve({
60
+ workspaceId: input.workspaceId,
61
+ target: input.config.target,
62
+ // Conditional spread, never `credentialId: input.credentialId` — an absent choice must not
63
+ // travel as an explicit `undefined` key, which a source could read as "a choice was made".
64
+ ...(input.credentialId !== undefined ? { credentialId: input.credentialId } : {}),
65
+ });
66
+ }
67
+ catch (err) {
68
+ return {
69
+ ok: false,
70
+ outcome: {
71
+ ok: false,
72
+ code: "NO_CREDENTIALS_CONFIGURED",
73
+ credentialSetup: deps.issueCredentialSetup({ setupToolId: "credential_save", prefill: { kind: "publish-host", target: input.config.target } }, {}),
74
+ message: `credential could not be resolved: ${err instanceof Error ? err.message : String(err)}`,
75
+ },
76
+ };
77
+ }
78
+ if (!credential.ok) {
79
+ return { ok: false, outcome: { ok: false, code: "NO_CREDENTIALS_CONFIGURED", credentialSetup: deps.issueCredentialSetup({ setupToolId: "credential_save", prefill: { kind: "publish-host", target: input.config.target } }, {}), message: credential.reason } };
80
+ }
81
+ return { ok: true, credential };
82
+ }
83
+ /**
84
+ * `result.status` is EVERY target's own honest terminal state (`DeployLinkStatus`) — not merely "did
85
+ * the API call succeed". A status other than 'ready' means the provider accepted the publish but the
86
+ * site is not (yet, or ever, without a further step outside this call) reachable — spec
87
+ * `custom-publish-provider-contract.md` §3a's "uploaded, but not yet reachable" requirement, required
88
+ * regardless of provider once `StaticPublishOutcome` carries a real third branch for it (see that
89
+ * type's own header). Applied uniformly here rather than special-cased per target: every target
90
+ * already resolves its own `status` internally before returning (verified directly against
91
+ * a hosting target's own reachability wait inside `publish()`), so this is the one
92
+ * place that turns an already-honest `status` into an equally-honest `StaticPublishOutcome`.
93
+ */
94
+ function buildPartialPublishOutcome({ targetId, result, basePath }, _options = {}) {
95
+ return {
96
+ ok: "partial",
97
+ targetId,
98
+ url: result.url,
99
+ status: result.status,
100
+ message: result.statusMessage ?? `Published to ${targetId}, but the public URL is not confirmed reachable yet (status: ${result.status}).`,
101
+ ...(result.deploymentId !== undefined ? { deploymentId: result.deploymentId } : {}),
102
+ ...(basePath !== undefined ? { basePath } : {}),
103
+ ...(result.providerMetadata !== undefined ? { providerMetadata: result.providerMetadata } : {}),
104
+ };
105
+ }
106
+ /** {@link buildPartialPublishOutcome}'s sibling for `result.status === "ready"` — a full success. */
107
+ function buildSuccessPublishOutcome({ targetId, result, basePath }, _options = {}) {
108
+ return {
109
+ ok: true,
110
+ targetId,
111
+ url: result.url,
112
+ status: result.status,
113
+ ...(result.deploymentId !== undefined ? { deploymentId: result.deploymentId } : {}),
114
+ ...(basePath !== undefined ? { basePath } : {}),
115
+ ...(result.providerMetadata !== undefined ? { providerMetadata: result.providerMetadata } : {}),
116
+ };
117
+ }
118
+ /** Public header data and existing publish metadata share one provider call; no extra I/O. */
119
+ function publishOptions({ input, formDestination, readHeaders }) {
120
+ return { responseHeaders: readHeaders(),
121
+ ...(input.onProgress ? { onProgress: (progress) => input.onProgress?.({ progress }) } : {}),
122
+ metadata: { ...input.config, ...(input.domainApproval ? { domainApproval: input.domainApproval } : {}), ...(formDestination ? { formDestination } : {}) } };
123
+ }
124
+ /**
125
+ * Calls `jiniTarget.publish()` and maps its result to a {@link StaticPublishOutcome}, translating a
126
+ * rejected `publish()` call into {@link publishStaticSite}'s own `{ok:false, code:"PROVIDER_ERROR"}`
127
+ * channel.
128
+ *
129
+ * `err.message` only — never `DeployError.details` (the raw upstream response body) or the error
130
+ * object itself. This crosses an HTTP/tool-result boundary (the admin route's JSON response, the
131
+ * agent tool's result), the same "message, never the raw error" discipline `export-site.ts`'s own
132
+ * errored-run summary already follows. No observed host deploy target puts `credential.token`
133
+ * into a `DeployError` message, but this boundary still holds even if one ever did.
134
+ */
135
+ async function publishAndMapOutcome({ jiniTarget, publishInput, input, basePath }, { formDestination, readHeaders }) {
136
+ try {
137
+ // Older plugins may not report progress. Once provider work starts, creation is unknown
138
+ // until that plugin reports evidence or returns a deployment ID.
139
+ input.onProgress?.({ progress: { phase: "uploading", deploymentCreated: "unknown" } });
140
+ const result = await jiniTarget.publish(publishInput, publishOptions({ input, formDestination, readHeaders }));
141
+ if (result.status === "failed")
142
+ return { ok: false, code: "PROVIDER_ERROR", message: failedPublishMessage({ targetId: input.config.target, result }) };
143
+ if (result.status !== "ready") {
144
+ return buildPartialPublishOutcome({ targetId: input.config.target, result, basePath });
145
+ }
146
+ return buildSuccessPublishOutcome({ targetId: input.config.target, result, basePath });
147
+ }
148
+ catch (err) {
149
+ const message = err instanceof DeployError || err instanceof Error ? err.message : String(err);
150
+ return { ok: false, code: "PROVIDER_ERROR", message };
151
+ }
152
+ }
153
+ /** The provider's own failure text, else a plain fallback naming the target and deployment. */
154
+ function failedPublishMessage({ targetId, result }, _options = {}) {
155
+ return result.statusMessage ?? `Publishing to ${targetId} failed. Check the provider dashboard before publishing again. Deployment ID: ${result.deploymentId ?? "unknown"}.`;
156
+ }
157
+ /**
158
+ * Publishes the host's current site content to `input.config.target`. Always runs a fresh, `clean`
159
+ * export with the target-correct base path immediately before publishing (see this file's header)
160
+ * — never reuses a previously-produced export directory.
161
+ *
162
+ * Never throws: every failure (an unknown target or bad config, a registry that will not load, a
163
+ * credential that does not resolve — including a genuine DECRYPT failure, see
164
+ * {@link resolvePublishCredentialForSite} — a failed export, a credential unusable for the target, or
165
+ * a rejected `publish()` call) is returned as `{ok: false, code, message}`. `message` is always built
166
+ * from `err.message`, never a raw `DeployError.details`/response-body object. Every caller
167
+ * (`publish-site.ts`'s HTTP route, `deployment_execute_static_publish`) relies on this.
168
+ *
169
+ * Orchestrates its work as a flat sequence of steps, each translating its own failure mode into this
170
+ * function's `{ok:false, code, message}` channel and returning early: {@link resolvePublishPlan},
171
+ * {@link resolvePublishCredentialForSite}, {@link runExportForPublish}, {@link constructTargetForPublish},
172
+ * then {@link publishAndMapOutcome} for the terminal result.
173
+ *
174
+ * @complexity One registry load, one `exportSite` pass (O(routes + assets) HTTP requests against the
175
+ * in-process app) plus one `DeployTarget.publish()` call (bounded by that target's own poll budget).
176
+ */
177
+ export async function publishStaticSite(deps, input) {
178
+ // Publish/deploy chokepoint: one `site.publish` operation per run (target id only; the outcome
179
+ // is `published` or the failure code), with its export and host egress as child spans.
180
+ const tracker = deps.tracker ?? deps.createNoopTracker({});
181
+ return tracker.trace({ name: "site.publish", run: async (span) => {
182
+ const outcome = await publishStaticSiteSteps(deps, input);
183
+ span.setOutcome(outcome.ok ? { outcome: "published", failed: false } : { outcome: outcome.code, failed: true });
184
+ return outcome;
185
+ } }, { attributes: { "publish.target": input.config.target } });
186
+ }
187
+ /** {@link publishStaticSite}'s steps, inside its operation. */
188
+ async function publishStaticSiteSteps(deps, input) {
189
+ if (input.projectName.trim() === "" || input.projectName.length > MAX_PROJECT_NAME_LENGTH) {
190
+ return { ok: false, code: "INVALID_CONFIG", message: `projectName must be 1-${MAX_PROJECT_NAME_LENGTH} characters` };
191
+ }
192
+ const plan = await resolvePublishPlan(deps, input);
193
+ if (!plan.ok)
194
+ return { ok: false, code: "INVALID_CONFIG", message: plan.message };
195
+ const credentialResult = await resolvePublishCredentialForSite(deps, input);
196
+ if (!credentialResult.ok) {
197
+ return credentialResult.outcome;
198
+ }
199
+ if (credentialChangedSinceReview({ input, credential: credentialResult.credential })) {
200
+ return { ok: false, code: "INVALID_CONFIG", message: "CREDENTIAL_CHANGED: The connection changed after domain review. Preview and confirm again before publishing." };
201
+ }
202
+ const resolvedCredential = toDeployTargetCredential(credentialResult.credential);
203
+ const targetResult = constructTargetForPublish({ deps, pluginTarget: plan.target, config: input.config, credential: resolvedCredential });
204
+ if (!targetResult.ok) {
205
+ return targetResult.outcome;
206
+ }
207
+ const outputDir = publishOutputDir({ parent: input.publishOutputRootDir, target: input.config.target, runId: input.idGen.newId() });
208
+ const exportResult = await runExportForPublish({ deps, input, outputDir, basePath: plan.basePath, target: targetResult.target });
209
+ if (!exportResult.ok)
210
+ return finishPublishOutcome({ outcome: exportResult.outcome, credential: credentialResult.credential, target: plan.target });
211
+ const files = buildDeployFilesForPublish(exportResult.report);
212
+ const forms = await prepareFormDestination({ deps, input });
213
+ if (!forms.ok)
214
+ return forms.outcome;
215
+ const publishInput = { files: filesForReceiver({ deps, files, submitUrl: forms.submitUrl }), projectName: input.projectName };
216
+ const hosts = await readPluginExportHosts({ deps });
217
+ const baseHeaders = deps.publicPageSecurityHeaders ?? deps.defaultPublicPageSecurityHeaders;
218
+ const outcome = await publishAndMapOutcome({ jiniTarget: targetResult.target, publishInput, input, basePath: plan.basePath }, { formDestination: forms.hosting, readHeaders: () => hosts ? withDeclaredHosts({ headers: baseHeaders(), hosts }) : baseHeaders() });
219
+ await saveReceiverKey({ deps, outcome, save: forms.save });
220
+ const reported = publishConsentWarning({ outcome, warning: exportResult.report.consentWarning });
221
+ return finishPublishOutcome({ outcome: reported, credential: credentialResult.credential, target: plan.target });
222
+ }
223
+ /** A domain review binds the credential it saw; any other credential needs a fresh review. */
224
+ function credentialChangedSinceReview({ input, credential }, _options = {}) {
225
+ return Boolean(input.domainApproval) && input.domainApproval?.credentialBinding !== createHash("sha256").update(JSON.stringify(toDeployTargetCredential(credential))).digest("hex");
226
+ }
227
+ /** Hosts the site's plugin exports declare, for the published security headers. */
228
+ async function readPluginExportHosts({ deps }, _options = {}) {
229
+ // Report-only data: a catalog read failure must not stop a publish.
230
+ return deps.pluginExportHosts?.().catch((error) => {
231
+ deps.warn("[static-publish] Could not read plugin export hosts", describeErrorForLog({ err: { err: error } }));
232
+ return undefined;
233
+ });
234
+ }
235
+ /** Keep a successful publication's export warning in the result without changing its status. */
236
+ function publishConsentWarning({ outcome, warning }) {
237
+ return outcome.ok !== false && warning ? { ...outcome, consentWarning: warning } : outcome;
238
+ }
239
+ /**
240
+ * The site's active forms and, when there are any, its receiver key, for the receiver the site's
241
+ * form setting selects (`features/form-destinations/port.ts`): the co-hosted add-on for this host
242
+ * (`hosting`), or an external receiver's post address (`submitUrl`). No port: nothing is sent and
243
+ * no key is created.
244
+ * @complexity One forms read plus at most one key read (and an external receiver's own prepare).
245
+ */
246
+ async function prepareFormDestination({ deps, input }, _options = {}) {
247
+ if (!deps.formDestination)
248
+ return { ok: true };
249
+ try {
250
+ const plan = await deps.formDestination.prepare({ workspaceId: input.workspaceId, hostingTargetId: input.config.target, projectName: input.projectName,
251
+ kit: deps.hostKit ?? deps.createDeployHostKit(deps.observability === undefined ? {} : { observability: deps.observability }) });
252
+ return { ok: true, ...plan };
253
+ }
254
+ catch (err) {
255
+ return { ok: false, outcome: { ok: false, code: "EXPORT_FAILED", message: `form submissions could not be prepared: ${err instanceof Error ? err.message : String(err)}. Check the site's forms, then publish again.` } };
256
+ }
257
+ }
258
+ /** An external receiver: exported pages post to its address instead of the site's own path. @complexity O(HTML bytes). */
259
+ function filesForReceiver({ deps, files, submitUrl }, _options = {}) {
260
+ return submitUrl ? deps.rewriteFormActions({ files, submitUrl }) : files;
261
+ }
262
+ /** Saves the receiver key (new, or moved after a rename) once the host has it. A failed save is logged, not fatal: the
263
+ * next publish creates and installs a fresh key, and rows still waiting at the host stay pullable. */
264
+ async function saveReceiverKey({ deps, outcome, save }, _options = {}) {
265
+ if (!save || outcome.ok === false)
266
+ return;
267
+ try {
268
+ await save({ url: outcome.url });
269
+ }
270
+ catch (error) {
271
+ deps.warn("[static-publish] the form receiver key could not be saved; the next publish will replace it", describeErrorForLog({ err: error }));
272
+ }
273
+ }
274
+ /** Redact declared secrets from full/partial provider failures and retain the saved credential id.
275
+ * @complexity O(fields + message bytes × secrets), delegated to the shared redactor. */
276
+ function finishPublishOutcome({ outcome, credential, target }, _options = {}) {
277
+ // A plugin can include its credential in an error message. Keep the useful provider explanation
278
+ // while removing every declared secret before this site-publish response reaches HTTP or a tool.
279
+ const safe = "message" in outcome
280
+ ? { ...outcome, message: redactDeployTargetMessage({ message: outcome.message, credential, target }) } : outcome;
281
+ // Bind history to the row opened for this run, never a later default lookup.
282
+ return safe.ok && credential.credentialId !== undefined ? { ...safe, credentialId: credential.credentialId } : safe;
283
+ }
284
+ /**
285
+ * Adapts an installed module's target to devops' {@link DeployTarget} port. Installed
286
+ * content-addressed modules keep their ABI: security headers still reach the first object, and
287
+ * `checkReachability` takes the bare URL string, so the port's `{ url }` is unwrapped here.
288
+ * @param installedTarget What the plugin module's `create` returned.
289
+ * @returns The same target behind the devops port.
290
+ * @complexity O(1); each call forwards once.
291
+ */
292
+ export function adaptInstalledTarget(installedTarget) {
293
+ const resolvePublicUrl = installedTarget.resolvePublicUrl?.bind(installedTarget);
294
+ return {
295
+ id: installedTarget.id,
296
+ ...(resolvePublicUrl ? { resolvePublicUrl: (required) => resolvePublicUrl(required, {}) } : {}),
297
+ publish: (required, optional) => installedTarget.publish({ ...required, ...optional }),
298
+ checkReachability: ({ url }) => installedTarget.checkReachability(url),
299
+ };
300
+ }
301
+ /**
302
+ * Constructs the `DeployTarget` `publishAndMapOutcome` will call `publish()` on, translating a throw
303
+ * (typically a credential missing a field the host requires) into {@link publishStaticSite}'s own
304
+ * `{ok:false, code}` channel — the message, never the raw error object, since it crosses an
305
+ * HTTP/tool-result boundary.
306
+ * @complexity O(1) plus the module's own construction.
307
+ */
308
+ function constructTargetForPublish({ deps, pluginTarget, config, credential }, _options = {}) {
309
+ try {
310
+ if (deps.buildTarget !== undefined)
311
+ return { ok: true, target: deps.buildTarget(config, credential) };
312
+ const kit = deps.hostKit ?? deps.createDeployHostKit(deps.observability === undefined ? {} : { observability: deps.observability });
313
+ return { ok: true, target: adaptInstalledTarget(pluginTarget.module.create({ credential, config: config, kit })) };
314
+ }
315
+ catch {
316
+ // Adapter exceptions may include a credential field; the card needs only the target identifier.
317
+ return { ok: false, outcome: { ok: false, code: "NO_CREDENTIALS_CONFIGURED", message: `credential is not usable for ${config.target}`,
318
+ credentialSetup: deps.issueCredentialSetup({ setupToolId: "credential_save", prefill: { kind: "publish-host", target: config.target } }, {}) } };
319
+ }
320
+ }
321
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1,209 @@
1
+ import type { StaticPublishConfig, PublishCredentialSource } from './types.js';
2
+ import type { DeployTargetCredentialSpec, DeployTargetRegistry, LoadedDeployTarget, DeployTargetInspection } from '../deploy-targets/types.js';
3
+ type AdminPublishSiteDeps = {
4
+ workspaceId: string;
5
+ loadDeployTargets: (required: {
6
+ workspaceId: string;
7
+ }) => Promise<DeployTargetRegistry>;
8
+ refusal: (refusal: string) => void;
9
+ unknownTargetMessage: (required: {
10
+ registry: DeployTargetRegistry;
11
+ targetId: string;
12
+ }) => string;
13
+ readStaticPublishConfig: (required: {
14
+ target: LoadedDeployTarget;
15
+ raw: Record<string, unknown>;
16
+ options: {
17
+ blankAsAbsent: boolean;
18
+ };
19
+ }) => {
20
+ ok: true;
21
+ config: StaticPublishConfig;
22
+ } | {
23
+ ok: false;
24
+ message: string;
25
+ };
26
+ missingRequiredFieldMessage: (required: {
27
+ target: LoadedDeployTarget;
28
+ config: StaticPublishConfig;
29
+ }) => string | null;
30
+ planStaticPublish: (required: {
31
+ registry: DeployTargetRegistry;
32
+ config: StaticPublishConfig;
33
+ }) => {
34
+ ok: true;
35
+ basePath?: string;
36
+ } | {
37
+ ok: false;
38
+ message: string;
39
+ };
40
+ inspectStaticPublish: (required: {
41
+ input: {
42
+ workspaceId: string;
43
+ config: StaticPublishConfig;
44
+ projectName: string;
45
+ credentialId?: string;
46
+ };
47
+ }) => Promise<{
48
+ inspection?: DeployTargetInspection;
49
+ }>;
50
+ };
51
+ type PublishSiteContext = {
52
+ deps: AdminPublishSiteDeps;
53
+ credentialSource: PublishCredentialSource;
54
+ };
55
+ /**
56
+ * Resolves `targetId` in this workspace's registry and reads its descriptor-declared config fields
57
+ * from `raw`. Registry refusals (a module that did not load) are logged, never returned.
58
+ * @returns The target and config, or a refusal naming the unknown target / the non-string field.
59
+ * @complexity One registry load plus O(f) declared fields.
60
+ */
61
+ export declare function readTargetConfig({ deps, targetId, raw, blankAsAbsent }: {
62
+ deps: AdminPublishSiteDeps;
63
+ targetId: string;
64
+ raw: Record<string, unknown>;
65
+ blankAsAbsent: boolean;
66
+ }, _optional?: {}): Promise<{
67
+ ok: true;
68
+ registry: DeployTargetRegistry;
69
+ target: LoadedDeployTarget;
70
+ config: StaticPublishConfig;
71
+ } | {
72
+ ok: false;
73
+ error: string;
74
+ }>;
75
+ export declare function credentialChoice({ value }: {
76
+ value: unknown;
77
+ }, _options?: {}): {
78
+ credentialId?: string;
79
+ };
80
+ /** The HTTP projection calls the same authenticated inspection used by the chat preview. */
81
+ export declare function httpPublishPreview(required: {
82
+ deps: AdminPublishSiteDeps;
83
+ credentialSource: PublishCredentialSource;
84
+ registry: DeployTargetRegistry;
85
+ config: StaticPublishConfig;
86
+ query: Record<string, unknown>;
87
+ }, _options?: {}): Promise<{
88
+ target: string;
89
+ valid: boolean;
90
+ validationError: string | null;
91
+ basePath: string | null;
92
+ credentialsConfigured: boolean;
93
+ credentialGuidance: string | null;
94
+ providerInspection: DeployTargetInspection | undefined;
95
+ }>;
96
+ /** The preview query's target + config, or the 400 message for whichever part is missing/invalid. */
97
+ export declare function readPreviewTarget({ deps, query }: {
98
+ deps: AdminPublishSiteDeps;
99
+ query: Record<string, unknown>;
100
+ }): Promise<{
101
+ ok: true;
102
+ read: Extract<Awaited<ReturnType<typeof readTargetConfig>>, {
103
+ ok: true;
104
+ }>;
105
+ } | {
106
+ ok: false;
107
+ error: string;
108
+ }>;
109
+ /**
110
+ * The preview read the `publish/preview` spec (`@jini-ai/cms/admin-http/routes/system/publish-site/preview`)
111
+ * is bound to: the same reads `deployment_preview_static_publish`'s handler performs (this file's
112
+ * header) — the registry's plan (config check + base path) and local credential readiness. No export
113
+ * runs. Authenticated provider inspection is separate from `isConfigured()` (2026-08-15 split, see
114
+ * `static-publish/types.ts`'s `PublishCredentialSource` header) — a preview must never resolve a real
115
+ * credential just to read a boolean off it. A `ToolInputError` from the inspection propagates: the spec
116
+ * answers it `400 PROVIDER_INSPECTION_FAILED`.
117
+ * @complexity One registry load plus the credential/inspection reads.
118
+ */
119
+ export declare function publishPreviewFor({ context }: {
120
+ context: PublishSiteContext;
121
+ }, _optional?: Record<string, never>): ({ query }: {
122
+ query: Readonly<Record<string, unknown>>;
123
+ }) => Promise<{
124
+ ok: true;
125
+ value: Awaited<ReturnType<typeof httpPublishPreview>>;
126
+ } | {
127
+ ok: false;
128
+ error: string;
129
+ }>;
130
+ /** The registry's targets as the admin card's descriptors: ids, labels and field specs, never module paths. */
131
+ export declare function describePublishTargets({ registry }: {
132
+ registry: DeployTargetRegistry;
133
+ }, _optional?: {}): {
134
+ i18n?: Readonly<Record<string, Readonly<Record<string, string>>>>;
135
+ credential?: {
136
+ vendorLabel?: string;
137
+ help?: string;
138
+ userHelp?: string;
139
+ tokenPageUrl?: string;
140
+ tokenField: string;
141
+ fields: DeployTargetCredentialSpec["fields"];
142
+ };
143
+ projectName?: import("../../target-contracts.js").DeployTargetProjectNameCopy;
144
+ id: string;
145
+ label: string;
146
+ defaultForNewDestination: boolean;
147
+ authenticatedPreview: boolean;
148
+ configFields: readonly import("../../target-contracts.js").DeployTargetFieldSpec[];
149
+ }[];
150
+ /** The registry's public target descriptors for this workspace, bound into the `publish-targets` spec;
151
+ * registry refusals (a module that did not load) are logged, never returned. @complexity O(t). */
152
+ export declare function publishTargetsFor({ deps }: {
153
+ deps: Pick<AdminPublishSiteDeps, "workspaceId" | "loadDeployTargets" | "refusal">;
154
+ }, _optional?: {}): () => Promise<{
155
+ i18n?: Readonly<Record<string, Readonly<Record<string, string>>>>;
156
+ credential?: {
157
+ vendorLabel?: string;
158
+ help?: string;
159
+ userHelp?: string;
160
+ tokenPageUrl?: string;
161
+ tokenField: string;
162
+ fields: DeployTargetCredentialSpec["fields"];
163
+ };
164
+ projectName?: import("../../target-contracts.js").DeployTargetProjectNameCopy;
165
+ id: string;
166
+ label: string;
167
+ defaultForNewDestination: boolean;
168
+ authenticatedPreview: boolean;
169
+ configFields: readonly import("../../target-contracts.js").DeployTargetFieldSpec[];
170
+ }[]>;
171
+ export declare function createAdminPublishRead(required: PublishSiteContext, _optional?: {}): {
172
+ readTargetConfig: (input: Omit<Parameters<typeof readTargetConfig>[0], "deps">, _optional?: {}) => Promise<{
173
+ ok: true;
174
+ registry: DeployTargetRegistry;
175
+ target: LoadedDeployTarget;
176
+ config: StaticPublishConfig;
177
+ } | {
178
+ ok: false;
179
+ error: string;
180
+ }>;
181
+ publishPreview: ({ query }: {
182
+ query: Readonly<Record<string, unknown>>;
183
+ }) => Promise<{
184
+ ok: true;
185
+ value: Awaited<ReturnType<typeof httpPublishPreview>>;
186
+ } | {
187
+ ok: false;
188
+ error: string;
189
+ }>;
190
+ publishTargets: () => Promise<{
191
+ i18n?: Readonly<Record<string, Readonly<Record<string, string>>>>;
192
+ credential?: {
193
+ vendorLabel?: string;
194
+ help?: string;
195
+ userHelp?: string;
196
+ tokenPageUrl?: string;
197
+ tokenField: string;
198
+ fields: DeployTargetCredentialSpec["fields"];
199
+ };
200
+ projectName?: import("../../target-contracts.js").DeployTargetProjectNameCopy;
201
+ id: string;
202
+ label: string;
203
+ defaultForNewDestination: boolean;
204
+ authenticatedPreview: boolean;
205
+ configFields: readonly import("../../target-contracts.js").DeployTargetFieldSpec[];
206
+ }[]>;
207
+ };
208
+ export {};
209
+ //# sourceMappingURL=admin-publish-read.d.ts.map
@@ -0,0 +1,116 @@
1
+ import { ToolInputError } from '@jini-ai/core';
2
+ /**
3
+ * Resolves `targetId` in this workspace's registry and reads its descriptor-declared config fields
4
+ * from `raw`. Registry refusals (a module that did not load) are logged, never returned.
5
+ * @returns The target and config, or a refusal naming the unknown target / the non-string field.
6
+ * @complexity One registry load plus O(f) declared fields.
7
+ */
8
+ export async function readTargetConfig({ deps, targetId, raw, blankAsAbsent }, _optional = {}) {
9
+ const registry = await deps.loadDeployTargets({ workspaceId: deps.workspaceId });
10
+ for (const refusal of registry.refusals)
11
+ deps.refusal(refusal);
12
+ const target = registry.get(targetId);
13
+ if (target === undefined)
14
+ return { ok: false, error: deps.unknownTargetMessage({ registry, targetId }) };
15
+ const read = deps.readStaticPublishConfig({ target, raw, options: { blankAsAbsent } });
16
+ if (!read.ok)
17
+ return { ok: false, error: read.message };
18
+ return { ok: true, registry, target, config: read.config };
19
+ }
20
+ /** A target's saved-credential form, as the admin renders it: the vendor's display name, the field
21
+ * specs (secret fields flagged, never a value), the form's help and token page, and which field is
22
+ * the token. Never the vendor id. @complexity O(1). */
23
+ function publicCredentialSpec(spec) {
24
+ return {
25
+ ...(spec.vendorLabel !== undefined ? { vendorLabel: spec.vendorLabel } : {}),
26
+ ...(spec.help !== undefined ? { help: spec.help } : {}),
27
+ ...(spec.userHelp !== undefined ? { userHelp: spec.userHelp } : {}),
28
+ ...(spec.tokenPageUrl !== undefined ? { tokenPageUrl: spec.tokenPageUrl } : {}),
29
+ tokenField: spec.tokenField,
30
+ fields: spec.fields,
31
+ };
32
+ }
33
+ export function credentialChoice({ value }, _options = {}) {
34
+ if (value === undefined)
35
+ return {};
36
+ if (typeof value !== "string" || !value.trim())
37
+ throw new ToolInputError({ message: "credentialId must be a non-empty string naming the selected connection. Reload and choose it again." });
38
+ return { credentialId: value };
39
+ }
40
+ /** The HTTP projection calls the same authenticated inspection used by the chat preview. */
41
+ export async function httpPublishPreview(required, _options = {}) {
42
+ const { deps, credentialSource, registry, config, query } = required;
43
+ const plan = deps.planStaticPublish({ registry, config });
44
+ // A chosen connection wins over the default one for readiness too (decision J-O25).
45
+ const choice = credentialChoice({ value: query.credentialId });
46
+ const credential = await credentialSource.isConfigured({ workspaceId: deps.workspaceId, target: config.target, ...choice });
47
+ const inspected = plan.ok && credential.configured ? await deps.inspectStaticPublish({
48
+ input: { workspaceId: deps.workspaceId, config, projectName: typeof query.projectName === "string" ? query.projectName : "", ...choice },
49
+ }) : {};
50
+ return { target: config.target, valid: plan.ok, validationError: plan.ok ? null : plan.message,
51
+ basePath: plan.ok ? (plan.basePath ?? null) : null, credentialsConfigured: credential.configured,
52
+ credentialGuidance: credential.configured ? null : credential.reason,
53
+ providerInspection: inspected.inspection };
54
+ }
55
+ /** The preview query's target + config, or the 400 message for whichever part is missing/invalid. */
56
+ export async function readPreviewTarget({ deps, query }) {
57
+ if (typeof query.target !== "string" || query.target.trim() === "")
58
+ return { ok: false, error: "'target' query param (non-empty string) is required" };
59
+ const read = await readTargetConfig({ deps, targetId: query.target, raw: query, blankAsAbsent: true });
60
+ if (!read.ok)
61
+ return { ok: false, error: read.error };
62
+ // A required field that is absent is a malformed request (400); a present-but-invalid value is
63
+ // an answer (200, `valid:false`) — the distinction the admin card renders.
64
+ const missing = deps.missingRequiredFieldMessage({ target: read.target, config: read.config });
65
+ return missing !== null ? { ok: false, error: missing } : { ok: true, read };
66
+ }
67
+ /**
68
+ * The preview read the `publish/preview` spec (`@jini-ai/cms/admin-http/routes/system/publish-site/preview`)
69
+ * is bound to: the same reads `deployment_preview_static_publish`'s handler performs (this file's
70
+ * header) — the registry's plan (config check + base path) and local credential readiness. No export
71
+ * runs. Authenticated provider inspection is separate from `isConfigured()` (2026-08-15 split, see
72
+ * `static-publish/types.ts`'s `PublishCredentialSource` header) — a preview must never resolve a real
73
+ * credential just to read a boolean off it. A `ToolInputError` from the inspection propagates: the spec
74
+ * answers it `400 PROVIDER_INSPECTION_FAILED`.
75
+ * @complexity One registry load plus the credential/inspection reads.
76
+ */
77
+ export function publishPreviewFor({ context }, _optional = {}) {
78
+ const { deps, credentialSource } = context;
79
+ return async ({ query }) => {
80
+ const target = await readPreviewTarget({ deps, query: { ...query } });
81
+ if (!target.ok)
82
+ return { ok: false, error: target.error };
83
+ return { ok: true, value: await httpPublishPreview({ deps, credentialSource, registry: target.read.registry, config: target.read.config, query: { ...query } }) };
84
+ };
85
+ }
86
+ /** The registry's targets as the admin card's descriptors: ids, labels and field specs, never module paths. */
87
+ export function describePublishTargets({ registry }, _optional = {}) {
88
+ return registry.list().map(({ descriptor }) => ({
89
+ id: descriptor.id,
90
+ label: descriptor.label,
91
+ defaultForNewDestination: registry.get(descriptor.id)?.module.defaultForNewDestination === true,
92
+ authenticatedPreview: registry.get(descriptor.id)?.module.preview !== undefined,
93
+ configFields: descriptor.configFields,
94
+ ...(descriptor.projectName !== undefined ? { projectName: descriptor.projectName } : {}),
95
+ ...(descriptor.credential !== undefined ? { credential: publicCredentialSpec(descriptor.credential) } : {}),
96
+ ...(descriptor.i18n !== undefined ? { i18n: descriptor.i18n } : {}),
97
+ }));
98
+ }
99
+ /** The registry's public target descriptors for this workspace, bound into the `publish-targets` spec;
100
+ * registry refusals (a module that did not load) are logged, never returned. @complexity O(t). */
101
+ export function publishTargetsFor({ deps }, _optional = {}) {
102
+ return async () => {
103
+ const registry = await deps.loadDeployTargets({ workspaceId: deps.workspaceId });
104
+ for (const refusal of registry.refusals)
105
+ deps.refusal(refusal);
106
+ return describePublishTargets({ registry });
107
+ };
108
+ }
109
+ export function createAdminPublishRead(required, _optional = {}) {
110
+ return {
111
+ readTargetConfig: (input, _optional = {}) => readTargetConfig({ ...input, deps: required.deps }),
112
+ publishPreview: publishPreviewFor({ context: required }),
113
+ publishTargets: publishTargetsFor({ deps: required.deps }),
114
+ };
115
+ }
116
+ //# sourceMappingURL=admin-publish-read.js.map