@flowdular/sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ai/agents/README.md +27 -0
- package/.ai/agents/module-executor.md +36 -0
- package/.ai/agents/reviewer.md +23 -0
- package/.ai/agents/sandbox/agentic-engineer.md +31 -0
- package/.ai/agents/sandbox/backend-engineer.md +36 -0
- package/.ai/agents/sandbox/business-manager.md +23 -0
- package/.ai/agents/sandbox/frontend-engineer.md +27 -0
- package/.ai/agents/sandbox/ux-designer.md +23 -0
- package/.ai/agents/spec-author.md +29 -0
- package/.ai/blueprints/add-migration/README.md +5 -0
- package/.ai/blueprints/add-migration/allowed-paths.yaml +23 -0
- package/.ai/blueprints/add-migration/blueprint.json +14 -0
- package/.ai/blueprints/add-migration/examples/invalid/input-destructive.json +6 -0
- package/.ai/blueprints/add-migration/examples/invalid/plan-unnumbered-file.json +9 -0
- package/.ai/blueprints/add-migration/examples/valid/input.json +6 -0
- package/.ai/blueprints/add-migration/examples/valid/plan.json +9 -0
- package/.ai/blueprints/add-migration/gates.yaml +30 -0
- package/.ai/blueprints/add-migration/input.schema.json +23 -0
- package/.ai/blueprints/add-migration/plan.schema.json +54 -0
- package/.ai/blueprints/add-migration/required-files.yaml +18 -0
- package/.ai/blueprints/add-migration/spec-requirements.yaml +13 -0
- package/.ai/blueprints/add-migration/steps.yaml +62 -0
- package/.ai/blueprints/author-spec/README.md +5 -0
- package/.ai/blueprints/author-spec/allowed-paths.yaml +7 -0
- package/.ai/blueprints/author-spec/blueprint.json +14 -0
- package/.ai/blueprints/author-spec/examples/invalid/input-missing-outcome.json +5 -0
- package/.ai/blueprints/author-spec/examples/valid/input.json +6 -0
- package/.ai/blueprints/author-spec/gates.yaml +13 -0
- package/.ai/blueprints/author-spec/input.schema.json +20 -0
- package/.ai/blueprints/author-spec/plan.schema.json +14 -0
- package/.ai/blueprints/author-spec/required-files.yaml +6 -0
- package/.ai/blueprints/author-spec/spec-requirements.yaml +35 -0
- package/.ai/blueprints/author-spec/steps.yaml +28 -0
- package/.ai/blueprints/author-spec/templates/module.yaml +45 -0
- package/.ai/blueprints/bug-fix/README.md +5 -0
- package/.ai/blueprints/bug-fix/allowed-paths.yaml +29 -0
- package/.ai/blueprints/bug-fix/blueprint.json +14 -0
- package/.ai/blueprints/bug-fix/examples/invalid/input-no-symptom.json +4 -0
- package/.ai/blueprints/bug-fix/examples/invalid/plan-no-test.json +8 -0
- package/.ai/blueprints/bug-fix/examples/valid/input.json +6 -0
- package/.ai/blueprints/bug-fix/examples/valid/plan.json +8 -0
- package/.ai/blueprints/bug-fix/gates.yaml +30 -0
- package/.ai/blueprints/bug-fix/input.schema.json +25 -0
- package/.ai/blueprints/bug-fix/plan.schema.json +53 -0
- package/.ai/blueprints/bug-fix/required-files.yaml +7 -0
- package/.ai/blueprints/bug-fix/spec-requirements.yaml +7 -0
- package/.ai/blueprints/bug-fix/steps.yaml +51 -0
- package/.ai/blueprints/core-extend/README.md +5 -0
- package/.ai/blueprints/core-extend/allowed-paths.yaml +49 -0
- package/.ai/blueprints/core-extend/blueprint.json +14 -0
- package/.ai/blueprints/core-extend/examples/invalid/input-unknown-package.json +5 -0
- package/.ai/blueprints/core-extend/examples/invalid/plan-missing-gates.json +7 -0
- package/.ai/blueprints/core-extend/examples/valid/input.json +6 -0
- package/.ai/blueprints/core-extend/examples/valid/plan.json +10 -0
- package/.ai/blueprints/core-extend/gates.yaml +16 -0
- package/.ai/blueprints/core-extend/input.schema.json +54 -0
- package/.ai/blueprints/core-extend/plan.schema.json +39 -0
- package/.ai/blueprints/core-extend/required-files.yaml +36 -0
- package/.ai/blueprints/core-extend/spec-requirements.yaml +17 -0
- package/.ai/blueprints/core-extend/steps.yaml +54 -0
- package/.ai/blueprints/edit-module/README.md +9 -0
- package/.ai/blueprints/edit-module/allowed-paths.yaml +27 -0
- package/.ai/blueprints/edit-module/blueprint.json +20 -0
- package/.ai/blueprints/edit-module/examples/invalid/input-unknown-change.json +5 -0
- package/.ai/blueprints/edit-module/examples/invalid/plan-touches-platform.json +15 -0
- package/.ai/blueprints/edit-module/examples/valid/input.json +5 -0
- package/.ai/blueprints/edit-module/examples/valid/plan.json +25 -0
- package/.ai/blueprints/edit-module/gates.yaml +30 -0
- package/.ai/blueprints/edit-module/input.schema.json +31 -0
- package/.ai/blueprints/edit-module/plan.schema.json +65 -0
- package/.ai/blueprints/edit-module/required-files.yaml +80 -0
- package/.ai/blueprints/edit-module/spec-requirements.yaml +15 -0
- package/.ai/blueprints/edit-module/steps.yaml +115 -0
- package/.ai/blueprints/new-module/README.md +7 -0
- package/.ai/blueprints/new-module/allowed-paths.yaml +27 -0
- package/.ai/blueprints/new-module/blueprint.json +20 -0
- package/.ai/blueprints/new-module/examples/invalid/input-spec-outside-modules.json +4 -0
- package/.ai/blueprints/new-module/examples/invalid/plan-unknown-gate.json +8 -0
- package/.ai/blueprints/new-module/examples/valid/input.json +5 -0
- package/.ai/blueprints/new-module/examples/valid/plan.json +22 -0
- package/.ai/blueprints/new-module/gates.yaml +30 -0
- package/.ai/blueprints/new-module/input.schema.json +21 -0
- package/.ai/blueprints/new-module/plan.schema.json +58 -0
- package/.ai/blueprints/new-module/required-files.yaml +73 -0
- package/.ai/blueprints/new-module/spec-requirements.yaml +30 -0
- package/.ai/blueprints/new-module/steps.yaml +138 -0
- package/.ai/blueprints/release/README.md +5 -0
- package/.ai/blueprints/release/allowed-paths.yaml +19 -0
- package/.ai/blueprints/release/blueprint.json +14 -0
- package/.ai/blueprints/release/examples/invalid/input-bad-version.json +4 -0
- package/.ai/blueprints/release/examples/invalid/plan-bad-branch.json +7 -0
- package/.ai/blueprints/release/examples/valid/input.json +5 -0
- package/.ai/blueprints/release/examples/valid/plan.json +20 -0
- package/.ai/blueprints/release/gates.yaml +20 -0
- package/.ai/blueprints/release/input.schema.json +24 -0
- package/.ai/blueprints/release/plan.schema.json +46 -0
- package/.ai/blueprints/release/required-files.yaml +19 -0
- package/.ai/blueprints/release/spec-requirements.yaml +8 -0
- package/.ai/blueprints/release/steps.yaml +47 -0
- package/.ai/blueprints/security-review/README.md +5 -0
- package/.ai/blueprints/security-review/allowed-paths.yaml +6 -0
- package/.ai/blueprints/security-review/blueprint.json +14 -0
- package/.ai/blueprints/security-review/examples/invalid/input-unknown-kind.json +4 -0
- package/.ai/blueprints/security-review/examples/invalid/plan-finding-without-scenario.json +14 -0
- package/.ai/blueprints/security-review/examples/valid/input.json +4 -0
- package/.ai/blueprints/security-review/examples/valid/plan.json +19 -0
- package/.ai/blueprints/security-review/gates.yaml +22 -0
- package/.ai/blueprints/security-review/input.schema.json +20 -0
- package/.ai/blueprints/security-review/plan.schema.json +65 -0
- package/.ai/blueprints/security-review/required-files.yaml +6 -0
- package/.ai/blueprints/security-review/spec-requirements.yaml +9 -0
- package/.ai/blueprints/security-review/steps.yaml +38 -0
- package/.ai/policies/capabilities.yaml +164 -0
- package/.ai/policies/model-routing.yaml +72 -0
- package/.ai/policies/path-ownership.yaml +65 -0
- package/.ai/policies/task-budgets.yaml +37 -0
- package/.ai/references/catalog/LICENSE +21 -0
- package/.ai/references/catalog/migrations/0001_catalog_core.down.sql +2 -0
- package/.ai/references/catalog/migrations/0001_catalog_core.up.sql +21 -0
- package/.ai/references/catalog/migrations/0002_catalog_history.down.sql +3 -0
- package/.ai/references/catalog/migrations/0002_catalog_history.up.sql +20 -0
- package/.ai/references/catalog/migrations/0003_catalog_history_service_actors.down.sql +3 -0
- package/.ai/references/catalog/migrations/0003_catalog_history_service_actors.up.sql +36 -0
- package/.ai/references/catalog/migrations/0004_catalog_idempotency_ledger.down.sql +3 -0
- package/.ai/references/catalog/migrations/0004_catalog_idempotency_ledger.up.sql +19 -0
- package/.ai/references/catalog/migrations/README.md +3 -0
- package/.ai/references/catalog/module.json +27 -0
- package/.ai/references/catalog/package.json +49 -0
- package/.ai/references/catalog/spec/module.yaml +86 -0
- package/.ai/references/catalog/src/acl/permissions.ts +6 -0
- package/.ai/references/catalog/src/agent/tools.ts +164 -0
- package/.ai/references/catalog/src/api/endpoints.ts +243 -0
- package/.ai/references/catalog/src/client/CatalogHistoryDrawer.tsrx +123 -0
- package/.ai/references/catalog/src/client/CatalogItemForm.tsrx +190 -0
- package/.ai/references/catalog/src/client/CatalogView.tsrx +473 -0
- package/.ai/references/catalog/src/client/api.ts +111 -0
- package/.ai/references/catalog/src/client/contribution.tsrx +61 -0
- package/.ai/references/catalog/src/client/index.ts +18 -0
- package/.ai/references/catalog/src/client/navigation-copy.ts +9 -0
- package/.ai/references/catalog/src/client/state.ts +24 -0
- package/.ai/references/catalog/src/domain/types.ts +32 -0
- package/.ai/references/catalog/src/domain/variables.ts +111 -0
- package/.ai/references/catalog/src/index.ts +31 -0
- package/.ai/references/catalog/src/platform.ts +35 -0
- package/.ai/references/catalog/src/server/index.ts +4 -0
- package/.ai/references/catalog/src/server/runtime.ts +86 -0
- package/.ai/references/catalog/src/services/catalog-service.ts +306 -0
- package/.ai/references/catalog/src/services/database-repository.ts +440 -0
- package/.ai/references/catalog/src/services/index.ts +4 -0
- package/.ai/references/catalog/src/services/migration.ts +171 -0
- package/.ai/references/catalog/src/services/repository.ts +36 -0
- package/.ai/references/catalog/src/services/target-idempotency.ts +59 -0
- package/.ai/references/catalog/tests/agent-tools.test.ts +277 -0
- package/.ai/references/catalog/tests/endpoints.test.ts +320 -0
- package/.ai/references/catalog/tests/idempotency.test.ts +297 -0
- package/.ai/references/catalog/tests/migrations.test.ts +149 -0
- package/.ai/references/catalog/tests/module.test.ts +271 -0
- package/.ai/references/catalog/tests/support/database.ts +76 -0
- package/.ai/references/catalog/translations/en.json +101 -0
- package/.ai/references/catalog/translations/pl.json +101 -0
- package/.ai/references/catalog/tsconfig.json +15 -0
- package/.ai/references/catalog/vitest.config.ts +16 -0
- package/.ai/references/catalog.provenance.json +55 -0
- package/.ai/skills/README.md +36 -0
- package/.ai/skills/agent-tool-design/SKILL.md +209 -0
- package/.ai/skills/auth-security-review/SKILL.md +96 -0
- package/.ai/skills/auto-review/SKILL.md +112 -0
- package/.ai/skills/bug-hunt/SKILL.md +110 -0
- package/.ai/skills/business-agent-design/SKILL.md +188 -0
- package/.ai/skills/cli-extension/SKILL.md +114 -0
- package/.ai/skills/core-extend/SKILL.md +104 -0
- package/.ai/skills/database-adapter/SKILL.md +204 -0
- package/.ai/skills/database-adapter/references/first-run-and-matrix.md +105 -0
- package/.ai/skills/migration-authoring/SKILL.md +167 -0
- package/.ai/skills/module-new/SKILL.md +180 -0
- package/.ai/skills/module-update/SKILL.md +100 -0
- package/.ai/skills/perf-audit/SKILL.md +105 -0
- package/.ai/skills/release-eject-pr/SKILL.md +113 -0
- package/.ai/skills/spec-approval/SKILL.md +112 -0
- package/.ai/skills/test-hardening/SKILL.md +86 -0
- package/.ai/skills/translations-i18n/SKILL.md +85 -0
- package/.ai/skills/ux-design/SKILL.md +97 -0
- package/.ai/skills/variables/SKILL.md +164 -0
- package/.ai/skills/workflow-development/SKILL.md +199 -0
- package/AGENTS.md +59 -0
- package/LICENSE +21 -0
- package/README.md +24 -0
- package/docs/agent-contract.md +45 -0
- package/docs/design-system.md +217 -0
- package/modules/agents/migrations/0001_agents_core.down.sql +4 -0
- package/modules/agents/migrations/0001_agents_core.up.sql +106 -0
- package/modules/agents/migrations/0002_provider_connections.down.sql +1 -0
- package/modules/agents/migrations/0002_provider_connections.up.sql +34 -0
- package/modules/agents/migrations/0003_resource_audit.down.sql +1 -0
- package/modules/agents/migrations/0003_resource_audit.up.sql +25 -0
- package/modules/agents/migrations/0004_run_grants.down.sql +1 -0
- package/modules/agents/migrations/0004_run_grants.up.sql +19 -0
- package/modules/agents/migrations/0005_long_running_limits.down.sql +2 -0
- package/modules/agents/migrations/0005_long_running_limits.up.sql +14 -0
- package/modules/agents/migrations/0006_agent_skills.down.sql +3 -0
- package/modules/agents/migrations/0006_agent_skills.up.sql +44 -0
- package/modules/agents/migrations/0007_model_readiness.down.sql +1 -0
- package/modules/agents/migrations/0007_model_readiness.up.sql +18 -0
- package/modules/agents/migrations/0008_output_limits.down.sql +2 -0
- package/modules/agents/migrations/0008_output_limits.up.sql +8 -0
- package/modules/agents/migrations/0009_agent_audit_v3.down.sql +1 -0
- package/modules/agents/migrations/0009_agent_audit_v3.up.sql +25 -0
- package/modules/agents/migrations/0012_agent_run_costs.down.sql +3 -0
- package/modules/agents/migrations/0012_agent_run_costs.up.sql +32 -0
- package/modules/agents/migrations/0013_workflow_prerequisites.down.sql +3 -0
- package/modules/agents/migrations/0013_workflow_prerequisites.up.sql +97 -0
- package/modules/agents/migrations/0014_agent_action_audit.down.sql +1 -0
- package/modules/agents/migrations/0014_agent_action_audit.up.sql +25 -0
- package/modules/agents/migrations/0015_agent_run_actors.down.sql +1 -0
- package/modules/agents/migrations/0015_agent_run_actors.up.sql +17 -0
- package/modules/agents/migrations/0016_module_owned_agents.down.sql +6 -0
- package/modules/agents/migrations/0016_module_owned_agents.up.sql +68 -0
- package/modules/agents/migrations/0017_agent_authorization_subjects.down.sql +2 -0
- package/modules/agents/migrations/0017_agent_authorization_subjects.up.sql +18 -0
- package/modules/agents/migrations/0018_agent_child_tenant_isolation.down.sql +12 -0
- package/modules/agents/migrations/0018_agent_child_tenant_isolation.up.sql +88 -0
- package/modules/agents/migrations/0019_background_recovery_grants.down.sql +6 -0
- package/modules/agents/migrations/0019_background_recovery_grants.up.sql +17 -0
- package/modules/agents/migrations/0020_provider_summary_role.down.sql +2 -0
- package/modules/agents/migrations/0020_provider_summary_role.up.sql +17 -0
- package/modules/agents/migrations/0021_agents_agent_reconciliation_role.down.sql +4 -0
- package/modules/agents/migrations/0021_agents_agent_reconciliation_role.up.sql +7 -0
- package/modules/agents/migrations/README.md +39 -0
- package/modules/agents/module.json +38 -0
- package/modules/agents/package.json +56 -0
- package/modules/agents/spec/module.yaml +271 -0
- package/modules/agents/spec/procedures-compatibility.md +63 -0
- package/modules/agents/src/acl/permissions.ts +13 -0
- package/modules/agents/src/api/endpoints.ts +1122 -0
- package/modules/agents/src/cli/commands.json +29 -0
- package/modules/agents/src/cli/index.ts +162 -0
- package/modules/agents/src/client/AgentDashboardWidget.tsrx +32 -0
- package/modules/agents/src/client/AgentDefinitionForm.tsrx +362 -0
- package/modules/agents/src/client/AgentDefinitionList.tsrx +127 -0
- package/modules/agents/src/client/AgentPlaygroundView.tsrx +246 -0
- package/modules/agents/src/client/AgentProcedureForm.tsrx +182 -0
- package/modules/agents/src/client/AgentProcedureList.tsrx +118 -0
- package/modules/agents/src/client/AgentProceduresView.tsrx +253 -0
- package/modules/agents/src/client/AgentProvidersView.tsrx +248 -0
- package/modules/agents/src/client/AgentRunsView.tsrx +304 -0
- package/modules/agents/src/client/AgentUsageView.tsrx +233 -0
- package/modules/agents/src/client/AgentsView.tsrx +339 -0
- package/modules/agents/src/client/ModuleAgentBindingForm.tsrx +239 -0
- package/modules/agents/src/client/ModuleAgentList.tsrx +122 -0
- package/modules/agents/src/client/ProviderConnectionForm.tsrx +273 -0
- package/modules/agents/src/client/ProviderConnectionList.tsrx +229 -0
- package/modules/agents/src/client/ProviderModelEditor.tsrx +313 -0
- package/modules/agents/src/client/RunTimeline.tsrx +212 -0
- package/modules/agents/src/client/agents.css +349 -0
- package/modules/agents/src/client/api.ts +373 -0
- package/modules/agents/src/client/contribution.tsrx +181 -0
- package/modules/agents/src/client/index.ts +21 -0
- package/modules/agents/src/client/presentation.ts +162 -0
- package/modules/agents/src/client/state.ts +100 -0
- package/modules/agents/src/domain/context-variables.ts +58 -0
- package/modules/agents/src/domain/run-timeline.ts +145 -0
- package/modules/agents/src/domain/types.ts +481 -0
- package/modules/agents/src/index.ts +88 -0
- package/modules/agents/src/platform.ts +82 -0
- package/modules/agents/src/server/action-execution.ts +811 -0
- package/modules/agents/src/server/define-agent.ts +170 -0
- package/modules/agents/src/server/index.ts +67 -0
- package/modules/agents/src/server/run-execution.ts +231 -0
- package/modules/agents/src/server/run-queue.ts +96 -0
- package/modules/agents/src/server/runtime.ts +448 -0
- package/modules/agents/src/server/tools.ts +18 -0
- package/modules/agents/src/services/agent-service.ts +2167 -0
- package/modules/agents/src/services/credential-vault.ts +133 -0
- package/modules/agents/src/services/database-repository.ts +2786 -0
- package/modules/agents/src/services/index.ts +33 -0
- package/modules/agents/src/services/migration.ts +1152 -0
- package/modules/agents/src/services/module-agent-preflight.ts +76 -0
- package/modules/agents/src/services/outbound-policy.ts +136 -0
- package/modules/agents/src/services/provider-broker.ts +80 -0
- package/modules/agents/src/services/provider-repository.ts +589 -0
- package/modules/agents/src/services/provider-service.ts +968 -0
- package/modules/agents/src/services/repository.ts +294 -0
- package/modules/agents/src/services/run-grant.ts +305 -0
- package/modules/agents/src/services/usage-service.ts +119 -0
- package/modules/agents/src/services/worker.ts +442 -0
- package/modules/agents/src/settings.ts +244 -0
- package/modules/agents/translations/en.json +403 -0
- package/modules/agents/translations/pl.json +403 -0
- package/modules/auth/README.md +215 -0
- package/modules/auth/migrations/0001_auth_core.up.sql +108 -0
- package/modules/auth/migrations/0002_bundled_module_scopes.up.sql +26 -0
- package/modules/auth/migrations/0003_agent_core_scopes.up.sql +12 -0
- package/modules/auth/migrations/0004_owner_only_development_scopes.up.sql +8 -0
- package/modules/auth/migrations/0005_agent_provider_scopes.up.sql +13 -0
- package/modules/auth/migrations/0006_tenant_slug.up.sql +6 -0
- package/modules/auth/migrations/0007_sandbox_scopes.up.sql +13 -0
- package/modules/auth/migrations/0008_api_tokens.up.sql +43 -0
- package/modules/auth/migrations/0009_module_settings.up.sql +24 -0
- package/modules/auth/migrations/0010_sign_in_lockout.up.sql +11 -0
- package/modules/auth/migrations/0011_session_ids_and_password_reset.up.sql +7 -0
- package/modules/auth/migrations/0012_roles.up.sql +31 -0
- package/modules/auth/migrations/0013_audit.up.sql +27 -0
- package/modules/auth/migrations/0014_audit_actor.up.sql +4 -0
- package/modules/auth/migrations/0015_account_security.up.sql +81 -0
- package/modules/auth/module.json +26 -0
- package/modules/auth/package.json +61 -0
- package/modules/auth/spec/module.yaml +190 -0
- package/modules/auth/src/acl/scopes.ts +86 -0
- package/modules/auth/src/api/attempt-limiter.ts +42 -0
- package/modules/auth/src/api/client-address.ts +14 -0
- package/modules/auth/src/api/cookies.ts +52 -0
- package/modules/auth/src/api/origin.ts +40 -0
- package/modules/auth/src/cli/commands.json +74 -0
- package/modules/auth/src/cli/database.ts +51 -0
- package/modules/auth/src/cli/greenfield.ts +173 -0
- package/modules/auth/src/cli/index.ts +184 -0
- package/modules/auth/src/cli/provisioning.ts +211 -0
- package/modules/auth/src/client/AuthBackdrop.tsrx +137 -0
- package/modules/auth/src/client/AuthenticationCore.tsrx +630 -0
- package/modules/auth/src/client/PasswordChangeRequired.tsrx +145 -0
- package/modules/auth/src/client/PublicAuthFlows.tsrx +379 -0
- package/modules/auth/src/client/api.ts +464 -0
- package/modules/auth/src/client/audit/AuditView.tsrx +357 -0
- package/modules/auth/src/client/audit/api.ts +164 -0
- package/modules/auth/src/client/audit/audit-columns.tsrx +47 -0
- package/modules/auth/src/client/audit/audit-row.ts +38 -0
- package/modules/auth/src/client/auth.css +483 -0
- package/modules/auth/src/client/contribution.tsrx +100 -0
- package/modules/auth/src/client/index.ts +32 -0
- package/modules/auth/src/client/security/SecurityView.tsrx +253 -0
- package/modules/auth/src/client/settings/PreferencesCard.tsrx +65 -0
- package/modules/auth/src/client/settings/SettingsView.tsrx +212 -0
- package/modules/auth/src/client/settings/WorkspaceCard.tsrx +59 -0
- package/modules/auth/src/client/settings/api.ts +115 -0
- package/modules/auth/src/client/slug.ts +26 -0
- package/modules/auth/src/client/state.ts +115 -0
- package/modules/auth/src/client/tokens/ApiTokenForm.tsrx +153 -0
- package/modules/auth/src/client/tokens/ApiTokenSecret.tsrx +35 -0
- package/modules/auth/src/client/tokens/ApiTokensView.tsrx +216 -0
- package/modules/auth/src/client/tokens/api.ts +59 -0
- package/modules/auth/src/client/tokens/state.ts +26 -0
- package/modules/auth/src/client/tokens/token-columns.tsrx +64 -0
- package/modules/auth/src/client/translations.ts +23 -0
- package/modules/auth/src/domain/types.ts +152 -0
- package/modules/auth/src/index.ts +42 -0
- package/modules/auth/src/middleware/authentication.ts +97 -0
- package/modules/auth/src/platform.ts +0 -0
- package/modules/auth/src/server/actor.ts +12 -0
- package/modules/auth/src/server/audit-endpoints.ts +51 -0
- package/modules/auth/src/server/composition.ts +9 -0
- package/modules/auth/src/server/endpoints.ts +893 -0
- package/modules/auth/src/server/http.ts +153 -0
- package/modules/auth/src/server/index.ts +37 -0
- package/modules/auth/src/server/roles-endpoints.ts +120 -0
- package/modules/auth/src/server/runtime.ts +705 -0
- package/modules/auth/src/server/session-endpoints.ts +86 -0
- package/modules/auth/src/server/session-security.ts +62 -0
- package/modules/auth/src/server/token-endpoints.ts +106 -0
- package/modules/auth/src/services/auth-service-error.ts +11 -0
- package/modules/auth/src/services/auth-service.ts +2309 -0
- package/modules/auth/src/services/database-repository.ts +1825 -0
- package/modules/auth/src/services/mail-delivery.ts +27 -0
- package/modules/auth/src/services/migration.ts +591 -0
- package/modules/auth/src/services/password.ts +115 -0
- package/modules/auth/src/services/repository.ts +395 -0
- package/modules/auth/src/services/settings-store.ts +92 -0
- package/modules/auth/src/services/totp.ts +135 -0
- package/modules/auth/src/services/validation.ts +186 -0
- package/modules/auth/src/settings.ts +150 -0
- package/modules/auth/translations/en.json +263 -0
- package/modules/auth/translations/pl.json +263 -0
- package/modules/automations/migrations/0001_automations_core.down.sql +10 -0
- package/modules/automations/migrations/0001_automations_core.up.sql +76 -0
- package/modules/automations/migrations/0002_automations_targets.down.sql +9 -0
- package/modules/automations/migrations/0002_automations_targets.up.sql +37 -0
- package/modules/automations/migrations/0003_automations_scheduler_role.down.sql +3 -0
- package/modules/automations/migrations/0003_automations_scheduler_role.up.sql +19 -0
- package/modules/automations/migrations/0004_automations_trigger_routing_role.down.sql +3 -0
- package/modules/automations/migrations/0004_automations_trigger_routing_role.up.sql +18 -0
- package/modules/automations/migrations/README.md +3 -0
- package/modules/automations/module.json +31 -0
- package/modules/automations/package.json +55 -0
- package/modules/automations/spec/module.yaml +93 -0
- package/modules/automations/src/acl/permissions.ts +10 -0
- package/modules/automations/src/api/endpoints.ts +480 -0
- package/modules/automations/src/client/AutomationScheduleForm.tsrx +218 -0
- package/modules/automations/src/client/AutomationSchedulesView.tsrx +339 -0
- package/modules/automations/src/client/AutomationTriggerForm.tsrx +190 -0
- package/modules/automations/src/client/AutomationTriggersView.tsrx +329 -0
- package/modules/automations/src/client/api.ts +148 -0
- package/modules/automations/src/client/contribution.tsrx +70 -0
- package/modules/automations/src/client/index.ts +20 -0
- package/modules/automations/src/client/presentation.ts +38 -0
- package/modules/automations/src/client/state.ts +40 -0
- package/modules/automations/src/client/target-selection.ts +44 -0
- package/modules/automations/src/domain/cadence.ts +44 -0
- package/modules/automations/src/domain/types.ts +110 -0
- package/modules/automations/src/domain/variables.ts +178 -0
- package/modules/automations/src/index.ts +39 -0
- package/modules/automations/src/platform.ts +73 -0
- package/modules/automations/src/server/execution.ts +77 -0
- package/modules/automations/src/server/index.ts +39 -0
- package/modules/automations/src/server/runtime.ts +218 -0
- package/modules/automations/src/server/targets.ts +116 -0
- package/modules/automations/src/services/automations-service.ts +10 -0
- package/modules/automations/src/services/database-repository.ts +763 -0
- package/modules/automations/src/services/index.ts +5 -0
- package/modules/automations/src/services/migration.ts +223 -0
- package/modules/automations/src/services/repository.ts +119 -0
- package/modules/automations/src/services/schedule-service.ts +837 -0
- package/modules/automations/src/services/secret-vault.ts +124 -0
- package/modules/automations/src/services/trigger-service.ts +648 -0
- package/modules/automations/src/settings.ts +69 -0
- package/modules/automations/translations/en.json +126 -0
- package/modules/automations/translations/pl.json +126 -0
- package/modules/automations-workflows-integration/module.json +27 -0
- package/modules/automations-workflows-integration/package.json +48 -0
- package/modules/automations-workflows-integration/spec/module.yaml +93 -0
- package/modules/automations-workflows-integration/src/index.ts +14 -0
- package/modules/automations-workflows-integration/src/platform.ts +24 -0
- package/modules/automations-workflows-integration/src/server/adapter.ts +272 -0
- package/modules/automations-workflows-integration/src/server/index.ts +11 -0
- package/modules/automations-workflows-integration/src/server/tools.ts +0 -0
- package/modules/automations-workflows-integration/translations/en.json +21 -0
- package/modules/automations-workflows-integration/translations/pl.json +21 -0
- package/modules/profile/migrations/0001_profile_core.down.sql +1 -0
- package/modules/profile/migrations/0001_profile_core.up.sql +13 -0
- package/modules/profile/migrations/0002_profile_language.down.sql +1 -0
- package/modules/profile/migrations/0002_profile_language.up.sql +12 -0
- package/modules/profile/migrations/README.md +3 -0
- package/modules/profile/module.json +23 -0
- package/modules/profile/package.json +55 -0
- package/modules/profile/spec/module.yaml +136 -0
- package/modules/profile/src/acl/permissions.ts +5 -0
- package/modules/profile/src/api/endpoints.ts +184 -0
- package/modules/profile/src/client/DisplayNameCard.tsrx +59 -0
- package/modules/profile/src/client/LanguageCard.tsrx +89 -0
- package/modules/profile/src/client/PasswordCard.tsrx +79 -0
- package/modules/profile/src/client/ProfileView.tsrx +192 -0
- package/modules/profile/src/client/SessionsCard.tsrx +158 -0
- package/modules/profile/src/client/api.ts +134 -0
- package/modules/profile/src/client/contribution.tsrx +61 -0
- package/modules/profile/src/client/index.ts +15 -0
- package/modules/profile/src/client/password.ts +41 -0
- package/modules/profile/src/client/sessions-api.ts +52 -0
- package/modules/profile/src/client/state.ts +23 -0
- package/modules/profile/src/domain/types.ts +21 -0
- package/modules/profile/src/index.ts +21 -0
- package/modules/profile/src/platform.ts +23 -0
- package/modules/profile/src/server/index.ts +7 -0
- package/modules/profile/src/server/runtime.ts +84 -0
- package/modules/profile/src/services/database-repository.ts +154 -0
- package/modules/profile/src/services/index.ts +6 -0
- package/modules/profile/src/services/migration.ts +58 -0
- package/modules/profile/src/services/profile-service.ts +114 -0
- package/modules/profile/src/services/repository.ts +13 -0
- package/modules/profile/translations/en.json +58 -0
- package/modules/profile/translations/pl.json +58 -0
- package/modules/sandbox/migrations/0001_sandbox_core.down.sql +6 -0
- package/modules/sandbox/migrations/0001_sandbox_core.up.sql +70 -0
- package/modules/sandbox/migrations/0002_sandbox_session_lifecycle.down.sql +36 -0
- package/modules/sandbox/migrations/0002_sandbox_session_lifecycle.up.sql +37 -0
- package/modules/sandbox/migrations/README.md +7 -0
- package/modules/sandbox/module.json +31 -0
- package/modules/sandbox/package.json +56 -0
- package/modules/sandbox/spec/module.yaml +111 -0
- package/modules/sandbox/src/acl/permissions.ts +18 -0
- package/modules/sandbox/src/api/endpoints.ts +439 -0
- package/modules/sandbox/src/cli/commands.json +84 -0
- package/modules/sandbox/src/cli/index.ts +450 -0
- package/modules/sandbox/src/client/SandboxAccessView.tsrx +191 -0
- package/modules/sandbox/src/client/SandboxGrantForm.tsrx +134 -0
- package/modules/sandbox/src/client/SandboxGrantList.tsrx +83 -0
- package/modules/sandbox/src/client/SandboxSessionList.tsrx +56 -0
- package/modules/sandbox/src/client/api.ts +87 -0
- package/modules/sandbox/src/client/contribution.tsrx +47 -0
- package/modules/sandbox/src/client/index.ts +18 -0
- package/modules/sandbox/src/client/presentation.ts +47 -0
- package/modules/sandbox/src/client/state.ts +20 -0
- package/modules/sandbox/src/domain/types.ts +125 -0
- package/modules/sandbox/src/index.ts +33 -0
- package/modules/sandbox/src/platform.ts +28 -0
- package/modules/sandbox/src/server/index.ts +20 -0
- package/modules/sandbox/src/server/runtime.ts +119 -0
- package/modules/sandbox/src/services/database-repository.ts +567 -0
- package/modules/sandbox/src/services/directory.ts +33 -0
- package/modules/sandbox/src/services/index.ts +19 -0
- package/modules/sandbox/src/services/migration.ts +145 -0
- package/modules/sandbox/src/services/repository.ts +55 -0
- package/modules/sandbox/src/services/sandbox-service-error.ts +10 -0
- package/modules/sandbox/src/services/sandbox-service.ts +533 -0
- package/modules/sandbox/translations/en.json +77 -0
- package/modules/sandbox/translations/pl.json +77 -0
- package/modules/system/module.json +18 -0
- package/modules/system/package.json +56 -0
- package/modules/system/spec/module.yaml +104 -0
- package/modules/system/src/acl/permissions.ts +10 -0
- package/modules/system/src/client/ModuleSettingRow.tsrx +191 -0
- package/modules/system/src/client/ModuleSettingsSection.tsrx +155 -0
- package/modules/system/src/client/ModulesView.tsrx +241 -0
- package/modules/system/src/client/api.ts +36 -0
- package/modules/system/src/client/contribution.tsrx +48 -0
- package/modules/system/src/client/index.ts +26 -0
- package/modules/system/src/client/module-columns.tsrx +66 -0
- package/modules/system/src/client/overview-api.ts +30 -0
- package/modules/system/src/client/setting-copy.ts +30 -0
- package/modules/system/src/client/settings-api.ts +57 -0
- package/modules/system/src/client/state.ts +16 -0
- package/modules/system/src/index.ts +11 -0
- package/modules/system/src/platform.ts +11 -0
- package/modules/system/src/server/endpoints.ts +372 -0
- package/modules/system/src/server/index.ts +11 -0
- package/modules/system/src/server/module-catalog.ts +117 -0
- package/modules/system/translations/en.json +64 -0
- package/modules/system/translations/pl.json +64 -0
- package/modules/users/migrations/README.md +3 -0
- package/modules/users/module.json +27 -0
- package/modules/users/package.json +54 -0
- package/modules/users/spec/module.yaml +79 -0
- package/modules/users/src/acl/permissions.ts +6 -0
- package/modules/users/src/api/endpoints.ts +222 -0
- package/modules/users/src/client/InviteMemberForm.tsrx +62 -0
- package/modules/users/src/client/MemberDrawer.tsrx +298 -0
- package/modules/users/src/client/RoleForm.tsrx +140 -0
- package/modules/users/src/client/RolesView.tsrx +288 -0
- package/modules/users/src/client/UserAccountForm.tsrx +86 -0
- package/modules/users/src/client/UsersView.tsrx +486 -0
- package/modules/users/src/client/api.ts +172 -0
- package/modules/users/src/client/contribution.tsrx +92 -0
- package/modules/users/src/client/index.ts +19 -0
- package/modules/users/src/client/member-columns.tsrx +52 -0
- package/modules/users/src/client/roles-api.ts +90 -0
- package/modules/users/src/client/state.ts +42 -0
- package/modules/users/src/index.ts +27 -0
- package/modules/users/src/platform.ts +11 -0
- package/modules/users/src/services/index.ts +2 -0
- package/modules/users/src/services/users-service.ts +142 -0
- package/modules/users/translations/en.json +133 -0
- package/modules/users/translations/pl.json +133 -0
- package/modules/workflows/migrations/0001_workflows_core.down.sql +19 -0
- package/modules/workflows/migrations/0001_workflows_core.up.sql +228 -0
- package/modules/workflows/migrations/0002_workflows_authorization_subject.down.sql +1 -0
- package/modules/workflows/migrations/0002_workflows_authorization_subject.up.sql +9 -0
- package/modules/workflows/migrations/0003_workflows_worker_role.up.sql +34 -0
- package/modules/workflows/migrations/README.md +7 -0
- package/modules/workflows/module.json +31 -0
- package/modules/workflows/package.json +55 -0
- package/modules/workflows/spec/module.yaml +227 -0
- package/modules/workflows/src/acl/permissions.ts +10 -0
- package/modules/workflows/src/api/endpoints.ts +852 -0
- package/modules/workflows/src/client/WorkflowCanvas.tsrx +819 -0
- package/modules/workflows/src/client/WorkflowCreateForm.tsrx +111 -0
- package/modules/workflows/src/client/WorkflowEditor.tsrx +443 -0
- package/modules/workflows/src/client/WorkflowExecutionHistory.tsrx +169 -0
- package/modules/workflows/src/client/WorkflowFixtureDrawer.tsrx +206 -0
- package/modules/workflows/src/client/WorkflowInputForm.tsrx +125 -0
- package/modules/workflows/src/client/WorkflowInputSchemaEditor.tsrx +185 -0
- package/modules/workflows/src/client/WorkflowInspector.tsrx +471 -0
- package/modules/workflows/src/client/WorkflowLiveConfirmation.tsrx +67 -0
- package/modules/workflows/src/client/WorkflowMappingEditor.tsrx +283 -0
- package/modules/workflows/src/client/WorkflowNodePalette.tsrx +50 -0
- package/modules/workflows/src/client/WorkflowPointerField.tsrx +178 -0
- package/modules/workflows/src/client/WorkflowRevisionReview.tsrx +49 -0
- package/modules/workflows/src/client/WorkflowRunInspector.tsrx +143 -0
- package/modules/workflows/src/client/WorkflowTestPanel.tsrx +109 -0
- package/modules/workflows/src/client/WorkflowValidationPanel.tsrx +139 -0
- package/modules/workflows/src/client/WorkflowsView.tsrx +1060 -0
- package/modules/workflows/src/client/api.ts +312 -0
- package/modules/workflows/src/client/canvas-model.ts +472 -0
- package/modules/workflows/src/client/connected-node.ts +71 -0
- package/modules/workflows/src/client/contribution.tsrx +57 -0
- package/modules/workflows/src/client/create-model.ts +15 -0
- package/modules/workflows/src/client/draft-repair.ts +86 -0
- package/modules/workflows/src/client/index.ts +19 -0
- package/modules/workflows/src/client/input-model.ts +124 -0
- package/modules/workflows/src/client/mapping-model.ts +110 -0
- package/modules/workflows/src/client/pointer-model.ts +123 -0
- package/modules/workflows/src/client/presentation.ts +62 -0
- package/modules/workflows/src/client/run-actions.ts +19 -0
- package/modules/workflows/src/client/state.ts +57 -0
- package/modules/workflows/src/client/viewport.ts +107 -0
- package/modules/workflows/src/client/workflows.css +899 -0
- package/modules/workflows/src/domain/events.ts +399 -0
- package/modules/workflows/src/domain/graph.ts +1136 -0
- package/modules/workflows/src/domain/types.ts +563 -0
- package/modules/workflows/src/index.ts +27 -0
- package/modules/workflows/src/platform.ts +49 -0
- package/modules/workflows/src/server/index.ts +13 -0
- package/modules/workflows/src/server/runtime.ts +266 -0
- package/modules/workflows/src/services/cursor-codec.ts +62 -0
- package/modules/workflows/src/services/database-repository.ts +2407 -0
- package/modules/workflows/src/services/index.ts +6 -0
- package/modules/workflows/src/services/migration.ts +375 -0
- package/modules/workflows/src/services/payload-codec.ts +264 -0
- package/modules/workflows/src/services/repository.ts +285 -0
- package/modules/workflows/src/services/simulation.ts +359 -0
- package/modules/workflows/src/services/worker.ts +1196 -0
- package/modules/workflows/src/services/workflows-service.ts +1395 -0
- package/modules/workflows/translations/en.json +348 -0
- package/modules/workflows/translations/pl.json +348 -0
- package/modules.json +41 -0
- package/package.json +125 -0
- package/packages/ai-provider/package.json +46 -0
- package/packages/ai-provider/src/catalog.ts +102 -0
- package/packages/ai-provider/src/errors.ts +110 -0
- package/packages/ai-provider/src/index.ts +33 -0
- package/packages/ai-provider/src/model.ts +198 -0
- package/packages/ai-provider/src/pricing.ts +73 -0
- package/packages/cli-protocol/package.json +40 -0
- package/packages/cli-protocol/src/index.ts +113 -0
- package/packages/client/package.json +46 -0
- package/packages/client/src/ApplicationShell.tsrx +374 -0
- package/packages/client/src/contributions.ts +172 -0
- package/packages/client/src/i18n/index.ts +30 -0
- package/packages/client/src/i18n/locale.ts +25 -0
- package/packages/client/src/i18n/locales/en.json +66 -0
- package/packages/client/src/i18n/locales/pl.json +66 -0
- package/packages/client/src/i18n/runtime.ts +201 -0
- package/packages/client/src/i18n/translations.ts +88 -0
- package/packages/client/src/index.ts +55 -0
- package/packages/client/src/routing.ts +9 -0
- package/packages/client/src/shell/BrandMark.tsrx +10 -0
- package/packages/client/src/shell/CommandPalette.tsrx +79 -0
- package/packages/client/src/shell/ContributionOutlets.tsrx +31 -0
- package/packages/client/src/shell/DashboardView.tsrx +60 -0
- package/packages/client/src/shell/MobileHeader.tsrx +24 -0
- package/packages/client/src/shell/OrganizationSwitcher.tsrx +100 -0
- package/packages/client/src/shell/OverviewCharts.tsrx +167 -0
- package/packages/client/src/shell/PrimaryNavigation.tsrx +75 -0
- package/packages/client/src/shell/Sidebar.tsrx +76 -0
- package/packages/client/src/shell/Topbar.tsrx +44 -0
- package/packages/client/src/shell/UserMenu.tsrx +103 -0
- package/packages/client/src/shell/WorkspaceContent.tsrx +30 -0
- package/packages/client/src/shell/identity.ts +12 -0
- package/packages/client/src/shell/navigation.ts +68 -0
- package/packages/client/src/shell/shell.css +734 -0
- package/packages/client/src/shell/types.ts +29 -0
- package/packages/client/src/state.ts +63 -0
- package/packages/client/src/web.ts +39 -0
- package/packages/coding-agent/package.json +44 -0
- package/packages/coding-agent/src/drivers/byok.ts +322 -0
- package/packages/coding-agent/src/drivers/claude-code.ts +290 -0
- package/packages/coding-agent/src/drivers/codex.ts +281 -0
- package/packages/coding-agent/src/index.ts +56 -0
- package/packages/coding-agent/src/registry.ts +119 -0
- package/packages/coding-agent/src/roles/contract.ts +60 -0
- package/packages/coding-agent/src/roles/defaults.ts +134 -0
- package/packages/coding-agent/src/roles/handoff.ts +41 -0
- package/packages/coding-agent/src/roles/registry.ts +156 -0
- package/packages/coding-agent/src/roles/skills.ts +72 -0
- package/packages/coding-agent/src/roles/sync.ts +88 -0
- package/packages/coding-agent/src/types.ts +102 -0
- package/packages/coding-agent/src/workspace.ts +275 -0
- package/packages/contracts/package.json +38 -0
- package/packages/contracts/schemas/blueprint.schema.json +48 -0
- package/packages/contracts/schemas/cli-extension.schema.json +90 -0
- package/packages/contracts/schemas/module-artifact.schema.json +82 -0
- package/packages/contracts/schemas/module-catalog.schema.json +48 -0
- package/packages/contracts/schemas/module-spec.schema.json +111 -0
- package/packages/contracts/schemas/module.schema.json +156 -0
- package/packages/contracts/schemas/platform-spec.schema.json +17 -0
- package/packages/contracts/schemas/project.schema.json +270 -0
- package/packages/contracts/src/index.ts +191 -0
- package/packages/contracts/src/module-distribution.ts +47 -0
- package/packages/contracts/src/schemas.ts +18 -0
- package/packages/contracts/src/variables.ts +156 -0
- package/packages/contracts/src/web.ts +60 -0
- package/packages/database/package.json +43 -0
- package/packages/database/src/contracts.ts +399 -0
- package/packages/database/src/index.ts +112 -0
- package/packages/database/src/migrations.ts +444 -0
- package/packages/database/src/postgresql.ts +517 -0
- package/packages/database/src/provider.ts +639 -0
- package/packages/database/src/record-history.ts +201 -0
- package/packages/database/src/registry.ts +265 -0
- package/packages/database/src/reset.ts +87 -0
- package/packages/database-pglite/package.json +42 -0
- package/packages/database-pglite/src/driver.ts +168 -0
- package/packages/database-pglite/src/index.ts +2 -0
- package/packages/database-testing/package.json +44 -0
- package/packages/database-testing/src/index.ts +8 -0
- package/packages/database-testing/src/pglite.ts +124 -0
- package/packages/database-testing/src/postgres.ts +184 -0
- package/packages/database-testing/src/provider.ts +43 -0
- package/packages/database-testing/src/vitest-preset.ts +23 -0
- package/packages/dev-console/README.md +6 -0
- package/packages/dev-console/package.json +38 -0
- package/packages/dev-console/src/index.mjs +220 -0
- package/packages/harness/package.json +47 -0
- package/packages/harness/schemas/task-packet.schema.json +48 -0
- package/packages/harness/src/catalog.ts +24 -0
- package/packages/harness/src/errors.ts +9 -0
- package/packages/harness/src/index.ts +53 -0
- package/packages/harness/src/preamble.ts +31 -0
- package/packages/harness/src/runtime.ts +833 -0
- package/packages/harness/src/task-packet.ts +86 -0
- package/packages/harness/src/tool-adapters.ts +106 -0
- package/packages/harness/src/tool-contract.ts +242 -0
- package/packages/harness/src/vercel-ai-provider.ts +198 -0
- package/packages/kernel/package.json +44 -0
- package/packages/kernel/src/acl.ts +20 -0
- package/packages/kernel/src/actor.ts +139 -0
- package/packages/kernel/src/agent-registry.ts +81 -0
- package/packages/kernel/src/capability-registry.ts +28 -0
- package/packages/kernel/src/errors.ts +9 -0
- package/packages/kernel/src/index.ts +90 -0
- package/packages/kernel/src/legacy-local-state.ts +103 -0
- package/packages/kernel/src/module-compatibility.ts +70 -0
- package/packages/kernel/src/module-registry.ts +124 -0
- package/packages/kernel/src/module-settings.ts +403 -0
- package/packages/kernel/src/record-history.ts +146 -0
- package/packages/kernel/src/runtime-config.ts +51 -0
- package/packages/kernel/src/tool-registry.ts +25 -0
- package/packages/kernel/src/variable-registry.ts +339 -0
- package/packages/sandbox/README.md +691 -0
- package/packages/sandbox/bin/flowdular-sandbox.mjs +393 -0
- package/packages/sandbox/dist/client/assets/App-ClMOrpyg.js +11 -0
- package/packages/sandbox/dist/client/assets/PreviewHost-BHiHrfbQ.js +1 -0
- package/packages/sandbox/dist/client/assets/auto-buGEq6de.js +3 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/index-CvwhlQ87.js +4 -0
- package/packages/sandbox/dist/client/assets/styles-BPWaGf55.js +3 -0
- package/packages/sandbox/dist/client/assets/styles-Dx1_KOag.css +1 -0
- package/packages/sandbox/dist/client/favicon.svg +1 -0
- package/packages/sandbox/dist/server/assets/auto-CVGNYyb3.js +12785 -0
- package/packages/sandbox/dist/server/assets/chunk-DDJLRBDX-3OUNo51g.js +4125 -0
- package/packages/sandbox/dist/server/assets/nodefs-DVSI7kG0.js +24 -0
- package/packages/sandbox/dist/server/assets/opfs-ahp-D56iokt1.js +388 -0
- package/packages/sandbox/dist/server/assets/token-Bvaq7Anz.js +55 -0
- package/packages/sandbox/dist/server/assets/token-util-BqSvdIPQ.js +3 -0
- package/packages/sandbox/dist/server/assets/token-util-CktFFT4z.js +494 -0
- package/packages/sandbox/dist/server/entry.js +91671 -0
- package/packages/sandbox/dist/server/favicon.svg +1 -0
- package/packages/sandbox/dist/server/index.html +161 -0
- package/packages/sandbox/index.html +159 -0
- package/packages/sandbox/octane.config.ts +36 -0
- package/packages/sandbox/package.json +83 -0
- package/packages/sandbox/public/favicon.svg +1 -0
- package/packages/sandbox/public/og.png +0 -0
- package/packages/sandbox/src/App.tsrx +924 -0
- package/packages/sandbox/src/client/ApprovalHandoff.tsrx +39 -0
- package/packages/sandbox/src/client/ChatPane.tsrx +694 -0
- package/packages/sandbox/src/client/ConnectView.tsrx +86 -0
- package/packages/sandbox/src/client/DiffPane.tsrx +150 -0
- package/packages/sandbox/src/client/EjectModal.tsrx +571 -0
- package/packages/sandbox/src/client/GateResults.tsrx +60 -0
- package/packages/sandbox/src/client/GitHubSettingsModal.tsrx +219 -0
- package/packages/sandbox/src/client/NewSessionForm.tsrx +214 -0
- package/packages/sandbox/src/client/SessionBar.tsrx +151 -0
- package/packages/sandbox/src/client/SessionPicker.tsrx +472 -0
- package/packages/sandbox/src/client/SpecEditor.tsrx +109 -0
- package/packages/sandbox/src/client/SpecReviewCard.tsrx +321 -0
- package/packages/sandbox/src/client/WorkCard.tsrx +128 -0
- package/packages/sandbox/src/client/WorkbenchModal.tsrx +161 -0
- package/packages/sandbox/src/client/WorkspaceMenu.tsrx +100 -0
- package/packages/sandbox/src/client/api.ts +797 -0
- package/packages/sandbox/src/client/attachments.ts +73 -0
- package/packages/sandbox/src/client/dashboard.ts +46 -0
- package/packages/sandbox/src/client/github-settings.ts +48 -0
- package/packages/sandbox/src/client/highlight.ts +105 -0
- package/packages/sandbox/src/client/i18n.ts +32 -0
- package/packages/sandbox/src/client/locales/en.json +466 -0
- package/packages/sandbox/src/client/locales/pl.json +466 -0
- package/packages/sandbox/src/client/session-labels.ts +77 -0
- package/packages/sandbox/src/client/state.ts +108 -0
- package/packages/sandbox/src/index.ts +10 -0
- package/packages/sandbox/src/preview/PreviewHost.tsrx +373 -0
- package/packages/sandbox/src/preview/load-module.ts +16 -0
- package/packages/sandbox/src/server/attachments.ts +308 -0
- package/packages/sandbox/src/server/auto-review.ts +181 -0
- package/packages/sandbox/src/server/checkpoints.ts +90 -0
- package/packages/sandbox/src/server/config.ts +460 -0
- package/packages/sandbox/src/server/dashboard.ts +245 -0
- package/packages/sandbox/src/server/delivery/configuration.ts +193 -0
- package/packages/sandbox/src/server/delivery/git-pr.ts +1473 -0
- package/packages/sandbox/src/server/delivery/index.ts +83 -0
- package/packages/sandbox/src/server/delivery/local.ts +151 -0
- package/packages/sandbox/src/server/delivery/official-modules.ts +516 -0
- package/packages/sandbox/src/server/delivery/plan.ts +218 -0
- package/packages/sandbox/src/server/delivery/policies.ts +239 -0
- package/packages/sandbox/src/server/delivery/record.ts +41 -0
- package/packages/sandbox/src/server/delivery/steps.ts +464 -0
- package/packages/sandbox/src/server/delivery/types.ts +158 -0
- package/packages/sandbox/src/server/dependencies.ts +88 -0
- package/packages/sandbox/src/server/diff.ts +230 -0
- package/packages/sandbox/src/server/gates.ts +388 -0
- package/packages/sandbox/src/server/index.ts +139 -0
- package/packages/sandbox/src/server/path-guard.ts +282 -0
- package/packages/sandbox/src/server/planning.ts +749 -0
- package/packages/sandbox/src/server/platform-client.ts +189 -0
- package/packages/sandbox/src/server/preview-database-host.ts +340 -0
- package/packages/sandbox/src/server/preview-database-protocol.ts +163 -0
- package/packages/sandbox/src/server/preview-database-proxy.ts +356 -0
- package/packages/sandbox/src/server/preview-database.ts +109 -0
- package/packages/sandbox/src/server/preview-ipc.ts +15 -0
- package/packages/sandbox/src/server/preview-modules.ts +83 -0
- package/packages/sandbox/src/server/preview-revision.ts +44 -0
- package/packages/sandbox/src/server/preview-runtime.ts +467 -0
- package/packages/sandbox/src/server/preview-worker-manager.ts +436 -0
- package/packages/sandbox/src/server/preview-worker.ts +168 -0
- package/packages/sandbox/src/server/reference.ts +251 -0
- package/packages/sandbox/src/server/routes.ts +2258 -0
- package/packages/sandbox/src/server/runtime.ts +188 -0
- package/packages/sandbox/src/server/session-owner.ts +23 -0
- package/packages/sandbox/src/server/sessions.ts +849 -0
- package/packages/sandbox/src/server/spec.ts +471 -0
- package/packages/sandbox/src/server/turn-lifecycle.ts +56 -0
- package/packages/sandbox/src/server/turns.ts +993 -0
- package/packages/sandbox/src/server/workspace-install.ts +266 -0
- package/packages/sandbox/src/server/workspace-root.ts +73 -0
- package/packages/sandbox/src/styles.css +1573 -0
- package/packages/sandbox/vite.config.ts +133 -0
- package/packages/server/package.json +43 -0
- package/packages/server/src/application-routes.ts +21 -0
- package/packages/server/src/composition.ts +48 -0
- package/packages/server/src/endpoint.ts +142 -0
- package/packages/server/src/http.ts +128 -0
- package/packages/server/src/index.ts +46 -0
- package/packages/server/src/response-lifetime.ts +56 -0
- package/packages/server/src/security-headers.ts +130 -0
- package/packages/server/src/web-html.ts +55 -0
- package/packages/server/src/web.ts +361 -0
- package/packages/ui/package.json +46 -0
- package/packages/ui/src/brand/BrandMark.tsrx +66 -0
- package/packages/ui/src/brand/mark.ts +44 -0
- package/packages/ui/src/components/Alert.tsrx +17 -0
- package/packages/ui/src/components/Avatar.tsrx +18 -0
- package/packages/ui/src/components/Button.tsrx +29 -0
- package/packages/ui/src/components/Chart.tsrx +274 -0
- package/packages/ui/src/components/CheckGrid.tsrx +93 -0
- package/packages/ui/src/components/ConfirmDialog.tsrx +63 -0
- package/packages/ui/src/components/Drawer.tsrx +71 -0
- package/packages/ui/src/components/EmptyState.tsrx +26 -0
- package/packages/ui/src/components/Filters.tsrx +39 -0
- package/packages/ui/src/components/FormField.tsrx +27 -0
- package/packages/ui/src/components/Kpi.tsrx +36 -0
- package/packages/ui/src/components/PageHeader.tsrx +26 -0
- package/packages/ui/src/components/ScopeSummary.tsrx +76 -0
- package/packages/ui/src/components/SearchField.tsrx +24 -0
- package/packages/ui/src/components/SettingRow.tsrx +50 -0
- package/packages/ui/src/components/Switch.tsrx +21 -0
- package/packages/ui/src/components/Table.tsrx +267 -0
- package/packages/ui/src/components/TableCard.tsrx +52 -0
- package/packages/ui/src/components/Tag.tsrx +28 -0
- package/packages/ui/src/components/VariableField.tsrx +284 -0
- package/packages/ui/src/components/VariableInput.tsrx +7 -0
- package/packages/ui/src/components/VariableSelect.tsrx +72 -0
- package/packages/ui/src/components/VariableTextarea.tsrx +9 -0
- package/packages/ui/src/components/variable-field.ts +61 -0
- package/packages/ui/src/components/variable-select.ts +69 -0
- package/packages/ui/src/icons/Icon.tsrx +56 -0
- package/packages/ui/src/index.ts +81 -0
- package/packages/ui/src/initials.ts +10 -0
- package/packages/ui/src/styles/base.css +71 -0
- package/packages/ui/src/styles/components.css +1859 -0
- package/packages/ui/src/styles/index.css +3 -0
- package/packages/ui/src/styles/tokens.css +124 -0
- package/tsconfig.base.json +18 -0
|
@@ -0,0 +1,1060 @@
|
|
|
1
|
+
import { activeLocale, t } from '@flowdular/sdk/client';
|
|
2
|
+
import {
|
|
3
|
+
Alert,
|
|
4
|
+
Button,
|
|
5
|
+
ConfirmDialog,
|
|
6
|
+
Drawer,
|
|
7
|
+
EmptyState,
|
|
8
|
+
Filters,
|
|
9
|
+
Icon,
|
|
10
|
+
PageHeader,
|
|
11
|
+
SearchField,
|
|
12
|
+
TableCard,
|
|
13
|
+
Tag,
|
|
14
|
+
type TableColumn,
|
|
15
|
+
} from '@flowdular/sdk/ui';
|
|
16
|
+
import { useEffect, useMemo } from 'octane';
|
|
17
|
+
import { useValue } from 'segment-state';
|
|
18
|
+
import type {
|
|
19
|
+
CreateWorkflowDefinitionInput,
|
|
20
|
+
WorkflowDefinition,
|
|
21
|
+
WorkflowGraphV1,
|
|
22
|
+
WorkflowNodeV1,
|
|
23
|
+
WorkflowRunDetail,
|
|
24
|
+
WorkflowRunSummary,
|
|
25
|
+
WorkflowRunStatus,
|
|
26
|
+
WorkflowSimulationFixture,
|
|
27
|
+
} from '../domain/types.ts';
|
|
28
|
+
import {
|
|
29
|
+
archiveWorkflow,
|
|
30
|
+
cancelWorkflowRun,
|
|
31
|
+
createWorkflowDefinition,
|
|
32
|
+
deleteWorkflow,
|
|
33
|
+
enqueueWorkflow,
|
|
34
|
+
loadWorkflowCatalog,
|
|
35
|
+
loadWorkflowDefinitions,
|
|
36
|
+
loadWorkflowDetail,
|
|
37
|
+
loadWorkflowRunDetail,
|
|
38
|
+
loadWorkflowRuns,
|
|
39
|
+
observeWorkflowRun,
|
|
40
|
+
parseJsonInput,
|
|
41
|
+
publishWorkflow,
|
|
42
|
+
retryWorkflowRun,
|
|
43
|
+
simulateWorkflow,
|
|
44
|
+
updateWorkflowDraft,
|
|
45
|
+
validateWorkflowGraph,
|
|
46
|
+
} from './api.ts';
|
|
47
|
+
import {
|
|
48
|
+
addWorkflowNode,
|
|
49
|
+
connectWorkflowNodes,
|
|
50
|
+
moveWorkflowNode,
|
|
51
|
+
proposeWorkflowConnection,
|
|
52
|
+
removeWorkflowEdge,
|
|
53
|
+
removeWorkflowNode,
|
|
54
|
+
replaceWorkflowNode,
|
|
55
|
+
simulationFixtures,
|
|
56
|
+
workflowOverlay,
|
|
57
|
+
type WorkflowNodeType,
|
|
58
|
+
} from './canvas-model.ts';
|
|
59
|
+
import { dateTime } from './presentation.ts';
|
|
60
|
+
import { runActions } from './run-actions.ts';
|
|
61
|
+
import { repairCanvasIdentifiers } from './draft-repair.ts';
|
|
62
|
+
import {
|
|
63
|
+
addConnectedNode,
|
|
64
|
+
type ConnectedNodeRequest,
|
|
65
|
+
} from './connected-node.ts';
|
|
66
|
+
import { createWorkflowsClientState } from './state.ts';
|
|
67
|
+
import { WorkflowCreateForm } from './WorkflowCreateForm.tsrx';
|
|
68
|
+
import { WorkflowEditor } from './WorkflowEditor.tsrx';
|
|
69
|
+
import { WorkflowExecutionHistory } from './WorkflowExecutionHistory.tsrx';
|
|
70
|
+
import { WorkflowFixtureDrawer } from './WorkflowFixtureDrawer.tsrx';
|
|
71
|
+
import { WorkflowLiveConfirmation } from './WorkflowLiveConfirmation.tsrx';
|
|
72
|
+
|
|
73
|
+
export interface WorkflowsViewProps {
|
|
74
|
+
readonly csrfToken: string;
|
|
75
|
+
readonly canRead: boolean;
|
|
76
|
+
readonly canManage: boolean;
|
|
77
|
+
readonly canPublish: boolean;
|
|
78
|
+
readonly canReadRuns: boolean;
|
|
79
|
+
readonly canExecute: boolean;
|
|
80
|
+
readonly canCancel: boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function definitionColumns(): readonly TableColumn<WorkflowDefinition>[] {
|
|
84
|
+
return [
|
|
85
|
+
{
|
|
86
|
+
key: 'workflow',
|
|
87
|
+
header: t('workflows.table.column.workflow'),
|
|
88
|
+
width: '42%',
|
|
89
|
+
cell: (record) => <span class="ui-cell">
|
|
90
|
+
<b>{record.name}</b>
|
|
91
|
+
<small class="ui-mono">{record.key}</small>
|
|
92
|
+
</span>,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: 'draft',
|
|
96
|
+
header: t('workflows.table.column.draft'),
|
|
97
|
+
width: '14%',
|
|
98
|
+
numeric: true,
|
|
99
|
+
cell: (record) => t('workflows.table.revision', {
|
|
100
|
+
revision: record.currentDraftRevision,
|
|
101
|
+
}),
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
key: 'published',
|
|
105
|
+
header: t('workflows.table.column.published'),
|
|
106
|
+
width: '14%',
|
|
107
|
+
numeric: true,
|
|
108
|
+
cell: (record) => record.publishedRevision === null
|
|
109
|
+
? t('workflows.table.notPublished')
|
|
110
|
+
: t('workflows.table.revision', { revision: record.publishedRevision }),
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
key: 'updated',
|
|
114
|
+
header: t('workflows.table.column.updated'),
|
|
115
|
+
width: '18%',
|
|
116
|
+
cell: (record) => dateTime(record.updatedAt),
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
key: 'status',
|
|
120
|
+
header: t('workflows.table.column.status'),
|
|
121
|
+
width: '12%',
|
|
122
|
+
cell: (record) =>
|
|
123
|
+
<Tag tone={record.status === 'active' ? 'success' : 'neutral'} dot>{t(
|
|
124
|
+
'workflows.status.' + record.status,
|
|
125
|
+
)}</Tag>,
|
|
126
|
+
},
|
|
127
|
+
];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const TERMINAL_RUN_STATUSES: readonly WorkflowRunStatus[] = [
|
|
131
|
+
'succeeded',
|
|
132
|
+
'failed',
|
|
133
|
+
'refused',
|
|
134
|
+
'cancelled',
|
|
135
|
+
];
|
|
136
|
+
|
|
137
|
+
export function WorkflowsView(props: WorkflowsViewProps) @{
|
|
138
|
+
const client = useMemo(() => createWorkflowsClientState(), []);
|
|
139
|
+
const [definitions] = useValue(client.state.definitions);
|
|
140
|
+
const [runs] = useValue(client.state.runs);
|
|
141
|
+
const [detail, setDetail] = useValue(client.state.detail);
|
|
142
|
+
const [graph, setGraph] = useValue(client.state.graph);
|
|
143
|
+
const [selectedNodeId, setSelectedNodeId] = useValue(
|
|
144
|
+
client.state.selectedNodeId,
|
|
145
|
+
);
|
|
146
|
+
const [selectedEdgeId, setSelectedEdgeId] = useValue(
|
|
147
|
+
client.state.selectedEdgeId,
|
|
148
|
+
);
|
|
149
|
+
const [connectionSource, setConnectionSource] = useValue(
|
|
150
|
+
client.state.connectionSource,
|
|
151
|
+
);
|
|
152
|
+
const [selectedRun, setSelectedRun] = useValue(client.state.selectedRun);
|
|
153
|
+
const [agents] = useValue(client.state.agents);
|
|
154
|
+
const [actions] = useValue(client.state.actions);
|
|
155
|
+
const [validation, setValidation] = useValue(client.state.validation);
|
|
156
|
+
const [liveValidation, setLiveValidation] = useValue(
|
|
157
|
+
client.state.liveValidation,
|
|
158
|
+
);
|
|
159
|
+
const [validating, setValidating] = useValue(client.state.validating);
|
|
160
|
+
const [status, setStatus] = useValue(client.state.status);
|
|
161
|
+
const [error, setError] = useValue(client.state.error);
|
|
162
|
+
const [notice, setNotice] = useValue(client.state.notice);
|
|
163
|
+
const [dirty, setDirty] = useValue(client.state.dirty);
|
|
164
|
+
const [saving, setSaving] = useValue(client.state.saving);
|
|
165
|
+
const [query, setQuery] = useValue(client.state.query);
|
|
166
|
+
const [statusFilter, setStatusFilter] = useValue(client.state.statusFilter);
|
|
167
|
+
const [filtersOpen, setFiltersOpen] = useValue(client.state.filtersOpen);
|
|
168
|
+
const [runQuery, setRunQuery] = useValue(client.state.runQuery);
|
|
169
|
+
const [runStatusFilter, setRunStatusFilter] = useValue(
|
|
170
|
+
client.state.runStatusFilter,
|
|
171
|
+
);
|
|
172
|
+
const [runFiltersOpen, setRunFiltersOpen] = useValue(
|
|
173
|
+
client.state.runFiltersOpen,
|
|
174
|
+
);
|
|
175
|
+
const [createOpen, setCreateOpen] = useValue(client.state.createOpen);
|
|
176
|
+
const [fixturesOpen, setFixturesOpen] = useValue(client.state.fixturesOpen);
|
|
177
|
+
const [liveConfirmOpen, setLiveConfirmOpen] = useValue(
|
|
178
|
+
client.state.liveConfirmOpen,
|
|
179
|
+
);
|
|
180
|
+
const [deleteConfirmOpen, setDeleteConfirmOpen] = useValue(
|
|
181
|
+
client.state.deleteConfirmOpen,
|
|
182
|
+
);
|
|
183
|
+
const [lifecycleTarget, setLifecycleTarget] = useValue(
|
|
184
|
+
client.state.lifecycleTarget,
|
|
185
|
+
);
|
|
186
|
+
const [inputText, setInputText] = useValue(client.state.inputText);
|
|
187
|
+
const [fixturesText, setFixturesText] = useValue(client.state.fixturesText);
|
|
188
|
+
const [editorName, setEditorName] = useValue(client.state.editorName);
|
|
189
|
+
const [editorDescription, setEditorDescription] = useValue(
|
|
190
|
+
client.state.editorDescription,
|
|
191
|
+
);
|
|
192
|
+
const [editorMode, setEditorMode] = useValue(client.state.editorMode);
|
|
193
|
+
const runCursor = useMemo(() => ({ value: null as string | null }), []);
|
|
194
|
+
const editVersion = useMemo(() => ({ value: 0 }), []);
|
|
195
|
+
const failedSaveVersion = useMemo(() => ({ value: -1 }), []);
|
|
196
|
+
const createSession = useMemo(() => ({ value: 0 }), []);
|
|
197
|
+
|
|
198
|
+
const refresh = async () => {
|
|
199
|
+
if (!props.canRead) return;
|
|
200
|
+
setStatus('loading');
|
|
201
|
+
setError('');
|
|
202
|
+
try {
|
|
203
|
+
const [loadedDefinitions, runPage] = await Promise.all([
|
|
204
|
+
loadWorkflowDefinitions(),
|
|
205
|
+
props.canReadRuns
|
|
206
|
+
? loadWorkflowRuns({
|
|
207
|
+
limit: 50,
|
|
208
|
+
...(runStatusFilter
|
|
209
|
+
? { status: runStatusFilter as WorkflowRunStatus }
|
|
210
|
+
: {}),
|
|
211
|
+
})
|
|
212
|
+
: Promise.resolve({
|
|
213
|
+
runs: [],
|
|
214
|
+
nextCursor: null,
|
|
215
|
+
}),
|
|
216
|
+
]);
|
|
217
|
+
client.store.act((transaction) => {
|
|
218
|
+
transaction.set(client.state.definitions, loadedDefinitions);
|
|
219
|
+
transaction.set(client.state.runs, runPage.runs);
|
|
220
|
+
}, 'workflows/loaded');
|
|
221
|
+
runCursor.value = runPage.nextCursor;
|
|
222
|
+
} catch (loadError) {
|
|
223
|
+
setError(
|
|
224
|
+
loadError instanceof Error
|
|
225
|
+
? loadError.message
|
|
226
|
+
: t('workflows.error.load'),
|
|
227
|
+
);
|
|
228
|
+
} finally {
|
|
229
|
+
setStatus('idle');
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
useEffect(() => {
|
|
234
|
+
void refresh();
|
|
235
|
+
}, [props.canRead]);
|
|
236
|
+
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
if (!detail || !graph || !dirty || saving || !props.canManage) return;
|
|
239
|
+
if (
|
|
240
|
+
detail.definition.status === 'archived' ||
|
|
241
|
+
failedSaveVersion.value === editVersion.value
|
|
242
|
+
) return;
|
|
243
|
+
const timer = setTimeout(() => {
|
|
244
|
+
const scheduledVersion = editVersion.value;
|
|
245
|
+
setSaving(true);
|
|
246
|
+
setError('');
|
|
247
|
+
void updateWorkflowDraft(
|
|
248
|
+
{
|
|
249
|
+
workflowId: detail.definition.id,
|
|
250
|
+
expectedRevision: detail.draft.revision,
|
|
251
|
+
name: editorName,
|
|
252
|
+
description: editorDescription,
|
|
253
|
+
graph,
|
|
254
|
+
},
|
|
255
|
+
props.csrfToken,
|
|
256
|
+
).then((saved) => {
|
|
257
|
+
setDetail(saved);
|
|
258
|
+
if (editVersion.value === scheduledVersion) setDirty(false);
|
|
259
|
+
setSaving(false);
|
|
260
|
+
}).catch((saveError: unknown) => {
|
|
261
|
+
failedSaveVersion.value = scheduledVersion;
|
|
262
|
+
setSaving(false);
|
|
263
|
+
setError(
|
|
264
|
+
saveError instanceof Error
|
|
265
|
+
? saveError.message
|
|
266
|
+
: t('workflows.error.save'),
|
|
267
|
+
);
|
|
268
|
+
});
|
|
269
|
+
}, 700);
|
|
270
|
+
return () => clearTimeout(timer);
|
|
271
|
+
}, [detail?.definition.id, graph, editorName, editorDescription, dirty, saving]);
|
|
272
|
+
|
|
273
|
+
const changeGraph = (next: WorkflowGraphV1) => {
|
|
274
|
+
editVersion.value += 1;
|
|
275
|
+
setGraph(next);
|
|
276
|
+
setDirty(true);
|
|
277
|
+
setValidation(null);
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
const openEditor = async (definition: WorkflowDefinition) => {
|
|
281
|
+
editVersion.value += 1;
|
|
282
|
+
setStatus('loading');
|
|
283
|
+
setError('');
|
|
284
|
+
try {
|
|
285
|
+
const [loaded, catalog, runPage] = await Promise.all([
|
|
286
|
+
loadWorkflowDetail(definition.id),
|
|
287
|
+
loadWorkflowCatalog(),
|
|
288
|
+
props.canReadRuns
|
|
289
|
+
? loadWorkflowRuns({
|
|
290
|
+
workflowId: definition.id,
|
|
291
|
+
limit: 50,
|
|
292
|
+
...(runStatusFilter
|
|
293
|
+
? { status: runStatusFilter as WorkflowRunStatus }
|
|
294
|
+
: {}),
|
|
295
|
+
})
|
|
296
|
+
: Promise.resolve({ runs: [], nextCursor: null }),
|
|
297
|
+
]);
|
|
298
|
+
const editableGraph =
|
|
299
|
+
props.canManage && loaded.definition.status !== 'archived'
|
|
300
|
+
? repairCanvasIdentifiers(loaded.draft.graph)
|
|
301
|
+
: loaded.draft.graph;
|
|
302
|
+
client.store.act((transaction) => {
|
|
303
|
+
transaction.set(client.state.detail, loaded);
|
|
304
|
+
transaction.set(client.state.graph, editableGraph);
|
|
305
|
+
transaction.set(client.state.editorName, loaded.definition.name);
|
|
306
|
+
transaction.set(
|
|
307
|
+
client.state.editorDescription,
|
|
308
|
+
loaded.definition.description,
|
|
309
|
+
);
|
|
310
|
+
transaction.set(client.state.agents, catalog.agents);
|
|
311
|
+
transaction.set(client.state.actions, catalog.actions);
|
|
312
|
+
transaction.set(client.state.runs, runPage.runs);
|
|
313
|
+
transaction.set(client.state.validation, null);
|
|
314
|
+
transaction.set(client.state.liveValidation, null);
|
|
315
|
+
transaction.set(client.state.selectedRun, null);
|
|
316
|
+
transaction.set(client.state.selectedNodeId, '');
|
|
317
|
+
transaction.set(client.state.selectedEdgeId, '');
|
|
318
|
+
transaction.set(
|
|
319
|
+
client.state.dirty,
|
|
320
|
+
editableGraph !== loaded.draft.graph,
|
|
321
|
+
);
|
|
322
|
+
transaction.set(client.state.editorMode, 'editor');
|
|
323
|
+
transaction.set(client.state.inputText, '{}');
|
|
324
|
+
transaction.set(client.state.notice, '');
|
|
325
|
+
transaction.set(client.state.connectionSource, null);
|
|
326
|
+
}, 'workflows/editor-opened');
|
|
327
|
+
setFixturesText(
|
|
328
|
+
JSON.stringify(simulationFixtures(editableGraph), null, 2),
|
|
329
|
+
);
|
|
330
|
+
runCursor.value = runPage.nextCursor;
|
|
331
|
+
} catch (loadError) {
|
|
332
|
+
setError(
|
|
333
|
+
loadError instanceof Error
|
|
334
|
+
? loadError.message
|
|
335
|
+
: t('workflows.error.loadOne'),
|
|
336
|
+
);
|
|
337
|
+
} finally {
|
|
338
|
+
setStatus('idle');
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
const create = async (input: CreateWorkflowDefinitionInput) => {
|
|
343
|
+
setStatus('submitting');
|
|
344
|
+
setError('');
|
|
345
|
+
try {
|
|
346
|
+
const definition = await createWorkflowDefinition(input, props.csrfToken);
|
|
347
|
+
setCreateOpen(false);
|
|
348
|
+
await openEditor(definition);
|
|
349
|
+
} catch (createError) {
|
|
350
|
+
setError(
|
|
351
|
+
createError instanceof Error
|
|
352
|
+
? createError.message
|
|
353
|
+
: t('workflows.error.create'),
|
|
354
|
+
);
|
|
355
|
+
setStatus('idle');
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
const addNode = (type: WorkflowNodeType, request?: ConnectedNodeRequest) => {
|
|
360
|
+
if (!graph) return;
|
|
361
|
+
const added =
|
|
362
|
+
request
|
|
363
|
+
? addConnectedNode(
|
|
364
|
+
graph,
|
|
365
|
+
type,
|
|
366
|
+
t('workflows.nodeType.' + type),
|
|
367
|
+
request,
|
|
368
|
+
)
|
|
369
|
+
: addWorkflowNode(graph, type, t('workflows.nodeType.' + type));
|
|
370
|
+
if (!added) return;
|
|
371
|
+
changeGraph(added.graph);
|
|
372
|
+
setSelectedNodeId(added.nodeId);
|
|
373
|
+
setSelectedEdgeId('');
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
const finishConnection = (nodeId: string, port: string) => {
|
|
377
|
+
if (!graph || !connectionSource) {
|
|
378
|
+
setNotice(t('workflows.canvas.chooseOutputFirst'));
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
const proposal = proposeWorkflowConnection(
|
|
382
|
+
graph,
|
|
383
|
+
connectionSource.nodeId,
|
|
384
|
+
connectionSource.port,
|
|
385
|
+
nodeId,
|
|
386
|
+
port,
|
|
387
|
+
);
|
|
388
|
+
if (!proposal.valid) {
|
|
389
|
+
setError(t('workflows.connectionError.' + proposal.code));
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
changeGraph(
|
|
393
|
+
connectWorkflowNodes(
|
|
394
|
+
graph,
|
|
395
|
+
connectionSource.nodeId,
|
|
396
|
+
connectionSource.port,
|
|
397
|
+
nodeId,
|
|
398
|
+
port,
|
|
399
|
+
),
|
|
400
|
+
);
|
|
401
|
+
setConnectionSource(null);
|
|
402
|
+
setNotice(t('workflows.canvas.connected'));
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
const dryRun = async () => {
|
|
406
|
+
if (!graph) return;
|
|
407
|
+
setStatus('submitting');
|
|
408
|
+
setValidating(true);
|
|
409
|
+
setError('');
|
|
410
|
+
try {
|
|
411
|
+
parseJsonInput(inputText);
|
|
412
|
+
setValidation(await validateWorkflowGraph(graph, props.csrfToken));
|
|
413
|
+
} catch (dryRunError) {
|
|
414
|
+
setError(
|
|
415
|
+
dryRunError instanceof Error
|
|
416
|
+
? dryRunError.message
|
|
417
|
+
: t('workflows.error.validate'),
|
|
418
|
+
);
|
|
419
|
+
} finally {
|
|
420
|
+
setValidating(false);
|
|
421
|
+
setStatus('idle');
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
const selectRun = async (run: WorkflowRunSummary) => {
|
|
426
|
+
setError('');
|
|
427
|
+
try {
|
|
428
|
+
if (dirty || saving) {
|
|
429
|
+
setError(t('workflows.test.saveFirst'));
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
if (
|
|
433
|
+
!detail || detail.definition.id !== run.workflowId ||
|
|
434
|
+
editorMode !== 'editor'
|
|
435
|
+
) {
|
|
436
|
+
const definition =
|
|
437
|
+
definitions.find((entry) => entry.id === run.workflowId) ??
|
|
438
|
+
(await loadWorkflowDetail(run.workflowId)).definition;
|
|
439
|
+
await openEditor(definition);
|
|
440
|
+
}
|
|
441
|
+
const loaded = await loadWorkflowRunDetail(run.id);
|
|
442
|
+
setSelectedRun(loaded);
|
|
443
|
+
setSelectedNodeId(loaded.compiledOrder[0] ?? '');
|
|
444
|
+
setSelectedEdgeId('');
|
|
445
|
+
} catch (runError) {
|
|
446
|
+
setError(
|
|
447
|
+
runError instanceof Error ? runError.message : t('workflows.error.run'),
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
const simulate = async () => {
|
|
453
|
+
if (!detail) return;
|
|
454
|
+
if (dirty || saving) {
|
|
455
|
+
setError(t('workflows.test.saveFirst'));
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
setStatus('submitting');
|
|
459
|
+
setError('');
|
|
460
|
+
try {
|
|
461
|
+
const fixtures = JSON.parse(
|
|
462
|
+
inputFixtures(fixturesText),
|
|
463
|
+
) as WorkflowSimulationFixture[];
|
|
464
|
+
const run = await simulateWorkflow(
|
|
465
|
+
{
|
|
466
|
+
workflowId: detail.definition.id,
|
|
467
|
+
input: parseJsonInput(inputText),
|
|
468
|
+
fixtures,
|
|
469
|
+
},
|
|
470
|
+
props.csrfToken,
|
|
471
|
+
);
|
|
472
|
+
setSelectedRun(run);
|
|
473
|
+
setNotice(t('workflows.test.simulationCreated'));
|
|
474
|
+
await refreshRuns(detail.definition.id);
|
|
475
|
+
} catch (simulationError) {
|
|
476
|
+
setError(
|
|
477
|
+
simulationError instanceof Error
|
|
478
|
+
? simulationError.message
|
|
479
|
+
: t('workflows.error.simulate'),
|
|
480
|
+
);
|
|
481
|
+
} finally {
|
|
482
|
+
setStatus('idle');
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
const refreshRuns = async (
|
|
487
|
+
workflowId?: string,
|
|
488
|
+
statusValue = runStatusFilter,
|
|
489
|
+
) => {
|
|
490
|
+
if (!props.canReadRuns) return;
|
|
491
|
+
const page = await loadWorkflowRuns({
|
|
492
|
+
...(workflowId ? { workflowId } : {}),
|
|
493
|
+
...(statusValue ? { status: statusValue as WorkflowRunStatus } : {}),
|
|
494
|
+
limit: 50,
|
|
495
|
+
});
|
|
496
|
+
client.store.act(
|
|
497
|
+
(transaction) => transaction.set(client.state.runs, page.runs),
|
|
498
|
+
'workflows/runs-refreshed',
|
|
499
|
+
);
|
|
500
|
+
runCursor.value = page.nextCursor;
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
const confirmLive = async () => {
|
|
504
|
+
if (!detail || !liveValidation?.valid) return;
|
|
505
|
+
setLiveConfirmOpen(false);
|
|
506
|
+
setStatus('submitting');
|
|
507
|
+
setError('');
|
|
508
|
+
try {
|
|
509
|
+
const accepted = await enqueueWorkflow(
|
|
510
|
+
{
|
|
511
|
+
workflowKey: detail.definition.key,
|
|
512
|
+
input: parseJsonInput(inputText),
|
|
513
|
+
idempotencyKey: crypto.randomUUID(),
|
|
514
|
+
},
|
|
515
|
+
props.csrfToken,
|
|
516
|
+
);
|
|
517
|
+
setNotice(t('workflows.test.liveQueued', { id: accepted.runId }));
|
|
518
|
+
await refreshRuns(detail.definition.id);
|
|
519
|
+
setSelectedRun(await loadWorkflowRunDetail(accepted.runId));
|
|
520
|
+
} catch (liveError) {
|
|
521
|
+
setError(
|
|
522
|
+
liveError instanceof Error
|
|
523
|
+
? liveError.message
|
|
524
|
+
: t('workflows.error.live'),
|
|
525
|
+
);
|
|
526
|
+
} finally {
|
|
527
|
+
setStatus('idle');
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
const prepareLiveRun = async () => {
|
|
532
|
+
if (!detail || detail.definition.publishedRevision === null) return;
|
|
533
|
+
const published = detail.revisions.find(
|
|
534
|
+
(revision) => revision.revision === detail.definition.publishedRevision,
|
|
535
|
+
);
|
|
536
|
+
if (!published) {
|
|
537
|
+
setError(t('workflows.error.publishedRevision'));
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
setStatus('submitting');
|
|
541
|
+
setError('');
|
|
542
|
+
try {
|
|
543
|
+
const report = await validateWorkflowGraph(
|
|
544
|
+
published.graph,
|
|
545
|
+
props.csrfToken,
|
|
546
|
+
);
|
|
547
|
+
setLiveValidation(report);
|
|
548
|
+
if (!report.valid) {
|
|
549
|
+
setError(t('workflows.error.liveInvalid'));
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
setLiveConfirmOpen(true);
|
|
553
|
+
} catch (validationError) {
|
|
554
|
+
setError(
|
|
555
|
+
validationError instanceof Error
|
|
556
|
+
? validationError.message
|
|
557
|
+
: t('workflows.error.validate'),
|
|
558
|
+
);
|
|
559
|
+
} finally {
|
|
560
|
+
setStatus('idle');
|
|
561
|
+
}
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
useEffect(() => {
|
|
565
|
+
if (
|
|
566
|
+
!selectedRun || TERMINAL_RUN_STATUSES.includes(selectedRun.run.status)
|
|
567
|
+
) return;
|
|
568
|
+
const sequence = selectedRun.events.at(-1)?.sequence ?? 0;
|
|
569
|
+
return observeWorkflowRun(
|
|
570
|
+
selectedRun.run.id,
|
|
571
|
+
sequence,
|
|
572
|
+
() => {
|
|
573
|
+
void loadWorkflowRunDetail(selectedRun.run.id).then(setSelectedRun);
|
|
574
|
+
},
|
|
575
|
+
() => {
|
|
576
|
+
void loadWorkflowRunDetail(selectedRun.run.id).then(setSelectedRun);
|
|
577
|
+
},
|
|
578
|
+
);
|
|
579
|
+
}, [selectedRun?.run.id, selectedRun?.run.status, selectedRun?.events.length]);
|
|
580
|
+
|
|
581
|
+
const publish = async () => {
|
|
582
|
+
if (!detail || !graph) return;
|
|
583
|
+
if (dirty || saving) {
|
|
584
|
+
setError(t('workflows.error.saveBeforePublish'));
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
setStatus('submitting');
|
|
588
|
+
setError('');
|
|
589
|
+
try {
|
|
590
|
+
if (props.canExecute) {
|
|
591
|
+
setValidating(true);
|
|
592
|
+
const report = await validateWorkflowGraph(graph, props.csrfToken);
|
|
593
|
+
setValidating(false);
|
|
594
|
+
setValidation(report);
|
|
595
|
+
if (!report.valid) {
|
|
596
|
+
setError(t('workflows.error.publishInvalid'));
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
const published = await publishWorkflow(
|
|
601
|
+
detail.definition.id,
|
|
602
|
+
detail.draft.revision,
|
|
603
|
+
props.csrfToken,
|
|
604
|
+
);
|
|
605
|
+
setDetail(published);
|
|
606
|
+
setNotice(
|
|
607
|
+
t('workflows.editor.published', {
|
|
608
|
+
revision: published.definition.publishedRevision ??
|
|
609
|
+
published.draft.revision,
|
|
610
|
+
}),
|
|
611
|
+
);
|
|
612
|
+
} catch (publishError) {
|
|
613
|
+
setValidating(false);
|
|
614
|
+
setError(
|
|
615
|
+
publishError instanceof Error
|
|
616
|
+
? publishError.message
|
|
617
|
+
: t('workflows.error.publish'),
|
|
618
|
+
);
|
|
619
|
+
} finally {
|
|
620
|
+
setStatus('idle');
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
const removeDefinition = async () => {
|
|
625
|
+
if (!lifecycleTarget) return;
|
|
626
|
+
setStatus('submitting');
|
|
627
|
+
try {
|
|
628
|
+
await deleteWorkflow(lifecycleTarget.id, props.csrfToken);
|
|
629
|
+
setDeleteConfirmOpen(false);
|
|
630
|
+
setLifecycleTarget(null);
|
|
631
|
+
await refresh();
|
|
632
|
+
} catch (deleteError) {
|
|
633
|
+
setError(
|
|
634
|
+
deleteError instanceof Error
|
|
635
|
+
? deleteError.message
|
|
636
|
+
: t('workflows.error.delete'),
|
|
637
|
+
);
|
|
638
|
+
setStatus('idle');
|
|
639
|
+
}
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
const archive = async (definition: WorkflowDefinition) => {
|
|
643
|
+
setStatus('submitting');
|
|
644
|
+
setError('');
|
|
645
|
+
try {
|
|
646
|
+
await archiveWorkflow(definition.id, props.csrfToken);
|
|
647
|
+
await refresh();
|
|
648
|
+
} catch (archiveError) {
|
|
649
|
+
setError(
|
|
650
|
+
archiveError instanceof Error
|
|
651
|
+
? archiveError.message
|
|
652
|
+
: t('workflows.error.archive'),
|
|
653
|
+
);
|
|
654
|
+
setStatus('idle');
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
const loadMoreRuns = async () => {
|
|
659
|
+
if (!runCursor.value) return;
|
|
660
|
+
setStatus('loading');
|
|
661
|
+
try {
|
|
662
|
+
const page = await loadWorkflowRuns({
|
|
663
|
+
...(detail ? { workflowId: detail.definition.id } : {}),
|
|
664
|
+
...(runStatusFilter
|
|
665
|
+
? { status: runStatusFilter as WorkflowRunStatus }
|
|
666
|
+
: {}),
|
|
667
|
+
limit: 50,
|
|
668
|
+
cursor: runCursor.value,
|
|
669
|
+
});
|
|
670
|
+
client.store.act(
|
|
671
|
+
(transaction) => transaction.set(client.state.runs, [
|
|
672
|
+
...runs,
|
|
673
|
+
...page.runs,
|
|
674
|
+
]),
|
|
675
|
+
'workflows/runs-paged',
|
|
676
|
+
);
|
|
677
|
+
runCursor.value = page.nextCursor;
|
|
678
|
+
} catch (pageError) {
|
|
679
|
+
setError(
|
|
680
|
+
pageError instanceof Error
|
|
681
|
+
? pageError.message
|
|
682
|
+
: t('workflows.error.run'),
|
|
683
|
+
);
|
|
684
|
+
} finally {
|
|
685
|
+
setStatus('idle');
|
|
686
|
+
}
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
const cancelRun = async () => {
|
|
690
|
+
if (!selectedRun || !runActions(selectedRun.run, {
|
|
691
|
+
execute: props.canExecute,
|
|
692
|
+
cancel: props.canCancel,
|
|
693
|
+
}).cancel) return;
|
|
694
|
+
setStatus('submitting');
|
|
695
|
+
try {
|
|
696
|
+
await cancelWorkflowRun(selectedRun.run.id, props.csrfToken);
|
|
697
|
+
setSelectedRun(await loadWorkflowRunDetail(selectedRun.run.id));
|
|
698
|
+
} catch (cancelError) {
|
|
699
|
+
setError(
|
|
700
|
+
cancelError instanceof Error
|
|
701
|
+
? cancelError.message
|
|
702
|
+
: t('workflows.error.cancel'),
|
|
703
|
+
);
|
|
704
|
+
} finally {
|
|
705
|
+
setStatus('idle');
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
const retryRun = async () => {
|
|
710
|
+
if (!selectedRun || !runActions(selectedRun.run, {
|
|
711
|
+
execute: props.canExecute,
|
|
712
|
+
cancel: props.canCancel,
|
|
713
|
+
}).retry) return;
|
|
714
|
+
setStatus('submitting');
|
|
715
|
+
try {
|
|
716
|
+
const accepted = await retryWorkflowRun(
|
|
717
|
+
selectedRun.run.id,
|
|
718
|
+
props.csrfToken,
|
|
719
|
+
);
|
|
720
|
+
setSelectedRun(await loadWorkflowRunDetail(accepted.runId));
|
|
721
|
+
await refreshRuns(detail?.definition.id);
|
|
722
|
+
} catch (retryError) {
|
|
723
|
+
setError(
|
|
724
|
+
retryError instanceof Error
|
|
725
|
+
? retryError.message
|
|
726
|
+
: t('workflows.error.retry'),
|
|
727
|
+
);
|
|
728
|
+
} finally {
|
|
729
|
+
setStatus('idle');
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
|
|
733
|
+
const locale = activeLocale();
|
|
734
|
+
const term = query.trim().toLocaleLowerCase(locale);
|
|
735
|
+
const visibleDefinitions = definitions.filter(
|
|
736
|
+
(definition) =>
|
|
737
|
+
(term === '' ||
|
|
738
|
+
definition.name.toLocaleLowerCase(locale).includes(term) ||
|
|
739
|
+
definition.key.toLocaleLowerCase(locale).includes(term)) &&
|
|
740
|
+
(statusFilter === '' || definition.status === statusFilter),
|
|
741
|
+
);
|
|
742
|
+
const displayedGraph = selectedRun?.graph ?? graph;
|
|
743
|
+
const selectedNode =
|
|
744
|
+
displayedGraph?.nodes.find((node) => node.id === selectedNodeId) ?? null;
|
|
745
|
+
const selectedEdge =
|
|
746
|
+
displayedGraph?.edges.find((edge) => edge.id === selectedEdgeId) ?? null;
|
|
747
|
+
const history =
|
|
748
|
+
props.canReadRuns
|
|
749
|
+
? <WorkflowExecutionHistory
|
|
750
|
+
runs={runs}
|
|
751
|
+
query={runQuery}
|
|
752
|
+
statusFilter={runStatusFilter}
|
|
753
|
+
filtersOpen={runFiltersOpen}
|
|
754
|
+
loading={status === 'loading'}
|
|
755
|
+
hasMore={runCursor.value !== null}
|
|
756
|
+
selectedRunId={selectedRun?.run.id ?? ''}
|
|
757
|
+
onQuery={setRunQuery}
|
|
758
|
+
onStatusFilter={(value) => {
|
|
759
|
+
setRunStatusFilter(value);
|
|
760
|
+
void refreshRuns(detail?.definition.id, value);
|
|
761
|
+
}}
|
|
762
|
+
onToggleFilters={() => setRunFiltersOpen(!runFiltersOpen)}
|
|
763
|
+
onSelect={(run) => void selectRun(run)}
|
|
764
|
+
onLoadMore={() => void loadMoreRuns()}
|
|
765
|
+
/>
|
|
766
|
+
: null;
|
|
767
|
+
|
|
768
|
+
<>
|
|
769
|
+
@if (!props.canRead) {
|
|
770
|
+
<div class="ui-view">
|
|
771
|
+
<EmptyState icon="shield" title={t('workflows.denied.title')}>{t(
|
|
772
|
+
'workflows.denied.hint',
|
|
773
|
+
)}</EmptyState>
|
|
774
|
+
</div>
|
|
775
|
+
} @else if (editorMode === 'editor' && detail && graph) {
|
|
776
|
+
<>
|
|
777
|
+
<WorkflowEditor
|
|
778
|
+
key={detail.definition.id}
|
|
779
|
+
detail={detail}
|
|
780
|
+
graph={graph}
|
|
781
|
+
name={editorName}
|
|
782
|
+
description={editorDescription}
|
|
783
|
+
selectedNode={selectedNode}
|
|
784
|
+
selectedEdge={selectedEdge}
|
|
785
|
+
connectionSource={connectionSource}
|
|
786
|
+
validation={validation}
|
|
787
|
+
validating={validating}
|
|
788
|
+
selectedRun={selectedRun}
|
|
789
|
+
overlay={selectedRun
|
|
790
|
+
? workflowOverlay(selectedRun.nodes, selectedRun.edges)
|
|
791
|
+
: null}
|
|
792
|
+
agents={agents}
|
|
793
|
+
actions={actions}
|
|
794
|
+
inputText={inputText}
|
|
795
|
+
error={error}
|
|
796
|
+
notice={notice}
|
|
797
|
+
busy={status === 'submitting'}
|
|
798
|
+
saving={saving}
|
|
799
|
+
dirty={dirty}
|
|
800
|
+
history={history}
|
|
801
|
+
canManage={props.canManage && detail.definition.status === 'active'}
|
|
802
|
+
canPublish={props.canPublish && detail.definition.status === 'active'}
|
|
803
|
+
canExecute={props.canExecute}
|
|
804
|
+
canCancel={props.canCancel}
|
|
805
|
+
onBack={() => {
|
|
806
|
+
if (dirty || saving) return;
|
|
807
|
+
setEditorMode('catalog');
|
|
808
|
+
setSelectedRun(null);
|
|
809
|
+
setDetail(null);
|
|
810
|
+
void refresh();
|
|
811
|
+
}}
|
|
812
|
+
onName={(value) => {
|
|
813
|
+
editVersion.value += 1;
|
|
814
|
+
setEditorName(value);
|
|
815
|
+
setDirty(true);
|
|
816
|
+
}}
|
|
817
|
+
onDescription={(value) => {
|
|
818
|
+
editVersion.value += 1;
|
|
819
|
+
setEditorDescription(value);
|
|
820
|
+
setDirty(true);
|
|
821
|
+
}}
|
|
822
|
+
onAddNode={addNode}
|
|
823
|
+
onReplaceGraph={changeGraph}
|
|
824
|
+
onSelectNode={(nodeId) => {
|
|
825
|
+
setSelectedNodeId(nodeId);
|
|
826
|
+
setSelectedEdgeId('');
|
|
827
|
+
}}
|
|
828
|
+
onSelectEdge={(edgeId) => {
|
|
829
|
+
setSelectedEdgeId(edgeId);
|
|
830
|
+
if (edgeId) setSelectedNodeId('');
|
|
831
|
+
}}
|
|
832
|
+
onStartConnection={(nodeId, port) => {
|
|
833
|
+
setConnectionSource({ nodeId, port });
|
|
834
|
+
setNotice('');
|
|
835
|
+
}}
|
|
836
|
+
onFinishConnection={finishConnection}
|
|
837
|
+
onCancelConnection={() => {
|
|
838
|
+
setConnectionSource(null);
|
|
839
|
+
setNotice('');
|
|
840
|
+
}}
|
|
841
|
+
onMoveNode={(nodeId, x, y) => changeGraph(
|
|
842
|
+
moveWorkflowNode(graph, nodeId, x, y),
|
|
843
|
+
)}
|
|
844
|
+
onReplaceNode={(node: WorkflowNodeV1) => changeGraph(
|
|
845
|
+
replaceWorkflowNode(graph, node),
|
|
846
|
+
)}
|
|
847
|
+
onRemoveNode={(nodeId) => {
|
|
848
|
+
changeGraph(removeWorkflowNode(graph, nodeId));
|
|
849
|
+
setSelectedNodeId('');
|
|
850
|
+
}}
|
|
851
|
+
onRemoveEdge={(edgeId) => {
|
|
852
|
+
changeGraph(removeWorkflowEdge(graph, edgeId));
|
|
853
|
+
setSelectedEdgeId('');
|
|
854
|
+
}}
|
|
855
|
+
onDryRun={() => void dryRun()}
|
|
856
|
+
onSimulate={() => void simulate()}
|
|
857
|
+
onRunLive={() => void prepareLiveRun()}
|
|
858
|
+
onPublish={() => void publish()}
|
|
859
|
+
onInput={setInputText}
|
|
860
|
+
onOpenFixtures={() => setFixturesOpen(true)}
|
|
861
|
+
onCloseRun={() => {
|
|
862
|
+
setSelectedRun(null);
|
|
863
|
+
setSelectedNodeId('');
|
|
864
|
+
setSelectedEdgeId('');
|
|
865
|
+
}}
|
|
866
|
+
onCancelRun={() => void cancelRun()}
|
|
867
|
+
onRetryRun={() => void retryRun()}
|
|
868
|
+
/>
|
|
869
|
+
</>
|
|
870
|
+
} @else {
|
|
871
|
+
<div class="ui-view">
|
|
872
|
+
<PageHeader
|
|
873
|
+
eyebrow={t('workflows.page.eyebrow')}
|
|
874
|
+
title={t('workflows.page.title')}
|
|
875
|
+
description={t('workflows.page.description')}
|
|
876
|
+
>
|
|
877
|
+
<Button size="sm" onClick={() => void refresh()}>
|
|
878
|
+
<Icon name="refresh" size={14} />
|
|
879
|
+
{status === 'loading'
|
|
880
|
+
? t('workflows.common.refreshing')
|
|
881
|
+
: t('workflows.action.refresh')}
|
|
882
|
+
</Button>
|
|
883
|
+
@if (props.canManage) {
|
|
884
|
+
<Button
|
|
885
|
+
size="sm"
|
|
886
|
+
variant="primary"
|
|
887
|
+
onClick={() => {
|
|
888
|
+
createSession.value += 1;
|
|
889
|
+
setError('');
|
|
890
|
+
setCreateOpen(true);
|
|
891
|
+
}}
|
|
892
|
+
>
|
|
893
|
+
<Icon name="plus" size={14} />
|
|
894
|
+
{t('workflows.action.new')}
|
|
895
|
+
</Button>
|
|
896
|
+
}
|
|
897
|
+
</PageHeader>
|
|
898
|
+
@if (error && !createOpen) {
|
|
899
|
+
<Alert>{error}</Alert>
|
|
900
|
+
}
|
|
901
|
+
<TableCard
|
|
902
|
+
title={t('workflows.table.title')}
|
|
903
|
+
count={t('workflows.table.count', { count: definitions.length })}
|
|
904
|
+
search={<SearchField
|
|
905
|
+
value={query}
|
|
906
|
+
placeholder={t('workflows.table.searchPlaceholder')}
|
|
907
|
+
label={t('workflows.table.searchLabel')}
|
|
908
|
+
onInput={setQuery}
|
|
909
|
+
/>}
|
|
910
|
+
filters={<Filters
|
|
911
|
+
open={filtersOpen}
|
|
912
|
+
onToggle={() => setFiltersOpen(!filtersOpen)}
|
|
913
|
+
activeCount={statusFilter ? 1 : 0}
|
|
914
|
+
label={t('workflows.common.filters')}
|
|
915
|
+
>
|
|
916
|
+
<label>
|
|
917
|
+
<span class="ui-label">{t('workflows.table.statusFilter')}</span>
|
|
918
|
+
<select
|
|
919
|
+
class="ui-select"
|
|
920
|
+
value={statusFilter}
|
|
921
|
+
onInput={(event) => setStatusFilter(event.currentTarget.value)}
|
|
922
|
+
>
|
|
923
|
+
<option value="">{t('workflows.table.allStatuses')}</option>
|
|
924
|
+
<option value="active">{t('workflows.status.active')}</option>
|
|
925
|
+
<option value="archived">{t(
|
|
926
|
+
'workflows.status.archived',
|
|
927
|
+
)}</option>
|
|
928
|
+
</select>
|
|
929
|
+
</label>
|
|
930
|
+
</Filters>}
|
|
931
|
+
caption={t('workflows.table.caption')}
|
|
932
|
+
columns={definitionColumns()}
|
|
933
|
+
rows={visibleDefinitions}
|
|
934
|
+
rowKey={(record) => record.id}
|
|
935
|
+
status={status === 'loading' && definitions.length === 0
|
|
936
|
+
? 'loading'
|
|
937
|
+
: 'idle'}
|
|
938
|
+
loadingLabel={t('workflows.table.loading')}
|
|
939
|
+
filtered={term !== '' || statusFilter !== ''}
|
|
940
|
+
empty={{
|
|
941
|
+
icon: 'modules',
|
|
942
|
+
title: t('workflows.table.emptyTitle'),
|
|
943
|
+
hint: t('workflows.table.emptyHint'),
|
|
944
|
+
}}
|
|
945
|
+
emptyFiltered={{
|
|
946
|
+
icon: 'search',
|
|
947
|
+
title: t('workflows.table.filteredTitle'),
|
|
948
|
+
hint: t('workflows.table.filteredHint'),
|
|
949
|
+
}}
|
|
950
|
+
actions={props.canManage
|
|
951
|
+
? (record) => [
|
|
952
|
+
{
|
|
953
|
+
id: 'open',
|
|
954
|
+
label: t('workflows.action.open'),
|
|
955
|
+
icon: 'external',
|
|
956
|
+
onSelect: () => void openEditor(record),
|
|
957
|
+
},
|
|
958
|
+
...(record.status === 'active'
|
|
959
|
+
? [
|
|
960
|
+
{
|
|
961
|
+
id: 'archive',
|
|
962
|
+
label: t('workflows.action.archive'),
|
|
963
|
+
onSelect: () => void archive(record),
|
|
964
|
+
},
|
|
965
|
+
]
|
|
966
|
+
: []),
|
|
967
|
+
...(record.publishedRevision === null
|
|
968
|
+
? [
|
|
969
|
+
{
|
|
970
|
+
id: 'delete',
|
|
971
|
+
label: t('workflows.action.delete'),
|
|
972
|
+
icon: 'x' as const,
|
|
973
|
+
tone: 'danger' as const,
|
|
974
|
+
onSelect: () => {
|
|
975
|
+
setLifecycleTarget(record);
|
|
976
|
+
setDeleteConfirmOpen(true);
|
|
977
|
+
},
|
|
978
|
+
},
|
|
979
|
+
]
|
|
980
|
+
: []),
|
|
981
|
+
]
|
|
982
|
+
: (record) => [
|
|
983
|
+
{
|
|
984
|
+
id: 'open',
|
|
985
|
+
label: t('workflows.action.open'),
|
|
986
|
+
icon: 'external',
|
|
987
|
+
onSelect: () => void openEditor(record),
|
|
988
|
+
},
|
|
989
|
+
]}
|
|
990
|
+
actionsLabel={t('workflows.table.actions')}
|
|
991
|
+
actionsWidth="320px"
|
|
992
|
+
/>
|
|
993
|
+
{history}
|
|
994
|
+
</div>
|
|
995
|
+
}
|
|
996
|
+
<Drawer
|
|
997
|
+
open={createOpen}
|
|
998
|
+
title={t('workflows.create.title')}
|
|
999
|
+
subtitle={t('workflows.create.subtitle')}
|
|
1000
|
+
onClose={() => {
|
|
1001
|
+
if (status !== 'submitting') setCreateOpen(false);
|
|
1002
|
+
}}
|
|
1003
|
+
>
|
|
1004
|
+
<WorkflowCreateForm
|
|
1005
|
+
key={'workflow-create-' + createSession.value}
|
|
1006
|
+
busy={status === 'submitting'}
|
|
1007
|
+
error={error}
|
|
1008
|
+
onCancel={() => setCreateOpen(false)}
|
|
1009
|
+
onSubmit={(input) => void create(input)}
|
|
1010
|
+
/>
|
|
1011
|
+
</Drawer>
|
|
1012
|
+
<WorkflowFixtureDrawer
|
|
1013
|
+
open={fixturesOpen}
|
|
1014
|
+
graph={graph}
|
|
1015
|
+
value={fixturesText}
|
|
1016
|
+
onChange={setFixturesText}
|
|
1017
|
+
onClose={() => setFixturesOpen(false)}
|
|
1018
|
+
/>
|
|
1019
|
+
<ConfirmDialog
|
|
1020
|
+
open={liveConfirmOpen}
|
|
1021
|
+
title={t('workflows.liveConfirm.title')}
|
|
1022
|
+
confirmLabel={t('workflows.liveConfirm.confirm')}
|
|
1023
|
+
cancelLabel={t('workflows.common.cancel')}
|
|
1024
|
+
tone="primary"
|
|
1025
|
+
busy={status === 'submitting'}
|
|
1026
|
+
onConfirm={() => void confirmLive()}
|
|
1027
|
+
onCancel={() => setLiveConfirmOpen(false)}
|
|
1028
|
+
>
|
|
1029
|
+
<WorkflowLiveConfirmation
|
|
1030
|
+
graph={detail?.revisions.find(
|
|
1031
|
+
(revision) =>
|
|
1032
|
+
revision.revision === detail.definition.publishedRevision,
|
|
1033
|
+
)?.graph ?? null}
|
|
1034
|
+
report={liveValidation}
|
|
1035
|
+
agents={agents}
|
|
1036
|
+
actions={actions}
|
|
1037
|
+
/>
|
|
1038
|
+
</ConfirmDialog>
|
|
1039
|
+
<ConfirmDialog
|
|
1040
|
+
open={deleteConfirmOpen}
|
|
1041
|
+
title={t('workflows.delete.title')}
|
|
1042
|
+
confirmLabel={t('workflows.delete.confirm')}
|
|
1043
|
+
cancelLabel={t('workflows.common.cancel')}
|
|
1044
|
+
busy={status === 'submitting'}
|
|
1045
|
+
onConfirm={() => void removeDefinition()}
|
|
1046
|
+
onCancel={() => {
|
|
1047
|
+
setDeleteConfirmOpen(false);
|
|
1048
|
+
setLifecycleTarget(null);
|
|
1049
|
+
}}
|
|
1050
|
+
>{t('workflows.delete.description')}</ConfirmDialog>
|
|
1051
|
+
</>
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
function inputFixtures(value: string): string {
|
|
1055
|
+
const parsed = JSON.parse(value) as unknown;
|
|
1056
|
+
if (!Array.isArray(parsed)) throw new Error(t(
|
|
1057
|
+
'workflows.test.fixturesInvalid',
|
|
1058
|
+
));
|
|
1059
|
+
return value;
|
|
1060
|
+
}
|