@flowdular/sdk 0.2.3 → 0.3.0

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 (912) hide show
  1. package/.ai/agents/sandbox/business-manager.md +5 -1
  2. package/.ai/blueprints/author-spec/README.md +1 -1
  3. package/.ai/blueprints/author-spec/spec-requirements.yaml +44 -0
  4. package/.ai/blueprints/author-spec/steps.yaml +5 -5
  5. package/.ai/blueprints/author-spec/templates/module.yaml +99 -3
  6. package/.ai/blueprints/edit-module/gates.yaml +4 -0
  7. package/.ai/blueprints/edit-module/required-files.yaml +9 -0
  8. package/.ai/blueprints/new-module/gates.yaml +4 -0
  9. package/.ai/blueprints/new-module/spec-requirements.yaml +2 -2
  10. package/.ai/blueprints/release/gates.yaml +4 -0
  11. package/.ai/platform-capabilities.md +128 -0
  12. package/.ai/policies/capabilities.yaml +100 -0
  13. package/.ai/policies/path-ownership.yaml +5 -2
  14. package/.ai/policies/task-budgets.yaml +5 -3
  15. package/.ai/references/catalog/module.json +4 -4
  16. package/.ai/references/catalog/package.json +2 -2
  17. package/.ai/references/catalog/spec/module.yaml +5 -3
  18. package/.ai/references/catalog/src/platform.ts +2 -0
  19. package/.ai/references/catalog/src/services/catalog-service.ts +89 -1
  20. package/.ai/references/catalog/src/services/data-classes.ts +47 -0
  21. package/.ai/references/catalog/src/services/database-repository.ts +98 -1
  22. package/.ai/references/catalog/src/services/repository.ts +22 -1
  23. package/.ai/references/catalog/tests/data-classes.test.ts +157 -0
  24. package/.ai/references/catalog.provenance.json +12 -10
  25. package/.ai/skills/README.md +10 -0
  26. package/.ai/skills/agent-tool-design/SKILL.md +1 -2
  27. package/.ai/skills/auth-security-review/SKILL.md +1 -1
  28. package/.ai/skills/business-agent-design/SKILL.md +0 -1
  29. package/.ai/skills/deploy-operate/SKILL.md +114 -0
  30. package/.ai/skills/module-new/SKILL.md +29 -3
  31. package/.ai/skills/module-update/SKILL.md +9 -3
  32. package/.ai/skills/perf-audit/SKILL.md +0 -1
  33. package/.ai/skills/release-eject-pr/SKILL.md +0 -1
  34. package/.ai/skills/spec-interview/SKILL.md +120 -0
  35. package/.ai/skills/test-hardening/SKILL.md +1 -0
  36. package/.ai/skills/ux-design/SKILL.md +34 -3
  37. package/.ai/skills/variables/SKILL.md +0 -2
  38. package/.ai/skills/workflow-development/SKILL.md +0 -1
  39. package/AGENTS.md +4 -0
  40. package/docs/agent-contract.md +2 -2
  41. package/docs/design-system.md +185 -31
  42. package/modules/access/migrations/0001_access_core.down.sql +1 -0
  43. package/modules/access/migrations/0001_access_core.up.sql +28 -0
  44. package/modules/access/migrations/README.md +3 -0
  45. package/modules/access/module.json +33 -0
  46. package/modules/access/package.json +43 -0
  47. package/modules/access/spec/module.yaml +225 -0
  48. package/modules/access/src/acl/permissions.ts +6 -0
  49. package/modules/access/src/api/endpoints.ts +244 -0
  50. package/modules/access/src/client/ActivityView.tsrx +245 -0
  51. package/modules/access/src/client/AttestationsView.tsrx +176 -0
  52. package/modules/access/src/client/ReviewView.tsrx +586 -0
  53. package/modules/access/src/client/api.ts +132 -0
  54. package/modules/access/src/client/contribution.tsrx +41 -0
  55. package/modules/access/src/client/index.ts +41 -0
  56. package/modules/access/src/client/navigation.ts +57 -0
  57. package/modules/access/src/client/presentation.ts +69 -0
  58. package/modules/access/src/client/state.ts +72 -0
  59. package/modules/access/src/domain/types.ts +189 -0
  60. package/modules/access/src/index.ts +38 -0
  61. package/modules/access/src/platform.ts +60 -0
  62. package/modules/access/src/server/index.ts +42 -0
  63. package/modules/access/src/server/runtime.ts +105 -0
  64. package/modules/access/src/services/access-service.ts +298 -0
  65. package/modules/access/src/services/audit-window.ts +78 -0
  66. package/modules/access/src/services/auth-directory.ts +72 -0
  67. package/modules/access/src/services/changes.ts +91 -0
  68. package/modules/access/src/services/data-classes.ts +28 -0
  69. package/modules/access/src/services/database-repository.ts +185 -0
  70. package/modules/access/src/services/directory.ts +102 -0
  71. package/modules/access/src/services/index.ts +33 -0
  72. package/modules/access/src/services/list-exports.ts +150 -0
  73. package/modules/access/src/services/migration.ts +54 -0
  74. package/modules/access/src/services/repository.ts +30 -0
  75. package/modules/access/src/services/review.ts +178 -0
  76. package/modules/access/translations/en.json +155 -0
  77. package/modules/access/translations/pl.json +155 -0
  78. package/modules/agents/migrations/0022_credential_rotation_inventory.down.sql +2 -0
  79. package/modules/agents/migrations/0022_credential_rotation_inventory.up.sql +7 -0
  80. package/modules/agents/migrations/0023_agents_retention_indexes.down.sql +2 -0
  81. package/modules/agents/migrations/0023_agents_retention_indexes.up.sql +9 -0
  82. package/modules/agents/migrations/0024_agent_meter_refusals.down.sql +3 -0
  83. package/modules/agents/migrations/0024_agent_meter_refusals.up.sql +22 -0
  84. package/modules/agents/migrations/0025_agent_list_indexes.down.sql +3 -0
  85. package/modules/agents/migrations/0025_agent_list_indexes.up.sql +11 -0
  86. package/modules/agents/module.json +30 -4
  87. package/modules/agents/package.json +3 -2
  88. package/modules/agents/spec/module.yaml +63 -5
  89. package/modules/agents/src/api/endpoints.ts +291 -33
  90. package/modules/agents/src/cli/commands.json +11 -0
  91. package/modules/agents/src/cli/index.ts +45 -0
  92. package/modules/agents/src/client/AgentDashboardWidget.tsrx +19 -11
  93. package/modules/agents/src/client/AgentDefinitionList.tsrx +53 -10
  94. package/modules/agents/src/client/AgentPlaygroundView.tsrx +4 -4
  95. package/modules/agents/src/client/AgentProceduresView.tsrx +2 -2
  96. package/modules/agents/src/client/AgentRunsView.tsrx +143 -40
  97. package/modules/agents/src/client/AgentsView.tsrx +109 -33
  98. package/modules/agents/src/client/api.ts +99 -21
  99. package/modules/agents/src/client/state.ts +97 -0
  100. package/modules/agents/src/domain/types.ts +44 -4
  101. package/modules/agents/src/platform.ts +42 -0
  102. package/modules/agents/src/server/action-execution.ts +201 -106
  103. package/modules/agents/src/server/runtime.ts +32 -0
  104. package/modules/agents/src/services/agent-service.ts +158 -30
  105. package/modules/agents/src/services/credential-rotation.ts +185 -0
  106. package/modules/agents/src/services/credential-vault.ts +71 -46
  107. package/modules/agents/src/services/data-classes.ts +176 -0
  108. package/modules/agents/src/services/database-repository.ts +393 -101
  109. package/modules/agents/src/services/metering.ts +111 -0
  110. package/modules/agents/src/services/migration.ts +109 -0
  111. package/modules/agents/src/services/module-agent-preflight.ts +17 -9
  112. package/modules/agents/src/services/notifications.ts +98 -0
  113. package/modules/agents/src/services/provider-repository.ts +9 -18
  114. package/modules/agents/src/services/provider-service.ts +1 -9
  115. package/modules/agents/src/services/reports.ts +107 -0
  116. package/modules/agents/src/services/repository.ts +86 -6
  117. package/modules/agents/src/services/usage-service.ts +2 -0
  118. package/modules/agents/src/services/worker.ts +114 -4
  119. package/modules/agents/src/settings.ts +14 -3
  120. package/modules/agents/translations/en.json +14 -4
  121. package/modules/agents/translations/pl.json +14 -4
  122. package/modules/approvals/migrations/0001_approvals_core.down.sql +3 -0
  123. package/modules/approvals/migrations/0001_approvals_core.up.sql +78 -0
  124. package/modules/approvals/migrations/0002_approvals_expiry_routing_role.down.sql +2 -0
  125. package/modules/approvals/migrations/0002_approvals_expiry_routing_role.up.sql +19 -0
  126. package/modules/approvals/migrations/0003_approvals_retention_indexes.down.sql +6 -0
  127. package/modules/approvals/migrations/0003_approvals_retention_indexes.up.sql +14 -0
  128. package/modules/approvals/migrations/0004_approvals_inbox_keyset_indexes.down.sql +5 -0
  129. package/modules/approvals/migrations/0004_approvals_inbox_keyset_indexes.up.sql +12 -0
  130. package/modules/approvals/migrations/README.md +3 -0
  131. package/modules/approvals/module.json +34 -0
  132. package/modules/approvals/package.json +43 -0
  133. package/modules/approvals/spec/module.yaml +318 -0
  134. package/modules/approvals/src/acl/permissions.ts +7 -0
  135. package/modules/approvals/src/api/endpoints.ts +457 -0
  136. package/modules/approvals/src/client/ApprovalRequestDrawer.tsrx +138 -0
  137. package/modules/approvals/src/client/ApprovalsView.tsrx +562 -0
  138. package/modules/approvals/src/client/PendingCountWidget.tsrx +52 -0
  139. package/modules/approvals/src/client/api.ts +203 -0
  140. package/modules/approvals/src/client/approvals.css +51 -0
  141. package/modules/approvals/src/client/contribution.tsrx +44 -0
  142. package/modules/approvals/src/client/index.ts +26 -0
  143. package/modules/approvals/src/client/navigation.ts +39 -0
  144. package/modules/approvals/src/client/pending-count.ts +26 -0
  145. package/modules/approvals/src/client/presentation.ts +52 -0
  146. package/modules/approvals/src/client/state.ts +141 -0
  147. package/modules/approvals/src/domain/capability.ts +95 -0
  148. package/modules/approvals/src/domain/types.ts +154 -0
  149. package/modules/approvals/src/index.ts +52 -0
  150. package/modules/approvals/src/platform.ts +128 -0
  151. package/modules/approvals/src/server/index.ts +42 -0
  152. package/modules/approvals/src/server/runtime.ts +181 -0
  153. package/modules/approvals/src/services/approvals-service.ts +557 -0
  154. package/modules/approvals/src/services/callbacks.ts +75 -0
  155. package/modules/approvals/src/services/data-classes.ts +167 -0
  156. package/modules/approvals/src/services/database-repository.ts +724 -0
  157. package/modules/approvals/src/services/eligibility.ts +121 -0
  158. package/modules/approvals/src/services/expiry-runner.ts +81 -0
  159. package/modules/approvals/src/services/index.ts +31 -0
  160. package/modules/approvals/src/services/migration.ts +222 -0
  161. package/modules/approvals/src/services/notifications.ts +95 -0
  162. package/modules/approvals/src/services/repository.ts +161 -0
  163. package/modules/approvals/src/services/service-error.ts +70 -0
  164. package/modules/approvals/src/settings.ts +102 -0
  165. package/modules/approvals/translations/en.json +104 -0
  166. package/modules/approvals/translations/pl.json +104 -0
  167. package/modules/audit/migrations/0001_audit_core.down.sql +8 -0
  168. package/modules/audit/migrations/0001_audit_core.up.sql +107 -0
  169. package/modules/audit/migrations/0002_audit_sweep_routing_role.down.sql +2 -0
  170. package/modules/audit/migrations/0002_audit_sweep_routing_role.up.sql +21 -0
  171. package/modules/audit/migrations/0003_audit_export_request.down.sql +12 -0
  172. package/modules/audit/migrations/0003_audit_export_request.up.sql +40 -0
  173. package/modules/audit/migrations/0004_audit_hold_seal_erasure.down.sql +17 -0
  174. package/modules/audit/migrations/0004_audit_hold_seal_erasure.up.sql +192 -0
  175. package/modules/audit/migrations/0005_audit_event_format.down.sql +17 -0
  176. package/modules/audit/migrations/0005_audit_event_format.up.sql +60 -0
  177. package/modules/audit/migrations/0006_audit_own_class_walks.down.sql +3 -0
  178. package/modules/audit/migrations/0006_audit_own_class_walks.up.sql +14 -0
  179. package/modules/audit/migrations/README.md +3 -0
  180. package/modules/audit/module.json +32 -0
  181. package/modules/audit/package.json +49 -0
  182. package/modules/audit/spec/module.yaml +809 -0
  183. package/modules/audit/src/acl/permissions.ts +7 -0
  184. package/modules/audit/src/api/endpoints.ts +315 -0
  185. package/modules/audit/src/cli/commands.json +95 -0
  186. package/modules/audit/src/cli/index.ts +658 -0
  187. package/modules/audit/src/client/DataClassesView.tsrx +420 -0
  188. package/modules/audit/src/client/ExportsView.tsrx +256 -0
  189. package/modules/audit/src/client/HoldsView.tsrx +604 -0
  190. package/modules/audit/src/client/SweepsView.tsrx +251 -0
  191. package/modules/audit/src/client/api.ts +185 -0
  192. package/modules/audit/src/client/contribution.tsrx +52 -0
  193. package/modules/audit/src/client/index.ts +23 -0
  194. package/modules/audit/src/client/navigation.ts +74 -0
  195. package/modules/audit/src/client/presentation.ts +105 -0
  196. package/modules/audit/src/client/state.ts +86 -0
  197. package/modules/audit/src/domain/data-classes.ts +16 -0
  198. package/modules/audit/src/domain/types.ts +339 -0
  199. package/modules/audit/src/index.ts +76 -0
  200. package/modules/audit/src/platform.ts +44 -0
  201. package/modules/audit/src/server/index.ts +177 -0
  202. package/modules/audit/src/server/runtime.ts +303 -0
  203. package/modules/audit/src/services/anchor-key.ts +143 -0
  204. package/modules/audit/src/services/anchor-rotation.ts +147 -0
  205. package/modules/audit/src/services/audit-runners.ts +278 -0
  206. package/modules/audit/src/services/backup-guard.ts +95 -0
  207. package/modules/audit/src/services/database-repository.ts +1946 -0
  208. package/modules/audit/src/services/declared-classes.ts +64 -0
  209. package/modules/audit/src/services/erasure-port.ts +126 -0
  210. package/modules/audit/src/services/erasure-service.ts +770 -0
  211. package/modules/audit/src/services/export-directory.ts +106 -0
  212. package/modules/audit/src/services/export-service.ts +714 -0
  213. package/modules/audit/src/services/hold-service.ts +295 -0
  214. package/modules/audit/src/services/index.ts +17 -0
  215. package/modules/audit/src/services/migration.ts +658 -0
  216. package/modules/audit/src/services/own-classes.ts +318 -0
  217. package/modules/audit/src/services/platform-version.ts +23 -0
  218. package/modules/audit/src/services/repository.ts +495 -0
  219. package/modules/audit/src/services/retention-service.ts +191 -0
  220. package/modules/audit/src/services/seal-service.ts +769 -0
  221. package/modules/audit/src/services/service-error.ts +61 -0
  222. package/modules/audit/src/services/subject-keys.ts +90 -0
  223. package/modules/audit/src/services/sweep-service.ts +298 -0
  224. package/modules/audit/src/services/zip.ts +217 -0
  225. package/modules/audit/src/settings.ts +69 -0
  226. package/modules/audit/translations/en.json +210 -0
  227. package/modules/audit/translations/pl.json +210 -0
  228. package/modules/auth/README.md +77 -29
  229. package/modules/auth/migrations/0016_external_identities.up.sql +16 -0
  230. package/modules/auth/migrations/0017_mfa_key_id.up.sql +8 -0
  231. package/modules/auth/migrations/0018_retire_bundled_module_scopes.up.sql +29 -0
  232. package/modules/auth/migrations/0019_notifications_member_scopes.up.sql +44 -0
  233. package/modules/auth/migrations/0020_identity_providers.up.sql +61 -0
  234. package/modules/auth/migrations/0021_membership_status.up.sql +19 -0
  235. package/modules/auth/migrations/0022_auth_provider_scopes.up.sql +45 -0
  236. package/modules/auth/migrations/0023_enterprise_module_scopes.down.sql +19 -0
  237. package/modules/auth/migrations/0023_enterprise_module_scopes.up.sql +71 -0
  238. package/modules/auth/migrations/0024_approvals_member_scopes.down.sql +22 -0
  239. package/modules/auth/migrations/0024_approvals_member_scopes.up.sql +48 -0
  240. package/modules/auth/migrations/0025_audit_holds_owner_scope.down.sql +21 -0
  241. package/modules/auth/migrations/0025_audit_holds_owner_scope.up.sql +47 -0
  242. package/modules/auth/migrations/0026_auth_export_keyset_indexes.down.sql +6 -0
  243. package/modules/auth/migrations/0026_auth_export_keyset_indexes.up.sql +15 -0
  244. package/modules/auth/migrations/0027_workflow_automation_profile_scopes.down.sql +34 -0
  245. package/modules/auth/migrations/0027_workflow_automation_profile_scopes.up.sql +72 -0
  246. package/modules/auth/migrations/0028_auth_member_search_prefix_indexes.down.sql +6 -0
  247. package/modules/auth/migrations/0028_auth_member_search_prefix_indexes.up.sql +21 -0
  248. package/modules/auth/migrations/0029_reports_exports_access_scopes.down.sql +22 -0
  249. package/modules/auth/migrations/0029_reports_exports_access_scopes.up.sql +56 -0
  250. package/modules/auth/migrations/0030_auth_membership_keyset_index.down.sql +4 -0
  251. package/modules/auth/migrations/0030_auth_membership_keyset_index.up.sql +10 -0
  252. package/modules/auth/migrations/0031_membership_scope_backfills_under_rls.down.sql +4 -0
  253. package/modules/auth/migrations/0031_membership_scope_backfills_under_rls.up.sql +31 -0
  254. package/modules/auth/migrations/0032_audit_actor_service.down.sql +9 -0
  255. package/modules/auth/migrations/0032_audit_actor_service.up.sql +10 -0
  256. package/modules/auth/migrations/0033_auth_account_keyset_indexes.down.sql +5 -0
  257. package/modules/auth/migrations/0033_auth_account_keyset_indexes.up.sql +23 -0
  258. package/modules/auth/module.json +3 -3
  259. package/modules/auth/package.json +3 -2
  260. package/modules/auth/spec/module.yaml +372 -3
  261. package/modules/auth/src/acl/scopes.ts +50 -6
  262. package/modules/auth/src/cli/commands.json +11 -0
  263. package/modules/auth/src/cli/greenfield.ts +2 -2
  264. package/modules/auth/src/cli/index.ts +14 -0
  265. package/modules/auth/src/cli/secrets.ts +114 -0
  266. package/modules/auth/src/client/AuthenticationCore.tsrx +61 -8
  267. package/modules/auth/src/client/api.ts +72 -6
  268. package/modules/auth/src/client/contribution.tsrx +23 -0
  269. package/modules/auth/src/client/index.ts +6 -0
  270. package/modules/auth/src/client/providers/IdentityProviderForm.tsrx +191 -0
  271. package/modules/auth/src/client/providers/IdentityProvidersView.tsrx +358 -0
  272. package/modules/auth/src/client/providers/api.ts +128 -0
  273. package/modules/auth/src/client/providers/provider-columns.tsrx +60 -0
  274. package/modules/auth/src/client/providers/state.ts +35 -0
  275. package/modules/auth/src/client/security/SecurityView.tsrx +9 -1
  276. package/modules/auth/src/client/state.ts +15 -1
  277. package/modules/auth/src/domain/types.ts +55 -0
  278. package/modules/auth/src/index.ts +11 -1
  279. package/modules/auth/src/middleware/authentication.ts +4 -0
  280. package/modules/auth/src/server/endpoints.ts +467 -171
  281. package/modules/auth/src/server/http.ts +3 -2
  282. package/modules/auth/src/server/index.ts +22 -1
  283. package/modules/auth/src/server/membership-endpoints.ts +62 -0
  284. package/modules/auth/src/server/mfa-enforcement.ts +156 -0
  285. package/modules/auth/src/server/oidc.ts +389 -0
  286. package/modules/auth/src/server/provider-endpoints.ts +246 -0
  287. package/modules/auth/src/server/provider-host.ts +77 -0
  288. package/modules/auth/src/server/runtime.ts +231 -55
  289. package/modules/auth/src/services/auth-service-error.ts +7 -2
  290. package/modules/auth/src/services/auth-service.ts +948 -51
  291. package/modules/auth/src/services/data-classes.ts +236 -0
  292. package/modules/auth/src/services/database-repository.ts +853 -71
  293. package/modules/auth/src/services/identity-provider-service.ts +571 -0
  294. package/modules/auth/src/services/mail-delivery.ts +16 -16
  295. package/modules/auth/src/services/mail-message.ts +54 -0
  296. package/modules/auth/src/services/mail-port.ts +24 -0
  297. package/modules/auth/src/services/mail-smtp.ts +85 -0
  298. package/modules/auth/src/services/mfa-rotation.ts +144 -0
  299. package/modules/auth/src/services/migration.ts +810 -0
  300. package/modules/auth/src/services/password.ts +14 -0
  301. package/modules/auth/src/services/provider-secret-rotation.ts +169 -0
  302. package/modules/auth/src/services/provider-secrets.ts +136 -0
  303. package/modules/auth/src/services/repository.ts +321 -5
  304. package/modules/auth/src/services/session-sweep-runner.ts +73 -0
  305. package/modules/auth/src/services/settings-store.ts +10 -83
  306. package/modules/auth/src/services/totp.ts +88 -62
  307. package/modules/auth/src/services/validation.ts +194 -7
  308. package/modules/auth/src/settings.ts +18 -0
  309. package/modules/auth/translations/en.json +84 -1
  310. package/modules/auth/translations/pl.json +84 -1
  311. package/modules/automations/migrations/0005_secret_rotation_inventory.down.sql +1 -0
  312. package/modules/automations/migrations/0005_secret_rotation_inventory.up.sql +6 -0
  313. package/modules/automations/migrations/0006_automations_list_sort_indexes.down.sql +4 -0
  314. package/modules/automations/migrations/0006_automations_list_sort_indexes.up.sql +11 -0
  315. package/modules/automations/module.json +24 -6
  316. package/modules/automations/package.json +5 -2
  317. package/modules/automations/spec/module.yaml +81 -7
  318. package/modules/automations/src/api/endpoints.ts +202 -28
  319. package/modules/automations/src/cli/commands.json +17 -0
  320. package/modules/automations/src/cli/index.ts +114 -0
  321. package/modules/automations/src/client/AutomationScheduleForm.tsrx +77 -19
  322. package/modules/automations/src/client/AutomationSchedulesView.tsrx +144 -40
  323. package/modules/automations/src/client/AutomationTriggersView.tsrx +131 -32
  324. package/modules/automations/src/client/api.ts +62 -19
  325. package/modules/automations/src/client/presentation.ts +20 -2
  326. package/modules/automations/src/client/state.ts +84 -0
  327. package/modules/automations/src/domain/cadence.ts +99 -3
  328. package/modules/automations/src/domain/cron.ts +366 -0
  329. package/modules/automations/src/domain/time-zone.ts +61 -0
  330. package/modules/automations/src/platform.ts +38 -4
  331. package/modules/automations/src/server/index.ts +11 -0
  332. package/modules/automations/src/server/runtime.ts +46 -22
  333. package/modules/{automations-workflows-integration/src/server/adapter.ts → automations/src/server/workflow-target.ts} +13 -14
  334. package/modules/{automations-workflows-integration/src/server/tools.ts → automations/src/server/workflow-tools.ts} +0 -0
  335. package/modules/automations/src/services/data-classes.ts +62 -0
  336. package/modules/automations/src/services/database-repository.ts +152 -38
  337. package/modules/automations/src/services/migration.ts +119 -9
  338. package/modules/automations/src/services/repository.ts +52 -1
  339. package/modules/automations/src/services/schedule-runner.ts +84 -0
  340. package/modules/automations/src/services/schedule-service.ts +152 -26
  341. package/modules/automations/src/services/secret-rotation.ts +176 -0
  342. package/modules/automations/src/services/secret-vault.ts +68 -41
  343. package/modules/automations/src/services/trigger-service.ts +13 -10
  344. package/modules/automations/translations/en.json +15 -2
  345. package/modules/automations/translations/pl.json +15 -2
  346. package/modules/connectors/migrations/0001_connectors_core.down.sql +3 -0
  347. package/modules/connectors/migrations/0001_connectors_core.up.sql +72 -0
  348. package/modules/connectors/migrations/0002_connectors_call_keys.down.sql +3 -0
  349. package/modules/connectors/migrations/0002_connectors_call_keys.up.sql +18 -0
  350. package/modules/connectors/migrations/README.md +3 -0
  351. package/modules/connectors/module.json +28 -0
  352. package/modules/{automations-workflows-integration → connectors}/package.json +27 -26
  353. package/modules/connectors/spec/module.yaml +447 -0
  354. package/modules/connectors/src/acl/permissions.ts +6 -0
  355. package/modules/connectors/src/agent/tools.ts +180 -0
  356. package/modules/connectors/src/api/endpoints.ts +572 -0
  357. package/modules/connectors/src/client/ConnectorCallsView.tsrx +358 -0
  358. package/modules/connectors/src/client/ConnectorForm.tsrx +424 -0
  359. package/modules/connectors/src/client/ConnectorsView.tsrx +711 -0
  360. package/modules/connectors/src/client/api.ts +281 -0
  361. package/modules/connectors/src/client/consent.ts +48 -0
  362. package/modules/connectors/src/client/contribution.tsrx +37 -0
  363. package/modules/connectors/src/client/index.ts +22 -0
  364. package/modules/connectors/src/client/navigation.ts +42 -0
  365. package/modules/connectors/src/client/presentation.ts +38 -0
  366. package/modules/connectors/src/client/state.ts +175 -0
  367. package/modules/connectors/src/domain/calls.ts +70 -0
  368. package/modules/connectors/src/domain/definitions.ts +190 -0
  369. package/modules/connectors/src/domain/http-json.ts +68 -0
  370. package/modules/connectors/src/domain/types.ts +185 -0
  371. package/modules/connectors/src/index.ts +64 -0
  372. package/modules/connectors/src/platform.ts +56 -0
  373. package/modules/connectors/src/server/index.ts +66 -0
  374. package/modules/connectors/src/server/runtime.ts +163 -0
  375. package/modules/connectors/src/services/call-service.ts +903 -0
  376. package/modules/connectors/src/services/connectors-service.ts +653 -0
  377. package/modules/connectors/src/services/credential-vault.ts +188 -0
  378. package/modules/connectors/src/services/data-classes.ts +158 -0
  379. package/modules/connectors/src/services/database-repository.ts +897 -0
  380. package/modules/connectors/src/services/egress.ts +261 -0
  381. package/modules/connectors/src/services/index.ts +19 -0
  382. package/modules/connectors/src/services/migration.ts +166 -0
  383. package/modules/connectors/src/services/repository.ts +175 -0
  384. package/modules/connectors/src/services/service-error.ts +46 -0
  385. package/modules/connectors/src/settings.ts +69 -0
  386. package/modules/connectors/translations/en.json +191 -0
  387. package/modules/connectors/translations/pl.json +191 -0
  388. package/modules/directory/migrations/0001_directory_core.down.sql +5 -0
  389. package/modules/directory/migrations/0001_directory_core.up.sql +111 -0
  390. package/modules/directory/migrations/README.md +3 -0
  391. package/modules/directory/module.json +27 -0
  392. package/modules/directory/package.json +46 -0
  393. package/modules/directory/spec/module.yaml +351 -0
  394. package/modules/directory/src/acl/permissions.ts +7 -0
  395. package/modules/directory/src/api/endpoints.ts +478 -0
  396. package/modules/directory/src/api/scim-endpoints.ts +516 -0
  397. package/modules/directory/src/client/GroupMappingsView.tsrx +430 -0
  398. package/modules/directory/src/client/ProvisioningLogView.tsrx +248 -0
  399. package/modules/directory/src/client/ScimTokensView.tsrx +587 -0
  400. package/modules/directory/src/client/api.ts +222 -0
  401. package/modules/directory/src/client/contribution.tsrx +46 -0
  402. package/modules/directory/src/client/index.ts +22 -0
  403. package/modules/directory/src/client/navigation.ts +57 -0
  404. package/modules/directory/src/client/presentation.ts +143 -0
  405. package/modules/directory/src/client/state.ts +173 -0
  406. package/modules/directory/src/domain/scim.ts +346 -0
  407. package/modules/directory/src/domain/types.ts +166 -0
  408. package/modules/directory/src/index.ts +44 -0
  409. package/modules/directory/src/platform.ts +43 -0
  410. package/modules/directory/src/server/index.ts +17 -0
  411. package/modules/directory/src/server/runtime.ts +124 -0
  412. package/modules/directory/src/services/auth-port.ts +127 -0
  413. package/modules/directory/src/services/data-classes.ts +41 -0
  414. package/modules/directory/src/services/database-repository.ts +1067 -0
  415. package/modules/directory/src/services/directory-service.ts +311 -0
  416. package/modules/directory/src/services/index.ts +43 -0
  417. package/modules/directory/src/services/migration.ts +146 -0
  418. package/modules/directory/src/services/provisioning-service.ts +1420 -0
  419. package/modules/directory/src/services/rate-limiter.ts +103 -0
  420. package/modules/directory/src/services/repository.ts +208 -0
  421. package/modules/directory/src/services/service-error.ts +42 -0
  422. package/modules/directory/src/services/token-service.ts +215 -0
  423. package/modules/directory/src/settings.ts +86 -0
  424. package/modules/directory/translations/en.json +185 -0
  425. package/modules/directory/translations/pl.json +185 -0
  426. package/modules/documents/migrations/0001_documents_core.down.sql +1 -0
  427. package/modules/documents/migrations/0001_documents_core.up.sql +35 -0
  428. package/modules/documents/migrations/0002_documents_files_page.down.sql +1 -0
  429. package/modules/documents/migrations/0002_documents_files_page.up.sql +6 -0
  430. package/modules/documents/migrations/README.md +3 -0
  431. package/modules/documents/module.json +28 -0
  432. package/modules/documents/package.json +49 -0
  433. package/modules/documents/spec/module.yaml +247 -0
  434. package/modules/documents/src/acl/permissions.ts +6 -0
  435. package/modules/documents/src/api/endpoints.ts +401 -0
  436. package/modules/documents/src/client/DocumentUploader.tsrx +148 -0
  437. package/modules/documents/src/client/DocumentsView.tsrx +540 -0
  438. package/modules/documents/src/client/api.ts +209 -0
  439. package/modules/documents/src/client/contribution.tsrx +29 -0
  440. package/modules/documents/src/client/download.ts +70 -0
  441. package/modules/documents/src/client/index.ts +22 -0
  442. package/modules/documents/src/client/navigation.ts +25 -0
  443. package/modules/documents/src/client/presentation.ts +110 -0
  444. package/modules/documents/src/client/state.ts +117 -0
  445. package/modules/documents/src/domain/attachments.ts +84 -0
  446. package/modules/documents/src/domain/types.ts +80 -0
  447. package/modules/documents/src/index.ts +46 -0
  448. package/modules/documents/src/platform.ts +61 -0
  449. package/modules/documents/src/server/index.ts +30 -0
  450. package/modules/documents/src/server/runtime.ts +107 -0
  451. package/modules/documents/src/services/attachments.ts +39 -0
  452. package/modules/documents/src/services/data-classes.ts +25 -0
  453. package/modules/documents/src/services/database-repository.ts +259 -0
  454. package/modules/documents/src/services/documents-service.ts +586 -0
  455. package/modules/documents/src/services/index.ts +18 -0
  456. package/modules/documents/src/services/migration.ts +82 -0
  457. package/modules/documents/src/services/repository.ts +48 -0
  458. package/modules/documents/src/settings.ts +107 -0
  459. package/modules/documents/translations/en.json +111 -0
  460. package/modules/documents/translations/pl.json +111 -0
  461. package/modules/exports/migrations/0001_exports_core.down.sql +2 -0
  462. package/modules/exports/migrations/0001_exports_core.up.sql +28 -0
  463. package/modules/exports/migrations/0002_exports_job_routing_role.down.sql +4 -0
  464. package/modules/exports/migrations/0002_exports_job_routing_role.up.sql +21 -0
  465. package/modules/exports/migrations/README.md +3 -0
  466. package/modules/exports/module.json +28 -0
  467. package/modules/exports/package.json +44 -0
  468. package/modules/exports/spec/module.yaml +229 -0
  469. package/modules/exports/src/acl/permissions.ts +6 -0
  470. package/modules/exports/src/api/endpoints.ts +211 -0
  471. package/modules/exports/src/client/ExportsView.tsrx +327 -0
  472. package/modules/exports/src/client/api.ts +133 -0
  473. package/modules/exports/src/client/contribution.tsrx +31 -0
  474. package/modules/exports/src/client/index.ts +20 -0
  475. package/modules/exports/src/client/navigation.ts +25 -0
  476. package/modules/exports/src/client/presentation.ts +53 -0
  477. package/modules/exports/src/client/state.ts +56 -0
  478. package/modules/exports/src/domain/lists.ts +29 -0
  479. package/modules/exports/src/domain/types.ts +120 -0
  480. package/modules/exports/src/index.ts +41 -0
  481. package/modules/exports/src/platform.ts +80 -0
  482. package/modules/exports/src/server/index.ts +51 -0
  483. package/modules/exports/src/server/runtime.ts +160 -0
  484. package/modules/exports/src/services/data-classes.ts +56 -0
  485. package/modules/exports/src/services/database-repository.ts +405 -0
  486. package/modules/exports/src/services/export-runner.ts +123 -0
  487. package/modules/exports/src/services/export-service.ts +356 -0
  488. package/modules/exports/src/services/index.ts +6 -0
  489. package/modules/exports/src/services/list-registry.ts +105 -0
  490. package/modules/exports/src/services/migration.ts +89 -0
  491. package/modules/exports/src/services/repository.ts +97 -0
  492. package/modules/exports/src/settings.ts +70 -0
  493. package/modules/exports/translations/en.json +69 -0
  494. package/modules/exports/translations/pl.json +69 -0
  495. package/modules/import/migrations/0001_import_core.down.sql +6 -0
  496. package/modules/import/migrations/0001_import_core.up.sql +61 -0
  497. package/modules/import/migrations/0002_import_job_routing_role.down.sql +4 -0
  498. package/modules/import/migrations/0002_import_job_routing_role.up.sql +20 -0
  499. package/modules/import/migrations/0003_import_jobs_export_index.down.sql +1 -0
  500. package/modules/import/migrations/0003_import_jobs_export_index.up.sql +7 -0
  501. package/modules/import/migrations/0004_import_jobs_traceparent.down.sql +1 -0
  502. package/modules/import/migrations/0004_import_jobs_traceparent.up.sql +7 -0
  503. package/modules/import/migrations/README.md +3 -0
  504. package/modules/import/module.json +37 -0
  505. package/modules/import/package.json +50 -0
  506. package/modules/import/spec/module.yaml +335 -0
  507. package/modules/import/src/acl/permissions.ts +6 -0
  508. package/modules/import/src/api/endpoints.ts +400 -0
  509. package/modules/import/src/client/ImportJobDrawer.tsrx +229 -0
  510. package/modules/import/src/client/ImportsView.tsrx +455 -0
  511. package/modules/import/src/client/NewImportForm.tsrx +274 -0
  512. package/modules/import/src/client/api.ts +243 -0
  513. package/modules/import/src/client/contribution.tsrx +29 -0
  514. package/modules/import/src/client/index.ts +23 -0
  515. package/modules/import/src/client/navigation.ts +25 -0
  516. package/modules/import/src/client/presentation.ts +59 -0
  517. package/modules/import/src/client/state.ts +43 -0
  518. package/modules/import/src/domain/csv.ts +258 -0
  519. package/modules/import/src/domain/ports.ts +157 -0
  520. package/modules/import/src/domain/types.ts +179 -0
  521. package/modules/import/src/index.ts +58 -0
  522. package/modules/import/src/platform.ts +60 -0
  523. package/modules/import/src/server/index.ts +49 -0
  524. package/modules/import/src/server/runtime.ts +158 -0
  525. package/modules/import/src/services/csv-source.ts +121 -0
  526. package/modules/import/src/services/data-classes.ts +63 -0
  527. package/modules/import/src/services/database-repository.ts +780 -0
  528. package/modules/import/src/services/import-runner.ts +127 -0
  529. package/modules/import/src/services/import-service.ts +872 -0
  530. package/modules/import/src/services/index.ts +6 -0
  531. package/modules/import/src/services/migration.ts +156 -0
  532. package/modules/import/src/services/port-registry.ts +158 -0
  533. package/modules/import/src/services/repository.ts +147 -0
  534. package/modules/import/src/settings.ts +70 -0
  535. package/modules/import/translations/en.json +175 -0
  536. package/modules/import/translations/pl.json +175 -0
  537. package/modules/metering/migrations/0001_metering_core.down.sql +6 -0
  538. package/modules/metering/migrations/0001_metering_core.up.sql +119 -0
  539. package/modules/metering/migrations/0002_metering_bucket_export.down.sql +3 -0
  540. package/modules/metering/migrations/0002_metering_bucket_export.up.sql +5 -0
  541. package/modules/metering/migrations/README.md +3 -0
  542. package/modules/metering/module.json +46 -0
  543. package/modules/metering/package.json +50 -0
  544. package/modules/metering/spec/module.yaml +269 -0
  545. package/modules/metering/src/acl/permissions.ts +5 -0
  546. package/modules/metering/src/api/endpoints.ts +104 -0
  547. package/modules/metering/src/cli/commands.json +28 -0
  548. package/modules/metering/src/cli/index.ts +246 -0
  549. package/modules/metering/src/client/LimitsView.tsrx +170 -0
  550. package/modules/metering/src/client/UsageSummaryWidget.tsrx +63 -0
  551. package/modules/metering/src/client/UsageView.tsrx +205 -0
  552. package/modules/metering/src/client/api.ts +91 -0
  553. package/modules/metering/src/client/contribution.tsrx +42 -0
  554. package/modules/metering/src/client/index.ts +26 -0
  555. package/modules/metering/src/client/navigation.ts +54 -0
  556. package/modules/metering/src/client/presentation.ts +63 -0
  557. package/modules/metering/src/client/state.ts +31 -0
  558. package/modules/metering/src/domain/meters.ts +100 -0
  559. package/modules/metering/src/domain/types.ts +71 -0
  560. package/modules/metering/src/index.ts +51 -0
  561. package/modules/metering/src/platform.ts +84 -0
  562. package/modules/metering/src/server/index.ts +40 -0
  563. package/modules/metering/src/server/runtime.ts +165 -0
  564. package/modules/metering/src/services/data-classes.ts +34 -0
  565. package/modules/metering/src/services/database-repository.ts +574 -0
  566. package/modules/metering/src/services/index.ts +9 -0
  567. package/modules/metering/src/services/meter-registry.ts +145 -0
  568. package/modules/metering/src/services/metering-service.ts +441 -0
  569. package/modules/metering/src/services/migration.ts +183 -0
  570. package/modules/metering/src/services/notifications.ts +75 -0
  571. package/modules/metering/src/services/reports.ts +105 -0
  572. package/modules/metering/src/services/repository.ts +132 -0
  573. package/modules/metering/src/services/service-error.ts +46 -0
  574. package/modules/metering/src/settings.ts +47 -0
  575. package/modules/metering/translations/en.json +68 -0
  576. package/modules/metering/translations/pl.json +68 -0
  577. package/modules/notifications/migrations/0001_notifications_core.down.sql +1 -0
  578. package/modules/notifications/migrations/0001_notifications_core.up.sql +26 -0
  579. package/modules/notifications/migrations/0002_notifications_preferences.down.sql +1 -0
  580. package/modules/notifications/migrations/0002_notifications_preferences.up.sql +17 -0
  581. package/modules/notifications/migrations/0003_notifications_webhook_subscriptions.down.sql +1 -0
  582. package/modules/notifications/migrations/0003_notifications_webhook_subscriptions.up.sql +30 -0
  583. package/modules/notifications/migrations/0004_notifications_deliveries.down.sql +1 -0
  584. package/modules/notifications/migrations/0004_notifications_deliveries.up.sql +35 -0
  585. package/modules/notifications/migrations/0005_notifications_delivery_routing_role.down.sql +2 -0
  586. package/modules/notifications/migrations/0005_notifications_delivery_routing_role.up.sql +17 -0
  587. package/modules/notifications/migrations/0006_notifications_delivery_title.down.sql +1 -0
  588. package/modules/notifications/migrations/0006_notifications_delivery_title.up.sql +11 -0
  589. package/modules/notifications/migrations/0007_notifications_secret_rotation_inventory.down.sql +2 -0
  590. package/modules/notifications/migrations/0007_notifications_secret_rotation_inventory.up.sql +19 -0
  591. package/modules/notifications/migrations/0008_notifications_delivery_claim.down.sql +8 -0
  592. package/modules/notifications/migrations/0008_notifications_delivery_claim.up.sql +19 -0
  593. package/modules/notifications/migrations/0009_notifications_kind_approvals.down.sql +16 -0
  594. package/modules/notifications/migrations/0009_notifications_kind_approvals.up.sql +18 -0
  595. package/modules/notifications/migrations/0010_notifications_kind_meter_threshold.down.sql +16 -0
  596. package/modules/notifications/migrations/0010_notifications_kind_meter_threshold.up.sql +18 -0
  597. package/modules/notifications/migrations/0011_notifications_retention_keyset.down.sql +5 -0
  598. package/modules/notifications/migrations/0011_notifications_retention_keyset.up.sql +15 -0
  599. package/modules/notifications/migrations/0012_notifications_email_channel.down.sql +12 -0
  600. package/modules/notifications/migrations/0012_notifications_email_channel.up.sql +38 -0
  601. package/modules/notifications/migrations/0013_notifications_list_pages.down.sql +5 -0
  602. package/modules/notifications/migrations/0013_notifications_list_pages.up.sql +13 -0
  603. package/modules/notifications/migrations/README.md +3 -0
  604. package/modules/notifications/module.json +32 -0
  605. package/modules/notifications/package.json +49 -0
  606. package/modules/notifications/spec/module.yaml +718 -0
  607. package/modules/notifications/src/acl/permissions.ts +11 -0
  608. package/modules/notifications/src/api/endpoints.ts +814 -0
  609. package/modules/notifications/src/cli/commands.json +17 -0
  610. package/modules/notifications/src/cli/index.ts +126 -0
  611. package/modules/notifications/src/client/DeliveriesView.tsrx +483 -0
  612. package/modules/notifications/src/client/FactList.tsrx +24 -0
  613. package/modules/notifications/src/client/NotificationPreferencesView.tsrx +240 -0
  614. package/modules/notifications/src/client/NotificationsInboxView.tsrx +592 -0
  615. package/modules/notifications/src/client/UnreadCountWidget.tsrx +62 -0
  616. package/modules/notifications/src/client/WebhookForm.tsrx +297 -0
  617. package/modules/notifications/src/client/WebhooksView.tsrx +637 -0
  618. package/modules/notifications/src/client/api.ts +382 -0
  619. package/modules/notifications/src/client/contribution.tsrx +83 -0
  620. package/modules/notifications/src/client/inbox.ts +41 -0
  621. package/modules/notifications/src/client/index.ts +29 -0
  622. package/modules/notifications/src/client/navigation.ts +92 -0
  623. package/modules/notifications/src/client/notifications.css +70 -0
  624. package/modules/notifications/src/client/presentation.ts +81 -0
  625. package/modules/notifications/src/client/state.ts +246 -0
  626. package/modules/notifications/src/client/unread-count.ts +26 -0
  627. package/modules/notifications/src/domain/locale.ts +47 -0
  628. package/modules/notifications/src/domain/publish.ts +46 -0
  629. package/modules/notifications/src/domain/types.ts +186 -0
  630. package/modules/notifications/src/index.ts +62 -0
  631. package/modules/notifications/src/platform.ts +85 -0
  632. package/modules/notifications/src/server/index.ts +82 -0
  633. package/modules/notifications/src/server/runtime.ts +251 -0
  634. package/modules/notifications/src/services/data-classes.ts +139 -0
  635. package/modules/notifications/src/services/database-repository.ts +1334 -0
  636. package/modules/notifications/src/services/delivery-payload.ts +93 -0
  637. package/modules/notifications/src/services/delivery-runner.ts +170 -0
  638. package/modules/notifications/src/services/delivery-service.ts +811 -0
  639. package/modules/notifications/src/services/egress.ts +239 -0
  640. package/modules/notifications/src/services/email-channel.ts +93 -0
  641. package/modules/notifications/src/services/index.ts +23 -0
  642. package/modules/notifications/src/services/migration.ts +572 -0
  643. package/modules/notifications/src/services/notifications-service.ts +297 -0
  644. package/modules/notifications/src/services/paging.ts +60 -0
  645. package/modules/notifications/src/services/publish-service.ts +133 -0
  646. package/modules/notifications/src/services/repository.ts +342 -0
  647. package/modules/notifications/src/services/secret-rotation.ts +177 -0
  648. package/modules/notifications/src/services/secret-vault.ts +168 -0
  649. package/modules/notifications/src/services/service-error.ts +67 -0
  650. package/modules/notifications/src/services/signature.ts +81 -0
  651. package/modules/notifications/src/services/webhook-service.ts +307 -0
  652. package/modules/notifications/src/settings.ts +130 -0
  653. package/modules/notifications/translations/en.json +255 -0
  654. package/modules/notifications/translations/pl.json +255 -0
  655. package/modules/profile/module.json +3 -3
  656. package/modules/profile/package.json +2 -2
  657. package/modules/profile/spec/module.yaml +3 -3
  658. package/modules/profile/src/services/database-repository.ts +3 -13
  659. package/modules/reports/module.json +28 -0
  660. package/modules/reports/package.json +42 -0
  661. package/modules/reports/spec/module.yaml +231 -0
  662. package/modules/reports/src/acl/permissions.ts +5 -0
  663. package/modules/reports/src/api/endpoints.ts +72 -0
  664. package/modules/reports/src/client/ReportsSummaryWidget.tsrx +52 -0
  665. package/modules/reports/src/client/ReportsView.tsrx +246 -0
  666. package/modules/reports/src/client/api.ts +65 -0
  667. package/modules/reports/src/client/contribution.tsrx +36 -0
  668. package/modules/reports/src/client/index.ts +18 -0
  669. package/modules/reports/src/client/navigation.ts +39 -0
  670. package/modules/reports/src/client/presentation.ts +123 -0
  671. package/modules/reports/src/client/state.ts +28 -0
  672. package/modules/reports/src/domain/providers.ts +115 -0
  673. package/modules/reports/src/domain/types.ts +44 -0
  674. package/modules/reports/src/index.ts +47 -0
  675. package/modules/reports/src/platform.ts +37 -0
  676. package/modules/reports/src/server/index.ts +21 -0
  677. package/modules/reports/src/server/runtime.ts +40 -0
  678. package/modules/reports/src/services/index.ts +17 -0
  679. package/modules/reports/src/services/provider-registry.ts +144 -0
  680. package/modules/reports/src/services/range.ts +65 -0
  681. package/modules/reports/src/services/reports-service.ts +316 -0
  682. package/modules/reports/src/services/service-error.ts +26 -0
  683. package/modules/reports/src/settings.ts +49 -0
  684. package/modules/reports/translations/en.json +35 -0
  685. package/modules/reports/translations/pl.json +35 -0
  686. package/modules/sandbox/module.json +4 -4
  687. package/modules/sandbox/package.json +2 -2
  688. package/modules/sandbox/spec/module.yaml +3 -3
  689. package/modules/sandbox/src/services/database-repository.ts +14 -23
  690. package/modules/sandbox/src/services/directory.ts +16 -0
  691. package/modules/sandbox/src/services/sandbox-service.ts +13 -11
  692. package/modules/search/migrations/0001_search_core.down.sql +1 -0
  693. package/modules/search/migrations/0001_search_core.up.sql +22 -0
  694. package/modules/search/migrations/0002_search_recent_export.down.sql +3 -0
  695. package/modules/search/migrations/0002_search_recent_export.up.sql +5 -0
  696. package/modules/search/migrations/README.md +3 -0
  697. package/modules/search/module.json +28 -0
  698. package/modules/search/package.json +43 -0
  699. package/modules/search/spec/module.yaml +177 -0
  700. package/modules/search/src/acl/permissions.ts +5 -0
  701. package/modules/search/src/api/endpoints.ts +221 -0
  702. package/modules/search/src/client/SearchView.tsrx +346 -0
  703. package/modules/search/src/client/api.ts +157 -0
  704. package/modules/search/src/client/contribution.tsrx +31 -0
  705. package/modules/search/src/client/index.ts +17 -0
  706. package/modules/search/src/client/navigation.ts +97 -0
  707. package/modules/search/src/client/search.css +56 -0
  708. package/modules/search/src/client/state.ts +113 -0
  709. package/modules/search/src/domain/data-classes.ts +73 -0
  710. package/modules/search/src/domain/providers.ts +88 -0
  711. package/modules/search/src/domain/types.ts +56 -0
  712. package/modules/search/src/index.ts +46 -0
  713. package/modules/search/src/platform.ts +42 -0
  714. package/modules/search/src/server/index.ts +25 -0
  715. package/modules/search/src/server/runtime.ts +123 -0
  716. package/modules/search/src/services/database-repository.ts +163 -0
  717. package/modules/search/src/services/index.ts +21 -0
  718. package/modules/search/src/services/migration.ts +65 -0
  719. package/modules/search/src/services/provider-registry.ts +137 -0
  720. package/modules/search/src/services/repository.ts +43 -0
  721. package/modules/search/src/services/search-service.ts +442 -0
  722. package/modules/search/src/services/service-error.ts +35 -0
  723. package/modules/search/src/settings.ts +68 -0
  724. package/modules/search/translations/en.json +45 -0
  725. package/modules/search/translations/pl.json +45 -0
  726. package/modules/system/module.json +2 -2
  727. package/modules/system/package.json +2 -2
  728. package/modules/system/spec/module.yaml +30 -3
  729. package/modules/system/src/client/FlagsPanel.tsrx +127 -0
  730. package/modules/system/src/client/ModuleSettingRow.tsrx +17 -7
  731. package/modules/system/src/client/ModuleSettingsSection.tsrx +10 -71
  732. package/modules/system/src/client/ModulesView.tsrx +91 -65
  733. package/modules/system/src/client/flags.ts +35 -0
  734. package/modules/system/src/client/index.ts +8 -0
  735. package/modules/system/src/client/navigation.ts +8 -0
  736. package/modules/system/src/client/settings-state.ts +159 -0
  737. package/modules/system/src/client/state.ts +2 -0
  738. package/modules/system/src/domain/time-zone.ts +105 -0
  739. package/modules/system/src/index.ts +12 -0
  740. package/modules/system/src/platform.ts +5 -1
  741. package/modules/system/src/server/endpoints.ts +72 -21
  742. package/modules/system/src/settings.ts +28 -0
  743. package/modules/system/translations/en.json +17 -0
  744. package/modules/system/translations/pl.json +17 -0
  745. package/modules/users/module.json +30 -4
  746. package/modules/users/package.json +5 -2
  747. package/modules/users/spec/module.yaml +290 -7
  748. package/modules/users/src/api/endpoints.ts +228 -15
  749. package/modules/users/src/client/InviteMemberForm.tsrx +2 -2
  750. package/modules/users/src/client/MemberDrawer.tsrx +142 -26
  751. package/modules/users/src/client/UserAccountForm.tsrx +2 -2
  752. package/modules/users/src/client/UsersView.tsrx +432 -71
  753. package/modules/users/src/client/api.ts +106 -12
  754. package/modules/users/src/client/contribution.tsrx +5 -0
  755. package/modules/users/src/client/member-columns.tsrx +22 -9
  756. package/modules/users/src/client/state.ts +172 -7
  757. package/modules/users/src/domain/lists.ts +9 -0
  758. package/modules/users/src/index.ts +11 -0
  759. package/modules/users/src/platform.ts +50 -1
  760. package/modules/users/src/services/member-export.ts +51 -0
  761. package/modules/users/src/services/member-import.ts +249 -0
  762. package/modules/users/src/services/member-search.ts +145 -0
  763. package/modules/users/src/services/users-service.ts +117 -4
  764. package/modules/users/translations/en.json +57 -8
  765. package/modules/users/translations/pl.json +57 -8
  766. package/modules/workflows/migrations/0004_payload_rotation_inventory.up.sql +17 -0
  767. package/modules/workflows/migrations/0005_workflows_human_approval.up.sql +28 -0
  768. package/modules/workflows/migrations/0006_workflows_retention_indexes.up.sql +11 -0
  769. package/modules/workflows/migrations/0007_workflows_erasure_subject_indexes.up.sql +17 -0
  770. package/modules/workflows/migrations/0008_workflows_subject_account.up.sql +24 -0
  771. package/modules/workflows/migrations/0009_workflows_definition_list_indexes.up.sql +9 -0
  772. package/modules/workflows/module.json +34 -6
  773. package/modules/workflows/package.json +3 -2
  774. package/modules/workflows/spec/module.yaml +26 -9
  775. package/modules/workflows/src/api/endpoints.ts +131 -25
  776. package/modules/workflows/src/cli/commands.json +17 -0
  777. package/modules/workflows/src/cli/index.ts +114 -0
  778. package/modules/workflows/src/client/WorkflowExecutionHistory.tsrx +36 -27
  779. package/modules/workflows/src/client/WorkflowInspector.tsrx +116 -0
  780. package/modules/workflows/src/client/WorkflowNodePalette.tsrx +1 -0
  781. package/modules/workflows/src/client/WorkflowsView.tsrx +236 -99
  782. package/modules/workflows/src/client/api.ts +54 -34
  783. package/modules/workflows/src/client/canvas-model.ts +12 -0
  784. package/modules/workflows/src/client/state.ts +95 -0
  785. package/modules/workflows/src/domain/events.ts +25 -11
  786. package/modules/workflows/src/domain/graph.ts +135 -1
  787. package/modules/workflows/src/domain/types.ts +91 -4
  788. package/modules/workflows/src/platform.ts +12 -0
  789. package/modules/workflows/src/server/runtime.ts +78 -5
  790. package/modules/workflows/src/services/approvals.ts +62 -0
  791. package/modules/workflows/src/services/cursors.ts +37 -0
  792. package/modules/workflows/src/services/data-classes.ts +232 -0
  793. package/modules/workflows/src/services/database-repository.ts +660 -171
  794. package/modules/workflows/src/services/migration.ts +240 -0
  795. package/modules/workflows/src/services/notifications.ts +98 -0
  796. package/modules/workflows/src/services/payload-codec.ts +51 -28
  797. package/modules/workflows/src/services/payload-rotation.ts +171 -0
  798. package/modules/workflows/src/services/repository.ts +123 -8
  799. package/modules/workflows/src/services/simulation.ts +7 -0
  800. package/modules/workflows/src/services/worker.ts +446 -25
  801. package/modules/workflows/src/services/workflows-service.ts +264 -103
  802. package/modules/workflows/translations/en.json +12 -4
  803. package/modules/workflows/translations/pl.json +12 -4
  804. package/modules.json +48 -4
  805. package/package.json +66 -7
  806. package/packages/client/package.json +2 -1
  807. package/packages/client/src/ApplicationShell.tsrx +43 -0
  808. package/packages/client/src/contributions.ts +55 -0
  809. package/packages/client/src/i18n/locales/en.json +5 -0
  810. package/packages/client/src/i18n/locales/pl.json +5 -0
  811. package/packages/client/src/index.ts +13 -1
  812. package/packages/client/src/routing.ts +22 -0
  813. package/packages/client/src/shell/CommandPalette.tsrx +223 -11
  814. package/packages/client/src/shell/command-search.ts +126 -0
  815. package/packages/client/src/shell/command.ts +30 -0
  816. package/packages/client/src/shell/navigation.ts +12 -0
  817. package/packages/client/src/shell/palette-keys.ts +27 -0
  818. package/packages/client/src/shell/shell.css +7 -0
  819. package/packages/contracts/schemas/module-spec.schema.json +287 -1
  820. package/packages/contracts/schemas/module.schema.json +25 -0
  821. package/packages/contracts/src/index.ts +144 -1
  822. package/packages/database/src/backup.ts +179 -0
  823. package/packages/database/src/decoders.ts +25 -0
  824. package/packages/database/src/index.ts +17 -0
  825. package/packages/database/src/record-history.ts +5 -14
  826. package/packages/dev-console/package.json +2 -1
  827. package/packages/dev-console/src/brand.d.mts +8 -0
  828. package/packages/dev-console/src/brand.mjs +33 -0
  829. package/packages/dev-console/src/index.mjs +2 -1
  830. package/packages/harness/src/index.ts +2 -0
  831. package/packages/harness/src/runtime.ts +218 -1
  832. package/packages/harness/src/tool-adapters.ts +19 -1
  833. package/packages/kernel/src/acl.ts +179 -0
  834. package/packages/kernel/src/capability-registry.ts +69 -2
  835. package/packages/kernel/src/data-class-registry.ts +354 -0
  836. package/packages/kernel/src/index.ts +65 -4
  837. package/packages/kernel/src/keyring.ts +208 -0
  838. package/packages/kernel/src/module-compatibility.ts +35 -4
  839. package/packages/kernel/src/module-registry.ts +49 -2
  840. package/packages/kernel/src/module-settings.ts +189 -27
  841. package/packages/server/package.json +2 -1
  842. package/packages/server/src/composition.ts +38 -0
  843. package/packages/server/src/endpoint.ts +104 -47
  844. package/packages/server/src/export/csv.ts +34 -0
  845. package/packages/server/src/export/definition.ts +346 -0
  846. package/packages/server/src/export/index.ts +61 -0
  847. package/packages/server/src/export/run.ts +116 -0
  848. package/packages/server/src/index.ts +155 -0
  849. package/packages/server/src/jobs/index.ts +93 -0
  850. package/packages/server/src/jobs/runner.ts +486 -0
  851. package/packages/server/src/log.ts +291 -0
  852. package/packages/server/src/mail/config.ts +184 -0
  853. package/packages/server/src/mail/contracts.ts +251 -0
  854. package/packages/server/src/mail/index.ts +31 -0
  855. package/packages/server/src/mail/port.ts +101 -0
  856. package/packages/server/src/mail/smtp.ts +191 -0
  857. package/packages/server/src/mail/template.ts +105 -0
  858. package/packages/server/src/metrics.ts +447 -0
  859. package/packages/server/src/pagination.ts +246 -0
  860. package/packages/server/src/trace/context.ts +103 -0
  861. package/packages/server/src/trace/egress.ts +66 -0
  862. package/packages/server/src/trace/error-sink.ts +296 -0
  863. package/packages/server/src/trace/exporter.ts +295 -0
  864. package/packages/server/src/trace/index.ts +60 -0
  865. package/packages/server/src/trace/job-sink.ts +172 -0
  866. package/packages/server/src/trace/tracer.ts +338 -0
  867. package/packages/server/src/web.ts +5 -1
  868. package/packages/storage/package.json +40 -0
  869. package/packages/storage/src/config.ts +189 -0
  870. package/packages/storage/src/content-type.ts +124 -0
  871. package/packages/storage/src/contracts.ts +112 -0
  872. package/packages/storage/src/envelope.ts +189 -0
  873. package/packages/storage/src/index.ts +43 -0
  874. package/packages/storage/src/local.ts +75 -0
  875. package/packages/storage/src/port.ts +251 -0
  876. package/packages/storage/src/read-token.ts +130 -0
  877. package/packages/storage/src/s3.ts +144 -0
  878. package/packages/storage/src/scanner.ts +22 -0
  879. package/packages/storage/src/sigv4.ts +104 -0
  880. package/packages/storage/src/store.ts +13 -0
  881. package/packages/ui/package.json +1 -0
  882. package/packages/ui/src/components/Button.tsrx +3 -0
  883. package/packages/ui/src/components/ConfirmDialog.tsrx +13 -2
  884. package/packages/ui/src/components/DateField.tsrx +92 -0
  885. package/packages/ui/src/components/DatePicker.tsrx +525 -0
  886. package/packages/ui/src/components/DateRangeField.tsrx +93 -0
  887. package/packages/ui/src/components/Drawer.tsrx +10 -1
  888. package/packages/ui/src/components/FileUpload.tsrx +158 -0
  889. package/packages/ui/src/components/Pagination.tsrx +130 -0
  890. package/packages/ui/src/components/Select.tsrx +78 -0
  891. package/packages/ui/src/components/Table.tsrx +498 -81
  892. package/packages/ui/src/components/Tabs.tsrx +53 -0
  893. package/packages/ui/src/components/ToastHost.tsrx +48 -0
  894. package/packages/ui/src/components/calendar.ts +243 -0
  895. package/packages/ui/src/components/date-field.ts +62 -0
  896. package/packages/ui/src/components/file-upload.ts +49 -0
  897. package/packages/ui/src/components/focus-trap.ts +62 -0
  898. package/packages/ui/src/components/pagination.ts +68 -0
  899. package/packages/ui/src/components/table-sorting.ts +49 -0
  900. package/packages/ui/src/components/tabs.ts +61 -0
  901. package/packages/ui/src/components/toast-store.ts +116 -0
  902. package/packages/ui/src/icons/Icon.tsrx +5 -0
  903. package/packages/ui/src/index.ts +45 -0
  904. package/packages/ui/src/styles/components.css +598 -0
  905. package/modules/automations-workflows-integration/module.json +0 -27
  906. package/modules/automations-workflows-integration/spec/module.yaml +0 -93
  907. package/modules/automations-workflows-integration/src/index.ts +0 -14
  908. package/modules/automations-workflows-integration/src/platform.ts +0 -24
  909. package/modules/automations-workflows-integration/src/server/index.ts +0 -11
  910. package/modules/automations-workflows-integration/translations/en.json +0 -21
  911. package/modules/automations-workflows-integration/translations/pl.json +0 -21
  912. package/modules/workflows/src/services/cursor-codec.ts +0 -62
