@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
package/AGENTS.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<!-- Source: .ai/rules/flowdular.md. Run pnpm rules:generate; never edit generated copies. -->
|
|
2
|
+
|
|
3
|
+
# Flowdular
|
|
4
|
+
|
|
5
|
+
An agentic foundation that businesses extend with their own modules.
|
|
6
|
+
|
|
7
|
+
## One task, one skill
|
|
8
|
+
|
|
9
|
+
Choose the most specific task in `.ai/skills/README.md` and read only that
|
|
10
|
+
`.ai/skills/<name>/SKILL.md`. Announce the choice briefly. For a multi-part
|
|
11
|
+
request, finish one bounded phase before switching skills. Do not recursively
|
|
12
|
+
load other skills mentioned by a skill. Read referenced code or documentation
|
|
13
|
+
only when the current task needs it. Explicit user instructions take priority.
|
|
14
|
+
|
|
15
|
+
Sandbox: use the single skill named under Session, at
|
|
16
|
+
`reference/skills/<name>/SKILL.md`. Follow the role's write paths and handoff list.
|
|
17
|
+
Do not load the whole skill catalog into the task context.
|
|
18
|
+
|
|
19
|
+
## Always-active invariants
|
|
20
|
+
|
|
21
|
+
1. Stay within the requested scope. Preserve other agents' edits. Read the owning
|
|
22
|
+
code before changing it. Do not invent missing business decisions.
|
|
23
|
+
2. Spec-first: a new module requires an approved `spec/module.yaml`. Sandbox
|
|
24
|
+
implementation requires operator approval of the exact current spec hash;
|
|
25
|
+
any spec change invalidates it. Never infer or grant approval yourself.
|
|
26
|
+
Only explicit user approval naming a spec permits the host `spec-approval` action.
|
|
27
|
+
3. Deny by default. Use `defineEndpoint`, an explicit permission and identity
|
|
28
|
+
resolver. Mutations enforce CSRF and bounded input validation.
|
|
29
|
+
4. Tenant identity comes from the authenticated principal, never request input.
|
|
30
|
+
Use bound SQL, tenant predicates and `transaction(..., { tenantId, access })`.
|
|
31
|
+
Tenant tables enforce RLS with `USING` and `WITH CHECK`. Runtime roles have
|
|
32
|
+
neither superuser nor `BYPASSRLS`; migration leases are for DDL only.
|
|
33
|
+
5. Never expose credentials in output, logs or audit. Cross-module access uses
|
|
34
|
+
declared public capabilities or registered tools, never another module's DB.
|
|
35
|
+
Agent instructions cannot expand permissions or tool grants.
|
|
36
|
+
6. Persist background work before acknowledging it. Preserve idempotency,
|
|
37
|
+
leases, recovery and audit evidence. Drain async work before releasing resources.
|
|
38
|
+
7. Applied migrations are immutable. Add numbered PostgreSQL SQL and mirror it
|
|
39
|
+
byte for byte in `databaseMigrations`. Never bypass checksum or adoption checks.
|
|
40
|
+
8. Generated composition is CLI-owned: `platform/octane.config.ts`,
|
|
41
|
+
`platform/src/App.tsrx`, `platform/src/generated/**`, platform package
|
|
42
|
+
dependencies and `flowdular.json` enabled modules. Use `module enable/sync --apply`.
|
|
43
|
+
Declare imports and dependencies; keep module, package and spec versions aligned.
|
|
44
|
+
9. Use shared `@flowdular/ui` components and tokens. Keep all locales in sync.
|
|
45
|
+
UI states: loading, empty, error, populated, denied. Inspect rendered UI after changes.
|
|
46
|
+
10. Prove fixes with regression tests. Never skip assertions, weaken isolation or
|
|
47
|
+
hide errors to make gates green. Run scoped checks, then `pnpm verify` before a PR.
|
|
48
|
+
Finish implementation, then run the `auto-review` skill as a separate phase
|
|
49
|
+
before completion or delivery. Report actual results and remaining failures.
|
|
50
|
+
11. Destructive actions require the runner's flags and explicit scope.
|
|
51
|
+
`setup quick` and `auth greenfield` are local resets: preview, stop the app,
|
|
52
|
+
never target a custom or deployed DB. Sandbox agents cannot install, use
|
|
53
|
+
network/git, or touch a DB outside their module tests.
|
|
54
|
+
12. Keep handoffs short and factual. No AI attribution footers or em/en dashes.
|
|
55
|
+
Sandbox final line: `HANDOFF: <allowed-role> - <why>` or
|
|
56
|
+
`HANDOFF: none - <why>`, never your own role.
|
|
57
|
+
|
|
58
|
+
Detailed recipes: `docs/agent-contract.md` (lookup only).
|
|
59
|
+
Reference module: `.ai/references/catalog`; visual contract: `docs/design-system.md`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Flowdular contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Flowdular SDK
|
|
2
|
+
|
|
3
|
+
One npm package for the Flowdular platform. Import the surface you need:
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { defineEndpoint } from '@flowdular/sdk/server';
|
|
7
|
+
import type { ModuleManifest } from '@flowdular/sdk/contracts';
|
|
8
|
+
import { Button } from '@flowdular/sdk/ui';
|
|
9
|
+
import '@flowdular/sdk/ui/styles';
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Exports include `client`, `server`, `ui`, `contracts`, `kernel`, `database`,
|
|
13
|
+
`database-pglite`, `database-testing`, `harness`, `ai-provider`, `coding-agent`,
|
|
14
|
+
`cli-protocol`, `dev-console`, `sandbox` and `modules/<name>` for bundled core modules.
|
|
15
|
+
Subpaths retain their own exports, such as `modules/auth/server` and `client/i18n`.
|
|
16
|
+
There is no root barrel importing server code into browser entrypoints.
|
|
17
|
+
|
|
18
|
+
The SDK ships TypeScript and TSRX source for the Flowdular/Octane build toolchain.
|
|
19
|
+
Create a configured workspace with `npm create flowdular@latest my-app`.
|
|
20
|
+
The CLI is published separately as `flowdular`.
|
|
21
|
+
|
|
22
|
+
Source packages remain separate private workspaces in the repository. Release
|
|
23
|
+
assembly copies the declared members, rewrites internal imports to SDK subpaths,
|
|
24
|
+
and exposes their original entrypoints. Only the assembled SDK is published.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Agent implementation reference
|
|
2
|
+
|
|
3
|
+
Lookup only. The always-active contract lives in `.ai/rules/flowdular.md`.
|
|
4
|
+
Use one task skill; consult only the relevant section here, not the whole file.
|
|
5
|
+
|
|
6
|
+
Flowdular is an agentic foundation framework. It ships the foundation platform (accounts, workspaces, permissions, modules, agents runtime, CLI, sandbox) and people build their own platform on top of it: in the sandbox with AI specialists, or with the skills in `.ai/skills` inside their own coding tool. This contract and the skills are the shared RuleSync sources for every supported coding agent. Spec-first is a working rule here: a module is created only from an approved `spec/module.yaml`.
|
|
7
|
+
|
|
8
|
+
Use the already selected task skill. Consult `.ai/references/catalog` for implementation examples and `docs/design-system.md` for visual work only when the current task needs them.
|
|
9
|
+
|
|
10
|
+
## Rules
|
|
11
|
+
|
|
12
|
+
1. Read the owning code end to end before changing it. Copy the shape of `.ai/references/catalog`; do not invent architecture, permissions, entities, routes, or dependencies. Stop when required input is missing or contradictory and say exactly what you need.
|
|
13
|
+
2. Write only inside the paths your role or blueprint names. In the sandbox these paths are advisory; a reviewer treats a write elsewhere as a defect.
|
|
14
|
+
3. Identifiers: module, permission and capability ids match `^[a-z][a-z0-9-]*(\.[a-z][a-z0-9-]*)+$`. `inventory.core` lives in `modules/inventory` as `@flowdular/module-inventory`; permissions are `<module>.<entity>.read` and `<module>.<entity>.manage`.
|
|
15
|
+
4. A module is created only from a spec with `status: approved`. An agent never initiates, infers, or grants approval from its own judgment. After a current, explicit user instruction naming the spec, a host coding agent may record that decision mechanically by following `spec-approval`; a sandbox specialist can only request approval, and the operator route records the exact approved hash. Spec `permissions[].id` equal the constants in `src/acl/permissions.ts`: the spec is what `auth sync-scopes` grants.
|
|
16
|
+
5. Every endpoint is `defineEndpoint` from `@flowdular/sdk/server` with `access: { kind: 'permission', permission }` and `resolveIdentity: endpointIdentityFromContext`. Deny by default; a public endpoint needs a written reason. No raw `new ServerRoute` outside `modules/auth`.
|
|
17
|
+
6. The tenant id comes only from `principalFromContext(octane)!.tenantId`, never from the body, query or headers. Every query on a tenant-owned table filters by `tenant_id`; unique constraints and indexes start with `tenant_id`; SQL uses bound parameters. PostgreSQL tenant tables also enable and force row-level security with `USING` and `WITH CHECK` policies bound to transaction-local `coreloom.tenant_id`. Every repository operation runs through `database.transaction(..., { tenantId, access })`; the runtime role is never a superuser and never has `BYPASSRLS`, while a separate migration lease may own DDL. `WHERE tenant_id = ...` remains defense in depth.
|
|
18
|
+
7. Every mutation calls `sessionMutationDenial(octane, auth)` first and reads its body with `readJsonObject` plus `requiredString`, `optionalString`, `requiredInteger`. Clients send `content-type: application/json`, `x-csrf-token`, and `credentials: 'same-origin'`.
|
|
19
|
+
8. Routes mount only through `src/platform.ts` exporting `createServerComposition(context)` with `platform.server: true` in `module.json` and a `./platform` export in `package.json`; the context carries `auth`, `settings`, `agentTools`, `agentDefinitions`, `capabilities` and `databases`. A database module passes `context.databases` into one runtime, which acquires and releases one provider lease lazily; `prepare` stays read-only and never opens a database. A composition may return `settings`, read-only `prepare`, `start`, background-work `stop`, and final `dispose`. Client contributions mount only through `createClientContribution(context)` in `src/client/index.ts` with `platform.client: true`. `pnpm flowdular module validate` fails on a missing entry (`PLATFORM_*`).
|
|
20
|
+
9. Never edit the composition by hand: `platform/octane.config.ts`, `platform/src/App.tsrx`, `platform/src/generated/**`, `platform/package.json` dependencies and `modules.enabled` in `flowdular.json` are written by `pnpm flowdular module enable <id> --apply` and `pnpm flowdular module sync --apply`.
|
|
21
|
+
10. `pnpm flowdular module enable <id> --apply` grants the spec permissions to every tenant owner as its last step; `pnpm flowdular auth sync-scopes --module <id> --apply` re-grants later (new permission, another database). Members receive scopes only through `MEMBER_SCOPES` in `modules/auth/src/acl/scopes.ts`, a core change.
|
|
22
|
+
11. Declare every imported package in the module `package.json`; the sandbox `dependencies` gate and the eject fail otherwise. Every relative import carries its `.ts` or `.tsrx` extension.
|
|
23
|
+
12. Use the CLI for discovery, validation and scaffolding: `doctor`, `spec validate`, `module validate`, `module new`, `module enable`, `auth sync-scopes`. Run destructive, external or production capabilities only with what the runner demands (`--apply`, `--confirm`, `--spec`) and never work around a refusal.
|
|
24
|
+
13. Gates are `spec-schema`, `module-schema`, `dependencies`, `typecheck`, `tests`, `format`. The sandbox runs `dependencies` plus the ones your role lists after every turn, per draft module, and feeds a failure back to you; with a shell you may run the module's own gate commands yourself, never installs, network or git. From a checkout run them yourself and `pnpm verify` before any pull request.
|
|
25
|
+
14. Build UI only from `@flowdular/sdk/ui` components, `ui-*` classes and tokens (`docs/design-system.md`). No hardcoded colors, fonts or sizes; never restyle a `ui-*` class; `glyph` and `Icon name` are `ICON_PATHS` keys. Modules use the shared `Table` and `TableCard`, which are backed by the official Octane TanStack adapter; they never import `@octanejs/tanstack-table` directly. A missing primitive becomes a module-local component on tokens, flagged as a promotion candidate. Guard UX: no visual artifacts. A card head is one line (title left; search and the `Filters` dropdown right), filters live inside `Filters` not loose in the head, form rows top-align so a `help` line never drops its neighbour, a field is labelled once, no decorative tags, long values use `ui-mono`/`ui-table-wrap`, adjacent top-level nodes go in a fragment. Look at the rendered screen before handing off and fix any alignment, wrapping, padding or duplicated-label glitch.
|
|
26
|
+
15. One screen, form, table or stateful region per named component. Records own the page; create and edit happen in a `Drawer`. Every screen shows loading, empty, error, populated and denied.
|
|
27
|
+
16. Tests live in `tests/*.test.ts`: identity, tenant isolation, uniqueness, one 401 and one 403 per endpoint, each validation bound. Repository behavior uses `createTestDatabaseProvider()` from `@flowdular/sdk/database-testing`: PGlite locally and isolated server PostgreSQL in CI. Open one provider per test file, migrate once, and truncate module tables between cases (`modules/profile/tests/support/database.ts`). Tenancy tests use two tenants, prove `TENANT_CONTEXT_REQUIRED` without a transaction tenant id, prove RLS prevents cross-tenant reads and writes under the non-bypass runtime role, and cover `WITH CHECK`. Tenant fixture work also supplies tenant context on a migration connection. The sandbox `tests` gate passes with zero tests, so an empty suite is a defect.
|
|
28
|
+
17. Translations are live. Every module contribution registers all declared `translations/*.json` bundles, user-facing copy uses fully qualified `t('<module>.<key>')` keys, navigation labels are lazy getters, locale-aware formatting uses `activeLocale()`, and every locale has the same key set. `module validate` rejects missing files, key drift, and missing static translation keys.
|
|
29
|
+
18. Numbered migration SQL is immutable source. `migrations/000N_<module>_<name>.up.sql` and `.down.sql` are PostgreSQL and the only schema source; there is no dialect subdirectory. `src/services/migration.ts` mirrors every `.up.sql` byte for byte as `databaseMigrations: readonly DatabaseMigration[]` with `sql: { postgresql: ... }`, and the runtime calls `runDatabaseMigrations` through its provider lease. The namespaced `_coreloom_migrations_v2` ledger records the checksum, adopts only an explicit complete `inspectExisting` result (`postgresTenantTableState` is the standard check), and refuses drift, duplicates, or partial schema. Add a new numbered, additive migration instead of changing existing bytes. A tenant table's migration includes enabled and forced RLS plus a tenant policy, with the policy behavior covered by tests.
|
|
30
|
+
19. Module CLI commands live in `src/cli/commands.json` and `src/cli/index.ts`, metadata-identical, inside the module namespace.
|
|
31
|
+
20. Passwords, session tokens and provider credentials never leave `auth.core` (or the `agents.core` vault) and never appear in logs, audit metadata or responses.
|
|
32
|
+
21. `setup quick` and `auth greenfield` are destructive local resets. Preview first, stop the app, never point them at a custom or deployed database.
|
|
33
|
+
22. Agent workers reach ERP data only through registered API or CLI tools. A module defines them with `defineApiAgentTool` or `defineCliAgentTool` from `@flowdular/sdk/harness/tool-adapters` and registers them inside `createServerComposition` with `context.agentTools.register([...])`; nothing else registers a tool. A module may also ship business agents with `defineAgent()` from `@flowdular/sdk/modules/agents/server` and `context.agentDefinitions.register([...])` after declaring an `agents.core` dependency. Their code allowlist is only a maximum: effective tools are the exact intersection of that allowlist, the tenant binding reduction, invocation grants, registered tool permissions, the actor's saved permission ceiling, and live authorization. Sandbox coding specialists are not business agents.
|
|
34
|
+
23. A background run is persisted before enqueue returns; idempotency, leases, recovery, tenant scoping and append-only audit evidence for every fire-and-forget run.
|
|
35
|
+
24. Module settings are declared with `defineModuleSettings` from `@flowdular/sdk/kernel`, returned as `settings` from the composition, read live with `context.settings.get(tenantId, '<module>.core', key)`, and rendered in that module's drawer under Administration, Modules. User-facing setting copy declares fully qualified `labelKey` and `descriptionKey` present in every module locale, with English `label` and `description` literals as compatibility fallbacks. Values, identifiers and secrets are never translated. Administration, Settings is only for workspace and organization settings. A cross-module setting read needs a declared dependency and a `shared`, non-secret setting. Cross-module operations use a typed public service registered in `context.capabilities` by the owning module and resolved by a declared dependent, never the other module's database.
|
|
36
|
+
25. `Development` navigation is owner-only in the client; server permissions remain authoritative.
|
|
37
|
+
26. Generated files are production code: no placeholders, silent fallbacks or skipped tests. `module.json` `version`, spec `specVersion` and `package.json` `version` move together.
|
|
38
|
+
27. Commits and pull requests: short body, one line on verification, no AI attribution footers, generated files only through the CLI. Never use em or en dashes in anything you write.
|
|
39
|
+
28. End a sandbox turn with one line: `HANDOFF: <role-id> - <why>` or `HANDOFF: none - <why>`. The role must be in your role's `handoff` list and never yourself; otherwise the sandbox routing decides.
|
|
40
|
+
|
|
41
|
+
## Sequence
|
|
42
|
+
|
|
43
|
+
Sandbox: brief, planner picks all affected modules and the first role, specification or spec delta per module, operator approval of each exact spec hash, specialist turns with gates per changed module, scaffold when needed, eject (fresh spec-hash check, gates, copy and removals, `pnpm install`, `module enable` with scope grant for new modules, `auth sync-scopes`, platform typecheck, restart note), pull request. A host agent may invoke the operator approval action only after the user explicitly delegates that exact approval through `spec-approval`.
|
|
44
|
+
|
|
45
|
+
Checkout: read the skill, approved spec, `module new` dry run then `--apply`, implement, gates, `module enable --apply` (grants scopes), `pnpm verify`, pull request.
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Flowdular design system
|
|
2
|
+
|
|
3
|
+
Identity 1.0 (2026-08-31). The implementation reference for humans and agents:
|
|
4
|
+
shared primitives, tokens, and the rules for using them.
|
|
5
|
+
|
|
6
|
+
## Where things live
|
|
7
|
+
|
|
8
|
+
- `packages/ui` (`@flowdular/sdk/ui`): the only source of visual primitives.
|
|
9
|
+
Design tokens (`src/styles/tokens.css`), base styles, `ui-*` component
|
|
10
|
+
classes, TSRX components, icons, and the brand mark. Fonts (IBM Plex Sans
|
|
11
|
+
Variable, IBM Plex Mono) are self-hosted through `@fontsource` packages.
|
|
12
|
+
- `packages/client`: the application shell (sidebar, topbar, command palette,
|
|
13
|
+
dashboard, contribution outlets). Shell-only layout lives in
|
|
14
|
+
`src/shell/shell.css`.
|
|
15
|
+
- Modules: compose screens from `@flowdular/sdk/ui`. Module CSS may only add
|
|
16
|
+
module-specific composites built on the tokens (example:
|
|
17
|
+
`modules/agents/src/client/agents.css`).
|
|
18
|
+
- `platform/public`: `favicon.svg`, `og.png` (1200x630 Open Graph image).
|
|
19
|
+
- Brand mark geometry is generated: `node packages/ui/scripts/gen-mark.mjs`
|
|
20
|
+
rewrites `packages/ui/src/brand/mark.ts` from the weave parameters.
|
|
21
|
+
|
|
22
|
+
## Rules
|
|
23
|
+
|
|
24
|
+
1. Primitives first. Use a `ui-*` class or an exported component before
|
|
25
|
+
writing any new visual code.
|
|
26
|
+
2. Colors, fonts, sizes, radii, and shadows come only from tokens
|
|
27
|
+
(`var(--...)`). No hex values in shell or module CSS.
|
|
28
|
+
3. Never restyle or override a `ui-*` class outside `packages/ui`.
|
|
29
|
+
4. A missing primitive is added per use case as a module-local component built
|
|
30
|
+
on the tokens, and flagged as a promotion candidate for `packages/ui`.
|
|
31
|
+
5. Blue means action and selection. Green, amber, and red mean state. Copper
|
|
32
|
+
is reserved for the brand (mark, splash, sign-in) and is never a button or
|
|
33
|
+
a state color.
|
|
34
|
+
6. Minimum text size is 12 px (`--text-sm`); labels use `--text-xs` uppercase.
|
|
35
|
+
Numbers in tables and KPIs are tabular (`.num`, `ui-kpi__value`).
|
|
36
|
+
7. Layout containment is owned by the primitives, not by the screen. Children
|
|
37
|
+
of `ui-view`, `ui-two-col`, `ui-grid-2`, and `ui-kpi-grid` are shrinkable
|
|
38
|
+
tracks, long words wrap, and the workspace never scrolls horizontally. Wide
|
|
39
|
+
content scrolls inside its own container (`ui-table-wrap`), so one long
|
|
40
|
+
value can never push the page sideways.
|
|
41
|
+
8. `Kpi` is a stat tile. Its value is a number or a short state word; addresses,
|
|
42
|
+
identifiers, and paths belong in `note` or a `ui-mono` line.
|
|
43
|
+
9. A screen never splits its width between records and a form. Records own the
|
|
44
|
+
page; creating and editing happens in a `Drawer`.
|
|
45
|
+
10. `Tag` carries state or a value with meaning (a status, a count, a scope).
|
|
46
|
+
Never decoration: no "Secure", "Master data", or "Suggested setup" badges.
|
|
47
|
+
A card head is a title, a one-line description in its `small`, and at most
|
|
48
|
+
one right-aligned cluster (`ui-card__actions`: a count, a state, buttons).
|
|
49
|
+
11. A row is title and description on the left and its controls on one line on
|
|
50
|
+
the right, vertically centered (`SettingRow`). The row title is the label;
|
|
51
|
+
the control inside carries `aria-label`, never a second visible label.
|
|
52
|
+
12. Large sets are summarized where they are read (`ScopeSummary`, grouped by
|
|
53
|
+
module) and edited in full only inside the drawer (`CheckGrid`).
|
|
54
|
+
13. Destructive actions close a drawer in their own `ui-form__section--danger`:
|
|
55
|
+
one title, one line of consequence, one `Button variant="danger"`. They are
|
|
56
|
+
never mixed into a status row.
|
|
57
|
+
14. Menus (workspace switcher, account menu, session actions) are `ui-menu`
|
|
58
|
+
with `ui-menu__item` rows: 40 px, 10 px inset, the same hover and selected
|
|
59
|
+
background, a 32 px avatar, two lines of text, and the trailing check
|
|
60
|
+
pushed to the right edge.
|
|
61
|
+
|
|
62
|
+
## Screen pattern
|
|
63
|
+
|
|
64
|
+
Every record screen is built the same way, so a user who learns one learns all
|
|
65
|
+
of them:
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
PageHeader eyebrow, title, description, [Refresh] [+ New ...]
|
|
69
|
+
Alert only when the last action failed
|
|
70
|
+
TableCard
|
|
71
|
+
ui-card__head title, count, SearchField and Filters on one line
|
|
72
|
+
Table the records, full width
|
|
73
|
+
ui-note the constraint worth stating (permissions, boundaries)
|
|
74
|
+
Drawer the create or edit form, opened from the header or a row
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`TableCard` is the default for a record screen. It owns the card, the one-line
|
|
78
|
+
head (title, `count`, and the `search` and `filters` slots inside
|
|
79
|
+
`ui-card__filters`), the `Table`, and the optional `ui-note` footer, so every
|
|
80
|
+
screen shows the same head, loading row, empty state, and filtered-empty
|
|
81
|
+
message. A screen passes data and slots, never table markup. Row actions are
|
|
82
|
+
compact, visible buttons in a narrow trailing column with an accessible but
|
|
83
|
+
visually empty header. The column is part of the same `colgroup` in loading,
|
|
84
|
+
empty and populated states, so widths do not drift. `Table` on its own covers
|
|
85
|
+
what needs a bare table, such as the list side of a master-detail screen.
|
|
86
|
+
|
|
87
|
+
`Table` is backed by the official `@octanejs/tanstack-table` adapter. Modules
|
|
88
|
+
still use the smaller Flowdular `Table` and `TableCard` contract from
|
|
89
|
+
`@flowdular/sdk/ui`; they never import TanStack directly. The shared primitive owns
|
|
90
|
+
the TanStack features, row model, header model and cell rendering so every
|
|
91
|
+
screen keeps the same states, widths and actions.
|
|
92
|
+
|
|
93
|
+
Every column declares a semantic CSS `width`. Give the primary record and its
|
|
94
|
+
description the largest share, medium shares to dates and identifiers, and the
|
|
95
|
+
smallest share to counts and lifecycle state. In a table with row actions, data
|
|
96
|
+
columns normally add up to about 90 percent; the shared 160 px action column
|
|
97
|
+
uses the rest. In a read-only table, data columns add up to 100 percent. The
|
|
98
|
+
table keeps these widths in loading, empty and populated states and scrolls
|
|
99
|
+
horizontally below its minimum readable width.
|
|
100
|
+
|
|
101
|
+
The drawer holds one `ui-drawer__form`: fields scroll inside
|
|
102
|
+
`ui-drawer__body`, and the primary action stays pinned in `ui-drawer__foot`.
|
|
103
|
+
Escape and the scrim close it. Master-detail screens that only read (agent runs,
|
|
104
|
+
the playground) keep `ui-two-col`; the list side is a `ui-table` whose open
|
|
105
|
+
record carries `is-selected`.
|
|
106
|
+
|
|
107
|
+
A drawer that edits several independent things (a member, a module) stacks
|
|
108
|
+
`ui-form__section` blocks inside its `ui-form`: an uppercase title and one-line
|
|
109
|
+
description in `ui-form__section-head`, then the fields and a right-aligned
|
|
110
|
+
`ui-form__actions` row with one primary per section. An input paired with one
|
|
111
|
+
action (a temporary password and its Reset) sits in a `ui-control-row`. The
|
|
112
|
+
danger section comes last, and the foot then keeps only Close.
|
|
113
|
+
|
|
114
|
+
Administration > Settings holds only workspace settings: full-width cards
|
|
115
|
+
(Workspace, Preferences), each `SettingRow` one setting. A module's declared
|
|
116
|
+
settings are edited in its Drawer under Administration > Modules, as
|
|
117
|
+
`SettingRow`s inside the drawer's Settings `ui-form__section`; a module
|
|
118
|
+
without settings shows a one-line empty state there.
|
|
119
|
+
|
|
120
|
+
## Components
|
|
121
|
+
|
|
122
|
+
| Component | Use |
|
|
123
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
124
|
+
| `Button` | Actions: `variant` primary, secondary (default), ghost, danger; `size` sm, md, lg; `block` |
|
|
125
|
+
| `FormField` | Label + control + help or error. Put `ui-input`, `ui-select`, or `ui-textarea` inside |
|
|
126
|
+
| `VariableTextarea` | Multiline template field: `value`, `onInput`, `variables` (scope-filtered `VariableDefinition[]`), `sampleValues`, `label`, `name`; a `braces` menu inserts `{{ key }}` and tokens highlight as pills (error pill when unknown). Presentational, never fetches |
|
|
127
|
+
| `VariableInput` | Single-line variant of `VariableTextarea` with the same props |
|
|
128
|
+
| `VariableSelect` | Native select that stores either a literal option value or one allowed `{{ key }}` token. Takes scope-filtered `variables`, `sampleValues`, literal `options`, `value`, `onInput`, `name`, `label`, and native required/disabled state. It preserves keyboard, validation, accessibility, and `FormData` semantics and never fetches or resolves data |
|
|
129
|
+
| `Tag` | Status and metadata: `tone` neutral, success, warning, danger, info, ink; `dot` adds a state dot; `mono` |
|
|
130
|
+
| `Kpi` | Stat tile: `label`, `value`, `unit`, `badge`, `note`, `href`, `linkLabel` |
|
|
131
|
+
| `Chart` | Token-driven Chart.js wrapper on a client-only canvas: `type` area, bar, line; `data`, `series` (`key`, `label`, `token`), `xKey`, `height`, `title`, `xTickFormatter`; series colors come from `--chart-1..5`; shows an EmptyState for empty or all-zero data |
|
|
132
|
+
| `Table` | The one data table, backed by `@octanejs/tanstack-table`: `columns` (`key`, `header`, required `width`, `numeric`, `cell`), `rows`, `rowKey`, `status` idle/loading, `loadingLabel`, `empty` and `emptyFiltered` picked by `filtered`, `actions(row): TableAction[]`, `actionsLabel`, optional stable `actionsWidth` (160 px by default, 280 px for two actions), `onSelect` with `selectedKey`, `caption`; fixed layout and `colgroup` keep columns stable across states |
|
|
133
|
+
| `TableCard` | The record card around `Table`: `title`, `count`, the `head`, `search`, and `filters` head slots, `before` and `after` around the table, `note` with `noteIcon` as the footer |
|
|
134
|
+
| `PageHeader` | Every view starts with it: `eyebrow`, `title`, `description`; children render as right-side actions |
|
|
135
|
+
| `EmptyState` | `icon`, `title`, children, optional `code` |
|
|
136
|
+
| `Alert` | Inline message: `tone` danger (default), warning, info |
|
|
137
|
+
| `Drawer` | Editor panel over the records: `open`, `title`, `subtitle`, `width` md/lg, `onClose` |
|
|
138
|
+
| `SearchField` | Filter control for a panel head: `value`, `placeholder`, `label`, `onInput` |
|
|
139
|
+
| `CheckGrid` | Grouped multi-select for scopes, tools, and long option sets: `groups` (`label`, `options` of `value`, `label`, `hint`), `value`, `mono`, `disabled`, `onChange` |
|
|
140
|
+
| `ScopeSummary` | Read-only summary of `module.entity.action` scopes: one row per module, one chip per entity with its actions: `scopes`, `labels` (module id to display name) |
|
|
141
|
+
| `SettingRow` | One setting: `label`, `description` (node, one line), `scopeLabel` (small neutral tag), `status` (`ok`, `message` of the last save), children as the control cluster |
|
|
142
|
+
| `Avatar` | Initials from `name`: `square` for organizations, round for people; `large` in profile and account headers |
|
|
143
|
+
| `Switch` | Boolean setting that applies on its own (no form submit): `checked`, `label` as the accessible name, `disabled`, `onChange` |
|
|
144
|
+
| `ConfirmDialog` | One question before an irreversible action: `open`, `title`, children, `confirmLabel`, `tone` danger (default) or primary, `busy`, `onConfirm`, `onCancel` |
|
|
145
|
+
| `Icon` | Stroke icon by `name` from `ICON_PATHS`; `size` 18 default, 16 in controls, 14 in `Button size="sm"`; `strokeWidth` 1.75 default |
|
|
146
|
+
| `BrandMark` | The weave: `size`, `signature` (copper weft, large brand moments only), `tone` brand, current, inverse |
|
|
147
|
+
|
|
148
|
+
`Drawer` takes one child, a `ui-drawer__form` (fields in `ui-drawer__body`, actions in `ui-drawer__foot`) or a plain `ui-drawer__body`; it closes on Escape and on the scrim. `SearchField` carries no visible label, so pass `label` as its accessible name. `FormField` renders `error` in place of `help` and marks it `role="alert"`. `SettingRow` is presentation only: the caller owns the draft value, the save call, and passes the result back as `status`. `ScopeSummary` is the read side of `CheckGrid`; both keep the first-seen module order, and `summarizeScopes` is exported for callers that need the grouping without the markup.
|
|
149
|
+
|
|
150
|
+
Icon names (`packages/ui/src/icons/Icon.tsrx`): `dashboard`, `parties`, `catalog`,
|
|
151
|
+
`user`, `users`, `shield`, `code`, `modules`, `file-text`, `play`, `bot`,
|
|
152
|
+
`flask`, `activity`, `plug`, `search`, `chevron-down`, `chevrons-up-down`,
|
|
153
|
+
`plus`, `panel-left`, `check`, `filter`, `download`, `more`, `external`,
|
|
154
|
+
`alert`, `x`, `sign-out`, `refresh`, `help`, `key`, `settings`, `braces`. An unknown name renders
|
|
155
|
+
`modules` without a warning; a new icon is one 24x24 stroke path added there.
|
|
156
|
+
|
|
157
|
+
## Classes
|
|
158
|
+
|
|
159
|
+
- Layout: `ui-view`, `ui-two-col` (+`--wide-aside`), `ui-grid-2`,
|
|
160
|
+
`ui-kpi-grid`, `ui-tag-cloud`, `ui-section-head` (an `h2` with actions
|
|
161
|
+
inside a view)
|
|
162
|
+
- Surfaces: `ui-card` (+`__head`, `__title` with a `small` description,
|
|
163
|
+
`__actions` for the right-aligned cluster, `__body`), `ui-toolbar`
|
|
164
|
+
(+`__spacer` to push actions right; a bare `ui-input` or `ui-select` inside
|
|
165
|
+
it takes the button height and an `aria-label`)
|
|
166
|
+
- Data: `ui-table` (+`ui-table-wrap`, `ui-table__empty`, `ui-table__actions`
|
|
167
|
+
for the component-owned trailing button column, `ui-table__state` for a dot plus label,
|
|
168
|
+
`ui-table__placeholder` for the loading and empty rows inside the table,
|
|
169
|
+
`.num`, row states `is-clickable` and `is-selected`), `ui-cell`
|
|
170
|
+
(+`ui-cell__muted`), `ui-mono`, `ui-code`
|
|
171
|
+
- Forms: `ui-form` (+`__row`, `__row--4`, `__foot`, `__actions`, `__section`
|
|
172
|
+
with `__section-head` (`b` title, `small` description) and
|
|
173
|
+
`__section--danger`), `ui-control-row` (a growing control beside one fixed
|
|
174
|
+
button), `ui-choices` (a short wrapping row of `ui-checkbox`), `ui-input`
|
|
175
|
+
(+`--error`), `ui-select`, `ui-textarea` (+`--error`), `ui-checkbox`,
|
|
176
|
+
`ui-label`, `ui-help` (+`--error`)
|
|
177
|
+
- Drawer: `ui-drawer__form` (scrolling body plus pinned footer),
|
|
178
|
+
`ui-drawer__body`, `ui-drawer__foot`
|
|
179
|
+
- Settings rows inside a `ui-card` or a drawer `ui-form__section`, rendered
|
|
180
|
+
by `SettingRow`: `ui-setting`
|
|
181
|
+
(+`__text` for title, scope tag, and help, `__control` for the one-line
|
|
182
|
+
control cluster, `__status` (+`--error`) for the inline result)
|
|
183
|
+
- Buttons: `ui-btn` with `--primary`, `--secondary`, `--ghost`, `--danger`,
|
|
184
|
+
`--sm`, `--lg`, `--block`, and `--icon` for an icon-only square button
|
|
185
|
+
(the `Button` component renders all but `--icon`)
|
|
186
|
+
- Bits: `ui-kbd`, `ui-dot` (+`--muted`), `ui-note`, `ui-menu` (+`__label`,
|
|
187
|
+
`__section` for a static identity or connection block, `__item`,
|
|
188
|
+
`__item--active`, `__item--danger`, `__sep`), `ui-icon`
|
|
189
|
+
|
|
190
|
+
Rendered by components, not written by hand: `ui-page-head*`, `ui-search`,
|
|
191
|
+
`ui-field`, `ui-switch` (+`--on`), `ui-dialog` (+`__panel`, `__title`,
|
|
192
|
+
`__body`, `__actions`), `ui-empty` (+`__icon`), `ui-alert` (+`--danger`, `--warning`,
|
|
193
|
+
`--info`), `ui-tag` (+tone and `--mono`), `ui-kpi` (+`__label`, `__value`,
|
|
194
|
+
`__note`, `__link`), `ui-avatar` (+`--sq`, `--lg`), `ui-checks` (+`__group`,
|
|
195
|
+
`__head`, `__count`, `__all`, `__items`, `__option`), `ui-scopes` (+`__row`,
|
|
196
|
+
`__chip`), `ui-drawer-slot`, `ui-drawer` (+`__panel`, `__panel--lg`, `__head`,
|
|
197
|
+
`__close`), `ui-varfield` (+`__control`, `__highlight`, `__input`, `__pill`
|
|
198
|
+
(+`--error`), `__trigger`, `__menu`, `__value`, `__empty`; the overlay layer
|
|
199
|
+
that highlights `{{ key }}` tokens, rendered by `VariableTextarea` and
|
|
200
|
+
`VariableInput`).
|
|
201
|
+
|
|
202
|
+
## Token cheat sheet
|
|
203
|
+
|
|
204
|
+
- Surfaces: `--bg`, `--surface`, `--surface-2`; lines: `--line`, `--line-2`
|
|
205
|
+
- Text: `--ink`, `--ink-2` (labels), `--ink-3` (descriptions), `--ink-4`
|
|
206
|
+
(placeholders only, below AA for text)
|
|
207
|
+
- Action: `--primary`, `--primary-hover`, `--primary-soft`, `--primary-tint`,
|
|
208
|
+
`--focus`
|
|
209
|
+
- State: `--success`, `--warning`, `--danger` with `-bg` and `-line` pairs
|
|
210
|
+
- Brand: `--brand`, `--brand-weft` (copper)
|
|
211
|
+
- Type: `--font-sans`, `--font-mono`, `--text-xs` 11 to `--text-display` 36
|
|
212
|
+
- Dimensions: `--sidebar-w` 260, `--rail-w` 60, `--topbar-h` 52, `--control-h`
|
|
213
|
+
36, `--button-h` 32, `--row-h` 44, radii `--r-sm` 4, `--r` 6, `--r-md` 8,
|
|
214
|
+
`--r-lg` 12
|
|
215
|
+
|
|
216
|
+
Components reference the semantic layer only, so a dark theme is one token
|
|
217
|
+
override block, not a rewrite.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS agent_definitions (
|
|
2
|
+
id TEXT PRIMARY KEY,
|
|
3
|
+
tenant_id TEXT NOT NULL,
|
|
4
|
+
agent_key TEXT NOT NULL,
|
|
5
|
+
name TEXT NOT NULL,
|
|
6
|
+
description TEXT NOT NULL,
|
|
7
|
+
instructions TEXT NOT NULL,
|
|
8
|
+
provider TEXT NOT NULL,
|
|
9
|
+
model TEXT NOT NULL,
|
|
10
|
+
allowed_tools_json TEXT NOT NULL,
|
|
11
|
+
max_steps INTEGER NOT NULL CHECK (max_steps BETWEEN 1 AND 32),
|
|
12
|
+
timeout_ms BIGINT NOT NULL CHECK (timeout_ms BETWEEN 250 AND 300000),
|
|
13
|
+
temperature_milli INTEGER NOT NULL CHECK (temperature_milli BETWEEN 0 AND 2000),
|
|
14
|
+
status TEXT NOT NULL CHECK (status IN ('draft', 'active', 'paused', 'archived')),
|
|
15
|
+
revision INTEGER NOT NULL CHECK (revision >= 1),
|
|
16
|
+
created_by TEXT NOT NULL,
|
|
17
|
+
created_at BIGINT NOT NULL,
|
|
18
|
+
updated_by TEXT NOT NULL,
|
|
19
|
+
updated_at BIGINT NOT NULL,
|
|
20
|
+
UNIQUE (tenant_id, agent_key)
|
|
21
|
+
);
|
|
22
|
+
CREATE INDEX IF NOT EXISTS agent_definitions_tenant_name_idx ON agent_definitions (tenant_id, name, id);
|
|
23
|
+
|
|
24
|
+
CREATE TABLE IF NOT EXISTS agent_runs (
|
|
25
|
+
id TEXT PRIMARY KEY,
|
|
26
|
+
tenant_id TEXT NOT NULL,
|
|
27
|
+
agent_id TEXT NOT NULL,
|
|
28
|
+
agent_name TEXT NOT NULL,
|
|
29
|
+
agent_revision INTEGER NOT NULL,
|
|
30
|
+
instructions_snapshot TEXT NOT NULL,
|
|
31
|
+
provider TEXT NOT NULL,
|
|
32
|
+
model TEXT NOT NULL,
|
|
33
|
+
allowed_tools_json TEXT NOT NULL,
|
|
34
|
+
max_steps INTEGER NOT NULL,
|
|
35
|
+
timeout_ms BIGINT NOT NULL,
|
|
36
|
+
temperature_milli INTEGER NOT NULL,
|
|
37
|
+
trigger TEXT NOT NULL CHECK (trigger IN ('playground', 'workflow', 'service', 'schedule')),
|
|
38
|
+
status TEXT NOT NULL CHECK (status IN ('queued', 'running', 'succeeded', 'failed', 'cancelled')),
|
|
39
|
+
input TEXT NOT NULL,
|
|
40
|
+
output TEXT,
|
|
41
|
+
requested_by TEXT NOT NULL,
|
|
42
|
+
permission_snapshot_json TEXT NOT NULL,
|
|
43
|
+
tool_grants_json TEXT NOT NULL,
|
|
44
|
+
usage_json TEXT,
|
|
45
|
+
failure_code TEXT,
|
|
46
|
+
failure_message TEXT,
|
|
47
|
+
idempotency_key TEXT,
|
|
48
|
+
attempt INTEGER NOT NULL DEFAULT 0,
|
|
49
|
+
queued_at BIGINT NOT NULL,
|
|
50
|
+
started_at BIGINT,
|
|
51
|
+
completed_at BIGINT,
|
|
52
|
+
lease_owner TEXT,
|
|
53
|
+
lease_expires_at BIGINT,
|
|
54
|
+
FOREIGN KEY (agent_id) REFERENCES agent_definitions(id),
|
|
55
|
+
UNIQUE (tenant_id, idempotency_key)
|
|
56
|
+
);
|
|
57
|
+
CREATE INDEX IF NOT EXISTS agent_runs_tenant_queued_idx ON agent_runs (tenant_id, queued_at DESC, id);
|
|
58
|
+
CREATE INDEX IF NOT EXISTS agent_runs_recovery_idx ON agent_runs (status, lease_expires_at, queued_at);
|
|
59
|
+
|
|
60
|
+
CREATE TABLE IF NOT EXISTS agent_run_events (
|
|
61
|
+
run_id TEXT NOT NULL REFERENCES agent_runs(id) ON DELETE CASCADE,
|
|
62
|
+
tenant_id TEXT NOT NULL,
|
|
63
|
+
sequence BIGINT NOT NULL,
|
|
64
|
+
event_type TEXT NOT NULL,
|
|
65
|
+
message TEXT NOT NULL,
|
|
66
|
+
metadata_json TEXT NOT NULL,
|
|
67
|
+
occurred_at BIGINT NOT NULL,
|
|
68
|
+
PRIMARY KEY (run_id, sequence)
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
CREATE TABLE IF NOT EXISTS agent_audit_events (
|
|
72
|
+
id TEXT PRIMARY KEY,
|
|
73
|
+
tenant_id TEXT NOT NULL,
|
|
74
|
+
sequence BIGINT NOT NULL,
|
|
75
|
+
actor_id TEXT NOT NULL,
|
|
76
|
+
action TEXT NOT NULL,
|
|
77
|
+
subject_type TEXT NOT NULL CHECK (subject_type IN ('agent', 'agent-run')),
|
|
78
|
+
subject_id TEXT NOT NULL,
|
|
79
|
+
metadata_json TEXT NOT NULL,
|
|
80
|
+
occurred_at BIGINT NOT NULL,
|
|
81
|
+
previous_hash TEXT,
|
|
82
|
+
event_hash TEXT NOT NULL,
|
|
83
|
+
UNIQUE (tenant_id, sequence),
|
|
84
|
+
UNIQUE (tenant_id, event_hash)
|
|
85
|
+
);
|
|
86
|
+
CREATE INDEX IF NOT EXISTS agent_audit_tenant_time_idx ON agent_audit_events (tenant_id, occurred_at DESC, sequence DESC);
|
|
87
|
+
ALTER TABLE agent_definitions ENABLE ROW LEVEL SECURITY;
|
|
88
|
+
ALTER TABLE agent_definitions FORCE ROW LEVEL SECURITY;
|
|
89
|
+
CREATE POLICY agent_definitions_tenant_policy ON agent_definitions
|
|
90
|
+
USING (tenant_id = current_setting('coreloom.tenant_id', true))
|
|
91
|
+
WITH CHECK (tenant_id = current_setting('coreloom.tenant_id', true));
|
|
92
|
+
ALTER TABLE agent_runs ENABLE ROW LEVEL SECURITY;
|
|
93
|
+
ALTER TABLE agent_runs FORCE ROW LEVEL SECURITY;
|
|
94
|
+
CREATE POLICY agent_runs_tenant_policy ON agent_runs
|
|
95
|
+
USING (tenant_id = current_setting('coreloom.tenant_id', true))
|
|
96
|
+
WITH CHECK (tenant_id = current_setting('coreloom.tenant_id', true));
|
|
97
|
+
ALTER TABLE agent_run_events ENABLE ROW LEVEL SECURITY;
|
|
98
|
+
ALTER TABLE agent_run_events FORCE ROW LEVEL SECURITY;
|
|
99
|
+
CREATE POLICY agent_run_events_tenant_policy ON agent_run_events
|
|
100
|
+
USING (tenant_id = current_setting('coreloom.tenant_id', true))
|
|
101
|
+
WITH CHECK (tenant_id = current_setting('coreloom.tenant_id', true));
|
|
102
|
+
ALTER TABLE agent_audit_events ENABLE ROW LEVEL SECURITY;
|
|
103
|
+
ALTER TABLE agent_audit_events FORCE ROW LEVEL SECURITY;
|
|
104
|
+
CREATE POLICY agent_audit_events_tenant_policy ON agent_audit_events
|
|
105
|
+
USING (tenant_id = current_setting('coreloom.tenant_id', true))
|
|
106
|
+
WITH CHECK (tenant_id = current_setting('coreloom.tenant_id', true));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
DROP TABLE IF EXISTS agent_provider_connections;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS agent_provider_connections (
|
|
2
|
+
id TEXT PRIMARY KEY,
|
|
3
|
+
tenant_id TEXT NOT NULL,
|
|
4
|
+
provider_key TEXT NOT NULL,
|
|
5
|
+
name TEXT NOT NULL,
|
|
6
|
+
kind TEXT NOT NULL CHECK (kind IN ('vercel', 'azure', 'openai', 'openai-compatible', 'anthropic')),
|
|
7
|
+
enabled INTEGER NOT NULL CHECK (enabled IN (0, 1)),
|
|
8
|
+
resource_name TEXT,
|
|
9
|
+
base_url TEXT,
|
|
10
|
+
models_json TEXT NOT NULL,
|
|
11
|
+
credential_key_id TEXT NOT NULL,
|
|
12
|
+
credential_iv TEXT NOT NULL,
|
|
13
|
+
credential_tag TEXT NOT NULL,
|
|
14
|
+
credential_ciphertext TEXT NOT NULL,
|
|
15
|
+
credential_revision INTEGER NOT NULL CHECK (credential_revision >= 1),
|
|
16
|
+
readiness_status TEXT NOT NULL CHECK (readiness_status IN ('unknown', 'healthy', 'unhealthy')),
|
|
17
|
+
readiness_model TEXT,
|
|
18
|
+
readiness_latency_ms BIGINT,
|
|
19
|
+
readiness_error_code TEXT,
|
|
20
|
+
readiness_checked_at BIGINT,
|
|
21
|
+
revision INTEGER NOT NULL CHECK (revision >= 1),
|
|
22
|
+
created_by TEXT NOT NULL,
|
|
23
|
+
created_at BIGINT NOT NULL,
|
|
24
|
+
updated_by TEXT NOT NULL,
|
|
25
|
+
updated_at BIGINT NOT NULL,
|
|
26
|
+
UNIQUE (tenant_id, provider_key)
|
|
27
|
+
);
|
|
28
|
+
CREATE INDEX IF NOT EXISTS agent_provider_connections_tenant_name_idx
|
|
29
|
+
ON agent_provider_connections (tenant_id, name, id);
|
|
30
|
+
ALTER TABLE agent_provider_connections ENABLE ROW LEVEL SECURITY;
|
|
31
|
+
ALTER TABLE agent_provider_connections FORCE ROW LEVEL SECURITY;
|
|
32
|
+
CREATE POLICY agent_provider_connections_tenant_policy ON agent_provider_connections
|
|
33
|
+
USING (tenant_id = current_setting('coreloom.tenant_id', true))
|
|
34
|
+
WITH CHECK (tenant_id = current_setting('coreloom.tenant_id', true));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
DROP TABLE IF EXISTS agent_audit_events_v2;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS agent_audit_events_v2 (
|
|
2
|
+
id TEXT PRIMARY KEY,
|
|
3
|
+
tenant_id TEXT NOT NULL,
|
|
4
|
+
sequence BIGINT NOT NULL,
|
|
5
|
+
actor_id TEXT NOT NULL,
|
|
6
|
+
action TEXT NOT NULL,
|
|
7
|
+
subject_type TEXT NOT NULL CHECK (subject_type IN ('agent', 'agent-run', 'agent-provider', 'agent-skill')),
|
|
8
|
+
subject_id TEXT NOT NULL,
|
|
9
|
+
metadata_json TEXT NOT NULL,
|
|
10
|
+
occurred_at BIGINT NOT NULL,
|
|
11
|
+
previous_hash TEXT,
|
|
12
|
+
event_hash TEXT NOT NULL,
|
|
13
|
+
UNIQUE (tenant_id, sequence),
|
|
14
|
+
UNIQUE (tenant_id, event_hash)
|
|
15
|
+
);
|
|
16
|
+
INSERT INTO agent_audit_events_v2
|
|
17
|
+
SELECT * FROM agent_audit_events ORDER BY tenant_id, sequence
|
|
18
|
+
ON CONFLICT DO NOTHING;
|
|
19
|
+
CREATE INDEX IF NOT EXISTS agent_audit_v2_tenant_time_idx
|
|
20
|
+
ON agent_audit_events_v2 (tenant_id, occurred_at DESC, sequence DESC);
|
|
21
|
+
ALTER TABLE agent_audit_events_v2 ENABLE ROW LEVEL SECURITY;
|
|
22
|
+
ALTER TABLE agent_audit_events_v2 FORCE ROW LEVEL SECURITY;
|
|
23
|
+
CREATE POLICY agent_audit_events_v2_tenant_policy ON agent_audit_events_v2
|
|
24
|
+
USING (tenant_id = current_setting('coreloom.tenant_id', true))
|
|
25
|
+
WITH CHECK (tenant_id = current_setting('coreloom.tenant_id', true));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
DROP TABLE IF EXISTS agent_run_grant_uses;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS agent_run_grant_uses (
|
|
2
|
+
grant_id TEXT PRIMARY KEY,
|
|
3
|
+
token_hash TEXT NOT NULL UNIQUE,
|
|
4
|
+
tenant_id TEXT NOT NULL,
|
|
5
|
+
run_id TEXT NOT NULL REFERENCES agent_runs(id) ON DELETE CASCADE,
|
|
6
|
+
worker_id TEXT NOT NULL,
|
|
7
|
+
provider_id TEXT NOT NULL,
|
|
8
|
+
model_id TEXT NOT NULL,
|
|
9
|
+
issued_at BIGINT NOT NULL,
|
|
10
|
+
expires_at BIGINT NOT NULL,
|
|
11
|
+
consumed_at BIGINT NOT NULL
|
|
12
|
+
);
|
|
13
|
+
CREATE INDEX IF NOT EXISTS agent_run_grant_expiry_idx
|
|
14
|
+
ON agent_run_grant_uses (expires_at);
|
|
15
|
+
ALTER TABLE agent_run_grant_uses ENABLE ROW LEVEL SECURITY;
|
|
16
|
+
ALTER TABLE agent_run_grant_uses FORCE ROW LEVEL SECURITY;
|
|
17
|
+
CREATE POLICY agent_run_grant_uses_tenant_policy ON agent_run_grant_uses
|
|
18
|
+
USING (tenant_id = current_setting('coreloom.tenant_id', true))
|
|
19
|
+
WITH CHECK (tenant_id = current_setting('coreloom.tenant_id', true));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS agent_definition_execution_limits (
|
|
2
|
+
agent_id TEXT PRIMARY KEY REFERENCES agent_definitions(id) ON DELETE CASCADE,
|
|
3
|
+
timeout_ms BIGINT NOT NULL CHECK (timeout_ms BETWEEN 250 AND 86400000)
|
|
4
|
+
);
|
|
5
|
+
INSERT INTO agent_definition_execution_limits (agent_id, timeout_ms)
|
|
6
|
+
SELECT id, timeout_ms FROM agent_definitions
|
|
7
|
+
ON CONFLICT DO NOTHING;
|
|
8
|
+
CREATE TABLE IF NOT EXISTS agent_run_execution_limits (
|
|
9
|
+
run_id TEXT PRIMARY KEY REFERENCES agent_runs(id) ON DELETE CASCADE,
|
|
10
|
+
timeout_ms BIGINT NOT NULL CHECK (timeout_ms BETWEEN 250 AND 86400000)
|
|
11
|
+
);
|
|
12
|
+
INSERT INTO agent_run_execution_limits (run_id, timeout_ms)
|
|
13
|
+
SELECT id, timeout_ms FROM agent_runs
|
|
14
|
+
ON CONFLICT DO NOTHING;
|