@flowdular/sdk 0.2.4 → 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 (908) 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 +2 -1
  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 +2 -1
  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 +4 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +4 -1
  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 +2 -1
  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 +64 -6
  806. package/packages/client/package.json +1 -0
  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/harness/src/index.ts +2 -0
  827. package/packages/harness/src/runtime.ts +218 -1
  828. package/packages/harness/src/tool-adapters.ts +19 -1
  829. package/packages/kernel/src/acl.ts +179 -0
  830. package/packages/kernel/src/capability-registry.ts +69 -2
  831. package/packages/kernel/src/data-class-registry.ts +354 -0
  832. package/packages/kernel/src/index.ts +65 -4
  833. package/packages/kernel/src/keyring.ts +208 -0
  834. package/packages/kernel/src/module-compatibility.ts +35 -4
  835. package/packages/kernel/src/module-registry.ts +49 -2
  836. package/packages/kernel/src/module-settings.ts +189 -27
  837. package/packages/server/package.json +2 -1
  838. package/packages/server/src/composition.ts +38 -0
  839. package/packages/server/src/endpoint.ts +104 -47
  840. package/packages/server/src/export/csv.ts +34 -0
  841. package/packages/server/src/export/definition.ts +346 -0
  842. package/packages/server/src/export/index.ts +61 -0
  843. package/packages/server/src/export/run.ts +116 -0
  844. package/packages/server/src/index.ts +155 -0
  845. package/packages/server/src/jobs/index.ts +93 -0
  846. package/packages/server/src/jobs/runner.ts +486 -0
  847. package/packages/server/src/log.ts +291 -0
  848. package/packages/server/src/mail/config.ts +184 -0
  849. package/packages/server/src/mail/contracts.ts +251 -0
  850. package/packages/server/src/mail/index.ts +31 -0
  851. package/packages/server/src/mail/port.ts +101 -0
  852. package/packages/server/src/mail/smtp.ts +191 -0
  853. package/packages/server/src/mail/template.ts +105 -0
  854. package/packages/server/src/metrics.ts +447 -0
  855. package/packages/server/src/pagination.ts +246 -0
  856. package/packages/server/src/trace/context.ts +103 -0
  857. package/packages/server/src/trace/egress.ts +66 -0
  858. package/packages/server/src/trace/error-sink.ts +296 -0
  859. package/packages/server/src/trace/exporter.ts +295 -0
  860. package/packages/server/src/trace/index.ts +60 -0
  861. package/packages/server/src/trace/job-sink.ts +172 -0
  862. package/packages/server/src/trace/tracer.ts +338 -0
  863. package/packages/server/src/web.ts +5 -1
  864. package/packages/storage/package.json +40 -0
  865. package/packages/storage/src/config.ts +189 -0
  866. package/packages/storage/src/content-type.ts +124 -0
  867. package/packages/storage/src/contracts.ts +112 -0
  868. package/packages/storage/src/envelope.ts +189 -0
  869. package/packages/storage/src/index.ts +43 -0
  870. package/packages/storage/src/local.ts +75 -0
  871. package/packages/storage/src/port.ts +251 -0
  872. package/packages/storage/src/read-token.ts +130 -0
  873. package/packages/storage/src/s3.ts +144 -0
  874. package/packages/storage/src/scanner.ts +22 -0
  875. package/packages/storage/src/sigv4.ts +104 -0
  876. package/packages/storage/src/store.ts +13 -0
  877. package/packages/ui/package.json +1 -0
  878. package/packages/ui/src/components/Button.tsrx +3 -0
  879. package/packages/ui/src/components/ConfirmDialog.tsrx +13 -2
  880. package/packages/ui/src/components/DateField.tsrx +92 -0
  881. package/packages/ui/src/components/DatePicker.tsrx +525 -0
  882. package/packages/ui/src/components/DateRangeField.tsrx +93 -0
  883. package/packages/ui/src/components/Drawer.tsrx +10 -1
  884. package/packages/ui/src/components/FileUpload.tsrx +158 -0
  885. package/packages/ui/src/components/Pagination.tsrx +130 -0
  886. package/packages/ui/src/components/Select.tsrx +78 -0
  887. package/packages/ui/src/components/Table.tsrx +498 -81
  888. package/packages/ui/src/components/Tabs.tsrx +53 -0
  889. package/packages/ui/src/components/ToastHost.tsrx +48 -0
  890. package/packages/ui/src/components/calendar.ts +243 -0
  891. package/packages/ui/src/components/date-field.ts +62 -0
  892. package/packages/ui/src/components/file-upload.ts +49 -0
  893. package/packages/ui/src/components/focus-trap.ts +62 -0
  894. package/packages/ui/src/components/pagination.ts +68 -0
  895. package/packages/ui/src/components/table-sorting.ts +49 -0
  896. package/packages/ui/src/components/tabs.ts +61 -0
  897. package/packages/ui/src/components/toast-store.ts +116 -0
  898. package/packages/ui/src/icons/Icon.tsrx +5 -0
  899. package/packages/ui/src/index.ts +45 -0
  900. package/packages/ui/src/styles/components.css +598 -0
  901. package/modules/automations-workflows-integration/module.json +0 -27
  902. package/modules/automations-workflows-integration/spec/module.yaml +0 -93
  903. package/modules/automations-workflows-integration/src/index.ts +0 -14
  904. package/modules/automations-workflows-integration/src/platform.ts +0 -24
  905. package/modules/automations-workflows-integration/src/server/index.ts +0 -11
  906. package/modules/automations-workflows-integration/translations/en.json +0 -21
  907. package/modules/automations-workflows-integration/translations/pl.json +0 -21
  908. package/modules/workflows/src/services/cursor-codec.ts +0 -62