@@ -1,6 +1,6 @@
1
- schemaVersion: 1
1
+ schemaVersion: 2
2
2
  id: auth.core
3
- specVersion: 0.10.0
3
+ specVersion: 0.13.10
4
4
  status: approved
5
5
  name: Authentication Core
6
6
  description: Provides tenant-aware accounts, password authentication, sessions, scopes, tenant roles, API tokens for machine clients, the module settings store, the auth audit trail, security headers, authentication screens, and server authorization middleware.
@@ -13,7 +13,7 @@ capabilities:
13
13
  - cli
14
14
  dependencies:
15
15
  - id: system.core
16
- range: 0.5.0
16
+ range: ^0.7.0
17
17
  tenancy: required
18
18
  locales:
19
19
  - en
@@ -28,7 +28,19 @@ invariants:
28
28
  - Switching tenant context rotates the session and loads scopes from the target membership.
29
29
  - Authorization is evaluated server-side and missing scopes are denied.
30
30
  - Sign-up availability is controlled by the auth.allowSignUp module setting and is enforced by both the API and client.
31
+ - An account may hold no password at all. The administration port creates such a member with an unusable credential marker rather than a placeholder secret, so nothing was drawn that could be guessed or leaked. A password sign-in for it is refused exactly as an unregistered address is, with the same code and the same derivation cost, so the refusal never reports which addresses exist and hold no password yet; the public reset flow and an administrative temporary password both set the first one, an external identity signs the account in unchanged, and a self-service credential change is refused with PASSWORD_NOT_SET, which only a caller already authenticated as the account can reach.
32
+ - The administration port answers the members of one workspace by address and by search term in the database. A lookup names at most 500 addresses, folded the way a stored address is folded and bound as one array parameter; a search pushes its term and a limit of 1 to 500 into SQL as a display-name prefix or an address prefix, and a byte-ordered expression index covers both, so a keystroke reads the rows the prefix matched rather than the workspace. The display name was matched anywhere until then; a containment is a range no btree answers, so a term inside a name no longer matches. A caller therefore never lists a workspace of unknown size to find the members it already named, and a LIKE wildcard in a term is matched as a character.
33
+ - The audit query takes an optional inclusive from and to in epoch milliseconds, applied in SQL beside the action, the actor and the keyset cursor and answered by the same (tenant_id, occurred_at, id) index, so a reader of a date window states the window instead of seeding the cursor at its ceiling and watching for its floor. An absent end is open; a bound that is no epoch millisecond, and a window that ends before it starts, are refused with a stable code before the read.
34
+ - listExternalIdentities answers one bounded page of the identity bindings a workspace's own providers assert, keyset ordered by provider and subject over the unique workspace index. A binding names the account, the provider key, the subject the provider keeps stable and when it was first recorded, and never a token, a secret, a ciphertext, a fingerprint or the address the provider reported. A binding a platform provider made carries no workspace and is not answered; the read is scoped to the workspace it is given, and the permission a reader needs is the calling module's to enforce at its own endpoint.
35
+ - listTenantMembers keeps its unbounded roll for the callers that hold a workspace of known size and gains a paged form of 1 to 500 members, keyset ordered by account id and answering the cursor of the next page, so a caller may walk a workspace of unknown size without reading it in one statement. Migration 0030 indexes (tenant_id, account_id), which is the order that walk reads.
36
+ - listTenantMembersSorted answers one page of 1 to 500 members of one workspace in the order a screen shows them, by display name folded to lower case or by the folded address, ascending or descending, keyset on that column and the account id, narrowed in SQL by a display-name or address prefix the way the search narrows and by membership status, and answers the keyset of its last member only when the page is full; a caller carries that keyset back to continue and the paged walk by account id stays for exports. Migration 0033 indexes (lower(display_name), id) and (email_normalized, id) on auth_accounts, where both sort columns live, because the account carries no workspace column and the workspace is bound through the membership join.
37
+ - A workspace created after a module was enabled receives that module's permissions only through the seed lists in acl/scopes.ts, because auth sync-scopes reaches the workspaces that exist when it runs and no later one. A permission an enabled module declares and OWNER_SCOPES does not carry is therefore a defect, and a guard test compares the two against every enabled module specification of flowdular.json, checks what each permissions decision says members hold, and names the declarations still open so none is added silently.
38
+ - auth.core erases one subject inside one workspace. The sessions and the API tokens that subject holds there are removed outright, live ones included, and the same subject's rows in another workspace are untouched. A call removes at most its batch and reports truncated when it filled one, so the caller comes back rather than believing the class complete. The authentication audit events declare no erase, because the audit specification excludes them as the evidence the data lifecycle happened; retention bounds them instead.
39
+ - Every data class export walks one workspace by keyset over (tenant_id, id), and an index covers that pair on the sessions, the API tokens and the audit events, so a page is the rows it returns rather than a sort of the workspace.
31
40
  - Bundled module scopes are assigned from explicit owner and member defaults and migrated for existing tenant memberships.
