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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +16 -0
  3. package/dist/backup/site/archive-extensions.d.ts +73 -0
  4. package/dist/backup/site/archive-extensions.js +129 -0
  5. package/dist/backup/site/archive-manifest.d.ts +85 -0
  6. package/dist/backup/site/archive-manifest.js +176 -0
  7. package/dist/backup/site/archive-media.d.ts +121 -0
  8. package/dist/backup/site/archive-media.js +93 -0
  9. package/dist/backup/site/backup-service.credentials.d.ts +31 -0
  10. package/dist/backup/site/backup-service.credentials.js +161 -0
  11. package/dist/backup/site/backup-service.d.ts +331 -0
  12. package/dist/backup/site/backup-service.js +125 -0
  13. package/dist/backup/site/backup-service.plan.d.ts +64 -0
  14. package/dist/backup/site/backup-service.plan.js +207 -0
  15. package/dist/backup/site/backup-service.push.d.ts +29 -0
  16. package/dist/backup/site/backup-service.push.js +82 -0
  17. package/dist/backup/site/backup-service.shared.d.ts +40 -0
  18. package/dist/backup/site/backup-service.shared.js +37 -0
  19. package/dist/backup/site/bundled-export-file-policy.d.ts +38 -0
  20. package/dist/backup/site/bundled-export-file-policy.js +40 -0
  21. package/dist/backup/site/credential-warnings.d.ts +41 -0
  22. package/dist/backup/site/credential-warnings.js +50 -0
  23. package/dist/backup/site/import-backend-steps.d.ts +167 -0
  24. package/dist/backup/site/import-backend-steps.js +170 -0
  25. package/dist/backup/site/import-backend.d.ts +167 -0
  26. package/dist/backup/site/import-backend.js +298 -0
  27. package/dist/backup/site/import-database.d.ts +118 -0
  28. package/dist/backup/site/import-database.js +167 -0
  29. package/dist/backup/site/import-index/admission.d.ts +54 -0
  30. package/dist/backup/site/import-index/admission.js +46 -0
  31. package/dist/backup/site/import-index/backfill.d.ts +106 -0
  32. package/dist/backup/site/import-index/backfill.js +137 -0
  33. package/dist/backup/site/import-index/errors.d.ts +28 -0
  34. package/dist/backup/site/import-index/errors.js +38 -0
  35. package/dist/backup/site/import-index/migrations/checksums.d.ts +4 -0
  36. package/dist/backup/site/import-index/migrations/checksums.js +4 -0
  37. package/dist/backup/site/import-index/migrations/site-imports-v1.d.ts +2 -0
  38. package/dist/backup/site/import-index/migrations/site-imports-v1.js +10 -0
  39. package/dist/backup/site/import-index/mode.d.ts +191 -0
  40. package/dist/backup/site/import-index/mode.js +272 -0
  41. package/dist/backup/site/import-index/open.d.ts +40 -0
  42. package/dist/backup/site/import-index/open.js +87 -0
  43. package/dist/backup/site/import-index/paging.d.ts +28 -0
  44. package/dist/backup/site/import-index/paging.js +66 -0
  45. package/dist/backup/site/import-index/payload-namespace.d.ts +80 -0
  46. package/dist/backup/site/import-index/payload-namespace.js +156 -0
  47. package/dist/backup/site/import-index/rows.d.ts +32 -0
  48. package/dist/backup/site/import-index/rows.js +61 -0
  49. package/dist/backup/site/import-index/schema.d.ts +8 -0
  50. package/dist/backup/site/import-index/schema.js +31 -0
  51. package/dist/backup/site/import-index/store.d.ts +27 -0
  52. package/dist/backup/site/import-index/store.js +33 -0
  53. package/dist/backup/site/import-index/sweep.d.ts +10 -0
  54. package/dist/backup/site/import-index/sweep.js +26 -0
  55. package/dist/backup/site/import-keep-off.d.ts +128 -0
  56. package/dist/backup/site/import-keep-off.js +204 -0
  57. package/dist/backup/site/import-plugin-state.d.ts +74 -0
  58. package/dist/backup/site/import-plugin-state.js +67 -0
  59. package/dist/backup/site/import-registry.d.ts +110 -0
  60. package/dist/backup/site/import-registry.js +205 -0
  61. package/dist/backup/site/import-restore-placement.d.ts +94 -0
  62. package/dist/backup/site/import-restore-placement.js +158 -0
  63. package/dist/backup/site/import-restore.d.ts +111 -0
  64. package/dist/backup/site/import-restore.js +120 -0
  65. package/dist/backup/site/import-verifier-inventory.d.ts +137 -0
  66. package/dist/backup/site/import-verifier-inventory.js +236 -0
  67. package/dist/backup/site/import-verifier-projection.d.ts +78 -0
  68. package/dist/backup/site/import-verifier-projection.js +100 -0
  69. package/dist/backup/site/import-verifier.d.ts +126 -0
  70. package/dist/backup/site/import-verifier.js +53 -0
  71. package/dist/backup/site/owned-temp-root.d.ts +12 -0
  72. package/dist/backup/site/owned-temp-root.js +2 -0
  73. package/dist/backup/site/package-file-inventory.d.ts +63 -0
  74. package/dist/backup/site/package-file-inventory.js +56 -0
  75. package/dist/backup/site/push-content.d.ts +70 -0
  76. package/dist/backup/site/push-content.js +56 -0
  77. package/dist/backup/site/react/ShowMoreImports.d.ts +21 -0
  78. package/dist/backup/site/react/ShowMoreImports.js +8 -0
  79. package/dist/backup/site/saved-keys-port.d.ts +47 -0
  80. package/dist/backup/site/saved-keys-port.js +3 -0
  81. package/dist/backup/site/saved-keys.d.ts +25 -0
  82. package/dist/backup/site/saved-keys.js +38 -0
  83. package/dist/backup/site/share-backend.d.ts +243 -0
  84. package/dist/backup/site/share-backend.js +284 -0
  85. package/dist/backup/site/share-database/projection.d.ts +195 -0
  86. package/dist/backup/site/share-database/projection.js +90 -0
  87. package/dist/backup/site/share-database/projection.media.d.ts +38 -0
  88. package/dist/backup/site/share-database/projection.media.js +179 -0
  89. package/dist/backup/site/share-database/projection.tables.d.ts +46 -0
  90. package/dist/backup/site/share-database/projection.tables.js +193 -0
  91. package/dist/backup/site/share-expiry.d.ts +75 -0
  92. package/dist/backup/site/share-expiry.js +49 -0
  93. package/dist/backup/site/share-export-failure.d.ts +17 -0
  94. package/dist/backup/site/share-export-failure.js +16 -0
  95. package/dist/backup/site/share-file-policy.d.ts +60 -0
  96. package/dist/backup/site/share-file-policy.js +146 -0
  97. package/dist/backup/site/share-hosting.d.ts +107 -0
  98. package/dist/backup/site/share-hosting.js +148 -0
  99. package/dist/backup/site/share-preparation-steps.d.ts +180 -0
  100. package/dist/backup/site/share-preparation-steps.js +109 -0
  101. package/dist/backup/site/share-preparation.d.ts +122 -0
  102. package/dist/backup/site/share-preparation.js +43 -0
  103. package/dist/backup/site/share-refusal.d.ts +21 -0
  104. package/dist/backup/site/share-refusal.js +20 -0
  105. package/dist/backup/site/share-registry.d.ts +124 -0
  106. package/dist/backup/site/share-registry.js +219 -0
  107. package/dist/backup/site/share-retention.d.ts +62 -0
  108. package/dist/backup/site/share-retention.js +126 -0
  109. package/dist/backup/site/share-service.d.ts +128 -0
  110. package/dist/backup/site/share-service.js +194 -0
  111. package/dist/backup/site/share-zip.d.ts +115 -0
  112. package/dist/backup/site/share-zip.js +144 -0
  113. package/dist/backup/site/sources.d.ts +344 -0
  114. package/dist/backup/site/sources.js +595 -0
  115. package/dist/backup/site/static-copy.d.ts +122 -0
  116. package/dist/backup/site/static-copy.js +165 -0
  117. package/dist/backup/site/static-download-html.d.ts +76 -0
  118. package/dist/backup/site/static-download-html.js +149 -0
  119. package/dist/backup/site/static-download-landing.d.ts +52 -0
  120. package/dist/backup/site/static-download-landing.js +95 -0
  121. package/dist/backup/site/static-download-layout.d.ts +96 -0
  122. package/dist/backup/site/static-download-layout.js +325 -0
  123. package/dist/backup/site/static-export-selection.d.ts +50 -0
  124. package/dist/backup/site/static-export-selection.js +76 -0
  125. package/dist/backup/site/static-site-packager.d.ts +42 -0
  126. package/dist/backup/site/static-site-packager.js +32 -0
  127. package/dist/backup/site/tool-registrations.d.ts +74 -0
  128. package/dist/backup/site/tool-registrations.js +201 -0
  129. package/dist/checks/complexity-debt.d.ts +100 -0
  130. package/dist/checks/complexity-debt.js +131 -0
  131. package/dist/checks/coverage/diff.js +5 -1
  132. package/dist/checks/env-access.d.ts +14 -1
  133. package/dist/checks/env-access.js +92 -6
  134. package/dist/checks/live-verify-checks.d.ts +29 -0
  135. package/dist/checks/live-verify-checks.js +30 -0
  136. package/dist/checks/quality-gates.d.ts +137 -0
  137. package/dist/checks/quality-gates.js +209 -0
  138. package/dist/core/deploy-types.d.ts +2 -0
  139. package/dist/deploy/admin-http/site-update-status.d.ts +8 -0
  140. package/dist/deploy/admin-http/site-update-status.js +15 -0
  141. package/dist/deploy/host-kit.d.ts +3 -0
  142. package/dist/deploy/index.d.ts +6 -0
  143. package/dist/deploy/index.js +6 -0
  144. package/dist/deploy/ops-runner.js +7 -0
  145. package/dist/deploy/ops-tool-contracts.d.ts +10 -1
  146. package/dist/deploy/react/Deployment.d.ts +37 -0
  147. package/dist/deploy/react/Deployment.js +94 -0
  148. package/dist/deploy/react/DockerfileTab.d.ts +72 -0
  149. package/dist/deploy/react/DockerfileTab.js +131 -0
  150. package/dist/deploy/react/HistoryTab.d.ts +43 -0
  151. package/dist/deploy/react/HistoryTab.js +12 -0
  152. package/dist/deploy/react/OverviewTab.d.ts +60 -0
  153. package/dist/deploy/react/OverviewTab.js +75 -0
  154. package/dist/deploy/react/PublishRunResult.d.ts +5 -1
  155. package/dist/deploy/react/PublishRunResult.js +4 -4
  156. package/dist/deploy/react/SiteUpdateNotice.d.ts +22 -0
  157. package/dist/deploy/react/SiteUpdateNotice.js +25 -0
  158. package/dist/deploy/react/StaticCredentialFields.d.ts +36 -0
  159. package/dist/deploy/react/StaticCredentialFields.js +63 -0
  160. package/dist/deploy/react/StaticCredentialSteps.d.ts +23 -0
  161. package/dist/deploy/react/StaticCredentialSteps.js +155 -0
  162. package/dist/deploy/react/StaticExportCard.d.ts +11 -0
  163. package/dist/deploy/react/StaticExportCard.js +97 -0
  164. package/dist/deploy/react/StaticPublishCredentials.d.ts +50 -0
  165. package/dist/deploy/react/StaticPublishCredentials.js +77 -0
  166. package/dist/deploy/react/StaticPublishForm.d.ts +12 -0
  167. package/dist/deploy/react/StaticPublishForm.js +91 -0
  168. package/dist/deploy/react/StaticSiteTab.d.ts +207 -0
  169. package/dist/deploy/react/StaticSiteTab.js +117 -0
  170. package/dist/deploy/react/deployment-visuals.d.ts +207 -0
  171. package/dist/deploy/react/deployment-visuals.js +101 -0
  172. package/dist/deploy/react/download-dockerfile.d.ts +14 -0
  173. package/dist/deploy/react/download-dockerfile.js +15 -0
  174. package/dist/deploy/react/hooks/publish-credential-draft.d.ts +33 -0
  175. package/dist/deploy/react/hooks/publish-credential-draft.js +54 -0
  176. package/dist/deploy/react/hooks/publish-credential-selection.d.ts +13 -0
  177. package/dist/deploy/react/hooks/publish-credential-selection.js +34 -0
  178. package/dist/deploy/react/hooks/publish-credential-writes.d.ts +20 -0
  179. package/dist/deploy/react/hooks/publish-credential-writes.js +99 -0
  180. package/dist/deploy/react/hooks/static-publish-actions.d.ts +10 -0
  181. package/dist/deploy/react/hooks/static-publish-actions.js +62 -0
  182. package/dist/deploy/react/hooks/static-publish-form.hooks.d.ts +38 -0
  183. package/dist/deploy/react/hooks/static-publish-form.hooks.js +103 -0
  184. package/dist/deploy/react/hooks/static-publish-run.hooks.d.ts +28 -0
  185. package/dist/deploy/react/hooks/static-publish-run.hooks.js +92 -0
  186. package/dist/deploy/react/hooks/use-dockerfile-source.hooks.d.ts +148 -0
  187. package/dist/deploy/react/hooks/use-dockerfile-source.hooks.js +155 -0
  188. package/dist/deploy/react/hooks/use-publish-credentials.hooks.d.ts +268 -0
  189. package/dist/deploy/react/hooks/use-publish-credentials.hooks.js +52 -0
  190. package/dist/deploy/react/hooks/use-static-export.hooks.d.ts +128 -0
  191. package/dist/deploy/react/hooks/use-static-export.hooks.js +159 -0
  192. package/dist/deploy/react/hooks/use-static-publish.hooks.d.ts +208 -0
  193. package/dist/deploy/react/hooks/use-static-publish.hooks.js +48 -0
  194. package/dist/deploy/react/index.d.ts +4 -0
  195. package/dist/deploy/react/index.js +2 -0
  196. package/dist/deploy/react/rules.d.ts +363 -0
  197. package/dist/deploy/react/rules.js +314 -0
  198. package/dist/deploy/react/use-deployment-overview.hooks.d.ts +41 -0
  199. package/dist/deploy/react/use-deployment-overview.hooks.js +11 -0
  200. package/dist/deploy/site/agent-tools.d.ts +42 -0
  201. package/dist/deploy/site/agent-tools.js +119 -0
  202. package/dist/deploy/site/deploy-config-registry.d.ts +155 -0
  203. package/dist/deploy/site/deploy-config-registry.js +124 -0
  204. package/dist/deploy/site/deploy-config.d.ts +97 -0
  205. package/dist/deploy/site/deploy-config.js +115 -0
  206. package/dist/deploy/site/deploy-ops/agent-tools.d.ts +22 -0
  207. package/dist/deploy/site/deploy-ops/agent-tools.js +76 -0
  208. package/dist/deploy/site/deploy-ops/registry.d.ts +134 -0
  209. package/dist/deploy/site/deploy-ops/registry.js +106 -0
  210. package/dist/deploy/site/deploy-ops/run-ops.d.ts +66 -0
  211. package/dist/deploy/site/deploy-ops/run-ops.js +34 -0
  212. package/dist/deploy/site/deploy-ops/secret-confirm.d.ts +36 -0
  213. package/dist/deploy/site/deploy-ops/secret-confirm.js +27 -0
  214. package/dist/deploy/site/deploy-targets/host-kit.d.ts +28 -0
  215. package/dist/deploy/site/deploy-targets/host-kit.js +120 -0
  216. package/dist/deploy/site/deploy-targets/registry.d.ts +157 -0
  217. package/dist/deploy/site/deploy-targets/registry.js +132 -0
  218. package/dist/deploy/site/deploy-targets/types.d.ts +27 -0
  219. package/dist/deploy/site/deploy-targets/types.js +2 -0
  220. package/dist/deploy/site/dockerfile.d.ts +137 -0
  221. package/dist/deploy/site/dockerfile.js +101 -0
  222. package/dist/deploy/site/export-run.d.ts +137 -0
  223. package/dist/deploy/site/export-run.js +152 -0
  224. package/dist/deploy/site/ports.d.ts +115 -0
  225. package/dist/deploy/site/ports.js +2 -0
  226. package/dist/deploy/site/publish-agent-tools.d.ts +18 -0
  227. package/dist/deploy/site/publish-agent-tools.js +120 -0
  228. package/dist/deploy/site/publish-candidate.d.ts +26 -0
  229. package/dist/deploy/site/publish-candidate.js +37 -0
  230. package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.d.ts +78 -0
  231. package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.js +88 -0
  232. package/dist/deploy/site/publish-credentials/compatibility-port.d.ts +38 -0
  233. package/dist/deploy/site/publish-credentials/compatibility-port.js +19 -0
  234. package/dist/deploy/site/publish-credentials/execution-mode.d.ts +43 -0
  235. package/dist/deploy/site/publish-credentials/execution-mode.js +19 -0
  236. package/dist/deploy/site/publish-credentials/store-owner.d.ts +11 -0
  237. package/dist/deploy/site/publish-credentials/store-owner.js +9 -0
  238. package/dist/deploy/site/publish-credentials/store-resolution.d.ts +55 -0
  239. package/dist/deploy/site/publish-credentials/store-resolution.js +100 -0
  240. package/dist/deploy/site/publish-credentials/store-validation.d.ts +68 -0
  241. package/dist/deploy/site/publish-credentials/store-validation.js +182 -0
  242. package/dist/deploy/site/publish-credentials/store.d.ts +322 -0
  243. package/dist/deploy/site/publish-credentials/store.js +372 -0
  244. package/dist/deploy/site/publish-credentials/types.d.ts +85 -0
  245. package/dist/deploy/site/publish-credentials/types.js +2 -0
  246. package/dist/deploy/site/publish-tool-capabilities.d.ts +123 -0
  247. package/dist/deploy/site/publish-tool-capabilities.js +175 -0
  248. package/dist/deploy/site/publish-tool-credential.d.ts +48 -0
  249. package/dist/deploy/site/publish-tool-credential.js +284 -0
  250. package/dist/deploy/site/publish-tool-deps.d.ts +205 -0
  251. package/dist/deploy/site/publish-tool-deps.js +15 -0
  252. package/dist/deploy/site/publish-tool-execution.d.ts +78 -0
  253. package/dist/deploy/site/publish-tool-execution.js +313 -0
  254. package/dist/deploy/site/publish-tool-schema.d.ts +29 -0
  255. package/dist/deploy/site/publish-tool-schema.js +38 -0
  256. package/dist/deploy/site/static-publish/adapter-export.d.ts +54 -0
  257. package/dist/deploy/site/static-publish/adapter-export.js +89 -0
  258. package/dist/deploy/site/static-publish/adapter-plan.d.ts +99 -0
  259. package/dist/deploy/site/static-publish/adapter-plan.js +112 -0
  260. package/dist/deploy/site/static-publish/adapter.d.ts +182 -0
  261. package/dist/deploy/site/static-publish/adapter.js +321 -0
  262. package/dist/deploy/site/static-publish/admin-publish-read.d.ts +209 -0
  263. package/dist/deploy/site/static-publish/admin-publish-read.js +116 -0
  264. package/dist/deploy/site/static-publish/credentials.d.ts +110 -0
  265. package/dist/deploy/site/static-publish/credentials.js +290 -0
  266. package/dist/deploy/site/static-publish/domain-publish-rows.d.ts +25 -0
  267. package/dist/deploy/site/static-publish/domain-publish-rows.js +43 -0
  268. package/dist/deploy/site/static-publish/domain-publish-tool.d.ts +19 -0
  269. package/dist/deploy/site/static-publish/domain-publish-tool.js +111 -0
  270. package/dist/deploy/site/static-publish/inspection.d.ts +24 -0
  271. package/dist/deploy/site/static-publish/inspection.js +69 -0
  272. package/dist/deploy/site/static-publish/publish-history.d.ts +197 -0
  273. package/dist/deploy/site/static-publish/publish-history.js +153 -0
  274. package/dist/deploy/site/static-publish/publish-run.d.ts +156 -0
  275. package/dist/deploy/site/static-publish/publish-run.js +186 -0
  276. package/dist/deploy/site/static-publish/types.d.ts +165 -0
  277. package/dist/deploy/site/static-publish/types.js +2 -0
  278. package/dist/deploy/site/static-publish/verify.d.ts +217 -0
  279. package/dist/deploy/site/static-publish/verify.js +248 -0
  280. package/dist/deploy/site/tool-registrations.d.ts +97 -0
  281. package/dist/deploy/site/tool-registrations.js +130 -0
  282. package/dist/deploy/site/types.d.ts +51 -0
  283. package/dist/deploy/site/types.js +2 -0
  284. package/dist/deploy/site-update/check-for-update.d.ts +19 -0
  285. package/dist/deploy/site-update/check-for-update.js +19 -0
  286. package/dist/deploy/site-update/contracts.d.ts +161 -0
  287. package/dist/deploy/site-update/contracts.js +94 -0
  288. package/dist/deploy/site-update/desktop-site-update.d.ts +66 -0
  289. package/dist/deploy/site-update/desktop-site-update.js +43 -0
  290. package/dist/deploy/site-update/fake-site-update.d.ts +39 -0
  291. package/dist/deploy/site-update/fake-site-update.js +52 -0
  292. package/dist/deploy/site-update/run-site-update.d.ts +121 -0
  293. package/dist/deploy/site-update/run-site-update.js +219 -0
  294. package/dist/deploy/site-update/self-hosted-site-update.d.ts +71 -0
  295. package/dist/deploy/site-update/self-hosted-site-update.js +79 -0
  296. package/dist/deploy/target-contracts.d.ts +3 -0
  297. package/dist/deploy/tool.d.ts +5 -8
  298. package/dist/deploy/tool.js +6 -9
  299. package/dist/dns/binding-sweeper.d.ts +72 -0
  300. package/dist/dns/binding-sweeper.js +53 -0
  301. package/dist/dns/index.d.ts +1 -0
  302. package/dist/dns/index.js +1 -0
  303. package/dist/dns/site/binding.repo.d.ts +71 -0
  304. package/dist/dns/site/binding.repo.js +45 -0
  305. package/dist/dns/site/dns-changes.d.ts +90 -0
  306. package/dist/dns/site/dns-changes.js +271 -0
  307. package/dist/dns/site/dns-tools.d.ts +46 -0
  308. package/dist/dns/site/dns-tools.js +204 -0
  309. package/dist/dns/site/mail-dns-status.d.ts +111 -0
  310. package/dist/dns/site/mail-dns-status.js +190 -0
  311. package/dist/dns/site/mail-dns-tools.d.ts +33 -0
  312. package/dist/dns/site/mail-dns-tools.js +62 -0
  313. package/dist/dns/site/mail-requirements.d.ts +30 -0
  314. package/dist/dns/site/mail-requirements.js +78 -0
  315. package/dist/dns/site/tool-deps.d.ts +21 -0
  316. package/dist/dns/site/tool-deps.js +2 -0
  317. package/dist/dns/site/tools.d.ts +74 -0
  318. package/dist/dns/site/tools.js +124 -0
  319. package/dist/local-dev/bind-host.d.ts +80 -0
  320. package/dist/local-dev/bind-host.js +90 -0
  321. package/dist/local-dev/dev-proxy-upstream.d.ts +69 -0
  322. package/dist/local-dev/dev-proxy-upstream.js +63 -0
  323. package/dist/local-dev/index.d.ts +28 -0
  324. package/dist/local-dev/index.js +25 -0
  325. package/dist/packaging/electron/archive.d.ts +2 -9
  326. package/dist/packaging/electron/asar-adapter.d.ts +2 -1
  327. package/dist/packaging/electron/entry.d.ts +2 -0
  328. package/dist/packaging/electron/move-to-applications.d.ts +165 -0
  329. package/dist/packaging/electron/move-to-applications.js +162 -0
  330. package/dist/packaging/electron/policies.d.ts +33 -4
  331. package/dist/packaging/electron/policies.js +29 -10
  332. package/dist/packaging/electron/ports.d.ts +1 -6
  333. package/dist/packaging/electron/staging.d.ts +11 -2
  334. package/dist/packaging/electron/staging.js +15 -5
  335. package/dist/react/site-share-expiry/ShareExpiryControls.d.ts +29 -0
  336. package/dist/react/site-share-expiry/ShareExpiryControls.js +7 -0
  337. package/dist/react/site-share-expiry/index.d.ts +2 -0
  338. package/dist/react/site-share-expiry/index.js +2 -0
  339. package/dist/source-control/react/ProvidersTab.d.ts +98 -0
  340. package/dist/source-control/react/ProvidersTab.js +195 -0
  341. package/dist/source-control/react/SourceControl.d.ts +51 -0
  342. package/dist/source-control/react/SourceControl.js +61 -0
  343. package/dist/source-control/react/hooks/use-source-control-credentials.hooks.d.ts +128 -0
  344. package/dist/source-control/react/hooks/use-source-control-credentials.hooks.js +102 -0
  345. package/dist/source-control/react/rules.d.ts +167 -0
  346. package/dist/source-control/react/rules.js +125 -0
  347. package/dist/source-control/react/source-control-visuals.d.ts +75 -0
  348. package/dist/source-control/react/source-control-visuals.js +48 -0
  349. package/dist/source-control/site/agent-tools.d.ts +5 -0
  350. package/dist/source-control/site/agent-tools.js +30 -0
  351. package/dist/source-control/site/bundled-provider-registry.d.ts +33 -0
  352. package/dist/source-control/site/bundled-provider-registry.js +37 -0
  353. package/dist/source-control/site/commit-schema.d.ts +40 -0
  354. package/dist/source-control/site/commit-schema.js +29 -0
  355. package/dist/source-control/site/commit-target.d.ts +26 -0
  356. package/dist/source-control/site/commit-target.js +58 -0
  357. package/dist/source-control/site/credential-form.d.ts +36 -0
  358. package/dist/source-control/site/credential-form.js +102 -0
  359. package/dist/source-control/site/credential-setup.d.ts +107 -0
  360. package/dist/source-control/site/credential-setup.js +216 -0
  361. package/dist/source-control/site/provider-kit.d.ts +37 -0
  362. package/dist/source-control/site/provider-kit.js +35 -0
  363. package/dist/source-control/site/provider-module.d.ts +251 -0
  364. package/dist/source-control/site/provider-module.js +2 -0
  365. package/dist/source-control/site/saved-key-bindings.d.ts +4 -0
  366. package/dist/source-control/site/saved-key-bindings.js +4 -0
  367. package/dist/source-control/site/static-site-packager-port.d.ts +37 -0
  368. package/dist/source-control/site/static-site-packager-port.js +2 -0
  369. package/dist/source-control/site/store.d.ts +209 -0
  370. package/dist/source-control/site/store.js +374 -0
  371. package/dist/source-control/site/store.validation.d.ts +72 -0
  372. package/dist/source-control/site/store.validation.js +168 -0
  373. package/dist/source-control/site/tool-registrations.d.ts +190 -0
  374. package/dist/source-control/site/tool-registrations.js +379 -0
  375. package/dist/static-export/site/export-preflight.d.ts +48 -0
  376. package/dist/static-export/site/export-preflight.js +82 -0
  377. package/dist/static-export/site/media-original-urls.d.ts +57 -0
  378. package/dist/static-export/site/media-original-urls.js +109 -0
  379. package/dist/static-export/site/ports.d.ts +82 -0
  380. package/dist/static-export/site/ports.js +29 -0
  381. package/dist/static-export/site/public-origin-policy.d.ts +32 -0
  382. package/dist/static-export/site/public-origin-policy.js +68 -0
  383. package/dist/static-export/site/route-manifest.d.ts +65 -0
  384. package/dist/static-export/site/route-manifest.js +139 -0
  385. package/dist/static-export/site/site-exporter.d.ts +158 -0
  386. package/dist/static-export/site/site-exporter.js +112 -0
  387. package/dist/static-export/site/static-security-headers.d.ts +39 -0
  388. package/dist/static-export/site/static-security-headers.js +43 -0
  389. package/dist/static-export/site/theme-preview-manifest.d.ts +35 -0
  390. package/dist/static-export/site/theme-preview-manifest.js +28 -0
  391. package/package.json +912 -8