@@ -0,0 +1,447 @@
1
+ schemaVersion: 2
2
+ id: connectors.core
3
+ specVersion: 0.1.5
4
+ status: approved
5
+ name: Connectors Core
6
+ description: Gives a workspace a governed way to call external systems through connector definitions a module or the platform ships, instances an owner configures with sealed credentials and a host allowlist, a test call, a call log without payloads, and an explicit per-instance consent that lets workflows and agents use the connector as an external action, with a generic HTTP JSON connector as the reference.
7
+ profile: full
8
+ capabilities:
9
+ - api
10
+ - database
11
+ - client
12
+ - translations
13
+ dependencies:
14
+ - id: system.core
15
+ range: ^0.7.0
16
+ - id: auth.core
17
+ range: ^0.13.0
18
+ tenancy: required
19
+ locales:
20
+ - en
21
+ - pl
22
+ invariants:
23
+ - Persistence runs on the shared asynchronous database contract with explicit PostgreSQL SQL; every tenant table enables and forces row-level security with USING and WITH CHECK policies bound to the transaction-local tenant id, and the runtime role holds neither SUPERUSER nor BYPASSRLS.
24
+ - A connector definition lives only in the code registry, never in a tenant table; it is registered through the public capability connectors.definitions.v1 at composition with a stable key, a label, the authentication kinds it supports (api-key, bearer, oauth2-client-credentials, none), its operations (key, label, method, path template, input schema, output schema) and its default host allowlist; the platform ships the generic HTTP JSON definition, and a module may ship its own.
25
+ - An instance is created by a member holding connectors.instances.manage for one definition, with a base URL, an authentication kind and its credentials sealed under the module keyring FD_CONNECTORS_SECRET_KEY and never returned after creation, a host allowlist that defaults to the base URL host and must contain it, and two consent flags, allowWorkflows and allowAgents, both off by default and switched on only with an explicit confirmation recorded in the audit trail.
26
+ - Every outbound call from an instance obeys the notifications egress policy (https only, private, loopback and link-local ranges refused at save and at call, no redirects, a bounded timeout and response size) and the instance host allowlist, and is recorded in the call log with the operation, the outcome class, the status, the duration and the byte counts, never the request or response body, never a credential.
27
+ - A workflow action or an agent tool that calls a connector is exposed only for an instance whose consent flag is on; the tool is declared with risk workspace-write and the harness consent gate connectors.instance-consent, which admits the call only when the instance consent for that caller kind is on at invocation time; it runs only within the instance host allowlist and is audited per call with the run identity; the CLI runner and the harness keep refusing external risk, so a connector call is never an unattended CLI capability.
28
+ - A test call from the instance screen runs one operation with a member-supplied input and returns the outcome class and status only; the response body is shown truncated to a bounded size for diagnosis and is not stored.
29
+ - Disabling an instance stops every call at once, including calls already queued by workflows; deleting an instance requires it to be disabled and removes its sealed credentials, and the call log stays until retention removes it.
30
+ - Every outbound request is pinned to the addresses the egress check accepted, so the connection resolves nothing again and a name that answers publicly for the check and privately a moment later cannot be reached. The host name, the Host header and the TLS server name are unchanged, and the same pinning covers the OAuth2 token exchange.
31
+ - A call is refused before the socket unless its target is https on a port the definition names, and a definition that names no port accepts 443 only. The same rule applies to the OAuth2 token URL, at save and at call.
32
+ - The credential fingerprint an owner compares is a keyed digest under this module's own key, bound to the tenant and the instance, so holding the column reveals neither the credential nor whether two workspaces hold the same one. A cached access token is keyed by that fingerprint, so a replaced client secret can never be served from the token the previous one obtained.
33
+ - A connector call an unattended caller makes carries a durable idempotency key. connectors.core claims the key in connectors_call_keys before anything leaves the process and binds it to the recorded call in the same transaction as the call log row, so a replayed run answers the first call, success or failure, instead of reaching the external system twice.
34
+ - The caller kind of a tool call is the invocation the runtime states, an agent run or a workflow action, and never the tool's own assumption or anything in the input. connectors.core answers an agent run with allowAgents and a workflow action with allowWorkflows, in the consent gate and again in the call capability, and records that kind as the caller of the call log row.
35
+ - The idempotency key is claimed only once the credential is resolved, the OAuth2 token exchange included, and is bound to the recorded call only once the request was written to the socket. A refused call, and a failure raised before that point, leave the key unbound for the retry that follows the fix. Two attempts that read the same abandoned claim are answered by a retake that compares the claim time it read, so only one of them owns the key.
36
+ - A template value names a resource and never carries path syntax. A value with a segment that is a single or double dot is refused before the request is built, in the escaped expansion and in the reserved one.
37
+ - The agent tool has no server route. The harness runs it in this process, and a route under connectors.instances.read that made the credentialed call and returned the parsed body would give every member the connector itself. The run identity comes from the trusted tool context and never from a request header.
38
+ - connectors.core declares three data classes to the platform catalogue. Calls carry a 400 day default retention, a sweep and an export; audit rows and instances are kept until a person deletes them and are exportable, with instances exported without anything of the credential but its fingerprint. The call sweep removes the idempotency keys claimed before the same cutoff, so no key is left naming a call that is gone.
39
+ permissions:
40
+ - id: connectors.instances.read
41
+ description: Read connector definitions, instances without credentials and the call log of the active workspace.
42
+ - id: connectors.instances.manage
43
+ description: Create, change, enable, disable, test, consent and delete connector instances in the active workspace.
44
+ dataOwnership:
45
+ - connectors.core owns the definition registry, instances, sealed credentials, its own audit trail of instance changes and consents, and the call log.
46
+ - workflows.core and agents.core own the runs that call a connector and record the call in their own trails by call identifier.
47
+ entities:
48
+ - id: definition
49
+ name: Connector definition
50
+ description: One registered connector kind as the workspace sees it. It is the read view of the code registry rather than a tenant table, so connectors.core stores no definition row and a workspace cannot add, change or remove one.
51
+ fields:
52
+ - id: key
53
+ type: string
54
+ required: true
55
+ unique: tenant
56
+ maxLength: 96
57
+ - id: moduleId
58
+ type: string
59
+ required: true
60
+ maxLength: 64
61
+ - id: label
62
+ type: string
63
+ required: true
64
+ maxLength: 120
65
+ - id: authKinds
66
+ type: json
67
+ required: true
68
+ - id: operations
69
+ type: json
70
+ required: true
71
+ - id: allowedPorts
72
+ type: json
73
+ required: false
74
+ description: Ports an instance of this definition may reach. Absent means 443 only, and a definition reaching a service on another port names every port it accepts.
75
+ - id: instance
76
+ name: Connector instance
77
+ description: A configured connection of one definition in the workspace.
78
+ fields:
79
+ - id: definition
80
+ type: reference
81
+ required: true
82
+ reference: definition
83
+ - id: name
84
+ type: string
85
+ required: true
86
+ unique: tenant
87
+ maxLength: 120
88
+ - id: baseUrl
89
+ type: string
90
+ required: true
91
+ maxLength: 2048
92
+ - id: authKind
93
+ type: enum
94
+ required: true
95
+ values:
96
+ - none
97
+ - api-key
98
+ - bearer
99
+ - oauth2-client-credentials
100
+ - id: credentialFingerprint
101
+ type: string
102
+ required: false
103
+ maxLength: 32
104
+ - id: allowedHosts
105
+ type: json
106
+ required: true
107
+ - id: allowWorkflows
108
+ type: boolean
109
+ required: true
110
+ - id: allowAgents
111
+ type: boolean
112
+ required: true
113
+ - id: status
114
+ type: enum
115
+ required: true
116
+ values:
117
+ - active
118
+ - disabled
119
+ - id: lastCallAt
120
+ type: datetime
121
+ required: false
122
+ states:
123
+ field: status
124
+ values:
125
+ - active
126
+ - disabled
127
+ transitions:
128
+ - from: active
129
+ to: disabled
130
+ permission: connectors.instances.manage
131
+ - from: disabled
132
+ to: active
133
+ permission: connectors.instances.manage
134
+ - id: audit-entry
135
+ name: Connector audit entry
136
+ description: One instance change or consent decision, written in the same transaction as the change.
137
+ fields:
138
+ - id: instance
139
+ type: reference
140
+ required: true
141
+ reference: instance
142
+ - id: action
143
+ type: string
144
+ required: true
145
+ maxLength: 64
146
+ - id: actorAccountId
147
+ type: string
148
+ required: true
149
+ maxLength: 128
150
+ - id: occurredAt
151
+ type: datetime
152
+ required: true
153
+ - id: call
154
+ name: Connector call
155
+ description: One outbound call as recorded.
156
+ fields:
157
+ - id: instance
158
+ type: reference
159
+ required: true
160
+ reference: instance
161
+ - id: operation
162
+ type: string
163
+ required: true
164
+ maxLength: 64
165
+ - id: caller
166
+ type: enum
167
+ required: true
168
+ values:
169
+ - test
170
+ - workflow
171
+ - agent
172
+ - id: callerRef
173
+ type: string
174
+ required: false
175
+ maxLength: 200
176
+ - id: outcome
177
+ type: enum
178
+ required: true
179
+ values:
180
+ - succeeded
181
+ - failed
182
+ - refused
183
+ - id: status
184
+ type: integer
185
+ required: false
186
+ - id: errorClass
187
+ type: string
188
+ required: false
189
+ maxLength: 64
190
+ - id: durationMs
191
+ type: integer
192
+ required: true
193
+ - id: requestBytes
194
+ type: integer
195
+ required: true
196
+ - id: responseBytes
197
+ type: integer
198
+ required: true
199
+ - id: occurredAt
200
+ type: datetime
201
+ required: true
202
+ - id: call-key
203
+ name: Connector call idempotency key
204
+ description: One durable key bound to one call, claimed before anything leaves the process so a replayed unattended caller writes at most once. Swept with the call log.
205
+ fields:
206
+ - id: idempotencyKey
207
+ type: string
208
+ required: true
209
+ unique: tenant
210
+ maxLength: 128
211
+ - id: operationId
212
+ type: string
213
+ required: true
214
+ maxLength: 200
215
+ - id: inputDigest
216
+ type: string
217
+ required: true
218
+ maxLength: 64
219
+ - id: call
220
+ type: reference
221
+ required: false
222
+ reference: call
223
+ - id: claimedAt
224
+ type: datetime
225
+ required: true
226
+ - id: completedAt
227
+ type: datetime
228
+ required: false
229
+ screens:
230
+ - id: instances
231
+ kind: list
232
+ entity: instance
233
+ title: Connectors
234
+ columns:
235
+ - name
236
+ - definition
237
+ - baseUrl
238
+ - authKind
239
+ - status
240
+ - allowWorkflows
241
+ - allowAgents
242
+ - lastCallAt
243
+ filters:
244
+ - status
245
+ - definition
246
+ navigationGroup: Administration
247
+ - id: instance
248
+ kind: record
249
+ entity: instance
250
+ title: Connector
251
+ columns:
252
+ - name
253
+ - definition
254
+ - baseUrl
255
+ - authKind
256
+ - credentialFingerprint
257
+ - allowedHosts
258
+ - allowWorkflows
259
+ - allowAgents
260
+ - status
261
+ navigationGroup: Administration
262
+ - id: calls
263
+ kind: list
264
+ entity: call
265
+ title: Connector calls
266
+ columns:
267
+ - occurredAt
268
+ - instance
269
+ - operation
270
+ - caller
271
+ - outcome
272
+ - status
273
+ - errorClass
274
+ - durationMs
275
+ filters:
276
+ - outcome
277
+ - instance
278
+ navigationGroup: Administration
279
+ actions:
280
+ - id: create-instance
281
+ entity: instance
282
+ permission: connectors.instances.manage
283
+ kind: create
284
+ risk: workspace-write
285
+ idempotent: false
286
+ description: Create an active instance with credentials accepted once and sealed; the base URL is validated against the egress policy and the definition's host allowlist.
287
+ - id: update-instance
288
+ entity: instance
289
+ permission: connectors.instances.manage
290
+ kind: update
291
+ risk: workspace-write
292
+ idempotent: true
293
+ description: Change name, base URL, allowed hosts or credentials; a changed URL is validated again.
294
+ - id: consent
295
+ entity: instance
296
+ permission: connectors.instances.manage
297
+ kind: custom
298
+ risk: workspace-write
299
+ idempotent: true
300
+ description: Turn allowWorkflows or allowAgents on or off with an explicit confirmation, recorded in the audit trail.
301
+ - id: test-call
302
+ entity: instance
303
+ permission: connectors.instances.manage
304
+ kind: custom
305
+ risk: workspace-write
306
+ idempotent: false
307
+ description: Run one operation with a supplied input and return the outcome class, status and a truncated body for diagnosis.
308
+ - id: disable-instance
309
+ entity: instance
310
+ permission: connectors.instances.manage
311
+ kind: custom
312
+ risk: workspace-write
313
+ idempotent: true
314
+ description: Stop every call at once.
315
+ - id: enable-instance
316
+ entity: instance
317
+ permission: connectors.instances.manage
318
+ kind: custom
319
+ risk: workspace-write
320
+ idempotent: true
321
+ description: Allow calls again.
322
+ - id: delete-instance
323
+ entity: instance
324
+ permission: connectors.instances.manage
325
+ kind: delete
326
+ risk: destructive
327
+ idempotent: true
328
+ description: Delete a disabled instance and its sealed credentials; the call log stays.
329
+ widgets: []
330
+ settings:
331
+ - key: callTimeoutMs
332
+ type: integer
333
+ scope: platform
334
+ default: 10000
335
+ description: Timeout per connector call; 1000 to 60000.
336
+ - key: maxResponseBytes
337
+ type: integer
338
+ scope: platform
339
+ default: 1048576
340
+ description: Response size cap per call; 1024 to 16777216.
341
+ agentTools:
342
+ - id: connectors.call
343
+ permission: connectors.instances.read
344
+ description: Call an operation of a consented instance; exposed to an agent only for instances with allowAgents on, declared with risk workspace-write and admitted per call by the connectors.instance-consent gate, within the instance host allowlist and the definition port list. It declares contractVersion, an output schema, idempotency required with target-ledger protection and cooperative cancellation, so agents.core also publishes it as a workflow action. It has no server route, because the harness runs it in this process.
345
+ risk: workspace-write
346
+ outOfScope:
347
+ - OAuth2 authorization-code flows with a person in the loop are not offered; client credentials only.
348
+ - Inbound calls from external systems are the automations webhook triggers, not connectors.
349
+ - Rate limiting per external system beyond the platform timeout and size caps is the definition's concern later.
350
+ decisions:
351
+ - id: D-CONNECTORS-SCOPE
352
+ question: What is the first version?
353
+ answer: The definition contract and registry, owner-configured instances with sealed credentials and host allowlists, test calls, a call log without payloads, workflow actions and agent tools behind per-instance consent, and the generic HTTP JSON connector as the reference.
354
+ decidedBy: user
355
+ - id: D-CONNECTORS-EGRESS
356
+ question: How is the external risk ceiling raised?
357
+ answer: Only per instance with the owner's explicit consent, within the instance host allowlist, audited per call; the CLI runner still refuses external.
358
+ decidedBy: user
359
+ - id: D-CONNECTORS-TOOL-RISK
360
+ question: How is the agent tool declared given that the harness refuses external?
361
+ answer: The tool is declared with risk workspace-write on this module's surface and the harness is extended to admit it only when the instance consent is on, so the ceiling is raised by consent, not by a declaration a spec could copy.
362
+ decidedBy: default
363
+ - id: D-CONNECTORS-RETENTION
364
+ question: Who owns the retention of the call log, and for how long?
365
+ answer: connectors.core owns it and declares the data classes itself. Calls carry a 400 day default and are swept and exportable; audit rows and instances are kept until a person deletes them and are exportable, with instances exported without a credential. 400 days covers a financial year and the audit that follows it. The sweep removes the idempotency keys claimed before the same cutoff with the calls.
366
+ decidedBy: default
367
+ - id: D-CONNECTORS-PORTS
368
+ question: Which ports may an instance reach?
369
+ answer: 443 only, unless its definition names more through allowedPorts. A public address answering on an unnamed port is a different service from the one the definition was written for, so the port is part of the definition's contract rather than something an instance may choose.
370
+ decidedBy: default
371
+ - id: D-CONNECTORS-AGENT-ROUTE
372
+ question: Does the agent tool need a server route?
373
+ answer: No. The harness runs the tool in process, so a route would only add a second way in, under the read permission every member holds, that makes a credentialed outbound call and hands back the parsed body. The endpoint id stays as the tool's identity and nothing serves it.
374
+ decidedBy: default
375
+ - id: D-CONNECTORS-PERMISSIONS
376
+ question: Who manages connectors?
377
+ answer: Owners hold connectors.instances.read and manage; members hold read.
378
+ decidedBy: default
379
+ acceptanceScenarios:
380
+ - id: CONNECTORS-INSTANCE-CRUD
381
+ given: A principal holding connectors.instances.manage supplies a unique name, an https base URL on a public host, an api-key credential and an allowed host list.
382
+ when: The instance is created, updated, disabled, enabled and deleted after disabling.
383
+ then: Each accepted transition is persisted under the workspace's forced policy, the credential is never readable after creation and only its fingerprint changes on update, deleting an active instance is refused, and a member without the permission is refused before repository access.
384
+ - id: CONNECTORS-EGRESS
385
+ given: A base URL with an http scheme, a loopback or private address, a host that resolves to one, or a host outside the instance allowlist.
386
+ when: The instance is created or a call is made.
387
+ then: The save is refused with a stable error before any write, and a call is refused with outcome refused and errorClass egress-refused before any request leaves.
388
+ - id: CONNECTORS-TEST-CALL
389
+ given: An active instance pointing at a test server.
390
+ when: The owner runs a test call of an operation.
391
+ then: The request carries the sealed credential in the definition's authentication form, obeys the timeout and size caps, and the response shows outcome, status and a truncated body while the call log stores no body.
392
+ - id: CONNECTORS-CONSENT
393
+ given: An instance with both consent flags off.
394
+ when: A workflow action and an agent tool try to call it, then the owner consents to workflows only and both try again.
395
+ then: Both are refused before any request at first; after consent the workflow call succeeds and is audited with the run identity, the agent call is still refused, and each consent change is an audit row.
396
+ - id: CONNECTORS-DISABLE
397
+ given: An active instance with a queued workflow call.
398
+ when: The owner disables the instance.
399
+ then: The queued call fails with a stable code without any request leaving and later calls are refused until the instance is enabled.
400
+ - id: CONNECTORS-DENY
401
+ given: A principal is unauthenticated or lacks the required permission.
402
+ when: The principal reads or mutates instances or runs a test call.
403
+ then: The server denies the operation before repository access, and a mutation without a CSRF proof is refused first.
404
+ - id: CONNECTORS-PINNED-EGRESS
405
+ given: A host that answers the egress check with a public address and every later resolution with a private one, and an instance whose base URL is http or on a port the definition does not name.
406
+ when: A call is made.
407
+ then: The call reaches the address the check accepted and never the later one, with the Host header unchanged, and the http or unnamed-port target is refused with outcome refused and errorClass egress-refused before any socket is opened.
408
+ - id: CONNECTORS-CALL-IDEMPOTENCY
409
+ given: An instance consented to agents and an unattended caller holding one durable idempotency key.
410
+ when: The caller makes the same call twice under that key, and once more under the key with a different operation.
411
+ then: The external system is reached once, the repeat answers the recorded call with replayed set and no body, a recorded failure is replayed the same way, and the key bound to another operation or input is refused with a stable conflict.
412
+ - id: CONNECTORS-CONSENT-PER-CALLER
413
+ given: An instance with allowWorkflows on and allowAgents off.
414
+ when: The owner confirms a change to the workflow consent from the instance screen.
415
+ then: Only the workflow flag moves, the agent flag stays off, and the confirmation names the caller kind and the value it is about to write.
416
+ - id: CONNECTORS-TOOL-CALLER-KIND
417
+ given: One instance with allowWorkflows on and allowAgents off, and one with the mirror state.
418
+ when: A workflow action and an agent run call each of them through the registered tool.
419
+ then: The workflow action is admitted only by the instance with allowWorkflows and its call log row carries caller workflow, the agent run is admitted only by the instance with allowAgents, and every other combination is refused by the gate and again by the call capability.
420
+ - id: CONNECTORS-KEY-BINDING
421
+ given: An instance whose OAuth2 token endpoint refuses the first exchange, and an instance whose host accepts no connection.
422
+ when: An unattended caller makes the call under one durable key and retries under the same key.
423
+ then: Neither the refused token exchange nor the failure raised before the request was written binds the key, and the retry makes the call instead of replaying an answer the external system never gave.
424
+ - id: CONNECTORS-KEY-RETAKE-RACE
425
+ given: An idempotency key whose claim was abandoned past the claim window and two attempts that read it at the same moment.
426
+ when: Both try to take the claim over.
427
+ then: Exactly one is answered claimed and makes the call, the other is answered in flight, and the ledger holds the claim time of the one that won.
428
+ - id: CONNECTORS-PATH-SEGMENT
429
+ given: An operation whose path template expands a caller value as one escaped segment, and one that expands it as a whole path.
430
+ when: The value is a single or double dot segment.
431
+ then: The call is refused with outcome refused and errorClass invalid-input before any request is built, while a value that merely contains dots is expanded unchanged.
432
+ - id: CONNECTORS-RETENTION
433
+ given: Two workspaces with calls, audit rows and instances, some older than the retention period.
434
+ when: The platform sweeps and exports the connectors data classes for one workspace.
435
+ then: Only that workspace's calls older than the cutoff are removed together with the idempotency keys claimed before it, the other workspace keeps its rows, and the export carries calls, audit rows and instances without any credential and without any request or response body.
436
+ - id: CONNECTORS-INSTANCES-PAGING
437
+ given: A workspace with more instances than one page holds, narrowed by a status, definition or search filter.
438
+ when: A reader opens the connectors screen and walks its pages forward and back.
439
+ then: Each page carries at most 200 instances (50 by default) in name order, ascending or descending, and the next page opens from an opaque cursor bound to the workspace, the sort and the filters, so a cursor from another workspace, another sort or other filters is refused with a stable error.
440
+ - id: CONNECTORS-CALLS-PAGING
441
+ given: A workspace with more logged calls than one page holds, narrowed by an instance, outcome or operation filter.
442
+ when: A reader opens the call log and walks its pages forward and back.
443
+ then: Each page carries at most 200 calls (50 by default) in occurredAt order, descending or ascending, and the next page opens from an opaque cursor bound to the workspace, the sort and the filters, so a cursor from another workspace, another sort or other filters is refused with a stable error.
444
+ - id: CONNECTORS-TENANT-BOUNDARY
445
+ given: Two workspaces with instances and calls.
446
+ when: A runtime transaction bound to one workspace reads or writes any of them.
447
+ then: Only that workspace's rows are visible or mutable and a row carrying another tenant identifier is rejected by the forced policy.
@@ -0,0 +1,6 @@
1
+ export const CONNECTORS_PERMISSIONS = {
2
+ read: 'connectors.instances.read',
3
+ manage: 'connectors.instances.manage',
4
+ } as const;
5
+
6
+ export const permissions = Object.freeze(Object.values(CONNECTORS_PERMISSIONS));
@@ -0,0 +1,180 @@
1
+ import { defineApiAgentTool } from '@flowdular/sdk/harness/tool-adapters';
2
+ import type {
3
+ AgentTool,
4
+ AgentToolConsentDecision,
5
+ AgentToolContext,
6
+ } from '@flowdular/sdk/harness/runtime';
7
+ import { CONNECTORS_PERMISSIONS } from '../acl/permissions.ts';
8
+ import type { ConnectorCaller } from '../domain/types.ts';
9
+ import type { ConnectorsRuntime } from '../server/runtime.ts';
10
+ import { ConnectorsServiceError } from '../services/service-error.ts';
11
+
12
+ /** Characters of a response body one tool call hands back to the model. */
13
+ export const MAX_TOOL_BODY_CHARACTERS = 16_384;
14
+
15
+ export const CONNECTORS_TOOL_CONSENT_ID = 'connectors.instance-consent';
16
+
17
+ /**
18
+ * The identity the tool is published under. There is no server route behind it:
19
+ * the harness runs `execute` in this process, and a credentialed egress route
20
+ * under the read permission would have handed every member the call itself.
21
+ */
22
+ export const CONNECTORS_CALL_TOOL_TARGET = 'connectors.calls.agent';
23
+
24
+ function instanceId(input: unknown): string | null {
25
+ const value = (input ?? {}) as Record<string, unknown>;
26
+ return typeof value.instanceId === 'string' && value.instanceId.length > 0
27
+ ? value.instanceId
28
+ : null;
29
+ }
30
+
31
+ /**
32
+ * Which consent flag of the instance admits this call. The invocation kind is
33
+ * the caller's own statement, so a workflow node is answered by allowWorkflows
34
+ * and a model turn by allowAgents; an absent kind is an agent run, because the
35
+ * workflow action runtime always states it.
36
+ */
37
+ function callerOf(context: AgentToolContext): ConnectorCaller {
38
+ return context.invocation === 'workflow-action' ? 'workflow' : 'agent';
39
+ }
40
+
41
+ /**
42
+ * Raises this tool's ceiling per instance instead of per declaration: the call
43
+ * is admitted only while the workspace owner keeps the consent flag of this
44
+ * caller kind on for the instance named, and the call capability enforces the
45
+ * same flag again before anything leaves the process.
46
+ */
47
+ function consentGate(runtime: ConnectorsRuntime) {
48
+ return {
49
+ id: CONNECTORS_TOOL_CONSENT_ID,
50
+ async check(
51
+ input: unknown,
52
+ context: AgentToolContext,
53
+ ): Promise<AgentToolConsentDecision> {
54
+ const id = instanceId(input);
55
+ if (!id) {
56
+ return { granted: false, reason: 'CONNECTOR_INSTANCE_UNKNOWN' };
57
+ }
58
+ const calls = await runtime.calls();
59
+ return (await calls.consented(context.tenantId, id, callerOf(context)))
60
+ ? { granted: true }
61
+ : { granted: false, reason: 'CONNECTOR_CONSENT_MISSING' };
62
+ },
63
+ };
64
+ }
65
+
66
+ /**
67
+ * The whole contract a workflow action needs on top of an agent tool: a
68
+ * version, an output schema, a required key backed by the call ledger, and a
69
+ * cancellation answer. Without every one of them agents.core declines to
70
+ * publish the tool as an action, which would leave the workflow consent flag
71
+ * unreachable however the workspace set it.
72
+ */
73
+ export const CONNECTORS_CALL_CONTRACT_VERSION = 1;
74
+
75
+ const CALL_OUTPUT_SCHEMA = {
76
+ type: 'object',
77
+ additionalProperties: false,
78
+ required: [
79
+ 'callId',
80
+ 'outcome',
81
+ 'status',
82
+ 'errorClass',
83
+ 'durationMs',
84
+ 'responseBytes',
85
+ 'bodyOmitted',
86
+ 'replayed',
87
+ 'body',
88
+ ],
89
+ properties: {
90
+ callId: { type: 'string' },
91
+ outcome: { type: 'string', enum: ['succeeded', 'failed'] },
92
+ status: { type: ['integer', 'null'] },
93
+ errorClass: { type: ['string', 'null'] },
94
+ durationMs: { type: 'integer' },
95
+ responseBytes: { type: 'integer' },
96
+ bodyOmitted: { type: 'boolean' },
97
+ replayed: { type: 'boolean' },
98
+ body: {},
99
+ },
100
+ } as const;
101
+
102
+ export function connectorsAgentTools(
103
+ runtime: ConnectorsRuntime,
104
+ ): readonly AgentTool[] {
105
+ return [
106
+ defineApiAgentTool({
107
+ id: 'connectors.call',
108
+ endpointId: CONNECTORS_CALL_TOOL_TARGET,
109
+ contractVersion: CONNECTORS_CALL_CONTRACT_VERSION,
110
+ description:
111
+ 'Call one operation of a connector instance the workspace has consented to for agents.',
112
+ requiredPermissions: [CONNECTORS_PERMISSIONS.read],
113
+ risk: 'workspace-write',
114
+ idempotency: 'required',
115
+ /* connectors_call_keys binds the key to one call before anything
116
+ leaves the process and answers that call on a repeat. */
117
+ idempotencyProtection: 'target-ledger',
118
+ cancellation: 'cooperative',
119
+ consent: consentGate(runtime),
120
+ inputSchema: {
121
+ type: 'object',
122
+ additionalProperties: false,
123
+ required: ['instanceId', 'operation'],
124
+ properties: {
125
+ instanceId: { type: 'string' },
126
+ operation: { type: 'string' },
127
+ input: { type: 'object' },
128
+ },
129
+ },
130
+ outputSchema: CALL_OUTPUT_SCHEMA,
131
+ execute: async (input, context) => {
132
+ const value = (input ?? {}) as Record<string, unknown>;
133
+ if (!context.idempotencyKey) {
134
+ throw new ConnectorsServiceError(
135
+ 'CONNECTOR_IDEMPOTENCY_KEY_REQUIRED',
136
+ 'A connector call requires a durable idempotency key.',
137
+ 409,
138
+ );
139
+ }
140
+ const calls = await runtime.calls();
141
+ const result = await calls.call({
142
+ /* Tenant and run identity come from the run, never from input. */
143
+ tenantId: context.tenantId,
144
+ instanceId: String(value.instanceId ?? ''),
145
+ operation: String(value.operation ?? ''),
146
+ input:
147
+ value.input && typeof value.input === 'object'
148
+ ? (value.input as Record<string, unknown>)
149
+ : {},
150
+ caller: callerOf(context),
151
+ callerRef: context.runId,
152
+ idempotencyKey: context.idempotencyKey,
153
+ signal: context.signal,
154
+ });
155
+ if (result.outcome === 'refused') {
156
+ throw new ConnectorsServiceError(
157
+ 'CONNECTOR_CALL_REFUSED',
158
+ `The connector call was refused: ${result.errorClass}.`,
159
+ );
160
+ }
161
+ const serialized =
162
+ result.body === null ? '' : JSON.stringify(result.body);
163
+ const omitted = serialized.length > MAX_TOOL_BODY_CHARACTERS;
164
+ return {
165
+ callId: result.callId,
166
+ outcome: result.outcome,
167
+ status: result.status,
168
+ errorClass: result.errorClass,
169
+ durationMs: result.durationMs,
170
+ responseBytes: result.responseBytes,
171
+ /* A body too large for one run window is dropped whole rather than
172
+ handed to the model as truncated JSON. */
173
+ bodyOmitted: omitted,
174
+ replayed: result.replayed,
175
+ body: omitted ? null : result.body,
176
+ };
177
+ },
178
+ }),
179
+ ];
180
+ }