41
+ - The built-in owner role carries the enterprise module scopes directory.tokens.read, directory.tokens.manage, directory.provisioning.read, audit.registry.read, audit.retention.manage, approvals.requests.read, approvals.requests.decide, approvals.requests.manage, documents.files.read, documents.files.manage, metering.usage.read, import.jobs.read, import.jobs.manage, search.records.read, connectors.instances.read and connectors.instances.manage, and the built-in member role carries documents.files.read, documents.files.manage, search.records.read, connectors.instances.read, approvals.requests.read and approvals.requests.decide, because a member decides the requests their role makes them eligible for.
42
+ - The built-in owner role carries reports.workspace.read, exports.lists.read, exports.lists.manage, access.review.read and access.review.manage, and the built-in member role carries none of them, because a workspace report composes spend, usage and volume across modules (D-REPORTS-AUDIENCE), an access review names every scope, token and provider of the workspace (D-OWNERS-ONLY), and the export decision states what starting an export and opening a file require of the live principal rather than granting a role anything (D-EXPORTS-PERMISSIONS). Migration 0029 grants the five to the owner memberships and the built-in owner role row of every workspace that already exists, and to no member membership and no member role row.
43
+ - auth.core declares the workspace data it keeps by age as data classes, when the platform hands it the registry. auth.core.sessions is kept for 30 days, auth.core.api-tokens and auth.core.audit-events for 400 days. Each is exportable and swept in bounded batches inside its own tenant transaction; a sweep removes only a session that already expired and a credential already revoked or expired, and no export carries a session token hash, a CSRF token or an API token hash. Memberships, membership scopes, roles, identity providers and module settings are configuration rather than swept classes.
32
44
  - An API token is a tenant-scoped machine credential bound to one membership. Only its hash is stored, the raw value is returned exactly once at creation, and it is never recoverable afterwards.
