@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,372 @@
1
+ import { PublishCredentialValidationError, validatedWorksFor, updatedWorksFor, validateLabel, optionalBoolean, validateConnection, connectionCredentialSpec, isSecretField, preservedMove } from './store-validation.js';
2
+ import { ownerOf } from './store-owner.js';
3
+ import { isUniqueViolation } from "@jini-ai/core/contracts/storage";
4
+ import { VaultError } from "@jini-ai/core/contracts/vault";
5
+ /** Publish credentials map deploy hosts to vendor accounts. Feature validation and human-gated
6
+ * verification remain here; Jini's vault owns sealing, defaults and persistence. Create/update
7
+ * are shared with an agent-facing caller, so provider probes stay in the human-gated verify path.
8
+ * Migration 0012 folds legacy rows once; there is no recurring backfill to resurrect deletions. */
9
+ /** A `(workspaceId, vendor, label)` collision — the route maps this to `409 DUPLICATE_LABEL`. */
10
+ export class PublishCredentialDuplicateLabelError extends Error {
11
+ }
12
+ /** Thrown when `sealer.seal()`/`keyring.activeKey()` fails while writing a connection — the realistic
13
+ * cause is a missing site key (the site key), same fail-closed contract
14
+ * `SiteAssistantSecretStoreUnconfiguredError` documents for the sibling ADR-058 table. */
15
+ export class PublishCredentialSecretStoreUnconfiguredError extends Error {
16
+ }
17
+ export class PublishCredentialNotFoundError extends Error {
18
+ }
19
+ /** Deploy descriptors adapt into Jini's compatibility and selection policy. Required companion
20
+ * fields exclude token-only custom keys before any default is selected. No I/O; O(hosts).
21
+ */
22
+ export function publishHostsForCredential({ deps, credential, registry }, _options = {}) {
23
+ return deps.matchingCredentialProviderIds({ credential, providers: registry.list().flatMap(({ descriptor }) => {
24
+ if (!moduleAcceptsCredential({ credential, registry, targetId: descriptor.id }))
25
+ return [];
26
+ const spec = descriptor.credential;
27
+ return spec ? [{ id: descriptor.id, vendorId: spec.vendorId,
28
+ acceptsCustomToken: !spec.fields.some(field => field.required && field.name !== spec.tokenField) }] : [];
29
+ }) });
30
+ }
31
+ /** Only narrow eligibility here; the existing Jini matcher still owns worksFor/default selection.
32
+ * No persisted metadata changes, so an old vendor grant cannot silently acquire a new capability. */
33
+ function moduleAcceptsCredential({ credential, registry, targetId }, _options = {}) {
34
+ const accepts = registry.get(targetId)?.module.acceptsCredential;
35
+ if (!accepts)
36
+ return true;
37
+ const worksFor = credential.meta.worksFor;
38
+ if (!Array.isArray(worksFor) || !worksFor.every(id => typeof id === "string"))
39
+ return false;
40
+ return accepts({ worksFor });
41
+ }
42
+ /** The vault's `hintToken` for a connection: its token field's value, omitted when the field is absent. O(1). */
43
+ function hintTokenOf(required, _optional = {}) {
44
+ const hintToken = required.fields[required.tokenField];
45
+ return hintToken === undefined ? {} : { hintToken };
46
+ }
47
+ /** An explicit id is found in either store. Otherwise the first store (in `inventory` order: this
48
+ * site's, then the project's) holding any compatible row decides alone (owner 2026-10-25: a site row
49
+ * overrides), so an ambiguous site stays ambiguous instead of silently using a project key.
50
+ * @complexity O(rows × compatibility IDs).
51
+ */
52
+ export function selectPublishCredential({ deps, registry, credentials, provider, id }, _options = {}) {
53
+ const eligible = credentials.filter(credential => moduleAcceptsCredential({ credential, registry, targetId: provider.id }));
54
+ if (id !== undefined)
55
+ return deps.selectCredentialForProvider({ credentials: eligible, provider, id });
56
+ const decides = eligible.find(row => deps.selectCredentialForProvider({ credentials: [row], provider, id: row.id }));
57
+ return deps.selectCredentialForProvider({ credentials: eligible.filter(row => row.workspaceId === decides?.workspaceId), provider });
58
+ }
59
+ /** Compatibility edits invalidate only hosts whose eligibility changed, through the existing cache
60
+ * port. Catalog adaptation and custom token shape rules are shared with runtime matching.
61
+ * @complexity O(hosts × compatibility IDs); no credential reads, opens or provider requests.
62
+ */
63
+ export function invalidatePublishCredentialCompatibility({ deps, workspaceId, registry, cache, before, after }, _options = {}) {
64
+ const hosts = (value) => value ? publishHostsForCredential({ deps, registry,
65
+ credential: { kind: "vendor", provider: null, label: "", meta: { credentialType: value.credentialType, worksFor: value.worksFor } } }) : [];
66
+ const previous = new Set(hosts(before));
67
+ const next = new Set(hosts(after));
68
+ for (const target of new Set([...previous, ...next]))
69
+ if (previous.has(target) !== next.has(target))
70
+ cache.delete({ workspaceId, target });
71
+ }
72
+ export function providerContract({ registry, providerId }, _options = {}) {
73
+ const spec = registry.get(providerId)?.descriptor.credential;
74
+ return spec ? { id: providerId, vendorId: spec.vendorId,
75
+ acceptsCustomToken: !spec.fields.some(field => field.required && field.name !== spec.tokenField) } : null;
76
+ }
77
+ function vaultSummary({ summary, hint, providerId, publishHosts = [], defaultFor = [] }, _options = {}) {
78
+ const tokenHint = hint({ record: summary });
79
+ return { id: summary.id, providerId, vendorId: summary.provider ?? providerId, label: summary.label, configured: true,
80
+ credentialType: summary.meta.credentialType, worksFor: [...summary.meta.worksFor],
81
+ publishHosts, defaultFor, isDefault: defaultFor.includes(providerId), tokenTail: tokenHint?.last4 ?? "", tokenHint,
82
+ accountLabel: typeof summary.meta.accountLabel === "string" ? summary.meta.accountLabel : null,
83
+ createdAt: summary.createdAt, updatedAt: summary.updatedAt };
84
+ }
85
+ /** The repo's host-bound vault collaborator; a repo without one refuses exactly as a repo without a vault did. */
86
+ export function bound(deps, _options = {}) {
87
+ if (!deps.repo.credentialVault)
88
+ throw new VaultError({ code: "invalid-record" });
89
+ return deps.repo.credentialVault;
90
+ }
91
+ export function vault(deps, _options = {}) {
92
+ return bound(deps).open({ ...deps, storageError: () => new PublishCredentialSecretStoreUnconfiguredError(deps.storageMessage) });
93
+ }
94
+ /** The store a listed row came from: rows carry their own store's workspace id. */
95
+ export function scopeOfRow(deps, input) {
96
+ const scopes = deps.credentialScopes({ deps, workspaceId: input.workspaceId });
97
+ const scope = scopes.find(scoped => scoped.workspaceId === input.row.workspaceId) ?? scopes[0];
98
+ if (scope === undefined)
99
+ throw new Error("Publish credential has no storage scope");
100
+ return scope;
101
+ }
102
+ /** The vendor row with this id, from the first store holding it (ids are unique across both). @complexity O(scopes). */
103
+ async function locateById(deps, input) {
104
+ for (const scoped of deps.credentialScopes({ deps, workspaceId: input.workspaceId })) {
105
+ const existing = await scoped.deps.repo.findById({ workspaceId: scoped.workspaceId, id: input.id });
106
+ if (existing)
107
+ return { scoped, existing };
108
+ }
109
+ return null;
110
+ }
111
+ /** A site row overrides the project row it would collide with: custom keys share one label space,
112
+ * vendor keys one per vendor (the vault's own unique-label scopes). */
113
+ const labelKey = (row) => row.meta.credentialType === "custom" ? `custom\0${row.label}` : `vendor\0${row.provider}\0${row.label}`;
114
+ /** Every row this site can publish with: its own, then the project's whose label no site row claims.
115
+ * @complexity O(rows); one inventory per store, no row is opened.
116
+ */
117
+ export async function inventory({ deps, workspaceId }, _options = {}) {
118
+ const rows = [];
119
+ const claimed = new Set();
120
+ for (const scoped of deps.credentialScopes({ deps, workspaceId })) {
121
+ const own = await storeInventory({ deps: scoped.deps, workspaceId: scoped.workspaceId });
122
+ rows.push(...own.filter(row => !claimed.has(labelKey(row))));
123
+ for (const row of own)
124
+ claimed.add(labelKey(row));
125
+ }
126
+ return rows;
127
+ }
128
+ /** One authorized, metadata-only inventory of one store for both subtypes. No secret is opened, and an
129
+ * injected port cannot widen the workspace/owner/binding. Jini parses every canonical row before matching.
130
+ * @complexity O(rows + metadata); two scoped reads during rollout, no per-row queries.
131
+ */
132
+ async function storeInventory({ deps, workspaceId }, _options = {}) {
133
+ const service = vault(deps);
134
+ const unified = await service.list(bound(deps).scope({ workspaceId, kind: "vendor" }));
135
+ const legacy = await service.list(bound(deps).scope({ workspaceId, kind: "custom" }));
136
+ return [...unified, ...legacy]
137
+ .filter(row => {
138
+ if (row.workspaceId !== workspaceId || (row.kind !== "vendor" && row.kind !== "custom"))
139
+ return false;
140
+ return row.ownerKey === deps.ownerKey && row.principalId === null && row.binding === null && row.configured;
141
+ });
142
+ }
143
+ /** Safe publish inventory; empty compatibility stays editable on vendor cards. Display host
144
+ * fallback is used only for editing, never for runtime eligibility. Defaults are selected per host.
145
+ * @complexity O(rows × hosts), one metadata inventory and one catalog load.
146
+ */
147
+ export async function listPublishCredentials(deps, input) {
148
+ const registry = await deps.loadDeployTargets({ workspaceId: input.workspaceId });
149
+ const rows = await inventory({ deps, workspaceId: input.workspaceId });
150
+ const defaults = new Map();
151
+ for (const { descriptor } of registry.list()) {
152
+ const provider = providerContract({ registry, providerId: descriptor.id });
153
+ const selected = provider && selectPublishCredential({ deps, registry, credentials: rows, provider });
154
+ if (selected)
155
+ defaults.set(descriptor.id, selected.id);
156
+ }
157
+ return rows.flatMap(row => {
158
+ const publishHosts = publishHostsForCredential({ deps, credential: row, registry });
159
+ const providerId = publishHosts[0] ?? (row.meta.credentialType === "vendor"
160
+ ? registry.list().find(target => target.descriptor.credential?.vendorId === row.provider)?.descriptor.id : undefined);
161
+ if (providerId === undefined)
162
+ return [];
163
+ const defaultFor = [...defaults].filter(([, id]) => id === row.id).map(([host]) => host);
164
+ const summary = vaultSummary({ summary: row, hint: bound(deps).hint, providerId, publishHosts, defaultFor });
165
+ const vendorId = row.provider ?? registry.get(providerId)?.descriptor.credential?.vendorId;
166
+ if (vendorId === undefined)
167
+ throw new Error(`Publish target ${providerId} has no credential vendor`);
168
+ return [{ ...summary, vendorId, ...reportedScope({ deps, workspaceId: input.workspaceId, row }) }];
169
+ });
170
+ }
171
+ /** The summary's `scope`, only where a project store is attached (a site-only server's output is unchanged). */
172
+ function reportedScope({ deps, workspaceId, row }, _options = {}) {
173
+ return deps.repo.project ? { scope: scopeOfRow(deps, { workspaceId, row }).scope } : {};
174
+ }
175
+ /** Metadata-only ID projection; custom keys keep their existing custom edit/permission boundary. */
176
+ export async function describeCredential(deps, input) {
177
+ return (await listPublishCredentials(deps, input)).find(row => row.id === input.id) ?? null;
178
+ }
179
+ /**
180
+ * A project row whose vendor and label this site already uses would be hidden here by the site row
181
+ * (site rows override), so the save would look lost: refused as the same duplicate as within one store.
182
+ */
183
+ async function assertLabelFreeOnSite({ deps, target, workspaceId, vendorId, label, providerId }, _options = {}) {
184
+ if (target.scope !== "project")
185
+ return;
186
+ if ((await deps.repo.listByVendor({ workspaceId, vendorId })).some(row => row.label === label)) {
187
+ throw new PublishCredentialDuplicateLabelError(`a '${providerId}' credential labeled '${label}' already exists in this workspace`);
188
+ }
189
+ }
190
+ /** Label conflicts keep the feature's error contract; stale CAS failures stay conflicts.
191
+ * Callers choose the row id before writing, including when the vault could generate one.
192
+ * @complexity One vault write; a failed update adds one selected row read, never an inventory scan. */
193
+ async function saveConnection({ target, input, providerId }, _options = {}) {
194
+ try {
195
+ return await vault(target.deps).put(input);
196
+ }
197
+ catch (error) {
198
+ if (error instanceof target.deps.ProjectKeyCreateConflictError)
199
+ throw new PublishCredentialDuplicateLabelError(error.message);
200
+ // Unattached project rows are hidden from normal reads. Compare only this row's revision to
201
+ // distinguish a duplicate label from a CAS conflict; never enumerate, attach or open other keys.
202
+ // The storage kernel recognizes UNIQUE (workspace_id, vendor_id, label) via SQLite's
203
+ // code/message or Postgres SQLSTATE 23505.
204
+ const duplicate = await isPublishLabelConflict({ error, target, input });
205
+ if (duplicate)
206
+ throw new PublishCredentialDuplicateLabelError(input.workspaceId === target.deps.projectWorkspaceId ? `Your project already has a key named '${input.label}'. Use it here, or pick another name.` : `a '${providerId}' credential labeled '${input.label}' already exists in this workspace`);
207
+ throw error;
208
+ }
209
+ }
210
+ /** Distinguish duplicate labels from stale CAS without enumerating hidden owner keys.
211
+ * @returns Whether this is a duplicate label rather than a stale compare-and-set.
212
+ * @complexity O(1); a failed update reads one selected metadata row, creates read none.
213
+ */
214
+ async function isPublishLabelConflict({ error, target, input }, _options = {}) {
215
+ if (isUniqueViolation({ err: error }))
216
+ return true;
217
+ if (!(error instanceof VaultError) || error.code !== "conflict")
218
+ return false;
219
+ if (input.expectedRevision === null)
220
+ return true;
221
+ return currentPublishLabelConflict({ target, input });
222
+ }
223
+ async function currentPublishLabelConflict({ target, input }) {
224
+ if (!target.deps.repo.vault)
225
+ throw new VaultError({ code: "invalid-record" });
226
+ const current = await target.deps.repo.vault.find({ workspaceId: input.workspaceId, id: input.id });
227
+ if (!current || current.revision !== input.expectedRevision)
228
+ return false;
229
+ // The unique label belongs to its provider, so moving providers can conflict without a rename.
230
+ return current.label !== input.label || (input.provider !== undefined && current.provider !== input.provider);
231
+ }
232
+ /** Validate before the vault write. Jini atomically auto-defaults the first vendor credential. */
233
+ export async function createPublishCredential(deps, input) {
234
+ const label = validateLabel({ deps, raw: input.label });
235
+ const registry = await deps.loadDeployTargets({ workspaceId: input.workspaceId });
236
+ const validated = validateConnection({ deps, raw: input.connection, registry });
237
+ const isDefault = optionalBoolean({ raw: input.isDefault, field: "isDefault" });
238
+ const { providerId, ...fields } = validated.connection;
239
+ // Project-first (`@jini-ai/integrations/vendor-credentials/project-scope`); "site" = only for this site.
240
+ const target = deps.credentialCreateTarget({ deps, input, invalid: message => new PublishCredentialValidationError(message) });
241
+ await assertLabelFreeOnSite({ deps, target, workspaceId: input.workspaceId, vendorId: validated.spec.vendorId, label, providerId });
242
+ const summary = await saveConnection({ target, providerId, input: {
243
+ ...bound(target.deps).scope({ workspaceId: target.workspaceId, kind: "vendor" }), id: deps.idGen.newId(), expectedRevision: null,
244
+ provider: validated.spec.vendorId, label, meta: { credentialType: "vendor", worksFor: validatedWorksFor({ deps, value: input.worksFor === undefined ? registry.get(providerId)?.module.defaultCredentialWorksFor ?? [validated.spec.vendorId] : input.worksFor }), accountLabel: null }, payload: { vendorId: validated.spec.vendorId, ...fields },
245
+ ...hintTokenOf({ fields, tokenField: validated.spec.tokenField }), ...(isDefault === undefined ? {} : { isDefault }),
246
+ } });
247
+ // The project read view deliberately hides this new row until it is attached; use put's result.
248
+ const publishHosts = publishHostsForCredential({ deps, credential: summary, registry });
249
+ return { ...vaultSummary({ summary, hint: bound(target.deps).hint, providerId, publishHosts, defaultFor: summary.isDefault ? publishHosts : [] }), ...reportedScope({ deps, workspaceId: input.workspaceId, row: summary }) };
250
+ }
251
+ /** Select the trusted owner-card writer without widening the site's read view.
252
+ * @returns The existing scope for local/legacy stores; otherwise the grant-checked writer.
253
+ * @throws PublishCredentialValidationError outside a submitted human card.
254
+ * @complexity O(1); no I/O, inventories or secret material.
255
+ */
256
+ function sharedReplacementScope({ deps, scoped }, _options = {}) {
257
+ const project = deps.repo.project;
258
+ if (scoped.scope !== "project" || !project?.createRepo)
259
+ return scoped;
260
+ if (!deps.allowSharedKeyReplacement || !project.replaceRepo)
261
+ throw new PublishCredentialValidationError("Change this saved key in Shared Keys, or open its secure key card in the owner session. Details: P25_OWNER_KEY_READ_ONLY.");
262
+ return { ...scoped, deps: { ...scoped.deps, repo: project.replaceRepo } };
263
+ }
264
+ /** Blank secret fields keep their stored value; null explicitly removes an optional secret.
265
+ * Required secrets remain required, and non-secret companion fields still update.
266
+ * @complexity O(fields + sealed payload bytes), at most one existing connection open.
267
+ */
268
+ async function updatedConnection({ deps, input, existing, registry, host }, _options = {}) {
269
+ const raw = input.connection;
270
+ if (!raw || typeof raw !== "object" || Array.isArray(raw))
271
+ return validateConnection({ deps, raw, registry });
272
+ const values = raw;
273
+ const { spec } = connectionCredentialSpec({ value: values, registry });
274
+ if (spec.vendorId !== existing.vendorId)
275
+ return validateConnection({ deps, raw, registry });
276
+ const blankSecrets = spec.fields.filter(field => isSecretField({ field, spec }) && (values[field.name] === "" || values[field.name] === undefined));
277
+ const clearedSecrets = spec.fields.filter(field => isSecretField({ field, spec }) && !field.required && field.name !== spec.tokenField && values[field.name] === null);
278
+ if (blankSecrets.length === 0 && clearedSecrets.length === 0)
279
+ return validateConnection({ deps, raw, registry });
280
+ const stored = await decryptRecord({ deps, record: existing, providerId: host });
281
+ const merged = { ...stored, ...values };
282
+ for (const field of blankSecrets)
283
+ merged[field.name] = stored[field.name];
284
+ for (const field of clearedSecrets)
285
+ delete merged[field.name];
286
+ return validateConnection({ deps, raw: merged, registry });
287
+ }
288
+ /** Omitted connections retain their sealed envelope/hints and never require a site key.
289
+ * Provider moves retarget the old compatibility IDs unless the caller supplies worksFor.
290
+ * Reject labels that would hide a project row behind a site's row before writing.
291
+ */
292
+ export async function updatePublishCredential(deps, input) {
293
+ // Changed where it lives: this site's own row, else the project's (shared by every site).
294
+ const located = await locateById(deps, input);
295
+ const registry = await deps.loadDeployTargets({ workspaceId: input.workspaceId });
296
+ const host = located ? registry.list().find(target => target.descriptor.credential?.vendorId === located.existing.vendorId)?.descriptor.id : undefined;
297
+ if (!located || host === undefined)
298
+ throw new PublishCredentialNotFoundError(`no publish credential '${input.id}' in this workspace`);
299
+ const { existing } = located;
300
+ const scoped = sharedReplacementScope({ deps, scoped: located.scoped });
301
+ const label = input.label !== undefined ? validateLabel({ deps, raw: input.label }) : existing.label;
302
+ const requestedDefault = optionalBoolean({ raw: input.isDefault, field: "isDefault" });
303
+ if (!scoped.deps.repo.vault)
304
+ throw new VaultError({ code: "invalid-record" });
305
+ const row = await scoped.deps.repo.vault.find({ workspaceId: scoped.workspaceId, id: input.id });
306
+ if (!row)
307
+ throw new PublishCredentialNotFoundError(`no publish credential '${input.id}' in this workspace`);
308
+ const { providerId, accountLabel, ...changes } = await connectionChanges({ deps: scoped.deps, input, existing, registry, host, row });
309
+ await assertLabelFreeOnSite({ deps, target: scoped, workspaceId: input.workspaceId, vendorId: changes.provider, label, providerId });
310
+ const summary = await saveConnection({ target: scoped, providerId, input: { ...bound(scoped.deps).scope({ workspaceId: scoped.workspaceId, kind: "vendor" }), id: input.id,
311
+ expectedRevision: row.revision, label, ...changes,
312
+ meta: { ...row.meta, worksFor: updatedWorksFor({ deps, value: input.worksFor, row, provider: changes.provider, host }), accountLabel },
313
+ ...(requestedDefault === true ? { isDefault: true } : {}) } });
314
+ const described = await describeCredential(deps, { workspaceId: input.workspaceId, id: summary.id });
315
+ if (!described)
316
+ throw new PublishCredentialNotFoundError(`saved publish credential '${summary.id}' could not be found`);
317
+ return described;
318
+ }
319
+ async function connectionChanges({ deps, input, existing, registry, host, row }, _options = {}) {
320
+ const move = preservedMove({ raw: input.connection, registry, host });
321
+ if (input.connection !== undefined && !move) {
322
+ const validated = await updatedConnection({ deps, input, existing, registry, host });
323
+ const { providerId, ...fields } = validated.connection;
324
+ return { providerId, provider: validated.spec.vendorId, accountLabel: null,
325
+ payload: { vendorId: validated.spec.vendorId, ...fields }, ...hintTokenOf({ fields, tokenField: validated.spec.tokenField }) };
326
+ }
327
+ // Payload omission preserves ciphertext/hints; the vault atomically promotes/selects defaults.
328
+ const providerId = move?.providerId ?? host;
329
+ const provider = move?.spec.vendorId ?? existing.vendorId;
330
+ return { providerId, provider, accountLabel: provider === existing.vendorId ? row.meta.accountLabel : null };
331
+ }
332
+ /** Legacy rows were folded by 0012. Delete only the vault row; reboot has no source to recopy.
333
+ * A project row is removed only when no other site uses it; its attachments are removed with it. */
334
+ export async function deletePublishCredential(deps, input) {
335
+ const owner = await ownerOf(deps.repo, input);
336
+ await owner.repo.delete({ workspaceId: owner.workspaceId, id: input.id });
337
+ }
338
+ /**
339
+ * Persists a freshly-verified account label onto an existing row — see this file's own header for
340
+ * why {@link createPublishCredential}/{@link updatePublishCredential} never do this themselves. The
341
+ * ONE intended caller is the admin credential-CRUD route (`server/routes/admin/system/publish-
342
+ * credentials.ts`), immediately after its own `verifyPublishCredentialById` call returns a `"valid"`
343
+ * result carrying an `accountLabel`. Never call this with an EMPTY/absent label to "clear" one: a
344
+ * failed or inconclusive re-verify carries no `accountLabel` at all and must leave a previously-healed
345
+ * value alone — the caller's own `result.accountLabel !== undefined` check enforces that.
346
+ *
347
+ * A targeted single-column write ({@link VendorCredentialSetRepoPort.updateAccountLabel}), not a
348
+ * full-row replace — never touches `sealed`, `isDefault`, or `updatedAt`.
349
+ *
350
+ * Written where the row lives: this site's vault, else the project's.
351
+ *
352
+ * @complexity O(1) — one lookup and one repo write (a no-op, not an error, if the row vanished meanwhile).
353
+ */
354
+ export async function healAccountLabel(deps, input) {
355
+ const owner = await ownerOf(deps.repo, input);
356
+ await owner.repo.updateAccountLabel({ ...input, workspaceId: owner.workspaceId });
357
+ }
358
+ /** Jini checks exact ownership before opening. Keep the typed error used by HTTP and daemon
359
+ * boundaries: a missing key must not become an unhandled rejection in a publishing process. */
360
+ export async function decryptRecord({ deps, record, providerId }, _options = {}) {
361
+ try {
362
+ const resolved = await vault(deps).get({ ...bound(deps).scope({ workspaceId: record.workspaceId, kind: "vendor" }), id: record.id });
363
+ if (!resolved?.payload)
364
+ throw new PublishCredentialSecretStoreUnconfiguredError(deps.storageMessage);
365
+ const { vendorId: _vendorId, ...fields } = resolved.payload;
366
+ return { ...fields, providerId };
367
+ }
368
+ catch {
369
+ throw new PublishCredentialSecretStoreUnconfiguredError(deps.storageMessage);
370
+ }
371
+ }
372
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1,85 @@
1
+ import type { DeployTargetDescriptor } from "../../target-contracts.js";
2
+ import type { CredentialTokenHint } from "@jini-ai/core/contracts/site/secrets-credential-token";
3
+ import type { ISODateTime, UUID } from "@jini-ai/core/primitives";
4
+ /**
5
+ * @file Domain types for named, workspace-scoped provider connections used to publish a static
6
+ * export to a host plugin's deploy target (the host's `publish_credential_sets` table).
7
+ *
8
+ * Purpose:
9
+ * `PublishProviderId` is the ONE canonical provider-id type — `../static-publish/
10
+ * types.ts`'s `StaticPublishTargetId` is a type ALIAS of it (not a second, independently
11
+ * declared one), so the provider set can never drift between "what a credential can be saved for"
12
+ * and "what a publish can target". This module owns the canonical declaration (not the other way
13
+ * around) because a credential's provider identity is the more general, storage-shaped concept; a
14
+ * one-shot publish operation borrows it, not the reverse.
15
+ *
16
+ * `PublishConnectionInput` is a CLOSED discriminated union on `providerId` — deliberately not an
17
+ * open bag of optional fields, so a caller can never construct a connection with the wrong provider's
18
+ * companion fields and have it silently ignored. Every host's required/optional split comes from
19
+ * its plugin's descriptor (some need more than a bare token, e.g. an owner/repo or an account id,
20
+ * HARD required — see `store.ts`'s `validateConnection`); other hosts' companion fields are
21
+ * genuinely optional. Per-host notes on which stored companion fields a deploy target actually
22
+ * reads live with the host plugin (its own `NOTES.md`).
23
+ *
24
+ * A companion field is accepted and stored here even when, as of this pass, the host's deploy
25
+ * target has nowhere to send it once decrypted. Storing it anyway keeps this module's contract
26
+ * stable for whichever side (this store, or a future deploy-target change) ships second — see `../static-publish/adapter.ts`'s header for where this gap is flagged again at
27
+ * the point it would actually matter (wiring a real publish).
28
+ *
29
+ * Architectural role:
30
+ * Domain types only — no I/O, no sealer/keyring dependency. `store.ts` is the one place a
31
+ * `PublishConnectionInput` is validated, serialized, and sealed. Since the vendor-vault migration the
32
+ * sealed connections are vendor vault rows, persisted through the host's `VendorCredentialSetRepoPort`
33
+ * (which carries the `isDefault`/`updateAccountLabel` contract).
34
+ */
35
+ /** A deploy target id (`DeployTargetDescriptor.id`) that takes a saved credential. Open: which ids
36
+ * exist is the deploy registry's business, validated where a connection is written (`store.ts`). */
37
+ export type PublishProviderId = DeployTargetDescriptor["id"];
38
+ /**
39
+ * A saved connection: the target id plus the flat string fields that host's deploy-plugin descriptor
40
+ * declares for its credential (`DeployTargetDescriptor.credential`), validated by `store.ts`. This
41
+ * whole object is what gets serialized to JSON and sealed as ONE ciphertext blob per credential set
42
+ * (never per-field columns — see the host schema's `publishCredentialSets` header for why). The shape is byte-compatible with rows sealed before hosts moved into the plugin: same
43
+ * `providerId`, same field names.
44
+ *
45
+ * Publish-TARGET settings (a repository, a team) are never credential fields: they are chosen per
46
+ * publish run and live on the publish config.
47
+ */
48
+ export type PublishConnectionInput = {
49
+ readonly providerId: PublishProviderId;
50
+ } & Readonly<Record<string, string>>;
51
+ /** The read model every route/tool in this feature returns — see `store.ts`'s `toSummary`. NEVER
52
+ * contains `sealed`, a token, or any `PublishConnectionInput` field — enforced by construction: this
53
+ * type has no field capable of carrying one. */
54
+ export interface PublishCredentialSummary {
55
+ readonly credentialType: "vendor" | "custom";
56
+ readonly worksFor: string[];
57
+ readonly publishHosts: string[];
58
+ readonly defaultFor: string[];
59
+ readonly tokenHint?: CredentialTokenHint | null;
60
+ readonly id: UUID;
61
+ /** Display host: the first compatible target, or the stored vendor's editing host. */
62
+ readonly providerId: PublishProviderId;
63
+ /** Stored vendor group; custom NULL-provider keys use the display host's vendor. */
64
+ readonly vendorId: string;
65
+ readonly label: string;
66
+ readonly configured: true;
67
+ /** At most one `true` per vendor group, maintained by `store.ts`'s write path — see
68
+ * `VendorCredentialSetRepoPort`'s doc for the invariant. */
69
+ readonly isDefault: boolean;
70
+ /** Last 4 characters of the token field — see `vendor_credential_sets.token_tail`'s own doc. */
71
+ readonly tokenTail: string;
72
+ /** The verified account's public login, held in the clear (never sealed) — carried through
73
+ * unchanged, never re-derived here (this is a read model, it never decrypts or verifies anything).
74
+ * Create, a connection rotation or a vendor move reset it; only the verify heal
75
+ * (`healAccountLabel`) populates it. */
76
+ readonly accountLabel: string | null;
77
+ /** Where the row lives — present only where a project store is attached (local web + desktop):
78
+ * `"project"` is visible to attached sites only, `"site"` is this site's own (an override). */
79
+ readonly scope?: PublishCredentialScope;
80
+ readonly createdAt: ISODateTime;
81
+ readonly updatedAt: ISODateTime;
82
+ }
83
+ /** This site's own vault, or the project store every site of the project shares (`project.db`). */
84
+ export type PublishCredentialScope = "site" | "project";
85
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,123 @@
1
+ import { type ToolHandler } from '@jini-ai/core';
2
+ import type { StaticPublishToolDeps } from './publish-tool-deps.js';
3
+ import type { PublishHistoryStore } from './static-publish/publish-history.js';
4
+ import type { PublishCredentialSource } from './static-publish/types.js';
5
+ /**
6
+ * Never decrypts — reads through `listPublishCredentials` (a pure DB read of
7
+ * `vendor_credential_sets`; see its own "read model only" doc) and `credentialSource.isConfigured`
8
+ * (this file's own preview handler already relies on the identical never-decrypting contract).
9
+ * Structurally cannot reach `resolveForPublish`/`resolveDefaultForPublish`: this handler never
10
+ * hands them a `SecretSealerPort`. `tokenTail` is the stored last 4 characters, never derived by
11
+ * decrypting.
12
+ */
13
+ export declare function getStaticPublishCapabilities({ deps, credentialSource, historyStore, ctx }: {
14
+ deps: StaticPublishToolDeps;
15
+ credentialSource: PublishCredentialSource;
16
+ historyStore: PublishHistoryStore;
17
+ ctx: Parameters<ToolHandler>[0];
18
+ }): Promise<{
19
+ executionMode: import("./publish-credentials/execution-mode.js").PublishExecutionMode;
20
+ providers: ({
21
+ executable: boolean;
22
+ pluginId: string;
23
+ enabled: boolean | null;
24
+ defaultForNewDestination: boolean;
25
+ authenticatedPreview: boolean;
26
+ guidance?: string;
27
+ providerId: string;
28
+ label: string;
29
+ configFields: {
30
+ help?: string;
31
+ name: string;
32
+ label: string;
33
+ required: boolean;
34
+ }[];
35
+ ready: boolean;
36
+ credentialConfigured: boolean;
37
+ credentialOrigin: "saved" | "environment" | null;
38
+ verified: "unreachable" | "invalid" | "valid" | null;
39
+ verifiedAt: string | null;
40
+ accountLabel: string | null;
41
+ lastPublish: import("./static-publish/publish-history.js").PublishHistoryEntry | null;
42
+ savedCredentials: {
43
+ id: string;
44
+ label: string;
45
+ isDefault: boolean;
46
+ createdAt: string;
47
+ updatedAt: string;
48
+ tokenTail: string;
49
+ tokenHint: import("@jini-ai/core/contracts/site/secrets-credential-token").CredentialTokenHint | null | undefined;
50
+ credentialType: "vendor" | "custom";
51
+ worksFor: string[];
52
+ }[];
53
+ } | {
54
+ executable: boolean;
55
+ ready: boolean;
56
+ credentialConfigured: null;
57
+ savedCredentials: null;
58
+ guidance: string;
59
+ pluginId: string;
60
+ enabled: boolean | null;
61
+ providerId: string;
62
+ label: string;
63
+ })[];
64
+ refusals: string[];
65
+ credentialSetup: {
66
+ toolId: string;
67
+ message: string;
68
+ kind?: never;
69
+ } | {
70
+ toolId: string;
71
+ kind: string;
72
+ message: string;
73
+ };
74
+ } | {
75
+ executionMode: import("./publish-credentials/execution-mode.js").PublishExecutionMode;
76
+ providers: ({
77
+ executable: boolean;
78
+ pluginId: string;
79
+ enabled: boolean | null;
80
+ defaultForNewDestination: boolean;
81
+ authenticatedPreview: boolean;
82
+ guidance?: string;
83
+ providerId: string;
84
+ label: string;
85
+ configFields: {
86
+ help?: string;
87
+ name: string;
88
+ label: string;
89
+ required: boolean;
90
+ }[];
91
+ ready: boolean;
92
+ credentialConfigured: boolean;
93
+ credentialOrigin: "saved" | "environment" | null;
94
+ verified: "unreachable" | "invalid" | "valid" | null;
95
+ verifiedAt: string | null;
96
+ accountLabel: string | null;
97
+ lastPublish: import("./static-publish/publish-history.js").PublishHistoryEntry | null;
98
+ savedCredentials: {
99
+ id: string;
100
+ label: string;
101
+ isDefault: boolean;
102
+ createdAt: string;
103
+ updatedAt: string;
104
+ tokenTail: string;
105
+ tokenHint: import("@jini-ai/core/contracts/site/secrets-credential-token").CredentialTokenHint | null | undefined;
106
+ credentialType: "vendor" | "custom";
107
+ worksFor: string[];
108
+ }[];
109
+ } | {
110
+ executable: boolean;
111
+ ready: boolean;
112
+ credentialConfigured: null;
113
+ savedCredentials: null;
114
+ guidance: string;
115
+ pluginId: string;
116
+ enabled: boolean | null;
117
+ providerId: string;
118
+ label: string;
119
+ })[];
120
+ refusals: string[];
121
+ credentialSetup?: never;
122
+ }>;
123
+ //# sourceMappingURL=publish-tool-capabilities.d.ts.map