@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,82 @@
1
+ import { parse } from "parse5";
2
+ const MAX_SAMPLE_BYTES = 1_000_000;
3
+ /** Whether the page still carries the privacy template's contact placeholder. @complexity O(n) in page bytes. */
4
+ export function findContactEmailPlaceholder({ html, placeholder }, _optional = {}) {
5
+ return html.includes(placeholder);
6
+ }
7
+ function hostOf({ value }, _optional = {}) {
8
+ if (typeof value !== "string")
9
+ return undefined;
10
+ try {
11
+ return new URL(value, "https://site.invalid").host.toLowerCase();
12
+ }
13
+ catch {
14
+ return undefined;
15
+ }
16
+ }
17
+ /** The other-origin host a hand-written `<script src>` loads from; declared (consent-managed) scripts are skipped. */
18
+ function authoredScriptHost({ node, ownHosts }, _optional = {}) {
19
+ if (node.tagName !== "script")
20
+ return undefined;
21
+ const attrs = new Map(node.attrs.map(attr => [attr.name, attr.value]));
22
+ const src = attrs.get("src");
23
+ if (!src || attrs.has("data-jini-declared-script"))
24
+ return undefined;
25
+ try {
26
+ const url = new URL(src, "https://site.invalid");
27
+ const host = url.host.toLowerCase();
28
+ return (url.protocol === "https:" || url.protocol === "http:") && host !== "site.invalid" && !ownHosts.has(host) ? host : undefined;
29
+ }
30
+ catch {
31
+ return undefined;
32
+ }
33
+ }
34
+ /**
35
+ * Hosts of external scripts written straight into a page. Relative and same-site sources are
36
+ * first-party; templates are inert authored content and are not entered.
37
+ * @complexity O(sample bytes), at most 1 MB per page.
38
+ */
39
+ export function findThirdPartyScriptHosts({ html, ownHosts }, _optional = {}) {
40
+ if (!html.toLowerCase().includes("<script"))
41
+ return []; // HTML tag names are case-insensitive; the parser sorts the rest.
42
+ const hosts = new Set();
43
+ const nodes = [...parse(html.slice(0, MAX_SAMPLE_BYTES)).childNodes];
44
+ while (nodes.length) {
45
+ const node = nodes.pop();
46
+ if (node === undefined || !("tagName" in node))
47
+ continue;
48
+ const host = authoredScriptHost({ node, ownHosts });
49
+ if (host !== undefined)
50
+ hosts.add(host);
51
+ if (node.tagName !== "template")
52
+ nodes.push(...node.childNodes);
53
+ }
54
+ return [...hosts].sort();
55
+ }
56
+ /** One export's collector. State lives in this closure, created per export, never at module level. */
57
+ export function createExportPreflight({ ownOrigins, copy }, _optional = {}) {
58
+ const ownHosts = new Set(ownOrigins.flatMap(value => hostOf({ value }) ?? []));
59
+ const found = { placeholderPages: 0, thirdPartyPages: 0, hosts: new Set(), consentConfigured: false };
60
+ return {
61
+ observePage({ html }, _optional = {}) {
62
+ if (findContactEmailPlaceholder({ html, placeholder: copy.contactEmailPlaceholder }))
63
+ found.placeholderPages += 1;
64
+ const hosts = findThirdPartyScriptHosts({ html, ownHosts });
65
+ if (hosts.length === 0)
66
+ return;
67
+ found.thirdPartyPages += 1;
68
+ for (const host of hosts)
69
+ found.hosts.add(host);
70
+ },
71
+ /** Third-party scripts only matter once a cookie banner is promising to manage consent. */
72
+ setConsentConfigured({ configured }, _optional = {}) { found.consentConfigured = configured; },
73
+ /** The existing warning with this export's pre-flight warnings appended; undefined when there are none. */
74
+ joinWarnings({ existing }, _optional = {}) {
75
+ const warnings = [existing, copy.placeholderWarning({ pages: found.placeholderPages }),
76
+ found.consentConfigured ? copy.thirdPartyWarning({ pages: found.thirdPartyPages, hosts: [...found.hosts].sort() }) : undefined]
77
+ .filter((warning) => warning !== undefined && warning !== "");
78
+ return warnings.length === 0 ? undefined : warnings.join(" ");
79
+ },
80
+ };
81
+ }
82
+ //# sourceMappingURL=export-preflight.js.map
@@ -0,0 +1,57 @@
1
+ import type { OriginRegistryPort } from "@jini-ai/core/contracts/server/verified-origin";
2
+ export interface ExportMediaUrlDeps<R extends {
3
+ status: string;
4
+ kind?: string | undefined;
5
+ source: {
6
+ sha256: string;
7
+ };
8
+ }> {
9
+ workspaceId: string;
10
+ originRegistry: Pick<OriginRegistryPort, "canonicalOrigin">;
11
+ findMedia(required: {
12
+ workspaceId: string;
13
+ idOrSlug: string;
14
+ }, optional?: Record<string, never>): Promise<R | null>;
15
+ resolveContentTypes(required: {
16
+ media: readonly R[];
17
+ }, optional?: Record<string, never>): Promise<ReadonlyMap<string, string>>;
18
+ mediaPublicPath(required: {
19
+ key: string;
20
+ sha256: string;
21
+ variant: {
22
+ kind: "original";
23
+ contentType: string;
24
+ };
25
+ }, optional?: Record<string, never>): string;
26
+ }
27
+ /** Upgrade stored URLs using the same lookup and read-path type backfill as the media library.
28
+ * O(text length + URL positions log URL positions + distinct media keys) work, one batched type lookup; legacy bytes read only
29
+ * when their type was never recorded. Missing/private documents retain their existing URLs.
30
+ */
31
+ export declare function rewriteMediaOriginalUrls<R extends {
32
+ status: string;
33
+ kind?: string | undefined;
34
+ source: {
35
+ sha256: string;
36
+ };
37
+ }>({ body, deps }: {
38
+ body: string;
39
+ deps: ExportMediaUrlDeps<R>;
40
+ }, { contentType }?: {
41
+ contentType?: string;
42
+ }): Promise<string>;
43
+ /** Rewrite textual responses before the existing exporter writes AND crawls them. Binary responses
44
+ * stay streaming and untouched. Response headers remain authoritative except for the byte length,
45
+ * which must be recalculated after a text rewrite. No extra HTTP requests or renderer are used.
46
+ */
47
+ export declare function rewriteExportMediaResponse<R extends {
48
+ status: string;
49
+ kind?: string | undefined;
50
+ source: {
51
+ sha256: string;
52
+ };
53
+ }>({ response, deps }: {
54
+ response: Response;
55
+ deps: ExportMediaUrlDeps<R>;
56
+ }, _optional?: Record<string, never>): Promise<Response>;
57
+ //# sourceMappingURL=media-original-urls.d.ts.map
@@ -0,0 +1,109 @@
1
+ import { exportUrlLocations } from "../html-url-locations.js";
2
+ // Match complete local media paths in HTML, CSS, XML and JSON, retaining query/fragment tails.
3
+ // Check absolute URLs against the configured origin: another site's /m/ namespace is not ours.
4
+ const ORIGINAL_URL = /(?<![\w/.:%-])((?:https?:)?\/\/[^/\s"'<>\\()]+)?\/m\/([^/\s"'<>\\()?#]+)\/original(?![^\s"'<>\\()?#,;])(?:\?[^\s"'<>\\()#]*)?/g;
5
+ /** Same origin as the configured site; an unparsable URL is never ours. */
6
+ function sameOrigin({ url, origin }) {
7
+ // Both sides go through URL so an explicit default port (`:443`) compares equal to none.
8
+ try {
9
+ return new URL(url, origin).origin === new URL(origin).origin;
10
+ }
11
+ catch {
12
+ return false;
13
+ }
14
+ }
15
+ /** The configured origin as text, keeping a verified non-default port (as site-exporter does). */
16
+ function originText({ scheme, host, port }, _optional = {}) {
17
+ const suffix = port === undefined ? "" : `:${port}`;
18
+ return `${scheme}://${host}${suffix}`;
19
+ }
20
+ function decodeOriginalMediaKey(raw) {
21
+ if (raw === undefined)
22
+ return undefined;
23
+ try {
24
+ return decodeURIComponent(raw);
25
+ }
26
+ catch {
27
+ return undefined;
28
+ }
29
+ }
30
+ /** Local paths need no origin lookup; absolute references must belong to the configured site.
31
+ * With no verified origin, absolute references stay as written: a link must never fail the export. */
32
+ async function localOriginalPaths({ body, deps, locations }, _optional = {}) {
33
+ const matches = locations.flatMap(({ start, end }) => [...body.slice(start, end).matchAll(ORIGINAL_URL)]);
34
+ const paths = new Map();
35
+ let origin;
36
+ for (const match of matches) {
37
+ if (match[1]) {
38
+ origin ??= await deps.originRegistry.canonicalOrigin({ workspaceId: deps.workspaceId })
39
+ .then(configured => originText(configured), () => null);
40
+ if (!origin || !sameOrigin({ url: match[0], origin }))
41
+ continue;
42
+ }
43
+ const key = decodeOriginalMediaKey(match[2]);
44
+ // Absolute URLs stay absolute (sitemaps and og:image require them); only the path is upgraded.
45
+ if (key !== undefined)
46
+ paths.set(match[0], { prefix: match[1] ?? "", key });
47
+ }
48
+ return paths;
49
+ }
50
+ /** Upgrade stored URLs using the same lookup and read-path type backfill as the media library.
51
+ * O(text length + URL positions log URL positions + distinct media keys) work, one batched type lookup; legacy bytes read only
52
+ * when their type was never recorded. Missing/private documents retain their existing URLs.
53
+ */
54
+ export async function rewriteMediaOriginalUrls({ body, deps }, { contentType = "text/html" } = {}) {
55
+ // Parsed once: the same URL positions are scanned for keys and then rewritten.
56
+ const locations = exportUrlLocations({ body, contentType });
57
+ const paths = await localOriginalPaths({ body, deps, locations });
58
+ if (paths.size === 0)
59
+ return body;
60
+ const records = await exportableMediaRecords({ paths, deps });
61
+ const contentTypes = await deps.resolveContentTypes({ media: [...records.values()] });
62
+ const replacements = new Map();
63
+ for (const [url, record] of records) {
64
+ const type = contentTypes.get(record.source.sha256);
65
+ const path = paths.get(url);
66
+ if (path === undefined)
67
+ throw new Error("Export media record has no matching URL path");
68
+ const { prefix, key } = path;
69
+ const query = new URL(url, "https://export.invalid").searchParams;
70
+ query.delete("v");
71
+ if (type)
72
+ replacements.set(url, prefix + deps.mediaPublicPath({ key, sha256: record.source.sha256, variant: { kind: "original", contentType: type } }) + (query.size ? `&${query}` : ""));
73
+ }
74
+ const output = [];
75
+ let offset = 0;
76
+ for (const { start, end } of locations) {
77
+ const value = body.slice(start, end).replace(ORIGINAL_URL, url => replacements.get(url) ?? url);
78
+ output.push(body.slice(offset, start), value);
79
+ offset = end;
80
+ }
81
+ output.push(body.slice(offset));
82
+ return output.join('');
83
+ }
84
+ /** Missing, inactive and document records keep their original URL; lookups remain sequential. */
85
+ async function exportableMediaRecords({ paths, deps }, _optional = {}) {
86
+ const records = new Map();
87
+ for (const [url, { key }] of paths) {
88
+ const record = await deps.findMedia({ workspaceId: deps.workspaceId, idOrSlug: key });
89
+ if (record && record.status === "active" && record.kind !== "document")
90
+ records.set(url, record);
91
+ }
92
+ return records;
93
+ }
94
+ /** Rewrite textual responses before the existing exporter writes AND crawls them. Binary responses
95
+ * stay streaming and untouched. Response headers remain authoritative except for the byte length,
96
+ * which must be recalculated after a text rewrite. No extra HTTP requests or renderer are used.
97
+ */
98
+ export async function rewriteExportMediaResponse({ response, deps }, _optional = {}) {
99
+ if (response.body === null)
100
+ return response;
101
+ if (!/^(?:text\/(?:html|css)|application\/(?:[\w.+-]*\+)?(?:json|xml))\b/i.test(response.headers.get("content-type") ?? ""))
102
+ return response;
103
+ const body = await rewriteMediaOriginalUrls({ body: await response.text(), deps }, { contentType: response.headers.get("content-type") ?? "" });
104
+ const headers = new Headers(response.headers);
105
+ headers.delete("content-length");
106
+ headers.delete("content-encoding");
107
+ return new Response(body, { status: response.status, statusText: response.statusText, headers });
108
+ }
109
+ //# sourceMappingURL=media-original-urls.js.map
@@ -0,0 +1,82 @@
1
+ /**
2
+ * @file Contracts for the static-site exporter's route enumeration step (2026-08-15).
3
+ *
4
+ * Purpose:
5
+ * `buildRouteManifest` owns "what URLs does this workspace's public site actually serve" —
6
+ * separately from the HTTP-driving writer, so export and preview callers share enumeration
7
+ * rather than maintaining hand-rolled route lists inside the exporter engine.
8
+ *
9
+ * `Jini/packages/cms/src/seo/sitemap.ts`'s `buildSitemap` is NOT this enumerator and must never be mistaken for it: it
10
+ * enumerates only published, indexable posts, silently omitting home, products, theme-owned static
11
+ * pages, redirects, and 404 — an SEO index and a deployable manifest answer different questions
12
+ * (the host's deployment-constraints doc, §3).
13
+ *
14
+ * Architectural role:
15
+ * Tier-2 library, mirroring `src/redirects`/`src/seo`'s own `ports.ts` + implementation-file split.
16
+ * The concrete reader (`route-manifest.ts`) reuses the exact selection logic real routes use — never
17
+ * re-derives it — so the manifest can never enumerate a route the live server would not actually
18
+ * serve, or miss one it would. `resolveActiveTheme` is a direct import from feature-owned
19
+ * the host's theme feature (see `route-manifest.ts`'s header for why this library now lives in
20
+ * `features/`).
21
+ * `resolveActiveThemeId`/`listPublishedPosts`/`resolveStorefrontProducts` are all reached via
22
+ * `RouteDeps` injection (`deps.resolveActiveThemeId()` etc.) rather than a direct import — see
23
+ * `route-manifest.ts`'s own file header for why (2026-09-03: the first two moved from direct import
24
+ * to injection specifically to close a `platform <-> features/presentation`/`platform <->
25
+ * features/post` module cycle; `resolveStorefrontProducts` was injected earlier, 2026-08-16, for an
26
+ * unrelated `SiteProduct` type-boundary reason).
27
+ */
28
+ /**
29
+ * What kind of thing a route is, for reporting only — the exporter's writer does not branch on
30
+ * this to decide HOW to fetch a route (every non-redirect, non-404 entry is fetched identically);
31
+ * it exists so a human-facing export report can say "12 posts, 3 pages, 8 theme pages, 4 products"
32
+ * instead of an undifferentiated route count.
33
+ */
34
+ export type ManifestRouteKind = "home" | "post" | "page" | "theme-page" | "product-list" | "product" | "redirect" | "not-found" | "well-known";
35
+ /**
36
+ * One publicly reachable URL. `redirectTarget`/`redirectStatusCode` are populated ONLY for
37
+ * `kind: "redirect"` — they are the rule's DECLARED destination, carried as a cross-check hint for
38
+ * the writer's own report, never as the source of truth for exported bytes: the writer re-requests
39
+ * the path with `redirect: "manual"` and writes whatever the live server actually answers with, the
40
+ * same "boot the real app, trust its real response" rule every other route follows.
41
+ */
42
+ export interface ManifestRoute {
43
+ /** Site-relative request path, e.g. `"/"`, `"/about"`, `"/products/mug-01"`. Always a leading
44
+ * slash; `"/"` is the only entry with no further segments. For `kind: "not-found"` this is a
45
+ * collision-checked SENTINEL path chosen to trigger the live 404 branch, not a real content URL —
46
+ * the writer maps its response to `404.html` at the export root rather than to this literal path. */
47
+ path: string;
48
+ kind: ManifestRouteKind;
49
+ /** Human-readable label for reporting only (slug/title/product name) — never used for lookup. */
50
+ label: string;
51
+ redirectTarget?: string;
52
+ redirectStatusCode?: number;
53
+ }
54
+ /** Identifies the active theme a built manifest resolved against, so a caller (the exporter's
55
+ * unreferenced-file diff) can locate its on-disk folder without re-resolving "which theme is
56
+ * active" a third time (`route-manifest.ts` and `pages.ts`'s live route are the other two). Not
57
+ * the full `DiscoveredTheme` — only the fields a caller outside this port's own module needs. */
58
+ export interface ManifestActiveTheme {
59
+ id: string;
60
+ /** Absolute path of the theme's own folder on disk (`DiscoveredTheme.dir`). */
61
+ dir: string;
62
+ /** `DiscoveredTheme.manifest.apiVersion` — `2` nests a static theme's files under `render/`
63
+ * (`theme-authoring-guide-v2.md` §3), `undefined` keeps the v1 theme-root layout. Threaded
64
+ * through so a caller outside this port's own module (the exporter's unreferenced-file diff)
65
+ * never has to re-derive schema version from disk layout — same reasoning as `dir` itself. */
66
+ apiVersion?: 2;
67
+ }
68
+ /** A publicly reachable URL the manifest could NOT enumerate, recorded so the export report names
69
+ * the gap instead of silently under-counting routes (the brief's "never a silently missing file"
70
+ * rule, applied one step upstream of the writer). Today's only known source: `prefix`/`wildcard`/
71
+ * `regex` redirect rules, which match a family of paths rather than one enumerable path. */
72
+ export interface ManifestSkip {
73
+ reason: string;
74
+ detail: string;
75
+ }
76
+ export interface RouteManifest {
77
+ routes: ManifestRoute[];
78
+ skipped: ManifestSkip[];
79
+ /** Set only when a valid theme was resolved (absent in the `no-theme` `skipped` case). */
80
+ activeTheme?: ManifestActiveTheme;
81
+ }
82
+ //# sourceMappingURL=ports.d.ts.map
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @file Contracts for the static-site exporter's route enumeration step (2026-08-15).
3
+ *
4
+ * Purpose:
5
+ * `buildRouteManifest` owns "what URLs does this workspace's public site actually serve" —
6
+ * separately from the HTTP-driving writer, so export and preview callers share enumeration
7
+ * rather than maintaining hand-rolled route lists inside the exporter engine.
8
+ *
9
+ * `Jini/packages/cms/src/seo/sitemap.ts`'s `buildSitemap` is NOT this enumerator and must never be mistaken for it: it
10
+ * enumerates only published, indexable posts, silently omitting home, products, theme-owned static
11
+ * pages, redirects, and 404 — an SEO index and a deployable manifest answer different questions
12
+ * (the host's deployment-constraints doc, §3).
13
+ *
14
+ * Architectural role:
15
+ * Tier-2 library, mirroring `src/redirects`/`src/seo`'s own `ports.ts` + implementation-file split.
16
+ * The concrete reader (`route-manifest.ts`) reuses the exact selection logic real routes use — never
17
+ * re-derives it — so the manifest can never enumerate a route the live server would not actually
18
+ * serve, or miss one it would. `resolveActiveTheme` is a direct import from feature-owned
19
+ * the host's theme feature (see `route-manifest.ts`'s header for why this library now lives in
20
+ * `features/`).
21
+ * `resolveActiveThemeId`/`listPublishedPosts`/`resolveStorefrontProducts` are all reached via
22
+ * `RouteDeps` injection (`deps.resolveActiveThemeId()` etc.) rather than a direct import — see
23
+ * `route-manifest.ts`'s own file header for why (2026-09-03: the first two moved from direct import
24
+ * to injection specifically to close a `platform <-> features/presentation`/`platform <->
25
+ * features/post` module cycle; `resolveStorefrontProducts` was injected earlier, 2026-08-16, for an
26
+ * unrelated `SiteProduct` type-boundary reason).
27
+ */
28
+ export {};
29
+ //# sourceMappingURL=ports.js.map
@@ -0,0 +1,32 @@
1
+ import { type OriginRegistryPort } from "@jini-ai/core/contracts/server/verified-origin";
2
+ /** Only the registry's public evidence counts; a dev seed must never become export identity.
3
+ * Reuse the configured-origin owner's validation, including loopback and credential refusal.
4
+ * Registry absence degrades the export to a copy without public identity, as it does live SEO.
5
+ * @complexity One registry read; O(origin length) validation, no network access.
6
+ */
7
+ export declare function exportPublicOrigin({ registry, workspaceId }: {
8
+ registry: OriginRegistryPort;
9
+ workspaceId: string;
10
+ }, _options?: {}): Promise<string | undefined>;
11
+ /** Replace render authority everywhere, including JSON-LD and plain-text discovery files.
12
+ * Root-relative paths and external URLs retain their exact bytes. A JSON escaped slash retains
13
+ * its encoding. The ephemeral crawl origin and persisted dev origins need the same treatment.
14
+ * @complexity O(body bytes), no requests or path/layout changes.
15
+ */
16
+ export declare function rewriteRenderOrigins({ body, renderOrigin, publicOrigin, sourceOrigin }: {
17
+ body: string;
18
+ renderOrigin: string;
19
+ publicOrigin?: string | undefined;
20
+ sourceOrigin?: string | undefined;
21
+ }, _options?: {}): string;
22
+ /** Transform every textual response before the owner crawls/writes it; binary media streams through.
23
+ * The copied response has no stale length/encoding headers after decoding and editing its body.
24
+ * @complexity O(response text bytes), one buffered response and no additional fetch.
25
+ */
26
+ export declare function rewriteExportOriginResponse({ response, url, publicOrigin, sourceOrigin }: {
27
+ response: Response;
28
+ url: string;
29
+ publicOrigin?: string | undefined;
30
+ sourceOrigin?: string | undefined;
31
+ }, _options?: {}): Promise<Response>;
32
+ //# sourceMappingURL=public-origin-policy.d.ts.map
@@ -0,0 +1,68 @@
1
+ import { resolveConfiguredOrigin, } from "@jini-ai/core/contracts/server/verified-origin";
2
+ import { orFallback } from "@jini-ai/core/errors/idioms";
3
+ /** Same loopback spellings URL normalizes from IPv4/IPv6 literals, including mapped IPv4. */
4
+ function isRenderHost({ hostname }, _options = {}) {
5
+ const host = hostname.toLowerCase().replace(/\.$/, "");
6
+ return /^(?:localhost|.*\.localhost|127\.\d+\.\d+\.\d+|0\.0\.0\.0|\[(?:::1|::|::ffff:7f[\da-f]{2}:[\da-f]+)\])$/.test(host);
7
+ }
8
+ /** Only the registry's public evidence counts; a dev seed must never become export identity.
9
+ * Reuse the configured-origin owner's validation, including loopback and credential refusal.
10
+ * Registry absence degrades the export to a copy without public identity, as it does live SEO.
11
+ * @complexity One registry read; O(origin length) validation, no network access.
12
+ */
13
+ export async function exportPublicOrigin({ registry, workspaceId }, _options = {}) {
14
+ const evidence = await orFallback({ work: () => registry.canonicalOrigin({ workspaceId }), fallback: undefined, step: "Read configured export origin" });
15
+ if (evidence === undefined)
16
+ return undefined;
17
+ if (evidence.source !== "workspace-setting")
18
+ return undefined;
19
+ const raw = `${evidence.scheme}://${evidence.host}${evidence.port === undefined ? "" : `:${evidence.port}`}`;
20
+ const accepted = resolveConfiguredOrigin({ env: { origin: raw }, envVarName: "origin", clock: { nowIso: () => evidence.verifiedAt }, warn: () => { } });
21
+ if (!accepted)
22
+ return undefined;
23
+ const parsed = new URL(raw);
24
+ return isRenderHost({ hostname: parsed.hostname }) ? undefined : parsed.origin;
25
+ }
26
+ /** Replace render authority everywhere, including JSON-LD and plain-text discovery files.
27
+ * Root-relative paths and external URLs retain their exact bytes. A JSON escaped slash retains
28
+ * its encoding. The ephemeral crawl origin and persisted dev origins need the same treatment.
29
+ * @complexity O(body bytes), no requests or path/layout changes.
30
+ */
31
+ export function rewriteRenderOrigins({ body, renderOrigin, publicOrigin, sourceOrigin }, _options = {}) {
32
+ return body.replace(/(?:\bhttps?:|(?<![:\w]))(?:\/\/|\\\/\\\/)(?:[^\s/"'<>\\()?#@]+@)?(?:\[[\da-f:.]+\]|[\w.-]+)(?::\d+)?/gi, (raw, offset) => {
33
+ let parsed;
34
+ try {
35
+ parsed = new URL(raw.replaceAll("\\/", "/"), renderOrigin);
36
+ }
37
+ catch {
38
+ return raw;
39
+ }
40
+ if (parsed.origin !== renderOrigin && parsed.origin !== sourceOrigin && !isRenderHost({ hostname: parsed.hostname }))
41
+ return raw;
42
+ const tail = body.slice(offset + raw.length, offset + raw.length + 2);
43
+ const replacement = publicOrigin ?? (/^(?:\/|\\\/)/.test(tail) ? "" : "/");
44
+ return raw.includes("\\/") ? replacement.replaceAll("/", "\\/") : replacement;
45
+ });
46
+ }
47
+ /** Transform every textual response before the owner crawls/writes it; binary media streams through.
48
+ * The copied response has no stale length/encoding headers after decoding and editing its body.
49
+ * @complexity O(response text bytes), one buffered response and no additional fetch.
50
+ */
51
+ export async function rewriteExportOriginResponse({ response, url, publicOrigin, sourceOrigin }, _options = {}) {
52
+ const headers = new Headers(response.headers);
53
+ const location = headers.get("location");
54
+ const renderOrigin = new URL(url).origin;
55
+ if (location)
56
+ headers.set("location", rewriteRenderOrigins({ body: location, renderOrigin, publicOrigin, sourceOrigin }));
57
+ if (response.body === null)
58
+ return new Response(null, { status: response.status, statusText: response.statusText, headers });
59
+ if (!/^(?:text\/|image\/svg\+xml\b|application\/(?:[\w.+-]*\+)?(?:json|xml|javascript)\b)/i.test(headers.get("content-type") ?? ""))
60
+ return response;
61
+ let body = rewriteRenderOrigins({ body: await response.text(), renderOrigin, publicOrigin, sourceOrigin });
62
+ if (!publicOrigin && new URL(url).pathname === "/robots.txt")
63
+ body = body.replace(/^[\t ]*Sitemap:[^\r\n]*(?:\r?\n|$)/gim, "");
64
+ headers.delete("content-length");
65
+ headers.delete("content-encoding");
66
+ return new Response(body, { status: response.status, statusText: response.statusText, headers });
67
+ }
68
+ //# sourceMappingURL=public-origin-policy.js.map
@@ -0,0 +1,65 @@
1
+ import type { ManifestActiveTheme, ManifestRoute, ManifestSkip, RouteManifest } from "./ports.js";
2
+ type Empty = Record<string, never>;
3
+ export interface RouteManifestSources {
4
+ readThemeAndPosts: () => Promise<{
5
+ theme: {
6
+ kind: "absent";
7
+ } | {
8
+ kind: "deliberately-off";
9
+ } | {
10
+ kind: "selected";
11
+ identity: ManifestActiveTheme;
12
+ tier: string;
13
+ pages: readonly string[];
14
+ };
15
+ posts: readonly {
16
+ slug: string;
17
+ title: string;
18
+ kind: string;
19
+ overridesThemePage?: boolean | undefined;
20
+ }[];
21
+ }>;
22
+ listProducts: () => Promise<readonly {
23
+ slug: string;
24
+ title: string;
25
+ }[]>;
26
+ listActiveRedirects: () => Promise<readonly {
27
+ matchType: string;
28
+ fromPattern: string;
29
+ toTarget: string;
30
+ statusCode: number;
31
+ }[]>;
32
+ }
33
+ export interface RouteManifestPolicy {
34
+ initialRoutes: readonly ManifestRoute[];
35
+ initialSkips: readonly ManifestSkip[];
36
+ probeBase: string;
37
+ probeSuffix: () => string;
38
+ postPath: (required: {
39
+ slug: string;
40
+ }) => string;
41
+ productPaths: {
42
+ list: string;
43
+ detail: (required: {
44
+ slug: string;
45
+ }) => string;
46
+ };
47
+ isStandaloneThemePage: (required: {
48
+ pageId: string;
49
+ }) => boolean;
50
+ skipCopy: {
51
+ absent: string;
52
+ deliberatelyOff: string;
53
+ nonExactRedirect: (required: {
54
+ matchType: string;
55
+ fromPattern: string;
56
+ toTarget: string;
57
+ }) => string;
58
+ };
59
+ }
60
+ export declare function buildRouteManifest({ sources, policy }: {
61
+ sources: RouteManifestSources;
62
+ policy: RouteManifestPolicy;
63
+ }, _optional?: Empty): Promise<RouteManifest>;
64
+ export {};
65
+ //# sourceMappingURL=route-manifest.d.ts.map