33
45
  - API token authority is the intersection of its recorded scopes with the live membership scopes at every request. Revoking a scope or disabling the membership takes effect immediately without touching the token.
34
46
  - An API token can never pass a session-guarded mutation. Requests carrying a token instead of a browser session are denied before the handler runs.
@@ -41,16 +53,35 @@ invariants:
41
53
  - Every tenant carries the built-in owner and member roles as rows; custom roles are tenant-scoped, grant only grantable scopes, and cannot be edited, deleted, or shadowed when built in or in use.
42
54
  - Assigning a role replaces the membership scopes with the role's scopes and keeps the role key on the membership in sync.
43
55
  - Module settings are declared by their owning module, stored per tenant (or once for the platform), validated against the declaration on every write, and secret values are never returned.
56
+ - Every committed module settings change appends exactly one audit event. A setting declared as a feature flag is recorded as settings.flag.changed, carrying the module, the key, the previous and next effective values and the actor; every other setting is recorded as settings.updated, carrying the module, the key, whether the value was cleared and the actor. No declared value of a non-flag setting and no secret value ever reaches the trail.
44
57
  - Email confirmation cannot be enabled without a composed mail transport.
45
58
  - Password reset and tenant invitation tokens are random, hashed at rest, short lived, single use, and never returned by HTTP APIs.
