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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (402) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +16 -0
  3. package/dist/backup/site/archive-extensions.d.ts +73 -0
  4. package/dist/backup/site/archive-extensions.js +129 -0
  5. package/dist/backup/site/archive-manifest.d.ts +85 -0
  6. package/dist/backup/site/archive-manifest.js +176 -0
  7. package/dist/backup/site/archive-media.d.ts +121 -0
  8. package/dist/backup/site/archive-media.js +93 -0
  9. package/dist/backup/site/backup-service.credentials.d.ts +31 -0
  10. package/dist/backup/site/backup-service.credentials.js +158 -0
  11. package/dist/backup/site/backup-service.d.ts +336 -0
  12. package/dist/backup/site/backup-service.js +127 -0
  13. package/dist/backup/site/backup-service.plan.d.ts +64 -0
  14. package/dist/backup/site/backup-service.plan.js +207 -0
  15. package/dist/backup/site/backup-service.push.d.ts +29 -0
  16. package/dist/backup/site/backup-service.push.js +94 -0
  17. package/dist/backup/site/backup-service.shared.d.ts +40 -0
  18. package/dist/backup/site/backup-service.shared.js +37 -0
  19. package/dist/backup/site/bundled-export-file-policy.d.ts +38 -0
  20. package/dist/backup/site/bundled-export-file-policy.js +39 -0
  21. package/dist/backup/site/credential-warnings.d.ts +41 -0
  22. package/dist/backup/site/credential-warnings.js +50 -0
  23. package/dist/backup/site/import-backend-steps.d.ts +167 -0
  24. package/dist/backup/site/import-backend-steps.js +170 -0
  25. package/dist/backup/site/import-backend.d.ts +167 -0
  26. package/dist/backup/site/import-backend.js +298 -0
  27. package/dist/backup/site/import-database.d.ts +118 -0
  28. package/dist/backup/site/import-database.js +167 -0
  29. package/dist/backup/site/import-index/admission.d.ts +54 -0
  30. package/dist/backup/site/import-index/admission.js +46 -0
  31. package/dist/backup/site/import-index/backfill.d.ts +106 -0
  32. package/dist/backup/site/import-index/backfill.js +137 -0
  33. package/dist/backup/site/import-index/errors.d.ts +28 -0
  34. package/dist/backup/site/import-index/errors.js +38 -0
  35. package/dist/backup/site/import-index/migrations/checksums.d.ts +4 -0
  36. package/dist/backup/site/import-index/migrations/checksums.js +4 -0
  37. package/dist/backup/site/import-index/migrations/site-imports-v1.d.ts +2 -0
  38. package/dist/backup/site/import-index/migrations/site-imports-v1.js +10 -0
  39. package/dist/backup/site/import-index/mode.d.ts +191 -0
  40. package/dist/backup/site/import-index/mode.js +272 -0
  41. package/dist/backup/site/import-index/open.d.ts +40 -0
  42. package/dist/backup/site/import-index/open.js +87 -0
  43. package/dist/backup/site/import-index/paging.d.ts +28 -0
  44. package/dist/backup/site/import-index/paging.js +66 -0
  45. package/dist/backup/site/import-index/payload-namespace.d.ts +80 -0
  46. package/dist/backup/site/import-index/payload-namespace.js +156 -0
  47. package/dist/backup/site/import-index/rows.d.ts +32 -0
  48. package/dist/backup/site/import-index/rows.js +61 -0
  49. package/dist/backup/site/import-index/schema.d.ts +8 -0
  50. package/dist/backup/site/import-index/schema.js +31 -0
  51. package/dist/backup/site/import-index/store.d.ts +27 -0
  52. package/dist/backup/site/import-index/store.js +33 -0
  53. package/dist/backup/site/import-index/sweep.d.ts +10 -0
  54. package/dist/backup/site/import-index/sweep.js +26 -0
  55. package/dist/backup/site/import-keep-off.d.ts +128 -0
  56. package/dist/backup/site/import-keep-off.js +204 -0
  57. package/dist/backup/site/import-plugin-state.d.ts +74 -0
  58. package/dist/backup/site/import-plugin-state.js +67 -0
  59. package/dist/backup/site/import-registry.d.ts +110 -0
  60. package/dist/backup/site/import-registry.js +205 -0
  61. package/dist/backup/site/import-restore-placement.d.ts +94 -0
  62. package/dist/backup/site/import-restore-placement.js +158 -0
  63. package/dist/backup/site/import-restore.d.ts +111 -0
  64. package/dist/backup/site/import-restore.js +120 -0
  65. package/dist/backup/site/import-verifier-inventory.d.ts +137 -0
  66. package/dist/backup/site/import-verifier-inventory.js +236 -0
  67. package/dist/backup/site/import-verifier-projection.d.ts +78 -0
  68. package/dist/backup/site/import-verifier-projection.js +100 -0
  69. package/dist/backup/site/import-verifier.d.ts +126 -0
  70. package/dist/backup/site/import-verifier.js +53 -0
  71. package/dist/backup/site/owned-temp-root.d.ts +12 -0
  72. package/dist/backup/site/owned-temp-root.js +2 -0
  73. package/dist/backup/site/package-file-inventory.d.ts +63 -0
  74. package/dist/backup/site/package-file-inventory.js +56 -0
  75. package/dist/backup/site/push-content.d.ts +70 -0
  76. package/dist/backup/site/push-content.js +56 -0
  77. package/dist/backup/site/react/ShowMoreImports.d.ts +21 -0
  78. package/dist/backup/site/react/ShowMoreImports.js +8 -0
  79. package/dist/backup/site/saved-keys-port.d.ts +47 -0
  80. package/dist/backup/site/saved-keys-port.js +3 -0
  81. package/dist/backup/site/saved-keys.d.ts +25 -0
  82. package/dist/backup/site/saved-keys.js +38 -0
  83. package/dist/backup/site/share-backend.d.ts +243 -0
  84. package/dist/backup/site/share-backend.js +284 -0
  85. package/dist/backup/site/share-database/projection.d.ts +197 -0
  86. package/dist/backup/site/share-database/projection.js +90 -0
  87. package/dist/backup/site/share-database/projection.media.d.ts +38 -0
  88. package/dist/backup/site/share-database/projection.media.js +179 -0
  89. package/dist/backup/site/share-database/projection.tables.d.ts +46 -0
  90. package/dist/backup/site/share-database/projection.tables.js +210 -0
  91. package/dist/backup/site/share-expiry.d.ts +75 -0
  92. package/dist/backup/site/share-expiry.js +49 -0
  93. package/dist/backup/site/share-export-failure.d.ts +17 -0
  94. package/dist/backup/site/share-export-failure.js +16 -0
  95. package/dist/backup/site/share-file-policy.d.ts +60 -0
  96. package/dist/backup/site/share-file-policy.js +146 -0
  97. package/dist/backup/site/share-hosting.d.ts +107 -0
  98. package/dist/backup/site/share-hosting.js +148 -0
  99. package/dist/backup/site/share-preparation-steps.d.ts +180 -0
  100. package/dist/backup/site/share-preparation-steps.js +107 -0
  101. package/dist/backup/site/share-preparation.d.ts +122 -0
  102. package/dist/backup/site/share-preparation.js +43 -0
  103. package/dist/backup/site/share-refusal.d.ts +21 -0
  104. package/dist/backup/site/share-refusal.js +20 -0
  105. package/dist/backup/site/share-registry.d.ts +124 -0
  106. package/dist/backup/site/share-registry.js +219 -0
  107. package/dist/backup/site/share-retention.d.ts +62 -0
  108. package/dist/backup/site/share-retention.js +126 -0
  109. package/dist/backup/site/share-service.d.ts +128 -0
  110. package/dist/backup/site/share-service.js +194 -0
  111. package/dist/backup/site/share-zip.d.ts +115 -0
  112. package/dist/backup/site/share-zip.js +144 -0
  113. package/dist/backup/site/sources.d.ts +344 -0
  114. package/dist/backup/site/sources.js +595 -0
  115. package/dist/backup/site/static-copy.d.ts +122 -0
  116. package/dist/backup/site/static-copy.js +165 -0
  117. package/dist/backup/site/static-download-html.d.ts +76 -0
  118. package/dist/backup/site/static-download-html.js +149 -0
  119. package/dist/backup/site/static-download-landing.d.ts +52 -0
  120. package/dist/backup/site/static-download-landing.js +95 -0
  121. package/dist/backup/site/static-download-layout.d.ts +96 -0
  122. package/dist/backup/site/static-download-layout.js +325 -0
  123. package/dist/backup/site/static-export-selection.d.ts +50 -0
  124. package/dist/backup/site/static-export-selection.js +75 -0
  125. package/dist/backup/site/static-site-packager.d.ts +42 -0
  126. package/dist/backup/site/static-site-packager.js +32 -0
  127. package/dist/backup/site/tool-registrations.d.ts +74 -0
  128. package/dist/backup/site/tool-registrations.js +204 -0
  129. package/dist/checks/complexity-debt.d.ts +100 -0
  130. package/dist/checks/complexity-debt.js +131 -0
  131. package/dist/checks/coverage/diff.js +5 -1
  132. package/dist/checks/coverage/lcov.js +1 -1
  133. package/dist/checks/env-access.d.ts +14 -1
  134. package/dist/checks/env-access.js +92 -6
  135. package/dist/checks/live-verify-checks.d.ts +29 -0
  136. package/dist/checks/live-verify-checks.js +30 -0
  137. package/dist/checks/quality-gates.d.ts +137 -0
  138. package/dist/checks/quality-gates.js +209 -0
  139. package/dist/core/deploy-types.d.ts +2 -0
  140. package/dist/deploy/admin-http/site-update-status.d.ts +8 -0
  141. package/dist/deploy/admin-http/site-update-status.js +15 -0
  142. package/dist/deploy/host-kit.d.ts +3 -0
  143. package/dist/deploy/index.d.ts +6 -0
  144. package/dist/deploy/index.js +6 -0
  145. package/dist/deploy/ops-runner.js +7 -0
  146. package/dist/deploy/ops-tool-contracts.d.ts +10 -1
  147. package/dist/deploy/react/Deployment.d.ts +37 -0
  148. package/dist/deploy/react/Deployment.js +94 -0
  149. package/dist/deploy/react/DockerfileTab.d.ts +72 -0
  150. package/dist/deploy/react/DockerfileTab.js +131 -0
  151. package/dist/deploy/react/HistoryTab.d.ts +43 -0
  152. package/dist/deploy/react/HistoryTab.js +12 -0
  153. package/dist/deploy/react/OverviewTab.d.ts +60 -0
  154. package/dist/deploy/react/OverviewTab.js +75 -0
  155. package/dist/deploy/react/PublishRunResult.d.ts +5 -1
  156. package/dist/deploy/react/PublishRunResult.js +4 -4
  157. package/dist/deploy/react/SiteUpdateNotice.d.ts +22 -0
  158. package/dist/deploy/react/SiteUpdateNotice.js +25 -0
  159. package/dist/deploy/react/StaticCredentialFields.d.ts +36 -0
  160. package/dist/deploy/react/StaticCredentialFields.js +63 -0
  161. package/dist/deploy/react/StaticCredentialSteps.d.ts +23 -0
  162. package/dist/deploy/react/StaticCredentialSteps.js +152 -0
  163. package/dist/deploy/react/StaticExportCard.d.ts +11 -0
  164. package/dist/deploy/react/StaticExportCard.js +97 -0
  165. package/dist/deploy/react/StaticPublishCredentials.d.ts +50 -0
  166. package/dist/deploy/react/StaticPublishCredentials.js +77 -0
  167. package/dist/deploy/react/StaticPublishForm.d.ts +12 -0
  168. package/dist/deploy/react/StaticPublishForm.js +91 -0
  169. package/dist/deploy/react/StaticSiteTab.d.ts +207 -0
  170. package/dist/deploy/react/StaticSiteTab.js +117 -0
  171. package/dist/deploy/react/deployment-visuals.d.ts +207 -0
  172. package/dist/deploy/react/deployment-visuals.js +101 -0
  173. package/dist/deploy/react/download-dockerfile.d.ts +14 -0
  174. package/dist/deploy/react/download-dockerfile.js +15 -0
  175. package/dist/deploy/react/hooks/publish-credential-draft.d.ts +33 -0
  176. package/dist/deploy/react/hooks/publish-credential-draft.js +54 -0
  177. package/dist/deploy/react/hooks/publish-credential-selection.d.ts +13 -0
  178. package/dist/deploy/react/hooks/publish-credential-selection.js +34 -0
  179. package/dist/deploy/react/hooks/publish-credential-writes.d.ts +20 -0
  180. package/dist/deploy/react/hooks/publish-credential-writes.js +99 -0
  181. package/dist/deploy/react/hooks/static-publish-actions.d.ts +10 -0
  182. package/dist/deploy/react/hooks/static-publish-actions.js +62 -0
  183. package/dist/deploy/react/hooks/static-publish-form.hooks.d.ts +38 -0
  184. package/dist/deploy/react/hooks/static-publish-form.hooks.js +103 -0
  185. package/dist/deploy/react/hooks/static-publish-run.hooks.d.ts +28 -0
  186. package/dist/deploy/react/hooks/static-publish-run.hooks.js +92 -0
  187. package/dist/deploy/react/hooks/use-dockerfile-source.hooks.d.ts +148 -0
  188. package/dist/deploy/react/hooks/use-dockerfile-source.hooks.js +155 -0
  189. package/dist/deploy/react/hooks/use-publish-credentials.hooks.d.ts +268 -0
  190. package/dist/deploy/react/hooks/use-publish-credentials.hooks.js +52 -0
  191. package/dist/deploy/react/hooks/use-static-export.hooks.d.ts +128 -0
  192. package/dist/deploy/react/hooks/use-static-export.hooks.js +159 -0
  193. package/dist/deploy/react/hooks/use-static-publish.hooks.d.ts +208 -0
  194. package/dist/deploy/react/hooks/use-static-publish.hooks.js +48 -0
  195. package/dist/deploy/react/index.d.ts +4 -0
  196. package/dist/deploy/react/index.js +2 -0
  197. package/dist/deploy/react/rules.d.ts +363 -0
  198. package/dist/deploy/react/rules.js +314 -0
  199. package/dist/deploy/react/use-deployment-overview.hooks.d.ts +41 -0
  200. package/dist/deploy/react/use-deployment-overview.hooks.js +11 -0
  201. package/dist/deploy/site/agent-tools.d.ts +42 -0
  202. package/dist/deploy/site/agent-tools.js +119 -0
  203. package/dist/deploy/site/deploy-config-registry.d.ts +155 -0
  204. package/dist/deploy/site/deploy-config-registry.js +124 -0
  205. package/dist/deploy/site/deploy-config.d.ts +97 -0
  206. package/dist/deploy/site/deploy-config.js +115 -0
  207. package/dist/deploy/site/deploy-ops/agent-tools.d.ts +22 -0
  208. package/dist/deploy/site/deploy-ops/agent-tools.js +76 -0
  209. package/dist/deploy/site/deploy-ops/registry.d.ts +134 -0
  210. package/dist/deploy/site/deploy-ops/registry.js +106 -0
  211. package/dist/deploy/site/deploy-ops/run-ops.d.ts +66 -0
  212. package/dist/deploy/site/deploy-ops/run-ops.js +34 -0
  213. package/dist/deploy/site/deploy-ops/secret-confirm.d.ts +36 -0
  214. package/dist/deploy/site/deploy-ops/secret-confirm.js +27 -0
  215. package/dist/deploy/site/deploy-targets/host-kit.d.ts +28 -0
  216. package/dist/deploy/site/deploy-targets/host-kit.js +120 -0
  217. package/dist/deploy/site/deploy-targets/registry.d.ts +157 -0
  218. package/dist/deploy/site/deploy-targets/registry.js +130 -0
  219. package/dist/deploy/site/deploy-targets/types.d.ts +27 -0
  220. package/dist/deploy/site/deploy-targets/types.js +2 -0
  221. package/dist/deploy/site/dockerfile.d.ts +137 -0
  222. package/dist/deploy/site/dockerfile.js +101 -0
  223. package/dist/deploy/site/export-run.d.ts +137 -0
  224. package/dist/deploy/site/export-run.js +152 -0
  225. package/dist/deploy/site/ports.d.ts +115 -0
  226. package/dist/deploy/site/ports.js +2 -0
  227. package/dist/deploy/site/publish-agent-tools.d.ts +18 -0
  228. package/dist/deploy/site/publish-agent-tools.js +120 -0
  229. package/dist/deploy/site/publish-candidate.d.ts +26 -0
  230. package/dist/deploy/site/publish-candidate.js +37 -0
  231. package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.d.ts +78 -0
  232. package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.js +88 -0
  233. package/dist/deploy/site/publish-credentials/compatibility-port.d.ts +38 -0
  234. package/dist/deploy/site/publish-credentials/compatibility-port.js +19 -0
  235. package/dist/deploy/site/publish-credentials/execution-mode.d.ts +43 -0
  236. package/dist/deploy/site/publish-credentials/execution-mode.js +19 -0
  237. package/dist/deploy/site/publish-credentials/store-owner.d.ts +11 -0
  238. package/dist/deploy/site/publish-credentials/store-owner.js +9 -0
  239. package/dist/deploy/site/publish-credentials/store-resolution.d.ts +55 -0
  240. package/dist/deploy/site/publish-credentials/store-resolution.js +100 -0
  241. package/dist/deploy/site/publish-credentials/store-validation.d.ts +68 -0
  242. package/dist/deploy/site/publish-credentials/store-validation.js +182 -0
  243. package/dist/deploy/site/publish-credentials/store.d.ts +321 -0
  244. package/dist/deploy/site/publish-credentials/store.js +367 -0
  245. package/dist/deploy/site/publish-credentials/types.d.ts +85 -0
  246. package/dist/deploy/site/publish-credentials/types.js +2 -0
  247. package/dist/deploy/site/publish-tool-capabilities.d.ts +123 -0
  248. package/dist/deploy/site/publish-tool-capabilities.js +175 -0
  249. package/dist/deploy/site/publish-tool-credential.d.ts +48 -0
  250. package/dist/deploy/site/publish-tool-credential.js +284 -0
  251. package/dist/deploy/site/publish-tool-deps.d.ts +205 -0
  252. package/dist/deploy/site/publish-tool-deps.js +15 -0
  253. package/dist/deploy/site/publish-tool-execution.d.ts +78 -0
  254. package/dist/deploy/site/publish-tool-execution.js +313 -0
  255. package/dist/deploy/site/publish-tool-schema.d.ts +29 -0
  256. package/dist/deploy/site/publish-tool-schema.js +38 -0
  257. package/dist/deploy/site/static-publish/adapter-export.d.ts +54 -0
  258. package/dist/deploy/site/static-publish/adapter-export.js +89 -0
  259. package/dist/deploy/site/static-publish/adapter-plan.d.ts +99 -0
  260. package/dist/deploy/site/static-publish/adapter-plan.js +112 -0
  261. package/dist/deploy/site/static-publish/adapter.d.ts +182 -0
  262. package/dist/deploy/site/static-publish/adapter.js +321 -0
  263. package/dist/deploy/site/static-publish/admin-publish-read.d.ts +209 -0
  264. package/dist/deploy/site/static-publish/admin-publish-read.js +118 -0
  265. package/dist/deploy/site/static-publish/credentials.d.ts +114 -0
  266. package/dist/deploy/site/static-publish/credentials.js +298 -0
  267. package/dist/deploy/site/static-publish/domain-publish-rows.d.ts +25 -0
  268. package/dist/deploy/site/static-publish/domain-publish-rows.js +43 -0
  269. package/dist/deploy/site/static-publish/domain-publish-tool.d.ts +19 -0
  270. package/dist/deploy/site/static-publish/domain-publish-tool.js +111 -0
  271. package/dist/deploy/site/static-publish/inspection.d.ts +24 -0
  272. package/dist/deploy/site/static-publish/inspection.js +69 -0
  273. package/dist/deploy/site/static-publish/publish-history.d.ts +197 -0
  274. package/dist/deploy/site/static-publish/publish-history.js +153 -0
  275. package/dist/deploy/site/static-publish/publish-run.d.ts +156 -0
  276. package/dist/deploy/site/static-publish/publish-run.js +186 -0
  277. package/dist/deploy/site/static-publish/types.d.ts +168 -0
  278. package/dist/deploy/site/static-publish/types.js +2 -0
  279. package/dist/deploy/site/static-publish/verify.d.ts +237 -0
  280. package/dist/deploy/site/static-publish/verify.js +284 -0
  281. package/dist/deploy/site/tool-registrations.d.ts +97 -0
  282. package/dist/deploy/site/tool-registrations.js +130 -0
  283. package/dist/deploy/site/types.d.ts +51 -0
  284. package/dist/deploy/site/types.js +2 -0
  285. package/dist/deploy/site-update/check-for-update.d.ts +19 -0
  286. package/dist/deploy/site-update/check-for-update.js +19 -0
  287. package/dist/deploy/site-update/contracts.d.ts +161 -0
  288. package/dist/deploy/site-update/contracts.js +94 -0
  289. package/dist/deploy/site-update/desktop-site-update.d.ts +66 -0
  290. package/dist/deploy/site-update/desktop-site-update.js +43 -0
  291. package/dist/deploy/site-update/fake-site-update.d.ts +39 -0
  292. package/dist/deploy/site-update/fake-site-update.js +52 -0
  293. package/dist/deploy/site-update/run-site-update.d.ts +121 -0
  294. package/dist/deploy/site-update/run-site-update.js +219 -0
  295. package/dist/deploy/site-update/self-hosted-site-update.d.ts +71 -0
  296. package/dist/deploy/site-update/self-hosted-site-update.js +79 -0
  297. package/dist/deploy/target-contracts.d.ts +3 -0
  298. package/dist/deploy/tool.d.ts +5 -8
  299. package/dist/deploy/tool.js +6 -9
  300. package/dist/dns/binding-sweeper.d.ts +72 -0
  301. package/dist/dns/binding-sweeper.js +53 -0
  302. package/dist/dns/index.d.ts +1 -0
  303. package/dist/dns/index.js +1 -0
  304. package/dist/dns/site/binding.repo.d.ts +71 -0
  305. package/dist/dns/site/binding.repo.js +45 -0
  306. package/dist/dns/site/dns-changes.d.ts +90 -0
  307. package/dist/dns/site/dns-changes.js +271 -0
  308. package/dist/dns/site/dns-tools.d.ts +46 -0
  309. package/dist/dns/site/dns-tools.js +204 -0
  310. package/dist/dns/site/mail-dns-status.d.ts +111 -0
  311. package/dist/dns/site/mail-dns-status.js +190 -0
  312. package/dist/dns/site/mail-dns-tools.d.ts +33 -0
  313. package/dist/dns/site/mail-dns-tools.js +62 -0
  314. package/dist/dns/site/mail-requirements.d.ts +30 -0
  315. package/dist/dns/site/mail-requirements.js +78 -0
  316. package/dist/dns/site/tool-deps.d.ts +21 -0
  317. package/dist/dns/site/tool-deps.js +2 -0
  318. package/dist/dns/site/tools.d.ts +74 -0
  319. package/dist/dns/site/tools.js +124 -0
  320. package/dist/local-dev/bind-host.d.ts +80 -0
  321. package/dist/local-dev/bind-host.js +90 -0
  322. package/dist/local-dev/dev-proxy-upstream.d.ts +69 -0
  323. package/dist/local-dev/dev-proxy-upstream.js +63 -0
  324. package/dist/local-dev/index.d.ts +28 -0
  325. package/dist/local-dev/index.js +25 -0
  326. package/dist/packaging/electron/archive.d.ts +2 -9
  327. package/dist/packaging/electron/asar-adapter.d.ts +2 -1
  328. package/dist/packaging/electron/entry.d.ts +2 -0
  329. package/dist/packaging/electron/move-to-applications.d.ts +165 -0
  330. package/dist/packaging/electron/move-to-applications.js +162 -0
  331. package/dist/packaging/electron/policies.d.ts +33 -4
  332. package/dist/packaging/electron/policies.js +29 -10
  333. package/dist/packaging/electron/ports.d.ts +1 -6
  334. package/dist/packaging/electron/staging.d.ts +11 -2
  335. package/dist/packaging/electron/staging.js +15 -5
  336. package/dist/packaging/electron/update-manifest-merge.js +0 -2
  337. package/dist/react/site-share-expiry/ShareExpiryControls.d.ts +29 -0
  338. package/dist/react/site-share-expiry/ShareExpiryControls.js +7 -0
  339. package/dist/react/site-share-expiry/index.d.ts +2 -0
  340. package/dist/react/site-share-expiry/index.js +2 -0
  341. package/dist/source-control/react/ProvidersTab.d.ts +98 -0
  342. package/dist/source-control/react/ProvidersTab.js +195 -0
  343. package/dist/source-control/react/SourceControl.d.ts +51 -0
  344. package/dist/source-control/react/SourceControl.js +61 -0
  345. package/dist/source-control/react/hooks/use-source-control-credentials.hooks.d.ts +128 -0
  346. package/dist/source-control/react/hooks/use-source-control-credentials.hooks.js +102 -0
  347. package/dist/source-control/react/rules.d.ts +167 -0
  348. package/dist/source-control/react/rules.js +125 -0
  349. package/dist/source-control/react/source-control-visuals.d.ts +75 -0
  350. package/dist/source-control/react/source-control-visuals.js +48 -0
  351. package/dist/source-control/site/agent-tools.d.ts +5 -0
  352. package/dist/source-control/site/agent-tools.js +30 -0
  353. package/dist/source-control/site/bundled-provider-registry.d.ts +33 -0
  354. package/dist/source-control/site/bundled-provider-registry.js +37 -0
  355. package/dist/source-control/site/commit-schema.d.ts +40 -0
  356. package/dist/source-control/site/commit-schema.js +29 -0
  357. package/dist/source-control/site/commit-target.d.ts +26 -0
  358. package/dist/source-control/site/commit-target.js +58 -0
  359. package/dist/source-control/site/credential-form.d.ts +36 -0
  360. package/dist/source-control/site/credential-form.js +102 -0
  361. package/dist/source-control/site/credential-setup.d.ts +107 -0
  362. package/dist/source-control/site/credential-setup.js +216 -0
  363. package/dist/source-control/site/provider-kit.d.ts +37 -0
  364. package/dist/source-control/site/provider-kit.js +35 -0
  365. package/dist/source-control/site/provider-module.d.ts +251 -0
  366. package/dist/source-control/site/provider-module.js +2 -0
  367. package/dist/source-control/site/saved-key-bindings.d.ts +4 -0
  368. package/dist/source-control/site/saved-key-bindings.js +4 -0
  369. package/dist/source-control/site/static-site-packager-port.d.ts +37 -0
  370. package/dist/source-control/site/static-site-packager-port.js +2 -0
  371. package/dist/source-control/site/store.d.ts +209 -0
  372. package/dist/source-control/site/store.js +374 -0
  373. package/dist/source-control/site/store.validation.d.ts +72 -0
  374. package/dist/source-control/site/store.validation.js +168 -0
  375. package/dist/source-control/site/tool-registrations.d.ts +190 -0
  376. package/dist/source-control/site/tool-registrations.js +379 -0
  377. package/dist/static-export/asset-crawl.d.ts +30 -0
  378. package/dist/static-export/asset-crawl.js +71 -0
  379. package/dist/static-export/dynamic-asset-locations.d.ts +23 -0
  380. package/dist/static-export/dynamic-asset-locations.js +34 -0
  381. package/dist/static-export/html-url-locations.d.ts +3 -1
  382. package/dist/static-export/html-url-locations.js +43 -9
  383. package/dist/static-export/runner.js +26 -27
  384. package/dist/static-export/site/export-preflight.d.ts +48 -0
  385. package/dist/static-export/site/export-preflight.js +82 -0
  386. package/dist/static-export/site/media-original-urls.d.ts +57 -0
  387. package/dist/static-export/site/media-original-urls.js +109 -0
  388. package/dist/static-export/site/ports.d.ts +82 -0
  389. package/dist/static-export/site/ports.js +29 -0
  390. package/dist/static-export/site/public-origin-policy.d.ts +32 -0
  391. package/dist/static-export/site/public-origin-policy.js +68 -0
  392. package/dist/static-export/site/route-manifest.d.ts +65 -0
  393. package/dist/static-export/site/route-manifest.js +139 -0
  394. package/dist/static-export/site/site-exporter.d.ts +158 -0
  395. package/dist/static-export/site/site-exporter.js +112 -0
  396. package/dist/static-export/site/static-security-headers.d.ts +39 -0
  397. package/dist/static-export/site/static-security-headers.js +43 -0
  398. package/dist/static-export/site/theme-preview-manifest.d.ts +35 -0
  399. package/dist/static-export/site/theme-preview-manifest.js +28 -0
  400. package/dist/static-export/transforms.d.ts +1 -1
  401. package/dist/static-export/transforms.js +3 -3
  402. package/package.json +911 -7
