@flowdular/sdk 0.1.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/README.md +27 -0
- package/.ai/agents/module-executor.md +36 -0
- package/.ai/agents/reviewer.md +23 -0
- package/.ai/agents/sandbox/agentic-engineer.md +31 -0
- package/.ai/agents/sandbox/backend-engineer.md +36 -0
- package/.ai/agents/sandbox/business-manager.md +23 -0
- package/.ai/agents/sandbox/frontend-engineer.md +27 -0
- package/.ai/agents/sandbox/ux-designer.md +23 -0
- package/.ai/agents/spec-author.md +29 -0
- package/.ai/blueprints/add-migration/README.md +5 -0
- package/.ai/blueprints/add-migration/allowed-paths.yaml +23 -0
- package/.ai/blueprints/add-migration/blueprint.json +14 -0
- package/.ai/blueprints/add-migration/examples/invalid/input-destructive.json +6 -0
- package/.ai/blueprints/add-migration/examples/invalid/plan-unnumbered-file.json +9 -0
- package/.ai/blueprints/add-migration/examples/valid/input.json +6 -0
- package/.ai/blueprints/add-migration/examples/valid/plan.json +9 -0
- package/.ai/blueprints/add-migration/gates.yaml +30 -0
- package/.ai/blueprints/add-migration/input.schema.json +23 -0
- package/.ai/blueprints/add-migration/plan.schema.json +54 -0
- package/.ai/blueprints/add-migration/required-files.yaml +18 -0
- package/.ai/blueprints/add-migration/spec-requirements.yaml +13 -0
- package/.ai/blueprints/add-migration/steps.yaml +62 -0
- package/.ai/blueprints/author-spec/README.md +5 -0
- package/.ai/blueprints/author-spec/allowed-paths.yaml +7 -0
- package/.ai/blueprints/author-spec/blueprint.json +14 -0
- package/.ai/blueprints/author-spec/examples/invalid/input-missing-outcome.json +5 -0
- package/.ai/blueprints/author-spec/examples/valid/input.json +6 -0
- package/.ai/blueprints/author-spec/gates.yaml +13 -0
- package/.ai/blueprints/author-spec/input.schema.json +20 -0
- package/.ai/blueprints/author-spec/plan.schema.json +14 -0
- package/.ai/blueprints/author-spec/required-files.yaml +6 -0
- package/.ai/blueprints/author-spec/spec-requirements.yaml +35 -0
- package/.ai/blueprints/author-spec/steps.yaml +28 -0
- package/.ai/blueprints/author-spec/templates/module.yaml +45 -0
- package/.ai/blueprints/bug-fix/README.md +5 -0
- package/.ai/blueprints/bug-fix/allowed-paths.yaml +29 -0
- package/.ai/blueprints/bug-fix/blueprint.json +14 -0
- package/.ai/blueprints/bug-fix/examples/invalid/input-no-symptom.json +4 -0
- package/.ai/blueprints/bug-fix/examples/invalid/plan-no-test.json +8 -0
- package/.ai/blueprints/bug-fix/examples/valid/input.json +6 -0
- package/.ai/blueprints/bug-fix/examples/valid/plan.json +8 -0
- package/.ai/blueprints/bug-fix/gates.yaml +30 -0
- package/.ai/blueprints/bug-fix/input.schema.json +25 -0
- package/.ai/blueprints/bug-fix/plan.schema.json +53 -0
- package/.ai/blueprints/bug-fix/required-files.yaml +7 -0
- package/.ai/blueprints/bug-fix/spec-requirements.yaml +7 -0
- package/.ai/blueprints/bug-fix/steps.yaml +51 -0
- package/.ai/blueprints/core-extend/README.md +5 -0
- package/.ai/blueprints/core-extend/allowed-paths.yaml +49 -0
- package/.ai/blueprints/core-extend/blueprint.json +14 -0
- package/.ai/blueprints/core-extend/examples/invalid/input-unknown-package.json +5 -0
- package/.ai/blueprints/core-extend/examples/invalid/plan-missing-gates.json +7 -0
- package/.ai/blueprints/core-extend/examples/valid/input.json +6 -0
- package/.ai/blueprints/core-extend/examples/valid/plan.json +10 -0
- package/.ai/blueprints/core-extend/gates.yaml +16 -0
- package/.ai/blueprints/core-extend/input.schema.json +54 -0
- package/.ai/blueprints/core-extend/plan.schema.json +39 -0
- package/.ai/blueprints/core-extend/required-files.yaml +36 -0
- package/.ai/blueprints/core-extend/spec-requirements.yaml +17 -0
- package/.ai/blueprints/core-extend/steps.yaml +54 -0
- package/.ai/blueprints/edit-module/README.md +9 -0
- package/.ai/blueprints/edit-module/allowed-paths.yaml +27 -0
- package/.ai/blueprints/edit-module/blueprint.json +20 -0
- package/.ai/blueprints/edit-module/examples/invalid/input-unknown-change.json +5 -0
- package/.ai/blueprints/edit-module/examples/invalid/plan-touches-platform.json +15 -0
- package/.ai/blueprints/edit-module/examples/valid/input.json +5 -0
- package/.ai/blueprints/edit-module/examples/valid/plan.json +25 -0
- package/.ai/blueprints/edit-module/gates.yaml +30 -0
- package/.ai/blueprints/edit-module/input.schema.json +31 -0
- package/.ai/blueprints/edit-module/plan.schema.json +65 -0
- package/.ai/blueprints/edit-module/required-files.yaml +80 -0
- package/.ai/blueprints/edit-module/spec-requirements.yaml +15 -0
- package/.ai/blueprints/edit-module/steps.yaml +115 -0
- package/.ai/blueprints/new-module/README.md +7 -0
- package/.ai/blueprints/new-module/allowed-paths.yaml +27 -0
- package/.ai/blueprints/new-module/blueprint.json +20 -0
- package/.ai/blueprints/new-module/examples/invalid/input-spec-outside-modules.json +4 -0
- package/.ai/blueprints/new-module/examples/invalid/plan-unknown-gate.json +8 -0
- package/.ai/blueprints/new-module/examples/valid/input.json +5 -0
- package/.ai/blueprints/new-module/examples/valid/plan.json +22 -0
- package/.ai/blueprints/new-module/gates.yaml +30 -0
- package/.ai/blueprints/new-module/input.schema.json +21 -0
- package/.ai/blueprints/new-module/plan.schema.json +58 -0
- package/.ai/blueprints/new-module/required-files.yaml +73 -0
- package/.ai/blueprints/new-module/spec-requirements.yaml +30 -0
- package/.ai/blueprints/new-module/steps.yaml +138 -0
- package/.ai/blueprints/release/README.md +5 -0
- package/.ai/blueprints/release/allowed-paths.yaml +19 -0
- package/.ai/blueprints/release/blueprint.json +14 -0
- package/.ai/blueprints/release/examples/invalid/input-bad-version.json +4 -0
- package/.ai/blueprints/release/examples/invalid/plan-bad-branch.json +7 -0
- package/.ai/blueprints/release/examples/valid/input.json +5 -0
- package/.ai/blueprints/release/examples/valid/plan.json +20 -0
- package/.ai/blueprints/release/gates.yaml +20 -0
- package/.ai/blueprints/release/input.schema.json +24 -0
- package/.ai/blueprints/release/plan.schema.json +46 -0
- package/.ai/blueprints/release/required-files.yaml +19 -0
- package/.ai/blueprints/release/spec-requirements.yaml +8 -0
- package/.ai/blueprints/release/steps.yaml +47 -0
- package/.ai/blueprints/security-review/README.md +5 -0
- package/.ai/blueprints/security-review/allowed-paths.yaml +6 -0
- package/.ai/blueprints/security-review/blueprint.json +14 -0
- package/.ai/blueprints/security-review/examples/invalid/input-unknown-kind.json +4 -0
- package/.ai/blueprints/security-review/examples/invalid/plan-finding-without-scenario.json +14 -0
- package/.ai/blueprints/security-review/examples/valid/input.json +4 -0
- package/.ai/blueprints/security-review/examples/valid/plan.json +19 -0
- package/.ai/blueprints/security-review/gates.yaml +22 -0
- package/.ai/blueprints/security-review/input.schema.json +20 -0
- package/.ai/blueprints/security-review/plan.schema.json +65 -0
- package/.ai/blueprints/security-review/required-files.yaml +6 -0
- package/.ai/blueprints/security-review/spec-requirements.yaml +9 -0
- package/.ai/blueprints/security-review/steps.yaml +38 -0
- package/.ai/policies/capabilities.yaml +164 -0
- package/.ai/policies/model-routing.yaml +72 -0
- package/.ai/policies/path-ownership.yaml +65 -0
- package/.ai/policies/task-budgets.yaml +37 -0
- package/.ai/references/catalog/LICENSE +21 -0
- package/.ai/references/catalog/migrations/0001_catalog_core.down.sql +2 -0
- package/.ai/references/catalog/migrations/0001_catalog_core.up.sql +21 -0
- package/.ai/references/catalog/migrations/0002_catalog_history.down.sql +3 -0
- package/.ai/references/catalog/migrations/0002_catalog_history.up.sql +20 -0
- package/.ai/references/catalog/migrations/0003_catalog_history_service_actors.down.sql +3 -0
- package/.ai/references/catalog/migrations/0003_catalog_history_service_actors.up.sql +36 -0
- package/.ai/references/catalog/migrations/0004_catalog_idempotency_ledger.down.sql +3 -0
- package/.ai/references/catalog/migrations/0004_catalog_idempotency_ledger.up.sql +19 -0
- package/.ai/references/catalog/migrations/README.md +3 -0
- package/.ai/references/catalog/module.json +27 -0
- package/.ai/references/catalog/package.json +49 -0
- package/.ai/references/catalog/spec/module.yaml +86 -0
- package/.ai/references/catalog/src/acl/permissions.ts +6 -0
- package/.ai/references/catalog/src/agent/tools.ts +164 -0
- package/.ai/references/catalog/src/api/endpoints.ts +243 -0
- package/.ai/references/catalog/src/client/CatalogHistoryDrawer.tsrx +123 -0
- package/.ai/references/catalog/src/client/CatalogItemForm.tsrx +190 -0
- package/.ai/references/catalog/src/client/CatalogView.tsrx +473 -0
- package/.ai/references/catalog/src/client/api.ts +111 -0
- package/.ai/references/catalog/src/client/contribution.tsrx +61 -0
- package/.ai/references/catalog/src/client/index.ts +18 -0
- package/.ai/references/catalog/src/client/navigation-copy.ts +9 -0
- package/.ai/references/catalog/src/client/state.ts +24 -0
- package/.ai/references/catalog/src/domain/types.ts +32 -0
- package/.ai/references/catalog/src/domain/variables.ts +111 -0
- package/.ai/references/catalog/src/index.ts +31 -0
- package/.ai/references/catalog/src/platform.ts +35 -0
- package/.ai/references/catalog/src/server/index.ts +4 -0
- package/.ai/references/catalog/src/server/runtime.ts +86 -0
- package/.ai/references/catalog/src/services/catalog-service.ts +306 -0
- package/.ai/references/catalog/src/services/database-repository.ts +440 -0
- package/.ai/references/catalog/src/services/index.ts +4 -0
- package/.ai/references/catalog/src/services/migration.ts +171 -0
- package/.ai/references/catalog/src/services/repository.ts +36 -0
- package/.ai/references/catalog/src/services/target-idempotency.ts +59 -0
- package/.ai/references/catalog/tests/agent-tools.test.ts +277 -0
- package/.ai/references/catalog/tests/endpoints.test.ts +320 -0
- package/.ai/references/catalog/tests/idempotency.test.ts +297 -0
- package/.ai/references/catalog/tests/migrations.test.ts +149 -0
- package/.ai/references/catalog/tests/module.test.ts +271 -0
- package/.ai/references/catalog/tests/support/database.ts +76 -0
- package/.ai/references/catalog/translations/en.json +101 -0
- package/.ai/references/catalog/translations/pl.json +101 -0
- package/.ai/references/catalog/tsconfig.json +15 -0
- package/.ai/references/catalog/vitest.config.ts +16 -0
- package/.ai/references/catalog.provenance.json +55 -0
- package/.ai/skills/README.md +36 -0
- package/.ai/skills/agent-tool-design/SKILL.md +209 -0
- package/.ai/skills/auth-security-review/SKILL.md +96 -0
- package/.ai/skills/auto-review/SKILL.md +112 -0
- package/.ai/skills/bug-hunt/SKILL.md +110 -0
- package/.ai/skills/business-agent-design/SKILL.md +188 -0
- package/.ai/skills/cli-extension/SKILL.md +114 -0
- package/.ai/skills/core-extend/SKILL.md +104 -0
- package/.ai/skills/database-adapter/SKILL.md +204 -0
- package/.ai/skills/database-adapter/references/first-run-and-matrix.md +105 -0
- package/.ai/skills/migration-authoring/SKILL.md +167 -0
- package/.ai/skills/module-new/SKILL.md +180 -0
- package/.ai/skills/module-update/SKILL.md +100 -0
- package/.ai/skills/perf-audit/SKILL.md +105 -0
- package/.ai/skills/release-eject-pr/SKILL.md +113 -0
- package/.ai/skills/spec-approval/SKILL.md +112 -0
- package/.ai/skills/test-hardening/SKILL.md +86 -0
- package/.ai/skills/translations-i18n/SKILL.md +85 -0
- package/.ai/skills/ux-design/SKILL.md +97 -0
- package/.ai/skills/variables/SKILL.md +164 -0
- package/.ai/skills/workflow-development/SKILL.md +199 -0
- package/AGENTS.md +59 -0
- package/LICENSE +21 -0
- package/README.md +24 -0
- package/docs/agent-contract.md +45 -0
- package/docs/design-system.md +217 -0
- package/modules/agents/migrations/0001_agents_core.down.sql +4 -0
- package/modules/agents/migrations/0001_agents_core.up.sql +106 -0
- package/modules/agents/migrations/0002_provider_connections.down.sql +1 -0
- package/modules/agents/migrations/0002_provider_connections.up.sql +34 -0
- package/modules/agents/migrations/0003_resource_audit.down.sql +1 -0
- package/modules/agents/migrations/0003_resource_audit.up.sql +25 -0
- package/modules/agents/migrations/0004_run_grants.down.sql +1 -0
- package/modules/agents/migrations/0004_run_grants.up.sql +19 -0
- package/modules/agents/migrations/0005_long_running_limits.down.sql +2 -0
- package/modules/agents/migrations/0005_long_running_limits.up.sql +14 -0
- package/modules/agents/migrations/0006_agent_skills.down.sql +3 -0
- package/modules/agents/migrations/0006_agent_skills.up.sql +44 -0
- package/modules/agents/migrations/0007_model_readiness.down.sql +1 -0
- package/modules/agents/migrations/0007_model_readiness.up.sql +18 -0
- package/modules/agents/migrations/0008_output_limits.down.sql +2 -0
- package/modules/agents/migrations/0008_output_limits.up.sql +8 -0
- package/modules/agents/migrations/0009_agent_audit_v3.down.sql +1 -0
- package/modules/agents/migrations/0009_agent_audit_v3.up.sql +25 -0
- package/modules/agents/migrations/0012_agent_run_costs.down.sql +3 -0
- package/modules/agents/migrations/0012_agent_run_costs.up.sql +32 -0
- package/modules/agents/migrations/0013_workflow_prerequisites.down.sql +3 -0
- package/modules/agents/migrations/0013_workflow_prerequisites.up.sql +97 -0
- package/modules/agents/migrations/0014_agent_action_audit.down.sql +1 -0
- package/modules/agents/migrations/0014_agent_action_audit.up.sql +25 -0
- package/modules/agents/migrations/0015_agent_run_actors.down.sql +1 -0
- package/modules/agents/migrations/0015_agent_run_actors.up.sql +17 -0
- package/modules/agents/migrations/0016_module_owned_agents.down.sql +6 -0
- package/modules/agents/migrations/0016_module_owned_agents.up.sql +68 -0
- package/modules/agents/migrations/0017_agent_authorization_subjects.down.sql +2 -0
- package/modules/agents/migrations/0017_agent_authorization_subjects.up.sql +18 -0
- package/modules/agents/migrations/0018_agent_child_tenant_isolation.down.sql +12 -0
- package/modules/agents/migrations/0018_agent_child_tenant_isolation.up.sql +88 -0
- package/modules/agents/migrations/0019_background_recovery_grants.down.sql +6 -0
- package/modules/agents/migrations/0019_background_recovery_grants.up.sql +17 -0
- package/modules/agents/migrations/0020_provider_summary_role.down.sql +2 -0
- package/modules/agents/migrations/0020_provider_summary_role.up.sql +17 -0
- package/modules/agents/migrations/0021_agents_agent_reconciliation_role.down.sql +4 -0
- package/modules/agents/migrations/0021_agents_agent_reconciliation_role.up.sql +7 -0
- package/modules/agents/migrations/README.md +39 -0
- package/modules/agents/module.json +38 -0
- package/modules/agents/package.json +56 -0
- package/modules/agents/spec/module.yaml +271 -0
- package/modules/agents/spec/procedures-compatibility.md +63 -0
- package/modules/agents/src/acl/permissions.ts +13 -0
- package/modules/agents/src/api/endpoints.ts +1122 -0
- package/modules/agents/src/cli/commands.json +29 -0
- package/modules/agents/src/cli/index.ts +162 -0
- package/modules/agents/src/client/AgentDashboardWidget.tsrx +32 -0
- package/modules/agents/src/client/AgentDefinitionForm.tsrx +362 -0
- package/modules/agents/src/client/AgentDefinitionList.tsrx +127 -0
- package/modules/agents/src/client/AgentPlaygroundView.tsrx +246 -0
- package/modules/agents/src/client/AgentProcedureForm.tsrx +182 -0
- package/modules/agents/src/client/AgentProcedureList.tsrx +118 -0
- package/modules/agents/src/client/AgentProceduresView.tsrx +253 -0
- package/modules/agents/src/client/AgentProvidersView.tsrx +248 -0
- package/modules/agents/src/client/AgentRunsView.tsrx +304 -0
- package/modules/agents/src/client/AgentUsageView.tsrx +233 -0
- package/modules/agents/src/client/AgentsView.tsrx +339 -0
- package/modules/agents/src/client/ModuleAgentBindingForm.tsrx +239 -0
- package/modules/agents/src/client/ModuleAgentList.tsrx +122 -0
- package/modules/agents/src/client/ProviderConnectionForm.tsrx +273 -0
- package/modules/agents/src/client/ProviderConnectionList.tsrx +229 -0
- package/modules/agents/src/client/ProviderModelEditor.tsrx +313 -0
- package/modules/agents/src/client/RunTimeline.tsrx +212 -0
- package/modules/agents/src/client/agents.css +349 -0
- package/modules/agents/src/client/api.ts +373 -0
- package/modules/agents/src/client/contribution.tsrx +181 -0
- package/modules/agents/src/client/index.ts +21 -0
- package/modules/agents/src/client/presentation.ts +162 -0
- package/modules/agents/src/client/state.ts +100 -0
- package/modules/agents/src/domain/context-variables.ts +58 -0
- package/modules/agents/src/domain/run-timeline.ts +145 -0
- package/modules/agents/src/domain/types.ts +481 -0
- package/modules/agents/src/index.ts +88 -0
- package/modules/agents/src/platform.ts +82 -0
- package/modules/agents/src/server/action-execution.ts +811 -0
- package/modules/agents/src/server/define-agent.ts +170 -0
- package/modules/agents/src/server/index.ts +67 -0
- package/modules/agents/src/server/run-execution.ts +231 -0
- package/modules/agents/src/server/run-queue.ts +96 -0
- package/modules/agents/src/server/runtime.ts +448 -0
- package/modules/agents/src/server/tools.ts +18 -0
- package/modules/agents/src/services/agent-service.ts +2167 -0
- package/modules/agents/src/services/credential-vault.ts +133 -0
- package/modules/agents/src/services/database-repository.ts +2786 -0
- package/modules/agents/src/services/index.ts +33 -0
- package/modules/agents/src/services/migration.ts +1152 -0
- package/modules/agents/src/services/module-agent-preflight.ts +76 -0
- package/modules/agents/src/services/outbound-policy.ts +136 -0
- package/modules/agents/src/services/provider-broker.ts +80 -0
- package/modules/agents/src/services/provider-repository.ts +589 -0
- package/modules/agents/src/services/provider-service.ts +968 -0
- package/modules/agents/src/services/repository.ts +294 -0
- package/modules/agents/src/services/run-grant.ts +305 -0
- package/modules/agents/src/services/usage-service.ts +119 -0
- package/modules/agents/src/services/worker.ts +442 -0
- package/modules/agents/src/settings.ts +244 -0
- package/modules/agents/translations/en.json +403 -0
- package/modules/agents/translations/pl.json +403 -0
- package/modules/auth/README.md +215 -0
- package/modules/auth/migrations/0001_auth_core.up.sql +108 -0
- package/modules/auth/migrations/0002_bundled_module_scopes.up.sql +26 -0
- package/modules/auth/migrations/0003_agent_core_scopes.up.sql +12 -0
- package/modules/auth/migrations/0004_owner_only_development_scopes.up.sql +8 -0
- package/modules/auth/migrations/0005_agent_provider_scopes.up.sql +13 -0
- package/modules/auth/migrations/0006_tenant_slug.up.sql +6 -0
- package/modules/auth/migrations/0007_sandbox_scopes.up.sql +13 -0
- package/modules/auth/migrations/0008_api_tokens.up.sql +43 -0
- package/modules/auth/migrations/0009_module_settings.up.sql +24 -0
- package/modules/auth/migrations/0010_sign_in_lockout.up.sql +11 -0
- package/modules/auth/migrations/0011_session_ids_and_password_reset.up.sql +7 -0
- package/modules/auth/migrations/0012_roles.up.sql +31 -0
- package/modules/auth/migrations/0013_audit.up.sql +27 -0
- package/modules/auth/migrations/0014_audit_actor.up.sql +4 -0
- package/modules/auth/migrations/0015_account_security.up.sql +81 -0
- package/modules/auth/module.json +26 -0
- package/modules/auth/package.json +61 -0
- package/modules/auth/spec/module.yaml +190 -0
- package/modules/auth/src/acl/scopes.ts +86 -0
- package/modules/auth/src/api/attempt-limiter.ts +42 -0
- package/modules/auth/src/api/client-address.ts +14 -0
- package/modules/auth/src/api/cookies.ts +52 -0
- package/modules/auth/src/api/origin.ts +40 -0
- package/modules/auth/src/cli/commands.json +74 -0
- package/modules/auth/src/cli/database.ts +51 -0
- package/modules/auth/src/cli/greenfield.ts +173 -0
- package/modules/auth/src/cli/index.ts +184 -0
- package/modules/auth/src/cli/provisioning.ts +211 -0
- package/modules/auth/src/client/AuthBackdrop.tsrx +137 -0
- package/modules/auth/src/client/AuthenticationCore.tsrx +630 -0
- package/modules/auth/src/client/PasswordChangeRequired.tsrx +145 -0
- package/modules/auth/src/client/PublicAuthFlows.tsrx +379 -0
- package/modules/auth/src/client/api.ts +464 -0
- package/modules/auth/src/client/audit/AuditView.tsrx +357 -0
- package/modules/auth/src/client/audit/api.ts +164 -0
- package/modules/auth/src/client/audit/audit-columns.tsrx +47 -0
- package/modules/auth/src/client/audit/audit-row.ts +38 -0
- package/modules/auth/src/client/auth.css +483 -0
- package/modules/auth/src/client/contribution.tsrx +100 -0
- package/modules/auth/src/client/index.ts +32 -0
- package/modules/auth/src/client/security/SecurityView.tsrx +253 -0
- package/modules/auth/src/client/settings/PreferencesCard.tsrx +65 -0
- package/modules/auth/src/client/settings/SettingsView.tsrx +212 -0
- package/modules/auth/src/client/settings/WorkspaceCard.tsrx +59 -0
- package/modules/auth/src/client/settings/api.ts +115 -0
- package/modules/auth/src/client/slug.ts +26 -0
- package/modules/auth/src/client/state.ts +115 -0
- package/modules/auth/src/client/tokens/ApiTokenForm.tsrx +153 -0
- package/modules/auth/src/client/tokens/ApiTokenSecret.tsrx +35 -0
- package/modules/auth/src/client/tokens/ApiTokensView.tsrx +216 -0
- package/modules/auth/src/client/tokens/api.ts +59 -0
- package/modules/auth/src/client/tokens/state.ts +26 -0
- package/modules/auth/src/client/tokens/token-columns.tsrx +64 -0
- package/modules/auth/src/client/translations.ts +23 -0
- package/modules/auth/src/domain/types.ts +152 -0
- package/modules/auth/src/index.ts +42 -0
- package/modules/auth/src/middleware/authentication.ts +97 -0
- package/modules/auth/src/platform.ts +0 -0
- package/modules/auth/src/server/actor.ts +12 -0
- package/modules/auth/src/server/audit-endpoints.ts +51 -0
- package/modules/auth/src/server/composition.ts +9 -0
- package/modules/auth/src/server/endpoints.ts +893 -0
- package/modules/auth/src/server/http.ts +153 -0
- package/modules/auth/src/server/index.ts +37 -0
- package/modules/auth/src/server/roles-endpoints.ts +120 -0
- package/modules/auth/src/server/runtime.ts +705 -0
- package/modules/auth/src/server/session-endpoints.ts +86 -0
- package/modules/auth/src/server/session-security.ts +62 -0
- package/modules/auth/src/server/token-endpoints.ts +106 -0
- package/modules/auth/src/services/auth-service-error.ts +11 -0
- package/modules/auth/src/services/auth-service.ts +2309 -0
- package/modules/auth/src/services/database-repository.ts +1825 -0
- package/modules/auth/src/services/mail-delivery.ts +27 -0
- package/modules/auth/src/services/migration.ts +591 -0
- package/modules/auth/src/services/password.ts +115 -0
- package/modules/auth/src/services/repository.ts +395 -0
- package/modules/auth/src/services/settings-store.ts +92 -0
- package/modules/auth/src/services/totp.ts +135 -0
- package/modules/auth/src/services/validation.ts +186 -0
- package/modules/auth/src/settings.ts +150 -0
- package/modules/auth/translations/en.json +263 -0
- package/modules/auth/translations/pl.json +263 -0
- package/modules/automations/migrations/0001_automations_core.down.sql +10 -0
- package/modules/automations/migrations/0001_automations_core.up.sql +76 -0
- package/modules/automations/migrations/0002_automations_targets.down.sql +9 -0
- package/modules/automations/migrations/0002_automations_targets.up.sql +37 -0
- package/modules/automations/migrations/0003_automations_scheduler_role.down.sql +3 -0
- package/modules/automations/migrations/0003_automations_scheduler_role.up.sql +19 -0
- package/modules/automations/migrations/0004_automations_trigger_routing_role.down.sql +3 -0
- package/modules/automations/migrations/0004_automations_trigger_routing_role.up.sql +18 -0
- package/modules/automations/migrations/README.md +3 -0
- package/modules/automations/module.json +31 -0
- package/modules/automations/package.json +55 -0
- package/modules/automations/spec/module.yaml +93 -0
- package/modules/automations/src/acl/permissions.ts +10 -0
- package/modules/automations/src/api/endpoints.ts +480 -0
- package/modules/automations/src/client/AutomationScheduleForm.tsrx +218 -0
- package/modules/automations/src/client/AutomationSchedulesView.tsrx +339 -0
- package/modules/automations/src/client/AutomationTriggerForm.tsrx +190 -0
- package/modules/automations/src/client/AutomationTriggersView.tsrx +329 -0
- package/modules/automations/src/client/api.ts +148 -0
- package/modules/automations/src/client/contribution.tsrx +70 -0
- package/modules/automations/src/client/index.ts +20 -0
- package/modules/automations/src/client/presentation.ts +38 -0
- package/modules/automations/src/client/state.ts +40 -0
- package/modules/automations/src/client/target-selection.ts +44 -0
- package/modules/automations/src/domain/cadence.ts +44 -0
- package/modules/automations/src/domain/types.ts +110 -0
- package/modules/automations/src/domain/variables.ts +178 -0
- package/modules/automations/src/index.ts +39 -0
- package/modules/automations/src/platform.ts +73 -0
- package/modules/automations/src/server/execution.ts +77 -0
- package/modules/automations/src/server/index.ts +39 -0
- package/modules/automations/src/server/runtime.ts +218 -0
- package/modules/automations/src/server/targets.ts +116 -0
- package/modules/automations/src/services/automations-service.ts +10 -0
- package/modules/automations/src/services/database-repository.ts +763 -0
- package/modules/automations/src/services/index.ts +5 -0
- package/modules/automations/src/services/migration.ts +223 -0
- package/modules/automations/src/services/repository.ts +119 -0
- package/modules/automations/src/services/schedule-service.ts +837 -0
- package/modules/automations/src/services/secret-vault.ts +124 -0
- package/modules/automations/src/services/trigger-service.ts +648 -0
- package/modules/automations/src/settings.ts +69 -0
- package/modules/automations/translations/en.json +126 -0
- package/modules/automations/translations/pl.json +126 -0
- package/modules/automations-workflows-integration/module.json +27 -0
- package/modules/automations-workflows-integration/package.json +48 -0
- package/modules/automations-workflows-integration/spec/module.yaml +93 -0
- package/modules/automations-workflows-integration/src/index.ts +14 -0
- package/modules/automations-workflows-integration/src/platform.ts +24 -0
- package/modules/automations-workflows-integration/src/server/adapter.ts +272 -0
- package/modules/automations-workflows-integration/src/server/index.ts +11 -0
- package/modules/automations-workflows-integration/src/server/tools.ts +0 -0
- package/modules/automations-workflows-integration/translations/en.json +21 -0
- package/modules/automations-workflows-integration/translations/pl.json +21 -0
- package/modules/profile/migrations/0001_profile_core.down.sql +1 -0
- package/modules/profile/migrations/0001_profile_core.up.sql +13 -0
- package/modules/profile/migrations/0002_profile_language.down.sql +1 -0
- package/modules/profile/migrations/0002_profile_language.up.sql +12 -0
- package/modules/profile/migrations/README.md +3 -0
- package/modules/profile/module.json +23 -0
- package/modules/profile/package.json +55 -0
- package/modules/profile/spec/module.yaml +136 -0
- package/modules/profile/src/acl/permissions.ts +5 -0
- package/modules/profile/src/api/endpoints.ts +184 -0
- package/modules/profile/src/client/DisplayNameCard.tsrx +59 -0
- package/modules/profile/src/client/LanguageCard.tsrx +89 -0
- package/modules/profile/src/client/PasswordCard.tsrx +79 -0
- package/modules/profile/src/client/ProfileView.tsrx +192 -0
- package/modules/profile/src/client/SessionsCard.tsrx +158 -0
- package/modules/profile/src/client/api.ts +134 -0
- package/modules/profile/src/client/contribution.tsrx +61 -0
- package/modules/profile/src/client/index.ts +15 -0
- package/modules/profile/src/client/password.ts +41 -0
- package/modules/profile/src/client/sessions-api.ts +52 -0
- package/modules/profile/src/client/state.ts +23 -0
- package/modules/profile/src/domain/types.ts +21 -0
- package/modules/profile/src/index.ts +21 -0
- package/modules/profile/src/platform.ts +23 -0
- package/modules/profile/src/server/index.ts +7 -0
- package/modules/profile/src/server/runtime.ts +84 -0
- package/modules/profile/src/services/database-repository.ts +154 -0
- package/modules/profile/src/services/index.ts +6 -0
- package/modules/profile/src/services/migration.ts +58 -0
- package/modules/profile/src/services/profile-service.ts +114 -0
- package/modules/profile/src/services/repository.ts +13 -0
- package/modules/profile/translations/en.json +58 -0
- package/modules/profile/translations/pl.json +58 -0
- package/modules/sandbox/migrations/0001_sandbox_core.down.sql +6 -0
- package/modules/sandbox/migrations/0001_sandbox_core.up.sql +70 -0
- package/modules/sandbox/migrations/0002_sandbox_session_lifecycle.down.sql +36 -0
- package/modules/sandbox/migrations/0002_sandbox_session_lifecycle.up.sql +37 -0
- package/modules/sandbox/migrations/README.md +7 -0
- package/modules/sandbox/module.json +31 -0
- package/modules/sandbox/package.json +56 -0
- package/modules/sandbox/spec/module.yaml +111 -0
- package/modules/sandbox/src/acl/permissions.ts +18 -0
- package/modules/sandbox/src/api/endpoints.ts +439 -0
- package/modules/sandbox/src/cli/commands.json +84 -0
- package/modules/sandbox/src/cli/index.ts +450 -0
- package/modules/sandbox/src/client/SandboxAccessView.tsrx +191 -0
- package/modules/sandbox/src/client/SandboxGrantForm.tsrx +134 -0
- package/modules/sandbox/src/client/SandboxGrantList.tsrx +83 -0
- package/modules/sandbox/src/client/SandboxSessionList.tsrx +56 -0
- package/modules/sandbox/src/client/api.ts +87 -0
- package/modules/sandbox/src/client/contribution.tsrx +47 -0
- package/modules/sandbox/src/client/index.ts +18 -0
- package/modules/sandbox/src/client/presentation.ts +47 -0
- package/modules/sandbox/src/client/state.ts +20 -0
- package/modules/sandbox/src/domain/types.ts +125 -0
- package/modules/sandbox/src/index.ts +33 -0
- package/modules/sandbox/src/platform.ts +28 -0
- package/modules/sandbox/src/server/index.ts +20 -0
- package/modules/sandbox/src/server/runtime.ts +119 -0
- package/modules/sandbox/src/services/database-repository.ts +567 -0
- package/modules/sandbox/src/services/directory.ts +33 -0
- package/modules/sandbox/src/services/index.ts +19 -0
- package/modules/sandbox/src/services/migration.ts +145 -0
- package/modules/sandbox/src/services/repository.ts +55 -0
- package/modules/sandbox/src/services/sandbox-service-error.ts +10 -0
- package/modules/sandbox/src/services/sandbox-service.ts +533 -0
- package/modules/sandbox/translations/en.json +77 -0
- package/modules/sandbox/translations/pl.json +77 -0
- package/modules/system/module.json +18 -0
- package/modules/system/package.json +56 -0
- package/modules/system/spec/module.yaml +104 -0
- package/modules/system/src/acl/permissions.ts +10 -0
- package/modules/system/src/client/ModuleSettingRow.tsrx +191 -0
- package/modules/system/src/client/ModuleSettingsSection.tsrx +155 -0
- package/modules/system/src/client/ModulesView.tsrx +241 -0
- package/modules/system/src/client/api.ts +36 -0
- package/modules/system/src/client/contribution.tsrx +48 -0
- package/modules/system/src/client/index.ts +26 -0
- package/modules/system/src/client/module-columns.tsrx +66 -0
- package/modules/system/src/client/overview-api.ts +30 -0
- package/modules/system/src/client/setting-copy.ts +30 -0
- package/modules/system/src/client/settings-api.ts +57 -0
- package/modules/system/src/client/state.ts +16 -0
- package/modules/system/src/index.ts +11 -0
- package/modules/system/src/platform.ts +11 -0
- package/modules/system/src/server/endpoints.ts +372 -0
- package/modules/system/src/server/index.ts +11 -0
- package/modules/system/src/server/module-catalog.ts +117 -0
- package/modules/system/translations/en.json +64 -0
- package/modules/system/translations/pl.json +64 -0
- package/modules/users/migrations/README.md +3 -0
- package/modules/users/module.json +27 -0
- package/modules/users/package.json +54 -0
- package/modules/users/spec/module.yaml +79 -0
- package/modules/users/src/acl/permissions.ts +6 -0
- package/modules/users/src/api/endpoints.ts +222 -0
- package/modules/users/src/client/InviteMemberForm.tsrx +62 -0
- package/modules/users/src/client/MemberDrawer.tsrx +298 -0
- package/modules/users/src/client/RoleForm.tsrx +140 -0
- package/modules/users/src/client/RolesView.tsrx +288 -0
- package/modules/users/src/client/UserAccountForm.tsrx +86 -0
- package/modules/users/src/client/UsersView.tsrx +486 -0
- package/modules/users/src/client/api.ts +172 -0
- package/modules/users/src/client/contribution.tsrx +92 -0
- package/modules/users/src/client/index.ts +19 -0
- package/modules/users/src/client/member-columns.tsrx +52 -0
- package/modules/users/src/client/roles-api.ts +90 -0
- package/modules/users/src/client/state.ts +42 -0
- package/modules/users/src/index.ts +27 -0
- package/modules/users/src/platform.ts +11 -0
- package/modules/users/src/services/index.ts +2 -0
- package/modules/users/src/services/users-service.ts +142 -0
- package/modules/users/translations/en.json +133 -0
- package/modules/users/translations/pl.json +133 -0
- package/modules/workflows/migrations/0001_workflows_core.down.sql +19 -0
- package/modules/workflows/migrations/0001_workflows_core.up.sql +228 -0
- package/modules/workflows/migrations/0002_workflows_authorization_subject.down.sql +1 -0
- package/modules/workflows/migrations/0002_workflows_authorization_subject.up.sql +9 -0
- package/modules/workflows/migrations/0003_workflows_worker_role.up.sql +34 -0
- package/modules/workflows/migrations/README.md +7 -0
- package/modules/workflows/module.json +31 -0
- package/modules/workflows/package.json +55 -0
- package/modules/workflows/spec/module.yaml +227 -0
- package/modules/workflows/src/acl/permissions.ts +10 -0
- package/modules/workflows/src/api/endpoints.ts +852 -0
- package/modules/workflows/src/client/WorkflowCanvas.tsrx +819 -0
- package/modules/workflows/src/client/WorkflowCreateForm.tsrx +111 -0
- package/modules/workflows/src/client/WorkflowEditor.tsrx +443 -0
- package/modules/workflows/src/client/WorkflowExecutionHistory.tsrx +169 -0
- package/modules/workflows/src/client/WorkflowFixtureDrawer.tsrx +206 -0
- package/modules/workflows/src/client/WorkflowInputForm.tsrx +125 -0
- package/modules/workflows/src/client/WorkflowInputSchemaEditor.tsrx +185 -0
- package/modules/workflows/src/client/WorkflowInspector.tsrx +471 -0
- package/modules/workflows/src/client/WorkflowLiveConfirmation.tsrx +67 -0
- package/modules/workflows/src/client/WorkflowMappingEditor.tsrx +283 -0
- package/modules/workflows/src/client/WorkflowNodePalette.tsrx +50 -0
- package/modules/workflows/src/client/WorkflowPointerField.tsrx +178 -0
- package/modules/workflows/src/client/WorkflowRevisionReview.tsrx +49 -0
- package/modules/workflows/src/client/WorkflowRunInspector.tsrx +143 -0
- package/modules/workflows/src/client/WorkflowTestPanel.tsrx +109 -0
- package/modules/workflows/src/client/WorkflowValidationPanel.tsrx +139 -0
- package/modules/workflows/src/client/WorkflowsView.tsrx +1060 -0
- package/modules/workflows/src/client/api.ts +312 -0
- package/modules/workflows/src/client/canvas-model.ts +472 -0
- package/modules/workflows/src/client/connected-node.ts +71 -0
- package/modules/workflows/src/client/contribution.tsrx +57 -0
- package/modules/workflows/src/client/create-model.ts +15 -0
- package/modules/workflows/src/client/draft-repair.ts +86 -0
- package/modules/workflows/src/client/index.ts +19 -0
- package/modules/workflows/src/client/input-model.ts +124 -0
- package/modules/workflows/src/client/mapping-model.ts +110 -0
- package/modules/workflows/src/client/pointer-model.ts +123 -0
- package/modules/workflows/src/client/presentation.ts +62 -0
- package/modules/workflows/src/client/run-actions.ts +19 -0
- package/modules/workflows/src/client/state.ts +57 -0
- package/modules/workflows/src/client/viewport.ts +107 -0
- package/modules/workflows/src/client/workflows.css +899 -0
- package/modules/workflows/src/domain/events.ts +399 -0
- package/modules/workflows/src/domain/graph.ts +1136 -0
- package/modules/workflows/src/domain/types.ts +563 -0
- package/modules/workflows/src/index.ts +27 -0
- package/modules/workflows/src/platform.ts +49 -0
- package/modules/workflows/src/server/index.ts +13 -0
- package/modules/workflows/src/server/runtime.ts +266 -0
- package/modules/workflows/src/services/cursor-codec.ts +62 -0
- package/modules/workflows/src/services/database-repository.ts +2407 -0
- package/modules/workflows/src/services/index.ts +6 -0
- package/modules/workflows/src/services/migration.ts +375 -0
- package/modules/workflows/src/services/payload-codec.ts +264 -0
- package/modules/workflows/src/services/repository.ts +285 -0
- package/modules/workflows/src/services/simulation.ts +359 -0
- package/modules/workflows/src/services/worker.ts +1196 -0
- package/modules/workflows/src/services/workflows-service.ts +1395 -0
- package/modules/workflows/translations/en.json +348 -0
- package/modules/workflows/translations/pl.json +348 -0
- package/modules.json +41 -0
- package/package.json +125 -0
- package/packages/ai-provider/package.json +46 -0
- package/packages/ai-provider/src/catalog.ts +102 -0
- package/packages/ai-provider/src/errors.ts +110 -0
- package/packages/ai-provider/src/index.ts +33 -0
- package/packages/ai-provider/src/model.ts +198 -0
- package/packages/ai-provider/src/pricing.ts +73 -0
- package/packages/cli-protocol/package.json +40 -0
- package/packages/cli-protocol/src/index.ts +113 -0
- package/packages/client/package.json +46 -0
- package/packages/client/src/ApplicationShell.tsrx +374 -0
- package/packages/client/src/contributions.ts +172 -0
- package/packages/client/src/i18n/index.ts +30 -0
- package/packages/client/src/i18n/locale.ts +25 -0
- package/packages/client/src/i18n/locales/en.json +66 -0
- package/packages/client/src/i18n/locales/pl.json +66 -0
- package/packages/client/src/i18n/runtime.ts +201 -0
- package/packages/client/src/i18n/translations.ts +88 -0
- package/packages/client/src/index.ts +55 -0
- package/packages/client/src/routing.ts +9 -0
- package/packages/client/src/shell/BrandMark.tsrx +10 -0
- package/packages/client/src/shell/CommandPalette.tsrx +79 -0
- package/packages/client/src/shell/ContributionOutlets.tsrx +31 -0
- package/packages/client/src/shell/DashboardView.tsrx +60 -0
- package/packages/client/src/shell/MobileHeader.tsrx +24 -0
- package/packages/client/src/shell/OrganizationSwitcher.tsrx +100 -0
- package/packages/client/src/shell/OverviewCharts.tsrx +167 -0
- package/packages/client/src/shell/PrimaryNavigation.tsrx +75 -0
- package/packages/client/src/shell/Sidebar.tsrx +76 -0
- package/packages/client/src/shell/Topbar.tsrx +44 -0
- package/packages/client/src/shell/UserMenu.tsrx +103 -0
- package/packages/client/src/shell/WorkspaceContent.tsrx +30 -0
- package/packages/client/src/shell/identity.ts +12 -0
- package/packages/client/src/shell/navigation.ts +68 -0
- package/packages/client/src/shell/shell.css +734 -0
- package/packages/client/src/shell/types.ts +29 -0
- package/packages/client/src/state.ts +63 -0
- package/packages/client/src/web.ts +39 -0
- package/packages/coding-agent/package.json +44 -0
- package/packages/coding-agent/src/drivers/byok.ts +322 -0
- package/packages/coding-agent/src/drivers/claude-code.ts +290 -0
- package/packages/coding-agent/src/drivers/codex.ts +281 -0
- package/packages/coding-agent/src/index.ts +56 -0
- package/packages/coding-agent/src/registry.ts +119 -0
- package/packages/coding-agent/src/roles/contract.ts +60 -0
- package/packages/coding-agent/src/roles/defaults.ts +134 -0
- package/packages/coding-agent/src/roles/handoff.ts +41 -0
- package/packages/coding-agent/src/roles/registry.ts +156 -0
- package/packages/coding-agent/src/roles/skills.ts +72 -0
- package/packages/coding-agent/src/roles/sync.ts +88 -0
- package/packages/coding-agent/src/types.ts +102 -0
- package/packages/coding-agent/src/workspace.ts +275 -0
- package/packages/contracts/package.json +38 -0
- package/packages/contracts/schemas/blueprint.schema.json +48 -0
- package/packages/contracts/schemas/cli-extension.schema.json +90 -0
- package/packages/contracts/schemas/module-artifact.schema.json +82 -0
- package/packages/contracts/schemas/module-catalog.schema.json +48 -0
- package/packages/contracts/schemas/module-spec.schema.json +111 -0
- package/packages/contracts/schemas/module.schema.json +156 -0
- package/packages/contracts/schemas/platform-spec.schema.json +17 -0
- package/packages/contracts/schemas/project.schema.json +270 -0
- package/packages/contracts/src/index.ts +191 -0
- package/packages/contracts/src/module-distribution.ts +47 -0
- package/packages/contracts/src/schemas.ts +18 -0
- package/packages/contracts/src/variables.ts +156 -0
- package/packages/contracts/src/web.ts +60 -0
- package/packages/database/package.json +43 -0
- package/packages/database/src/contracts.ts +399 -0
- package/packages/database/src/index.ts +112 -0
- package/packages/database/src/migrations.ts +444 -0
- package/packages/database/src/postgresql.ts +517 -0
- package/packages/database/src/provider.ts +639 -0
- package/packages/database/src/record-history.ts +201 -0
- package/packages/database/src/registry.ts +265 -0
- package/packages/database/src/reset.ts +87 -0
- package/packages/database-pglite/package.json +42 -0
- package/packages/database-pglite/src/driver.ts +168 -0
- package/packages/database-pglite/src/index.ts +2 -0
- package/packages/database-testing/package.json +44 -0
- package/packages/database-testing/src/index.ts +8 -0
- package/packages/database-testing/src/pglite.ts +124 -0
- package/packages/database-testing/src/postgres.ts +184 -0
- package/packages/database-testing/src/provider.ts +43 -0
- package/packages/database-testing/src/vitest-preset.ts +23 -0
- package/packages/dev-console/README.md +6 -0
- package/packages/dev-console/package.json +38 -0
- package/packages/dev-console/src/index.mjs +220 -0
- package/packages/harness/package.json +47 -0
- package/packages/harness/schemas/task-packet.schema.json +48 -0
- package/packages/harness/src/catalog.ts +24 -0
- package/packages/harness/src/errors.ts +9 -0
- package/packages/harness/src/index.ts +53 -0
- package/packages/harness/src/preamble.ts +31 -0
- package/packages/harness/src/runtime.ts +833 -0
- package/packages/harness/src/task-packet.ts +86 -0
- package/packages/harness/src/tool-adapters.ts +106 -0
- package/packages/harness/src/tool-contract.ts +242 -0
- package/packages/harness/src/vercel-ai-provider.ts +198 -0
- package/packages/kernel/package.json +44 -0
- package/packages/kernel/src/acl.ts +20 -0
- package/packages/kernel/src/actor.ts +139 -0
- package/packages/kernel/src/agent-registry.ts +81 -0
- package/packages/kernel/src/capability-registry.ts +28 -0
- package/packages/kernel/src/errors.ts +9 -0
- package/packages/kernel/src/index.ts +90 -0
- package/packages/kernel/src/legacy-local-state.ts +103 -0
- package/packages/kernel/src/module-compatibility.ts +70 -0
- package/packages/kernel/src/module-registry.ts +124 -0
- package/packages/kernel/src/module-settings.ts +403 -0
- package/packages/kernel/src/record-history.ts +146 -0
- package/packages/kernel/src/runtime-config.ts +51 -0
- package/packages/kernel/src/tool-registry.ts +25 -0
- package/packages/kernel/src/variable-registry.ts +339 -0
- package/packages/sandbox/README.md +691 -0
- package/packages/sandbox/bin/flowdular-sandbox.mjs +393 -0
- package/packages/sandbox/dist/client/assets/App-ClMOrpyg.js +11 -0
- package/packages/sandbox/dist/client/assets/PreviewHost-BHiHrfbQ.js +1 -0
- package/packages/sandbox/dist/client/assets/auto-buGEq6de.js +3 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/index-CvwhlQ87.js +4 -0
- package/packages/sandbox/dist/client/assets/styles-BPWaGf55.js +3 -0
- package/packages/sandbox/dist/client/assets/styles-Dx1_KOag.css +1 -0
- package/packages/sandbox/dist/client/favicon.svg +1 -0
- package/packages/sandbox/dist/server/assets/auto-CVGNYyb3.js +12785 -0
- package/packages/sandbox/dist/server/assets/chunk-DDJLRBDX-3OUNo51g.js +4125 -0
- package/packages/sandbox/dist/server/assets/nodefs-DVSI7kG0.js +24 -0
- package/packages/sandbox/dist/server/assets/opfs-ahp-D56iokt1.js +388 -0
- package/packages/sandbox/dist/server/assets/token-Bvaq7Anz.js +55 -0
- package/packages/sandbox/dist/server/assets/token-util-BqSvdIPQ.js +3 -0
- package/packages/sandbox/dist/server/assets/token-util-CktFFT4z.js +494 -0
- package/packages/sandbox/dist/server/entry.js +91671 -0
- package/packages/sandbox/dist/server/favicon.svg +1 -0
- package/packages/sandbox/dist/server/index.html +161 -0
- package/packages/sandbox/index.html +159 -0
- package/packages/sandbox/octane.config.ts +36 -0
- package/packages/sandbox/package.json +83 -0
- package/packages/sandbox/public/favicon.svg +1 -0
- package/packages/sandbox/public/og.png +0 -0
- package/packages/sandbox/src/App.tsrx +924 -0
- package/packages/sandbox/src/client/ApprovalHandoff.tsrx +39 -0
- package/packages/sandbox/src/client/ChatPane.tsrx +694 -0
- package/packages/sandbox/src/client/ConnectView.tsrx +86 -0
- package/packages/sandbox/src/client/DiffPane.tsrx +150 -0
- package/packages/sandbox/src/client/EjectModal.tsrx +571 -0
- package/packages/sandbox/src/client/GateResults.tsrx +60 -0
- package/packages/sandbox/src/client/GitHubSettingsModal.tsrx +219 -0
- package/packages/sandbox/src/client/NewSessionForm.tsrx +214 -0
- package/packages/sandbox/src/client/SessionBar.tsrx +151 -0
- package/packages/sandbox/src/client/SessionPicker.tsrx +472 -0
- package/packages/sandbox/src/client/SpecEditor.tsrx +109 -0
- package/packages/sandbox/src/client/SpecReviewCard.tsrx +321 -0
- package/packages/sandbox/src/client/WorkCard.tsrx +128 -0
- package/packages/sandbox/src/client/WorkbenchModal.tsrx +161 -0
- package/packages/sandbox/src/client/WorkspaceMenu.tsrx +100 -0
- package/packages/sandbox/src/client/api.ts +797 -0
- package/packages/sandbox/src/client/attachments.ts +73 -0
- package/packages/sandbox/src/client/dashboard.ts +46 -0
- package/packages/sandbox/src/client/github-settings.ts +48 -0
- package/packages/sandbox/src/client/highlight.ts +105 -0
- package/packages/sandbox/src/client/i18n.ts +32 -0
- package/packages/sandbox/src/client/locales/en.json +466 -0
- package/packages/sandbox/src/client/locales/pl.json +466 -0
- package/packages/sandbox/src/client/session-labels.ts +77 -0
- package/packages/sandbox/src/client/state.ts +108 -0
- package/packages/sandbox/src/index.ts +10 -0
- package/packages/sandbox/src/preview/PreviewHost.tsrx +373 -0
- package/packages/sandbox/src/preview/load-module.ts +16 -0
- package/packages/sandbox/src/server/attachments.ts +308 -0
- package/packages/sandbox/src/server/auto-review.ts +181 -0
- package/packages/sandbox/src/server/checkpoints.ts +90 -0
- package/packages/sandbox/src/server/config.ts +460 -0
- package/packages/sandbox/src/server/dashboard.ts +245 -0
- package/packages/sandbox/src/server/delivery/configuration.ts +193 -0
- package/packages/sandbox/src/server/delivery/git-pr.ts +1473 -0
- package/packages/sandbox/src/server/delivery/index.ts +83 -0
- package/packages/sandbox/src/server/delivery/local.ts +151 -0
- package/packages/sandbox/src/server/delivery/official-modules.ts +516 -0
- package/packages/sandbox/src/server/delivery/plan.ts +218 -0
- package/packages/sandbox/src/server/delivery/policies.ts +239 -0
- package/packages/sandbox/src/server/delivery/record.ts +41 -0
- package/packages/sandbox/src/server/delivery/steps.ts +464 -0
- package/packages/sandbox/src/server/delivery/types.ts +158 -0
- package/packages/sandbox/src/server/dependencies.ts +88 -0
- package/packages/sandbox/src/server/diff.ts +230 -0
- package/packages/sandbox/src/server/gates.ts +388 -0
- package/packages/sandbox/src/server/index.ts +139 -0
- package/packages/sandbox/src/server/path-guard.ts +282 -0
- package/packages/sandbox/src/server/planning.ts +749 -0
- package/packages/sandbox/src/server/platform-client.ts +189 -0
- package/packages/sandbox/src/server/preview-database-host.ts +340 -0
- package/packages/sandbox/src/server/preview-database-protocol.ts +163 -0
- package/packages/sandbox/src/server/preview-database-proxy.ts +356 -0
- package/packages/sandbox/src/server/preview-database.ts +109 -0
- package/packages/sandbox/src/server/preview-ipc.ts +15 -0
- package/packages/sandbox/src/server/preview-modules.ts +83 -0
- package/packages/sandbox/src/server/preview-revision.ts +44 -0
- package/packages/sandbox/src/server/preview-runtime.ts +467 -0
- package/packages/sandbox/src/server/preview-worker-manager.ts +436 -0
- package/packages/sandbox/src/server/preview-worker.ts +168 -0
- package/packages/sandbox/src/server/reference.ts +251 -0
- package/packages/sandbox/src/server/routes.ts +2258 -0
- package/packages/sandbox/src/server/runtime.ts +188 -0
- package/packages/sandbox/src/server/session-owner.ts +23 -0
- package/packages/sandbox/src/server/sessions.ts +849 -0
- package/packages/sandbox/src/server/spec.ts +471 -0
- package/packages/sandbox/src/server/turn-lifecycle.ts +56 -0
- package/packages/sandbox/src/server/turns.ts +993 -0
- package/packages/sandbox/src/server/workspace-install.ts +266 -0
- package/packages/sandbox/src/server/workspace-root.ts +73 -0
- package/packages/sandbox/src/styles.css +1573 -0
- package/packages/sandbox/vite.config.ts +133 -0
- package/packages/server/package.json +43 -0
- package/packages/server/src/application-routes.ts +21 -0
- package/packages/server/src/composition.ts +48 -0
- package/packages/server/src/endpoint.ts +142 -0
- package/packages/server/src/http.ts +128 -0
- package/packages/server/src/index.ts +46 -0
- package/packages/server/src/response-lifetime.ts +56 -0
- package/packages/server/src/security-headers.ts +130 -0
- package/packages/server/src/web-html.ts +55 -0
- package/packages/server/src/web.ts +361 -0
- package/packages/ui/package.json +46 -0
- package/packages/ui/src/brand/BrandMark.tsrx +66 -0
- package/packages/ui/src/brand/mark.ts +44 -0
- package/packages/ui/src/components/Alert.tsrx +17 -0
- package/packages/ui/src/components/Avatar.tsrx +18 -0
- package/packages/ui/src/components/Button.tsrx +29 -0
- package/packages/ui/src/components/Chart.tsrx +274 -0
- package/packages/ui/src/components/CheckGrid.tsrx +93 -0
- package/packages/ui/src/components/ConfirmDialog.tsrx +63 -0
- package/packages/ui/src/components/Drawer.tsrx +71 -0
- package/packages/ui/src/components/EmptyState.tsrx +26 -0
- package/packages/ui/src/components/Filters.tsrx +39 -0
- package/packages/ui/src/components/FormField.tsrx +27 -0
- package/packages/ui/src/components/Kpi.tsrx +36 -0
- package/packages/ui/src/components/PageHeader.tsrx +26 -0
- package/packages/ui/src/components/ScopeSummary.tsrx +76 -0
- package/packages/ui/src/components/SearchField.tsrx +24 -0
- package/packages/ui/src/components/SettingRow.tsrx +50 -0
- package/packages/ui/src/components/Switch.tsrx +21 -0
- package/packages/ui/src/components/Table.tsrx +267 -0
- package/packages/ui/src/components/TableCard.tsrx +52 -0
- package/packages/ui/src/components/Tag.tsrx +28 -0
- package/packages/ui/src/components/VariableField.tsrx +284 -0
- package/packages/ui/src/components/VariableInput.tsrx +7 -0
- package/packages/ui/src/components/VariableSelect.tsrx +72 -0
- package/packages/ui/src/components/VariableTextarea.tsrx +9 -0
- package/packages/ui/src/components/variable-field.ts +61 -0
- package/packages/ui/src/components/variable-select.ts +69 -0
- package/packages/ui/src/icons/Icon.tsrx +56 -0
- package/packages/ui/src/index.ts +81 -0
- package/packages/ui/src/initials.ts +10 -0
- package/packages/ui/src/styles/base.css +71 -0
- package/packages/ui/src/styles/components.css +1859 -0
- package/packages/ui/src/styles/index.css +3 -0
- package/packages/ui/src/styles/tokens.css +124 -0
- package/tsconfig.base.json +18 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
schemaVersion: 1
|
|
2
|
+
id: auth.core
|
|
3
|
+
specVersion: 0.10.0
|
|
4
|
+
status: approved
|
|
5
|
+
name: Authentication Core
|
|
6
|
+
description: Provides tenant-aware accounts, password authentication, sessions, scopes, tenant roles, API tokens for machine clients, the module settings store, the auth audit trail, security headers, authentication screens, and server authorization middleware.
|
|
7
|
+
profile: full
|
|
8
|
+
capabilities:
|
|
9
|
+
- api
|
|
10
|
+
- database
|
|
11
|
+
- client
|
|
12
|
+
- translations
|
|
13
|
+
- cli
|
|
14
|
+
dependencies:
|
|
15
|
+
- id: system.core
|
|
16
|
+
range: 0.5.0
|
|
17
|
+
tenancy: required
|
|
18
|
+
locales:
|
|
19
|
+
- en
|
|
20
|
+
- pl
|
|
21
|
+
invariants:
|
|
22
|
+
- Passwords are stored only as salted memory-hard hashes.
|
|
23
|
+
- Raw session tokens are never persisted and never exposed to browser JavaScript.
|
|
24
|
+
- Greenfield reset is restricted to the workspace-local development database and requires explicit typed confirmation.
|
|
25
|
+
- Authentication cookies are HttpOnly, same-site, host-only, and secure outside explicitly configured local development.
|
|
26
|
+
- Every authenticated principal belongs to exactly one active tenant context.
|
|
27
|
+
- An account may belong to multiple tenants, while every session is bound to one selected membership.
|
|
28
|
+
- Switching tenant context rotates the session and loads scopes from the target membership.
|
|
29
|
+
- Authorization is evaluated server-side and missing scopes are denied.
|
|
30
|
+
- Sign-up availability is controlled by the auth.allowSignUp module setting and is enforced by both the API and client.
|
|
31
|
+
- Bundled module scopes are assigned from explicit owner and member defaults and migrated for existing tenant memberships.
|
|
32
|
+
- An API token is a tenant-scoped machine credential bound to one membership. Only its hash is stored, the raw value is returned exactly once at creation, and it is never recoverable afterwards.
|
|
33
|
+
- API token authority is the intersection of its recorded scopes with the live membership scopes at every request. Revoking a scope or disabling the membership takes effect immediately without touching the token.
|
|
34
|
+
- An API token can never pass a session-guarded mutation. Requests carrying a token instead of a browser session are denied before the handler runs.
|
|
35
|
+
- Issuing, listing, and revoking API tokens require a browser session with the token management scope. A machine credential cannot mint or revoke another credential.
|
|
36
|
+
- A revoked or expired API token authenticates nothing, and token lifetime is bounded to one year.
|
|
37
|
+
- Sign-in attempts are throttled per submitted address and per trusted client address, and repeated failures lock the address for a fixed period with a stable error that never reveals whether an account exists.
|
|
38
|
+
- Sign-up and sign-in errors never confirm that an email address is registered.
|
|
39
|
+
- Every response carries the platform security headers; the content security policy is enforced in production and report-only in development.
|
|
40
|
+
- A session ends at its absolute lifetime or after the configured idle period, whichever comes first; expired rows are swept periodically.
|
|
41
|
+
- Every tenant carries the built-in owner and member roles as rows; custom roles are tenant-scoped, grant only grantable scopes, and cannot be edited, deleted, or shadowed when built in or in use.
|
|
42
|
+
- Assigning a role replaces the membership scopes with the role's scopes and keeps the role key on the membership in sync.
|
|
43
|
+
- Module settings are declared by their owning module, stored per tenant (or once for the platform), validated against the declaration on every write, and secret values are never returned.
|
|
44
|
+
- Email confirmation cannot be enabled without a composed mail transport.
|
|
45
|
+
- Password reset and tenant invitation tokens are random, hashed at rest, short lived, single use, and never returned by HTTP APIs.
|
|
46
|
+
- Operator provisioning creates a workspace, its owner and the owner scopes exactly as sign-up does, works against the deployment database, and never reads the sign-up setting.
|
|
47
|
+
- An operator command never returns a password the operator did not supply. It emits a single-use setup or invitation link once, and a supplied password is read from the environment rather than from a command flag.
|
|
48
|
+
- Every operator provisioning command appends an audit row whose actor identifies the operator shell that ran it.
|
|
49
|
+
- TOTP secrets are encrypted with a deployment-provided AES-256 key; a successful password check creates a short-lived, single-use MFA challenge rather than a session.
|
|
50
|
+
- External email delivery is an injected deployment adapter. The local in-memory adapter is development-only and never exposes tokens over HTTP or logs.
|
|
51
|
+
- Authentication and administration events are appended to an auth audit trail that is readable per tenant and never contains credentials or raw tokens.
|
|
52
|
+
- Every request-time read and write runs on a tenant-scoped database handle, under forced row-level security bound to the transaction tenant.
|
|
53
|
+
- A lookup that arrives with a key and no workspace, such as a session cookie, a bearer token, an invitation link or an email address, resolves the owning tenant on a read-only cross-tenant handle that is granted only the routing columns, and the work that follows runs under the tenant that lookup named.
|
|
54
|
+
permissions:
|
|
55
|
+
- id: auth.profile.read
|
|
56
|
+
description: Read the current account profile.
|
|
57
|
+
- id: auth.session.manage
|
|
58
|
+
description: Create, inspect, and revoke the current account session.
|
|
59
|
+
- id: auth.account.manage
|
|
60
|
+
description: Manage account security settings.
|
|
61
|
+
- id: auth.tenant.switch
|
|
62
|
+
description: Switch the active session to another granted tenant membership.
|
|
63
|
+
- id: auth.tokens.read
|
|
64
|
+
description: Read API token metadata of the active tenant.
|
|
65
|
+
- id: auth.tokens.manage
|
|
66
|
+
description: Issue and revoke API tokens for the active tenant.
|
|
67
|
+
- id: auth.roles.read
|
|
68
|
+
description: Read the tenant role catalog and the grantable scopes.
|
|
69
|
+
- id: auth.roles.manage
|
|
70
|
+
description: Create, change, and delete custom tenant roles.
|
|
71
|
+
- id: auth.audit.read
|
|
72
|
+
description: Read the authentication and administration audit trail of the active tenant.
|
|
73
|
+
dataOwnership:
|
|
74
|
+
- Accounts, tenant memberships, scope grants, and hashed sessions are owned by auth.core.
|
|
75
|
+
- API token identity, hashed secret, recorded scopes, expiry, revocation state, and last use are owned by auth.core.
|
|
76
|
+
- Tenant roles, sign-in failure counters, module settings values, and the auth audit trail are owned by auth.core.
|
|
77
|
+
- Other modules may reference account and tenant identifiers but may not write authentication tables.
|
|
78
|
+
acceptanceScenarios:
|
|
79
|
+
- id: AUTH-TOKEN-ISSUE
|
|
80
|
+
given: An owner with auth.tokens.manage and an active browser session.
|
|
81
|
+
when: The owner issues an API token with a label, a scope subset, and an optional expiry.
|
|
82
|
+
then: The raw token is returned once, only its hash and safe metadata are persisted, and the recorded scopes are the intersection with the membership scopes.
|
|
83
|
+
- id: AUTH-TOKEN-AUTHENTICATE
|
|
84
|
+
given: A live API token and a read endpoint that requires one of its scopes.
|
|
85
|
+
when: A client sends the token as a bearer credential without a session cookie.
|
|
86
|
+
then: The request is authorized as that membership with the token scopes, and the token's last use is recorded.
|
|
87
|
+
- id: AUTH-TOKEN-MUTATION-DENY
|
|
88
|
+
given: A live API token and an endpoint protected by the session mutation guard.
|
|
89
|
+
when: The client attempts the mutation with the token.
|
|
90
|
+
then: The server denies the request with a stable token error before the handler runs.
|
|
91
|
+
- id: AUTH-TOKEN-REVOKE
|
|
92
|
+
given: An issued API token.
|
|
93
|
+
when: An owner revokes it, or its expiry passes, or its membership loses the scope.
|
|
94
|
+
then: The next request carrying that token is unauthenticated, and no further lookup grants authority.
|
|
95
|
+
- id: AUTH-SIGNUP
|
|
96
|
+
given: A visitor provides a valid unique email, organization, display name, and password.
|
|
97
|
+
when: The visitor submits the sign-up form from the same origin.
|
|
98
|
+
then: An account, tenant membership, scoped session, and protected cookie are created atomically.
|
|
99
|
+
- id: AUTH-SIGNIN
|
|
100
|
+
given: An active account exists with a stored password hash.
|
|
101
|
+
when: Correct credentials are submitted from the same origin.
|
|
102
|
+
then: A new rotated session is returned without exposing its token to JavaScript.
|
|
103
|
+
- id: AUTH-DENY
|
|
104
|
+
given: A request has no valid session or lacks a required scope.
|
|
105
|
+
when: It reaches a protected middleware boundary.
|
|
106
|
+
then: The server returns 401 or 403 and does not invoke the protected handler.
|
|
107
|
+
- id: AUTH-SIGNOUT
|
|
108
|
+
given: An authenticated session and matching CSRF token exist.
|
|
109
|
+
when: The user signs out from the same origin.
|
|
110
|
+
then: The server revokes the session and expires the browser cookie.
|
|
111
|
+
- id: AUTH-GREENFIELD
|
|
112
|
+
given: A developer requests a fresh local authentication database while the application is stopped.
|
|
113
|
+
when: The developer supplies both apply authorization and the exact reset-local-auth confirmation token.
|
|
114
|
+
then: Only the workspace-local auth database is reset; documented admin and user accounts plus two isolated tenants are seeded.
|
|
115
|
+
- id: AUTH-TENANT-SWITCH
|
|
116
|
+
given: An authenticated account has memberships in more than one tenant.
|
|
117
|
+
when: The account selects another granted tenant with its current CSRF token.
|
|
118
|
+
then: The old session is revoked and a rotated session is bound to the selected tenant and its scopes.
|
|
119
|
+
- id: AUTH-SIGNUP-DISABLED
|
|
120
|
+
given: The auth.allowSignUp module setting is false.
|
|
121
|
+
when: A visitor opens or submits sign-up.
|
|
122
|
+
then: The client routes to sign-in and the server rejects account creation without writing authentication data.
|
|
123
|
+
- id: AUTH-AGENT-SCOPES
|
|
124
|
+
given: The bundled agents.core module is enabled.
|
|
125
|
+
when: Default owner and member scope grants are created or migrated.
|
|
126
|
+
then: Owners can manage and execute agents while members receive only the explicitly declared read and execute scopes.
|
|
127
|
+
- id: AUTH-LOCKOUT
|
|
128
|
+
given: Five failed sign-in attempts for one address within the window.
|
|
129
|
+
when: The next sign-in for that address arrives, correct or not.
|
|
130
|
+
then: The server returns the stable ACCOUNT_LOCKED error until the lock period passes, and the audit trail records the lock for a known account.
|
|
131
|
+
- id: AUTH-SECURITY-HEADERS
|
|
132
|
+
given: Any request served by the platform.
|
|
133
|
+
when: The response is produced.
|
|
134
|
+
then: It carries nosniff, frame denial, referrer, and permissions policies, HSTS when secure cookies are on, and a content security policy.
|
|
135
|
+
- id: AUTH-ROLE-CUSTOM
|
|
136
|
+
given: An owner with auth.roles.manage.
|
|
137
|
+
when: The owner creates a role with a subset of grantable scopes and assigns it to a member.
|
|
138
|
+
then: The role is listed for the tenant only, the member's scopes equal the role's scopes, and deleting the role is refused while a member holds it.
|
|
139
|
+
- id: AUTH-ROLE-BUILTIN
|
|
140
|
+
given: The built-in owner or member role.
|
|
141
|
+
when: Anyone tries to rename, rescope, delete, or recreate it.
|
|
142
|
+
then: The server refuses with a stable error and the role is unchanged.
|
|
143
|
+
- id: AUTH-SETTINGS-STORE
|
|
144
|
+
given: A module setting is written through the shared settings runtime by an identified actor.
|
|
145
|
+
when: The value passes the declared validation and the write commits.
|
|
146
|
+
then: The value is persisted in auth.db per tenant (or once for the platform), the next read returns it, and a settings.updated audit event records the actor, the setting, and whether the value was cleared.
|
|
147
|
+
- id: AUTH-WORKSPACE-SETTINGS
|
|
148
|
+
given: An owner with system.settings.manage on Administration > Settings.
|
|
149
|
+
when: The owner renames the workspace or picks a default locale.
|
|
150
|
+
then: The tenant name is updated and reflected in the session, the defaultLocale tenant setting is stored through the platform settings API, and the session payload serves it as tenantSettings.defaultLocale.
|
|
151
|
+
- id: AUTH-AUDIT-READ
|
|
152
|
+
given: A principal with auth.audit.read.
|
|
153
|
+
when: The principal pages through the audit trail with action and actor filters.
|
|
154
|
+
then: Only the active tenant's events are returned, newest first, with a cursor for the next page.
|
|
155
|
+
- id: AUTH-AUDIT-SOURCES
|
|
156
|
+
given: A principal who opens the unified audit screen holding a subset of auth.audit.read, agents.runs.read, and sandbox.sessions.read.
|
|
157
|
+
when: The screen offers audit sources.
|
|
158
|
+
then: Only the sources whose scope the principal holds are selectable, and the agent and sandbox sources show a chain-integrity indicator driven by their verify endpoint.
|
|
159
|
+
- id: AUTH-SESSIONS-OWN
|
|
160
|
+
given: An account with several live sessions.
|
|
161
|
+
when: The account lists its sessions and revokes one that is not current.
|
|
162
|
+
then: The revoked session no longer resolves and the current one is unchanged.
|
|
163
|
+
- id: AUTH-PASSWORD-RECOVERY
|
|
164
|
+
given: A visitor has access to the email address of an active account.
|
|
165
|
+
when: The visitor requests a reset and submits the delivered, unexpired, single-use token with a policy-compliant password.
|
|
166
|
+
then: The password changes, earlier sessions are revoked, the token cannot be reused, and the request response never reveals whether the address exists.
|
|
167
|
+
- id: AUTH-INVITATION-ACCEPT
|
|
168
|
+
given: A workspace administrator delivered a tenant invitation through the configured mail adapter.
|
|
169
|
+
when: The invited person submits the unexpired, single-use token with account details.
|
|
170
|
+
then: The account gains only the invited workspace role, the token cannot be reused, and no token appears in logs or audit metadata.
|
|
171
|
+
- id: AUTH-MFA-ENROLL
|
|
172
|
+
given: An authenticated account and a configured MFA encryption key.
|
|
173
|
+
when: The account enrolls a TOTP authenticator and confirms a valid rotating code.
|
|
174
|
+
then: The secret stays encrypted at rest, recovery codes are returned only during enrollment, and future sign-in requires a TOTP or unused recovery code.
|
|
175
|
+
- id: AUTH-MFA-OIDC
|
|
176
|
+
given: An account with confirmed TOTP signs in through an enabled, configured OIDC provider.
|
|
177
|
+
when: The provider returns a verified email for that account.
|
|
178
|
+
then: Flowdular redirects to the MFA challenge using a short-lived HttpOnly proof cookie and creates no session before the second factor succeeds.
|
|
179
|
+
- id: AUTH-SECURITY-SURFACES
|
|
180
|
+
given: A browser opens account recovery, invitation acceptance, or personal security from a supported route.
|
|
181
|
+
when: The corresponding operation is unavailable, loading, denied, invalid, successful, or pending confirmation.
|
|
182
|
+
then: The screen renders a translated explicit state and never exposes a stored credential or reusable token.
|
|
183
|
+
- id: AUTH-OPERATOR-WORKSPACE
|
|
184
|
+
given: A deployment with public sign-up disabled and no workspace yet.
|
|
185
|
+
when: An operator runs the workspace creation command with a workspace name, an owner address and a display name, and authorizes it with apply.
|
|
186
|
+
then: The workspace, the owner account, the owner membership and the owner scopes are created exactly as a sign-up creates them, an audit row names the operator, and the owner's first credential is returned once as a single-use setup link unless the operator supplied a password through the environment.
|
|
187
|
+
- id: AUTH-OPERATOR-MEMBER
|
|
188
|
+
given: An existing workspace in a deployment with public sign-up disabled.
|
|
189
|
+
when: An operator adds an email address to that workspace with a role.
|
|
190
|
+
then: A known account joins immediately with that role's scopes, an unknown address receives a single-use invitation link that is shown once, and either outcome is appended to the workspace audit trail with the operator as the actor.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export const AUTH_SCOPES = {
|
|
2
|
+
profileRead: 'auth.profile.read',
|
|
3
|
+
sessionManage: 'auth.session.manage',
|
|
4
|
+
accountManage: 'auth.account.manage',
|
|
5
|
+
tenantSwitch: 'auth.tenant.switch',
|
|
6
|
+
tokensRead: 'auth.tokens.read',
|
|
7
|
+
tokensManage: 'auth.tokens.manage',
|
|
8
|
+
rolesRead: 'auth.roles.read',
|
|
9
|
+
rolesManage: 'auth.roles.manage',
|
|
10
|
+
auditRead: 'auth.audit.read',
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
13
|
+
export const PLATFORM_SCOPES = {
|
|
14
|
+
workspaceAccess: 'system.workspace.access',
|
|
15
|
+
modulesRead: 'system.modules.read',
|
|
16
|
+
specsRead: 'system.specs.read',
|
|
17
|
+
runsRead: 'system.runs.read',
|
|
18
|
+
settingsRead: 'system.settings.read',
|
|
19
|
+
settingsManage: 'system.settings.manage',
|
|
20
|
+
} as const;
|
|
21
|
+
|
|
22
|
+
export const BUNDLED_MODULE_SCOPES = {
|
|
23
|
+
usersRead: 'users.members.read',
|
|
24
|
+
usersManage: 'users.members.manage',
|
|
25
|
+
partiesRead: 'parties.records.read',
|
|
26
|
+
partiesManage: 'parties.records.manage',
|
|
27
|
+
catalogRead: 'catalog.items.read',
|
|
28
|
+
catalogManage: 'catalog.items.manage',
|
|
29
|
+
agentDefinitionsRead: 'agents.definitions.read',
|
|
30
|
+
agentDefinitionsManage: 'agents.definitions.manage',
|
|
31
|
+
agentRunsRead: 'agents.runs.read',
|
|
32
|
+
agentRunsExecute: 'agents.runs.execute',
|
|
33
|
+
agentProvidersRead: 'agents.providers.read',
|
|
34
|
+
agentProvidersManage: 'agents.providers.manage',
|
|
35
|
+
agentProvidersTest: 'agents.providers.test',
|
|
36
|
+
agentSkillsRead: 'agents.skills.read',
|
|
37
|
+
agentSkillsManage: 'agents.skills.manage',
|
|
38
|
+
sandboxAccessUse: 'sandbox.access.use',
|
|
39
|
+
sandboxAccessManage: 'sandbox.access.manage',
|
|
40
|
+
sandboxSessionsRead: 'sandbox.sessions.read',
|
|
41
|
+
sandboxPreviewData: 'sandbox.preview.data',
|
|
42
|
+
sandboxModulesEject: 'sandbox.modules.eject',
|
|
43
|
+
} as const;
|
|
44
|
+
|
|
45
|
+
export const OWNER_SCOPES = Object.freeze([
|
|
46
|
+
...Object.values(AUTH_SCOPES),
|
|
47
|
+
...Object.values(PLATFORM_SCOPES),
|
|
48
|
+
...Object.values(BUNDLED_MODULE_SCOPES),
|
|
49
|
+
]);
|
|
50
|
+
|
|
51
|
+
export const MEMBER_SCOPES = Object.freeze([
|
|
52
|
+
AUTH_SCOPES.profileRead,
|
|
53
|
+
AUTH_SCOPES.sessionManage,
|
|
54
|
+
AUTH_SCOPES.tenantSwitch,
|
|
55
|
+
AUTH_SCOPES.rolesRead,
|
|
56
|
+
PLATFORM_SCOPES.workspaceAccess,
|
|
57
|
+
BUNDLED_MODULE_SCOPES.usersRead,
|
|
58
|
+
BUNDLED_MODULE_SCOPES.partiesRead,
|
|
59
|
+
BUNDLED_MODULE_SCOPES.catalogRead,
|
|
60
|
+
BUNDLED_MODULE_SCOPES.agentDefinitionsRead,
|
|
61
|
+
BUNDLED_MODULE_SCOPES.agentRunsRead,
|
|
62
|
+
BUNDLED_MODULE_SCOPES.agentRunsExecute,
|
|
63
|
+
BUNDLED_MODULE_SCOPES.agentSkillsRead,
|
|
64
|
+
]);
|
|
65
|
+
|
|
66
|
+
/* Built-in roles; every tenant gets a row per entry in auth_roles. */
|
|
67
|
+
export const BUILTIN_ROLES = Object.freeze([
|
|
68
|
+
{
|
|
69
|
+
key: 'owner',
|
|
70
|
+
name: 'Owner',
|
|
71
|
+
description:
|
|
72
|
+
'Full workspace administration, module management, and operational access.',
|
|
73
|
+
scopes: OWNER_SCOPES,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
key: 'member',
|
|
77
|
+
name: 'Member',
|
|
78
|
+
description:
|
|
79
|
+
'Standard workspace access with read-only access to bundled records.',
|
|
80
|
+
scopes: MEMBER_SCOPES,
|
|
81
|
+
},
|
|
82
|
+
] as const);
|
|
83
|
+
|
|
84
|
+
export type AuthScope =
|
|
85
|
+
| (typeof OWNER_SCOPES)[number]
|
|
86
|
+
| (typeof MEMBER_SCOPES)[number];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* Fixed-window counter per key, bounded by evicting the least recently touched
|
|
2
|
+
key once the table is full. A flood of new keys can therefore only shorten
|
|
3
|
+
other attackers' windows, never lock legitimate first-time callers out. */
|
|
4
|
+
export class AttemptLimiter {
|
|
5
|
+
readonly #attempts = new Map<string, { count: number; resetAt: number }>();
|
|
6
|
+
readonly #limit: number;
|
|
7
|
+
readonly #windowMs: number;
|
|
8
|
+
readonly #maxEntries: number;
|
|
9
|
+
|
|
10
|
+
constructor(limit = 5, windowMs = 5 * 60 * 1000, maxEntries = 10_000) {
|
|
11
|
+
this.#limit = limit;
|
|
12
|
+
this.#windowMs = windowMs;
|
|
13
|
+
this.#maxEntries = maxEntries;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
consume(key: string, now = Date.now()): boolean {
|
|
17
|
+
const current = this.#attempts.get(key);
|
|
18
|
+
if (current && current.resetAt > now) {
|
|
19
|
+
if (current.count >= this.#limit) return false;
|
|
20
|
+
current.count += 1;
|
|
21
|
+
this.#attempts.delete(key);
|
|
22
|
+
this.#attempts.set(key, current);
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
if (current) {
|
|
26
|
+
this.#attempts.delete(key);
|
|
27
|
+
} else if (this.#attempts.size >= this.#maxEntries) {
|
|
28
|
+
const oldest = this.#attempts.keys().next().value;
|
|
29
|
+
if (oldest !== undefined) this.#attempts.delete(oldest);
|
|
30
|
+
}
|
|
31
|
+
this.#attempts.set(key, { count: 1, resetAt: now + this.#windowMs });
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
clear(key: string): void {
|
|
36
|
+
this.#attempts.delete(key);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get size(): number {
|
|
40
|
+
return this.#attempts.size;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const ADDRESS_PATTERN = /^[0-9a-fA-F.:]{3,45}$/;
|
|
2
|
+
|
|
3
|
+
/* Octane hands routes a Web Request without the socket address, so the client
|
|
4
|
+
address is only known behind a reverse proxy that is explicitly trusted to
|
|
5
|
+
set x-forwarded-for. Callers skip address-based limits on null. */
|
|
6
|
+
export function clientAddress(
|
|
7
|
+
request: Request,
|
|
8
|
+
trustProxy: boolean,
|
|
9
|
+
): string | null {
|
|
10
|
+
if (!trustProxy) return null;
|
|
11
|
+
const forwarded = request.headers.get('x-forwarded-for');
|
|
12
|
+
const first = forwarded?.split(',')[0]?.trim() ?? '';
|
|
13
|
+
return ADDRESS_PATTERN.test(first) ? first.toLowerCase() : null;
|
|
14
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface AuthCookieConfig {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly secure: boolean;
|
|
4
|
+
readonly maxAgeSeconds: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function readCookie(
|
|
8
|
+
request: globalThis.Request,
|
|
9
|
+
name: string,
|
|
10
|
+
): string | null {
|
|
11
|
+
const header = request.headers.get('cookie');
|
|
12
|
+
if (!header) return null;
|
|
13
|
+
for (const item of header.split(';')) {
|
|
14
|
+
const separator = item.indexOf('=');
|
|
15
|
+
if (separator < 1) continue;
|
|
16
|
+
const key = item.slice(0, separator).trim();
|
|
17
|
+
if (key !== name) continue;
|
|
18
|
+
try {
|
|
19
|
+
return decodeURIComponent(item.slice(separator + 1).trim());
|
|
20
|
+
} catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function sessionCookie(token: string, config: AuthCookieConfig): string {
|
|
28
|
+
return [
|
|
29
|
+
`${config.name}=${encodeURIComponent(token)}`,
|
|
30
|
+
'Path=/',
|
|
31
|
+
'HttpOnly',
|
|
32
|
+
'SameSite=Strict',
|
|
33
|
+
`Max-Age=${config.maxAgeSeconds}`,
|
|
34
|
+
config.secure ? 'Secure' : '',
|
|
35
|
+
]
|
|
36
|
+
.filter(Boolean)
|
|
37
|
+
.join('; ');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function expiredSessionCookie(config: AuthCookieConfig): string {
|
|
41
|
+
return [
|
|
42
|
+
`${config.name}=`,
|
|
43
|
+
'Path=/',
|
|
44
|
+
'HttpOnly',
|
|
45
|
+
'SameSite=Strict',
|
|
46
|
+
'Max-Age=0',
|
|
47
|
+
'Expires=Thu, 01 Jan 1970 00:00:00 GMT',
|
|
48
|
+
config.secure ? 'Secure' : '',
|
|
49
|
+
]
|
|
50
|
+
.filter(Boolean)
|
|
51
|
+
.join('; ');
|
|
52
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Context } from '@octanejs/app-core';
|
|
2
|
+
import { AuthServiceError } from '../services/auth-service-error.ts';
|
|
3
|
+
|
|
4
|
+
export function assertSameOrigin(context: Context): void {
|
|
5
|
+
const site = context.request.headers.get('sec-fetch-site');
|
|
6
|
+
if (site === 'cross-site' || site === 'same-site') {
|
|
7
|
+
throw new AuthServiceError(
|
|
8
|
+
'CROSS_ORIGIN_REQUEST',
|
|
9
|
+
'Cross-origin request rejected.',
|
|
10
|
+
403,
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const origin = context.request.headers.get('origin');
|
|
15
|
+
if (origin) {
|
|
16
|
+
if (origin !== context.url.origin) {
|
|
17
|
+
throw new AuthServiceError(
|
|
18
|
+
'CROSS_ORIGIN_REQUEST',
|
|
19
|
+
'Request origin does not match.',
|
|
20
|
+
403,
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const referer = context.request.headers.get('referer');
|
|
27
|
+
if (referer) {
|
|
28
|
+
try {
|
|
29
|
+
if (new URL(referer).origin === context.url.origin) return;
|
|
30
|
+
} catch {
|
|
31
|
+
// The generic failure below does not disclose header parsing details.
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
throw new AuthServiceError(
|
|
36
|
+
'ORIGIN_REQUIRED',
|
|
37
|
+
'A same-origin request is required.',
|
|
38
|
+
403,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"protocolVersion": 1,
|
|
3
|
+
"moduleId": "auth.core",
|
|
4
|
+
"commands": [
|
|
5
|
+
{
|
|
6
|
+
"path": ["auth", "scopes"],
|
|
7
|
+
"capability": {
|
|
8
|
+
"id": "auth.scopes.list",
|
|
9
|
+
"version": 1,
|
|
10
|
+
"summary": "List authentication and platform scopes granted to new tenant owners.",
|
|
11
|
+
"risk": "read",
|
|
12
|
+
"requiresApprovedSpec": false,
|
|
13
|
+
"supportsDryRun": false
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"path": ["auth", "sync-scopes"],
|
|
18
|
+
"capability": {
|
|
19
|
+
"id": "auth.scopes.sync",
|
|
20
|
+
"version": 1,
|
|
21
|
+
"summary": "Grant the scopes an enabled module declares to every workspace owner.",
|
|
22
|
+
"risk": "process",
|
|
23
|
+
"requiresApprovedSpec": false,
|
|
24
|
+
"supportsDryRun": true
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"path": ["auth", "workspaces"],
|
|
29
|
+
"capability": {
|
|
30
|
+
"id": "auth.workspace.list",
|
|
31
|
+
"version": 1,
|
|
32
|
+
"summary": "List the workspaces of this deployment and their owners.",
|
|
33
|
+
"risk": "read",
|
|
34
|
+
"requiresApprovedSpec": false,
|
|
35
|
+
"supportsDryRun": false
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"path": ["auth", "workspace-create"],
|
|
40
|
+
"capability": {
|
|
41
|
+
"id": "auth.workspace.create",
|
|
42
|
+
"version": 1,
|
|
43
|
+
"summary": "Create a workspace with its owner account without opening public sign-up.",
|
|
44
|
+
"risk": "process",
|
|
45
|
+
"requiresApprovedSpec": false,
|
|
46
|
+
"supportsDryRun": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"path": ["auth", "member-add"],
|
|
51
|
+
"capability": {
|
|
52
|
+
"id": "auth.member.add",
|
|
53
|
+
"version": 1,
|
|
54
|
+
"summary": "Add an account to a workspace with a role, or invite an unknown address.",
|
|
55
|
+
"risk": "process",
|
|
56
|
+
"requiresApprovedSpec": false,
|
|
57
|
+
"supportsDryRun": true
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"path": ["auth", "greenfield"],
|
|
62
|
+
"capability": {
|
|
63
|
+
"id": "auth.greenfield.reset",
|
|
64
|
+
"version": 1,
|
|
65
|
+
"summary": "Reset local auth and seed demo tenants, an admin, and a reduced-scope user.",
|
|
66
|
+
"risk": "destructive",
|
|
67
|
+
"requiresApprovedSpec": false,
|
|
68
|
+
"supportsDryRun": true,
|
|
69
|
+
"localOnly": true,
|
|
70
|
+
"confirmation": "reset-local-auth"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import {
|
|
3
|
+
createDatabaseProvider,
|
|
4
|
+
databaseProviderConfigFromEnvironment,
|
|
5
|
+
DATABASE_CAPABILITY_IDS,
|
|
6
|
+
DATABASE_DIALECT_IDS,
|
|
7
|
+
type DatabaseProvider,
|
|
8
|
+
type DatabaseProviderConfig,
|
|
9
|
+
} from '@flowdular/sdk/database';
|
|
10
|
+
import { createPgliteCluster } from '@flowdular/sdk/database-pglite';
|
|
11
|
+
import { Pool } from 'pg';
|
|
12
|
+
|
|
13
|
+
export const MIGRATION_REQUIREMENTS = {
|
|
14
|
+
dialectIds: [DATABASE_DIALECT_IDS.postgresql],
|
|
15
|
+
capabilities: [
|
|
16
|
+
DATABASE_CAPABILITY_IDS.MIGRATION_LOCK,
|
|
17
|
+
DATABASE_CAPABILITY_IDS.SCHEMA_INTROSPECTION,
|
|
18
|
+
DATABASE_CAPABILITY_IDS.TRANSACTIONAL_DDL,
|
|
19
|
+
],
|
|
20
|
+
} as const;
|
|
21
|
+
|
|
22
|
+
export interface CliDatabase {
|
|
23
|
+
readonly config: DatabaseProviderConfig;
|
|
24
|
+
/** Where the data lives, for the evidence an operator command reports. */
|
|
25
|
+
readonly location: string;
|
|
26
|
+
create(): DatabaseProvider;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* The CLI protocol carries no provider, so an operator command opens the same
|
|
30
|
+
database the platform would open from this workspace and this environment.
|
|
31
|
+
The drivers are supplied here for the same reason the deployable supplies
|
|
32
|
+
them: @flowdular/sdk/database owns none. */
|
|
33
|
+
export function localDatabaseProvider(workspaceRoot: string): CliDatabase {
|
|
34
|
+
const config = databaseProviderConfigFromEnvironment(
|
|
35
|
+
process.env,
|
|
36
|
+
workspaceRoot,
|
|
37
|
+
);
|
|
38
|
+
return {
|
|
39
|
+
config,
|
|
40
|
+
location:
|
|
41
|
+
config.adapter === 'pglite'
|
|
42
|
+
? (config.pglite?.dataDirectory ??
|
|
43
|
+
resolve(workspaceRoot, '.flowdular', 'data', 'pglite'))
|
|
44
|
+
: 'the configured PostgreSQL database',
|
|
45
|
+
create: () =>
|
|
46
|
+
createDatabaseProvider(config, {
|
|
47
|
+
postgresPool: (options) => new Pool(options),
|
|
48
|
+
pgliteCluster: (options) => createPgliteCluster(options),
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
}
|