46
59
  - Operator provisioning creates a workspace, its owner and the owner scopes exactly as sign-up does, works against the deployment database, and never reads the sign-up setting.
47
60
  - An operator command never returns a password the operator did not supply. It emits a single-use setup or invitation link once, and a supplied password is read from the environment rather than from a command flag.
48
61
  - Every operator provisioning command appends an audit row whose actor identifies the operator shell that ran it.
62
+ - An audit row records its actor as one of the kernel kinds user, agent or service. An operator command and an identity provider are service actors, an account id is stored for a user only, an agent row names its run, and a service row stores the user who configured it, or null when that user is not stored, as an identity provider's is not.
49
63
  - TOTP secrets are encrypted with a deployment-provided AES-256 key; a successful password check creates a short-lived, single-use MFA challenge rather than a session.
64
+ - Every stored TOTP secret records the id of the key that sealed it, and a factor sealed before that id existed stays readable. Retired keys listed in FD_AUTH_MFA_KEY_PREVIOUS open stored factors and seal nothing, and the operator rotation re-seals the stale rows in bounded batches without clobbering a factor re-enrolled while it runs.
65
+ - A workspace whose auth.core.requireMfa setting is on answers no workspace API and no module web page to a member without a confirmed second factor; a web page resolves no identity for that member and answers 401. Only the platform health and readiness probes, the public sign-in configuration, the account routes that complete enrolment, change the password, switch workspace, or sign out, the settings read, and the settings write whose body targets auth.core.requireMfa stay open; every other settings write is held like any other workspace API. The refusal is the stable MFA_ENROLMENT_REQUIRED problem, and the setting binds the workspace it is stored for and no other.
66
+ - An API token is exempt from the enrolment requirement, because a service account cannot enrol and its authority is already the intersection of its recorded scopes with the live membership. Browser sessions stay gated.
67
+ - The requireMfa setting cannot be turned on without a deployment MFA encryption key. The write is refused with MFA_KEY_REQUIRED, the way email confirmation is refused without a composed mail transport, so a workspace can never close itself with no way back.
68
+ - Clearing another account's second factor requires the member management scope on a browser session, resolves the target inside the acting workspace, removes the factor together with every recovery code, and appends an audit row naming the actor and the target. An account of another workspace answers exactly as an unknown one.
69
+ - An external sign-in is accepted only after the provider ID token is verified against the key set discovered under the configured issuer, covering the signature, the issuer, the audience, an expiry and issue time within five minutes, and the nonce bound to the signed state cookie. A provider without a configured issuer is refused at boot.
70
+ - An external identity is the provider subject. It is stored on the account at the first sign-in and resolves the account afterwards; the reported address only bootstraps that first link, and an account already bound to another subject of the same provider is never re-bound.
71
+ - A password must clear the configured minimum length, must not be one of the hundred most common passwords, and must not contain the local part of the account address.
50
72
  - External email delivery is an injected deployment adapter. The local in-memory adapter is development-only and never exposes tokens over HTTP or logs.