@@ -0,0 +1,28 @@
1
+ import type { UserFacingError } from "@jini-ai/core";
2
+ import type { useStaticPublish } from "./use-static-publish.hooks.js";
3
+ export declare function useStaticPublishRun({ port, locale, hooks, deps }: Parameters<typeof useStaticPublish>[0], _optional?: {}): {
4
+ run: import("./use-static-publish.hooks.js").AdminPublishRunSnapshot | undefined;
5
+ setRun: import("react").Dispatch<import("react").SetStateAction<import("./use-static-publish.hooks.js").AdminPublishRunSnapshot | undefined>>;
6
+ publishing: boolean;
7
+ setPublishing: import("react").Dispatch<import("react").SetStateAction<boolean>>;
8
+ publishError: string | null;
9
+ setPublishError: import("react").Dispatch<import("react").SetStateAction<string | null>>;
10
+ publishFailure: UserFacingError | null;
11
+ setPublishFailure: import("react").Dispatch<import("react").SetStateAction<UserFacingError | null>>;
12
+ pollError: string | null;
13
+ setPollError: import("react").Dispatch<import("react").SetStateAction<string | null>>;
14
+ seededRef: import("react").RefObject<boolean>;
15
+ loadError: string | null;
16
+ pollFailuresRef: import("react").RefObject<number>;
17
+ publishingRef: import("react").RefObject<boolean>;
18
+ isPublishing: boolean;
19
+ pollInputs: import("react").RefObject<{
20
+ port: import("@jini-ai/core/contracts/site/deployment-admin").StaticPublishPort<import("../rules.js").AdminPublishTargetDescriptor, import("./use-static-publish.hooks.js").AdminStaticPublishConfig, import("./use-static-publish.hooks.js").AdminStaticPublishPreview, import("./use-static-publish.hooks.js").AdminPublishRunSnapshot>;
21
+ locale: string;
22
+ }>;
23
+ };
24
+ export declare function useStaticPublishPolling({ state, deps }: {
25
+ state: ReturnType<typeof useStaticPublishRun>;
26
+ deps: Parameters<typeof useStaticPublish>[0]["deps"];
27
+ }, _optional?: {}): void;
28
+ //# sourceMappingURL=static-publish-run.hooks.d.ts.map
@@ -0,0 +1,92 @@
1
+ import { useEffect, useRef, useState } from "react";
2
+ import { UNKNOWN_ERROR } from "./static-publish-actions.js";
3
+ /** Same interval `use-static-export.hooks.ts` polls its own run at — see that constant's doc for
4
+ * why this width. Publishing additionally blocks on an external provider's own build (up to
5
+ * roughly a minute per `publish-site.ts`'s header), so this loop simply runs for longer, not
6
+ * faster or slower. */
7
+ const PUBLISH_POLL_INTERVAL_MS = 1500;
8
+ /** Same bound and same rationale as `use-static-export.hooks.ts`'s own `POLL_FAILURE_LIMIT` — how
9
+ * many CONSECUTIVE poll failures the loop below tolerates before giving up and surfacing
10
+ * {@link StaticPublishController.pollError} instead of retrying forever. */
11
+ const PUBLISH_POLL_FAILURE_LIMIT = 3;
12
+ export function useStaticPublishRun({ port, locale, hooks, deps }, _optional = {}) {
13
+ const { useFetchQuery } = hooks;
14
+ const { publishLoadErrorMessage, describeApiError } = deps;
15
+ const query = useFetchQuery({ key: ["deployment", "publish"], fetch: () => port.getPublishStatus() });
16
+ const [run, setRun] = useState(undefined);
17
+ const [publishing, setPublishing] = useState(false);
18
+ const [publishError, setPublishError] = useState(null);
19
+ const [publishFailure, setPublishFailure] = useState(null);
20
+ const [pollError, setPollError] = useState(null);
21
+ // Seeds `run` from the query's first successful load, exactly once — same shape
22
+ // `use-static-export.hooks.ts`'s own `seededRef` uses, and for the same reason (a reload mid-
23
+ // publish, or a second tab, should show the real state rather than a blank "not started").
24
+ const seededRef = useRef(false);
25
+ useEffect(() => {
26
+ if (seededRef.current || query.status === "loading" || !query.data)
27
+ return;
28
+ seededRef.current = true;
29
+ setRun(query.data);
30
+ }, [query.status, query.data]);
31
+ const loadError = query.error ? publishLoadErrorMessage({ locale, error: describeApiError({ e: query.error, fallback: UNKNOWN_ERROR }) }) : null;
32
+ // Counts CONSECUTIVE poll failures for the `PUBLISH_POLL_FAILURE_LIMIT` bound below — same ref-not-
33
+ // state reasoning `use-static-export.hooks.ts`'s own `pollFailuresRef` documents.
34
+ const pollFailuresRef = useRef(0);
35
+ // Synchronous duplicate-submit guard for `publish()` — a ref, not the `publishing` state, because a
36
+ // true double-click can fire two calls in the same synchronous tick, before React has re-rendered
37
+ // with `publishing: true`; `publishing` (state) still exists to let the UI disable the button, but
38
+ // the guard that actually stops a second POST from ever being sent has to be synchronous (C4 fix).
39
+ const publishingRef = useRef(false);
40
+ const isPublishing = run?.status === "running" && pollError === null;
41
+ const pollInputs = useRef({ port, locale });
42
+ pollInputs.current = { port, locale };
43
+ return { run, setRun, publishing, setPublishing, publishError, setPublishError, publishFailure, setPublishFailure, pollError, setPollError, seededRef, loadError, pollFailuresRef, publishingRef, isPublishing, pollInputs };
44
+ }
45
+ export function useStaticPublishPolling({ state, deps }, _optional = {}) {
46
+ const { isPublishing, pollInputs, pollFailuresRef, setRun, setPollError } = state;
47
+ const { setTimeout, clearTimeout, publishPollErrorMessage, describeApiError } = deps;
48
+ // Self-scheduling poll loop, re-armed only when `isPublishing` flips true — identical shape and
49
+ // identical reasoning to `use-static-export.hooks.ts`'s own poll effect; see that file's comment
50
+ // for why `run`/`port` are deliberately excluded from the dependency list.
51
+ useEffect(() => {
52
+ if (!isPublishing)
53
+ return undefined;
54
+ const { port: pollPort, locale: pollLocale } = pollInputs.current;
55
+ let cancelled = false;
56
+ let timer;
57
+ function scheduleNext() {
58
+ timer = setTimeout(poll, PUBLISH_POLL_INTERVAL_MS);
59
+ }
60
+ async function poll() {
61
+ try {
62
+ const status = await pollPort.getPublishStatus();
63
+ if (cancelled)
64
+ return;
65
+ pollFailuresRef.current = 0;
66
+ setRun(status);
67
+ if (status.status === "running")
68
+ scheduleNext();
69
+ }
70
+ catch (err) {
71
+ if (cancelled)
72
+ return;
73
+ pollFailuresRef.current += 1;
74
+ if (pollFailuresRef.current >= PUBLISH_POLL_FAILURE_LIMIT) {
75
+ // Bounded (C2, same shape as use-static-export.hooks.ts's own fix): give up rather than
76
+ // retry forever. Setting `pollError` also flips `isPublishing` false on the next render,
77
+ // which re-arms this effect's own cleanup — but `return` here (no `scheduleNext()`) is
78
+ // what actually stops the loop; it must not depend on that later render having happened.
79
+ setPollError(publishPollErrorMessage({ locale: pollLocale, error: describeApiError({ e: err, fallback: UNKNOWN_ERROR }) }));
80
+ return;
81
+ }
82
+ scheduleNext();
83
+ }
84
+ }
85
+ scheduleNext();
86
+ return () => {
87
+ cancelled = true;
88
+ clearTimeout(timer);
89
+ };
90
+ }, [isPublishing]);
91
+ }
92
+ //# sourceMappingURL=static-publish-run.hooks.js.map
@@ -0,0 +1,148 @@
1
+ import type { FetchQueryAdapter } from "@jini-ai/core/fetch";
2
+ import type { DockerfileSourceSnapshot } from "../../site/dockerfile.js";
3
+ import { type Translate } from '@jini-ai/core/text';
4
+ /**
5
+ * @file Everything the Dockerfile tab does — load, edit, save, and the copy-to-clipboard
6
+ * interaction — so `DockerfileTab.tsx` is only markup.
7
+ *
8
+ * ## 2026-08-15 — the tab gained a write half
9
+ *
10
+ * The backend (`PUT .../system/dockerfile`, `api.setDockerfileSource`,
11
+ * `features/deployments/dockerfile.ts`'s `writeDockerfileSource`) landed the same day as this
12
+ * change and was already wired through `dockerfile-source-port.hooks.ts` (in `@jini-ai/admin`)/
13
+ * `dockerfile-source-dependencies.hooks.ts` before this hook touched it — see those files' own
14
+ * headers. `DockerfileTab.tsx`'s OWN header used to claim "there is no write route" as the reason
15
+ * this tab was read-only; that had gone stale (the write route existed, the frontend just hadn't
16
+ * been wired to it yet) and is corrected as part of this pass, not left standing.
17
+ *
18
+ * `snapshot`/`draft` are deliberately two different pieces of state, not one: `snapshot` is the
19
+ * last value this hook knows the SERVER holds (from the initial load, or echoed back by a
20
+ * successful save); `draft` is the operator's live edit buffer, seeded from `snapshot` once and
21
+ * otherwise touched only by `setDraft`/a successful `save()`. Same split `Jini forms/react/hooks/use-form-editor.hooks.ts`
22
+ * draws between `list.data` and `form`/`name`/`slug`/etc., and for the identical reason: an
23
+ * in-progress edit must survive a background refresh of the same query key without being clobbered
24
+ * (see `seededRef` below).
25
+ *
26
+ * `save()` calls `setDockerfileSource` through `useFetchMutation` with NO `invalidates` — there is
27
+ * no sibling list resource for a single repo-root file, and the mutation's own response is a fresher
28
+ * answer than a redundant re-`GET` of the same key would be. `snapshot`/`draft` are set directly
29
+ * from that response instead, mirroring `Jini forms/react/hooks/use-form-editor.hooks.ts`'s `handleSave` (which invalidates
30
+ * only the sibling `KEYS.list`, never its own `KEYS.form(id)` read) and
31
+ * `use-widget-region-editor.hooks.ts`'s `save()` (though that one DOES re-`load()`, for a reason
32
+ * that does not apply here — it reconciles a version counter for OTHER placements that may have
33
+ * changed shape; a Dockerfile write has no analogous server-side transform to reconcile).
34
+ *
35
+ * ## 2026-08-15 — optimistic concurrency (Terra audit finding C5)
36
+ *
37
+ * `snapshot.etag` (from `AdminDockerfileSource.etag`, itself read off the server's `ETag` response
38
+ * header — see that field's own doc in `lib/api.ts`) is sent as `save()`'s `ifMatch`, so a save that
39
+ * is based on stale contents — e.g. the AI assistant's own `deployment_set_dockerfile` tool saved a
40
+ * different version in between this hook's last load and this `save()` call — is refused by the
41
+ * server (`412`) instead of silently overwriting it. On that refusal, {@link save} does the opposite
42
+ * of every other failure path here: it does NOT let the generic `saveError` machinery describe it,
43
+ * and it does NOT touch `draft` at all. Instead it populates {@link saveConflict} with the real
44
+ * current contents the `412` response carried, so `DockerfileTab.tsx` can show them next to the
45
+ * operator's own untouched `draft` for a side-by-side comparison — "a generic save error" is
46
+ * explicitly the thing this is not (the brief for this change named that distinction directly).
47
+ * {@link reloadAfterConflict} is the operator's way out: a fresh `GET`, replacing `snapshot` (and
48
+ * therefore the etag the NEXT `save()` will use) with the server's current state, while still
49
+ * leaving `draft` alone — the operator reconciles their own edit by hand against what
50
+ * {@link saveConflict} showed them, then saves again.
51
+ */
52
+ export interface DockerfileSourceController {
53
+ /** The last value this hook knows the server holds — `undefined` until the first successful
54
+ * load. Distinct from {@link draft}: see this file's header for why the split exists. */
55
+ snapshot: DockerfileSourceSnapshot | undefined;
56
+ /** The editable buffer `DockerfileTab.tsx`'s textarea is bound to. Seeded from `snapshot` once
57
+ * it first loads (or once a save creates it, for the "no Dockerfile yet" case), and otherwise
58
+ * driven entirely by {@link setDraft} and a successful {@link save}. */
59
+ draft: string;
60
+ setDraft: (value: string) => void;
61
+ /** Whether `draft` differs from `snapshot`'s own contents — drives the "Unsaved changes" pill
62
+ * and, via `useDirtyGuard`, a native `beforeunload` prompt against losing an un-saved edit by
63
+ * closing or reloading the tab. Always `false` before `snapshot` has loaded. */
64
+ isDirty: boolean;
65
+ /** Already-formatted, translated LOAD error — `null` while loading or once loaded successfully.
66
+ * Distinct from {@link saveError}: a failed load and a failed save are different failures that
67
+ * can both be true at once (load succeeded earlier, THIS save attempt just failed). */
68
+ error: string | null;
69
+ /** True while a `save()` call is in flight. */
70
+ saving: boolean;
71
+ /** Already-formatted, translated SAVE error from the most recent {@link save} call — `null` until
72
+ * a save fails, and reset to `null` at the start of every new attempt. A `412` conflict does NOT
73
+ * populate this — see {@link saveConflict} instead, and this file's header for why the two are
74
+ * kept deliberately distinct. */
75
+ saveError: string | null;
76
+ /** Set only when the most recent {@link save} was refused with a `412` conflict — the real current
77
+ * `{exists, contents}` the server reported at that moment, for `DockerfileTab.tsx` to show next to
78
+ * the operator's own {@link draft} so they can reconcile by hand. `null` otherwise, and reset to
79
+ * `null` at the start of every new {@link save} attempt (a fresh attempt deserves a fresh
80
+ * judgment, not a stale conflict banner left over from a previous one) and by
81
+ * {@link reloadAfterConflict}. */
82
+ saveConflict: {
83
+ exists: boolean;
84
+ contents: string | null;
85
+ } | null;
86
+ /** Recovery action for a {@link saveConflict}: re-reads the Dockerfile from the server, replacing
87
+ * {@link snapshot} (and therefore the etag the next {@link save} call will use) with the fresh
88
+ * result, and clears {@link saveConflict}. Deliberately does NOT touch {@link draft} — the
89
+ * operator's in-progress edit survives so they can reconcile it by hand against what
90
+ * {@link saveConflict} just showed them before saving again. Resolves either way; a failed reload
91
+ * simply leaves {@link saveConflict} exactly as it was (nothing new to surface — the operator can
92
+ * still read the conflict's own contents and retry this action). */
93
+ reloadAfterConflict: () => Promise<void>;
94
+ /** True for a short window right after a successful {@link save} — drives a transient "Saved"
95
+ * confirmation next to the Save button, on the theory that "the Unsaved-changes pill went away"
96
+ * is not, by itself, an obviously-noticed success signal. Same `setTimeout(..., 1500)` reset
97
+ * idiom as {@link copied}. */
98
+ saved: boolean;
99
+ /** True for a short window right after a successful {@link copy} — drives the button's
100
+ * "Copied!" label. Mirrors `copyHash`'s `setTimeout(..., 1500)` reset in
101
+ * `use-edit-media-panel.hooks.ts`. */
102
+ copied: boolean;
103
+ /** Writes {@link draft} (not `snapshot` — the operator's current edit, which is what's actually
104
+ * on screen) to the clipboard, if there's anything to write. Swallows a denied clipboard
105
+ * permission the same way `copyHash`/`copyUrl` do. */
106
+ copy: () => Promise<void>;
107
+ /** Persists {@link draft} via `PUT .../system/dockerfile` (with `snapshot`'s etag as `ifMatch`),
108
+ * creating the file if it didn't exist yet. Resolves either way — a failure surfaces through
109
+ * {@link saveError} for an ordinary failure, or {@link saveConflict} for a `412` — never a thrown
110
+ * rejection, so callers don't need a try/catch of their own. */
111
+ save: () => Promise<void>;
112
+ /** Bound translator — see this file's header. */
113
+ t: Translate;
114
+ }
115
+ export declare function useDockerfileSource({ port, t, locale, useFetchQueryHook, useFetchMutationHook, useDirtyGuardHook, readSaveConflict, describeFailure, writeClipboard }: {
116
+ port: {
117
+ getDockerfileSource(): Promise<DockerfileSourceSnapshot>;
118
+ setDockerfileSource(required: {
119
+ contents: string;
120
+ ifMatch: string;
121
+ }, optional?: Record<string, never>): Promise<DockerfileSourceSnapshot>;
122
+ };
123
+ t: Translate;
124
+ locale: string;
125
+ useFetchQueryHook: FetchQueryAdapter["useFetchQuery"];
126
+ useFetchMutationHook: FetchQueryAdapter["useFetchMutation"];
127
+ useDirtyGuardHook(required: {
128
+ current: string;
129
+ original: string | null;
130
+ }): {
131
+ isDirty: boolean;
132
+ };
133
+ readSaveConflict(required: {
134
+ error: unknown;
135
+ }): {
136
+ exists: boolean;
137
+ contents: string | null;
138
+ } | null;
139
+ describeFailure(required: {
140
+ error: unknown;
141
+ locale: string;
142
+ operation: "load" | "save";
143
+ }): string;
144
+ writeClipboard(required: {
145
+ contents: string;
146
+ }): Promise<void>;
147
+ }, _options?: {}): DockerfileSourceController;
148
+ //# sourceMappingURL=use-dockerfile-source.hooks.d.ts.map
@@ -0,0 +1,155 @@
1
+ import { useEffect, useRef, useState } from "react";
2
+ import {} from '@jini-ai/core/text';
3
+ /** Loads the file once and seeds the editable draft from it; later refetches never clobber an unsaved edit. */
4
+ function useDockerfileDraft({ port, locale, useFetchQueryHook, describeFailure }) {
5
+ const query = useFetchQueryHook({
6
+ key: ["deployment", "dockerfile"],
7
+ fetch: () => port.getDockerfileSource(),
8
+ });
9
+ const [snapshot, setSnapshot] = useState(undefined);
10
+ const [draft, setDraft] = useState("");
11
+ // Seeds `snapshot`/`draft` from the query's first successful load, exactly once — a LATER
12
+ // background refetch of the same `["deployment", "dockerfile"]` key (the 10s `staleTime` window,
13
+ // or a remount) must not clobber an in-progress, unsaved edit. Same guard shape
14
+ // `Jini forms/react/hooks/use-form-editor.hooks.ts`'s `seededFormIdRef` uses; a plain boolean here rather than an
15
+ // identity comparison because this key has no id to key off — it names one fixed file.
16
+ const seededRef = useRef(false);
17
+ useEffect(() => {
18
+ if (seededRef.current || query.status === "loading" || !query.data)
19
+ return;
20
+ seededRef.current = true;
21
+ setSnapshot(query.data);
22
+ setDraft(query.data.contents ?? "");
23
+ }, [query.status, query.data]);
24
+ const error = query.error
25
+ ? describeFailure({ error: query.error, locale, operation: "load" })
26
+ : null;
27
+ return { snapshot, setSnapshot, draft, setDraft, error };
28
+ }
29
+ /** The "Copied!" confirmation window and the clipboard write of the current draft. */
30
+ function useDockerfileCopy({ draft, writeClipboard }) {
31
+ const [copied, setCopied] = useState(false);
32
+ async function copy() {
33
+ if (!draft)
34
+ return;
35
+ try {
36
+ await writeClipboard({ contents: draft });
37
+ setCopied(true);
38
+ setTimeout(() => setCopied(false), 1500);
39
+ }
40
+ catch {
41
+ // Clipboard access can be denied (permissions, insecure context) — see this file's header.
42
+ }
43
+ }
44
+ return { copied, copy };
45
+ }
46
+ async function saveDockerfile({ snapshot, draft, savingRef, setSaveConflict, saveMutation, setSnapshot, setDraft, setSaved, readSaveConflict }) {
47
+ // No etag to compare `ifMatch` against before the initial load has resolved — unreachable via
48
+ // the UI anyway (`DockerfileTab.tsx` shows "Loading…" and renders no Save button while
49
+ // `!snapshot`), but a direct caller (a test, or a future caller) gets a clean no-op instead of
50
+ // sending a request the server would refuse for a reason that has nothing to do with THIS call.
51
+ if (!snapshot)
52
+ return;
53
+ // A second call while the first is still in flight is a duplicate submit — ignore it here too,
54
+ // not just via the UI's `saving`-gated disabled Save button, so the race can't still send two
55
+ // PUTs (C4 fix; see `savingRef`'s own doc above for why this check must be synchronous).
56
+ if (savingRef.current)
57
+ return;
58
+ savingRef.current = true;
59
+ // A fresh attempt deserves a fresh judgment, not a conflict banner left over from a previous
60
+ // one — see this file's header.
61
+ setSaveConflict(null);
62
+ const sent = draft;
63
+ try {
64
+ const updated = await saveMutation.mutate({ input: { contents: sent, ifMatch: snapshot.etag } });
65
+ setSnapshot(updated);
66
+ // The response describes what was SENT. An edit typed while the PUT was in flight is newer than
67
+ // both, so the buffer adopts the server's copy only if it still holds exactly what was sent
68
+ // (terra review 2026-09-20, finding 4) — otherwise it stays, dirty against the new snapshot.
69
+ setDraft((current) => (current === sent ? (updated.contents ?? "") : current));
70
+ setSaved(true);
71
+ setTimeout(() => setSaved(false), 1500);
72
+ }
73
+ catch (err) {
74
+ const conflict = readSaveConflict({ error: err });
75
+ if (conflict !== null) {
76
+ setSaveConflict(conflict);
77
+ // A conflict is deliberately NOT a generic save error (see this file's header) — `reset()`
78
+ // clears the mutation's own error state so the `saveError` derivation below reports `null`
79
+ // on the next render instead of describing this same rejection a second, blander way.
80
+ saveMutation.reset();
81
+ return;
82
+ }
83
+ // any other failure: already surfaced through saveMutation.error -> saveError below
84
+ }
85
+ finally {
86
+ // Unconditional and in `finally` specifically — every branch above (success, conflict,
87
+ // ordinary failure) must release this guard, or one failed save would permanently wedge
88
+ // every future Save click into a silent no-op with no error surfaced anywhere.
89
+ savingRef.current = false;
90
+ }
91
+ }
92
+ /** Saving with an `If-Match` etag: duplicate-submit guard, 412 conflict capture and the transient "Saved" flag. */
93
+ function useDockerfileSave({ port, locale, source, useFetchMutationHook, readSaveConflict, describeFailure }) {
94
+ const { snapshot, setSnapshot, draft, setDraft } = source;
95
+ const [saved, setSaved] = useState(false);
96
+ const [saveConflict, setSaveConflict] = useState(null);
97
+ // No `invalidates` — see this file's header for why a redundant re-`GET` of this hook's own read
98
+ // key would be strictly worse than the response already in hand.
99
+ const saveMutation = useFetchMutationHook({
100
+ run: ({ input }) => port.setDockerfileSource(input),
101
+ });
102
+ // Synchronous duplicate-submit guard for `save()` — a ref, not the `saving` (state) value below,
103
+ // because a true double-click/double-Enter can fire two `save()` calls in the same synchronous
104
+ // tick, before React has re-rendered with `saving: true`. `saving` (derived from
105
+ // `saveMutation.status`) still exists to let the UI disable the Save button, but the guard that
106
+ // actually stops a second PUT from ever being sent has to be synchronous — same shape and same
107
+ // reasoning as `use-static-publish.hooks.ts`'s own `publishingRef` (C4 fix, fixed the same night).
108
+ // Without this, two rapid Saves could both read the SAME `snapshot.etag` as `ifMatch` (neither has
109
+ // committed yet), send two writes, and let the second one's `412` come back for a save the
110
+ // operator never actually made twice on purpose — a self-inflicted version of the exact race this
111
+ // whole change exists to close.
112
+ const savingRef = useRef(false);
113
+ function save() {
114
+ return saveDockerfile({ snapshot, draft, savingRef, setSaveConflict, saveMutation, setSnapshot, setDraft, setSaved, readSaveConflict });
115
+ }
116
+ const saveError = saveMutation.error
117
+ ? describeFailure({ error: saveMutation.error, locale, operation: "save" })
118
+ : null;
119
+ async function reloadAfterConflict() {
120
+ try {
121
+ const fresh = await port.getDockerfileSource();
122
+ setSnapshot(fresh);
123
+ setSaveConflict(null);
124
+ // `draft` is deliberately left untouched here — see this file's header for why: the
125
+ // operator's in-progress edit must survive so they can reconcile it by hand against what
126
+ // `saveConflict` just showed them, then save again.
127
+ }
128
+ catch {
129
+ // A failed reload leaves `saveConflict` exactly as it was — the operator can still read the
130
+ // conflict's own contents and retry this action; nothing new needs surfacing here.
131
+ }
132
+ }
133
+ return { saving: saveMutation.status === "pending", saveError, saveConflict, reloadAfterConflict, saved, save };
134
+ }
135
+ export function useDockerfileSource({ port, t, locale, useFetchQueryHook, useFetchMutationHook, useDirtyGuardHook, readSaveConflict, describeFailure, writeClipboard }, _options = {}) {
136
+ const source = useDockerfileDraft({ port, locale, useFetchQueryHook, describeFailure });
137
+ const { snapshot, draft, setDraft, error } = source;
138
+ // No `translate`: this hook reads only `isDirty`, never the guard's translated leave-confirm, so
139
+ // the identity translator it used to pass was never called (and equals the guard's own default).
140
+ const { isDirty } = useDirtyGuardHook({ current: draft, original: snapshot ? (snapshot.contents ?? "") : null });
141
+ const { copied, copy } = useDockerfileCopy({ draft, writeClipboard });
142
+ const save = useDockerfileSave({ port, locale, source, useFetchMutationHook, readSaveConflict, describeFailure });
143
+ return {
144
+ snapshot,
145
+ draft,
146
+ setDraft,
147
+ isDirty,
148
+ error,
149
+ ...save,
150
+ copied,
151
+ copy,
152
+ t,
153
+ };
154
+ }
155
+ //# sourceMappingURL=use-dockerfile-source.hooks.js.map