@@ -0,0 +1,179 @@
1
+ import { SiteShareRefusal, archiveRefusalName } from "../share-refusal.js";
2
+ /** Omitted media loses its rows, sidecars and application-owned links in the fresh projection.
3
+ * Sidecars use the retained-owner index below; posts retain their content with no featured image.
4
+ */
5
+ export function omitMediaReferences(required, _options = {}) {
6
+ const { row, table, omitted } = required;
7
+ if (table === "media" && omitted.has(String(row.id)))
8
+ return null;
9
+ if (table === "posts" && omitted.has(String(row.featured_media_id)))
10
+ return { ...row, featured_media_id: null };
11
+ if (table === "entry_refs" && row.target_kind === "media" && omitted.has(String(row.target_id)))
12
+ return null;
13
+ return row;
14
+ }
15
+ const SIDECAR_TABLES = ["media_slug_history", "asset_blobs", "asset_renditions"];
16
+ /** Workspace-scoped identity key for an owner lookup. O(1). */
17
+ function ownerKey({ workspace, identity }, _optional = {}) {
18
+ return JSON.stringify([workspace, identity]);
19
+ }
20
+ /** Select sidecars from retained editorial owners, never the filesystem or orphan blobs.
21
+ * One bounded owner scan per sidecar table, then O(1) lookup per row; O(media rows) space.
22
+ * Document ownership is sticky even when an active public-media owner shares the bytes.
23
+ */
24
+ export async function mediaRowProjection(required, _options = {}) {
25
+ if (required.table === "media")
26
+ return projectMediaRow;
27
+ if (!SIDECAR_TABLES.includes(required.table))
28
+ return row => row;
29
+ const owners = indexMediaOwners({ host: required.host, owners: await required.target.run(db => db.selectFrom("media").selectAll().execute()) });
30
+ if (required.table === "asset_blobs")
31
+ return row => projectAssetBlob({ row, owners });
32
+ const ownerColumn = required.table === "media_slug_history" ? "media_id" : "asset_id";
33
+ return row => {
34
+ const owner = owners.byId.get(ownerKey({ workspace: row.workspace_id, identity: row[ownerColumn] }));
35
+ if (!owner)
36
+ return null;
37
+ return required.table === "asset_renditions" ? projectRendition({ host: required.host, row, owner, privateKeys: owners.privateKeys }) : row;
38
+ };
39
+ }
40
+ /** Ordinary media travels as is; an active document loses its uploader; any other document drops.
41
+ * @throws SiteShareRefusal INVALID_DOCUMENT for a kind other than media/document. O(1). */
42
+ function projectMediaRow(row) {
43
+ if (row.kind !== "media" && row.kind !== "document")
44
+ throw new SiteShareRefusal({ code: "INVALID_DOCUMENT", message: "Unsupported media kind in share database." });
45
+ if (row.kind === "media")
46
+ return row;
47
+ return row.status === "active" ? { ...row, created_by: null } : null;
48
+ }
49
+ /** Indexes the retained media rows by id and by content hash, and derives document-only blob keys.
50
+ * O(media rows) time and space. */
51
+ function indexMediaOwners(required, _options = {}) {
52
+ const byId = new Map(required.owners.map(row => [ownerKey({ workspace: row.workspace_id, identity: row.id }), row]));
53
+ const byHash = new Map();
54
+ for (const row of required.owners) {
55
+ const hash = ownerKey({ workspace: row.workspace_id, identity: row.source_sha256 });
56
+ const kinds = byHash.get(hash) ?? { document: false, media: false };
57
+ if (row.kind === "document")
58
+ kinds.document = true;
59
+ else if (row.status === "active")
60
+ kinds.media = true;
61
+ else {
62
+ // Inactive non-document owners do not grant public media ownership.
63
+ }
64
+ byHash.set(hash, kinds);
65
+ }
66
+ const privateKeys = new Set(required.owners.filter(row => row.kind === "document" && !byHash.get(ownerKey({ workspace: row.workspace_id, identity: row.source_sha256 }))?.media)
67
+ .map(row => required.host.computeBlobStorageKey({ workspaceId: String(row.workspace_id), sha256: String(row.source_sha256) })));
68
+ return { byId, byHash, privateKeys };
69
+ }
70
+ /** A blob travels only with a retained owner of its bytes; document bytes stay marked share-owned. O(1). */
71
+ function projectAssetBlob(required, _options = {}) {
72
+ const kinds = required.owners.byHash.get(ownerKey({ workspace: required.row.workspace_id, identity: required.row.sha256 }));
73
+ if (!kinds)
74
+ return null;
75
+ return { ...required.row, ...(kinds.document || required.row.document_owned === 1 ? { document_owned: 1, created_by_principal: "share" } : {}) };
76
+ }
77
+ /** A rendition of a retained owner: ordinary owners may not reach document-only bytes; a document
78
+ * keeps only its `original`, which must be its own source blob. O(1).
79
+ * @throws SiteShareRefusal INVALID_DOCUMENT for either forged reference. */
80
+ function projectRendition(required, _options = {}) {
81
+ const { row, owner } = required;
82
+ // A public rendition must never borrow a document-only source, even across owners.
83
+ // Check before the import worker remaps keys and loses the source ownership boundary.
84
+ if (owner.kind !== "document") {
85
+ if (required.privateKeys.has(String(row.storage_key)))
86
+ throw new SiteShareRefusal({ code: "INVALID_DOCUMENT", message: "Ordinary rendition references a private document blob." });
87
+ return row;
88
+ }
89
+ if (row.transform_name !== "original")
90
+ return null;
91
+ if (row.storage_key !== required.host.computeBlobStorageKey({ workspaceId: String(owner.workspace_id), sha256: String(owner.source_sha256) }))
92
+ throw new SiteShareRefusal({ code: "INVALID_DOCUMENT", message: "Document original rendition has an invalid blob key." });
93
+ return row;
94
+ }
95
+ /** Validate document identity against its retained blob before reading bytes through storage.
96
+ * O(media + blob rows) time/space; missing/corrupt document references explicitly refuse.
97
+ */
98
+ export async function documentReferences(required, _options = {}) {
99
+ const blobs = await required.target.run(db => db.selectFrom("asset_blobs").selectAll().execute());
100
+ const byHash = new Map(blobs.map(row => [ownerKey({ workspace: row.workspace_id, identity: row.sha256 }), row]));
101
+ const documents = await required.target.run(db => db.selectFrom("media").selectAll().where("kind", "=", "document").execute());
102
+ return documents.map(row => {
103
+ const sha256 = String(row.source_sha256);
104
+ const blob = byHash.get(ownerKey({ workspace: row.workspace_id, identity: row.source_sha256 }));
105
+ const storageKey = required.host.computeBlobStorageKey({ workspaceId: String(row.workspace_id), sha256 });
106
+ const invalidBlob = !/^[a-f0-9]{64}$/.test(sha256) || !blob || blob.storage_key !== storageKey || blob.status !== "active";
107
+ if (invalidBlob || typeof row.original_filename !== "string")
108
+ throw new SiteShareRefusal({ code: "INVALID_DOCUMENT", message: "Document source blob is missing or has an invalid key/hash." });
109
+ required.host.documentContentType({ filename: row.original_filename });
110
+ return { storageKey, sha256, originalFilename: row.original_filename };
111
+ });
112
+ }
113
+ /** Snapshot metadata for the archive selector. Three bulk reads, then indexed lookups per item. */
114
+ export async function archiveMediaSources({ target }) {
115
+ const rows = await target.run(db => db.selectFrom("media").selectAll().execute());
116
+ const blobs = await target.run(db => db.selectFrom("asset_blobs").selectAll().execute());
117
+ const renditions = await target.run(db => db.selectFrom("asset_renditions").selectAll().where("transform_name", "=", "public").execute());
118
+ const transforms = await target.run(db => db.selectFrom("transform_registry").selectAll().where("name", "=", "public").orderBy("version", "asc").execute());
119
+ const byHash = new Map(blobs.map(row => [ownerKey({ workspace: row.workspace_id, identity: row.sha256 }), row]));
120
+ const byKey = new Map(blobs.map(row => [String(row.storage_key), row]));
121
+ const definitions = new Map(transforms.map(row => [String(row.workspace_id), row]));
122
+ const publics = new Map(renditions.map(row => [ownerKey({ workspace: row.workspace_id, identity: [row.asset_id, row.version] }), row]));
123
+ return rows.map(row => {
124
+ const blob = byHash.get(ownerKey({ workspace: row.workspace_id, identity: row.source_sha256 }));
125
+ if (!blob)
126
+ throw new SiteShareRefusal({ code: "MISSING_MEDIA", message: `Media '${archiveRefusalName({ name: String(row.id) })}' has no source blob.` });
127
+ const definition = definitions.get(String(row.workspace_id));
128
+ const rendition = definition && publics.get(ownerKey({ workspace: row.workspace_id, identity: [row.id, definition.version] }));
129
+ return { id: String(row.id), workspaceId: String(row.workspace_id), slug: String(row.slug ?? row.id), kind: String(row.kind),
130
+ originalFilename: row.original_filename === null ? null : String(row.original_filename), storageKey: String(blob.storage_key), sha256: String(blob.sha256), documentOwned: Boolean(blob.document_owned),
131
+ ...(definition ? { public: { version: Number(definition.version), params: JSON.parse(String(definition.params_json)),
132
+ ...(rendition ? publicRendition({ rendition, byKey }) : {}) } } : {}) };
133
+ });
134
+ }
135
+ export async function rewriteMediaRows(required, optional) {
136
+ const { target, sql } = required;
137
+ const media = await target.run(db => db.selectFrom("media").selectAll().execute());
138
+ const byId = new Map(media.map(row => [ownerKey({ workspace: row.workspace_id, identity: row.id }), row]));
139
+ const blobs = await target.run(db => db.selectFrom("asset_blobs").selectAll().execute());
140
+ const byHash = new Map(blobs.map(row => [ownerKey({ workspace: row.workspace_id, identity: row.sha256 }), row]));
141
+ if (byId.size !== required.copies.length)
142
+ throw new SiteShareRefusal({ code: "INVALID_MEDIA", message: "Archive media does not cover the snapshot." });
143
+ await target.transaction(async () => {
144
+ await target.run(db => db.deleteFrom("asset_renditions").execute());
145
+ await target.run(db => db.deleteFrom("asset_blobs").execute());
146
+ for (const copy of required.copies) {
147
+ optional.signal?.throwIfAborted();
148
+ const row = byId.get(ownerKey({ workspace: copy.workspaceId, identity: copy.id }));
149
+ if (!row)
150
+ throw new SiteShareRefusal({ code: "INVALID_MEDIA", message: "Unknown archive media item." });
151
+ await target.run(db => db.updateTable("media").set({ source_sha256: copy.sha256 }).where("id", "=", copy.id).where("workspace_id", "=", copy.workspaceId).execute());
152
+ await target.run(db => db.insertInto("asset_blobs").values(archiveBlobRow({ copy, media: row, existing: byHash.get(ownerKey({ workspace: copy.workspaceId, identity: copy.sha256 })) }))
153
+ .onConflict(oc => oc.columns(["workspace_id", "sha256"]).doUpdateSet({ document_owned: sql `max(document_owned, excluded.document_owned)` })).execute());
154
+ for (const rendition of [{ name: "original", version: 1 }, ...(copy.publicVersion === undefined ? [] : [{ name: "public", version: copy.publicVersion }])]) {
155
+ await target.run(db => db.insertInto("asset_renditions").values({ id: copy.id + ":" + rendition.name, workspace_id: copy.workspaceId, asset_id: copy.id, transform_name: rendition.name, version: rendition.version, storage_key: copy.storageKey, created_at: row.created_at }).execute());
156
+ }
157
+ }
158
+ });
159
+ }
160
+ /** Preserve unchanged blob metadata and sticky document privacy while replacing its path/hash. */
161
+ function archiveBlobRow(required) {
162
+ const { copy, media } = required;
163
+ const original = required.existing ?? { id: copy.workspaceId + ":" + copy.sha256, created_by_principal: "share", created_at: media.created_at, status: "active", tombstoned_at: null };
164
+ const documentOwned = Boolean(copy.documentOwned || media.kind === "document" || original.document_owned);
165
+ const contentType = copy.contentType === "application/octet-stream" ? original.content_type ?? copy.contentType : copy.contentType;
166
+ return { ...original, workspace_id: copy.workspaceId, sha256: copy.sha256, storage_key: copy.storageKey, content_type: contentType, document_owned: documentOwned ? 1 : 0 };
167
+ }
168
+ /** The archive's public rendition reference: its key, plus its hash when one is known. O(1). */
169
+ function publicRendition(required) {
170
+ const storageKey = String(required.rendition.storage_key);
171
+ const sha256 = renditionHash({ key: storageKey, blob: required.byKey.get(storageKey) });
172
+ return { storageKey, ...(sha256 === undefined ? {} : { sha256 }) };
173
+ }
174
+ function renditionHash(required) {
175
+ if (typeof required.blob?.sha256 === "string")
176
+ return required.blob.sha256;
177
+ return /[a-f0-9]{64}$/.exec(required.key)?.[0];
178
+ }
179
+ //# sourceMappingURL=projection.media.js.map
@@ -0,0 +1,46 @@
1
+ import { type CredentialWarning } from "../credential-warnings.js";
2
+ import { type Logger } from "@jini-ai/core/primitives";
3
+ import type { DataModuleDecl } from "@jini-ai/core/contracts/site/db-data-modules";
4
+ import type { Kernel, sanitizeShareDatabase } from "./projection.js";
5
+ /** Build only present portable plugin tables through the existing trusted DDL owner.
6
+ * Private tables contribute neither schema nor rows. O(declared tables + columns).
7
+ * `modules` is the trusted bundled registry; tests pass their own typed declarations.
8
+ * @throws SiteShareRefusal if the trusted declaration cannot be installed.
9
+ */
10
+ export declare function prepareSharePluginTables(required: {
11
+ host: Parameters<typeof sanitizeShareDatabase>[0]["host"];
12
+ target: Kernel;
13
+ present: ReadonlySet<string>;
14
+ modules: readonly DataModuleDecl[];
15
+ }, optional?: {
16
+ logger?: Pick<Logger, "error">;
17
+ }): Promise<{
18
+ portable: Set<string>;
19
+ private: Set<string>;
20
+ }>;
21
+ /** Refuse populated undeclared tables by name before any portable-row projection.
22
+ * Never executes source DDL; `listTables` omits SQLite's own `sqlite_*` tables.
23
+ * @throws SiteShareRefusal UNSUPPORTED_DATA with the table and required policy.
24
+ * @complexity O(tables), with one bounded existence query per undeclared table.
25
+ * @example await refuseUnknownShareTables({ source, trusted: new Set(await host.deps.listTables(target)) });
26
+ */
27
+ export declare function refuseUnknownShareTables({ host, source, trusted }: {
28
+ host: Parameters<typeof sanitizeShareDatabase>[0]["host"];
29
+ source: Kernel;
30
+ trusted: ReadonlySet<string>;
31
+ }, _options?: {}): Promise<void>;
32
+ /** Copy under one fresh-target transaction; private data and source search tables never enter it. */
33
+ export declare function copyPortableTables(required: {
34
+ host: Parameters<typeof sanitizeShareDatabase>[0]["host"];
35
+ source: Kernel;
36
+ target: Kernel;
37
+ present: ReadonlySet<string>;
38
+ plugins: {
39
+ portable: ReadonlySet<string>;
40
+ };
41
+ credentialWarnings: CredentialWarning[];
42
+ omittedMediaIds?: readonly string[] | undefined;
43
+ }, optional?: {
44
+ signal?: AbortSignal;
45
+ }): Promise<void>;
46
+ //# sourceMappingURL=projection.tables.d.ts.map
@@ -0,0 +1,193 @@
1
+ import { warnCredentialContent } from "../credential-warnings.js";
2
+ import { scheduler } from "node:timers/promises";
3
+ import { validateValueAgainstSchema } from "@jini-ai/core/settings";
4
+ import { createConsoleLogger } from "@jini-ai/core/primitives";
5
+ import { SiteShareRefusal, archiveRefusalName } from "../share-refusal.js";
6
+ import { mediaRowProjection, omitMediaReferences } from "./projection.media.js";
7
+ /** Build only present portable plugin tables through the existing trusted DDL owner.
8
+ * Private tables contribute neither schema nor rows. O(declared tables + columns).
9
+ * `modules` is the trusted bundled registry; tests pass their own typed declarations.
10
+ * @throws SiteShareRefusal if the trusted declaration cannot be installed.
11
+ */
12
+ export async function prepareSharePluginTables(required, optional = {}) {
13
+ const portable = new Set();
14
+ const privateTables = new Set();
15
+ for (const decl of required.modules) {
16
+ const plan = sharePluginPlan({ decl, present: required.present });
17
+ plan.portable.forEach(name => portable.add(name));
18
+ plan.private.forEach(name => privateTables.add(name));
19
+ if (plan.tables.length)
20
+ await declarePortableTables({ host: required.host, target: required.target, decl, tables: plan.tables }, optional);
21
+ }
22
+ return { portable, private: privateTables };
23
+ }
24
+ /** One trusted declaration's share plan: its present portable tables trimmed to their policy
25
+ * columns, and the physical names of its private tables (present or not). Pure; O(tables + columns).
26
+ * @throws SiteShareRefusal when a portable policy names a column the table does not declare.
27
+ */
28
+ function sharePluginPlan(required, _options = {}) {
29
+ const plan = { tables: [], portable: [], private: [] };
30
+ for (const table of required.decl.tables) {
31
+ const name = `p_${required.decl.pluginId}__${table.name}`;
32
+ const policy = table.portability;
33
+ if (policy?.kind === "private")
34
+ plan.private.push(name);
35
+ if (policy?.kind !== "portable" || !required.present.has(name))
36
+ continue;
37
+ plan.portable.push(name);
38
+ plan.tables.push(portableColumnsOnly({ name, table, columns: policy.columns }));
39
+ }
40
+ return plan;
41
+ }
42
+ /** The table declaration narrowed to exactly its portable policy columns. O(columns × policy columns).
43
+ * @throws SiteShareRefusal when the policy names a column the declaration lacks. */
44
+ function portableColumnsOnly(required, _options = {}) {
45
+ const columns = required.table.columns.filter(column => required.columns.includes(column.name));
46
+ if (columns.length !== required.columns.length)
47
+ throw new SiteShareRefusal({ code: "UNSUPPORTED_SCHEMA", message: `Invalid portable columns for '${required.name}': its portability policy names a column the table does not declare.` });
48
+ return { ...required.table, columns };
49
+ }
50
+ /** Installs the trimmed portable tables through `declareDataModule`, the trusted DDL owner.
51
+ * Logs the redacted declaration diagnostic; only the fixed refusal crosses the worker boundary.
52
+ * @throws SiteShareRefusal when the owner refuses. O(declaration + diagnostic bytes). */
53
+ async function declarePortableTables(required, { logger = createConsoleLogger({ prefix: "[site-share]" }) } = {}) {
54
+ const result = await required.host.deps.declareDataModule({ db: required.target, dbPath: ":memory:", decl: { ...required.decl, tables: required.tables } });
55
+ if (result.ok)
56
+ return;
57
+ // A typed refusal is written verbatim to refusal.txt, so native error text belongs only in logs.
58
+ logger.error({ message: "Cannot build portable plugin schema" }, {
59
+ meta: { diagnostic: required.host.redactSecretShapes({ text: result.error?.message ?? "Declaration refused" }).text },
60
+ });
61
+ throw new SiteShareRefusal({ code: "UNSUPPORTED_SCHEMA", message: `Cannot build portable plugin schema for '${required.decl.pluginId}': the bundled portable-data declaration could not be installed.` });
62
+ }
63
+ /** Refuse populated undeclared tables by name before any portable-row projection.
64
+ * Never executes source DDL; `listTables` omits SQLite's own `sqlite_*` tables.
65
+ * @throws SiteShareRefusal UNSUPPORTED_DATA with the table and required policy.
66
+ * @complexity O(tables), with one bounded existence query per undeclared table.
67
+ * @example await refuseUnknownShareTables({ source, trusted: new Set(await host.deps.listTables(target)) });
68
+ */
69
+ export async function refuseUnknownShareTables({ host, source, trusted }, _options = {}) {
70
+ for (const table of await host.deps.listTables({ kernel: source })) {
71
+ if (trusted.has(table) || host.SHARE_LEGACY_PRIVATE_TABLES.has(table) || host.CHAT_TABLE_NAMES.includes(table) || table.startsWith("_vault_backup_"))
72
+ continue;
73
+ const rows = await source.query(host.sql `SELECT 1 AS found FROM ${host.sql.id(table)} LIMIT 1`);
74
+ if (rows.length)
75
+ throw new SiteShareRefusal({ code: "UNSUPPORTED_DATA", message: `Cannot share unsupported nonempty table '${archiveRefusalName({ name: table })}'. Add an approved portable-data policy for this table first.` });
76
+ }
77
+ }
78
+ // Only the additive Library/source columns may be absent in an older share. Never accept an
79
+ // archive's DDL. Plugin owners explicitly allow dropping fields outside their column policy.
80
+ const ADDITIVE_COLUMN_DEFAULTS = new Map([
81
+ ["media", { kind: "media", original_filename: null, source_metadata_json: null }],
82
+ ["asset_blobs", { document_owned: 0 }],
83
+ ]);
84
+ /** Refuses a source table whose columns differ from the trusted target schema: an extra source
85
+ * column (unless a portable plugin table, whose extra fields are dropped) or a missing column with
86
+ * no additive default. Pure; O(columns²) over two short column lists.
87
+ * @throws SiteShareRefusal UNSUPPORTED_SCHEMA naming the table. */
88
+ function requireTrustedColumns(required, { portablePlugin = false } = {}) {
89
+ const extra = !portablePlugin && required.sourceColumns.some(column => !required.columns.includes(column));
90
+ const missing = required.columns.some(column => !required.sourceColumns.includes(column) && !Object.hasOwn(required.defaults, column));
91
+ if (extra || missing)
92
+ throw new SiteShareRefusal({ code: "UNSUPPORTED_SCHEMA", message: `Cannot share '${required.table}': its columns differ from the trusted current schema. Update the site first.` });
93
+ }
94
+ /** Copy rows using the trusted schema, preserving only explicit portable plugin columns.
95
+ * Core extension columns still refuse; historical Library columns retain their trusted defaults.
96
+ * O(rows × columns) projection/insertion; rows remain bounded by the snapshot cap.
97
+ * @throws SiteShareRefusal for missing required columns or unapproved core columns.
98
+ */
99
+ async function copyTable({ host, source, target, table, credentialWarnings }, { signal, portablePlugin, omittedMediaIds = [] } = {}) {
100
+ const columns = (await host.deps.listColumns({ kernel: target, table })).map(row => row.name);
101
+ const sourceColumns = (await host.deps.listColumns({ kernel: source, table })).map(row => row.name);
102
+ const defaults = ADDITIVE_COLUMN_DEFAULTS.get(table) ?? {};
103
+ requireTrustedColumns({ table, columns, sourceColumns, defaults }, { portablePlugin });
104
+ const rows = await source.run(db => db.selectFrom(table).select(columns.filter(column => sourceColumns.includes(column))).execute());
105
+ const project = await mediaRowProjection({ host: host, target, table });
106
+ const omitted = new Set(omittedMediaIds);
107
+ for (const [index, sourceRow] of rows.entries()) {
108
+ if (index % 1000 === 0) {
109
+ await scheduler.yield();
110
+ signal?.throwIfAborted();
111
+ }
112
+ const retained = omitMediaReferences({ row: { ...defaults, ...sourceRow }, table, omitted });
113
+ if (!retained)
114
+ continue;
115
+ warnPortableRow({ host: host, row: retained, table, credentialWarnings });
116
+ const row = project(retained);
117
+ if (row)
118
+ await target.run(db => db.insertInto(table).values(row).execute());
119
+ }
120
+ }
121
+ /** Scan each portable column, preserving its exact text/BLOB bytes and identity. Only the
122
+ * table/column leaves this boundary: row ids and matched values never enter diagnostics.
123
+ * @complexity O(row bytes + accumulated warnings); mutates only the warning sink.
124
+ */
125
+ function warnPortableRow(required, _options = {}) {
126
+ for (const [column, value] of Object.entries(required.row)) {
127
+ const text = value instanceof Uint8Array ? Buffer.from(value).toString("latin1") : value;
128
+ if (typeof text === "string")
129
+ warnCredentialContent({ path: `content.db:${required.table}.${column}`, text, credentialWarnings: required.credentialWarnings, redactSecretShapes: required.host.redactSecretShapes });
130
+ }
131
+ }
132
+ /** Only explicitly portable definitions/workspace values travel. Credential-looking values are retained with warnings. */
133
+ async function copySettings({ host, source, target, credentialWarnings }, _options = {}) {
134
+ const definitions = await source.run(db => db.selectFrom("setting_definitions").selectAll().where("secret", "=", 0).where("status", "=", "active").execute());
135
+ for (const definition of definitions) {
136
+ const schema = portableDefinitionSchema({ host: host, definition });
137
+ if (!schema) {
138
+ continue;
139
+ }
140
+ warnPortableRow({ host: host, row: definition, table: "setting_definitions", credentialWarnings });
141
+ await target.run(db => db.insertInto("setting_definitions").values(definition).execute());
142
+ await copyWorkspaceValues({ host: host, source, target, definition, schema, credentialWarnings });
143
+ }
144
+ }
145
+ /** The value schema of a definition that may travel — workspace-scoped, publishable,
146
+ * with a default its own schema accepts — else null. O(definition text).
147
+ * @throws SyntaxError when the stored schema or default is not JSON. */
148
+ function portableDefinitionSchema(required, _options = {}) {
149
+ const { definition } = required;
150
+ if (!(Number(definition.scopes) & 2) || !Object.hasOwn(required.host.PUBLISHABLE_SETTINGS, `${definition.namespace}:${definition.key}`))
151
+ return null;
152
+ const schema = JSON.parse(String(definition.schema_json));
153
+ const defaultValue = JSON.parse(String(definition.default_json));
154
+ return validateValueAgainstSchema({ schema, value: defaultValue }) ? schema : null;
155
+ }
156
+ /** Copies the definition's current-version workspace values that may travel, stamped `share`.
157
+ * O(values × value size). */
158
+ async function copyWorkspaceValues(required, _options = {}) {
159
+ const { definition } = required;
160
+ const rows = await required.source.run(db => db.selectFrom("setting_values_workspace").selectAll().where("setting_id", "=", definition.setting_id).where("def_version", "=", definition.version).execute());
161
+ for (const row of rows) {
162
+ const portable = portableValue({ row, schema: required.schema });
163
+ if (portable)
164
+ warnPortableRow({ host: required.host, row, table: "setting_values_workspace", credentialWarnings: required.credentialWarnings });
165
+ if (portable)
166
+ await required.target.run(db => db.insertInto("setting_values_workspace").values({ ...row, value_json: JSON.stringify(portable.value), updated_by: "share" }).execute());
167
+ }
168
+ }
169
+ /** The value one workspace row carries (null when cleared), or null when the row must be omitted:
170
+ * a set value its schema rejects. O(value size).
171
+ * @throws SyntaxError when a set value is not JSON. */
172
+ function portableValue(required, _options = {}) {
173
+ const { row } = required;
174
+ const value = row.state === "cleared" ? null : JSON.parse(String(row.value_json));
175
+ if (row.state !== "cleared" && !validateValueAgainstSchema({ schema: required.schema, value }))
176
+ return null;
177
+ return { value };
178
+ }
179
+ /** Copy under one fresh-target transaction; private data and source search tables never enter it. */
180
+ export async function copyPortableTables(required, optional = {}) {
181
+ const { source, target, present, plugins, credentialWarnings, omittedMediaIds } = required;
182
+ await target.transaction(async () => {
183
+ for (const table of required.host.SHARE_TABLES) {
184
+ if (!present.has(table))
185
+ throw new SiteShareRefusal({ code: "UNSUPPORTED_SCHEMA", message: `Share requires current table '${table}'. Update this site first.` });
186
+ await copyTable({ host: required.host, source, target, table, credentialWarnings }, { signal: optional.signal, omittedMediaIds });
187
+ }
188
+ for (const table of plugins.portable)
189
+ await copyTable({ host: required.host, source, target, table, credentialWarnings }, { signal: optional.signal, portablePlugin: true });
190
+ await copySettings({ host: required.host, source, target, credentialWarnings });
191
+ });
192
+ }
193
+ //# sourceMappingURL=projection.tables.js.map
@@ -0,0 +1,75 @@
1
+ /** The plain-words refusals for an expiry choice; the host owns the wording and injects it. */
2
+ export interface ShareExpiryCopy {
3
+ readonly choices: string;
4
+ readonly notHostedHere: string;
5
+ remote(required: {
6
+ provider: string;
7
+ }): string;
8
+ }
9
+ /** Host policy and copy for share-link expiry. Every member is REQUIRED: the engine carries no host defaults. */
10
+ export interface ShareExpiryHost {
11
+ /** The day counts a new export may choose besides Never (`null`, always accepted). */
12
+ readonly choices: readonly number[];
13
+ readonly copy: ShareExpiryCopy;
14
+ /** The plain-words answer for an expired link (acknowledgement and owner download). */
15
+ expiredMessage(required: {
16
+ row: {
17
+ readonly expiresAt?: string | null | undefined;
18
+ };
19
+ }): string;
20
+ }
21
+ /** A share destination as far as expiry cares: its provider and (for an own folder) its absolute binding. */
22
+ export type ShareExpiryDestination = {
23
+ readonly provider: string;
24
+ readonly binding?: string;
25
+ };
26
+ /** True when `days` is one of the host's day choices (Never is not a day choice). */
27
+ export declare function isShareExpiryChoice(required: {
28
+ days: unknown;
29
+ choices: readonly number[];
30
+ }, _optional?: Record<string, never>): required is {
31
+ days: number;
32
+ choices: readonly number[];
33
+ };
34
+ /**
35
+ * Refuses an expiry unless the destination is affirmatively this server's own share folder: only this
36
+ * server's token route checks `expiresAt`, so a remote copy (or no recorded destination) would keep
37
+ * serving past the stated date.
38
+ * @throws {SiteShareRefusal} INVALID_INPUT with the host's plain words.
39
+ */
40
+ export declare function requireOwnFolder(required: {
41
+ destination: ShareExpiryDestination | undefined;
42
+ copy: ShareExpiryCopy;
43
+ ownFolderProvider: string;
44
+ isOwnFolder: (required: {
45
+ storage: ShareExpiryDestination;
46
+ }) => boolean;
47
+ }, _optional?: Record<string, never>): void;
48
+ /**
49
+ * The `expiresAt` a new share records for the owner's choice: `null` (Never) for any destination, or
50
+ * `now + days` (from the injected host clock) for an affirmatively own-folder destination.
51
+ * @throws {SiteShareRefusal} INVALID_INPUT for an unsupported choice or a destination not affirmed as own folder.
52
+ */
53
+ export declare function shareExpiresAt(required: {
54
+ days: number | null;
55
+ now: number;
56
+ destination: ShareExpiryDestination | undefined;
57
+ expiry: ShareExpiryHost;
58
+ ownFolderProvider: string;
59
+ isOwnFolder: (required: {
60
+ storage: ShareExpiryDestination;
61
+ }) => boolean;
62
+ }, _optional?: Record<string, never>): string | null;
63
+ /**
64
+ * True once a share's own stated expiry has passed. Absent metadata (older rows, peer uploads) never
65
+ * expires: live links never break. A persisted value that does not parse counts as expired for SERVING
66
+ * only, so a damaged row can stop a public link but never extend one; it is not evidence that the
67
+ * artifact may be removed.
68
+ */
69
+ export declare function isShareExpired(required: {
70
+ row: {
71
+ readonly expiresAt?: string | null | undefined;
72
+ };
73
+ now: number;
74
+ }, _optional?: Record<string, never>): boolean;
75
+ //# sourceMappingURL=share-expiry.d.ts.map
@@ -0,0 +1,49 @@
1
+ import { SiteShareRefusal } from "./share-refusal.js";
2
+ const DAY_MS = 24 * 60 * 60 * 1000;
3
+ /** True when `days` is one of the host's day choices (Never is not a day choice). */
4
+ export function isShareExpiryChoice(required, _optional = {}) {
5
+ return typeof required.days === "number" && required.choices.includes(required.days);
6
+ }
7
+ /**
8
+ * Refuses an expiry unless the destination is affirmatively this server's own share folder: only this
9
+ * server's token route checks `expiresAt`, so a remote copy (or no recorded destination) would keep
10
+ * serving past the stated date.
11
+ * @throws {SiteShareRefusal} INVALID_INPUT with the host's plain words.
12
+ */
13
+ export function requireOwnFolder(required, _optional = {}) {
14
+ const { destination, copy } = required;
15
+ if (!destination)
16
+ throw new SiteShareRefusal({ code: "INVALID_INPUT", message: copy.notHostedHere });
17
+ if (required.isOwnFolder({ storage: destination }))
18
+ return;
19
+ const message = destination.provider === required.ownFolderProvider ? copy.notHostedHere : copy.remote({ provider: destination.provider });
20
+ throw new SiteShareRefusal({ code: "INVALID_INPUT", message });
21
+ }
22
+ /**
23
+ * The `expiresAt` a new share records for the owner's choice: `null` (Never) for any destination, or
24
+ * `now + days` (from the injected host clock) for an affirmatively own-folder destination.
25
+ * @throws {SiteShareRefusal} INVALID_INPUT for an unsupported choice or a destination not affirmed as own folder.
26
+ */
27
+ export function shareExpiresAt(required, _optional = {}) {
28
+ const { days, expiry } = required;
29
+ if (days === null)
30
+ return null;
31
+ if (!isShareExpiryChoice({ days, choices: expiry.choices }))
32
+ throw new SiteShareRefusal({ code: "INVALID_INPUT", message: expiry.copy.choices });
33
+ requireOwnFolder({ destination: required.destination, copy: expiry.copy, ownFolderProvider: required.ownFolderProvider, isOwnFolder: required.isOwnFolder });
34
+ return new Date(required.now + days * DAY_MS).toISOString();
35
+ }
36
+ /**
37
+ * True once a share's own stated expiry has passed. Absent metadata (older rows, peer uploads) never
38
+ * expires: live links never break. A persisted value that does not parse counts as expired for SERVING
39
+ * only, so a damaged row can stop a public link but never extend one; it is not evidence that the
40
+ * artifact may be removed.
41
+ */
42
+ export function isShareExpired(required, _optional = {}) {
43
+ const { expiresAt } = required.row;
44
+ if (expiresAt === undefined || expiresAt === null)
45
+ return false;
46
+ const at = Date.parse(expiresAt);
47
+ return Number.isNaN(at) || required.now >= at;
48
+ }
49
+ //# sourceMappingURL=share-expiry.js.map
@@ -0,0 +1,17 @@
1
+ /** Export-owned stages, retained by the existing in-memory job until its result is collected. */
2
+ export type SiteShareExportStep = "prepare" | "archive" | "delivery";
3
+ /** An unexpected export exception with its original cause; expected refusals keep their own types. */
4
+ export declare class SiteShareExportFailure extends Error {
5
+ readonly step: SiteShareExportStep;
6
+ readonly appVersion: string | undefined;
7
+ readonly jiniVersion: string | undefined;
8
+ readonly time: string | undefined;
9
+ constructor(required: {
10
+ step: SiteShareExportStep;
11
+ cause: unknown;
12
+ appVersion?: string;
13
+ jiniVersion?: string;
14
+ time?: string;
15
+ }, _options?: {});
16
+ }
17
+ //# sourceMappingURL=share-export-failure.d.ts.map
@@ -0,0 +1,16 @@
1
+ /** An unexpected export exception with its original cause; expected refusals keep their own types. */
2
+ export class SiteShareExportFailure extends Error {
3
+ step;
4
+ appVersion;
5
+ jiniVersion;
6
+ time;
7
+ constructor(required, _options = {}) {
8
+ super(`Site export stopped during ${required.step}.`, { cause: required.cause });
9
+ this.name = "SiteShareExportFailure";
10
+ this.step = required.step;
11
+ this.appVersion = required.appVersion;
12
+ this.jiniVersion = required.jiniVersion;
13
+ this.time = required.time;
14
+ }
15
+ }
16
+ //# sourceMappingURL=share-export-failure.js.map
@@ -0,0 +1,60 @@
1
+ import { type CredentialWarning, type CredentialRedactor } from "./credential-warnings.js";
2
+ /** Host policy the share file rules need. Every member is REQUIRED: the engine carries no host defaults. */
3
+ export interface ShareFilePolicyDeps {
4
+ /** The host secret-shape redactor (engine diagnostics rules plus any host key shapes). */
5
+ redactSecretShapes: CredentialRedactor;
6
+ /** The host's tree-path check; returns a refusal reason or null. */
7
+ checkTreePath: (required: {
8
+ relPath: string;
9
+ }) => string | null;
10
+ /** The share's maximum path depth. */
11
+ maxPathSegments: number;
12
+ }
13
+ /** Archive digest -> (package-relative path -> SHA-256 of the bytes) for every package THIS build
14
+ * ships (`package-file-inventory.ts`). The only proof a package-shaped path is the installer's. */
15
+ export type PackageFileInventory = ReadonlyMap<string, ReadonlyMap<string, string>>;
16
+ /** The plugin memory a share carries. Every other folder under a plugin's `memory/` is private runtime
17
+ * state: export excludes it ({@link excludedSharePath}) and import refuses it (`archive-manifest.ts`). */
18
+ export declare const SHARED_PLUGIN_MEMORY: string;
19
+ /** Upper/lower expansion also catches sharp-s/SS and final-sigma aliases, including ancestors. */
20
+ export declare function sharePathAlias(required: {
21
+ path: string;
22
+ }, _options?: Record<string, never>): string;
23
+ type RequireSecretFreeOptions = {
24
+ packageFiles?: PackageFileInventory | undefined;
25
+ bundledImportPluginIds?: ReadonlySet<string> | undefined;
26
+ shownPath?: string | undefined;
27
+ notices?: string[] | undefined;
28
+ credentialWarnings?: CredentialWarning[] | undefined;
29
+ };
30
+ type ClaimSharePathInput = {
31
+ path: string;
32
+ directory: boolean;
33
+ aliases: Map<string, string>;
34
+ files: Set<string>;
35
+ };
36
+ /** The share file policy bound to the host's redactor, tree-path check and depth limit. */
37
+ export interface ShareFilePolicy {
38
+ secretSharePath(required: {
39
+ path: string;
40
+ }, optional?: {
41
+ packageContent?: boolean;
42
+ }): boolean;
43
+ excludedSharePath(required: {
44
+ path: string;
45
+ }, optional?: {
46
+ notices?: string[];
47
+ }): boolean;
48
+ validateSharePath(required: {
49
+ path: string;
50
+ }, optional?: Record<string, never>): void;
51
+ requireShareSecretFree(required: {
52
+ path: string;
53
+ bytes: Uint8Array;
54
+ }, optional?: RequireSecretFreeOptions): true;
55
+ claimSharePath(required: ClaimSharePathInput, optional?: Record<string, never>): void;
56
+ }
57
+ /** Binds the share path/secret rules to REQUIRED host policy (see {@link ShareFilePolicyDeps}). */
58
+ export declare function createShareFilePolicy(deps: ShareFilePolicyDeps, _optional?: Record<string, never>): ShareFilePolicy;
59
+ export {};
60
+ //# sourceMappingURL=share-file-policy.d.ts.map