73
+ - Every auth.core message is worded in the default locale of the workspace it concerns, read from that workspace's auth.core.defaultLocale setting when the message is sent, and declares that locale; a locale the module ships no bundle for is rendered as English and declares en.
74
+ - The mail transport is chosen by deployment configuration, either none, the in-memory development adapter outside production, or an SMTP relay. A misconfigured transport refuses the boot by naming the variable, and the relay URL and its credentials never reach a response, a log line, or an audit row.
51
75
  - Authentication and administration events are appended to an auth audit trail that is readable per tenant and never contains credentials or raw tokens.
52
76
  - Every request-time read and write runs on a tenant-scoped database handle, under forced row-level security bound to the transaction tenant.
53
77
  - A lookup that arrives with a key and no workspace, such as a session cookie, a bearer token, an invitation link or an email address, resolves the owning tenant on a read-only cross-tenant handle that is granted only the routing columns, and the work that follows runs under the tenant that lookup named.
78
+ - An OIDC identity provider is either platform-scoped, read from FD_AUTH_OIDC_PROVIDERS at boot and available read-only to every workspace, or tenant-owned, stored in an auth table under forced row-level security and managed only by a principal holding auth.providers.manage in that workspace.
79
+ - A tenant-owned provider's client secret is generated or entered once, sealed with the auth module keyring under a provider-specific context, rotatable through auth secrets-rotate, returned to nobody after creation, and represented to administrators by its fingerprint alone.
80
+ - Sign-in is routed by the workspace the person is entering, so the sign-in screen resolves a workspace from the URL or a typed workspace id and offers only that workspace's enabled providers plus the password form; the platform never discovers workspaces from an e-mail address.
81
+ - An external identity is bound per workspace, provider and subject. A tenant-owned provider can sign an account into its own workspace only; it never grants access to another workspace, and an account already bound to another subject of the same provider in the same workspace is never re-bound.
82
+ - Just-in-time provisioning is off by default and is enabled per provider together with a required list of allowed e-mail domains and the built-in or custom role a new member receives; without JIT, an external sign-in requires an existing membership, and with JIT a verified address outside the allowed domains is refused before any account or membership is written.
83
+ - Just-in-time provisioning reuses an existing account only when that account holds no other membership; an address that already belongs to a member of another workspace is refused with a stable error and the workspace invites the person instead, so a tenant-owned provider can never absorb an account that other workspaces rely on.
84
+ - Membership status is per workspace, so disabling a member in one workspace revokes that membership's sessions and API tokens and refuses its sign-in, leaves the person's other memberships untouched, and the global account status remains the deployment operator's platform-level block.
54
85
  permissions:
55
86
  - id: auth.profile.read
56
87
  description: Read the current account profile.
@@ -70,12 +101,282 @@ permissions:
70
101
  description: Create, change, and delete custom tenant roles.
71
102
  - id: auth.audit.read
72
103
  description: Read the authentication and administration audit trail of the active tenant.
104
+ - id: auth.providers.read
105
+ description: Read the identity providers of the active workspace without their secrets.
106
+ - id: auth.providers.manage
107
+ description: Create, change, enable, disable, rotate and delete tenant-owned identity providers of the active workspace.
73
108
  dataOwnership:
109
+ - auth.core owns tenant-owned identity providers, their sealed client secrets, the per-workspace external identity bindings and the per-membership status; users.core renders the membership status control and calls the auth administration port.
74
110
  - Accounts, tenant memberships, scope grants, and hashed sessions are owned by auth.core.
75
111
  - API token identity, hashed secret, recorded scopes, expiry, revocation state, and last use are owned by auth.core.
76
112
  - Tenant roles, sign-in failure counters, module settings values, and the auth audit trail are owned by auth.core.
77
113
  - Other modules may reference account and tenant identifiers but may not write authentication tables.
