@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.
- package/.ai/agents/sandbox/business-manager.md +5 -1
- package/.ai/blueprints/author-spec/README.md +1 -1
- package/.ai/blueprints/author-spec/spec-requirements.yaml +44 -0
- package/.ai/blueprints/author-spec/steps.yaml +5 -5
- package/.ai/blueprints/author-spec/templates/module.yaml +99 -3
- package/.ai/blueprints/edit-module/gates.yaml +4 -0
- package/.ai/blueprints/edit-module/required-files.yaml +9 -0
- package/.ai/blueprints/new-module/gates.yaml +4 -0
- package/.ai/blueprints/new-module/spec-requirements.yaml +2 -2
- package/.ai/blueprints/release/gates.yaml +4 -0
- package/.ai/platform-capabilities.md +128 -0
- package/.ai/policies/capabilities.yaml +100 -0
- package/.ai/policies/path-ownership.yaml +5 -2
- package/.ai/policies/task-budgets.yaml +5 -3
- package/.ai/references/catalog/module.json +4 -4
- package/.ai/references/catalog/package.json +2 -2
- package/.ai/references/catalog/spec/module.yaml +5 -3
- package/.ai/references/catalog/src/platform.ts +2 -0
- package/.ai/references/catalog/src/services/catalog-service.ts +89 -1
- package/.ai/references/catalog/src/services/data-classes.ts +47 -0
- package/.ai/references/catalog/src/services/database-repository.ts +98 -1
- package/.ai/references/catalog/src/services/repository.ts +22 -1
- package/.ai/references/catalog/tests/data-classes.test.ts +157 -0
- package/.ai/references/catalog.provenance.json +12 -10
- package/.ai/skills/README.md +10 -0
- package/.ai/skills/agent-tool-design/SKILL.md +1 -2
- package/.ai/skills/auth-security-review/SKILL.md +1 -1
- package/.ai/skills/business-agent-design/SKILL.md +0 -1
- package/.ai/skills/deploy-operate/SKILL.md +114 -0
- package/.ai/skills/module-new/SKILL.md +29 -3
- package/.ai/skills/module-update/SKILL.md +9 -3
- package/.ai/skills/perf-audit/SKILL.md +0 -1
- package/.ai/skills/release-eject-pr/SKILL.md +0 -1
- package/.ai/skills/spec-interview/SKILL.md +120 -0
- package/.ai/skills/test-hardening/SKILL.md +1 -0
- package/.ai/skills/ux-design/SKILL.md +34 -3
- package/.ai/skills/variables/SKILL.md +0 -2
- package/.ai/skills/workflow-development/SKILL.md +0 -1
- package/AGENTS.md +4 -0
- package/docs/agent-contract.md +2 -2
- package/docs/design-system.md +185 -31
- package/modules/access/migrations/0001_access_core.down.sql +1 -0
- package/modules/access/migrations/0001_access_core.up.sql +28 -0
- package/modules/access/migrations/README.md +3 -0
- package/modules/access/module.json +33 -0
- package/modules/access/package.json +43 -0
- package/modules/access/spec/module.yaml +225 -0
- package/modules/access/src/acl/permissions.ts +6 -0
- package/modules/access/src/api/endpoints.ts +244 -0
- package/modules/access/src/client/ActivityView.tsrx +245 -0
- package/modules/access/src/client/AttestationsView.tsrx +176 -0
- package/modules/access/src/client/ReviewView.tsrx +586 -0
- package/modules/access/src/client/api.ts +132 -0
- package/modules/access/src/client/contribution.tsrx +41 -0
- package/modules/access/src/client/index.ts +41 -0
- package/modules/access/src/client/navigation.ts +57 -0
- package/modules/access/src/client/presentation.ts +69 -0
- package/modules/access/src/client/state.ts +72 -0
- package/modules/access/src/domain/types.ts +189 -0
- package/modules/access/src/index.ts +38 -0
- package/modules/access/src/platform.ts +60 -0
- package/modules/access/src/server/index.ts +42 -0
- package/modules/access/src/server/runtime.ts +105 -0
- package/modules/access/src/services/access-service.ts +298 -0
- package/modules/access/src/services/audit-window.ts +78 -0
- package/modules/access/src/services/auth-directory.ts +72 -0
- package/modules/access/src/services/changes.ts +91 -0
- package/modules/access/src/services/data-classes.ts +28 -0
- package/modules/access/src/services/database-repository.ts +185 -0
- package/modules/access/src/services/directory.ts +102 -0
- package/modules/access/src/services/index.ts +33 -0
- package/modules/access/src/services/list-exports.ts +150 -0
- package/modules/access/src/services/migration.ts +54 -0
- package/modules/access/src/services/repository.ts +30 -0
- package/modules/access/src/services/review.ts +178 -0
- package/modules/access/translations/en.json +155 -0
- package/modules/access/translations/pl.json +155 -0
- package/modules/agents/migrations/0022_credential_rotation_inventory.down.sql +2 -0
- package/modules/agents/migrations/0022_credential_rotation_inventory.up.sql +7 -0
- package/modules/agents/migrations/0023_agents_retention_indexes.down.sql +2 -0
- package/modules/agents/migrations/0023_agents_retention_indexes.up.sql +9 -0
- package/modules/agents/migrations/0024_agent_meter_refusals.down.sql +3 -0
- package/modules/agents/migrations/0024_agent_meter_refusals.up.sql +22 -0
- package/modules/agents/migrations/0025_agent_list_indexes.down.sql +3 -0
- package/modules/agents/migrations/0025_agent_list_indexes.up.sql +11 -0
- package/modules/agents/module.json +30 -4
- package/modules/agents/package.json +2 -1
- package/modules/agents/spec/module.yaml +63 -5
- package/modules/agents/src/api/endpoints.ts +291 -33
- package/modules/agents/src/cli/commands.json +11 -0
- package/modules/agents/src/cli/index.ts +45 -0
- package/modules/agents/src/client/AgentDashboardWidget.tsrx +19 -11
- package/modules/agents/src/client/AgentDefinitionList.tsrx +53 -10
- package/modules/agents/src/client/AgentPlaygroundView.tsrx +4 -4
- package/modules/agents/src/client/AgentProceduresView.tsrx +2 -2
- package/modules/agents/src/client/AgentRunsView.tsrx +143 -40
- package/modules/agents/src/client/AgentsView.tsrx +109 -33
- package/modules/agents/src/client/api.ts +99 -21
- package/modules/agents/src/client/state.ts +97 -0
- package/modules/agents/src/domain/types.ts +44 -4
- package/modules/agents/src/platform.ts +42 -0
- package/modules/agents/src/server/action-execution.ts +201 -106
- package/modules/agents/src/server/runtime.ts +32 -0
- package/modules/agents/src/services/agent-service.ts +158 -30
- package/modules/agents/src/services/credential-rotation.ts +185 -0
- package/modules/agents/src/services/credential-vault.ts +71 -46
- package/modules/agents/src/services/data-classes.ts +176 -0
- package/modules/agents/src/services/database-repository.ts +393 -101
- package/modules/agents/src/services/metering.ts +111 -0
- package/modules/agents/src/services/migration.ts +109 -0
- package/modules/agents/src/services/module-agent-preflight.ts +17 -9
- package/modules/agents/src/services/notifications.ts +98 -0
- package/modules/agents/src/services/provider-repository.ts +9 -18
- package/modules/agents/src/services/provider-service.ts +1 -9
- package/modules/agents/src/services/reports.ts +107 -0
- package/modules/agents/src/services/repository.ts +86 -6
- package/modules/agents/src/services/usage-service.ts +2 -0
- package/modules/agents/src/services/worker.ts +114 -4
- package/modules/agents/src/settings.ts +14 -3
- package/modules/agents/translations/en.json +14 -4
- package/modules/agents/translations/pl.json +14 -4
- package/modules/approvals/migrations/0001_approvals_core.down.sql +3 -0
- package/modules/approvals/migrations/0001_approvals_core.up.sql +78 -0
- package/modules/approvals/migrations/0002_approvals_expiry_routing_role.down.sql +2 -0
- package/modules/approvals/migrations/0002_approvals_expiry_routing_role.up.sql +19 -0
- package/modules/approvals/migrations/0003_approvals_retention_indexes.down.sql +6 -0
- package/modules/approvals/migrations/0003_approvals_retention_indexes.up.sql +14 -0
- package/modules/approvals/migrations/0004_approvals_inbox_keyset_indexes.down.sql +5 -0
- package/modules/approvals/migrations/0004_approvals_inbox_keyset_indexes.up.sql +12 -0
- package/modules/approvals/migrations/README.md +3 -0
- package/modules/approvals/module.json +34 -0
- package/modules/approvals/package.json +43 -0
- package/modules/approvals/spec/module.yaml +318 -0
- package/modules/approvals/src/acl/permissions.ts +7 -0
- package/modules/approvals/src/api/endpoints.ts +457 -0
- package/modules/approvals/src/client/ApprovalRequestDrawer.tsrx +138 -0
- package/modules/approvals/src/client/ApprovalsView.tsrx +562 -0
- package/modules/approvals/src/client/PendingCountWidget.tsrx +52 -0
- package/modules/approvals/src/client/api.ts +203 -0
- package/modules/approvals/src/client/approvals.css +51 -0
- package/modules/approvals/src/client/contribution.tsrx +44 -0
- package/modules/approvals/src/client/index.ts +26 -0
- package/modules/approvals/src/client/navigation.ts +39 -0
- package/modules/approvals/src/client/pending-count.ts +26 -0
- package/modules/approvals/src/client/presentation.ts +52 -0
- package/modules/approvals/src/client/state.ts +141 -0
- package/modules/approvals/src/domain/capability.ts +95 -0
- package/modules/approvals/src/domain/types.ts +154 -0
- package/modules/approvals/src/index.ts +52 -0
- package/modules/approvals/src/platform.ts +128 -0
- package/modules/approvals/src/server/index.ts +42 -0
- package/modules/approvals/src/server/runtime.ts +181 -0
- package/modules/approvals/src/services/approvals-service.ts +557 -0
- package/modules/approvals/src/services/callbacks.ts +75 -0
- package/modules/approvals/src/services/data-classes.ts +167 -0
- package/modules/approvals/src/services/database-repository.ts +724 -0
- package/modules/approvals/src/services/eligibility.ts +121 -0
- package/modules/approvals/src/services/expiry-runner.ts +81 -0
- package/modules/approvals/src/services/index.ts +31 -0
- package/modules/approvals/src/services/migration.ts +222 -0
- package/modules/approvals/src/services/notifications.ts +95 -0
- package/modules/approvals/src/services/repository.ts +161 -0
- package/modules/approvals/src/services/service-error.ts +70 -0
- package/modules/approvals/src/settings.ts +102 -0
- package/modules/approvals/translations/en.json +104 -0
- package/modules/approvals/translations/pl.json +104 -0
- package/modules/audit/migrations/0001_audit_core.down.sql +8 -0
- package/modules/audit/migrations/0001_audit_core.up.sql +107 -0
- package/modules/audit/migrations/0002_audit_sweep_routing_role.down.sql +2 -0
- package/modules/audit/migrations/0002_audit_sweep_routing_role.up.sql +21 -0
- package/modules/audit/migrations/0003_audit_export_request.down.sql +12 -0
- package/modules/audit/migrations/0003_audit_export_request.up.sql +40 -0
- package/modules/audit/migrations/0004_audit_hold_seal_erasure.down.sql +17 -0
- package/modules/audit/migrations/0004_audit_hold_seal_erasure.up.sql +192 -0
- package/modules/audit/migrations/0005_audit_event_format.down.sql +17 -0
- package/modules/audit/migrations/0005_audit_event_format.up.sql +60 -0
- package/modules/audit/migrations/0006_audit_own_class_walks.down.sql +3 -0
- package/modules/audit/migrations/0006_audit_own_class_walks.up.sql +14 -0
- package/modules/audit/migrations/README.md +3 -0
- package/modules/audit/module.json +32 -0
- package/modules/audit/package.json +49 -0
- package/modules/audit/spec/module.yaml +809 -0
- package/modules/audit/src/acl/permissions.ts +7 -0
- package/modules/audit/src/api/endpoints.ts +315 -0
- package/modules/audit/src/cli/commands.json +95 -0
- package/modules/audit/src/cli/index.ts +658 -0
- package/modules/audit/src/client/DataClassesView.tsrx +420 -0
- package/modules/audit/src/client/ExportsView.tsrx +256 -0
- package/modules/audit/src/client/HoldsView.tsrx +604 -0
- package/modules/audit/src/client/SweepsView.tsrx +251 -0
- package/modules/audit/src/client/api.ts +185 -0
- package/modules/audit/src/client/contribution.tsrx +52 -0
- package/modules/audit/src/client/index.ts +23 -0
- package/modules/audit/src/client/navigation.ts +74 -0
- package/modules/audit/src/client/presentation.ts +105 -0
- package/modules/audit/src/client/state.ts +86 -0
- package/modules/audit/src/domain/data-classes.ts +16 -0
- package/modules/audit/src/domain/types.ts +339 -0
- package/modules/audit/src/index.ts +76 -0
- package/modules/audit/src/platform.ts +44 -0
- package/modules/audit/src/server/index.ts +177 -0
- package/modules/audit/src/server/runtime.ts +303 -0
- package/modules/audit/src/services/anchor-key.ts +143 -0
- package/modules/audit/src/services/anchor-rotation.ts +147 -0
- package/modules/audit/src/services/audit-runners.ts +278 -0
- package/modules/audit/src/services/backup-guard.ts +95 -0
- package/modules/audit/src/services/database-repository.ts +1946 -0
- package/modules/audit/src/services/declared-classes.ts +64 -0
- package/modules/audit/src/services/erasure-port.ts +126 -0
- package/modules/audit/src/services/erasure-service.ts +770 -0
- package/modules/audit/src/services/export-directory.ts +106 -0
- package/modules/audit/src/services/export-service.ts +714 -0
- package/modules/audit/src/services/hold-service.ts +295 -0
- package/modules/audit/src/services/index.ts +17 -0
- package/modules/audit/src/services/migration.ts +658 -0
- package/modules/audit/src/services/own-classes.ts +318 -0
- package/modules/audit/src/services/platform-version.ts +23 -0
- package/modules/audit/src/services/repository.ts +495 -0
- package/modules/audit/src/services/retention-service.ts +191 -0
- package/modules/audit/src/services/seal-service.ts +769 -0
- package/modules/audit/src/services/service-error.ts +61 -0
- package/modules/audit/src/services/subject-keys.ts +90 -0
- package/modules/audit/src/services/sweep-service.ts +298 -0
- package/modules/audit/src/services/zip.ts +217 -0
- package/modules/audit/src/settings.ts +69 -0
- package/modules/audit/translations/en.json +210 -0
- package/modules/audit/translations/pl.json +210 -0
- package/modules/auth/README.md +77 -29
- package/modules/auth/migrations/0016_external_identities.up.sql +16 -0
- package/modules/auth/migrations/0017_mfa_key_id.up.sql +8 -0
- package/modules/auth/migrations/0018_retire_bundled_module_scopes.up.sql +29 -0
- package/modules/auth/migrations/0019_notifications_member_scopes.up.sql +44 -0
- package/modules/auth/migrations/0020_identity_providers.up.sql +61 -0
- package/modules/auth/migrations/0021_membership_status.up.sql +19 -0
- package/modules/auth/migrations/0022_auth_provider_scopes.up.sql +45 -0
- package/modules/auth/migrations/0023_enterprise_module_scopes.down.sql +19 -0
- package/modules/auth/migrations/0023_enterprise_module_scopes.up.sql +71 -0
- package/modules/auth/migrations/0024_approvals_member_scopes.down.sql +22 -0
- package/modules/auth/migrations/0024_approvals_member_scopes.up.sql +48 -0
- package/modules/auth/migrations/0025_audit_holds_owner_scope.down.sql +21 -0
- package/modules/auth/migrations/0025_audit_holds_owner_scope.up.sql +47 -0
- package/modules/auth/migrations/0026_auth_export_keyset_indexes.down.sql +6 -0
- package/modules/auth/migrations/0026_auth_export_keyset_indexes.up.sql +15 -0
- package/modules/auth/migrations/0027_workflow_automation_profile_scopes.down.sql +34 -0
- package/modules/auth/migrations/0027_workflow_automation_profile_scopes.up.sql +72 -0
- package/modules/auth/migrations/0028_auth_member_search_prefix_indexes.down.sql +6 -0
- package/modules/auth/migrations/0028_auth_member_search_prefix_indexes.up.sql +21 -0
- package/modules/auth/migrations/0029_reports_exports_access_scopes.down.sql +22 -0
- package/modules/auth/migrations/0029_reports_exports_access_scopes.up.sql +56 -0
- package/modules/auth/migrations/0030_auth_membership_keyset_index.down.sql +4 -0
- package/modules/auth/migrations/0030_auth_membership_keyset_index.up.sql +10 -0
- package/modules/auth/migrations/0031_membership_scope_backfills_under_rls.down.sql +4 -0
- package/modules/auth/migrations/0031_membership_scope_backfills_under_rls.up.sql +31 -0
- package/modules/auth/migrations/0032_audit_actor_service.down.sql +9 -0
- package/modules/auth/migrations/0032_audit_actor_service.up.sql +10 -0
- package/modules/auth/migrations/0033_auth_account_keyset_indexes.down.sql +5 -0
- package/modules/auth/migrations/0033_auth_account_keyset_indexes.up.sql +23 -0
- package/modules/auth/module.json +3 -3
- package/modules/auth/package.json +2 -1
- package/modules/auth/spec/module.yaml +372 -3
- package/modules/auth/src/acl/scopes.ts +50 -6
- package/modules/auth/src/cli/commands.json +11 -0
- package/modules/auth/src/cli/greenfield.ts +2 -2
- package/modules/auth/src/cli/index.ts +14 -0
- package/modules/auth/src/cli/secrets.ts +114 -0
- package/modules/auth/src/client/AuthenticationCore.tsrx +61 -8
- package/modules/auth/src/client/api.ts +72 -6
- package/modules/auth/src/client/contribution.tsrx +23 -0
- package/modules/auth/src/client/index.ts +6 -0
- package/modules/auth/src/client/providers/IdentityProviderForm.tsrx +191 -0
- package/modules/auth/src/client/providers/IdentityProvidersView.tsrx +358 -0
- package/modules/auth/src/client/providers/api.ts +128 -0
- package/modules/auth/src/client/providers/provider-columns.tsrx +60 -0
- package/modules/auth/src/client/providers/state.ts +35 -0
- package/modules/auth/src/client/security/SecurityView.tsrx +9 -1
- package/modules/auth/src/client/state.ts +15 -1
- package/modules/auth/src/domain/types.ts +55 -0
- package/modules/auth/src/index.ts +11 -1
- package/modules/auth/src/middleware/authentication.ts +4 -0
- package/modules/auth/src/server/endpoints.ts +467 -171
- package/modules/auth/src/server/http.ts +3 -2
- package/modules/auth/src/server/index.ts +22 -1
- package/modules/auth/src/server/membership-endpoints.ts +62 -0
- package/modules/auth/src/server/mfa-enforcement.ts +156 -0
- package/modules/auth/src/server/oidc.ts +389 -0
- package/modules/auth/src/server/provider-endpoints.ts +246 -0
- package/modules/auth/src/server/provider-host.ts +77 -0
- package/modules/auth/src/server/runtime.ts +231 -55
- package/modules/auth/src/services/auth-service-error.ts +7 -2
- package/modules/auth/src/services/auth-service.ts +948 -51
- package/modules/auth/src/services/data-classes.ts +236 -0
- package/modules/auth/src/services/database-repository.ts +853 -71
- package/modules/auth/src/services/identity-provider-service.ts +571 -0
- package/modules/auth/src/services/mail-delivery.ts +16 -16
- package/modules/auth/src/services/mail-message.ts +54 -0
- package/modules/auth/src/services/mail-port.ts +24 -0
- package/modules/auth/src/services/mail-smtp.ts +85 -0
- package/modules/auth/src/services/mfa-rotation.ts +144 -0
- package/modules/auth/src/services/migration.ts +810 -0
- package/modules/auth/src/services/password.ts +14 -0
- package/modules/auth/src/services/provider-secret-rotation.ts +169 -0
- package/modules/auth/src/services/provider-secrets.ts +136 -0
- package/modules/auth/src/services/repository.ts +321 -5
- package/modules/auth/src/services/session-sweep-runner.ts +73 -0
- package/modules/auth/src/services/settings-store.ts +10 -83
- package/modules/auth/src/services/totp.ts +88 -62
- package/modules/auth/src/services/validation.ts +194 -7
- package/modules/auth/src/settings.ts +18 -0
- package/modules/auth/translations/en.json +84 -1
- package/modules/auth/translations/pl.json +84 -1
- package/modules/automations/migrations/0005_secret_rotation_inventory.down.sql +1 -0
- package/modules/automations/migrations/0005_secret_rotation_inventory.up.sql +6 -0
- package/modules/automations/migrations/0006_automations_list_sort_indexes.down.sql +4 -0
- package/modules/automations/migrations/0006_automations_list_sort_indexes.up.sql +11 -0
- package/modules/automations/module.json +24 -6
- package/modules/automations/package.json +4 -1
- package/modules/automations/spec/module.yaml +81 -7
- package/modules/automations/src/api/endpoints.ts +202 -28
- package/modules/automations/src/cli/commands.json +17 -0
- package/modules/automations/src/cli/index.ts +114 -0
- package/modules/automations/src/client/AutomationScheduleForm.tsrx +77 -19
- package/modules/automations/src/client/AutomationSchedulesView.tsrx +144 -40
- package/modules/automations/src/client/AutomationTriggersView.tsrx +131 -32
- package/modules/automations/src/client/api.ts +62 -19
- package/modules/automations/src/client/presentation.ts +20 -2
- package/modules/automations/src/client/state.ts +84 -0
- package/modules/automations/src/domain/cadence.ts +99 -3
- package/modules/automations/src/domain/cron.ts +366 -0
- package/modules/automations/src/domain/time-zone.ts +61 -0
- package/modules/automations/src/platform.ts +38 -4
- package/modules/automations/src/server/index.ts +11 -0
- package/modules/automations/src/server/runtime.ts +46 -22
- package/modules/{automations-workflows-integration/src/server/adapter.ts → automations/src/server/workflow-target.ts} +13 -14
- package/modules/{automations-workflows-integration/src/server/tools.ts → automations/src/server/workflow-tools.ts} +0 -0
- package/modules/automations/src/services/data-classes.ts +62 -0
- package/modules/automations/src/services/database-repository.ts +152 -38
- package/modules/automations/src/services/migration.ts +119 -9
- package/modules/automations/src/services/repository.ts +52 -1
- package/modules/automations/src/services/schedule-runner.ts +84 -0
- package/modules/automations/src/services/schedule-service.ts +152 -26
- package/modules/automations/src/services/secret-rotation.ts +176 -0
- package/modules/automations/src/services/secret-vault.ts +68 -41
- package/modules/automations/src/services/trigger-service.ts +13 -10
- package/modules/automations/translations/en.json +15 -2
- package/modules/automations/translations/pl.json +15 -2
- package/modules/connectors/migrations/0001_connectors_core.down.sql +3 -0
- package/modules/connectors/migrations/0001_connectors_core.up.sql +72 -0
- package/modules/connectors/migrations/0002_connectors_call_keys.down.sql +3 -0
- package/modules/connectors/migrations/0002_connectors_call_keys.up.sql +18 -0
- package/modules/connectors/migrations/README.md +3 -0
- package/modules/connectors/module.json +28 -0
- package/modules/{automations-workflows-integration → connectors}/package.json +27 -26
- package/modules/connectors/spec/module.yaml +447 -0
- package/modules/connectors/src/acl/permissions.ts +6 -0
- package/modules/connectors/src/agent/tools.ts +180 -0
- package/modules/connectors/src/api/endpoints.ts +572 -0
- package/modules/connectors/src/client/ConnectorCallsView.tsrx +358 -0
- package/modules/connectors/src/client/ConnectorForm.tsrx +424 -0
- package/modules/connectors/src/client/ConnectorsView.tsrx +711 -0
- package/modules/connectors/src/client/api.ts +281 -0
- package/modules/connectors/src/client/consent.ts +48 -0
- package/modules/connectors/src/client/contribution.tsrx +37 -0
- package/modules/connectors/src/client/index.ts +22 -0
- package/modules/connectors/src/client/navigation.ts +42 -0
- package/modules/connectors/src/client/presentation.ts +38 -0
- package/modules/connectors/src/client/state.ts +175 -0
- package/modules/connectors/src/domain/calls.ts +70 -0
- package/modules/connectors/src/domain/definitions.ts +190 -0
- package/modules/connectors/src/domain/http-json.ts +68 -0
- package/modules/connectors/src/domain/types.ts +185 -0
- package/modules/connectors/src/index.ts +64 -0
- package/modules/connectors/src/platform.ts +56 -0
- package/modules/connectors/src/server/index.ts +66 -0
- package/modules/connectors/src/server/runtime.ts +163 -0
- package/modules/connectors/src/services/call-service.ts +903 -0
- package/modules/connectors/src/services/connectors-service.ts +653 -0
- package/modules/connectors/src/services/credential-vault.ts +188 -0
- package/modules/connectors/src/services/data-classes.ts +158 -0
- package/modules/connectors/src/services/database-repository.ts +897 -0
- package/modules/connectors/src/services/egress.ts +261 -0
- package/modules/connectors/src/services/index.ts +19 -0
- package/modules/connectors/src/services/migration.ts +166 -0
- package/modules/connectors/src/services/repository.ts +175 -0
- package/modules/connectors/src/services/service-error.ts +46 -0
- package/modules/connectors/src/settings.ts +69 -0
- package/modules/connectors/translations/en.json +191 -0
- package/modules/connectors/translations/pl.json +191 -0
- package/modules/directory/migrations/0001_directory_core.down.sql +5 -0
- package/modules/directory/migrations/0001_directory_core.up.sql +111 -0
- package/modules/directory/migrations/README.md +3 -0
- package/modules/directory/module.json +27 -0
- package/modules/directory/package.json +46 -0
- package/modules/directory/spec/module.yaml +351 -0
- package/modules/directory/src/acl/permissions.ts +7 -0
- package/modules/directory/src/api/endpoints.ts +478 -0
- package/modules/directory/src/api/scim-endpoints.ts +516 -0
- package/modules/directory/src/client/GroupMappingsView.tsrx +430 -0
- package/modules/directory/src/client/ProvisioningLogView.tsrx +248 -0
- package/modules/directory/src/client/ScimTokensView.tsrx +587 -0
- package/modules/directory/src/client/api.ts +222 -0
- package/modules/directory/src/client/contribution.tsrx +46 -0
- package/modules/directory/src/client/index.ts +22 -0
- package/modules/directory/src/client/navigation.ts +57 -0
- package/modules/directory/src/client/presentation.ts +143 -0
- package/modules/directory/src/client/state.ts +173 -0
- package/modules/directory/src/domain/scim.ts +346 -0
- package/modules/directory/src/domain/types.ts +166 -0
- package/modules/directory/src/index.ts +44 -0
- package/modules/directory/src/platform.ts +43 -0
- package/modules/directory/src/server/index.ts +17 -0
- package/modules/directory/src/server/runtime.ts +124 -0
- package/modules/directory/src/services/auth-port.ts +127 -0
- package/modules/directory/src/services/data-classes.ts +41 -0
- package/modules/directory/src/services/database-repository.ts +1067 -0
- package/modules/directory/src/services/directory-service.ts +311 -0
- package/modules/directory/src/services/index.ts +43 -0
- package/modules/directory/src/services/migration.ts +146 -0
- package/modules/directory/src/services/provisioning-service.ts +1420 -0
- package/modules/directory/src/services/rate-limiter.ts +103 -0
- package/modules/directory/src/services/repository.ts +208 -0
- package/modules/directory/src/services/service-error.ts +42 -0
- package/modules/directory/src/services/token-service.ts +215 -0
- package/modules/directory/src/settings.ts +86 -0
- package/modules/directory/translations/en.json +185 -0
- package/modules/directory/translations/pl.json +185 -0
- package/modules/documents/migrations/0001_documents_core.down.sql +1 -0
- package/modules/documents/migrations/0001_documents_core.up.sql +35 -0
- package/modules/documents/migrations/0002_documents_files_page.down.sql +1 -0
- package/modules/documents/migrations/0002_documents_files_page.up.sql +6 -0
- package/modules/documents/migrations/README.md +3 -0
- package/modules/documents/module.json +28 -0
- package/modules/documents/package.json +49 -0
- package/modules/documents/spec/module.yaml +247 -0
- package/modules/documents/src/acl/permissions.ts +6 -0
- package/modules/documents/src/api/endpoints.ts +401 -0
- package/modules/documents/src/client/DocumentUploader.tsrx +148 -0
- package/modules/documents/src/client/DocumentsView.tsrx +540 -0
- package/modules/documents/src/client/api.ts +209 -0
- package/modules/documents/src/client/contribution.tsrx +29 -0
- package/modules/documents/src/client/download.ts +70 -0
- package/modules/documents/src/client/index.ts +22 -0
- package/modules/documents/src/client/navigation.ts +25 -0
- package/modules/documents/src/client/presentation.ts +110 -0
- package/modules/documents/src/client/state.ts +117 -0
- package/modules/documents/src/domain/attachments.ts +84 -0
- package/modules/documents/src/domain/types.ts +80 -0
- package/modules/documents/src/index.ts +46 -0
- package/modules/documents/src/platform.ts +61 -0
- package/modules/documents/src/server/index.ts +30 -0
- package/modules/documents/src/server/runtime.ts +107 -0
- package/modules/documents/src/services/attachments.ts +39 -0
- package/modules/documents/src/services/data-classes.ts +25 -0
- package/modules/documents/src/services/database-repository.ts +259 -0
- package/modules/documents/src/services/documents-service.ts +586 -0
- package/modules/documents/src/services/index.ts +18 -0
- package/modules/documents/src/services/migration.ts +82 -0
- package/modules/documents/src/services/repository.ts +48 -0
- package/modules/documents/src/settings.ts +107 -0
- package/modules/documents/translations/en.json +111 -0
- package/modules/documents/translations/pl.json +111 -0
- package/modules/exports/migrations/0001_exports_core.down.sql +2 -0
- package/modules/exports/migrations/0001_exports_core.up.sql +28 -0
- package/modules/exports/migrations/0002_exports_job_routing_role.down.sql +4 -0
- package/modules/exports/migrations/0002_exports_job_routing_role.up.sql +21 -0
- package/modules/exports/migrations/README.md +3 -0
- package/modules/exports/module.json +28 -0
- package/modules/exports/package.json +44 -0
- package/modules/exports/spec/module.yaml +229 -0
- package/modules/exports/src/acl/permissions.ts +6 -0
- package/modules/exports/src/api/endpoints.ts +211 -0
- package/modules/exports/src/client/ExportsView.tsrx +327 -0
- package/modules/exports/src/client/api.ts +133 -0
- package/modules/exports/src/client/contribution.tsrx +31 -0
- package/modules/exports/src/client/index.ts +20 -0
- package/modules/exports/src/client/navigation.ts +25 -0
- package/modules/exports/src/client/presentation.ts +53 -0
- package/modules/exports/src/client/state.ts +56 -0
- package/modules/exports/src/domain/lists.ts +29 -0
- package/modules/exports/src/domain/types.ts +120 -0
- package/modules/exports/src/index.ts +41 -0
- package/modules/exports/src/platform.ts +80 -0
- package/modules/exports/src/server/index.ts +51 -0
- package/modules/exports/src/server/runtime.ts +160 -0
- package/modules/exports/src/services/data-classes.ts +56 -0
- package/modules/exports/src/services/database-repository.ts +405 -0
- package/modules/exports/src/services/export-runner.ts +123 -0
- package/modules/exports/src/services/export-service.ts +356 -0
- package/modules/exports/src/services/index.ts +6 -0
- package/modules/exports/src/services/list-registry.ts +105 -0
- package/modules/exports/src/services/migration.ts +89 -0
- package/modules/exports/src/services/repository.ts +97 -0
- package/modules/exports/src/settings.ts +70 -0
- package/modules/exports/translations/en.json +69 -0
- package/modules/exports/translations/pl.json +69 -0
- package/modules/import/migrations/0001_import_core.down.sql +6 -0
- package/modules/import/migrations/0001_import_core.up.sql +61 -0
- package/modules/import/migrations/0002_import_job_routing_role.down.sql +4 -0
- package/modules/import/migrations/0002_import_job_routing_role.up.sql +20 -0
- package/modules/import/migrations/0003_import_jobs_export_index.down.sql +1 -0
- package/modules/import/migrations/0003_import_jobs_export_index.up.sql +7 -0
- package/modules/import/migrations/0004_import_jobs_traceparent.down.sql +1 -0
- package/modules/import/migrations/0004_import_jobs_traceparent.up.sql +7 -0
- package/modules/import/migrations/README.md +3 -0
- package/modules/import/module.json +37 -0
- package/modules/import/package.json +50 -0
- package/modules/import/spec/module.yaml +335 -0
- package/modules/import/src/acl/permissions.ts +6 -0
- package/modules/import/src/api/endpoints.ts +400 -0
- package/modules/import/src/client/ImportJobDrawer.tsrx +229 -0
- package/modules/import/src/client/ImportsView.tsrx +455 -0
- package/modules/import/src/client/NewImportForm.tsrx +274 -0
- package/modules/import/src/client/api.ts +243 -0
- package/modules/import/src/client/contribution.tsrx +29 -0
- package/modules/import/src/client/index.ts +23 -0
- package/modules/import/src/client/navigation.ts +25 -0
- package/modules/import/src/client/presentation.ts +59 -0
- package/modules/import/src/client/state.ts +43 -0
- package/modules/import/src/domain/csv.ts +258 -0
- package/modules/import/src/domain/ports.ts +157 -0
- package/modules/import/src/domain/types.ts +179 -0
- package/modules/import/src/index.ts +58 -0
- package/modules/import/src/platform.ts +60 -0
- package/modules/import/src/server/index.ts +49 -0
- package/modules/import/src/server/runtime.ts +158 -0
- package/modules/import/src/services/csv-source.ts +121 -0
- package/modules/import/src/services/data-classes.ts +63 -0
- package/modules/import/src/services/database-repository.ts +780 -0
- package/modules/import/src/services/import-runner.ts +127 -0
- package/modules/import/src/services/import-service.ts +872 -0
- package/modules/import/src/services/index.ts +6 -0
- package/modules/import/src/services/migration.ts +156 -0
- package/modules/import/src/services/port-registry.ts +158 -0
- package/modules/import/src/services/repository.ts +147 -0
- package/modules/import/src/settings.ts +70 -0
- package/modules/import/translations/en.json +175 -0
- package/modules/import/translations/pl.json +175 -0
- package/modules/metering/migrations/0001_metering_core.down.sql +6 -0
- package/modules/metering/migrations/0001_metering_core.up.sql +119 -0
- package/modules/metering/migrations/0002_metering_bucket_export.down.sql +3 -0
- package/modules/metering/migrations/0002_metering_bucket_export.up.sql +5 -0
- package/modules/metering/migrations/README.md +3 -0
- package/modules/metering/module.json +46 -0
- package/modules/metering/package.json +50 -0
- package/modules/metering/spec/module.yaml +269 -0
- package/modules/metering/src/acl/permissions.ts +5 -0
- package/modules/metering/src/api/endpoints.ts +104 -0
- package/modules/metering/src/cli/commands.json +28 -0
- package/modules/metering/src/cli/index.ts +246 -0
- package/modules/metering/src/client/LimitsView.tsrx +170 -0
- package/modules/metering/src/client/UsageSummaryWidget.tsrx +63 -0
- package/modules/metering/src/client/UsageView.tsrx +205 -0
- package/modules/metering/src/client/api.ts +91 -0
- package/modules/metering/src/client/contribution.tsrx +42 -0
- package/modules/metering/src/client/index.ts +26 -0
- package/modules/metering/src/client/navigation.ts +54 -0
- package/modules/metering/src/client/presentation.ts +63 -0
- package/modules/metering/src/client/state.ts +31 -0
- package/modules/metering/src/domain/meters.ts +100 -0
- package/modules/metering/src/domain/types.ts +71 -0
- package/modules/metering/src/index.ts +51 -0
- package/modules/metering/src/platform.ts +84 -0
- package/modules/metering/src/server/index.ts +40 -0
- package/modules/metering/src/server/runtime.ts +165 -0
- package/modules/metering/src/services/data-classes.ts +34 -0
- package/modules/metering/src/services/database-repository.ts +574 -0
- package/modules/metering/src/services/index.ts +9 -0
- package/modules/metering/src/services/meter-registry.ts +145 -0
- package/modules/metering/src/services/metering-service.ts +441 -0
- package/modules/metering/src/services/migration.ts +183 -0
- package/modules/metering/src/services/notifications.ts +75 -0
- package/modules/metering/src/services/reports.ts +105 -0
- package/modules/metering/src/services/repository.ts +132 -0
- package/modules/metering/src/services/service-error.ts +46 -0
- package/modules/metering/src/settings.ts +47 -0
- package/modules/metering/translations/en.json +68 -0
- package/modules/metering/translations/pl.json +68 -0
- package/modules/notifications/migrations/0001_notifications_core.down.sql +1 -0
- package/modules/notifications/migrations/0001_notifications_core.up.sql +26 -0
- package/modules/notifications/migrations/0002_notifications_preferences.down.sql +1 -0
- package/modules/notifications/migrations/0002_notifications_preferences.up.sql +17 -0
- package/modules/notifications/migrations/0003_notifications_webhook_subscriptions.down.sql +1 -0
- package/modules/notifications/migrations/0003_notifications_webhook_subscriptions.up.sql +30 -0
- package/modules/notifications/migrations/0004_notifications_deliveries.down.sql +1 -0
- package/modules/notifications/migrations/0004_notifications_deliveries.up.sql +35 -0
- package/modules/notifications/migrations/0005_notifications_delivery_routing_role.down.sql +2 -0
- package/modules/notifications/migrations/0005_notifications_delivery_routing_role.up.sql +17 -0
- package/modules/notifications/migrations/0006_notifications_delivery_title.down.sql +1 -0
- package/modules/notifications/migrations/0006_notifications_delivery_title.up.sql +11 -0
- package/modules/notifications/migrations/0007_notifications_secret_rotation_inventory.down.sql +2 -0
- package/modules/notifications/migrations/0007_notifications_secret_rotation_inventory.up.sql +19 -0
- package/modules/notifications/migrations/0008_notifications_delivery_claim.down.sql +8 -0
- package/modules/notifications/migrations/0008_notifications_delivery_claim.up.sql +19 -0
- package/modules/notifications/migrations/0009_notifications_kind_approvals.down.sql +16 -0
- package/modules/notifications/migrations/0009_notifications_kind_approvals.up.sql +18 -0
- package/modules/notifications/migrations/0010_notifications_kind_meter_threshold.down.sql +16 -0
- package/modules/notifications/migrations/0010_notifications_kind_meter_threshold.up.sql +18 -0
- package/modules/notifications/migrations/0011_notifications_retention_keyset.down.sql +5 -0
- package/modules/notifications/migrations/0011_notifications_retention_keyset.up.sql +15 -0
- package/modules/notifications/migrations/0012_notifications_email_channel.down.sql +12 -0
- package/modules/notifications/migrations/0012_notifications_email_channel.up.sql +38 -0
- package/modules/notifications/migrations/0013_notifications_list_pages.down.sql +5 -0
- package/modules/notifications/migrations/0013_notifications_list_pages.up.sql +13 -0
- package/modules/notifications/migrations/README.md +3 -0
- package/modules/notifications/module.json +32 -0
- package/modules/notifications/package.json +49 -0
- package/modules/notifications/spec/module.yaml +718 -0
- package/modules/notifications/src/acl/permissions.ts +11 -0
- package/modules/notifications/src/api/endpoints.ts +814 -0
- package/modules/notifications/src/cli/commands.json +17 -0
- package/modules/notifications/src/cli/index.ts +126 -0
- package/modules/notifications/src/client/DeliveriesView.tsrx +483 -0
- package/modules/notifications/src/client/FactList.tsrx +24 -0
- package/modules/notifications/src/client/NotificationPreferencesView.tsrx +240 -0
- package/modules/notifications/src/client/NotificationsInboxView.tsrx +592 -0
- package/modules/notifications/src/client/UnreadCountWidget.tsrx +62 -0
- package/modules/notifications/src/client/WebhookForm.tsrx +297 -0
- package/modules/notifications/src/client/WebhooksView.tsrx +637 -0
- package/modules/notifications/src/client/api.ts +382 -0
- package/modules/notifications/src/client/contribution.tsrx +83 -0
- package/modules/notifications/src/client/inbox.ts +41 -0
- package/modules/notifications/src/client/index.ts +29 -0
- package/modules/notifications/src/client/navigation.ts +92 -0
- package/modules/notifications/src/client/notifications.css +70 -0
- package/modules/notifications/src/client/presentation.ts +81 -0
- package/modules/notifications/src/client/state.ts +246 -0
- package/modules/notifications/src/client/unread-count.ts +26 -0
- package/modules/notifications/src/domain/locale.ts +47 -0
- package/modules/notifications/src/domain/publish.ts +46 -0
- package/modules/notifications/src/domain/types.ts +186 -0
- package/modules/notifications/src/index.ts +62 -0
- package/modules/notifications/src/platform.ts +85 -0
- package/modules/notifications/src/server/index.ts +82 -0
- package/modules/notifications/src/server/runtime.ts +251 -0
- package/modules/notifications/src/services/data-classes.ts +139 -0
- package/modules/notifications/src/services/database-repository.ts +1334 -0
- package/modules/notifications/src/services/delivery-payload.ts +93 -0
- package/modules/notifications/src/services/delivery-runner.ts +170 -0
- package/modules/notifications/src/services/delivery-service.ts +811 -0
- package/modules/notifications/src/services/egress.ts +239 -0
- package/modules/notifications/src/services/email-channel.ts +93 -0
- package/modules/notifications/src/services/index.ts +23 -0
- package/modules/notifications/src/services/migration.ts +572 -0
- package/modules/notifications/src/services/notifications-service.ts +297 -0
- package/modules/notifications/src/services/paging.ts +60 -0
- package/modules/notifications/src/services/publish-service.ts +133 -0
- package/modules/notifications/src/services/repository.ts +342 -0
- package/modules/notifications/src/services/secret-rotation.ts +177 -0
- package/modules/notifications/src/services/secret-vault.ts +168 -0
- package/modules/notifications/src/services/service-error.ts +67 -0
- package/modules/notifications/src/services/signature.ts +81 -0
- package/modules/notifications/src/services/webhook-service.ts +307 -0
- package/modules/notifications/src/settings.ts +130 -0
- package/modules/notifications/translations/en.json +255 -0
- package/modules/notifications/translations/pl.json +255 -0
- package/modules/profile/module.json +3 -3
- package/modules/profile/package.json +1 -1
- package/modules/profile/spec/module.yaml +3 -3
- package/modules/profile/src/services/database-repository.ts +3 -13
- package/modules/reports/module.json +28 -0
- package/modules/reports/package.json +42 -0
- package/modules/reports/spec/module.yaml +231 -0
- package/modules/reports/src/acl/permissions.ts +5 -0
- package/modules/reports/src/api/endpoints.ts +72 -0
- package/modules/reports/src/client/ReportsSummaryWidget.tsrx +52 -0
- package/modules/reports/src/client/ReportsView.tsrx +246 -0
- package/modules/reports/src/client/api.ts +65 -0
- package/modules/reports/src/client/contribution.tsrx +36 -0
- package/modules/reports/src/client/index.ts +18 -0
- package/modules/reports/src/client/navigation.ts +39 -0
- package/modules/reports/src/client/presentation.ts +123 -0
- package/modules/reports/src/client/state.ts +28 -0
- package/modules/reports/src/domain/providers.ts +115 -0
- package/modules/reports/src/domain/types.ts +44 -0
- package/modules/reports/src/index.ts +47 -0
- package/modules/reports/src/platform.ts +37 -0
- package/modules/reports/src/server/index.ts +21 -0
- package/modules/reports/src/server/runtime.ts +40 -0
- package/modules/reports/src/services/index.ts +17 -0
- package/modules/reports/src/services/provider-registry.ts +144 -0
- package/modules/reports/src/services/range.ts +65 -0
- package/modules/reports/src/services/reports-service.ts +316 -0
- package/modules/reports/src/services/service-error.ts +26 -0
- package/modules/reports/src/settings.ts +49 -0
- package/modules/reports/translations/en.json +35 -0
- package/modules/reports/translations/pl.json +35 -0
- package/modules/sandbox/module.json +4 -4
- package/modules/sandbox/package.json +1 -1
- package/modules/sandbox/spec/module.yaml +3 -3
- package/modules/sandbox/src/services/database-repository.ts +14 -23
- package/modules/sandbox/src/services/directory.ts +16 -0
- package/modules/sandbox/src/services/sandbox-service.ts +13 -11
- package/modules/search/migrations/0001_search_core.down.sql +1 -0
- package/modules/search/migrations/0001_search_core.up.sql +22 -0
- package/modules/search/migrations/0002_search_recent_export.down.sql +3 -0
- package/modules/search/migrations/0002_search_recent_export.up.sql +5 -0
- package/modules/search/migrations/README.md +3 -0
- package/modules/search/module.json +28 -0
- package/modules/search/package.json +43 -0
- package/modules/search/spec/module.yaml +177 -0
- package/modules/search/src/acl/permissions.ts +5 -0
- package/modules/search/src/api/endpoints.ts +221 -0
- package/modules/search/src/client/SearchView.tsrx +346 -0
- package/modules/search/src/client/api.ts +157 -0
- package/modules/search/src/client/contribution.tsrx +31 -0
- package/modules/search/src/client/index.ts +17 -0
- package/modules/search/src/client/navigation.ts +97 -0
- package/modules/search/src/client/search.css +56 -0
- package/modules/search/src/client/state.ts +113 -0
- package/modules/search/src/domain/data-classes.ts +73 -0
- package/modules/search/src/domain/providers.ts +88 -0
- package/modules/search/src/domain/types.ts +56 -0
- package/modules/search/src/index.ts +46 -0
- package/modules/search/src/platform.ts +42 -0
- package/modules/search/src/server/index.ts +25 -0
- package/modules/search/src/server/runtime.ts +123 -0
- package/modules/search/src/services/database-repository.ts +163 -0
- package/modules/search/src/services/index.ts +21 -0
- package/modules/search/src/services/migration.ts +65 -0
- package/modules/search/src/services/provider-registry.ts +137 -0
- package/modules/search/src/services/repository.ts +43 -0
- package/modules/search/src/services/search-service.ts +442 -0
- package/modules/search/src/services/service-error.ts +35 -0
- package/modules/search/src/settings.ts +68 -0
- package/modules/search/translations/en.json +45 -0
- package/modules/search/translations/pl.json +45 -0
- package/modules/system/module.json +2 -2
- package/modules/system/package.json +1 -1
- package/modules/system/spec/module.yaml +30 -3
- package/modules/system/src/client/FlagsPanel.tsrx +127 -0
- package/modules/system/src/client/ModuleSettingRow.tsrx +17 -7
- package/modules/system/src/client/ModuleSettingsSection.tsrx +10 -71
- package/modules/system/src/client/ModulesView.tsrx +91 -65
- package/modules/system/src/client/flags.ts +35 -0
- package/modules/system/src/client/index.ts +8 -0
- package/modules/system/src/client/navigation.ts +8 -0
- package/modules/system/src/client/settings-state.ts +159 -0
- package/modules/system/src/client/state.ts +2 -0
- package/modules/system/src/domain/time-zone.ts +105 -0
- package/modules/system/src/index.ts +12 -0
- package/modules/system/src/platform.ts +5 -1
- package/modules/system/src/server/endpoints.ts +72 -21
- package/modules/system/src/settings.ts +28 -0
- package/modules/system/translations/en.json +17 -0
- package/modules/system/translations/pl.json +17 -0
- package/modules/users/module.json +30 -4
- package/modules/users/package.json +4 -1
- package/modules/users/spec/module.yaml +290 -7
- package/modules/users/src/api/endpoints.ts +228 -15
- package/modules/users/src/client/InviteMemberForm.tsrx +2 -2
- package/modules/users/src/client/MemberDrawer.tsrx +142 -26
- package/modules/users/src/client/UserAccountForm.tsrx +2 -2
- package/modules/users/src/client/UsersView.tsrx +432 -71
- package/modules/users/src/client/api.ts +106 -12
- package/modules/users/src/client/contribution.tsrx +5 -0
- package/modules/users/src/client/member-columns.tsrx +22 -9
- package/modules/users/src/client/state.ts +172 -7
- package/modules/users/src/domain/lists.ts +9 -0
- package/modules/users/src/index.ts +11 -0
- package/modules/users/src/platform.ts +50 -1
- package/modules/users/src/services/member-export.ts +51 -0
- package/modules/users/src/services/member-import.ts +249 -0
- package/modules/users/src/services/member-search.ts +145 -0
- package/modules/users/src/services/users-service.ts +117 -4
- package/modules/users/translations/en.json +57 -8
- package/modules/users/translations/pl.json +57 -8
- package/modules/workflows/migrations/0004_payload_rotation_inventory.up.sql +17 -0
- package/modules/workflows/migrations/0005_workflows_human_approval.up.sql +28 -0
- package/modules/workflows/migrations/0006_workflows_retention_indexes.up.sql +11 -0
- package/modules/workflows/migrations/0007_workflows_erasure_subject_indexes.up.sql +17 -0
- package/modules/workflows/migrations/0008_workflows_subject_account.up.sql +24 -0
- package/modules/workflows/migrations/0009_workflows_definition_list_indexes.up.sql +9 -0
- package/modules/workflows/module.json +34 -6
- package/modules/workflows/package.json +2 -1
- package/modules/workflows/spec/module.yaml +26 -9
- package/modules/workflows/src/api/endpoints.ts +131 -25
- package/modules/workflows/src/cli/commands.json +17 -0
- package/modules/workflows/src/cli/index.ts +114 -0
- package/modules/workflows/src/client/WorkflowExecutionHistory.tsrx +36 -27
- package/modules/workflows/src/client/WorkflowInspector.tsrx +116 -0
- package/modules/workflows/src/client/WorkflowNodePalette.tsrx +1 -0
- package/modules/workflows/src/client/WorkflowsView.tsrx +236 -99
- package/modules/workflows/src/client/api.ts +54 -34
- package/modules/workflows/src/client/canvas-model.ts +12 -0
- package/modules/workflows/src/client/state.ts +95 -0
- package/modules/workflows/src/domain/events.ts +25 -11
- package/modules/workflows/src/domain/graph.ts +135 -1
- package/modules/workflows/src/domain/types.ts +91 -4
- package/modules/workflows/src/platform.ts +12 -0
- package/modules/workflows/src/server/runtime.ts +78 -5
- package/modules/workflows/src/services/approvals.ts +62 -0
- package/modules/workflows/src/services/cursors.ts +37 -0
- package/modules/workflows/src/services/data-classes.ts +232 -0
- package/modules/workflows/src/services/database-repository.ts +660 -171
- package/modules/workflows/src/services/migration.ts +240 -0
- package/modules/workflows/src/services/notifications.ts +98 -0
- package/modules/workflows/src/services/payload-codec.ts +51 -28
- package/modules/workflows/src/services/payload-rotation.ts +171 -0
- package/modules/workflows/src/services/repository.ts +123 -8
- package/modules/workflows/src/services/simulation.ts +7 -0
- package/modules/workflows/src/services/worker.ts +446 -25
- package/modules/workflows/src/services/workflows-service.ts +264 -103
- package/modules/workflows/translations/en.json +12 -4
- package/modules/workflows/translations/pl.json +12 -4
- package/modules.json +48 -4
- package/package.json +64 -6
- package/packages/client/package.json +1 -0
- package/packages/client/src/ApplicationShell.tsrx +43 -0
- package/packages/client/src/contributions.ts +55 -0
- package/packages/client/src/i18n/locales/en.json +5 -0
- package/packages/client/src/i18n/locales/pl.json +5 -0
- package/packages/client/src/index.ts +13 -1
- package/packages/client/src/routing.ts +22 -0
- package/packages/client/src/shell/CommandPalette.tsrx +223 -11
- package/packages/client/src/shell/command-search.ts +126 -0
- package/packages/client/src/shell/command.ts +30 -0
- package/packages/client/src/shell/navigation.ts +12 -0
- package/packages/client/src/shell/palette-keys.ts +27 -0
- package/packages/client/src/shell/shell.css +7 -0
- package/packages/contracts/schemas/module-spec.schema.json +287 -1
- package/packages/contracts/schemas/module.schema.json +25 -0
- package/packages/contracts/src/index.ts +144 -1
- package/packages/database/src/backup.ts +179 -0
- package/packages/database/src/decoders.ts +25 -0
- package/packages/database/src/index.ts +17 -0
- package/packages/database/src/record-history.ts +5 -14
- package/packages/harness/src/index.ts +2 -0
- package/packages/harness/src/runtime.ts +218 -1
- package/packages/harness/src/tool-adapters.ts +19 -1
- package/packages/kernel/src/acl.ts +179 -0
- package/packages/kernel/src/capability-registry.ts +69 -2
- package/packages/kernel/src/data-class-registry.ts +354 -0
- package/packages/kernel/src/index.ts +65 -4
- package/packages/kernel/src/keyring.ts +208 -0
- package/packages/kernel/src/module-compatibility.ts +35 -4
- package/packages/kernel/src/module-registry.ts +49 -2
- package/packages/kernel/src/module-settings.ts +189 -27
- package/packages/server/package.json +2 -1
- package/packages/server/src/composition.ts +38 -0
- package/packages/server/src/endpoint.ts +104 -47
- package/packages/server/src/export/csv.ts +34 -0
- package/packages/server/src/export/definition.ts +346 -0
- package/packages/server/src/export/index.ts +61 -0
- package/packages/server/src/export/run.ts +116 -0
- package/packages/server/src/index.ts +155 -0
- package/packages/server/src/jobs/index.ts +93 -0
- package/packages/server/src/jobs/runner.ts +486 -0
- package/packages/server/src/log.ts +291 -0
- package/packages/server/src/mail/config.ts +184 -0
- package/packages/server/src/mail/contracts.ts +251 -0
- package/packages/server/src/mail/index.ts +31 -0
- package/packages/server/src/mail/port.ts +101 -0
- package/packages/server/src/mail/smtp.ts +191 -0
- package/packages/server/src/mail/template.ts +105 -0
- package/packages/server/src/metrics.ts +447 -0
- package/packages/server/src/pagination.ts +246 -0
- package/packages/server/src/trace/context.ts +103 -0
- package/packages/server/src/trace/egress.ts +66 -0
- package/packages/server/src/trace/error-sink.ts +296 -0
- package/packages/server/src/trace/exporter.ts +295 -0
- package/packages/server/src/trace/index.ts +60 -0
- package/packages/server/src/trace/job-sink.ts +172 -0
- package/packages/server/src/trace/tracer.ts +338 -0
- package/packages/server/src/web.ts +5 -1
- package/packages/storage/package.json +40 -0
- package/packages/storage/src/config.ts +189 -0
- package/packages/storage/src/content-type.ts +124 -0
- package/packages/storage/src/contracts.ts +112 -0
- package/packages/storage/src/envelope.ts +189 -0
- package/packages/storage/src/index.ts +43 -0
- package/packages/storage/src/local.ts +75 -0
- package/packages/storage/src/port.ts +251 -0
- package/packages/storage/src/read-token.ts +130 -0
- package/packages/storage/src/s3.ts +144 -0
- package/packages/storage/src/scanner.ts +22 -0
- package/packages/storage/src/sigv4.ts +104 -0
- package/packages/storage/src/store.ts +13 -0
- package/packages/ui/package.json +1 -0
- package/packages/ui/src/components/Button.tsrx +3 -0
- package/packages/ui/src/components/ConfirmDialog.tsrx +13 -2
- package/packages/ui/src/components/DateField.tsrx +92 -0
- package/packages/ui/src/components/DatePicker.tsrx +525 -0
- package/packages/ui/src/components/DateRangeField.tsrx +93 -0
- package/packages/ui/src/components/Drawer.tsrx +10 -1
- package/packages/ui/src/components/FileUpload.tsrx +158 -0
- package/packages/ui/src/components/Pagination.tsrx +130 -0
- package/packages/ui/src/components/Select.tsrx +78 -0
- package/packages/ui/src/components/Table.tsrx +498 -81
- package/packages/ui/src/components/Tabs.tsrx +53 -0
- package/packages/ui/src/components/ToastHost.tsrx +48 -0
- package/packages/ui/src/components/calendar.ts +243 -0
- package/packages/ui/src/components/date-field.ts +62 -0
- package/packages/ui/src/components/file-upload.ts +49 -0
- package/packages/ui/src/components/focus-trap.ts +62 -0
- package/packages/ui/src/components/pagination.ts +68 -0
- package/packages/ui/src/components/table-sorting.ts +49 -0
- package/packages/ui/src/components/tabs.ts +61 -0
- package/packages/ui/src/components/toast-store.ts +116 -0
- package/packages/ui/src/icons/Icon.tsrx +5 -0
- package/packages/ui/src/index.ts +45 -0
- package/packages/ui/src/styles/components.css +598 -0
- package/modules/automations-workflows-integration/module.json +0 -27
- package/modules/automations-workflows-integration/spec/module.yaml +0 -93
- package/modules/automations-workflows-integration/src/index.ts +0 -14
- package/modules/automations-workflows-integration/src/platform.ts +0 -24
- package/modules/automations-workflows-integration/src/server/index.ts +0 -11
- package/modules/automations-workflows-integration/translations/en.json +0 -21
- package/modules/automations-workflows-integration/translations/pl.json +0 -21
- package/modules/workflows/src/services/cursor-codec.ts +0 -62
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
schemaVersion: 1
|
|
2
2
|
id: agents.core
|
|
3
|
-
specVersion: 0.9
|
|
3
|
+
specVersion: 0.12.9
|
|
4
4
|
status: approved
|
|
5
5
|
name: Agentic Core
|
|
6
6
|
description: Provides tenant-created and module-owned business agent definitions, tenant-scoped provider connections, reusable procedures, durable streamed execution, run history, and the public run queue used by optional automation modules.
|
|
@@ -14,15 +14,26 @@ capabilities:
|
|
|
14
14
|
- cli
|
|
15
15
|
dependencies:
|
|
16
16
|
- id: system.core
|
|
17
|
-
range: 0.
|
|
17
|
+
range: ^0.7.0
|
|
18
18
|
- id: auth.core
|
|
19
|
-
range: 0.
|
|
19
|
+
range: ^0.13.0
|
|
20
|
+
- id: metering.core
|
|
21
|
+
range: ^0.1.0
|
|
22
|
+
- id: reports.core
|
|
23
|
+
range: ^0.1.0
|
|
24
|
+
requires:
|
|
25
|
+
- id: notifications.publish.v1
|
|
26
|
+
optional: true
|
|
27
|
+
- id: metering.meters.v1
|
|
28
|
+
- id: reports.v1
|
|
29
|
+
optional: true
|
|
20
30
|
tenancy: required
|
|
21
31
|
locales:
|
|
22
32
|
- en
|
|
23
33
|
- pl
|
|
24
34
|
invariants:
|
|
25
35
|
- Every agent managed by agents.core is a business agent with explicit ownership. A tenant-created definition is owned by one tenant; a module-owned definition is owned by one enabled module and receives a separate tenant-scoped execution binding. Sandbox coding specialists are outside agents.core. Every binding, run, and repository query receives the trusted tenant identifier.
|
|
36
|
+
- agents.core registers the report provider agents.runs through the public capability reports.v1 at composition when reports.core is present, and continues without it when it is not. The provider answers the runs and token totals of the requested range as tiles and runs and tokens per day as series, read from the existing agent run cost rollup inside this module's own tenant transaction; it prices nothing, writes nothing and opens no other module's tables. It names itself, each tile and each line with a key of this module's own translation bundle beside the English literal, and hands the reader's time budget to that transaction so the statement is cancelled when the budget expires.
|
|
26
37
|
- An enabled module may register immutable business agent behavior during platform composition with defineAgent. Its stable identity is derived from module id and agent key, its positive definition revision is supplied by the module, and malformed or duplicate identities fail platform boot before workers start.
|
|
27
38
|
- Module-owned instructions, names, maximum tool allowlists, and execution limits are read-only module source. A tenant administrator may bind an available provider and model, pause the binding, and reduce its enabled tool set, but cannot broaden the module allowlist or edit the module behavior in the Agents UI.
|
|
28
39
|
- An unconfigured module-owned agent is visible as unconfigured but cannot be activated, published in a workflow, or executed until its tenant binding names a usable provider and model.
|
|
@@ -67,7 +78,12 @@ invariants:
|
|
|
67
78
|
- Business actions exposed to workflows are explicit versioned contracts. Only read and workspace-write risks are eligible, input and output are schema checked, and every invocation is persisted before execution.
|
|
68
79
|
- Workflow action invocations receive a trusted actor, permission snapshot, idempotency key, and AbortSignal. Secrets, raw input, and raw output never enter audit metadata.
|
|
69
80
|
- Every request-time read and write runs on a tenant-scoped database handle. The worker recovery polls are the only cross-tenant reads, they run on a separate read-only role, and the module agent catalog is reconciled at boot on the schema-owner lease that runs migrations.
|
|
81
|
+
- Run outcome notifications are an optional integration. When a durable run reaches a terminal state the worker resolves notifications.publish.v1 from the platform capability registry at that moment, never at composition time, and publishes the outcome keyed by the run id. notifications.core is never a declared dependency. An absent capability, a run with no person behind it, and a run a workflow owns publish nothing. A publisher failure is logged once at warning level and never changes the settled run, and a repeated terminal step reports the same outcome instead of a second notification.
|
|
70
82
|
- Every table that carries tenant data enables and forces row-level security with a policy bound to the transaction-local tenant, including the child tables that hang off a run, a definition or a provider connection. A read by a caller-supplied parent id therefore cannot cross a workspace even when application code forgets the predicate.
|
|
83
|
+
- agents.core declares three data classes to the platform registry while it composes, and performs their operations itself on its own leases under its own tenant transaction. agents.core.runs holds the run record, its steps and the child rows that hang off it, keeps them 90 days by default, sweeps only settled runs in bounded batches so a queued or running run is never taken from its worker, exports one workspace by keyset in bounded pages, and erases the runs one account requested in bounded batches, reporting a full batch as truncated. agents.core.audit-events is exportable and is kept until a person deletes it, because the trail is hash chained and removing its oldest links by age would make the next verification report a break it cannot tell from tampering. agents.core.provider-credentials is workspace configuration, is never swept, and is excluded from the export with a stated reason because the row exists to hold a sealed provider secret. No export carries a credential or a sealed payload.
|
|
84
|
+
- agents.core depends on metering.core and requires the public metering.meters.v1 capability, so the module registry composes metering.core first and refuses a composition that leaves it out or that provides no meter registry. The meters agents.core.run-tokens and agents.core.runs are declared once while agents.core composes; every later use resolves the registry through the capability at the point of use rather than holding the one composition found. A settled run is counted once, keyed by the run id, so a repeated terminal step reports the same fact instead of a second one, and a run that reported no tokens counts the run alone. Counting is advisory and runs after the terminal row commits, so a metering failure never changes a settled run.
|
|
85
|
+
- Before a run is created the module asks metering.meters.v1 about both meters a run costs, on every enqueue path. agents.core.runs is asked for one run first and agents.core.run-tokens for the tokens the run may read and write, so a workspace that has spent either allowance is refused. A refused verdict fails the run start with METER_LIMIT_EXCEEDED naming that meter and creates no run. An allowed or warning verdict starts the run unchanged, and the settled fact replaces the estimate.
|
|
86
|
+
- A refused meter is recorded in this module's own hash-chained trail once per workspace, meter and calendar month, with the meter, the estimate, the month's usage and the limit. The claim that a refusal was already recorded is a row of agents.core's own tenant table, and taking it removes the rows of earlier months, so the workspace holds one row per meter however long it keeps being refused. Every attempt still asks metering.core, so a workspace is refused on what its month holds now and never on a remembered verdict, and the first refusal after the month turns is recorded again.
|
|
71
87
|
permissions:
|
|
72
88
|
- id: agents.definitions.read
|
|
73
89
|
description: Read agent definitions in the active tenant.
|
|
@@ -96,11 +112,13 @@ dataOwnership:
|
|
|
96
112
|
- agents.core owns the per-run cost projection, its per-day and per-agent rollups, and the budget caps declared as module settings.
|
|
97
113
|
- agents.core owns immutable agent revision snapshots, workflow-bound run output contracts, and durable versioned action invocation state.
|
|
98
114
|
- Business modules own their records and expose narrowly scoped tools to the harness; agents.core never bypasses their services or ACL rules.
|
|
115
|
+
- metering.core owns meter declarations as recorded, day buckets and limits. agents.core owns the meters it declares, the standing refusal rows that keep one refused meter out of its trail per workspace and month, and the decision about what a refusal means for a run; it never reads or writes metering storage.
|
|
116
|
+
- notifications.core owns inbox items, deliveries, and read state. agents.core owns the run it reports and hands over only the run id, the outcome kind, a bounded English title and outcome summary, and the accountable member; it never writes or reads notification records and never receives them back.
|
|
99
117
|
acceptanceScenarios:
|
|
100
118
|
- id: AGENTS-LIST
|
|
101
119
|
given: Tenant-created business agents and enabled modules with module-owned business agents exist.
|
|
102
120
|
when: An authorized principal lists agents.
|
|
103
|
-
then: The active tenant receives a deterministic catalog with an explicit tenant or module ownership discriminator and no definition from another tenant or disabled module.
|
|
121
|
+
then: The active tenant receives a deterministic catalog with an explicit tenant or module ownership discriminator and no definition from another tenant or disabled module. Tenant definitions arrive as pages of at most 200 rows, 50 by default, sorted by name or updatedAt in either direction with an optional search term, and each page ends in an opaque cursor bound to the tenant, the sort and the filters that a request with a different tenant, sort or filter cannot reuse; the module catalog, providers, tools and procedures are read separately.
|
|
104
122
|
- id: AGENTS-MODULE-REGISTER
|
|
105
123
|
given: An enabled module registers a valid defineAgent definition during composition.
|
|
106
124
|
when: The platform finishes composing modules before starting workers.
|
|
@@ -133,6 +151,10 @@ acceptanceScenarios:
|
|
|
133
151
|
given: An active agent and a principal with execution permission.
|
|
134
152
|
when: A playground or platform run is requested.
|
|
135
153
|
then: A queued run is durably persisted and a 202 response is returned before provider execution completes.
|
|
154
|
+
- id: AGENTS-RUNS-LIST
|
|
155
|
+
given: A tenant holds more runs than one page carries.
|
|
156
|
+
when: A principal with agents.runs.read lists runs.
|
|
157
|
+
then: Runs arrive newest first or oldest first by queuedAt in pages of at most 200 rows, 50 by default, narrowed by status, agent, trigger or a search term on the server, and each page ends in an opaque cursor bound to the tenant, the sort and the filters that another tenant, sort or filter cannot reuse; one run with its timeline is read by its id through a separate endpoint.
|
|
136
158
|
- id: AGENTS-EXECUTE
|
|
137
159
|
given: A queued run with valid server-side grants and bounded execution settings.
|
|
138
160
|
when: The harness worker claims the run.
|
|
@@ -224,7 +246,7 @@ acceptanceScenarios:
|
|
|
224
246
|
- id: AGENTS-AUDIT-READ
|
|
225
247
|
given: A principal reads the agent audit trail over HTTP.
|
|
226
248
|
when: The principal lacks agents.runs.read, or holds it and pages with a cursor.
|
|
227
|
-
then: The request is denied before any row is read without the scope, and with it only the active tenant's events are returned newest first with a stable occurred-at and sequence cursor and the chain fields.
|
|
249
|
+
then: The request is denied before any row is read without the scope, and with it only the active tenant's events are returned newest first with a stable occurred-at and sequence cursor and the chain fields. A page carries at most 100 events, 50 by default, and the cursor is opaque and bound to the tenant, so a cursor issued to another tenant or edited by a client is refused.
|
|
228
250
|
- id: AGENTS-AUDIT-VERIFY
|
|
229
251
|
given: A stored agent audit row is altered after it was written.
|
|
230
252
|
when: A principal with agents.runs.read verifies the chain over HTTP, reusing the same walk as the audit-verify CLI.
|
|
@@ -265,7 +287,43 @@ acceptanceScenarios:
|
|
|
265
287
|
given: A schedule, webhook, or other service identity was configured by an authenticated user.
|
|
266
288
|
when: It initiates workflow agent work or a versioned action.
|
|
267
289
|
then: Durable state records the service actor and its configuring user so history never presents background work as an anonymous system mutation.
|
|
290
|
+
- id: AGENTS-NOTIFY-RUN
|
|
291
|
+
given: A durable agent run started by a member reaches a terminal state, and the optional notifications module may or may not be composed.
|
|
292
|
+
when: The worker commits the terminal status.
|
|
293
|
+
then: With notifications.core composed, exactly one agent-run-completed or agent-run-failed notification is published after that commit, keyed by the run id, addressed to the member accountable for the run, and carrying no credentials, prompt, or transcript; without it, for a run a workflow owns, or when the publisher fails, the run settles unchanged and nothing is published.
|
|
268
294
|
- id: AGENT-CHILD-ISOLATION
|
|
269
295
|
given: Two workspaces each own an agent run with procedure snapshots and a provider connection with model readiness.
|
|
270
296
|
when: A caller supplies the other workspace's run id or provider id directly.
|
|
271
297
|
then: The read returns nothing, because those child tables carry their own workspace and force row-level security rather than relying on their parent.
|
|
298
|
+
- id: AGENTS-DATA-CLASSES
|
|
299
|
+
given: Two workspaces hold agent runs of several ages with their steps, one run still queued, a provider connection with a sealed credential, and the platform has sealed the data class registry.
|
|
300
|
+
when: The platform sweeps, exports and erases the declared classes for one of them.
|
|
301
|
+
then: The sweep removes only that workspace's settled runs strictly older than the cutoff and at most the batch it was given, taking their steps with them while the queued run stays; the export streams that workspace's runs and its audit trail through the sink in keyset pages with the oldest and newest record time, answers no rows and no range for a workspace that holds none, and carries no provider credential; the audit class declares no sweep; and erasing a subject removes the runs that account requested in that workspace alone, reporting a full batch as truncated.
|
|
302
|
+
- id: AGENTS-METER-COUNT
|
|
303
|
+
given: A workspace runs an agent and metering.core is composed, as every deployment of agents.core must compose it.
|
|
304
|
+
when: The platform composes and the run settles.
|
|
305
|
+
then: agents.core.run-tokens and agents.core.runs are declared at composition, the settled run counts one run and its reported tokens against the run id, and a run that reported none counts the run alone.
|
|
306
|
+
- id: AGENTS-METER-REFUSED
|
|
307
|
+
given: A workspace has used its monthly token allowance for agents.core.run-tokens.
|
|
308
|
+
when: A further run is requested through any enqueue path.
|
|
309
|
+
then: The request is refused with METER_LIMIT_EXCEEDED before a run row exists, the refusal is recorded in the agents audit trail with the meter, the estimate, the usage and the limit, the chain still verifies, and nothing is counted for the refused request.
|
|
310
|
+
- id: AGENTS-METERING-REQUIRED
|
|
311
|
+
given: A composition of agents.core with the platform modules it depends on.
|
|
312
|
+
when: The module registry composes it without metering.core, and again with a metering.core that provides no meter registry.
|
|
313
|
+
then: The first is refused with MODULE_DEPENDENCY_MISSING and the second with MODULE_CAPABILITY_MISSING; a complete composition orders metering.core before agents.core.
|
|
314
|
+
- id: AGENTS-METER-RUNS-LIMIT
|
|
315
|
+
given: A workspace that has used its monthly allowance of agents.core.runs while its token allowance is untouched.
|
|
316
|
+
when: A run is requested.
|
|
317
|
+
then: The request is refused with METER_LIMIT_EXCEEDED before a run row exists, the refusal names the runs meter and the amount of one run, and the token allowance is never asked.
|
|
318
|
+
- id: AGENTS-METER-REFUSAL-ONCE
|
|
319
|
+
given: A workspace refused on one meter that retries the request several times inside one month.
|
|
320
|
+
when: Every attempt is made.
|
|
321
|
+
then: Each is refused and asks metering.core again, the trail carries exactly one refusal for that workspace, meter and month, the chain still verifies, and the first attempt in the next month is recorded once more.
|
|
322
|
+
- id: AGENTS-ERASE-RUNNING-RUN
|
|
323
|
+
given: A run a worker of this process is executing, requested by the account an erasure names.
|
|
324
|
+
when: The agents.core.runs erase operation removes it mid-flight.
|
|
325
|
+
then: The worker's lease renewal cannot prove ownership, the execution is aborted as a lost lease, no terminal status and no terminal audit event are written for the run that is gone, and the worker returns to idle.
|
|
326
|
+
- id: AGENTS-REPORT-RUNS
|
|
327
|
+
given: A workspace with runs settled on several days inside the requested range and runs settled outside it.
|
|
328
|
+
when: The reports.core provider agents.runs is read.
|
|
329
|
+
then: It answers the runs and token totals of the range as tiles and runs and tokens per day as two series read from the existing rollup, counting only the days inside the range and writing nothing. It names itself, its tiles and its lines with keys of this module's bundle, and it passes the reader's time budget into its own tenant transaction so an expired budget cancels the statement instead of leaving it running.
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { randomBytes } from 'node:crypto';
|
|
1
2
|
import {
|
|
3
|
+
decodeCursor,
|
|
2
4
|
defineEndpoint,
|
|
5
|
+
encodeCursor,
|
|
3
6
|
HttpProblem,
|
|
4
7
|
jsonResponse,
|
|
8
|
+
pageResponse,
|
|
5
9
|
problemResponse,
|
|
6
10
|
readJsonObject,
|
|
11
|
+
readPageQuery,
|
|
7
12
|
requiredInteger,
|
|
8
13
|
requiredString,
|
|
9
14
|
} from '@flowdular/sdk/server';
|
|
@@ -14,18 +19,20 @@ import {
|
|
|
14
19
|
principalFromContext,
|
|
15
20
|
sessionMutationDenial,
|
|
16
21
|
} from '@flowdular/sdk/modules/auth/server';
|
|
17
|
-
import type { AgentExecutionEvent } from '@flowdular/sdk/harness';
|
|
22
|
+
import type { AgentExecutionEvent, AgentRunTrigger } from '@flowdular/sdk/harness';
|
|
18
23
|
import { userActor } from '@flowdular/sdk/kernel';
|
|
19
24
|
import { AGENT_PERMISSIONS } from '../acl/permissions.ts';
|
|
20
25
|
import type {
|
|
21
|
-
|
|
26
|
+
AgentListSort,
|
|
22
27
|
AgentProcedure,
|
|
23
28
|
AgentProcedureSnapshot,
|
|
24
29
|
AgentProviderKind,
|
|
25
30
|
AgentProviderModelConfiguration,
|
|
26
31
|
AgentRunDetail,
|
|
32
|
+
AgentRunStatus,
|
|
27
33
|
AgentProcedureStatus,
|
|
28
34
|
AgentStatus,
|
|
35
|
+
ListDirection,
|
|
29
36
|
CreateAgentInput,
|
|
30
37
|
CreateAgentProviderInput,
|
|
31
38
|
CreateAgentProcedureInput,
|
|
@@ -39,6 +46,30 @@ import { AgentServiceError } from '../services/agent-service.ts';
|
|
|
39
46
|
import { AgentProviderServiceError } from '../services/provider-service.ts';
|
|
40
47
|
import type { AgentRuntime } from '../server/runtime.ts';
|
|
41
48
|
|
|
49
|
+
/** The default page of every list here, and the ceiling of the audit trail. */
|
|
50
|
+
const LIST_PAGE_LIMIT = 50;
|
|
51
|
+
const AUDIT_PAGE_LIMIT = 100;
|
|
52
|
+
const SEARCH_LIMIT = 200;
|
|
53
|
+
const AGENT_SORTS: readonly AgentListSort[] = ['name', 'updatedAt'];
|
|
54
|
+
const AGENT_SORT_DIRECTIONS: Readonly<Record<AgentListSort, ListDirection>> = {
|
|
55
|
+
name: 'asc',
|
|
56
|
+
updatedAt: 'desc',
|
|
57
|
+
};
|
|
58
|
+
const RUN_SORTS = ['queuedAt'] as const;
|
|
59
|
+
const RUN_STATUSES: readonly AgentRunStatus[] = [
|
|
60
|
+
'queued',
|
|
61
|
+
'running',
|
|
62
|
+
'succeeded',
|
|
63
|
+
'failed',
|
|
64
|
+
'cancelled',
|
|
65
|
+
];
|
|
66
|
+
const RUN_TRIGGERS: readonly AgentRunTrigger[] = [
|
|
67
|
+
'playground',
|
|
68
|
+
'workflow',
|
|
69
|
+
'service',
|
|
70
|
+
'schedule',
|
|
71
|
+
];
|
|
72
|
+
|
|
42
73
|
function failure(error: unknown): Response {
|
|
43
74
|
if (
|
|
44
75
|
error instanceof AgentServiceError ||
|
|
@@ -196,6 +227,77 @@ function agentInput(value: Record<string, unknown>): CreateAgentInput {
|
|
|
196
227
|
};
|
|
197
228
|
}
|
|
198
229
|
|
|
230
|
+
function invalid(message: string): HttpProblem {
|
|
231
|
+
return new HttpProblem('INVALID_INPUT', message, 400);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function queryValue(url: URL, key: string, maximum: number): string | null {
|
|
235
|
+
const raw = url.searchParams.get(key);
|
|
236
|
+
if (raw === null) return null;
|
|
237
|
+
const value = raw.trim();
|
|
238
|
+
if (value === '') return null;
|
|
239
|
+
if (value.length > maximum) throw invalid(`${key} is too long.`);
|
|
240
|
+
return value;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function queryChoice<Choice extends string>(
|
|
244
|
+
url: URL,
|
|
245
|
+
key: string,
|
|
246
|
+
choices: readonly Choice[],
|
|
247
|
+
): Choice | null {
|
|
248
|
+
const value = queryValue(url, key, 32);
|
|
249
|
+
if (value === null) return null;
|
|
250
|
+
const chosen = choices.find((choice) => choice === value);
|
|
251
|
+
if (chosen === undefined) {
|
|
252
|
+
throw invalid(`${key} must be one of ${choices.join(', ')}.`);
|
|
253
|
+
}
|
|
254
|
+
return chosen;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
interface ListOrder<Sort extends string> {
|
|
258
|
+
readonly sort: Sort;
|
|
259
|
+
readonly direction: ListDirection;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function listOrder<Sort extends string>(
|
|
263
|
+
url: URL,
|
|
264
|
+
sorts: readonly Sort[],
|
|
265
|
+
defaults: Readonly<Record<Sort, ListDirection>>,
|
|
266
|
+
): ListOrder<Sort> {
|
|
267
|
+
const sort = queryChoice(url, 'sort', sorts) ?? sorts[0]!;
|
|
268
|
+
const direction = queryChoice(url, 'direction', ['asc', 'desc'] as const);
|
|
269
|
+
return { sort, direction: direction ?? defaults[sort] };
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
type CursorScope = Readonly<Record<string, string | number>> & {
|
|
273
|
+
readonly list: 'definitions' | 'runs' | 'audit';
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
/* A cursor answers one request: the list, tenant, order and filters it was
|
|
277
|
+
signed with are compared to the request's, and its keyset fields must carry
|
|
278
|
+
the type the statement binds, so a cursor of another list of the same
|
|
279
|
+
workspace is refused rather than moved onto a result set it never described. */
|
|
280
|
+
function boundCursor(
|
|
281
|
+
raw: string | null,
|
|
282
|
+
secret: Uint8Array,
|
|
283
|
+
scope: CursorScope,
|
|
284
|
+
keys: Readonly<Record<string, 'string' | 'number'>>,
|
|
285
|
+
): Record<string, string | number> | null {
|
|
286
|
+
if (raw === null) return null;
|
|
287
|
+
const cursor = decodeCursor(raw, secret);
|
|
288
|
+
const refused = () =>
|
|
289
|
+
new HttpProblem('CURSOR_INVALID', 'The page cursor is not valid.', 400);
|
|
290
|
+
for (const [key, value] of Object.entries(scope)) {
|
|
291
|
+
if (cursor[key] !== value) throw refused();
|
|
292
|
+
}
|
|
293
|
+
for (const [key, type] of Object.entries(keys)) {
|
|
294
|
+
const value = cursor[key];
|
|
295
|
+
if (typeof value !== type) throw refused();
|
|
296
|
+
if (type === 'number' && !Number.isSafeInteger(value)) throw refused();
|
|
297
|
+
}
|
|
298
|
+
return cursor;
|
|
299
|
+
}
|
|
300
|
+
|
|
199
301
|
/* A tenant agent and a run carry the deprecated projection beside the canonical
|
|
200
302
|
field, so a client on either contract reads the same configuration and the
|
|
201
303
|
same retained evidence. */
|
|
@@ -332,6 +434,10 @@ async function runEventStream(
|
|
|
332
434
|
}
|
|
333
435
|
|
|
334
436
|
export function createAgentRoutes(auth: AuthRuntime, runtime: AgentRuntime) {
|
|
437
|
+
/* Module-owned and never stored: a cursor names a position in one
|
|
438
|
+
workspace's own list, so a restart invalidating one costs a client the
|
|
439
|
+
first page. */
|
|
440
|
+
const cursorSecret = randomBytes(32);
|
|
335
441
|
const listAgents = defineEndpoint({
|
|
336
442
|
id: 'agents.definitions.list',
|
|
337
443
|
path: '/api/agents',
|
|
@@ -341,17 +447,84 @@ export function createAgentRoutes(auth: AuthRuntime, runtime: AgentRuntime) {
|
|
|
341
447
|
permission: AGENT_PERMISSIONS.definitionsRead,
|
|
342
448
|
},
|
|
343
449
|
resolveIdentity: endpointIdentityFromContext,
|
|
450
|
+
handler: async ({ octane }) => {
|
|
451
|
+
try {
|
|
452
|
+
const principal = principalFromContext(octane)!;
|
|
453
|
+
const url = new URL(octane.request.url);
|
|
454
|
+
const page = readPageQuery(url, { defaultLimit: LIST_PAGE_LIMIT });
|
|
455
|
+
const order = listOrder(url, AGENT_SORTS, AGENT_SORT_DIRECTIONS);
|
|
456
|
+
const search = queryValue(url, 'q', SEARCH_LIMIT);
|
|
457
|
+
const scope = {
|
|
458
|
+
list: 'definitions' as const,
|
|
459
|
+
tenant: principal.tenantId,
|
|
460
|
+
sort: order.sort,
|
|
461
|
+
direction: order.direction,
|
|
462
|
+
q: search ?? '',
|
|
463
|
+
};
|
|
464
|
+
const cursor = boundCursor(page.cursor, cursorSecret, scope, {
|
|
465
|
+
key: order.sort === 'name' ? 'string' : 'number',
|
|
466
|
+
id: 'string',
|
|
467
|
+
});
|
|
468
|
+
const result = await (
|
|
469
|
+
await runtime.service()
|
|
470
|
+
).listAgentsPage(principal.tenantId, {
|
|
471
|
+
sort: order.sort,
|
|
472
|
+
direction: order.direction,
|
|
473
|
+
search,
|
|
474
|
+
limit: page.limit,
|
|
475
|
+
after:
|
|
476
|
+
cursor === null
|
|
477
|
+
? null
|
|
478
|
+
: {
|
|
479
|
+
sortValue:
|
|
480
|
+
order.sort === 'name'
|
|
481
|
+
? String(cursor.key)
|
|
482
|
+
: Number(cursor.key),
|
|
483
|
+
id: String(cursor.id),
|
|
484
|
+
},
|
|
485
|
+
});
|
|
486
|
+
return pageResponse({
|
|
487
|
+
items: result.agents.map((agent) =>
|
|
488
|
+
withDeprecatedProcedureFields<TenantAgentView>({
|
|
489
|
+
...agent,
|
|
490
|
+
ownership: { kind: 'tenant' },
|
|
491
|
+
}),
|
|
492
|
+
),
|
|
493
|
+
limit: page.limit,
|
|
494
|
+
nextCursor:
|
|
495
|
+
result.last && result.agents.length === page.limit
|
|
496
|
+
? encodeCursor(
|
|
497
|
+
{
|
|
498
|
+
...scope,
|
|
499
|
+
key:
|
|
500
|
+
order.sort === 'name'
|
|
501
|
+
? result.last.nameKey
|
|
502
|
+
: result.last.updatedAt,
|
|
503
|
+
id: result.last.id,
|
|
504
|
+
},
|
|
505
|
+
cursorSecret,
|
|
506
|
+
)
|
|
507
|
+
: null,
|
|
508
|
+
});
|
|
509
|
+
} catch (error) {
|
|
510
|
+
return failure(error);
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
});
|
|
514
|
+
/* What the definitions screen needs beside its page: the module catalog,
|
|
515
|
+
the providers, the registered tools and the procedures. */
|
|
516
|
+
const agentContext = defineEndpoint({
|
|
517
|
+
id: 'agents.definitions.context',
|
|
518
|
+
path: '/api/agents/context',
|
|
519
|
+
methods: ['GET'],
|
|
520
|
+
access: {
|
|
521
|
+
kind: 'permission',
|
|
522
|
+
permission: AGENT_PERMISSIONS.definitionsRead,
|
|
523
|
+
},
|
|
524
|
+
resolveIdentity: endpointIdentityFromContext,
|
|
344
525
|
handler: async ({ octane }) => {
|
|
345
526
|
const principal = principalFromContext(octane)!;
|
|
346
527
|
return jsonResponse({
|
|
347
|
-
agents: (
|
|
348
|
-
await (await runtime.service()).listAgents(principal.tenantId)
|
|
349
|
-
).map((agent: AgentDefinition) =>
|
|
350
|
-
withDeprecatedProcedureFields<TenantAgentView>({
|
|
351
|
-
...agent,
|
|
352
|
-
ownership: { kind: 'tenant' },
|
|
353
|
-
}),
|
|
354
|
-
),
|
|
355
528
|
moduleAgents: await (
|
|
356
529
|
await runtime.service()
|
|
357
530
|
).listModuleAgents(principal.tenantId),
|
|
@@ -711,18 +884,72 @@ export function createAgentRoutes(auth: AuthRuntime, runtime: AgentRuntime) {
|
|
|
711
884
|
try {
|
|
712
885
|
const principal = principalFromContext(octane)!;
|
|
713
886
|
const url = new URL(octane.request.url);
|
|
714
|
-
const
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
887
|
+
const page = readPageQuery(url, { defaultLimit: LIST_PAGE_LIMIT });
|
|
888
|
+
const order = listOrder(url, RUN_SORTS, { queuedAt: 'desc' });
|
|
889
|
+
const filters = {
|
|
890
|
+
status: queryChoice(url, 'status', RUN_STATUSES),
|
|
891
|
+
agentId: queryValue(url, 'agentId', 128),
|
|
892
|
+
trigger: queryChoice(url, 'trigger', RUN_TRIGGERS),
|
|
893
|
+
search: queryValue(url, 'q', SEARCH_LIMIT),
|
|
894
|
+
};
|
|
895
|
+
const scope = {
|
|
896
|
+
list: 'runs' as const,
|
|
897
|
+
tenant: principal.tenantId,
|
|
898
|
+
sort: order.sort,
|
|
899
|
+
direction: order.direction,
|
|
900
|
+
status: filters.status ?? '',
|
|
901
|
+
agentId: filters.agentId ?? '',
|
|
902
|
+
trigger: filters.trigger ?? '',
|
|
903
|
+
q: filters.search ?? '',
|
|
904
|
+
};
|
|
905
|
+
const cursor = boundCursor(page.cursor, cursorSecret, scope, {
|
|
906
|
+
queuedAt: 'number',
|
|
907
|
+
id: 'string',
|
|
908
|
+
});
|
|
909
|
+
const runs = await (
|
|
910
|
+
await runtime.service()
|
|
911
|
+
).listRuns(principal.tenantId, {
|
|
912
|
+
...filters,
|
|
913
|
+
direction: order.direction,
|
|
914
|
+
limit: page.limit,
|
|
915
|
+
after:
|
|
916
|
+
cursor === null
|
|
917
|
+
? null
|
|
918
|
+
: { queuedAt: Number(cursor.queuedAt), id: String(cursor.id) },
|
|
919
|
+
});
|
|
920
|
+
const last = runs.at(-1);
|
|
921
|
+
return pageResponse({
|
|
922
|
+
items: runs.map(withDeprecatedRunFields),
|
|
923
|
+
limit: page.limit,
|
|
924
|
+
nextCursor:
|
|
925
|
+
last && runs.length === page.limit
|
|
926
|
+
? encodeCursor(
|
|
927
|
+
{ ...scope, queuedAt: last.queuedAt, id: last.id },
|
|
928
|
+
cursorSecret,
|
|
929
|
+
)
|
|
930
|
+
: null,
|
|
931
|
+
});
|
|
932
|
+
} catch (error) {
|
|
933
|
+
return failure(error);
|
|
934
|
+
}
|
|
935
|
+
},
|
|
936
|
+
});
|
|
937
|
+
const getRun = defineEndpoint({
|
|
938
|
+
id: 'agents.runs.get',
|
|
939
|
+
path: '/api/agent-runs/get',
|
|
940
|
+
methods: ['GET'],
|
|
941
|
+
access: { kind: 'permission', permission: AGENT_PERMISSIONS.runsRead },
|
|
942
|
+
resolveIdentity: endpointIdentityFromContext,
|
|
943
|
+
handler: async ({ octane }) => {
|
|
944
|
+
try {
|
|
945
|
+
const principal = principalFromContext(octane)!;
|
|
946
|
+
const runId = queryValue(new URL(octane.request.url), 'id', 128);
|
|
947
|
+
if (runId === null) throw invalid('id is required.');
|
|
948
|
+
return jsonResponse({
|
|
949
|
+
run: await (
|
|
950
|
+
await runtime.service()
|
|
951
|
+
).getRunTimeline(principal.tenantId, runId),
|
|
952
|
+
});
|
|
726
953
|
} catch (error) {
|
|
727
954
|
return failure(error);
|
|
728
955
|
}
|
|
@@ -857,17 +1084,44 @@ export function createAgentRoutes(auth: AuthRuntime, runtime: AgentRuntime) {
|
|
|
857
1084
|
handler: async ({ octane }) => {
|
|
858
1085
|
try {
|
|
859
1086
|
const principal = principalFromContext(octane)!;
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
1087
|
+
const page = readPageQuery(new URL(octane.request.url), {
|
|
1088
|
+
maxLimit: AUDIT_PAGE_LIMIT,
|
|
1089
|
+
defaultLimit: LIST_PAGE_LIMIT,
|
|
1090
|
+
});
|
|
1091
|
+
const scope = { list: 'audit' as const, tenant: principal.tenantId };
|
|
1092
|
+
const cursor = boundCursor(page.cursor, cursorSecret, scope, {
|
|
1093
|
+
occurredAt: 'number',
|
|
1094
|
+
sequence: 'number',
|
|
1095
|
+
});
|
|
1096
|
+
const events = await (
|
|
1097
|
+
await runtime.service()
|
|
1098
|
+
).pageAuditEvents(principal.tenantId, {
|
|
1099
|
+
limit: page.limit,
|
|
1100
|
+
after:
|
|
1101
|
+
cursor === null
|
|
1102
|
+
? null
|
|
1103
|
+
: {
|
|
1104
|
+
occurredAt: Number(cursor.occurredAt),
|
|
1105
|
+
sequence: Number(cursor.sequence),
|
|
1106
|
+
},
|
|
1107
|
+
});
|
|
1108
|
+
const last = events.at(-1);
|
|
1109
|
+
/* The body keeps `events` and `nextCursor`: auth.core's audit screen
|
|
1110
|
+
reads this trail beside the platform one through that shape. */
|
|
1111
|
+
return jsonResponse({
|
|
1112
|
+
events,
|
|
1113
|
+
nextCursor:
|
|
1114
|
+
last && events.length === page.limit
|
|
1115
|
+
? encodeCursor(
|
|
1116
|
+
{
|
|
1117
|
+
...scope,
|
|
1118
|
+
occurredAt: last.occurredAt,
|
|
1119
|
+
sequence: last.sequence,
|
|
1120
|
+
},
|
|
1121
|
+
cursorSecret,
|
|
1122
|
+
)
|
|
1123
|
+
: null,
|
|
1124
|
+
});
|
|
871
1125
|
} catch (error) {
|
|
872
1126
|
return failure(error);
|
|
873
1127
|
}
|
|
@@ -1062,6 +1316,7 @@ export function createAgentRoutes(auth: AuthRuntime, runtime: AgentRuntime) {
|
|
|
1062
1316
|
});
|
|
1063
1317
|
return [
|
|
1064
1318
|
listAgents.serverRoute,
|
|
1319
|
+
agentContext.serverRoute,
|
|
1065
1320
|
updateModuleAgentBinding.serverRoute,
|
|
1066
1321
|
createAgent.serverRoute,
|
|
1067
1322
|
updateAgent.serverRoute,
|
|
@@ -1076,6 +1331,7 @@ export function createAgentRoutes(auth: AuthRuntime, runtime: AgentRuntime) {
|
|
|
1076
1331
|
archiveSkill.serverRoute,
|
|
1077
1332
|
deleteSkill.serverRoute,
|
|
1078
1333
|
listRuns.serverRoute,
|
|
1334
|
+
getRun.serverRoute,
|
|
1079
1335
|
enqueueRun.serverRoute,
|
|
1080
1336
|
cancelRun.serverRoute,
|
|
1081
1337
|
workerStatus.serverRoute,
|
|
@@ -1093,6 +1349,7 @@ export function createAgentRoutes(auth: AuthRuntime, runtime: AgentRuntime) {
|
|
|
1093
1349
|
|
|
1094
1350
|
export const endpoints = [
|
|
1095
1351
|
'agents.definitions.list',
|
|
1352
|
+
'agents.definitions.context',
|
|
1096
1353
|
'agents.module-bindings.update',
|
|
1097
1354
|
'agents.definitions.create',
|
|
1098
1355
|
'agents.definitions.update',
|
|
@@ -1107,6 +1364,7 @@ export const endpoints = [
|
|
|
1107
1364
|
'agents.skills.archive',
|
|
1108
1365
|
'agents.skills.delete',
|
|
1109
1366
|
'agents.runs.list',
|
|
1367
|
+
'agents.runs.get',
|
|
1110
1368
|
'agents.runs.enqueue',
|
|
1111
1369
|
'agents.runs.cancel',
|
|
1112
1370
|
'agents.runs.worker',
|
|
@@ -13,6 +13,17 @@
|
|
|
13
13
|
"supportsDryRun": false
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
+
{
|
|
17
|
+
"path": ["agents", "secrets-rotate"],
|
|
18
|
+
"capability": {
|
|
19
|
+
"id": "agents.secrets.rotate",
|
|
20
|
+
"version": 1,
|
|
21
|
+
"summary": "Re-seal stored provider credentials with the current encryption key.",
|
|
22
|
+
"risk": "process",
|
|
23
|
+
"requiresApprovedSpec": false,
|
|
24
|
+
"supportsDryRun": true
|
|
25
|
+
}
|
|
26
|
+
},
|
|
16
27
|
{
|
|
17
28
|
"path": ["agents", "audit-verify"],
|
|
18
29
|
"capability": {
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
} from '@flowdular/sdk/database';
|
|
10
10
|
import { AI_PROVIDER_KINDS } from '@flowdular/sdk/harness/catalog';
|
|
11
11
|
import { agentRuntimeOptionsFromEnvironment } from '../server/runtime.ts';
|
|
12
|
+
import { rotateProviderCredentials } from '../services/credential-rotation.ts';
|
|
13
|
+
import { credentialVaultFromEnvironment } from '../services/credential-vault.ts';
|
|
12
14
|
import { DatabaseProviderRepository } from '../services/provider-repository.ts';
|
|
13
15
|
import {
|
|
14
16
|
DatabaseAgentRepository,
|
|
@@ -24,6 +26,16 @@ const statusCapability = {
|
|
|
24
26
|
supportsDryRun: false,
|
|
25
27
|
};
|
|
26
28
|
|
|
29
|
+
const rotateCapability = {
|
|
30
|
+
id: 'agents.secrets.rotate',
|
|
31
|
+
version: 1,
|
|
32
|
+
summary:
|
|
33
|
+
'Re-seal stored provider credentials with the current encryption key.',
|
|
34
|
+
risk: 'process' as const,
|
|
35
|
+
requiresApprovedSpec: false,
|
|
36
|
+
supportsDryRun: true,
|
|
37
|
+
};
|
|
38
|
+
|
|
27
39
|
const auditCapability = {
|
|
28
40
|
id: 'agents.audit.verify',
|
|
29
41
|
version: 1,
|
|
@@ -127,6 +139,39 @@ export const cliExtension = defineCliExtension({
|
|
|
127
139
|
}
|
|
128
140
|
},
|
|
129
141
|
},
|
|
142
|
+
{
|
|
143
|
+
path: ['agents', 'secrets-rotate'],
|
|
144
|
+
capability: rotateCapability,
|
|
145
|
+
execute: async (context) => {
|
|
146
|
+
/* The report names key ids and row counts only; a credential never
|
|
147
|
+
reaches the command output. */
|
|
148
|
+
const vault = credentialVaultFromEnvironment(
|
|
149
|
+
process.env,
|
|
150
|
+
context.workspaceRoot,
|
|
151
|
+
);
|
|
152
|
+
const opened = await open(context);
|
|
153
|
+
try {
|
|
154
|
+
const report = await rotateProviderCredentials({
|
|
155
|
+
runtime: opened.runtime.database,
|
|
156
|
+
background: opened.background.database,
|
|
157
|
+
vault,
|
|
158
|
+
apply: context.apply,
|
|
159
|
+
});
|
|
160
|
+
return {
|
|
161
|
+
data: { moduleId: 'agents.core', ...report },
|
|
162
|
+
evidence: ['modules/agents/spec/module.yaml', 'docs/operations.md'],
|
|
163
|
+
warnings:
|
|
164
|
+
report.skipped > 0
|
|
165
|
+
? [
|
|
166
|
+
`${report.skipped} rows were rewritten by the application while this ran and keep their own envelope. Run the command again.`,
|
|
167
|
+
]
|
|
168
|
+
: [],
|
|
169
|
+
};
|
|
170
|
+
} finally {
|
|
171
|
+
await close(opened);
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
},
|
|
130
175
|
{
|
|
131
176
|
path: ['agents', 'audit-verify'],
|
|
132
177
|
capability: auditCapability,
|