@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,122 @@
1
+ import type { ExportReport as BaseExportReport } from "../../static-export/contracts.js";
2
+ import { type DownloadHtmlSourceEdits } from "./static-download-html.js";
3
+ import type { OwnedTempRootScope } from "./owned-temp-root.js";
4
+ /** The exporter report as this packager reads it: the base report plus the public origin a host may record. */
5
+ export type ExportReport = BaseExportReport & {
6
+ publicOrigin?: string | undefined;
7
+ };
8
+ /** Host values the static copy cannot own: the parse5 source edits, the file-stem rule and the scratch-folder prefix. */
9
+ export interface StaticCopyHost {
10
+ sourceEdits: DownloadHtmlSourceEdits;
11
+ fileStem: (required: {
12
+ name: string;
13
+ }) => string;
14
+ tempPrefix: string;
15
+ }
16
+ export interface StaticSiteMetadata {
17
+ exportedAt: string;
18
+ theme: string;
19
+ routes: string[];
20
+ failed: {
21
+ routes: ExportReport["routes"]["failed"];
22
+ assets: ExportReport["assets"]["failed"];
23
+ };
24
+ skipped: {
25
+ routes: ExportReport["skippedManifestEntries"];
26
+ assets: string[];
27
+ references: ExportReport["droppedReferences"];
28
+ };
29
+ /** Generated redirects are delivered, but are not pages/posts in the README count. */
30
+ redirectFiles?: readonly string[] | undefined;
31
+ }
32
+ export type StaticSiteCopy = {
33
+ metadata: StaticSiteMetadata;
34
+ filename: string;
35
+ siteSlug?: string | undefined;
36
+ themeId?: string | undefined;
37
+ publicOrigin?: string | undefined;
38
+ basePath?: string | undefined;
39
+ readme?: {
40
+ name: string;
41
+ words: string;
42
+ };
43
+ files: readonly {
44
+ path: string;
45
+ content: Buffer;
46
+ }[];
47
+ } | {
48
+ reason: string;
49
+ };
50
+ export interface StaticSitePorts {
51
+ render?: (required: {
52
+ outputDir: string;
53
+ clean: boolean;
54
+ themeId?: string | undefined;
55
+ publicUrl?: string | undefined;
56
+ }) => Promise<ExportReport>;
57
+ context: () => Promise<{
58
+ name: string;
59
+ slug: string;
60
+ theme: string;
61
+ themeId?: string | undefined;
62
+ timeZone?: string | undefined;
63
+ }>;
64
+ now: () => Date;
65
+ /** Installed, valid themes only; copied once at static job start. */
66
+ themes?: () => readonly {
67
+ themeId: string;
68
+ title: string;
69
+ }[];
70
+ }
71
+ /** Static copies are informational only. Import never restores their files or trusts their metadata. */
72
+ export declare function isStaticSitePath({ path: name }: {
73
+ path: string;
74
+ }, _options?: {}): boolean;
75
+ /** Plain-language gaps are limited to things that could not render or need a server.
76
+ * The full machine diagnostics, including assets a crawl could not discover, stay in capture metadata.
77
+ * @complexity O(report entries + exported file count).
78
+ */
79
+ export declare function readmeText({ name, words, metadata, rendered }: {
80
+ name: string;
81
+ words?: string | undefined;
82
+ metadata: Omit<StaticSiteMetadata, "exportedAt"> & {
83
+ exportedAt?: string | undefined;
84
+ };
85
+ rendered: {
86
+ files: readonly {
87
+ path: string;
88
+ }[];
89
+ publicOrigin?: string | undefined;
90
+ };
91
+ }, { downloadTheme }?: {
92
+ downloadTheme?: string | undefined;
93
+ }): Buffer;
94
+ /** Prepare report bytes and disclosures once for downloadable ZIPs and repository commits.
95
+ * The publisher and CLI keep the renderer's original forms and layout.
96
+ * @complexity O(export bytes + report entries), no effects.
97
+ */
98
+ export declare function prepareStaticReport({ report, sourceEdits }: {
99
+ report: ExportReport;
100
+ sourceEdits: DownloadHtmlSourceEdits;
101
+ }, _options?: {}): Pick<StaticSiteMetadata, "routes" | "redirectFiles" | "failed" | "skipped"> & {
102
+ files: {
103
+ path: string;
104
+ content: Buffer;
105
+ }[];
106
+ publicOrigin?: string | undefined;
107
+ basePath?: string | undefined;
108
+ };
109
+ /**
110
+ * Captures a fresh static copy, deleting the isolated folder after success or failure.
111
+ * Missing render support, render/cleanup errors or zero written pages cannot block a backup.
112
+ * @complexity O(export bytes + report entries), buffered like the existing backup ZIP.
113
+ */
114
+ export declare function captureStaticSite({ ports, host }: {
115
+ ports: StaticSitePorts;
116
+ host: StaticCopyHost;
117
+ }, { themeId, publicUrl, tempRoot }?: {
118
+ themeId?: string | undefined;
119
+ publicUrl?: string | undefined;
120
+ tempRoot?: OwnedTempRootScope | undefined;
121
+ }): Promise<StaticSiteCopy>;
122
+ //# sourceMappingURL=static-copy.d.ts.map
@@ -0,0 +1,165 @@
1
+ import { mkdtemp, readdir, readFile, lstat, rm } from "node:fs/promises";
2
+ import { tmpdir } from "node:os";
3
+ import path from "node:path";
4
+ import { downloadForms } from "./static-download-html.js";
5
+ /** Static copies are informational only. Import never restores their files or trusts their metadata. */
6
+ export function isStaticSitePath({ path: name }, _options = {}) {
7
+ return name === "static_site" || name.startsWith("static_site/");
8
+ }
9
+ /** One instant in the site's zone, with an explicit ISO offset and a named, human-readable zone. */
10
+ function exportStamp({ date, timeZone }, _options = {}) {
11
+ const zone = timeZone ?? Intl.DateTimeFormat().resolvedOptions().timeZone;
12
+ const parts = new Intl.DateTimeFormat("en-CA", { timeZone: zone, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", hourCycle: "h23", timeZoneName: "longOffset" }).formatToParts(date);
13
+ const fields = Object.fromEntries(parts.map(part => [part.type, part.value]));
14
+ const day = `${fields.year}-${fields.month}-${fields.day}`;
15
+ if (fields.timeZoneName === undefined)
16
+ throw new Error("Static export timestamp has no time zone offset");
17
+ const offset = fields.timeZoneName === "GMT" ? "+00:00" : fields.timeZoneName.replace("GMT", "");
18
+ return { iso: `${day}T${fields.hour}:${fields.minute}:${fields.second}${offset}`, filename: `${day}-${fields.hour}${fields.minute}`,
19
+ words: `${new Intl.DateTimeFormat("en-US", { timeZone: zone, dateStyle: "full" }).format(date)} at ${new Intl.DateTimeFormat("en-US", { timeZone: zone, hour: "numeric", minute: "2-digit", timeZoneName: "short" }).format(date)}` };
20
+ }
21
+ /** Plain-language gaps are limited to things that could not render or need a server.
22
+ * The full machine diagnostics, including assets a crawl could not discover, stay in capture metadata.
23
+ * @complexity O(report entries + exported file count).
24
+ */
25
+ export function readmeText({ name, words, metadata, rendered }, { downloadTheme } = {}) {
26
+ const formNotes = [...new Set(metadata.skipped.references.map(reference => `${serverFeatureName({ url: reference.url })} on ${reference.page}.`))];
27
+ const redirects = new Set(metadata.redirectFiles?.map(file => downloadTheme === undefined ? file : `sites/${downloadTheme}/${file}`));
28
+ const { pages, images, videos } = copyCounts({ files: rendered.files.filter(file => !redirects.has(file.path)) });
29
+ const lines = [`${name} — static copy`, ...(words === undefined ? [] : [`Exported: ${words} (${metadata.exportedAt})`]), `Theme: ${metadata.theme}`,
30
+ `Contains: ${pages} pages and posts, ${images} ${images === 1 ? "image" : "images"}, ${videos} ${videos === 1 ? "video" : "videos"}.`,
31
+ ...(downloadTheme === undefined ? ["Open with any static web host (links start at the site root)."] : [
32
+ 'To look at it: extract the ZIP, then open index.html in your browser. It lists every exported theme and page.',
33
+ `To publish it by hand: upload sites/${downloadTheme}/ and media/ together, keeping them side by side.`,
34
+ "Page, asset, social images and llms.txt links are relative to their containing files; external links keep their URLs.",
35
+ ]),
36
+ ...formNotes.map(note => `Needs a server (does not work in this copy): ${note}`),
37
+ ...metadata.failed.routes.map(item => `Not included: Page ${item.path} could not be rendered.`),
38
+ ...metadata.failed.assets.map(item => failedAssetNote({ url: item.url }))];
39
+ if (!rendered.publicOrigin)
40
+ lines.push("No public domain is set, so sitemap.xml was left out.", "The Sitemap line in robots.txt was removed and feed.xml was left out because both need absolute public URLs.", downloadTheme === undefined ? "Canonical and og:url metadata and JSON-LD url/@id values were removed; social images and llms.txt links use paths starting at the site root."
41
+ : "Canonical and og:url metadata and JSON-LD url/@id values were removed.");
42
+ return Buffer.from([...lines, ""].join("\n"));
43
+ }
44
+ /** A denied media response can be a private Library document; its identifier must not reach README. */
45
+ function failedAssetNote({ url }, _options = {}) {
46
+ if (url.startsWith("/m/"))
47
+ return "Not included: A media file could not be copied.";
48
+ return `Not included: File ${url} could not be copied.`;
49
+ }
50
+ /** Server-only links and removed form actions share the same per-page README disclosure. */
51
+ function serverFeatureName({ url }, _options = {}) {
52
+ if (url === "/signin")
53
+ return "Sign in";
54
+ return url.startsWith("/forms/contact/") ? "Contact form" : "Form";
55
+ }
56
+ /** Count delivered HTML pages (excluding the error document) and image/video files. */
57
+ function copyCounts({ files }, _options = {}) {
58
+ return { pages: files.filter(file => path.posix.basename(file.path) !== "404.html" && /\.html$/i.test(file.path)).length,
59
+ images: files.filter(file => /\.(?:avif|webp|png|jpe?g|gif|svg|ico)$/i.test(file.path)).length,
60
+ videos: files.filter(file => /\.(?:mp4|webm|mov|m4v|ogv)$/i.test(file.path)).length };
61
+ }
62
+ /** Only downloadable copies disable backend forms; the normal exporter retains publish receivers. */
63
+ function downloadableFiles({ files, publicOrigin, pages, sourceEdits }, _options = {}) {
64
+ const references = [];
65
+ const rewritten = files.map(file => {
66
+ if (!/\.html$/i.test(file.path))
67
+ return file;
68
+ const page = pages.get(file.path) ?? "/" + file.path.replace(/(?:\/)?index\.html$/, "");
69
+ const result = downloadForms({ html: file.content.toString(), page, publicOrigin, sourceEdits });
70
+ references.push(...result.removed, ...result.serverLinks);
71
+ return { ...file, content: Buffer.from(result.html) };
72
+ });
73
+ return { files: rewritten, references };
74
+ }
75
+ /** The report carries the exact bytes/layout written by the existing exporter. No second renderer. */
76
+ function reportFiles({ report }, _options = {}) {
77
+ return [...report.routes.succeeded, ...report.assets.succeeded].map(file => ({ path: file.outputFile.replaceAll("\\", "/"), content: Buffer.from(file.data) }));
78
+ }
79
+ /** Prepare report bytes and disclosures once for downloadable ZIPs and repository commits.
80
+ * The publisher and CLI keep the renderer's original forms and layout.
81
+ * @complexity O(export bytes + report entries), no effects.
82
+ */
83
+ export function prepareStaticReport({ report, sourceEdits }, _options = {}) {
84
+ const downloads = downloadableFiles({ files: reportFiles({ report }), publicOrigin: report.publicOrigin, sourceEdits,
85
+ // The error document's route is the exporter's internal 404 probe; README names its file instead.
86
+ pages: new Map(report.routes.succeeded.map(route => [route.outputFile, route.kind === "not-found" ? `/${route.outputFile}` : route.path])) });
87
+ return { files: downloads.files, publicOrigin: report.publicOrigin, basePath: report.basePath, routes: report.routes.succeeded.map(route => route.path),
88
+ redirectFiles: report.routes.succeeded.filter(route => route.kind === "redirect").map(route => route.outputFile),
89
+ failed: { routes: report.routes.failed, assets: report.assets.failed },
90
+ skipped: { routes: report.skippedManifestEntries, assets: report.unreferencedThemeFiles, references: downloads.references } };
91
+ }
92
+ /** Retain already-written files if the exporter throws before it can return a report. Never follow links. */
93
+ async function partialFiles({ outputDir }, _options = {}) {
94
+ const files = [];
95
+ for (const name of await readdir(outputDir, { recursive: true })) {
96
+ const target = path.join(outputDir, name);
97
+ if ((await lstat(target)).isFile())
98
+ files.push({ path: name.split(path.sep).join("/"), content: await readFile(target) });
99
+ }
100
+ return files;
101
+ }
102
+ /** Render through the injected owner. A thrown render becomes a disclosed failure, retaining partial output. */
103
+ async function renderCopy({ ports, host, outputDir, themeId, publicUrl }, _options = {}) {
104
+ try {
105
+ if (!ports.render)
106
+ throw new Error("Static export has no renderer");
107
+ const report = await ports.render({ outputDir, clean: true, ...(publicUrl === undefined ? {} : { publicUrl }), ...(themeId === undefined ? {} : { themeId }) });
108
+ return prepareStaticReport({ report, sourceEdits: host.sourceEdits });
109
+ }
110
+ catch (error) {
111
+ const downloads = downloadableFiles({ files: await partialFiles({ outputDir }), pages: new Map(), sourceEdits: host.sourceEdits });
112
+ return { files: downloads.files, publicOrigin: undefined, basePath: undefined, routes: [], redirectFiles: [],
113
+ failed: { routes: [{ path: "(export)", kind: "export", reason: String(error) }], assets: [] },
114
+ skipped: { routes: [], assets: [], references: downloads.references } };
115
+ }
116
+ }
117
+ /** Attach the stamp to a useful render; a 404 probe alone is not a renderable site. */
118
+ async function stampedCopy({ ports, host, outputDir, themeId, publicUrl }, _options = {}) {
119
+ const context = await ports.context();
120
+ const stamp = exportStamp({ date: ports.now(), timeZone: context.timeZone });
121
+ const rendered = await renderCopy({ ports, host, outputDir, themeId, publicUrl });
122
+ if (!rendered.files.some(file => file.path !== "404.html" && /\.html$/i.test(file.path)))
123
+ return { reason: rendered.failed.routes[0]?.reason ?? "The exporter produced no HTML pages." };
124
+ const metadata = { exportedAt: stamp.iso, theme: context.theme, routes: rendered.routes, failed: rendered.failed, skipped: rendered.skipped, redirectFiles: rendered.redirectFiles };
125
+ const slug = host.fileStem({ name: context.name });
126
+ return { metadata, filename: `${slug}-static-${stamp.filename}.zip`, siteSlug: context.slug, themeId: context.themeId ?? context.theme, publicOrigin: rendered.publicOrigin, basePath: rendered.basePath, readme: { name: context.name, words: stamp.words },
127
+ files: [...rendered.files, { path: "README.txt", content: readmeText({ name: context.name, words: stamp.words, metadata, rendered }) }] };
128
+ }
129
+ /**
130
+ * Captures a fresh static copy, deleting the isolated folder after success or failure.
131
+ * Missing render support, render/cleanup errors or zero written pages cannot block a backup.
132
+ * @complexity O(export bytes + report entries), buffered like the existing backup ZIP.
133
+ */
134
+ export async function captureStaticSite({ ports, host }, { themeId, publicUrl, tempRoot } = {}) {
135
+ if (!ports.render)
136
+ return { reason: "Static exporter is unavailable in this context." };
137
+ if (tempRoot) {
138
+ // A host-owned root: `stampedCopy` reads every rendered file back into memory before `work` settles,
139
+ // so the owned root (and its lock) outlive that read and the host's temp-root tidy cannot remove it.
140
+ try {
141
+ return await tempRoot({ work: ({ root }) => stampedCopy({ ports, host, outputDir: root, themeId, publicUrl }).catch((error) => ({ reason: String(error) })) });
142
+ }
143
+ catch (error) {
144
+ return { reason: `Static render folder could not be prepared: ${String(error)}` };
145
+ }
146
+ }
147
+ let outputDir;
148
+ let copy;
149
+ try {
150
+ outputDir = await mkdtemp(path.join(tmpdir(), host.tempPrefix));
151
+ copy = await stampedCopy({ ports, host, outputDir, themeId, publicUrl });
152
+ }
153
+ catch (error) {
154
+ copy = { reason: String(error) };
155
+ }
156
+ try {
157
+ if (outputDir)
158
+ await rm(outputDir, { recursive: true, force: true });
159
+ }
160
+ catch (error) {
161
+ copy = { reason: `Static render cleanup failed: ${String(error)}` };
162
+ }
163
+ return copy;
164
+ }
165
+ //# sourceMappingURL=static-copy.js.map
@@ -0,0 +1,76 @@
1
+ /** @file Download-only HTML transforms for the backup/share static copy: backend forms are disabled and document bases rebased. */
2
+ import type { DroppedReference } from "../../static-export/contracts.js";
3
+ /** Byte range of a node, tag or attribute within the original HTML source. */
4
+ export interface SourceRange {
5
+ startOffset: number;
6
+ endOffset: number;
7
+ }
8
+ /** An ancestor of an element; the document root has a node name but no tag. */
9
+ export interface HtmlAncestor {
10
+ nodeName: string;
11
+ tagName?: string;
12
+ parentNode?: HtmlAncestor | null;
13
+ }
14
+ /** Structural view of a parsed element: only the tag, ancestry and source offsets this file reads. */
15
+ export interface Element {
16
+ tagName: string;
17
+ parentNode?: HtmlAncestor | null;
18
+ sourceCodeLocation?: (SourceRange & {
19
+ startTag?: SourceRange;
20
+ attrs?: Record<string, SourceRange>;
21
+ }) | null;
22
+ }
23
+ export type Edit = {
24
+ startOffset: number;
25
+ endOffset: number;
26
+ text: string;
27
+ };
28
+ /** Host-owned source-located HTML editor (parse5 with source locations). Injected so the
29
+ * backup package keeps no runtime edge to the HTML owner; edits apply against original offsets,
30
+ * which keeps theme scripts, formatting and root-relative paths byte-for-byte intact. */
31
+ export interface DownloadHtmlSourceEdits {
32
+ elements(required: {
33
+ html: string;
34
+ }, optional?: Record<string, never>): Element[];
35
+ attribute(required: {
36
+ node: Element;
37
+ name: string;
38
+ }, optional?: Record<string, never>): string | undefined;
39
+ editedHtml(required: {
40
+ html: string;
41
+ edits: Edit[];
42
+ }, optional?: Record<string, never>): string;
43
+ /** Attribute/text escaping owned by the host, so the backup package imports no text utilities. */
44
+ escapeHtml(required: {
45
+ text: string;
46
+ }, optional?: Record<string, never>): string;
47
+ }
48
+ type WithEdits = {
49
+ sourceEdits: DownloadHtmlSourceEdits;
50
+ };
51
+ /** Download-only form policy. Publish retains receiver-enabled actions. Report only removed actions.
52
+ * Theme data attributes remain: themes and the form scripts may use them for styling/validation.
53
+ * Retained sign-in links are reported separately for the download's server-dependency notes.
54
+ * @complexity O(HTML bytes + edits log edits); returned removals are the machine-report evidence.
55
+ */
56
+ export declare function downloadForms({ html, page, publicOrigin, sourceEdits }: {
57
+ html: string;
58
+ page: string;
59
+ publicOrigin?: string | undefined;
60
+ } & WithEdits, _options?: {}): {
61
+ html: string;
62
+ removed: DroppedReference[];
63
+ serverLinks: DroppedReference[];
64
+ };
65
+ /** Rebase refresh targets and drop base elements so download links resolve from their own file.
66
+ * @param required HTML and the download owner's URL mapping.
67
+ * @returns HTML with parser-located edits; theme scripts and surrounding formatting stay intact.
68
+ * @complexity O(HTML bytes + edits log edits), no I/O.
69
+ * @example downloadDocumentBase({ html, rewrite: url => url, sourceEdits });
70
+ */
71
+ export declare function downloadDocumentBase({ html, rewrite, sourceEdits }: {
72
+ html: string;
73
+ rewrite: (url: string) => string;
74
+ } & WithEdits, _options?: {}): string;
75
+ export {};
76
+ //# sourceMappingURL=static-download-html.d.ts.map
@@ -0,0 +1,149 @@
1
+ /** Local form actions address a backend, including empty actions that post to the page itself. */
2
+ function serverAction({ action, publicOrigin, page }, _options = {}) {
3
+ const base = publicOrigin ?? "https://static-copy.invalid";
4
+ try {
5
+ const url = new URL(action, base + page);
6
+ return url.origin === base ? url : undefined;
7
+ }
8
+ catch {
9
+ return undefined;
10
+ }
11
+ }
12
+ /** Mailto comes from an actual page link, never assistant metadata or injected form configuration. */
13
+ function emailAlternative({ nodes, sourceEdits }, _options = {}) {
14
+ const link = nodes.find(node => node.tagName === "a" && /^mailto:/i.test(sourceEdits.attribute({ node, name: "href" }) ?? ""));
15
+ if (!link)
16
+ return "";
17
+ const href = sourceEdits.attribute({ node: link, name: "href" });
18
+ if (href === undefined)
19
+ throw new Error("Static export email link has no address");
20
+ const address = href.slice(7).split("?")[0]; // split always returns a first piece
21
+ return ` Email us at <a href="${sourceEdits.escapeHtml({ text: href })}">${sourceEdits.escapeHtml({ text: address })}</a> instead.`;
22
+ }
23
+ /** Disable one backend-dependent form and disclose the missing server immediately after it. */
24
+ function formEdits({ node, alternative }, _options = {}) {
25
+ const location = node.sourceCodeLocation;
26
+ if (!location)
27
+ throw new Error("Static export form has no source location");
28
+ const attrs = node.sourceCodeLocation?.attrs ?? {};
29
+ const edits = [];
30
+ if (attrs.action)
31
+ edits.push({ ...attrs.action, text: "" });
32
+ // Removing action/method alone defaults to GET and leaks answers into the URL. The native
33
+ // dialog method performs no network submission while preserving theme form selectors.
34
+ if (attrs.method)
35
+ edits.push({ ...attrs.method, text: 'method="dialog"' });
36
+ else {
37
+ if (!location.startTag)
38
+ throw new Error("Static export form has no start tag location");
39
+ const start = location.startTag.endOffset - 1;
40
+ edits.push({ startOffset: start, endOffset: start, text: ' method="dialog"' });
41
+ }
42
+ const end = location.endOffset;
43
+ edits.push({ startOffset: end, endOffset: end, text: `<p>This form needs a server to send messages.${alternative}</p>` });
44
+ return edits;
45
+ }
46
+ /** Explicit form owners take precedence over ancestors for outside submit controls. */
47
+ function submitOwner({ node, ids, disabled, sourceEdits }, _options = {}) {
48
+ const form = sourceEdits.attribute({ node, name: 'form' });
49
+ if (form !== undefined)
50
+ return ids.has(form);
51
+ let parent = node.parentNode;
52
+ while (parent) {
53
+ if (parent.tagName === 'form')
54
+ return disabled.has(parent);
55
+ parent = parent.parentNode;
56
+ }
57
+ return false;
58
+ }
59
+ /** Dialogs and action-less script/search forms have no known backend destination to disable. */
60
+ function backendFormTarget({ node, publicOrigin, page, sourceEdits }, _options = {}) {
61
+ if (node.tagName !== 'form' || !node.sourceCodeLocation)
62
+ return undefined;
63
+ const method = sourceEdits.attribute({ node, name: 'method' })?.toLowerCase();
64
+ if (method === 'dialog')
65
+ return undefined;
66
+ const action = sourceEdits.attribute({ node, name: 'action' });
67
+ if (action === undefined && method !== 'post' && sourceEdits.attribute({ node, name: 'data-form-slug' }) === undefined)
68
+ return undefined;
69
+ return serverAction({ action: action ?? '', publicOrigin, page });
70
+ }
71
+ /** Download-only form policy. Publish retains receiver-enabled actions. Report only removed actions.
72
+ * Theme data attributes remain: themes and the form scripts may use them for styling/validation.
73
+ * Retained sign-in links are reported separately for the download's server-dependency notes.
74
+ * @complexity O(HTML bytes + edits log edits); returned removals are the machine-report evidence.
75
+ */
76
+ export function downloadForms({ html, page, publicOrigin, sourceEdits }, _options = {}) {
77
+ const nodes = sourceEdits.elements({ html });
78
+ const alternative = emailAlternative({ nodes, sourceEdits });
79
+ const disabled = new Set();
80
+ const edits = [], removed = [], serverLinks = [];
81
+ for (const node of nodes) {
82
+ const signin = signInReference({ node, page, publicOrigin, sourceEdits });
83
+ if (signin)
84
+ serverLinks.push(signin);
85
+ const target = backendFormTarget({ node, publicOrigin, page, sourceEdits });
86
+ if (!target)
87
+ continue;
88
+ disabled.add(node);
89
+ edits.push(...formEdits({ node, alternative }));
90
+ removed.push({ page, url: target.pathname, attribute: "action", reason: "needs-server" });
91
+ }
92
+ const ids = new Set([...disabled].map(node => sourceEdits.attribute({ node, name: 'id' })).filter((id) => id !== undefined));
93
+ for (const node of nodes) {
94
+ const override = node.sourceCodeLocation?.attrs?.formmethod;
95
+ if (override && submitOwner({ node, ids, disabled, sourceEdits }))
96
+ edits.push({ ...override, text: 'formmethod="dialog"' });
97
+ }
98
+ return { html: sourceEdits.editedHtml({ html, edits }), removed, serverLinks };
99
+ }
100
+ /** Account entry points need a backend even when their link remains visible in the download. */
101
+ function signInReference({ node, page, publicOrigin, sourceEdits }, _options = {}) {
102
+ if (node.tagName !== "a")
103
+ return undefined;
104
+ const href = sourceEdits.attribute({ node, name: "href" });
105
+ if (href === undefined)
106
+ return undefined;
107
+ const target = serverAction({ action: href, publicOrigin, page });
108
+ if (target?.pathname !== "/signin")
109
+ return undefined;
110
+ return { page, url: "/signin", attribute: "href", reason: "needs-server" };
111
+ }
112
+ /** Rebase refresh targets and drop base elements so download links resolve from their own file.
113
+ * @param required HTML and the download owner's URL mapping.
114
+ * @returns HTML with parser-located edits; theme scripts and surrounding formatting stay intact.
115
+ * @complexity O(HTML bytes + edits log edits), no I/O.
116
+ * @example downloadDocumentBase({ html, rewrite: url => url, sourceEdits });
117
+ */
118
+ export function downloadDocumentBase({ html, rewrite, sourceEdits }, _options = {}) {
119
+ const edits = [];
120
+ for (const node of sourceEdits.elements({ html })) {
121
+ if (node.tagName === "base" && node.sourceCodeLocation)
122
+ edits.push({ ...node.sourceCodeLocation, text: "" });
123
+ const edit = refreshEdit({ node, rewrite, sourceEdits });
124
+ if (edit)
125
+ edits.push(edit);
126
+ }
127
+ return sourceEdits.editedHtml({ html, edits });
128
+ }
129
+ /** Refresh content is a delay plus one URL; HTML structure and quoting remain parser-owned. */
130
+ function refreshEdit({ node, rewrite, sourceEdits }, _options = {}) {
131
+ if (node.tagName !== "meta" || sourceEdits.attribute({ node, name: "http-equiv" })?.toLowerCase() !== "refresh")
132
+ return undefined;
133
+ const location = node.sourceCodeLocation?.attrs?.content;
134
+ const content = refreshContent({ content: sourceEdits.attribute({ node, name: "content" }) ?? "", rewrite });
135
+ if (!location || content === undefined)
136
+ return undefined;
137
+ return { ...location, text: `content="${sourceEdits.escapeHtml({ text: content })}"` };
138
+ }
139
+ /** Split the refresh value at its delimiters without overlapping whitespace runs or HTML matching. */
140
+ function refreshContent({ content, rewrite }, _options = {}) {
141
+ const match = /^([^;]*;[^=]*=)([\s\S]*)$/.exec(content);
142
+ if (!match)
143
+ return undefined;
144
+ if (!/;\s*url\s*=$/i.test(match[1]))
145
+ return undefined;
146
+ const url = match[2].trim().replace(/^["']|["']$/g, "");
147
+ return match[1] + rewrite(url);
148
+ }
149
+ //# sourceMappingURL=static-download-html.js.map
@@ -0,0 +1,52 @@
1
+ /** Host-supplied HTML-to-plain-text decoder (entity decoding included); the backup package owns no HTML parser. */
2
+ export type ExtractPlainText = (required: {
3
+ html: string;
4
+ }) => string;
5
+ /** One delivered page of one exported theme, as the landing page lists it. */
6
+ export interface LandingPage {
7
+ href: string;
8
+ title: string;
9
+ label: string;
10
+ }
11
+ /** One exported theme folder (`sites/<folder>/`) and its delivered pages. */
12
+ export interface LandingTheme {
13
+ title: string;
14
+ folder: string;
15
+ active: boolean;
16
+ pages: readonly LandingPage[];
17
+ }
18
+ /**
19
+ * The delivered pages of one theme, home first, then by path. Skips the error page and redirect stubs.
20
+ * @complexity O(pages log pages + page bytes scanned for <title>), no effects.
21
+ */
22
+ export declare function landingPages({ files, folder, skip, extractPlainText }: {
23
+ files: readonly {
24
+ path: string;
25
+ content: Buffer;
26
+ }[];
27
+ folder: string;
28
+ skip: ReadonlySet<string>;
29
+ extractPlainText: ExtractPlainText;
30
+ }, _options?: {}): LandingPage[];
31
+ /** Inputs of the download's root landing page: the site's display name, the optional "exported on" words and every theme card. */
32
+ export interface LandingPageInput {
33
+ siteName: string;
34
+ exportedWords?: string | undefined;
35
+ themes: readonly LandingTheme[];
36
+ }
37
+ /**
38
+ * Host-supplied renderer of the root landing page. The page is the host's exported HTML (its markup, CSS and class
39
+ * names are pinned byte for byte by the host), so the layout owns only the page list and never a template of its own.
40
+ * It must escape every name and title and keep hrefs as the plain relative paths it is given.
41
+ */
42
+ export type LandingRenderer = (required: LandingPageInput) => Buffer;
43
+ /** Root entry file of every static download and repository commit (formerly "Open website.html"). */
44
+ export declare const LANDING_FILE = "index.html";
45
+ /**
46
+ * Root index.html of a static download: works from file:// and in Quick Look with no script.
47
+ * Every name and title is escaped; hrefs are plain relative paths to delivered files.
48
+ * @complexity O(total listed pages), no effects.
49
+ * @example staticLandingPage({ siteName: "My Site", themes });
50
+ */
51
+ export declare function staticLandingPage({ siteName, exportedWords, themes }: LandingPageInput, _optional?: Record<string, never>): Buffer;
52
+ //# sourceMappingURL=static-download-landing.d.ts.map