114
+ entities:
115
+ - id: identity-provider
116
+ name: Identity provider
117
+ description: A tenant-owned OIDC provider a workspace offers on its sign-in screen; platform providers from the environment are listed alongside, read-only.
118
+ fields:
119
+ - id: key
120
+ type: string
121
+ required: true
122
+ unique: tenant
123
+ maxLength: 64
124
+ description: The stable identifier used in the sign-in URL for this workspace; lower-case letters, digits and hyphens.
125
+ - id: label
126
+ type: string
127
+ required: true
128
+ maxLength: 120
129
+ - id: issuer
130
+ type: string
131
+ required: true
132
+ maxLength: 2048
133
+ description: The https issuer whose discovery document names it back; verified as today.
134
+ - id: clientId
135
+ type: string
136
+ required: true
137
+ maxLength: 256
138
+ - id: secretFingerprint
139
+ type: string
140
+ required: true
141
+ maxLength: 32
142
+ description: Truncated SHA-256 of the sealed client secret; the secret itself is never readable.
143
+ - id: scopes
144
+ type: json
145
+ required: true
146
+ description: Array of OIDC scopes requested at authorization; openid and email are always included.
147
+ - id: jitEnabled
148
+ type: boolean
149
+ required: true
150
+ - id: allowedDomains
151
+ type: json
152
+ required: true
153
+ description: Array of lower-case e-mail domains; required non-empty when jitEnabled is true.
154
+ - id: jitRole
155
+ type: string
156
+ required: true
157
+ maxLength: 64
158
+ description: The role key a provisioned member receives; must be a role of the workspace.
159
+ - id: status
160
+ type: enum
161
+ required: true
162
+ values:
163
+ - active
164
+ - disabled
165
+ states:
166
+ field: status
167
+ values:
168
+ - active
169
+ - disabled
170
+ transitions:
171
+ - from: active
172
+ to: disabled
173
+ permission: auth.providers.manage
174
+ - from: disabled
175
+ to: active
176
+ permission: auth.providers.manage
177
+ - id: external-identity
178
+ name: External identity binding
179
+ description: The provider subject bound to an account inside one workspace; platform providers bind without a workspace, as today.
180
+ fields:
181
+ - id: provider
182
+ type: string
183
+ required: true
184
+ maxLength: 64
185
+ - id: subject
186
+ type: string
187
+ required: true
188
+ maxLength: 256
189
+ - id: accountId
190
+ type: string
191
+ required: true
192
+ maxLength: 128
193
+ - id: membership
194
+ name: Membership
195
+ description: The existing account membership of a workspace, extended with its own status.
196
+ fields:
197
+ - id: accountId
198
+ type: string
199
+ required: true
200
+ maxLength: 128
201
+ - id: role
202
+ type: string
203
+ required: true
204
+ maxLength: 64
205
+ - id: status
206
+ type: enum
207
+ required: true
208
+ values:
209
+ - active
210
+ - disabled
211
+ states:
212
+ field: status
213
+ values:
214
+ - active
215
+ - disabled
216
+ transitions:
217
+ - from: active
218
+ to: disabled
219
+ permission: users.members.manage
220
+ - from: disabled
221
+ to: active
222
+ permission: users.members.manage
223
+ screens:
224
+ - id: identity-providers
225
+ kind: list
226
+ entity: identity-provider
227
+ title: Identity providers
228
+ columns:
229
+ - key
230
+ - label
231
+ - issuer
232
+ - status
233
+ - jitEnabled
234
+ - secretFingerprint
235
+ filters:
236
+ - status
237
+ navigationGroup: Administration
238
+ - id: identity-provider
239
+ kind: record
240
+ entity: identity-provider
241
+ title: Identity provider
242
+ columns:
243
+ - key
244
+ - label
245
+ - issuer
246
+ - clientId
247
+ - scopes
248
+ - jitEnabled
249
+ - allowedDomains
250
+ - jitRole
251
+ - status
252
+ - secretFingerprint
253
+ navigationGroup: Administration
254
+ actions:
255
+ - id: create-provider
256
+ entity: identity-provider
257
+ permission: auth.providers.manage
258
+ kind: create
259
+ risk: workspace-write
260
+ idempotent: false
261
+ description: Create an active tenant-owned provider; the client secret is accepted once in the request, sealed, and only its fingerprint is returned.
262
+ - id: update-provider
263
+ entity: identity-provider
264
+ permission: auth.providers.manage
265
+ kind: update
266
+ risk: workspace-write
267
+ idempotent: true
268
+ description: Change label, issuer, client id, scopes, JIT settings or role; a changed issuer is re-verified through discovery.
269
+ - id: rotate-provider-secret
270
+ entity: identity-provider
271
+ permission: auth.providers.manage
272
+ kind: custom
273
+ risk: workspace-write
274
+ idempotent: false
275
+ description: Accept a new client secret once, seal it and update the fingerprint.
276
+ - id: disable-provider
277
+ entity: identity-provider
278
+ permission: auth.providers.manage
279
+ kind: custom
280
+ risk: workspace-write
281
+ idempotent: true
282
+ description: Stop offering the provider on the sign-in screen; existing sessions stay valid.
283
+ - id: enable-provider
284
+ entity: identity-provider
285
+ permission: auth.providers.manage
286
+ kind: custom
287
+ risk: workspace-write
288
+ idempotent: true
289
+ description: Offer the provider again.
290
+ - id: delete-provider
291
+ entity: identity-provider
292
+ permission: auth.providers.manage
293
+ kind: delete
294
+ risk: destructive
295
+ idempotent: true
296
+ description: Delete a disabled provider and its bindings in this workspace; members keep their accounts and can sign in by password or another provider.
297
+ widgets: []
298
+ settings: []
299
+ agentTools: []
300
+ outOfScope:
301
+ - SCIM 2.0 users and groups provisioning is a separate module, directory.core, specified after this delivery lands, because per-membership status has to exist first.
302
+ - SAML and LDAP are not offered; a provider is OIDC with discovery.
303
+ - Discovering a workspace from an e-mail address is not offered; the person names the workspace first.
304
+ - E-mailing a provisioned member is deferred to the notifications delivery path once auth mail kinds are extended.
305
+ - Wording a message in a workspace's own custom phrasing is deferred; every auth.core message is rendered from the shipped locale bundles, so a workspace picks a language and never its own text.
306
+ decisions:
307
+ - id: D-G2-SCOPE
308
+ question: What does this G2 delivery contain?
309
+ answer: Tenant-owned providers, just-in-time provisioning and per-membership status in auth.core; SCIM as a later directory.core specification.
310
+ decidedBy: user
311
+ - id: D-G2-ROUTING
312
+ question: How is a sign-in routed to a workspace when providers are tenant-owned?
313
+ answer: Workspace first, then the providers of that workspace plus the password form; no discovery by e-mail address.
314
+ decidedBy: user
315
+ - id: D-G2-ACCOUNTS
316
+ question: One global account or identities per workspace?
317
+ answer: One global account with external identities bound per workspace, provider and subject; a tenant provider signs into its own workspace only.
318
+ decidedBy: user
319
+ - id: D-G2-JIT
320
+ question: What are the JIT defaults?
321
+ answer: Off by default; enabled per provider with a required allowed-domain list and the role for new members, member by default.
322
+ decidedBy: user
323
+ - id: D-G2-MEMBERSHIP-STATUS
324
+ question: Is member status global or per workspace?
325
+ answer: Per membership; the global account status stays as the deployment operator's block.
326
+ decidedBy: user
327
+ - id: D-G2-ENV-PROVIDERS
328
+ question: What happens to FD_AUTH_OIDC_PROVIDERS?
329
+ answer: Kept as platform-scoped providers available read-only to every workspace; tenants add their own.
330
+ decidedBy: user
331
+ - id: D-G2-JIT-REUSE
332
+ question: May JIT attach an existing account that already belongs to other workspaces?
333
+ answer: No. JIT reuses only an account with no other membership; otherwise the sign-in is refused and the workspace invites the person, because a tenant provider must not absorb an account other workspaces rely on.
334
+ decidedBy: default
335
+ - id: D-G2-SECRET-KEY
336
+ question: Which key seals tenant provider client secrets?
337
+ answer: The auth module keyring already used for TOTP secrets, under a provider-specific context, so auth secrets-rotate covers both and no new deployment key is introduced.
338
+ decidedBy: default
339
+ - id: D-G2-PERMISSIONS
340
+ question: Who manages tenant providers and membership status?
341
+ answer: Owners hold auth.providers.read and auth.providers.manage; members hold neither. Membership status changes are users.core actions behind users.members.manage, served by the auth administration port.
342
+ decidedBy: default
343
+ - id: D-G2-SCREENS
344
+ question: Which screens exist?
345
+ answer: An identity providers list and record drawer under Administration in auth.core; the membership status toggle lives in the users.core member drawer.
346
+ decidedBy: default
347
+ - id: D-G2-PROVIDER-KEY
348
+ question: What identifies a provider in the sign-in URL?
349
+ answer: A tenant-unique key; the callback path carries the workspace and the key, and the signed state cookie binds both.
350
+ decidedBy: default
78
351
  acceptanceScenarios:
352
+ - id: AUTH-MEMBER-NO-PASSWORD
353
+ given: An owner of a workspace creating a member through the administration port without a credential.
354
+ when: Someone tries to sign that member in with a password, the member completes the public reset flow, and the member tries to change their own password before it is set.
355
+ then: The sign-in is refused with the same code and the same work an unregistered address is refused with, the reset link sets the first password and signs the member in, the self-service change answers PASSWORD_NOT_SET, and the audit trail names the acting owner, the address, the role and that no credential was stored.
356
+ - id: AUTH-MEMBER-LOOKUP
357
+ given: Two workspaces each holding members, and a caller that names addresses rather than listing a workspace.
358
+ when: The caller looks members up by address, by a search term, with an address in another workspace, past the bound of 500 addresses, and with a LIKE wildcard or a quoting character in the input.
359
+ then: Only members of the named workspace are answered, the folded address matches whatever the caller typed, the search answers at most the limit it was given, over the bound is refused with INVALID_INPUT, and a wildcard or a quote is matched as a character rather than changing the statement.
360
+ - id: AUTH-SCOPE-COVERAGE
361
+ given: The enabled modules of flowdular.json and their specifications.
362
+ when: The declared permissions are compared with the owner and member seed lists of acl/scopes.ts.
363
+ then: Every declared permission an enabled module carries is in OWNER_SCOPES or is named in the open list the guard keeps, every permissions decision that says members hold a permission is held by MEMBER_SCOPES, and every one that says they hold none is absent from it.
364
+ - id: AUTH-AUDIT-HOLDS-SCOPE
365
+ given: A workspace created before audit.core declared audit.holds.manage, with an owner, a member and a role the workspace wrote itself.
366
+ when: The migration ledger is applied.
367
+ then: The owner membership and the built-in owner role row carry the permission without a duplicate of the ones they held, the member and the workspace's own role are untouched, and a membership of the same account in another workspace receives nothing.
368
+ - id: AUTH-WORKFLOW-AUTOMATION-PROFILE-SCOPES
369
+ given: A workspace created before the eleven permissions of workflows.core, automations.core and profile.core became owner defaults, with an owner, a member and a role the workspace wrote itself.
370
+ when: The migration ledger is applied.
371
+ then: The owner membership and the built-in owner role row carry all eleven without a duplicate of the ones they held, the member membership and the built-in member role row carry profile.self.manage and none of the other ten, the workspace's own role is untouched, and a member membership of the same account in another workspace receives profile.self.manage alone.
372
+ - id: AUTH-ERASE-SUBJECT
373
+ given: Two workspaces holding sessions and API tokens of the same subject, and a second subject in the first workspace.
374
+ when: The erasure of the first subject runs in the first workspace, once with a batch smaller than the rows it holds and again until it is done.
375
+ then: Only that subject's sessions and tokens in that workspace are removed, live ones included, the other subject and the other workspace keep theirs, a filled batch is reported truncated and the next call finishes, and the authentication audit events report no erase operation at all.
376
+ - id: AUTH-DATA-CLASSES
377
+ given: A workspace holding a session that expired long ago, a revoked API token, audit rows older than the retention period, a live session, a usable token and recent audit rows, beside a second workspace holding the same.
378
+ when: The platform sweeps and exports the auth.core data classes for the first workspace.
379
+ then: Only the expired session, the retired token and the audit rows older than the cutoff are removed, never more than the batch limit and never a row of the second workspace, and the export carries the remaining rows of the first workspace with no session token hash, CSRF token or API token hash.
79
380
  - id: AUTH-TOKEN-ISSUE
80
381
  given: An owner with auth.tokens.manage and an active browser session.
81
382
  when: The owner issues an API token with a label, a scope subset, and an optional expiry.
@@ -144,6 +445,10 @@ acceptanceScenarios:
144
445
  given: A module setting is written through the shared settings runtime by an identified actor.
145
446
  when: The value passes the declared validation and the write commits.
146
447
  then: The value is persisted in auth.db per tenant (or once for the platform), the next read returns it, and a settings.updated audit event records the actor, the setting, and whether the value was cleared.
448
+ - id: AUTH-SETTINGS-FLAG-AUDIT
449
+ given: A setting declared with kind flag is turned on or reset through the shared settings runtime by an identified actor.
450
+ when: The write commits.
451
+ then: One settings.flag.changed audit event is appended for the actor's workspace with the module, the key, the previous and next effective values and the actor, no settings.updated event is written for that change, and a failed audit write is reported without undoing the committed setting.
147
452
  - id: AUTH-WORKSPACE-SETTINGS
148
453
  given: An owner with system.settings.manage on Administration > Settings.
149
454
  when: The owner renames the workspace or picks a default locale.
@@ -168,10 +473,38 @@ acceptanceScenarios:
168
473
  given: A workspace administrator delivered a tenant invitation through the configured mail adapter.
169
474
  when: The invited person submits the unexpired, single-use token with account details.
170
475
  then: The account gains only the invited workspace role, the token cannot be reused, and no token appears in logs or audit metadata.
476
+ - id: AUTH-MAIL-SMTP
477
+ given: A deployment selects the smtp mail transport with a relay URL and a sender address.
478
+ when: The server boots and an invitation or a password reset is requested.
479
+ then: The message is relayed over that transport with a subject and the single-use link, a missing or malformed variable refuses the boot by naming it, and a delivery failure reports a stable error carrying neither the SMTP exchange nor the relay credentials.
171
480
  - id: AUTH-MFA-ENROLL
172
481
  given: An authenticated account and a configured MFA encryption key.
173
482
  when: The account enrolls a TOTP authenticator and confirms a valid rotating code.
174
483
  then: The secret stays encrypted at rest, recovery codes are returned only during enrollment, and future sign-in requires a TOTP or unused recovery code.
484
+ - id: AUTH-MFA-REQUIRED
485
+ given: A workspace whose auth.core.requireMfa setting is on and a member of it without a confirmed second factor.
486
+ when: The member calls a workspace API, then the routes that complete enrolment, and finally the same workspace API after confirming a factor.
487
+ then: The workspace API answers 403 MFA_ENROLMENT_REQUIRED, the enrolment routes answer normally and report that enrolment is required, the same member in a workspace that does not require it is unaffected, and the workspace API answers again once the factor is confirmed.
488
+ - id: AUTH-MFA-ADMIN-RESET
489
+ given: An administrator with the member management scope and a member of the same workspace with an enrolled factor and recovery codes.
490
+ when: The administrator confirms the reset from the member drawer.
491
+ then: The factor and every recovery code are removed, an auth.mfa.reset audit row names the actor and the target, the member can enrol again, and the same call from a member without the scope, without a session, without a CSRF proof, for the acting account itself, or for an account of another workspace is refused without revealing that the account exists.
492
+ - id: AUTH-MFA-KEY-ROTATE
493
+ given: Enrolled TOTP factors sealed with the current MFA encryption key, including rows written before the sealing key id was recorded.
494
+ when: The deployment boots with a new key in FD_AUTH_MFA_KEY and the old one in FD_AUTH_MFA_KEY_PREVIOUS, and an operator runs auth secrets-rotate without apply and then with it.
495
+ then: Sign-in challenges keep verifying throughout, the dry run counts the rows per key id and writes nothing, apply re-seals every stale row under the current key, a second run changes nothing, a key in neither slot is refused on the stable MFA_CONFIGURATION_INVALID error, and no output carries key material or an enrolled secret.
496
+ - id: AUTH-OIDC-VERIFY
497
+ given: An enabled OIDC provider with a configured issuer.
498
+ when: The provider returns an authorization code and the callback exchanges it.
499
+ then: The ID token is verified against the discovered key set for signature, issuer, audience, freshness and the nonce of this transaction, a failure of any of them ends the flow on the stable external sign-in error, and a provider configured without an issuer is refused at boot.
500
+ - id: AUTH-OIDC-SUBJECT
501
+ given: An account that has signed in once through an OIDC provider.
502
+ when: The provider reports another address for the same subject, or another subject for the same address.
503
+ then: The stored subject resolves the account in the first case, and the second case is refused on the external sign-in error without binding a second identity.
504
+ - id: AUTH-PASSWORD-DENYLIST
505
+ given: Any credential path that sets a password.
506
+ when: The submitted password is one of the hundred most common passwords, or contains the local part of the account address.
507
+ then: The password is refused with PASSWORD_TOO_COMMON or PASSWORD_CONTAINS_EMAIL, the minimum length keeps its own code, and an unrelated password of sufficient length is accepted.
175
508
  - id: AUTH-MFA-OIDC
176
509
  given: An account with confirmed TOTP signs in through an enabled, configured OIDC provider.
177
510
  when: The provider returns a verified email for that account.
@@ -188,3 +521,39 @@ acceptanceScenarios:
188
521
  given: An existing workspace in a deployment with public sign-up disabled.
189
522
  when: An operator adds an email address to that workspace with a role.
190
523
  then: A known account joins immediately with that role's scopes, an unknown address receives a single-use invitation link that is shown once, and either outcome is appended to the workspace audit trail with the operator as the actor.
524
+ - id: AUTH-PROVIDER-TENANT-CRUD
525
+ given: A principal holding auth.providers.manage supplies a unique key, a label, an https issuer that discovers itself, a client id and a client secret.
526
+ when: The provider is created, updated, disabled, enabled, rotated and deleted after disabling.
527
+ then: Each accepted transition is persisted under the workspace's forced policy, the secret is never readable after creation and only its fingerprint changes on rotation, deleting an active provider is refused, and a member without the permission is refused before repository access.
528
+ - id: AUTH-PLATFORM-PROVIDERS
529
+ given: A deployment configures FD_AUTH_OIDC_PROVIDERS.
530
+ when: Any workspace's providers are listed or its sign-in screen is rendered.
531
+ then: The platform providers appear read-only next to the workspace's own, cannot be changed through the workspace API, and keep binding identities without a workspace as before.
532
+ - id: AUTH-SIGNIN-WORKSPACE-ROUTING
533
+ given: Two workspaces with different tenant-owned providers.
534
+ when: A person opens the sign-in screen for one workspace by URL or by typing its id.
535
+ then: Only that workspace's enabled providers and the platform providers are offered, the authorization state names the workspace and the provider, and a callback whose state names another workspace is refused.
536
+ - id: AUTH-OIDC-TENANT-BINDING
537
+ given: A tenant-owned provider of workspace A has bound a subject to an account.
538
+ when: The same subject signs in through workspace A's provider again, and then a provider of workspace B asserts the same address.
539
+ then: The first sign-in resolves the account and opens a session in A only; the second is refused unless the account is already a member of B or B's provider provisions it, and it never opens a session in A.
540
+ - id: AUTH-JIT-PROVISION
541
+ given: A provider with JIT enabled, allowed domain example.com and role member.
542
+ when: A verified address at example.com without a membership signs in, and then an address at another domain does.
543
+ then: The first creates or reuses the account, creates an active member membership with the role's scopes and an audit row, and opens a session; the second is refused with a stable error before any write.
544
+ - id: AUTH-JIT-DISABLED
545
+ given: A provider with JIT disabled.
546
+ when: A verified address without a membership signs in.
547
+ then: The sign-in is refused with a stable error and no account or membership is written.
548
+ - id: AUTH-MEMBERSHIP-DISABLE
549
+ given: An account with active memberships in workspaces A and B and a session and an API token in each.
550
+ when: An administrator of A disables the membership in A and later re-enables it.
551
+ then: The sessions and tokens of A are revoked and sign-in into A is refused while B keeps working; after re-enabling, sign-in into A works and previous tokens stay revoked.
552
+ - id: AUTH-PROVIDER-SECRET-ROTATE
553
+ given: Tenant-owned providers sealed under the current auth key.
554
+ when: The deployment rotates the auth key with a previous key configured and runs auth secrets-rotate.
555
+ then: Every provider secret is re-sealed under the current key in bounded batches, sign-in through those providers keeps working throughout, and the report names no secret.
556
+ - id: AUTH-JIT-NO-ABSORPTION
557
+ given: A provider with JIT enabled and an address whose account is already a member of another workspace.
558
+ when: That address signs in through the provider without a membership here.
559
+ then: The sign-in is refused with a stable error, no membership or binding is written, and an audit row records the refusal without the address.
@@ -8,6 +8,8 @@ export const AUTH_SCOPES = {
8
8
  rolesRead: 'auth.roles.read',
9
9
  rolesManage: 'auth.roles.manage',
10
10
  auditRead: 'auth.audit.read',
11
+ providersRead: 'auth.providers.read',
12
+ providersManage: 'auth.providers.manage',
11
13
  } as const;
12
14
 
13
15
  export const PLATFORM_SCOPES = {
@@ -22,10 +24,6 @@ export const PLATFORM_SCOPES = {
22
24
  export const BUNDLED_MODULE_SCOPES = {
23
25
  usersRead: 'users.members.read',
24
26
  usersManage: 'users.members.manage',
25
- partiesRead: 'parties.records.read',
26
- partiesManage: 'parties.records.manage',
27
- catalogRead: 'catalog.items.read',
28
- catalogManage: 'catalog.items.manage',
29
27
  agentDefinitionsRead: 'agents.definitions.read',
30
28
  agentDefinitionsManage: 'agents.definitions.manage',
31
29
  agentRunsRead: 'agents.runs.read',
@@ -35,11 +33,49 @@ export const BUNDLED_MODULE_SCOPES = {
35
33
  agentProvidersTest: 'agents.providers.test',
36
34
  agentSkillsRead: 'agents.skills.read',
37
35
  agentSkillsManage: 'agents.skills.manage',
36
+ notificationsInboxRead: 'notifications.inbox.read',
37
+ notificationsInboxManage: 'notifications.inbox.manage',
38
+ notificationsWebhooksRead: 'notifications.webhooks.read',
39
+ notificationsWebhooksManage: 'notifications.webhooks.manage',
40
+ notificationsDeliveriesRead: 'notifications.deliveries.read',
38
41
  sandboxAccessUse: 'sandbox.access.use',
39
42
  sandboxAccessManage: 'sandbox.access.manage',
40
43
  sandboxSessionsRead: 'sandbox.sessions.read',
41
44
  sandboxPreviewData: 'sandbox.preview.data',
42
45
  sandboxModulesEject: 'sandbox.modules.eject',
46
+ directoryTokensRead: 'directory.tokens.read',
47
+ directoryTokensManage: 'directory.tokens.manage',
48
+ directoryProvisioningRead: 'directory.provisioning.read',
49
+ auditRegistryRead: 'audit.registry.read',
50
+ auditRetentionManage: 'audit.retention.manage',
51
+ auditHoldsManage: 'audit.holds.manage',
52
+ approvalsRequestsRead: 'approvals.requests.read',
53
+ approvalsRequestsDecide: 'approvals.requests.decide',
54
+ approvalsRequestsManage: 'approvals.requests.manage',
55
+ documentsFilesRead: 'documents.files.read',
56
+ documentsFilesManage: 'documents.files.manage',
57
+ meteringUsageRead: 'metering.usage.read',
58
+ importJobsRead: 'import.jobs.read',
59
+ importJobsManage: 'import.jobs.manage',
60
+ searchRecordsRead: 'search.records.read',
61
+ connectorsInstancesRead: 'connectors.instances.read',
62
+ connectorsInstancesManage: 'connectors.instances.manage',
63
+ workflowsDefinitionsRead: 'workflows.definitions.read',
64
+ workflowsDefinitionsManage: 'workflows.definitions.manage',
65
+ workflowsDefinitionsPublish: 'workflows.definitions.publish',
66
+ workflowsRunsRead: 'workflows.runs.read',
67
+ workflowsRunsExecute: 'workflows.runs.execute',
68
+ workflowsRunsCancel: 'workflows.runs.cancel',
69
+ automationsSchedulesRead: 'automations.schedules.read',
70
+ automationsSchedulesManage: 'automations.schedules.manage',
71
+ automationsTriggersRead: 'automations.triggers.read',
72
+ automationsTriggersManage: 'automations.triggers.manage',
73
+ profileSelfManage: 'profile.self.manage',
74
+ reportsWorkspaceRead: 'reports.workspace.read',
75
+ exportsListsRead: 'exports.lists.read',
76
+ exportsListsManage: 'exports.lists.manage',
77
+ accessReviewRead: 'access.review.read',
78
+ accessReviewManage: 'access.review.manage',
43
79
  } as const;
44
80
 
45
81
  export const OWNER_SCOPES = Object.freeze([
@@ -55,12 +91,20 @@ export const MEMBER_SCOPES = Object.freeze([
55
91
  AUTH_SCOPES.rolesRead,
56
92
  PLATFORM_SCOPES.workspaceAccess,
57
93
  BUNDLED_MODULE_SCOPES.usersRead,
58
- BUNDLED_MODULE_SCOPES.partiesRead,
59
- BUNDLED_MODULE_SCOPES.catalogRead,
60
94
  BUNDLED_MODULE_SCOPES.agentDefinitionsRead,
61
95
  BUNDLED_MODULE_SCOPES.agentRunsRead,
62
96
  BUNDLED_MODULE_SCOPES.agentRunsExecute,
63
97
  BUNDLED_MODULE_SCOPES.agentSkillsRead,
98
+ BUNDLED_MODULE_SCOPES.notificationsInboxRead,
99
+ BUNDLED_MODULE_SCOPES.notificationsInboxManage,
100
+ BUNDLED_MODULE_SCOPES.notificationsWebhooksRead,
101
+ BUNDLED_MODULE_SCOPES.documentsFilesRead,
102
+ BUNDLED_MODULE_SCOPES.documentsFilesManage,
103
+ BUNDLED_MODULE_SCOPES.searchRecordsRead,
104
+ BUNDLED_MODULE_SCOPES.connectorsInstancesRead,
105
+ BUNDLED_MODULE_SCOPES.approvalsRequestsRead,
106
+ BUNDLED_MODULE_SCOPES.approvalsRequestsDecide,
107
+ BUNDLED_MODULE_SCOPES.profileSelfManage,
64
108
  ]);
65
109
 
66
110
  /* Built-in roles; every tenant gets a row per entry in auth_roles. */
@@ -57,6 +57,17 @@
57
57
  "supportsDryRun": true
58
58
  }
59
59
  },
60
+ {
61
+ "path": ["auth", "secrets-rotate"],
62
+ "capability": {
63
+ "id": "auth.secrets.rotate",
64
+ "version": 1,
65
+ "summary": "Re-seal enrolled TOTP secrets and workspace provider secrets with the current auth encryption key.",
66
+ "risk": "process",
67
+ "requiresApprovedSpec": false,
68
+ "supportsDryRun": true
69
+ }
70
+ },
60
71
  {
61
72
  "path": ["auth", "greenfield"],
62
73
  "capability": {
@@ -20,12 +20,12 @@ import { localDatabaseProvider, MIGRATION_REQUIREMENTS } from './database.ts';
20
20
  export const GREENFIELD_ACCOUNTS = Object.freeze({
21
21
  admin: Object.freeze({
22
22
  email: 'admin@example.com',
23
- password: 'Admin!23456789',
23
+ password: 'Owner!23456789',
24
24
  displayName: 'Local Administrator',
25
25
  }),
26
26
  user: Object.freeze({
27
27
  email: 'user@example.com',
28
- password: 'User!234567890',
28
+ password: 'Member!2345678',
29
29
  displayName: 'Demo User',
30
30
  }),
31
31
  });
@@ -10,6 +10,7 @@ import {
10
10
  createWorkspace,
11
11
  listWorkspaces,
12
12
  } from './provisioning.ts';
13
+ import { rotateMfaSecretsCommand } from './secrets.ts';
13
14
  import {
14
15
  authRuntimeOptionsFromEnvironment,
15
16
  createAuthRuntime,
@@ -170,6 +171,19 @@ export const cliExtension = defineCliExtension({
170
171
  },
171
172
  execute: addWorkspaceMember,
172
173
  },
174
+ {
175
+ path: ['auth', 'secrets-rotate'],
176
+ capability: {
177
+ id: 'auth.secrets.rotate',
178
+ version: 1,
179
+ summary:
180
+ 'Re-seal enrolled TOTP secrets and workspace provider secrets with the current auth encryption key.',
181
+ risk: 'process' as const,
182
+ requiresApprovedSpec: false,
183
+ supportsDryRun: true,
184
+ },
185
+ execute: rotateMfaSecretsCommand,
186
+ },
173
187
  {
174
188
  path: ['auth', 'greenfield'],
175
189
  capability: {