@open-mercato/core 0.7.1-develop.7193.1.910a5b0a1e → 0.7.1-develop.7194.1.ab4fc81f82
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/.turbo/turbo-build.log +2 -2
- package/AGENTS.md +4 -3
- package/agentic/standalone-guide.md +1 -1
- package/build.mjs +16 -0
- package/dist/generated/entities/action_log/index.js +2 -0
- package/dist/generated/entities/action_log/index.js.map +2 -2
- package/dist/generated/entities/user/index.js +2 -0
- package/dist/generated/entities/user/index.js.map +2 -2
- package/dist/generated/entities/user_task/index.js +14 -0
- package/dist/generated/entities/user_task/index.js.map +2 -2
- package/dist/generated/entities/workflow_definition/index.js +6 -0
- package/dist/generated/entities/workflow_definition/index.js.map +2 -2
- package/dist/generated/entities/workflow_definition_draft/index.js +25 -0
- package/dist/generated/entities/workflow_definition_draft/index.js.map +7 -0
- package/dist/generated/entities/workflow_definition_metric_rollup/index.js +23 -0
- package/dist/generated/entities/workflow_definition_metric_rollup/index.js.map +7 -0
- package/dist/generated/entities/workflow_instance/index.js +4 -0
- package/dist/generated/entities/workflow_instance/index.js.map +2 -2
- package/dist/generated/entities.ids.generated.js +4 -1
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +39 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/helpers/integration/workflowsFixtures.js +477 -2
- package/dist/helpers/integration/workflowsFixtures.js.map +2 -2
- package/dist/helpers/integration/workflowsUi.js +148 -0
- package/dist/helpers/integration/workflowsUi.js.map +7 -0
- package/dist/modules/attachments/lib/createFromBuffer.js +79 -0
- package/dist/modules/attachments/lib/createFromBuffer.js.map +7 -0
- package/dist/modules/audit_logs/data/entities.js +5 -0
- package/dist/modules/audit_logs/data/entities.js.map +2 -2
- package/dist/modules/audit_logs/data/validators.js +1 -0
- package/dist/modules/audit_logs/data/validators.js.map +2 -2
- package/dist/modules/audit_logs/lib/projections.js +2 -1
- package/dist/modules/audit_logs/lib/projections.js.map +2 -2
- package/dist/modules/audit_logs/migrations/Migration20260625120000.js +15 -0
- package/dist/modules/audit_logs/migrations/Migration20260625120000.js.map +7 -0
- package/dist/modules/audit_logs/services/actionLogService.js +3 -0
- package/dist/modules/audit_logs/services/actionLogService.js.map +2 -2
- package/dist/modules/auth/data/entities.js +6 -0
- package/dist/modules/auth/data/entities.js.map +2 -2
- package/dist/modules/auth/lib/executionPrincipal.js +140 -0
- package/dist/modules/auth/lib/executionPrincipal.js.map +7 -0
- package/dist/modules/auth/migrations/Migration20260625050000.js +13 -0
- package/dist/modules/auth/migrations/Migration20260625050000.js.map +7 -0
- package/dist/modules/business_rules/components/InlineRuleEditor.js +154 -0
- package/dist/modules/business_rules/components/InlineRuleEditor.js.map +7 -0
- package/dist/modules/business_rules/data/validators.js +6 -0
- package/dist/modules/business_rules/data/validators.js.map +2 -2
- package/dist/modules/business_rules/lib/rule-engine.js +5 -3
- package/dist/modules/business_rules/lib/rule-engine.js.map +2 -2
- package/dist/modules/catalog/commands/products.js +5 -0
- package/dist/modules/catalog/commands/products.js.map +2 -2
- package/dist/modules/catalog/workflows.js +19 -0
- package/dist/modules/catalog/workflows.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/[id]/page.js +3 -1
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/[id]/page.js.map +2 -2
- package/dist/modules/customer_accounts/cli.js +80 -0
- package/dist/modules/customer_accounts/cli.js.map +7 -0
- package/dist/modules/customer_accounts/lib/customerRoleAclSync.js +59 -0
- package/dist/modules/customer_accounts/lib/customerRoleAclSync.js.map +7 -0
- package/dist/modules/customer_accounts/setup.js +4 -2
- package/dist/modules/customer_accounts/setup.js.map +2 -2
- package/dist/modules/customers/commands/deals.js +4 -0
- package/dist/modules/customers/commands/deals.js.map +2 -2
- package/dist/modules/customers/components/detail/ChangelogEntryRow.js +1 -1
- package/dist/modules/customers/components/detail/ChangelogEntryRow.js.map +2 -2
- package/dist/modules/customers/components/detail/utils.js +2 -0
- package/dist/modules/customers/components/detail/utils.js.map +2 -2
- package/dist/modules/customers/events.js +13 -2
- package/dist/modules/customers/events.js.map +2 -2
- package/dist/modules/customers/lib/link-workflow-task-handler.js +64 -0
- package/dist/modules/customers/lib/link-workflow-task-handler.js.map +7 -0
- package/dist/modules/customers/lib/todoCompatibility.js +1 -1
- package/dist/modules/customers/lib/todoCompatibility.js.map +2 -2
- package/dist/modules/customers/lib/workflowTaskLink.js +9 -0
- package/dist/modules/customers/lib/workflowTaskLink.js.map +7 -0
- package/dist/modules/customers/subscribers/link-workflow-task.js +12 -0
- package/dist/modules/customers/subscribers/link-workflow-task.js.map +7 -0
- package/dist/modules/customers/workflows.js +29 -0
- package/dist/modules/customers/workflows.js.map +7 -0
- package/dist/modules/entities/api/records.js +13 -33
- package/dist/modules/entities/api/records.js.map +3 -3
- package/dist/modules/entities/lib/entityClassification.js +60 -0
- package/dist/modules/entities/lib/entityClassification.js.map +7 -0
- package/dist/modules/sales/commands/documents.js +31 -0
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/events.js +12 -1
- package/dist/modules/sales/events.js.map +2 -2
- package/dist/modules/sales/workflows.js +12 -1
- package/dist/modules/sales/workflows.js.map +2 -2
- package/dist/modules/seeds/cli.js +199 -0
- package/dist/modules/seeds/cli.js.map +7 -0
- package/dist/modules/seeds/examples/sample-seed.json +26 -0
- package/dist/modules/seeds/index.js +12 -0
- package/dist/modules/seeds/index.js.map +7 -0
- package/dist/modules/workflows/acl.js +96 -0
- package/dist/modules/workflows/acl.js.map +2 -2
- package/dist/modules/workflows/ai-agents.js +50 -0
- package/dist/modules/workflows/ai-agents.js.map +7 -0
- package/dist/modules/workflows/ai-tools/authoring-pack.js +582 -0
- package/dist/modules/workflows/ai-tools/authoring-pack.js.map +7 -0
- package/dist/modules/workflows/ai-tools/types.js +43 -0
- package/dist/modules/workflows/ai-tools/types.js.map +7 -0
- package/dist/modules/workflows/ai-tools.js +10 -0
- package/dist/modules/workflows/ai-tools.js.map +7 -0
- package/dist/modules/workflows/api/command-settings/route.js +137 -0
- package/dist/modules/workflows/api/command-settings/route.js.map +7 -0
- package/dist/modules/workflows/api/commands/route.js +72 -0
- package/dist/modules/workflows/api/commands/route.js.map +7 -0
- package/dist/modules/workflows/api/definitions/[id]/callers/route.js +76 -0
- package/dist/modules/workflows/api/definitions/[id]/callers/route.js.map +7 -0
- package/dist/modules/workflows/api/definitions/[id]/context-schema/route.js +134 -0
- package/dist/modules/workflows/api/definitions/[id]/context-schema/route.js.map +7 -0
- package/dist/modules/workflows/api/definitions/[id]/customize/route.js +5 -1
- package/dist/modules/workflows/api/definitions/[id]/customize/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/draft/route.js +286 -0
- package/dist/modules/workflows/api/definitions/[id]/draft/route.js.map +7 -0
- package/dist/modules/workflows/api/definitions/[id]/publish/route.js +207 -0
- package/dist/modules/workflows/api/definitions/[id]/publish/route.js.map +7 -0
- package/dist/modules/workflows/api/definitions/[id]/reset-to-code/route.js +5 -0
- package/dist/modules/workflows/api/definitions/[id]/reset-to-code/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/route.js +93 -9
- package/dist/modules/workflows/api/definitions/[id]/route.js.map +3 -3
- package/dist/modules/workflows/api/definitions/[id]/test-step/route.js +210 -0
- package/dist/modules/workflows/api/definitions/[id]/test-step/route.js.map +7 -0
- package/dist/modules/workflows/api/definitions/generate/route.js +233 -0
- package/dist/modules/workflows/api/definitions/generate/route.js.map +7 -0
- package/dist/modules/workflows/api/definitions/route.js +61 -113
- package/dist/modules/workflows/api/definitions/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/serialize.js +9 -0
- package/dist/modules/workflows/api/definitions/serialize.js.map +2 -2
- package/dist/modules/workflows/api/endpoints/route.js +69 -0
- package/dist/modules/workflows/api/endpoints/route.js.map +7 -0
- package/dist/modules/workflows/api/functions/route.js +73 -0
- package/dist/modules/workflows/api/functions/route.js.map +7 -0
- package/dist/modules/workflows/api/grantable-features/route.js +75 -0
- package/dist/modules/workflows/api/grantable-features/route.js.map +7 -0
- package/dist/modules/workflows/api/instances/[id]/context/route.js +180 -0
- package/dist/modules/workflows/api/instances/[id]/context/route.js.map +7 -0
- package/dist/modules/workflows/api/instances/[id]/rerun-step/route.js +184 -0
- package/dist/modules/workflows/api/instances/[id]/rerun-step/route.js.map +7 -0
- package/dist/modules/workflows/api/instances/[id]/retry/route.js +12 -2
- package/dist/modules/workflows/api/instances/[id]/retry/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/step-through/route.js +148 -0
- package/dist/modules/workflows/api/instances/[id]/step-through/route.js.map +7 -0
- package/dist/modules/workflows/api/instances/[id]/steps/route.js +123 -0
- package/dist/modules/workflows/api/instances/[id]/steps/route.js.map +7 -0
- package/dist/modules/workflows/api/instances/[id]/would-do/route.js +172 -0
- package/dist/modules/workflows/api/instances/[id]/would-do/route.js.map +7 -0
- package/dist/modules/workflows/api/instances/bulk-replay/route.js +117 -0
- package/dist/modules/workflows/api/instances/bulk-replay/route.js.map +7 -0
- package/dist/modules/workflows/api/instances/failure-queue/route.js +165 -0
- package/dist/modules/workflows/api/instances/failure-queue/route.js.map +7 -0
- package/dist/modules/workflows/api/instances/route.js +94 -3
- package/dist/modules/workflows/api/instances/route.js.map +2 -2
- package/dist/modules/workflows/api/metrics/definitions/route.js +188 -0
- package/dist/modules/workflows/api/metrics/definitions/route.js.map +7 -0
- package/dist/modules/workflows/api/openapi.js +415 -4
- package/dist/modules/workflows/api/openapi.js.map +2 -2
- package/dist/modules/workflows/api/portal/tasks/[id]/complete/route.js +132 -0
- package/dist/modules/workflows/api/portal/tasks/[id]/complete/route.js.map +7 -0
- package/dist/modules/workflows/api/portal/tasks/[id]/route.js +97 -0
- package/dist/modules/workflows/api/portal/tasks/[id]/route.js.map +7 -0
- package/dist/modules/workflows/api/portal/tasks/route.js +126 -0
- package/dist/modules/workflows/api/portal/tasks/route.js.map +7 -0
- package/dist/modules/workflows/api/rule-usage/route.js +80 -0
- package/dist/modules/workflows/api/rule-usage/route.js.map +7 -0
- package/dist/modules/workflows/api/task-settings/route.js +107 -0
- package/dist/modules/workflows/api/task-settings/route.js.map +7 -0
- package/dist/modules/workflows/api/tasks/[id]/claim/route.js +27 -16
- package/dist/modules/workflows/api/tasks/[id]/claim/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/complete/route.js +40 -16
- package/dist/modules/workflows/api/tasks/[id]/complete/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/reassign/route.js +150 -0
- package/dist/modules/workflows/api/tasks/[id]/reassign/route.js.map +7 -0
- package/dist/modules/workflows/api/tasks/[id]/route.js +39 -6
- package/dist/modules/workflows/api/tasks/[id]/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/unclaim/route.js +100 -0
- package/dist/modules/workflows/api/tasks/[id]/unclaim/route.js.map +7 -0
- package/dist/modules/workflows/api/tasks/route.js +37 -6
- package/dist/modules/workflows/api/tasks/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/serialize.js +83 -0
- package/dist/modules/workflows/api/tasks/serialize.js.map +7 -0
- package/dist/modules/workflows/api/templates/route.js +69 -0
- package/dist/modules/workflows/api/templates/route.js.map +7 -0
- package/dist/modules/workflows/api/work-inbox/next/route.js +129 -0
- package/dist/modules/workflows/api/work-inbox/next/route.js.map +7 -0
- package/dist/modules/workflows/api/work-inbox/route.js +119 -0
- package/dist/modules/workflows/api/work-inbox/route.js.map +7 -0
- package/dist/modules/workflows/backend/config/workflows/page.js +10 -0
- package/dist/modules/workflows/backend/config/workflows/page.js.map +7 -0
- package/dist/modules/workflows/backend/config/workflows/page.meta.js +35 -0
- package/dist/modules/workflows/backend/config/workflows/page.meta.js.map +7 -0
- package/dist/modules/workflows/backend/definitions/[id]/page.js +6 -271
- package/dist/modules/workflows/backend/definitions/[id]/page.js.map +3 -3
- package/dist/modules/workflows/backend/definitions/create/page.js +7 -56
- package/dist/modules/workflows/backend/definitions/create/page.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/create/page.meta.js +1 -1
- package/dist/modules/workflows/backend/definitions/create/page.meta.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/page.js +131 -51
- package/dist/modules/workflows/backend/definitions/page.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js +2606 -677
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js.map +3 -3
- package/dist/modules/workflows/backend/instances/[id]/page.js +532 -421
- package/dist/modules/workflows/backend/instances/[id]/page.js.map +2 -2
- package/dist/modules/workflows/backend/instances/[id]/page.meta.js +1 -1
- package/dist/modules/workflows/backend/instances/[id]/page.meta.js.map +1 -1
- package/dist/modules/workflows/backend/instances/failure-queue/page.js +211 -0
- package/dist/modules/workflows/backend/instances/failure-queue/page.js.map +7 -0
- package/dist/modules/workflows/backend/instances/failure-queue/page.meta.js +20 -0
- package/dist/modules/workflows/backend/instances/failure-queue/page.meta.js.map +7 -0
- package/dist/modules/workflows/backend/instances/page.js +159 -22
- package/dist/modules/workflows/backend/instances/page.js.map +2 -2
- package/dist/modules/workflows/backend/instances/page.meta.js +1 -1
- package/dist/modules/workflows/backend/instances/page.meta.js.map +1 -1
- package/dist/modules/workflows/backend/tasks/[id]/page.js +553 -392
- package/dist/modules/workflows/backend/tasks/[id]/page.js.map +3 -3
- package/dist/modules/workflows/backend/tasks/page.js +8 -250
- package/dist/modules/workflows/backend/tasks/page.js.map +2 -2
- package/dist/modules/workflows/backend/tasks/page.meta.js +1 -0
- package/dist/modules/workflows/backend/tasks/page.meta.js.map +2 -2
- package/dist/modules/workflows/backend/work-inbox/page.js +399 -0
- package/dist/modules/workflows/backend/work-inbox/page.js.map +7 -0
- package/dist/modules/workflows/backend/work-inbox/page.meta.js +19 -0
- package/dist/modules/workflows/backend/work-inbox/page.meta.js.map +7 -0
- package/dist/modules/workflows/cli.js +1 -1
- package/dist/modules/workflows/cli.js.map +2 -2
- package/dist/modules/workflows/commands/tasks.js +81 -0
- package/dist/modules/workflows/commands/tasks.js.map +7 -0
- package/dist/modules/workflows/components/ActivitiesEditor.js +281 -287
- package/dist/modules/workflows/components/ActivitiesEditor.js.map +2 -2
- package/dist/modules/workflows/components/ActivityEditDialog.js +220 -0
- package/dist/modules/workflows/components/ActivityEditDialog.js.map +7 -0
- package/dist/modules/workflows/components/AgentSelector.js +115 -0
- package/dist/modules/workflows/components/AgentSelector.js.map +7 -0
- package/dist/modules/workflows/components/AnnotationEditDialog.js +110 -0
- package/dist/modules/workflows/components/AnnotationEditDialog.js.map +7 -0
- package/dist/modules/workflows/components/BusinessRuleUsagePanel.js +71 -0
- package/dist/modules/workflows/components/BusinessRuleUsagePanel.js.map +7 -0
- package/dist/modules/workflows/components/BusinessRulesSelector.js +151 -93
- package/dist/modules/workflows/components/BusinessRulesSelector.js.map +2 -2
- package/dist/modules/workflows/components/ConfigJsonTextarea.js +85 -0
- package/dist/modules/workflows/components/ConfigJsonTextarea.js.map +7 -0
- package/dist/modules/workflows/components/ContextSchemaEditor.js +150 -0
- package/dist/modules/workflows/components/ContextSchemaEditor.js.map +7 -0
- package/dist/modules/workflows/components/DefinitionErrorHandlerField.js +102 -0
- package/dist/modules/workflows/components/DefinitionErrorHandlerField.js.map +7 -0
- package/dist/modules/workflows/components/DefinitionMetadataDrawer.js +377 -0
- package/dist/modules/workflows/components/DefinitionMetadataDrawer.js.map +7 -0
- package/dist/modules/workflows/components/DefinitionMetricsCells.js +132 -0
- package/dist/modules/workflows/components/DefinitionMetricsCells.js.map +7 -0
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js +307 -216
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +2 -2
- package/dist/modules/workflows/components/EdgeEditDialog.js +11 -18
- package/dist/modules/workflows/components/EdgeEditDialog.js.map +2 -2
- package/dist/modules/workflows/components/EdgeEditDialogCrudForm.js +112 -72
- package/dist/modules/workflows/components/EdgeEditDialogCrudForm.js.map +2 -2
- package/dist/modules/workflows/components/InputDataPanel.js +128 -0
- package/dist/modules/workflows/components/InputDataPanel.js.map +7 -0
- package/dist/modules/workflows/components/InspectorPanel.js +161 -0
- package/dist/modules/workflows/components/InspectorPanel.js.map +7 -0
- package/dist/modules/workflows/components/NodeEditDialog.js +363 -41
- package/dist/modules/workflows/components/NodeEditDialog.js.map +2 -2
- package/dist/modules/workflows/components/NodeEditDialogCrudForm.js +714 -159
- package/dist/modules/workflows/components/NodeEditDialogCrudForm.js.map +2 -2
- package/dist/modules/workflows/components/StepsEditor.js.map +2 -2
- package/dist/modules/workflows/components/TemplateGalleryDialog.js +148 -0
- package/dist/modules/workflows/components/TemplateGalleryDialog.js.map +7 -0
- package/dist/modules/workflows/components/TransitionsEditor.js +80 -74
- package/dist/modules/workflows/components/TransitionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/TriggersDialog.js +53 -0
- package/dist/modules/workflows/components/TriggersDialog.js.map +7 -0
- package/dist/modules/workflows/components/TriggersEditor.js +331 -0
- package/dist/modules/workflows/components/TriggersEditor.js.map +7 -0
- package/dist/modules/workflows/components/WorkflowAiDraftDialog.js +278 -0
- package/dist/modules/workflows/components/WorkflowAiDraftDialog.js.map +7 -0
- package/dist/modules/workflows/components/WorkflowCodeView.js +173 -0
- package/dist/modules/workflows/components/WorkflowCodeView.js.map +7 -0
- package/dist/modules/workflows/components/WorkflowCommandPalette.js +62 -0
- package/dist/modules/workflows/components/WorkflowCommandPalette.js.map +7 -0
- package/dist/modules/workflows/components/WorkflowCompensationGhostEdge.js +70 -0
- package/dist/modules/workflows/components/WorkflowCompensationGhostEdge.js.map +7 -0
- package/dist/modules/workflows/components/WorkflowDataMappingEdge.js +36 -0
- package/dist/modules/workflows/components/WorkflowDataMappingEdge.js.map +7 -0
- package/dist/modules/workflows/components/WorkflowGraph.js +4 -2
- package/dist/modules/workflows/components/WorkflowGraph.js.map +2 -2
- package/dist/modules/workflows/components/WorkflowGraphImpl.js +324 -86
- package/dist/modules/workflows/components/WorkflowGraphImpl.js.map +3 -3
- package/dist/modules/workflows/components/WorkflowIconPicker.js +109 -0
- package/dist/modules/workflows/components/WorkflowIconPicker.js.map +7 -0
- package/dist/modules/workflows/components/WorkflowLegend.js +45 -29
- package/dist/modules/workflows/components/WorkflowLegend.js.map +2 -2
- package/dist/modules/workflows/components/WorkflowNodeCard.js +221 -22
- package/dist/modules/workflows/components/WorkflowNodeCard.js.map +2 -2
- package/dist/modules/workflows/components/WorkflowRouteChips.js +111 -0
- package/dist/modules/workflows/components/WorkflowRouteChips.js.map +7 -0
- package/dist/modules/workflows/components/WorkflowSelector.js +108 -88
- package/dist/modules/workflows/components/WorkflowSelector.js.map +2 -2
- package/dist/modules/workflows/components/WorkflowTransitionEdge.js +61 -11
- package/dist/modules/workflows/components/WorkflowTransitionEdge.js.map +2 -2
- package/dist/modules/workflows/components/WorkflowTransitionLabel.js +15 -5
- package/dist/modules/workflows/components/WorkflowTransitionLabel.js.map +2 -2
- package/dist/modules/workflows/components/fields/ActivityArrayEditor.js +88 -21
- package/dist/modules/workflows/components/fields/ActivityArrayEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/ActivityConfigFields.js +615 -0
- package/dist/modules/workflows/components/fields/ActivityConfigFields.js.map +7 -0
- package/dist/modules/workflows/components/fields/ActivityTestPanel.js +191 -0
- package/dist/modules/workflows/components/fields/ActivityTestPanel.js.map +7 -0
- package/dist/modules/workflows/components/fields/AgentInvokeConfigField.js +488 -0
- package/dist/modules/workflows/components/fields/AgentInvokeConfigField.js.map +7 -0
- package/dist/modules/workflows/components/fields/AgentReviewOnBreachField.js +61 -0
- package/dist/modules/workflows/components/fields/AgentReviewOnBreachField.js.map +7 -0
- package/dist/modules/workflows/components/fields/BranchingRoutesEditor.js +227 -0
- package/dist/modules/workflows/components/fields/BranchingRoutesEditor.js.map +7 -0
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js +37 -4
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/CommandPicker.js +111 -0
- package/dist/modules/workflows/components/fields/CommandPicker.js.map +7 -0
- package/dist/modules/workflows/components/fields/EndpointPicker.js +235 -0
- package/dist/modules/workflows/components/fields/EndpointPicker.js.map +7 -0
- package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js +2 -2
- package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/FunctionPicker.js +55 -0
- package/dist/modules/workflows/components/fields/FunctionPicker.js.map +7 -0
- package/dist/modules/workflows/components/fields/MappingArrayEditor.js +38 -15
- package/dist/modules/workflows/components/fields/MappingArrayEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/PortFieldArrayEditor.js +206 -0
- package/dist/modules/workflows/components/fields/PortFieldArrayEditor.js.map +7 -0
- package/dist/modules/workflows/components/fields/RolesMultiSelect.js +53 -0
- package/dist/modules/workflows/components/fields/RolesMultiSelect.js.map +7 -0
- package/dist/modules/workflows/components/fields/RouteOrderEditor.js +130 -0
- package/dist/modules/workflows/components/fields/RouteOrderEditor.js.map +7 -0
- package/dist/modules/workflows/components/fields/SchemaBuilderDialog.js +104 -0
- package/dist/modules/workflows/components/fields/SchemaBuilderDialog.js.map +7 -0
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js +2 -2
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/TaskAssignmentField.js +210 -0
- package/dist/modules/workflows/components/fields/TaskAssignmentField.js.map +7 -0
- package/dist/modules/workflows/components/fields/TaskDeadlineFields.js +126 -0
- package/dist/modules/workflows/components/fields/TaskDeadlineFields.js.map +7 -0
- package/dist/modules/workflows/components/fields/TaskDecisionsField.js +218 -0
- package/dist/modules/workflows/components/fields/TaskDecisionsField.js.map +7 -0
- package/dist/modules/workflows/components/fields/TaskEntityBindingsField.js +114 -0
- package/dist/modules/workflows/components/fields/TaskEntityBindingsField.js.map +7 -0
- package/dist/modules/workflows/components/fields/TemplateTextControl.js +64 -0
- package/dist/modules/workflows/components/fields/TemplateTextControl.js.map +7 -0
- package/dist/modules/workflows/components/fields/VariablePickerButton.js +121 -0
- package/dist/modules/workflows/components/fields/VariablePickerButton.js.map +7 -0
- package/dist/modules/workflows/components/fields/ledgerDropTarget.js +35 -0
- package/dist/modules/workflows/components/fields/ledgerDropTarget.js.map +7 -0
- package/dist/modules/workflows/components/fields/useActivityTypeOptions.js +16 -0
- package/dist/modules/workflows/components/fields/useActivityTypeOptions.js.map +7 -0
- package/dist/modules/workflows/components/formConfig.js +39 -10
- package/dist/modules/workflows/components/formConfig.js.map +2 -2
- package/dist/modules/workflows/components/mobile/MobileDefinitionDetail.js.map +2 -2
- package/dist/modules/workflows/components/mobile/MobileMetadataSheet.js.map +2 -2
- package/dist/modules/workflows/components/mobile/MobileTaskForm.js +29 -2
- package/dist/modules/workflows/components/mobile/MobileTaskForm.js.map +2 -2
- package/dist/modules/workflows/components/mobile/MobileVisualEditor.js +64 -65
- package/dist/modules/workflows/components/mobile/MobileVisualEditor.js.map +2 -2
- package/dist/modules/workflows/components/nodes/AnnotationGroupNode.js +64 -0
- package/dist/modules/workflows/components/nodes/AnnotationGroupNode.js.map +7 -0
- package/dist/modules/workflows/components/nodes/AutomatedNode.js +24 -16
- package/dist/modules/workflows/components/nodes/AutomatedNode.js.map +2 -2
- package/dist/modules/workflows/components/nodes/EndNode.js +13 -12
- package/dist/modules/workflows/components/nodes/EndNode.js.map +2 -2
- package/dist/modules/workflows/components/nodes/ErrorOutputHandle.js +29 -0
- package/dist/modules/workflows/components/nodes/ErrorOutputHandle.js.map +7 -0
- package/dist/modules/workflows/components/nodes/IfElseNode.js +51 -0
- package/dist/modules/workflows/components/nodes/IfElseNode.js.map +7 -0
- package/dist/modules/workflows/components/nodes/InvokeAgentNode.js +122 -0
- package/dist/modules/workflows/components/nodes/InvokeAgentNode.js.map +7 -0
- package/dist/modules/workflows/components/nodes/NodeOutcomeRows.js +100 -0
- package/dist/modules/workflows/components/nodes/NodeOutcomeRows.js.map +7 -0
- package/dist/modules/workflows/components/nodes/ParallelForkNode.js +18 -14
- package/dist/modules/workflows/components/nodes/ParallelForkNode.js.map +2 -2
- package/dist/modules/workflows/components/nodes/ParallelJoinNode.js +18 -14
- package/dist/modules/workflows/components/nodes/ParallelJoinNode.js.map +2 -2
- package/dist/modules/workflows/components/nodes/StartNode.js +66 -15
- package/dist/modules/workflows/components/nodes/StartNode.js.map +2 -2
- package/dist/modules/workflows/components/nodes/StickyNoteNode.js +54 -0
- package/dist/modules/workflows/components/nodes/StickyNoteNode.js.map +7 -0
- package/dist/modules/workflows/components/nodes/SubWorkflowNode.js +107 -41
- package/dist/modules/workflows/components/nodes/SubWorkflowNode.js.map +2 -2
- package/dist/modules/workflows/components/nodes/SwitchNode.js +51 -0
- package/dist/modules/workflows/components/nodes/SwitchNode.js.map +7 -0
- package/dist/modules/workflows/components/nodes/TriggerCap.js +65 -0
- package/dist/modules/workflows/components/nodes/TriggerCap.js.map +7 -0
- package/dist/modules/workflows/components/nodes/TriggerNode.js +111 -0
- package/dist/modules/workflows/components/nodes/TriggerNode.js.map +7 -0
- package/dist/modules/workflows/components/nodes/UserTaskNode.js +43 -17
- package/dist/modules/workflows/components/nodes/UserTaskNode.js.map +2 -2
- package/dist/modules/workflows/components/nodes/WaitForConditionNode.js +53 -0
- package/dist/modules/workflows/components/nodes/WaitForConditionNode.js.map +7 -0
- package/dist/modules/workflows/components/nodes/WaitForSignalNode.js +21 -15
- package/dist/modules/workflows/components/nodes/WaitForSignalNode.js.map +2 -2
- package/dist/modules/workflows/components/nodes/WaitForTimerNode.js +21 -15
- package/dist/modules/workflows/components/nodes/WaitForTimerNode.js.map +2 -2
- package/dist/modules/workflows/components/nodes/index.js +14 -0
- package/dist/modules/workflows/components/nodes/index.js.map +2 -2
- package/dist/modules/workflows/components/portal/PortalTaskForm.js +196 -0
- package/dist/modules/workflows/components/portal/PortalTaskForm.js.map +7 -0
- package/dist/modules/workflows/components/run/AgentActivityPanel.js +22 -0
- package/dist/modules/workflows/components/run/AgentActivityPanel.js.map +7 -0
- package/dist/modules/workflows/components/run/RerunStepDialog.js +106 -0
- package/dist/modules/workflows/components/run/RerunStepDialog.js.map +7 -0
- package/dist/modules/workflows/components/run/RunEventBadge.js +30 -0
- package/dist/modules/workflows/components/run/RunEventBadge.js.map +7 -0
- package/dist/modules/workflows/components/run/RunGantt.js +130 -0
- package/dist/modules/workflows/components/run/RunGantt.js.map +7 -0
- package/dist/modules/workflows/components/run/RunStatusBadge.js +82 -0
- package/dist/modules/workflows/components/run/RunStatusBadge.js.map +7 -0
- package/dist/modules/workflows/components/run/RunStepInspector.js +116 -0
- package/dist/modules/workflows/components/run/RunStepInspector.js.map +7 -0
- package/dist/modules/workflows/components/run/WouldDoReport.js +52 -0
- package/dist/modules/workflows/components/run/WouldDoReport.js.map +7 -0
- package/dist/modules/workflows/components/run/useAgentLabels.js +28 -0
- package/dist/modules/workflows/components/run/useAgentLabels.js.map +7 -0
- package/dist/modules/workflows/components/run/useLastRunOverlay.js +89 -0
- package/dist/modules/workflows/components/run/useLastRunOverlay.js.map +7 -0
- package/dist/modules/workflows/components/run/useLiveAgentActions.js +41 -0
- package/dist/modules/workflows/components/run/useLiveAgentActions.js.map +7 -0
- package/dist/modules/workflows/components/run/useLiveRunUpdates.js +57 -0
- package/dist/modules/workflows/components/run/useLiveRunUpdates.js.map +7 -0
- package/dist/modules/workflows/components/settings/CommandSettingsPageClient.js +156 -0
- package/dist/modules/workflows/components/settings/CommandSettingsPageClient.js.map +7 -0
- package/dist/modules/workflows/components/work-inbox/EntityContextPanel.js +72 -0
- package/dist/modules/workflows/components/work-inbox/EntityContextPanel.js.map +7 -0
- package/dist/modules/workflows/components/work-inbox/ReassignTaskDialog.js +156 -0
- package/dist/modules/workflows/components/work-inbox/ReassignTaskDialog.js.map +7 -0
- package/dist/modules/workflows/components/work-inbox/StatusChip.js +46 -0
- package/dist/modules/workflows/components/work-inbox/StatusChip.js.map +7 -0
- package/dist/modules/workflows/components/work-inbox/TaskActionNotice.js +53 -0
- package/dist/modules/workflows/components/work-inbox/TaskActionNotice.js.map +7 -0
- package/dist/modules/workflows/components/work-inbox/TaskFormFields.js +261 -0
- package/dist/modules/workflows/components/work-inbox/TaskFormFields.js.map +7 -0
- package/dist/modules/workflows/components/work-inbox/WorkInboxEmptyState.js +27 -0
- package/dist/modules/workflows/components/work-inbox/WorkInboxEmptyState.js.map +7 -0
- package/dist/modules/workflows/data/activity-config-schemas.js +191 -0
- package/dist/modules/workflows/data/activity-config-schemas.js.map +7 -0
- package/dist/modules/workflows/data/activity-config-warnings.js +42 -0
- package/dist/modules/workflows/data/activity-config-warnings.js.map +7 -0
- package/dist/modules/workflows/data/branching-route-warnings.js +65 -0
- package/dist/modules/workflows/data/branching-route-warnings.js.map +7 -0
- package/dist/modules/workflows/data/entities.js +144 -4
- package/dist/modules/workflows/data/entities.js.map +2 -2
- package/dist/modules/workflows/data/metrics-validators.js +35 -0
- package/dist/modules/workflows/data/metrics-validators.js.map +7 -0
- package/dist/modules/workflows/data/task-primitives.js +14 -0
- package/dist/modules/workflows/data/task-primitives.js.map +7 -0
- package/dist/modules/workflows/data/validators.js +504 -61
- package/dist/modules/workflows/data/validators.js.map +3 -3
- package/dist/modules/workflows/di.js +16 -1
- package/dist/modules/workflows/di.js.map +2 -2
- package/dist/modules/workflows/events.js +66 -8
- package/dist/modules/workflows/events.js.map +2 -2
- package/dist/modules/workflows/examples/oze-residential-install-60-nodes.json +1545 -0
- package/dist/modules/workflows/examples/sales-pipeline-definition.json +35 -35
- package/dist/modules/workflows/examples/templates/lead-to-install.json +160 -0
- package/dist/modules/workflows/examples/templates/order-approval.json +230 -0
- package/dist/modules/workflows/examples/templates/task-escalation.json +110 -0
- package/dist/modules/workflows/examples/templates/webhook-integration.json +113 -0
- package/dist/modules/workflows/extension-points.js +1 -1
- package/dist/modules/workflows/extension-points.js.map +2 -2
- package/dist/modules/workflows/frontend/[orgSlug]/portal/tasks/[id]/page.js +144 -0
- package/dist/modules/workflows/frontend/[orgSlug]/portal/tasks/[id]/page.js.map +7 -0
- package/dist/modules/workflows/frontend/[orgSlug]/portal/tasks/[id]/page.meta.js +12 -0
- package/dist/modules/workflows/frontend/[orgSlug]/portal/tasks/[id]/page.meta.js.map +7 -0
- package/dist/modules/workflows/frontend/[orgSlug]/portal/tasks/page.js +114 -0
- package/dist/modules/workflows/frontend/[orgSlug]/portal/tasks/page.js.map +7 -0
- package/dist/modules/workflows/frontend/[orgSlug]/portal/tasks/page.meta.js +18 -0
- package/dist/modules/workflows/frontend/[orgSlug]/portal/tasks/page.meta.js.map +7 -0
- package/dist/modules/workflows/lib/activity-executor.js +505 -137
- package/dist/modules/workflows/lib/activity-executor.js.map +3 -3
- package/dist/modules/workflows/lib/activity-queue-types.js +3 -1
- package/dist/modules/workflows/lib/activity-queue-types.js.map +2 -2
- package/dist/modules/workflows/lib/activity-registry-bootstrap.js +2 -0
- package/dist/modules/workflows/lib/activity-registry-bootstrap.js.map +7 -0
- package/dist/modules/workflows/lib/activity-registry.js +27 -0
- package/dist/modules/workflows/lib/activity-registry.js.map +7 -0
- package/dist/modules/workflows/lib/activity-types.js +291 -0
- package/dist/modules/workflows/lib/activity-types.js.map +7 -0
- package/dist/modules/workflows/lib/activity-worker-handler.js +456 -32
- package/dist/modules/workflows/lib/activity-worker-handler.js.map +3 -3
- package/dist/modules/workflows/lib/advanced-config.js +31 -0
- package/dist/modules/workflows/lib/advanced-config.js.map +7 -0
- package/dist/modules/workflows/lib/agent-disposition-task.js +198 -0
- package/dist/modules/workflows/lib/agent-disposition-task.js.map +7 -0
- package/dist/modules/workflows/lib/agent-outcome-paths.js +82 -0
- package/dist/modules/workflows/lib/agent-outcome-paths.js.map +7 -0
- package/dist/modules/workflows/lib/agent-result-mapping.js +54 -0
- package/dist/modules/workflows/lib/agent-result-mapping.js.map +7 -0
- package/dist/modules/workflows/lib/agent-review-inspector.js +61 -0
- package/dist/modules/workflows/lib/agent-review-inspector.js.map +7 -0
- package/dist/modules/workflows/lib/agent-review.js +66 -0
- package/dist/modules/workflows/lib/agent-review.js.map +7 -0
- package/dist/modules/workflows/lib/ai-authoring.js +155 -0
- package/dist/modules/workflows/lib/ai-authoring.js.map +7 -0
- package/dist/modules/workflows/lib/ai-draft-runner.js +43 -0
- package/dist/modules/workflows/lib/ai-draft-runner.js.map +7 -0
- package/dist/modules/workflows/lib/annotation-events.js +10 -0
- package/dist/modules/workflows/lib/annotation-events.js.map +7 -0
- package/dist/modules/workflows/lib/branching-routes.js +182 -0
- package/dist/modules/workflows/lib/branching-routes.js.map +7 -0
- package/dist/modules/workflows/lib/breach-routing.js +50 -0
- package/dist/modules/workflows/lib/breach-routing.js.map +7 -0
- package/dist/modules/workflows/lib/bulk-replay.js +101 -0
- package/dist/modules/workflows/lib/bulk-replay.js.map +7 -0
- package/dist/modules/workflows/lib/business-rule-usage.js +91 -0
- package/dist/modules/workflows/lib/business-rule-usage.js.map +7 -0
- package/dist/modules/workflows/lib/caller-graph.js +53 -0
- package/dist/modules/workflows/lib/caller-graph.js.map +7 -0
- package/dist/modules/workflows/lib/code-view-apply.js +86 -0
- package/dist/modules/workflows/lib/code-view-apply.js.map +7 -0
- package/dist/modules/workflows/lib/collect-validation-issues.js +164 -0
- package/dist/modules/workflows/lib/collect-validation-issues.js.map +7 -0
- package/dist/modules/workflows/lib/compensation-ghosts.js +72 -0
- package/dist/modules/workflows/lib/compensation-ghosts.js.map +7 -0
- package/dist/modules/workflows/lib/component-guard.js +7 -0
- package/dist/modules/workflows/lib/component-guard.js.map +7 -0
- package/dist/modules/workflows/lib/condition-handler.js +443 -0
- package/dist/modules/workflows/lib/condition-handler.js.map +7 -0
- package/dist/modules/workflows/lib/context-ledger.js +448 -0
- package/dist/modules/workflows/lib/context-ledger.js.map +7 -0
- package/dist/modules/workflows/lib/crud-form-dialogs-flag.js +8 -0
- package/dist/modules/workflows/lib/crud-form-dialogs-flag.js.map +7 -0
- package/dist/modules/workflows/lib/data-edge-mapping.js +63 -0
- package/dist/modules/workflows/lib/data-edge-mapping.js.map +7 -0
- package/dist/modules/workflows/lib/definition-context-schema.js +56 -0
- package/dist/modules/workflows/lib/definition-context-schema.js.map +7 -0
- package/dist/modules/workflows/lib/definition-edit-safety.js +123 -0
- package/dist/modules/workflows/lib/definition-edit-safety.js.map +7 -0
- package/dist/modules/workflows/lib/definition-error-body.js +33 -0
- package/dist/modules/workflows/lib/definition-error-body.js.map +7 -0
- package/dist/modules/workflows/lib/definition-evaluation.js +79 -0
- package/dist/modules/workflows/lib/definition-evaluation.js.map +7 -0
- package/dist/modules/workflows/lib/definition-grant.js +90 -0
- package/dist/modules/workflows/lib/definition-grant.js.map +7 -0
- package/dist/modules/workflows/lib/definition-json-locations.js +139 -0
- package/dist/modules/workflows/lib/definition-json-locations.js.map +7 -0
- package/dist/modules/workflows/lib/definition-payload.js +31 -0
- package/dist/modules/workflows/lib/definition-payload.js.map +7 -0
- package/dist/modules/workflows/lib/draft-restore.js +49 -0
- package/dist/modules/workflows/lib/draft-restore.js.map +7 -0
- package/dist/modules/workflows/lib/dry-run.js +106 -0
- package/dist/modules/workflows/lib/dry-run.js.map +7 -0
- package/dist/modules/workflows/lib/duration.js +66 -17
- package/dist/modules/workflows/lib/duration.js.map +2 -2
- package/dist/modules/workflows/lib/edge-reattachment.js +79 -0
- package/dist/modules/workflows/lib/edge-reattachment.js.map +7 -0
- package/dist/modules/workflows/lib/edgeFormTransforms.js +7 -11
- package/dist/modules/workflows/lib/edgeFormTransforms.js.map +2 -2
- package/dist/modules/workflows/lib/editor-annotations.js +195 -0
- package/dist/modules/workflows/lib/editor-annotations.js.map +7 -0
- package/dist/modules/workflows/lib/editor-commands.js +103 -0
- package/dist/modules/workflows/lib/editor-commands.js.map +7 -0
- package/dist/modules/workflows/lib/editor-history.js +51 -0
- package/dist/modules/workflows/lib/editor-history.js.map +7 -0
- package/dist/modules/workflows/lib/endpoint-catalog.js +181 -0
- package/dist/modules/workflows/lib/endpoint-catalog.js.map +7 -0
- package/dist/modules/workflows/lib/endpoint-path.js +90 -0
- package/dist/modules/workflows/lib/endpoint-path.js.map +7 -0
- package/dist/modules/workflows/lib/engine-version.js +42 -0
- package/dist/modules/workflows/lib/engine-version.js.map +7 -0
- package/dist/modules/workflows/lib/error-handler.js +132 -0
- package/dist/modules/workflows/lib/error-handler.js.map +7 -0
- package/dist/modules/workflows/lib/error-routing.js +104 -0
- package/dist/modules/workflows/lib/error-routing.js.map +7 -0
- package/dist/modules/workflows/lib/event-logger.js +23 -0
- package/dist/modules/workflows/lib/event-logger.js.map +2 -2
- package/dist/modules/workflows/lib/expression-refs.js +168 -0
- package/dist/modules/workflows/lib/expression-refs.js.map +7 -0
- package/dist/modules/workflows/lib/failure-grouping.js +62 -0
- package/dist/modules/workflows/lib/failure-grouping.js.map +7 -0
- package/dist/modules/workflows/lib/find-definition.js +1 -0
- package/dist/modules/workflows/lib/find-definition.js.map +2 -2
- package/dist/modules/workflows/lib/flow-logic-warnings.js +338 -0
- package/dist/modules/workflows/lib/flow-logic-warnings.js.map +7 -0
- package/dist/modules/workflows/lib/graph-utils.js +328 -77
- package/dist/modules/workflows/lib/graph-utils.js.map +2 -2
- package/dist/modules/workflows/lib/icon-search.js +32 -0
- package/dist/modules/workflows/lib/icon-search.js.map +7 -0
- package/dist/modules/workflows/lib/insert-at-cursor.js +26 -0
- package/dist/modules/workflows/lib/insert-at-cursor.js.map +7 -0
- package/dist/modules/workflows/lib/instance-date-filter.js +28 -0
- package/dist/modules/workflows/lib/instance-date-filter.js.map +7 -0
- package/dist/modules/workflows/lib/interpolation-pipeline.js +271 -0
- package/dist/modules/workflows/lib/interpolation-pipeline.js.map +7 -0
- package/dist/modules/workflows/lib/ledger-drag.js +28 -0
- package/dist/modules/workflows/lib/ledger-drag.js.map +7 -0
- package/dist/modules/workflows/lib/ledger-entry-display.js +66 -0
- package/dist/modules/workflows/lib/ledger-entry-display.js.map +7 -0
- package/dist/modules/workflows/lib/ledger-schema-flatten.js +82 -0
- package/dist/modules/workflows/lib/ledger-schema-flatten.js.map +7 -0
- package/dist/modules/workflows/lib/metrics/definition-metrics.js +110 -0
- package/dist/modules/workflows/lib/metrics/definition-metrics.js.map +7 -0
- package/dist/modules/workflows/lib/metrics/metrics-display.js +26 -0
- package/dist/modules/workflows/lib/metrics/metrics-display.js.map +7 -0
- package/dist/modules/workflows/lib/metrics/rollup-schedule.js +7 -0
- package/dist/modules/workflows/lib/metrics/rollup-schedule.js.map +7 -0
- package/dist/modules/workflows/lib/metrics/rollup-service.js +160 -0
- package/dist/modules/workflows/lib/metrics/rollup-service.js.map +7 -0
- package/dist/modules/workflows/lib/node-config-summary.js +128 -0
- package/dist/modules/workflows/lib/node-config-summary.js.map +7 -0
- package/dist/modules/workflows/lib/node-geometry.js +53 -0
- package/dist/modules/workflows/lib/node-geometry.js.map +7 -0
- package/dist/modules/workflows/lib/node-nudge.js +44 -0
- package/dist/modules/workflows/lib/node-nudge.js.map +7 -0
- package/dist/modules/workflows/lib/node-outcome-rows.js +88 -0
- package/dist/modules/workflows/lib/node-outcome-rows.js.map +7 -0
- package/dist/modules/workflows/lib/node-placement.js +55 -0
- package/dist/modules/workflows/lib/node-placement.js.map +7 -0
- package/dist/modules/workflows/lib/node-type-icons.js +54 -13
- package/dist/modules/workflows/lib/node-type-icons.js.map +2 -2
- package/dist/modules/workflows/lib/nodeFormTransforms.js +329 -19
- package/dist/modules/workflows/lib/nodeFormTransforms.js.map +2 -2
- package/dist/modules/workflows/lib/outcome-routing.js +158 -0
- package/dist/modules/workflows/lib/outcome-routing.js.map +7 -0
- package/dist/modules/workflows/lib/owned-definition.js +107 -0
- package/dist/modules/workflows/lib/owned-definition.js.map +7 -0
- package/dist/modules/workflows/lib/owned-node-changes.js +10 -0
- package/dist/modules/workflows/lib/owned-node-changes.js.map +7 -0
- package/dist/modules/workflows/lib/palette-drag.js +36 -0
- package/dist/modules/workflows/lib/palette-drag.js.map +7 -0
- package/dist/modules/workflows/lib/palette-drop.js +45 -0
- package/dist/modules/workflows/lib/palette-drop.js.map +7 -0
- package/dist/modules/workflows/lib/parallel-handler.js +57 -2
- package/dist/modules/workflows/lib/parallel-handler.js.map +2 -2
- package/dist/modules/workflows/lib/port-contract.js +54 -0
- package/dist/modules/workflows/lib/port-contract.js.map +7 -0
- package/dist/modules/workflows/lib/portal-task-access.js +89 -0
- package/dist/modules/workflows/lib/portal-task-access.js.map +7 -0
- package/dist/modules/workflows/lib/rerun-from-step.js +65 -0
- package/dist/modules/workflows/lib/rerun-from-step.js.map +7 -0
- package/dist/modules/workflows/lib/route-chip-events.js +23 -0
- package/dist/modules/workflows/lib/route-chip-events.js.map +7 -0
- package/dist/modules/workflows/lib/route-chips.js +91 -0
- package/dist/modules/workflows/lib/route-chips.js.map +7 -0
- package/dist/modules/workflows/lib/route-edge.js +17 -0
- package/dist/modules/workflows/lib/route-edge.js.map +7 -0
- package/dist/modules/workflows/lib/route-kinds.js +67 -0
- package/dist/modules/workflows/lib/route-kinds.js.map +7 -0
- package/dist/modules/workflows/lib/route-priority.js +104 -0
- package/dist/modules/workflows/lib/route-priority.js.map +7 -0
- package/dist/modules/workflows/lib/run-duration.js +44 -0
- package/dist/modules/workflows/lib/run-duration.js.map +7 -0
- package/dist/modules/workflows/lib/run-event-tone.js +25 -0
- package/dist/modules/workflows/lib/run-event-tone.js.map +7 -0
- package/dist/modules/workflows/lib/run-execution.js +305 -0
- package/dist/modules/workflows/lib/run-execution.js.map +7 -0
- package/dist/modules/workflows/lib/run-gantt.js +180 -0
- package/dist/modules/workflows/lib/run-gantt.js.map +7 -0
- package/dist/modules/workflows/lib/run-outcome-evidence.js +33 -0
- package/dist/modules/workflows/lib/run-outcome-evidence.js.map +7 -0
- package/dist/modules/workflows/lib/run-outcome.js +48 -0
- package/dist/modules/workflows/lib/run-outcome.js.map +7 -0
- package/dist/modules/workflows/lib/sample-resolver.js +71 -0
- package/dist/modules/workflows/lib/sample-resolver.js.map +7 -0
- package/dist/modules/workflows/lib/seeds.js +1 -1
- package/dist/modules/workflows/lib/seeds.js.map +2 -2
- package/dist/modules/workflows/lib/server-output-contract.js +65 -0
- package/dist/modules/workflows/lib/server-output-contract.js.map +7 -0
- package/dist/modules/workflows/lib/set-variable.js +47 -0
- package/dist/modules/workflows/lib/set-variable.js.map +7 -0
- package/dist/modules/workflows/lib/signal-handler.js +63 -4
- package/dist/modules/workflows/lib/signal-handler.js.map +2 -2
- package/dist/modules/workflows/lib/start-fixtures.js +42 -0
- package/dist/modules/workflows/lib/start-fixtures.js.map +7 -0
- package/dist/modules/workflows/lib/status-colors.js +153 -22
- package/dist/modules/workflows/lib/status-colors.js.map +2 -2
- package/dist/modules/workflows/lib/step-handler.js +529 -53
- package/dist/modules/workflows/lib/step-handler.js.map +3 -3
- package/dist/modules/workflows/lib/step-presentation.js +147 -0
- package/dist/modules/workflows/lib/step-presentation.js.map +7 -0
- package/dist/modules/workflows/lib/step-through.js +26 -0
- package/dist/modules/workflows/lib/step-through.js.map +7 -0
- package/dist/modules/workflows/lib/step-type-conversion.js +167 -0
- package/dist/modules/workflows/lib/step-type-conversion.js.map +7 -0
- package/dist/modules/workflows/lib/subgraph-clipboard.js +114 -0
- package/dist/modules/workflows/lib/subgraph-clipboard.js.map +7 -0
- package/dist/modules/workflows/lib/task-decision-context.js +38 -0
- package/dist/modules/workflows/lib/task-decision-context.js.map +7 -0
- package/dist/modules/workflows/lib/task-decisions.js +49 -0
- package/dist/modules/workflows/lib/task-decisions.js.map +7 -0
- package/dist/modules/workflows/lib/task-entity-access.js +62 -0
- package/dist/modules/workflows/lib/task-entity-access.js.map +7 -0
- package/dist/modules/workflows/lib/task-entity-aliases.js +39 -0
- package/dist/modules/workflows/lib/task-entity-aliases.js.map +7 -0
- package/dist/modules/workflows/lib/task-entity-types.js +36 -0
- package/dist/modules/workflows/lib/task-entity-types.js.map +7 -0
- package/dist/modules/workflows/lib/task-form-registry.js +33 -0
- package/dist/modules/workflows/lib/task-form-registry.js.map +7 -0
- package/dist/modules/workflows/lib/task-form-schema.js +75 -0
- package/dist/modules/workflows/lib/task-form-schema.js.map +7 -0
- package/dist/modules/workflows/lib/task-handler.js +251 -32
- package/dist/modules/workflows/lib/task-handler.js.map +2 -2
- package/dist/modules/workflows/lib/task-inspector-config.js +182 -0
- package/dist/modules/workflows/lib/task-inspector-config.js.map +7 -0
- package/dist/modules/workflows/lib/task-list-query.js +19 -0
- package/dist/modules/workflows/lib/task-list-query.js.map +7 -0
- package/dist/modules/workflows/lib/task-notifications.js +119 -0
- package/dist/modules/workflows/lib/task-notifications.js.map +7 -0
- package/dist/modules/workflows/lib/task-permission-settings.js +43 -0
- package/dist/modules/workflows/lib/task-permission-settings.js.map +7 -0
- package/dist/modules/workflows/lib/task-presets.js +35 -0
- package/dist/modules/workflows/lib/task-presets.js.map +7 -0
- package/dist/modules/workflows/lib/task-quick-action.js +45 -0
- package/dist/modules/workflows/lib/task-quick-action.js.map +7 -0
- package/dist/modules/workflows/lib/task-resolution.js +120 -0
- package/dist/modules/workflows/lib/task-resolution.js.map +7 -0
- package/dist/modules/workflows/lib/task-sla.js +357 -0
- package/dist/modules/workflows/lib/task-sla.js.map +7 -0
- package/dist/modules/workflows/lib/task-visibility-request.js +266 -0
- package/dist/modules/workflows/lib/task-visibility-request.js.map +7 -0
- package/dist/modules/workflows/lib/task-visibility.js +194 -0
- package/dist/modules/workflows/lib/task-visibility.js.map +7 -0
- package/dist/modules/workflows/lib/timer-handler.js +3 -1
- package/dist/modules/workflows/lib/timer-handler.js.map +2 -2
- package/dist/modules/workflows/lib/transition-handler.js +148 -20
- package/dist/modules/workflows/lib/transition-handler.js.map +2 -2
- package/dist/modules/workflows/lib/trigger-node.js +121 -0
- package/dist/modules/workflows/lib/trigger-node.js.map +7 -0
- package/dist/modules/workflows/lib/visual-editor-navigation.js +14 -0
- package/dist/modules/workflows/lib/visual-editor-navigation.js.map +7 -0
- package/dist/modules/workflows/lib/work-inbox/empty-state.js +52 -0
- package/dist/modules/workflows/lib/work-inbox/empty-state.js.map +7 -0
- package/dist/modules/workflows/lib/work-inbox/entity-links.js +63 -0
- package/dist/modules/workflows/lib/work-inbox/entity-links.js.map +7 -0
- package/dist/modules/workflows/lib/work-inbox/navigation.js +11 -0
- package/dist/modules/workflows/lib/work-inbox/navigation.js.map +7 -0
- package/dist/modules/workflows/lib/work-inbox/presentation.js +90 -0
- package/dist/modules/workflows/lib/work-inbox/presentation.js.map +7 -0
- package/dist/modules/workflows/lib/work-inbox/provider.js +118 -0
- package/dist/modules/workflows/lib/work-inbox/provider.js.map +7 -0
- package/dist/modules/workflows/lib/work-inbox/query.js +70 -0
- package/dist/modules/workflows/lib/work-inbox/query.js.map +7 -0
- package/dist/modules/workflows/lib/work-inbox/service.js +56 -0
- package/dist/modules/workflows/lib/work-inbox/service.js.map +7 -0
- package/dist/modules/workflows/lib/work-inbox/user-task-source.js +149 -0
- package/dist/modules/workflows/lib/work-inbox/user-task-source.js.map +7 -0
- package/dist/modules/workflows/lib/workflow-command-enablement.js +57 -0
- package/dist/modules/workflows/lib/workflow-command-enablement.js.map +7 -0
- package/dist/modules/workflows/lib/workflow-command-settings.js +54 -0
- package/dist/modules/workflows/lib/workflow-command-settings.js.map +7 -0
- package/dist/modules/workflows/lib/workflow-executor.js +658 -6
- package/dist/modules/workflows/lib/workflow-executor.js.map +2 -2
- package/dist/modules/workflows/lib/workflow-function-registry.js +40 -0
- package/dist/modules/workflows/lib/workflow-function-registry.js.map +7 -0
- package/dist/modules/workflows/lib/workflow-safe-commands.js +11 -1
- package/dist/modules/workflows/lib/workflow-safe-commands.js.map +2 -2
- package/dist/modules/workflows/lib/workflow-templates.js +69 -0
- package/dist/modules/workflows/lib/workflow-templates.js.map +7 -0
- package/dist/modules/workflows/migrations/Migration20260626214855_workflows.js +15 -0
- package/dist/modules/workflows/migrations/Migration20260626214855_workflows.js.map +7 -0
- package/dist/modules/workflows/migrations/Migration20260626222424_workflows.js +17 -0
- package/dist/modules/workflows/migrations/Migration20260626222424_workflows.js.map +7 -0
- package/dist/modules/workflows/migrations/Migration20260727074335_workflows.js +15 -0
- package/dist/modules/workflows/migrations/Migration20260727074335_workflows.js.map +7 -0
- package/dist/modules/workflows/migrations/Migration20260728104038_workflows.js +13 -0
- package/dist/modules/workflows/migrations/Migration20260728104038_workflows.js.map +7 -0
- package/dist/modules/workflows/migrations/Migration20260728163001_workflows.js +15 -0
- package/dist/modules/workflows/migrations/Migration20260728163001_workflows.js.map +7 -0
- package/dist/modules/workflows/migrations/Migration20260729061736_workflows.js +13 -0
- package/dist/modules/workflows/migrations/Migration20260729061736_workflows.js.map +7 -0
- package/dist/modules/workflows/migrations/Migration20260729192652_workflows.js +12 -0
- package/dist/modules/workflows/migrations/Migration20260729192652_workflows.js.map +7 -0
- package/dist/modules/workflows/migrations/Migration20260730085000_workflows.js +13 -0
- package/dist/modules/workflows/migrations/Migration20260730085000_workflows.js.map +7 -0
- package/dist/modules/workflows/migrations/Migration20260730092706_workflows.js +13 -0
- package/dist/modules/workflows/migrations/Migration20260730092706_workflows.js.map +7 -0
- package/dist/modules/workflows/notifications.js +38 -10
- package/dist/modules/workflows/notifications.js.map +2 -2
- package/dist/modules/workflows/setup.js +81 -1
- package/dist/modules/workflows/setup.js.map +2 -2
- package/dist/modules/workflows/subscribers/task-assigned-notification.js +19 -27
- package/dist/modules/workflows/subscribers/task-assigned-notification.js.map +2 -2
- package/dist/modules/workflows/subscribers/task-deadline-breached-notification.js +24 -0
- package/dist/modules/workflows/subscribers/task-deadline-breached-notification.js.map +7 -0
- package/dist/modules/workflows/subscribers/task-reminder-notification.js +24 -0
- package/dist/modules/workflows/subscribers/task-reminder-notification.js.map +7 -0
- package/dist/modules/workflows/widgets/injection/pending-work/widget.client.js +73 -0
- package/dist/modules/workflows/widgets/injection/pending-work/widget.client.js.map +7 -0
- package/dist/modules/workflows/widgets/injection/pending-work/widget.js +17 -0
- package/dist/modules/workflows/widgets/injection/pending-work/widget.js.map +7 -0
- package/dist/modules/workflows/widgets/injection-table.js +26 -0
- package/dist/modules/workflows/widgets/injection-table.js.map +2 -2
- package/dist/modules/workflows/workers/workflow-activities.worker.js +61 -39
- package/dist/modules/workflows/workers/workflow-activities.worker.js.map +2 -2
- package/dist/modules/workflows/workers/workflow-definition-metric-rollup.worker.js +40 -0
- package/dist/modules/workflows/workers/workflow-definition-metric-rollup.worker.js.map +7 -0
- package/dist/modules/workflows/workers/workflow-instance-bulk-replay.js +43 -0
- package/dist/modules/workflows/workers/workflow-instance-bulk-replay.js.map +7 -0
- package/dist/modules/workflows/workers/workflow-invoke-agent.worker.js +30 -0
- package/dist/modules/workflows/workers/workflow-invoke-agent.worker.js.map +7 -0
- package/generated/entities/action_log/index.ts +1 -0
- package/generated/entities/user/index.ts +1 -0
- package/generated/entities/user_task/index.ts +7 -0
- package/generated/entities/workflow_definition/index.ts +3 -0
- package/generated/entities/workflow_definition_draft/index.ts +11 -0
- package/generated/entities/workflow_definition_metric_rollup/index.ts +10 -0
- package/generated/entities/workflow_instance/index.ts +2 -0
- package/generated/entities.ids.generated.ts +4 -1
- package/generated/entity-fields-registry.ts +39 -0
- package/jest.setup.ts +13 -0
- package/package.json +8 -7
- package/src/helpers/integration/workflowsFixtures.ts +765 -5
- package/src/helpers/integration/workflowsUi.ts +318 -0
- package/src/modules/attachments/lib/createFromBuffer.ts +120 -0
- package/src/modules/audit_logs/data/entities.ts +12 -0
- package/src/modules/audit_logs/data/validators.ts +1 -0
- package/src/modules/audit_logs/lib/projections.ts +5 -1
- package/src/modules/audit_logs/migrations/.snapshot-open-mercato.json +26 -0
- package/src/modules/audit_logs/migrations/Migration20260625120000.ts +15 -0
- package/src/modules/audit_logs/services/actionLogService.ts +3 -0
- package/src/modules/auth/data/entities.ts +21 -0
- package/src/modules/auth/i18n/de.json +31 -0
- package/src/modules/auth/i18n/en.json +31 -0
- package/src/modules/auth/i18n/es.json +31 -0
- package/src/modules/auth/i18n/ko.json +31 -0
- package/src/modules/auth/i18n/pl.json +31 -0
- package/src/modules/auth/lib/executionPrincipal.ts +235 -0
- package/src/modules/auth/migrations/.snapshot-open-mercato.json +16 -0
- package/src/modules/auth/migrations/Migration20260625050000.ts +21 -0
- package/src/modules/business_rules/components/InlineRuleEditor.tsx +231 -0
- package/src/modules/business_rules/data/validators.ts +6 -0
- package/src/modules/business_rules/i18n/de.json +4 -0
- package/src/modules/business_rules/i18n/en.json +4 -0
- package/src/modules/business_rules/i18n/es.json +4 -0
- package/src/modules/business_rules/i18n/ko.json +4 -0
- package/src/modules/business_rules/i18n/pl.json +4 -0
- package/src/modules/business_rules/lib/rule-engine.ts +15 -1
- package/src/modules/catalog/commands/products.ts +12 -0
- package/src/modules/catalog/i18n/de.json +1 -0
- package/src/modules/catalog/i18n/en.json +1 -0
- package/src/modules/catalog/i18n/es.json +1 -0
- package/src/modules/catalog/i18n/ko.json +1 -0
- package/src/modules/catalog/i18n/pl.json +1 -0
- package/src/modules/catalog/workflows.ts +35 -0
- package/src/modules/customer_accounts/AGENTS.md +11 -0
- package/src/modules/customer_accounts/backend/customer_accounts/roles/[id]/page.tsx +2 -0
- package/src/modules/customer_accounts/cli.ts +96 -0
- package/src/modules/customer_accounts/i18n/de.json +5 -0
- package/src/modules/customer_accounts/i18n/en.json +5 -0
- package/src/modules/customer_accounts/i18n/es.json +5 -0
- package/src/modules/customer_accounts/i18n/ko.json +5 -0
- package/src/modules/customer_accounts/i18n/pl.json +5 -0
- package/src/modules/customer_accounts/lib/customerRoleAclSync.ts +92 -0
- package/src/modules/customer_accounts/setup.ts +15 -3
- package/src/modules/customers/commands/deals.ts +5 -0
- package/src/modules/customers/components/detail/ChangelogEntryRow.tsx +4 -2
- package/src/modules/customers/components/detail/utils.ts +2 -0
- package/src/modules/customers/events.ts +21 -3
- package/src/modules/customers/i18n/de.json +4 -0
- package/src/modules/customers/i18n/en.json +4 -0
- package/src/modules/customers/i18n/es.json +4 -0
- package/src/modules/customers/i18n/ko.json +4 -0
- package/src/modules/customers/i18n/pl.json +4 -0
- package/src/modules/customers/lib/link-workflow-task-handler.ts +136 -0
- package/src/modules/customers/lib/todoCompatibility.ts +4 -1
- package/src/modules/customers/lib/workflowTaskLink.ts +23 -0
- package/src/modules/customers/subscribers/link-workflow-task.ts +19 -0
- package/src/modules/customers/workflows.ts +57 -0
- package/src/modules/entities/api/records.ts +18 -62
- package/src/modules/entities/lib/entityClassification.ts +102 -0
- package/src/modules/sales/commands/documents.ts +46 -0
- package/src/modules/sales/events.ts +20 -2
- package/src/modules/sales/i18n/de.json +2 -1
- package/src/modules/sales/i18n/en.json +2 -1
- package/src/modules/sales/i18n/es.json +2 -1
- package/src/modules/sales/i18n/ko.json +2 -1
- package/src/modules/sales/i18n/pl.json +2 -1
- package/src/modules/sales/workflows.ts +12 -1
- package/src/modules/seeds/README.md +86 -0
- package/src/modules/seeds/cli.ts +220 -0
- package/src/modules/seeds/examples/sample-seed.json +26 -0
- package/src/modules/seeds/index.ts +11 -0
- package/src/modules/workflows/AGENTS.md +851 -10
- package/src/modules/workflows/acl.ts +96 -0
- package/src/modules/workflows/ai-agents.ts +80 -0
- package/src/modules/workflows/ai-tools/authoring-pack.ts +798 -0
- package/src/modules/workflows/ai-tools/types.ts +117 -0
- package/src/modules/workflows/ai-tools.ts +20 -0
- package/src/modules/workflows/api/command-settings/route.ts +171 -0
- package/src/modules/workflows/api/commands/route.ts +109 -0
- package/src/modules/workflows/api/definitions/[id]/callers/route.ts +95 -0
- package/src/modules/workflows/api/definitions/[id]/context-schema/route.ts +187 -0
- package/src/modules/workflows/api/definitions/[id]/customize/route.ts +6 -1
- package/src/modules/workflows/api/definitions/[id]/draft/route.ts +395 -0
- package/src/modules/workflows/api/definitions/[id]/publish/route.ts +250 -0
- package/src/modules/workflows/api/definitions/[id]/reset-to-code/route.ts +5 -0
- package/src/modules/workflows/api/definitions/[id]/route.ts +107 -7
- package/src/modules/workflows/api/definitions/[id]/test-step/route.ts +288 -0
- package/src/modules/workflows/api/definitions/generate/route.ts +335 -0
- package/src/modules/workflows/api/definitions/route.ts +88 -113
- package/src/modules/workflows/api/definitions/serialize.ts +9 -0
- package/src/modules/workflows/api/endpoints/route.ts +88 -0
- package/src/modules/workflows/api/functions/route.ts +91 -0
- package/src/modules/workflows/api/grantable-features/route.ts +102 -0
- package/src/modules/workflows/api/instances/[id]/context/route.ts +214 -0
- package/src/modules/workflows/api/instances/[id]/rerun-step/route.ts +226 -0
- package/src/modules/workflows/api/instances/[id]/retry/route.ts +18 -2
- package/src/modules/workflows/api/instances/[id]/step-through/route.ts +195 -0
- package/src/modules/workflows/api/instances/[id]/steps/route.ts +160 -0
- package/src/modules/workflows/api/instances/[id]/would-do/route.ts +216 -0
- package/src/modules/workflows/api/instances/bulk-replay/route.ts +141 -0
- package/src/modules/workflows/api/instances/failure-queue/route.ts +197 -0
- package/src/modules/workflows/api/instances/route.ts +135 -3
- package/src/modules/workflows/api/metrics/definitions/route.ts +262 -0
- package/src/modules/workflows/api/openapi.ts +549 -2
- package/src/modules/workflows/api/portal/tasks/[id]/complete/route.ts +160 -0
- package/src/modules/workflows/api/portal/tasks/[id]/route.ts +124 -0
- package/src/modules/workflows/api/portal/tasks/route.ts +157 -0
- package/src/modules/workflows/api/rule-usage/route.ts +94 -0
- package/src/modules/workflows/api/task-settings/route.ts +138 -0
- package/src/modules/workflows/api/tasks/[id]/claim/route.ts +42 -17
- package/src/modules/workflows/api/tasks/[id]/complete/route.ts +47 -15
- package/src/modules/workflows/api/tasks/[id]/reassign/route.ts +197 -0
- package/src/modules/workflows/api/tasks/[id]/route.ts +57 -6
- package/src/modules/workflows/api/tasks/[id]/unclaim/route.ts +132 -0
- package/src/modules/workflows/api/tasks/route.ts +60 -5
- package/src/modules/workflows/api/tasks/serialize.ts +119 -0
- package/src/modules/workflows/api/templates/route.ts +87 -0
- package/src/modules/workflows/api/work-inbox/next/route.ts +170 -0
- package/src/modules/workflows/api/work-inbox/route.ts +153 -0
- package/src/modules/workflows/backend/config/workflows/page.meta.ts +33 -0
- package/src/modules/workflows/backend/config/workflows/page.tsx +12 -0
- package/src/modules/workflows/backend/definitions/[id]/page.tsx +19 -343
- package/src/modules/workflows/backend/definitions/create/page.meta.ts +1 -1
- package/src/modules/workflows/backend/definitions/create/page.tsx +19 -59
- package/src/modules/workflows/backend/definitions/page.tsx +156 -76
- package/src/modules/workflows/backend/definitions/visual-editor/page.tsx +3129 -584
- package/src/modules/workflows/backend/instances/[id]/page.meta.ts +1 -1
- package/src/modules/workflows/backend/instances/[id]/page.tsx +711 -539
- package/src/modules/workflows/backend/instances/failure-queue/page.meta.ts +16 -0
- package/src/modules/workflows/backend/instances/failure-queue/page.tsx +311 -0
- package/src/modules/workflows/backend/instances/page.meta.ts +1 -1
- package/src/modules/workflows/backend/instances/page.tsx +218 -38
- package/src/modules/workflows/backend/tasks/[id]/page.tsx +639 -400
- package/src/modules/workflows/backend/tasks/page.meta.ts +7 -0
- package/src/modules/workflows/backend/tasks/page.tsx +20 -333
- package/src/modules/workflows/backend/work-inbox/page.meta.ts +15 -0
- package/src/modules/workflows/backend/work-inbox/page.tsx +506 -0
- package/src/modules/workflows/cli.ts +1 -1
- package/src/modules/workflows/commands/tasks.ts +146 -0
- package/src/modules/workflows/components/ActivitiesEditor.tsx +91 -114
- package/src/modules/workflows/components/ActivityEditDialog.tsx +244 -0
- package/src/modules/workflows/components/AgentSelector.tsx +200 -0
- package/src/modules/workflows/components/AnnotationEditDialog.tsx +157 -0
- package/src/modules/workflows/components/BusinessRuleUsagePanel.tsx +106 -0
- package/src/modules/workflows/components/BusinessRulesSelector.tsx +71 -17
- package/src/modules/workflows/components/ConfigJsonTextarea.tsx +111 -0
- package/src/modules/workflows/components/ContextSchemaEditor.tsx +165 -0
- package/src/modules/workflows/components/DefinitionErrorHandlerField.tsx +133 -0
- package/src/modules/workflows/components/DefinitionMetadataDrawer.tsx +456 -0
- package/src/modules/workflows/components/DefinitionMetricsCells.tsx +212 -0
- package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +196 -95
- package/src/modules/workflows/components/EdgeEditDialog.tsx +15 -16
- package/src/modules/workflows/components/EdgeEditDialogCrudForm.tsx +130 -80
- package/src/modules/workflows/components/InputDataPanel.tsx +177 -0
- package/src/modules/workflows/components/InspectorPanel.tsx +250 -0
- package/src/modules/workflows/components/NodeEditDialog.tsx +444 -38
- package/src/modules/workflows/components/NodeEditDialogCrudForm.tsx +848 -178
- package/src/modules/workflows/components/StepsEditor.tsx +9 -2
- package/src/modules/workflows/components/TemplateGalleryDialog.tsx +205 -0
- package/src/modules/workflows/components/TransitionsEditor.tsx +98 -89
- package/src/modules/workflows/components/TriggersDialog.tsx +83 -0
- package/src/modules/workflows/components/TriggersEditor.tsx +363 -0
- package/src/modules/workflows/components/WorkflowAiDraftDialog.tsx +383 -0
- package/src/modules/workflows/components/WorkflowCodeView.tsx +257 -0
- package/src/modules/workflows/components/WorkflowCommandPalette.tsx +82 -0
- package/src/modules/workflows/components/WorkflowCompensationGhostEdge.tsx +78 -0
- package/src/modules/workflows/components/WorkflowDataMappingEdge.tsx +46 -0
- package/src/modules/workflows/components/WorkflowGraph.tsx +54 -1
- package/src/modules/workflows/components/WorkflowGraphImpl.tsx +463 -37
- package/src/modules/workflows/components/WorkflowIconPicker.tsx +144 -0
- package/src/modules/workflows/components/WorkflowLegend.tsx +59 -33
- package/src/modules/workflows/components/WorkflowNodeCard.tsx +355 -28
- package/src/modules/workflows/components/WorkflowRouteChips.tsx +145 -0
- package/src/modules/workflows/components/WorkflowSelector.tsx +33 -14
- package/src/modules/workflows/components/WorkflowTransitionEdge.tsx +83 -10
- package/src/modules/workflows/components/WorkflowTransitionLabel.tsx +13 -2
- package/src/modules/workflows/components/fields/ActivityArrayEditor.tsx +120 -30
- package/src/modules/workflows/components/fields/ActivityConfigFields.tsx +675 -0
- package/src/modules/workflows/components/fields/ActivityTestPanel.tsx +250 -0
- package/src/modules/workflows/components/fields/AgentInvokeConfigField.tsx +580 -0
- package/src/modules/workflows/components/fields/AgentReviewOnBreachField.tsx +88 -0
- package/src/modules/workflows/components/fields/BranchingRoutesEditor.tsx +323 -0
- package/src/modules/workflows/components/fields/BusinessRuleConditionsEditor.tsx +36 -4
- package/src/modules/workflows/components/fields/CommandPicker.tsx +158 -0
- package/src/modules/workflows/components/fields/EndpointPicker.tsx +330 -0
- package/src/modules/workflows/components/fields/FormFieldArrayEditor.tsx +2 -2
- package/src/modules/workflows/components/fields/FunctionPicker.tsx +68 -0
- package/src/modules/workflows/components/fields/MappingArrayEditor.tsx +46 -12
- package/src/modules/workflows/components/fields/PortFieldArrayEditor.tsx +255 -0
- package/src/modules/workflows/components/fields/RolesMultiSelect.tsx +68 -0
- package/src/modules/workflows/components/fields/RouteOrderEditor.tsx +169 -0
- package/src/modules/workflows/components/fields/SchemaBuilderDialog.tsx +139 -0
- package/src/modules/workflows/components/fields/StartPreConditionsEditor.tsx +2 -2
- package/src/modules/workflows/components/fields/TaskAssignmentField.tsx +355 -0
- package/src/modules/workflows/components/fields/TaskDeadlineFields.tsx +172 -0
- package/src/modules/workflows/components/fields/TaskDecisionsField.tsx +294 -0
- package/src/modules/workflows/components/fields/TaskEntityBindingsField.tsx +156 -0
- package/src/modules/workflows/components/fields/TemplateTextControl.tsx +85 -0
- package/src/modules/workflows/components/fields/VariablePickerButton.tsx +177 -0
- package/src/modules/workflows/components/fields/ledgerDropTarget.ts +55 -0
- package/src/modules/workflows/components/fields/useActivityTypeOptions.ts +19 -0
- package/src/modules/workflows/components/formConfig.tsx +84 -10
- package/src/modules/workflows/components/mobile/MobileDefinitionDetail.tsx +5 -0
- package/src/modules/workflows/components/mobile/MobileMetadataSheet.tsx +10 -0
- package/src/modules/workflows/components/mobile/MobileTaskForm.tsx +55 -19
- package/src/modules/workflows/components/mobile/MobileVisualEditor.tsx +49 -40
- package/src/modules/workflows/components/nodes/AnnotationGroupNode.tsx +81 -0
- package/src/modules/workflows/components/nodes/AutomatedNode.tsx +34 -17
- package/src/modules/workflows/components/nodes/EndNode.tsx +15 -14
- package/src/modules/workflows/components/nodes/ErrorOutputHandle.tsx +32 -0
- package/src/modules/workflows/components/nodes/IfElseNode.tsx +64 -0
- package/src/modules/workflows/components/nodes/InvokeAgentNode.tsx +180 -0
- package/src/modules/workflows/components/nodes/NodeOutcomeRows.tsx +143 -0
- package/src/modules/workflows/components/nodes/ParallelForkNode.tsx +28 -15
- package/src/modules/workflows/components/nodes/ParallelJoinNode.tsx +28 -15
- package/src/modules/workflows/components/nodes/StartNode.tsx +78 -18
- package/src/modules/workflows/components/nodes/StickyNoteNode.tsx +65 -0
- package/src/modules/workflows/components/nodes/SubWorkflowNode.tsx +124 -23
- package/src/modules/workflows/components/nodes/SwitchNode.tsx +64 -0
- package/src/modules/workflows/components/nodes/TriggerCap.tsx +103 -0
- package/src/modules/workflows/components/nodes/TriggerNode.tsx +151 -0
- package/src/modules/workflows/components/nodes/UserTaskNode.tsx +67 -22
- package/src/modules/workflows/components/nodes/WaitForConditionNode.tsx +74 -0
- package/src/modules/workflows/components/nodes/WaitForSignalNode.tsx +31 -17
- package/src/modules/workflows/components/nodes/WaitForTimerNode.tsx +31 -16
- package/src/modules/workflows/components/nodes/index.ts +17 -0
- package/src/modules/workflows/components/portal/PortalTaskForm.tsx +280 -0
- package/src/modules/workflows/components/run/AgentActivityPanel.tsx +48 -0
- package/src/modules/workflows/components/run/RerunStepDialog.tsx +133 -0
- package/src/modules/workflows/components/run/RunEventBadge.tsx +37 -0
- package/src/modules/workflows/components/run/RunGantt.tsx +180 -0
- package/src/modules/workflows/components/run/RunStatusBadge.tsx +112 -0
- package/src/modules/workflows/components/run/RunStepInspector.tsx +176 -0
- package/src/modules/workflows/components/run/WouldDoReport.tsx +93 -0
- package/src/modules/workflows/components/run/useAgentLabels.ts +42 -0
- package/src/modules/workflows/components/run/useLastRunOverlay.ts +150 -0
- package/src/modules/workflows/components/run/useLiveAgentActions.ts +70 -0
- package/src/modules/workflows/components/run/useLiveRunUpdates.ts +89 -0
- package/src/modules/workflows/components/settings/CommandSettingsPageClient.tsx +228 -0
- package/src/modules/workflows/components/work-inbox/EntityContextPanel.tsx +179 -0
- package/src/modules/workflows/components/work-inbox/ReassignTaskDialog.tsx +203 -0
- package/src/modules/workflows/components/work-inbox/StatusChip.tsx +61 -0
- package/src/modules/workflows/components/work-inbox/TaskActionNotice.tsx +77 -0
- package/src/modules/workflows/components/work-inbox/TaskFormFields.tsx +322 -0
- package/src/modules/workflows/components/work-inbox/WorkInboxEmptyState.tsx +43 -0
- package/src/modules/workflows/data/activity-config-schemas.ts +249 -0
- package/src/modules/workflows/data/activity-config-warnings.ts +71 -0
- package/src/modules/workflows/data/branching-route-warnings.ts +129 -0
- package/src/modules/workflows/data/entities.ts +397 -4
- package/src/modules/workflows/data/metrics-validators.ts +51 -0
- package/src/modules/workflows/data/task-primitives.ts +36 -0
- package/src/modules/workflows/data/types.ts +81 -2
- package/src/modules/workflows/data/validators.ts +729 -60
- package/src/modules/workflows/di.ts +22 -0
- package/src/modules/workflows/events.ts +68 -8
- package/src/modules/workflows/examples/oze-residential-install-60-nodes.json +1545 -0
- package/src/modules/workflows/examples/sales-pipeline-definition.json +35 -35
- package/src/modules/workflows/examples/templates/lead-to-install.json +160 -0
- package/src/modules/workflows/examples/templates/order-approval.json +230 -0
- package/src/modules/workflows/examples/templates/task-escalation.json +110 -0
- package/src/modules/workflows/examples/templates/webhook-integration.json +113 -0
- package/src/modules/workflows/extension-points.ts +1 -1
- package/src/modules/workflows/frontend/[orgSlug]/portal/tasks/[id]/page.meta.ts +21 -0
- package/src/modules/workflows/frontend/[orgSlug]/portal/tasks/[id]/page.tsx +212 -0
- package/src/modules/workflows/frontend/[orgSlug]/portal/tasks/page.meta.ts +25 -0
- package/src/modules/workflows/frontend/[orgSlug]/portal/tasks/page.tsx +185 -0
- package/src/modules/workflows/i18n/de.json +1083 -24
- package/src/modules/workflows/i18n/en.json +1081 -22
- package/src/modules/workflows/i18n/es.json +1083 -24
- package/src/modules/workflows/i18n/ko.json +1072 -13
- package/src/modules/workflows/i18n/pl.json +1082 -23
- package/src/modules/workflows/lib/activity-executor.ts +855 -186
- package/src/modules/workflows/lib/activity-queue-types.ts +120 -1
- package/src/modules/workflows/lib/activity-registry-bootstrap.ts +7 -0
- package/src/modules/workflows/lib/activity-registry.ts +89 -0
- package/src/modules/workflows/lib/activity-types.ts +415 -0
- package/src/modules/workflows/lib/activity-worker-handler.ts +744 -35
- package/src/modules/workflows/lib/advanced-config.ts +41 -0
- package/src/modules/workflows/lib/agent-disposition-task.ts +343 -0
- package/src/modules/workflows/lib/agent-outcome-paths.ts +153 -0
- package/src/modules/workflows/lib/agent-result-mapping.ts +88 -0
- package/src/modules/workflows/lib/agent-review-inspector.ts +125 -0
- package/src/modules/workflows/lib/agent-review.ts +171 -0
- package/src/modules/workflows/lib/ai-authoring.ts +402 -0
- package/src/modules/workflows/lib/ai-draft-runner.ts +105 -0
- package/src/modules/workflows/lib/annotation-events.ts +15 -0
- package/src/modules/workflows/lib/branching-routes.ts +280 -0
- package/src/modules/workflows/lib/breach-routing.ts +142 -0
- package/src/modules/workflows/lib/bulk-replay.ts +185 -0
- package/src/modules/workflows/lib/business-rule-usage.ts +154 -0
- package/src/modules/workflows/lib/caller-graph.ts +104 -0
- package/src/modules/workflows/lib/code-view-apply.ts +178 -0
- package/src/modules/workflows/lib/collect-validation-issues.ts +239 -0
- package/src/modules/workflows/lib/compensation-ghosts.ts +134 -0
- package/src/modules/workflows/lib/component-guard.ts +13 -0
- package/src/modules/workflows/lib/condition-handler.ts +658 -0
- package/src/modules/workflows/lib/context-ledger.ts +814 -0
- package/src/modules/workflows/lib/crud-form-dialogs-flag.ts +5 -0
- package/src/modules/workflows/lib/data-edge-mapping.ts +112 -0
- package/src/modules/workflows/lib/definition-context-schema.ts +103 -0
- package/src/modules/workflows/lib/definition-edit-safety.ts +228 -0
- package/src/modules/workflows/lib/definition-error-body.ts +43 -0
- package/src/modules/workflows/lib/definition-evaluation.ts +156 -0
- package/src/modules/workflows/lib/definition-grant.ts +211 -0
- package/src/modules/workflows/lib/definition-json-locations.ts +226 -0
- package/src/modules/workflows/lib/definition-payload.ts +81 -0
- package/src/modules/workflows/lib/draft-restore.ts +72 -0
- package/src/modules/workflows/lib/dry-run.ts +203 -0
- package/src/modules/workflows/lib/duration.ts +138 -24
- package/src/modules/workflows/lib/edge-reattachment.ts +186 -0
- package/src/modules/workflows/lib/edgeFormTransforms.ts +15 -14
- package/src/modules/workflows/lib/editor-annotations.ts +301 -0
- package/src/modules/workflows/lib/editor-commands.ts +205 -0
- package/src/modules/workflows/lib/editor-history.ts +151 -0
- package/src/modules/workflows/lib/endpoint-catalog.ts +283 -0
- package/src/modules/workflows/lib/endpoint-path.ts +134 -0
- package/src/modules/workflows/lib/engine-version.ts +67 -0
- package/src/modules/workflows/lib/error-handler.ts +192 -0
- package/src/modules/workflows/lib/error-routing.ts +236 -0
- package/src/modules/workflows/lib/event-logger.ts +27 -0
- package/src/modules/workflows/lib/expression-refs.ts +291 -0
- package/src/modules/workflows/lib/failure-grouping.ts +134 -0
- package/src/modules/workflows/lib/find-definition.ts +4 -0
- package/src/modules/workflows/lib/flow-logic-warnings.ts +591 -0
- package/src/modules/workflows/lib/graph-utils.ts +620 -110
- package/src/modules/workflows/lib/icon-search.ts +65 -0
- package/src/modules/workflows/lib/insert-at-cursor.ts +53 -0
- package/src/modules/workflows/lib/instance-date-filter.ts +56 -0
- package/src/modules/workflows/lib/interpolation-pipeline.ts +351 -0
- package/src/modules/workflows/lib/ledger-drag.ts +61 -0
- package/src/modules/workflows/lib/ledger-entry-display.ts +89 -0
- package/src/modules/workflows/lib/ledger-schema-flatten.ts +137 -0
- package/src/modules/workflows/lib/metrics/definition-metrics.ts +268 -0
- package/src/modules/workflows/lib/metrics/metrics-display.ts +57 -0
- package/src/modules/workflows/lib/metrics/rollup-schedule.ts +26 -0
- package/src/modules/workflows/lib/metrics/rollup-service.ts +292 -0
- package/src/modules/workflows/lib/node-config-summary.ts +235 -0
- package/src/modules/workflows/lib/node-geometry.ts +168 -0
- package/src/modules/workflows/lib/node-nudge.ts +63 -0
- package/src/modules/workflows/lib/node-outcome-rows.ts +195 -0
- package/src/modules/workflows/lib/node-placement.ts +104 -0
- package/src/modules/workflows/lib/node-type-icons.ts +71 -10
- package/src/modules/workflows/lib/nodeFormTransforms.ts +519 -28
- package/src/modules/workflows/lib/outcome-routing.ts +346 -0
- package/src/modules/workflows/lib/owned-definition.ts +188 -0
- package/src/modules/workflows/lib/owned-node-changes.ts +29 -0
- package/src/modules/workflows/lib/palette-drag.ts +68 -0
- package/src/modules/workflows/lib/palette-drop.ts +114 -0
- package/src/modules/workflows/lib/parallel-handler.ts +79 -2
- package/src/modules/workflows/lib/port-contract.ts +107 -0
- package/src/modules/workflows/lib/portal-task-access.ts +220 -0
- package/src/modules/workflows/lib/rerun-from-step.ts +140 -0
- package/src/modules/workflows/lib/route-chip-events.ts +45 -0
- package/src/modules/workflows/lib/route-chips.ts +177 -0
- package/src/modules/workflows/lib/route-edge.ts +57 -0
- package/src/modules/workflows/lib/route-kinds.ts +166 -0
- package/src/modules/workflows/lib/route-priority.ts +197 -0
- package/src/modules/workflows/lib/run-duration.ts +70 -0
- package/src/modules/workflows/lib/run-event-tone.ts +46 -0
- package/src/modules/workflows/lib/run-execution.ts +598 -0
- package/src/modules/workflows/lib/run-gantt.ts +311 -0
- package/src/modules/workflows/lib/run-outcome-evidence.ts +60 -0
- package/src/modules/workflows/lib/run-outcome.ts +142 -0
- package/src/modules/workflows/lib/sample-resolver.ts +113 -0
- package/src/modules/workflows/lib/seeds.ts +3 -1
- package/src/modules/workflows/lib/server-output-contract.ts +120 -0
- package/src/modules/workflows/lib/set-variable.ts +94 -0
- package/src/modules/workflows/lib/signal-handler.ts +134 -4
- package/src/modules/workflows/lib/start-fixtures.ts +93 -0
- package/src/modules/workflows/lib/status-colors.ts +220 -21
- package/src/modules/workflows/lib/step-handler.ts +744 -68
- package/src/modules/workflows/lib/step-presentation.ts +295 -0
- package/src/modules/workflows/lib/step-through.ts +71 -0
- package/src/modules/workflows/lib/step-type-conversion.ts +263 -0
- package/src/modules/workflows/lib/subgraph-clipboard.ts +214 -0
- package/src/modules/workflows/lib/task-decision-context.ts +76 -0
- package/src/modules/workflows/lib/task-decisions.ts +117 -0
- package/src/modules/workflows/lib/task-entity-access.ts +181 -0
- package/src/modules/workflows/lib/task-entity-aliases.ts +77 -0
- package/src/modules/workflows/lib/task-entity-types.ts +66 -0
- package/src/modules/workflows/lib/task-form-registry.ts +123 -0
- package/src/modules/workflows/lib/task-form-schema.ts +129 -0
- package/src/modules/workflows/lib/task-handler.ts +492 -51
- package/src/modules/workflows/lib/task-inspector-config.ts +348 -0
- package/src/modules/workflows/lib/task-list-query.ts +46 -0
- package/src/modules/workflows/lib/task-notifications.ts +218 -0
- package/src/modules/workflows/lib/task-permission-settings.ts +117 -0
- package/src/modules/workflows/lib/task-presets.ts +95 -0
- package/src/modules/workflows/lib/task-quick-action.ts +111 -0
- package/src/modules/workflows/lib/task-resolution.ts +270 -0
- package/src/modules/workflows/lib/task-sla.ts +628 -0
- package/src/modules/workflows/lib/task-visibility-request.ts +668 -0
- package/src/modules/workflows/lib/task-visibility.ts +627 -0
- package/src/modules/workflows/lib/timer-handler.ts +8 -1
- package/src/modules/workflows/lib/transition-handler.ts +228 -20
- package/src/modules/workflows/lib/trigger-node.ts +272 -0
- package/src/modules/workflows/lib/visual-editor-navigation.ts +29 -0
- package/src/modules/workflows/lib/work-inbox/empty-state.ts +150 -0
- package/src/modules/workflows/lib/work-inbox/entity-links.ts +99 -0
- package/src/modules/workflows/lib/work-inbox/navigation.ts +28 -0
- package/src/modules/workflows/lib/work-inbox/presentation.ts +163 -0
- package/src/modules/workflows/lib/work-inbox/provider.ts +390 -0
- package/src/modules/workflows/lib/work-inbox/query.ts +103 -0
- package/src/modules/workflows/lib/work-inbox/service.ts +122 -0
- package/src/modules/workflows/lib/work-inbox/user-task-source.ts +240 -0
- package/src/modules/workflows/lib/workflow-command-enablement.ts +188 -0
- package/src/modules/workflows/lib/workflow-command-settings.ts +124 -0
- package/src/modules/workflows/lib/workflow-executor.ts +1036 -10
- package/src/modules/workflows/lib/workflow-function-registry.ts +44 -0
- package/src/modules/workflows/lib/workflow-safe-commands.ts +42 -1
- package/src/modules/workflows/lib/workflow-templates.ts +91 -0
- package/src/modules/workflows/migrations/.snapshot-open-mercato.json +2321 -698
- package/src/modules/workflows/migrations/Migration20260626214855_workflows.ts +15 -0
- package/src/modules/workflows/migrations/Migration20260626222424_workflows.ts +17 -0
- package/src/modules/workflows/migrations/Migration20260727074335_workflows.ts +15 -0
- package/src/modules/workflows/migrations/Migration20260728104038_workflows.ts +13 -0
- package/src/modules/workflows/migrations/Migration20260728163001_workflows.ts +36 -0
- package/src/modules/workflows/migrations/Migration20260729061736_workflows.ts +13 -0
- package/src/modules/workflows/migrations/Migration20260729192652_workflows.ts +11 -0
- package/src/modules/workflows/migrations/Migration20260730085000_workflows.ts +13 -0
- package/src/modules/workflows/migrations/Migration20260730092706_workflows.ts +13 -0
- package/src/modules/workflows/notifications.ts +40 -10
- package/src/modules/workflows/setup.ts +128 -0
- package/src/modules/workflows/subscribers/task-assigned-notification.ts +36 -45
- package/src/modules/workflows/subscribers/task-deadline-breached-notification.ts +31 -0
- package/src/modules/workflows/subscribers/task-reminder-notification.ts +31 -0
- package/src/modules/workflows/widgets/injection/pending-work/widget.client.tsx +119 -0
- package/src/modules/workflows/widgets/injection/pending-work/widget.ts +27 -0
- package/src/modules/workflows/widgets/injection-table.ts +52 -2
- package/src/modules/workflows/workers/workflow-activities.worker.ts +95 -42
- package/src/modules/workflows/workers/workflow-definition-metric-rollup.worker.ts +71 -0
- package/src/modules/workflows/workers/workflow-instance-bulk-replay.ts +51 -0
- package/src/modules/workflows/workers/workflow-invoke-agent.worker.ts +72 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Button } from "@open-mercato/ui/primitives/button";
|
|
5
|
+
import {
|
|
6
|
+
Drawer,
|
|
7
|
+
DrawerBody,
|
|
8
|
+
DrawerContent,
|
|
9
|
+
DrawerDescription,
|
|
10
|
+
DrawerFooter,
|
|
11
|
+
DrawerHeader,
|
|
12
|
+
DrawerTitle
|
|
13
|
+
} from "@open-mercato/ui/primitives/drawer";
|
|
14
|
+
import { Input } from "@open-mercato/ui/primitives/input";
|
|
15
|
+
import { Label } from "@open-mercato/ui/primitives/label";
|
|
16
|
+
import { Switch } from "@open-mercato/ui/primitives/switch";
|
|
17
|
+
import { Textarea } from "@open-mercato/ui/primitives/textarea";
|
|
18
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
19
|
+
import {
|
|
20
|
+
ANNOTATION_GROUP_NODE_TYPE,
|
|
21
|
+
ANNOTATION_NOTE_NODE_TYPE
|
|
22
|
+
} from "../lib/editor-annotations.js";
|
|
23
|
+
function AnnotationEditDialog({ node, isOpen, onClose, onSave, onDelete }) {
|
|
24
|
+
const t = useT();
|
|
25
|
+
const isNote = node?.type === ANNOTATION_NOTE_NODE_TYPE;
|
|
26
|
+
const isGroup = node?.type === ANNOTATION_GROUP_NODE_TYPE;
|
|
27
|
+
const [markdown, setMarkdown] = React.useState("");
|
|
28
|
+
const [name, setName] = React.useState("");
|
|
29
|
+
const [collapsed, setCollapsed] = React.useState(false);
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
if (!node) return;
|
|
32
|
+
const data = node.data;
|
|
33
|
+
setMarkdown(typeof data?.markdown === "string" ? data.markdown : "");
|
|
34
|
+
setName(typeof data?.name === "string" ? data.name : "");
|
|
35
|
+
setCollapsed(data?.collapsed === true);
|
|
36
|
+
}, [node]);
|
|
37
|
+
const handleSave = React.useCallback(() => {
|
|
38
|
+
if (!node) return;
|
|
39
|
+
onSave(node.id, isNote ? { markdown } : { name, collapsed });
|
|
40
|
+
onClose();
|
|
41
|
+
}, [node, onSave, onClose, isNote, markdown, name, collapsed]);
|
|
42
|
+
const handleDelete = React.useCallback(() => {
|
|
43
|
+
if (!node) return;
|
|
44
|
+
onClose();
|
|
45
|
+
onDelete(node.id);
|
|
46
|
+
}, [node, onClose, onDelete]);
|
|
47
|
+
if (!node || !isNote && !isGroup) return null;
|
|
48
|
+
return /* @__PURE__ */ jsx(Drawer, { open: isOpen, onOpenChange: (open) => {
|
|
49
|
+
if (!open) onClose();
|
|
50
|
+
}, children: /* @__PURE__ */ jsxs(
|
|
51
|
+
DrawerContent,
|
|
52
|
+
{
|
|
53
|
+
"data-testid": "workflow-annotation-drawer",
|
|
54
|
+
onKeyDown: (event) => {
|
|
55
|
+
if ((event.metaKey || event.ctrlKey) && event.key === "Enter") {
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
handleSave();
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
closeAriaLabel: t("workflows.annotations.close", "Close annotation editor"),
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsxs(DrawerHeader, { children: [
|
|
63
|
+
/* @__PURE__ */ jsx(DrawerTitle, { children: isNote ? t("workflows.annotations.note.dialogTitle", "Edit note") : t("workflows.annotations.group.dialogTitle", "Edit group") }),
|
|
64
|
+
/* @__PURE__ */ jsx(DrawerDescription, { children: isNote ? t("workflows.annotations.note.dialogDescription", "Notes document the workflow for the people editing it. They are never executed.") : t("workflows.annotations.group.dialogDescription", "Groups label a region of the canvas. Collapsing one changes nothing the engine runs.") })
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ jsx(DrawerBody, { className: "space-y-3 py-2", children: isNote ? /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
67
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "annotation-markdown", className: "text-xs", children: t("workflows.annotations.note.markdownLabel", "Markdown") }),
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
Textarea,
|
|
70
|
+
{
|
|
71
|
+
id: "annotation-markdown",
|
|
72
|
+
value: markdown,
|
|
73
|
+
onChange: (event) => setMarkdown(event.target.value),
|
|
74
|
+
rows: 8,
|
|
75
|
+
spellCheck: false,
|
|
76
|
+
className: "font-mono text-sm",
|
|
77
|
+
placeholder: t("workflows.annotations.note.markdownPlaceholder", "## Why this branch exists")
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
81
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
82
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "annotation-name", className: "text-xs", children: t("workflows.annotations.group.nameLabel", "Group name") }),
|
|
83
|
+
/* @__PURE__ */ jsx(
|
|
84
|
+
Input,
|
|
85
|
+
{
|
|
86
|
+
id: "annotation-name",
|
|
87
|
+
value: name,
|
|
88
|
+
onChange: (event) => setName(event.target.value),
|
|
89
|
+
placeholder: t("workflows.annotations.group.namePlaceholder", "Fulfillment"),
|
|
90
|
+
className: "h-8 text-sm"
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
] }),
|
|
94
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
95
|
+
/* @__PURE__ */ jsx(Switch, { id: "annotation-collapsed", checked: collapsed, onCheckedChange: setCollapsed }),
|
|
96
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "annotation-collapsed", className: "cursor-pointer text-xs font-normal", children: t("workflows.annotations.group.collapsedLabel", "Collapsed (visual only)") })
|
|
97
|
+
] })
|
|
98
|
+
] }) }),
|
|
99
|
+
/* @__PURE__ */ jsxs(DrawerFooter, { leading: /* @__PURE__ */ jsx(Button, { type: "button", variant: "destructive-outline", onClick: handleDelete, children: t("common.delete", "Delete") }), children: [
|
|
100
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: onClose, children: t("common.cancel", "Cancel") }),
|
|
101
|
+
/* @__PURE__ */ jsx(Button, { type: "button", onClick: handleSave, children: t("workflows.common.save", "Save") })
|
|
102
|
+
] })
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
) });
|
|
106
|
+
}
|
|
107
|
+
export {
|
|
108
|
+
AnnotationEditDialog
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=AnnotationEditDialog.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/workflows/components/AnnotationEditDialog.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport type { Node } from '@xyflow/react'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport {\n Drawer,\n DrawerBody,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerTitle,\n} from '@open-mercato/ui/primitives/drawer'\nimport { Input } from '@open-mercato/ui/primitives/input'\nimport { Label } from '@open-mercato/ui/primitives/label'\nimport { Switch } from '@open-mercato/ui/primitives/switch'\nimport { Textarea } from '@open-mercato/ui/primitives/textarea'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport {\n ANNOTATION_GROUP_NODE_TYPE,\n ANNOTATION_NOTE_NODE_TYPE,\n type WorkflowGroupNodeData,\n type WorkflowNoteNodeData,\n} from '../lib/editor-annotations'\n\nexport interface AnnotationEditDialogProps {\n node: Node | null\n isOpen: boolean\n onClose: () => void\n onSave: (nodeId: string, updates: Partial<WorkflowNoteNodeData & WorkflowGroupNodeData>) => void\n onDelete: (nodeId: string) => void\n}\n\n/**\n * Inspector for a sticky note or a named group (spec section 4.5).\n *\n * Notes and groups carry no step configuration, so they deliberately do not go\n * through the step inspector: this panel edits the two fields an annotation\n * actually has and nothing else.\n *\n * It is a Drawer, not a modal, for the same reason the step and route\n * inspectors are rails: an annotation is written ABOUT a region of the canvas,\n * so covering that region while it is edited hides the thing being described.\n * Keyboard contract unchanged \u2014 Cmd/Ctrl+Enter saves, Escape cancels.\n */\nexport function AnnotationEditDialog({ node, isOpen, onClose, onSave, onDelete }: AnnotationEditDialogProps) {\n const t = useT()\n const isNote = node?.type === ANNOTATION_NOTE_NODE_TYPE\n const isGroup = node?.type === ANNOTATION_GROUP_NODE_TYPE\n const [markdown, setMarkdown] = React.useState('')\n const [name, setName] = React.useState('')\n const [collapsed, setCollapsed] = React.useState(false)\n\n React.useEffect(() => {\n if (!node) return\n const data = node.data as Partial<WorkflowNoteNodeData & WorkflowGroupNodeData> | undefined\n setMarkdown(typeof data?.markdown === 'string' ? data.markdown : '')\n setName(typeof data?.name === 'string' ? data.name : '')\n setCollapsed(data?.collapsed === true)\n }, [node])\n\n const handleSave = React.useCallback(() => {\n if (!node) return\n onSave(node.id, isNote ? { markdown } : { name, collapsed })\n onClose()\n }, [node, onSave, onClose, isNote, markdown, name, collapsed])\n\n const handleDelete = React.useCallback(() => {\n if (!node) return\n onClose()\n onDelete(node.id)\n }, [node, onClose, onDelete])\n\n if (!node || (!isNote && !isGroup)) return null\n\n return (\n <Drawer open={isOpen} onOpenChange={(open) => { if (!open) onClose() }}>\n <DrawerContent\n data-testid=\"workflow-annotation-drawer\"\n onKeyDown={(event) => {\n if ((event.metaKey || event.ctrlKey) && event.key === 'Enter') {\n event.preventDefault()\n handleSave()\n }\n }}\n closeAriaLabel={t('workflows.annotations.close', 'Close annotation editor')}\n >\n <DrawerHeader>\n <DrawerTitle>\n {isNote\n ? t('workflows.annotations.note.dialogTitle', 'Edit note')\n : t('workflows.annotations.group.dialogTitle', 'Edit group')}\n </DrawerTitle>\n <DrawerDescription>\n {isNote\n ? t('workflows.annotations.note.dialogDescription', 'Notes document the workflow for the people editing it. They are never executed.')\n : t('workflows.annotations.group.dialogDescription', 'Groups label a region of the canvas. Collapsing one changes nothing the engine runs.')}\n </DrawerDescription>\n </DrawerHeader>\n\n <DrawerBody className=\"space-y-3 py-2\">\n {isNote ? (\n <div className=\"space-y-1\">\n <Label htmlFor=\"annotation-markdown\" className=\"text-xs\">\n {t('workflows.annotations.note.markdownLabel', 'Markdown')}\n </Label>\n <Textarea\n id=\"annotation-markdown\"\n value={markdown}\n onChange={(event) => setMarkdown(event.target.value)}\n rows={8}\n spellCheck={false}\n className=\"font-mono text-sm\"\n placeholder={t('workflows.annotations.note.markdownPlaceholder', '## Why this branch exists')}\n />\n </div>\n ) : (\n <>\n <div className=\"space-y-1\">\n <Label htmlFor=\"annotation-name\" className=\"text-xs\">\n {t('workflows.annotations.group.nameLabel', 'Group name')}\n </Label>\n <Input\n id=\"annotation-name\"\n value={name}\n onChange={(event) => setName(event.target.value)}\n placeholder={t('workflows.annotations.group.namePlaceholder', 'Fulfillment')}\n className=\"h-8 text-sm\"\n />\n </div>\n <div className=\"flex items-center gap-2\">\n <Switch id=\"annotation-collapsed\" checked={collapsed} onCheckedChange={setCollapsed} />\n <Label htmlFor=\"annotation-collapsed\" className=\"cursor-pointer text-xs font-normal\">\n {t('workflows.annotations.group.collapsedLabel', 'Collapsed (visual only)')}\n </Label>\n </div>\n </>\n )}\n </DrawerBody>\n\n <DrawerFooter leading={(\n <Button type=\"button\" variant=\"destructive-outline\" onClick={handleDelete}>\n {t('common.delete', 'Delete')}\n </Button>\n )}>\n <Button type=\"button\" variant=\"outline\" onClick={onClose}>\n {t('common.cancel', 'Cancel')}\n </Button>\n <Button type=\"button\" onClick={handleSave}>\n {t('workflows.common.save', 'Save')}\n </Button>\n </DrawerFooter>\n </DrawerContent>\n </Drawer>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAwFQ,SA8BI,UA7BF,KADF;AAtFR,YAAY,WAAW;AAEvB,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa;AACtB,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAs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SACZ,oBAAC,UAAO,MAAK,UAAS,SAAQ,uBAAsB,SAAS,cAC1D,YAAE,iBAAiB,QAAQ,GAC9B,GAEA;AAAA,8BAAC,UAAO,MAAK,UAAS,SAAQ,WAAU,SAAS,SAC9C,YAAE,iBAAiB,QAAQ,GAC9B;AAAA,UACA,oBAAC,UAAO,MAAK,UAAS,SAAS,YAC5B,YAAE,yBAAyB,MAAM,GACpC;AAAA,WACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { apiFetch } from "@open-mercato/ui/backend/utils/api";
|
|
5
|
+
import { readJsonSafe } from "@open-mercato/ui/backend/utils/serverErrors";
|
|
6
|
+
import { Spinner } from "@open-mercato/ui/primitives/spinner";
|
|
7
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
8
|
+
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
9
|
+
const logger = createLogger("workflows");
|
|
10
|
+
function BusinessRuleUsagePanel({ ruleId, className }) {
|
|
11
|
+
const t = useT();
|
|
12
|
+
const [usage, setUsage] = React.useState(null);
|
|
13
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
14
|
+
const [failed, setFailed] = React.useState(false);
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
if (!ruleId) {
|
|
17
|
+
setUsage(null);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
let cancelled = false;
|
|
21
|
+
setIsLoading(true);
|
|
22
|
+
setFailed(false);
|
|
23
|
+
const load = async () => {
|
|
24
|
+
try {
|
|
25
|
+
const response = await apiFetch(`/api/workflows/rule-usage?ruleId=${encodeURIComponent(ruleId)}`);
|
|
26
|
+
if (!response.ok) {
|
|
27
|
+
if (!cancelled) setFailed(true);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const body = await readJsonSafe(response) ?? {};
|
|
31
|
+
if (!cancelled) setUsage(body);
|
|
32
|
+
} catch (error) {
|
|
33
|
+
logger.error("Failed to load business rule usage", { ruleId, err: error });
|
|
34
|
+
if (!cancelled) setFailed(true);
|
|
35
|
+
} finally {
|
|
36
|
+
if (!cancelled) setIsLoading(false);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
void load();
|
|
40
|
+
return () => {
|
|
41
|
+
cancelled = true;
|
|
42
|
+
};
|
|
43
|
+
}, [ruleId]);
|
|
44
|
+
if (!ruleId) return null;
|
|
45
|
+
const references = usage?.references ?? [];
|
|
46
|
+
const workflowCount = usage?.workflowCount ?? 0;
|
|
47
|
+
return /* @__PURE__ */ jsxs("section", { className: `rounded-lg border border-border bg-card p-3 ${className ?? ""}`, children: [
|
|
48
|
+
/* @__PURE__ */ jsx("h4", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: t("workflows.businessRules.usage.title") }),
|
|
49
|
+
isLoading ? /* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
50
|
+
/* @__PURE__ */ jsx(Spinner, { size: "sm" }),
|
|
51
|
+
/* @__PURE__ */ jsx("span", { children: t("workflows.common.loadingDetails") })
|
|
52
|
+
] }) : failed ? /* @__PURE__ */ jsx("p", { className: "mt-2 text-xs text-muted-foreground", children: t("workflows.businessRules.usage.unavailable") }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
53
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 text-sm font-medium text-foreground", children: t("workflows.businessRules.usage.workflowCount", { count: workflowCount }) }),
|
|
54
|
+
references.length === 0 ? /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: t("workflows.businessRules.usage.empty") }) : /* @__PURE__ */ jsx("ul", { className: "mt-2 space-y-1", children: references.map((reference) => /* @__PURE__ */ jsxs(
|
|
55
|
+
"li",
|
|
56
|
+
{
|
|
57
|
+
className: "text-xs text-muted-foreground",
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: reference.workflowName || reference.workflowId }),
|
|
60
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1", children: t(`workflows.businessRules.usage.kinds.${reference.kind}`) })
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
`${reference.workflowId}:${reference.version}:${reference.kind}:${reference.locationId}`
|
|
64
|
+
)) })
|
|
65
|
+
] })
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
BusinessRuleUsagePanel
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=BusinessRuleUsagePanel.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/workflows/components/BusinessRuleUsagePanel.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { apiFetch } from '@open-mercato/ui/backend/utils/api'\nimport { readJsonSafe } from '@open-mercato/ui/backend/utils/serverErrors'\nimport { Spinner } from '@open-mercato/ui/primitives/spinner'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\nimport type { BusinessRuleUsageReference } from '../lib/business-rule-usage'\n\nconst logger = createLogger('workflows')\n\nexport type BusinessRuleUsagePanelProps = {\n ruleId: string | null\n className?: string\n}\n\ntype UsageResponse = {\n workflowCount?: number\n references?: BusinessRuleUsageReference[]\n}\n\n/**\n * BusinessRuleUsagePanel \u2014 the workflows half of the inline-BR dependency\n * visibility (#4236). `business_rules` exposes a slot on its `InlineRuleEditor`;\n * this panel fills it by asking `GET /api/workflows/rule-usage`, so the upstream\n * module never imports or queries workflows.\n */\nexport function BusinessRuleUsagePanel({ ruleId, className }: BusinessRuleUsagePanelProps) {\n const t = useT()\n const [usage, setUsage] = React.useState<UsageResponse | null>(null)\n const [isLoading, setIsLoading] = React.useState(false)\n const [failed, setFailed] = React.useState(false)\n\n React.useEffect(() => {\n if (!ruleId) {\n setUsage(null)\n return\n }\n let cancelled = false\n setIsLoading(true)\n setFailed(false)\n const load = async () => {\n try {\n const response = await apiFetch(`/api/workflows/rule-usage?ruleId=${encodeURIComponent(ruleId)}`)\n if (!response.ok) {\n if (!cancelled) setFailed(true)\n return\n }\n const body = (await readJsonSafe<UsageResponse>(response)) ?? {}\n if (!cancelled) setUsage(body)\n } catch (error) {\n logger.error('Failed to load business rule usage', { ruleId, err: error })\n if (!cancelled) setFailed(true)\n } finally {\n if (!cancelled) setIsLoading(false)\n }\n }\n void load()\n return () => {\n cancelled = true\n }\n }, [ruleId])\n\n if (!ruleId) return null\n\n const references = usage?.references ?? []\n const workflowCount = usage?.workflowCount ?? 0\n\n return (\n <section className={`rounded-lg border border-border bg-card p-3 ${className ?? ''}`}>\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n {t('workflows.businessRules.usage.title')}\n </h4>\n {isLoading ? (\n <div className=\"mt-2 flex items-center gap-2 text-xs text-muted-foreground\">\n <Spinner size=\"sm\" />\n <span>{t('workflows.common.loadingDetails')}</span>\n </div>\n ) : failed ? (\n <p className=\"mt-2 text-xs text-muted-foreground\">{t('workflows.businessRules.usage.unavailable')}</p>\n ) : (\n <>\n <p className=\"mt-2 text-sm font-medium text-foreground\">\n {t('workflows.businessRules.usage.workflowCount', { count: workflowCount })}\n </p>\n {references.length === 0 ? (\n <p className=\"mt-1 text-xs text-muted-foreground\">{t('workflows.businessRules.usage.empty')}</p>\n ) : (\n <ul className=\"mt-2 space-y-1\">\n {references.map((reference) => (\n <li\n key={`${reference.workflowId}:${reference.version}:${reference.kind}:${reference.locationId}`}\n className=\"text-xs text-muted-foreground\"\n >\n <span className=\"font-medium text-foreground\">{reference.workflowName || reference.workflowId}</span>\n <span className=\"ml-1\">{t(`workflows.businessRules.usage.kin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;AAEpB,QAAM,aAAa,OAAO,cAAc,CAAC;AACzC,QAAM,gBAAgB,OAAO,iBAAiB;AAE9C,SACE,qBAAC,aAAQ,WAAW,+CAA+C,aAAa,EAAE,IAChF;AAAA,wBAAC,QAAG,WAAU,uEACX,YAAE,qCAAqC,GAC1C;AAAA,IACC,YACC,qBAAC,SAAI,WAAU,8DACb;AAAA,0BAAC,WAAQ,MAAK,MAAK;AAAA,MACnB,oBAAC,UAAM,YAAE,iCAAiC,GAAE;AAAA,OAC9C,IACE,SACF,oBAAC,OAAE,WAAU,sCAAsC,YAAE,2CAA2C,GAAE,IAElG,iCACE;AAAA,0BAAC,OAAE,WAAU,4CACV,YAAE,+CAA+C,EAAE,OAAO,cAAc,CAAC,GAC5E;AAAA,MACC,WAAW,WAAW,IACrB,oBAAC,OAAE,WAAU,sCAAsC,YAAE,qCAAqC,GAAE,IAE5F,oBAAC,QAAG,WAAU,kBACX,qBAAW,IAAI,CAAC,cACf;AAAA,QAAC;AAAA;AAAA,UAEC,WAAU;AAAA,UAEV;AAAA,gCAAC,UAAK,WAAU,+BAA+B,oBAAU,gBAAgB,UAAU,YAAW;AAAA,YAC9F,oBAAC,UAAK,WAAU,QAAQ,YAAE,uCAAuC,UAAU,IAAI,EAAE,GAAE;AAAA;AAAA;AAAA,QAJ9E,GAAG,UAAU,UAAU,IAAI,UAAU,OAAO,IAAI,UAAU,IAAI,IAAI,UAAU,UAAU;AAAA,MAK7F,CACD,GACH;AAAA,OAEJ;AAAA,KAEJ;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -2,12 +2,22 @@
|
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useEffect } from "react";
|
|
4
4
|
import { apiFetch } from "@open-mercato/ui/backend/utils/api";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
Drawer,
|
|
7
|
+
DrawerBody,
|
|
8
|
+
DrawerContent,
|
|
9
|
+
DrawerDescription,
|
|
10
|
+
DrawerFooter,
|
|
11
|
+
DrawerHeader,
|
|
12
|
+
DrawerTitle
|
|
13
|
+
} from "@open-mercato/ui/primitives/drawer";
|
|
6
14
|
import { Button } from "@open-mercato/ui/primitives/button";
|
|
7
15
|
import { Input } from "@open-mercato/ui/primitives/input";
|
|
8
16
|
import { Badge } from "@open-mercato/ui/primitives/badge";
|
|
9
17
|
import { Plus, Loader2, AlertCircle } from "lucide-react";
|
|
10
18
|
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
19
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
20
|
+
import { InlineRuleEditor } from "@open-mercato/core/modules/business_rules/components/InlineRuleEditor";
|
|
11
21
|
const logger = createLogger("workflows");
|
|
12
22
|
function BusinessRulesSelector({
|
|
13
23
|
isOpen,
|
|
@@ -21,12 +31,15 @@ function BusinessRulesSelector({
|
|
|
21
31
|
filterCategory,
|
|
22
32
|
onlyEnabled = false,
|
|
23
33
|
emptyMessage,
|
|
24
|
-
searchPlaceholder = "Search by name, ID, type, category, or description..."
|
|
34
|
+
searchPlaceholder = "Search by name, ID, type, category, or description...",
|
|
35
|
+
disableInlineCreate = false
|
|
25
36
|
}) {
|
|
37
|
+
const t = useT();
|
|
26
38
|
const [businessRules, setBusinessRules] = useState([]);
|
|
27
39
|
const [loading, setLoading] = useState(false);
|
|
28
40
|
const [error, setError] = useState(null);
|
|
29
41
|
const [searchQuery, setSearchQuery] = useState("");
|
|
42
|
+
const [isInlineEditorOpen, setIsInlineEditorOpen] = useState(false);
|
|
30
43
|
useEffect(() => {
|
|
31
44
|
if (isOpen) {
|
|
32
45
|
fetchBusinessRules();
|
|
@@ -54,7 +67,9 @@ function BusinessRulesSelector({
|
|
|
54
67
|
const response = await apiFetch(url);
|
|
55
68
|
if (response.ok) {
|
|
56
69
|
const data = await response.json();
|
|
57
|
-
|
|
70
|
+
const items = data.items || [];
|
|
71
|
+
setBusinessRules(items);
|
|
72
|
+
return items;
|
|
58
73
|
} else {
|
|
59
74
|
let errorMessage = `Failed to load business rules (${response.status})`;
|
|
60
75
|
try {
|
|
@@ -79,6 +94,14 @@ function BusinessRulesSelector({
|
|
|
79
94
|
} finally {
|
|
80
95
|
setLoading(false);
|
|
81
96
|
}
|
|
97
|
+
return [];
|
|
98
|
+
};
|
|
99
|
+
const handleInlineRuleSaved = async (saved) => {
|
|
100
|
+
const refreshed = await fetchBusinessRules();
|
|
101
|
+
const created = refreshed.find((rule) => rule.ruleId === saved.ruleId);
|
|
102
|
+
if (created) {
|
|
103
|
+
handleSelect(created);
|
|
104
|
+
}
|
|
82
105
|
};
|
|
83
106
|
const getFilteredRules = () => {
|
|
84
107
|
return businessRules.filter((rule) => !excludeRuleIds.includes(rule.ruleId)).filter((rule) => {
|
|
@@ -96,101 +119,136 @@ function BusinessRulesSelector({
|
|
|
96
119
|
onClose();
|
|
97
120
|
};
|
|
98
121
|
const filteredRules = getFilteredRules();
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
/* @__PURE__ */ jsx("div", { className: "px-6", children: /* @__PURE__ */ jsx(
|
|
105
|
-
Input,
|
|
122
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
123
|
+
/* @__PURE__ */ jsx(Drawer, { open: isOpen, onOpenChange: (next) => {
|
|
124
|
+
if (!next) handleClose();
|
|
125
|
+
}, children: /* @__PURE__ */ jsxs(
|
|
126
|
+
DrawerContent,
|
|
106
127
|
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
128
|
+
"data-testid": "workflow-business-rules-selector-drawer",
|
|
129
|
+
className: "w-full max-w-none sm:w-3/5",
|
|
130
|
+
closeAriaLabel: t("workflows.selectors.businessRule.close"),
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ jsxs(DrawerHeader, { children: [
|
|
133
|
+
/* @__PURE__ */ jsx(DrawerTitle, { children: title }),
|
|
134
|
+
/* @__PURE__ */ jsx(DrawerDescription, { children: description })
|
|
135
|
+
] }),
|
|
136
|
+
/* @__PURE__ */ jsx("div", { className: "px-6", children: /* @__PURE__ */ jsx(
|
|
137
|
+
Input,
|
|
138
|
+
{
|
|
139
|
+
type: "text",
|
|
140
|
+
value: searchQuery,
|
|
141
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
142
|
+
placeholder: searchPlaceholder,
|
|
143
|
+
autoFocus: true,
|
|
144
|
+
disabled: loading
|
|
145
|
+
}
|
|
146
|
+
) }),
|
|
147
|
+
/* @__PURE__ */ jsx(DrawerBody, { className: "py-4", children: loading ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-12", children: [
|
|
148
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-12 w-12 animate-spin text-primary mb-4" }),
|
|
149
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Loading business rules..." })
|
|
150
|
+
] }) : error ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-12", children: [
|
|
151
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-16 w-16 text-destructive mb-4" }),
|
|
152
|
+
/* @__PURE__ */ jsx("p", { className: "text-destructive text-sm font-medium mb-2", children: error }),
|
|
153
|
+
/* @__PURE__ */ jsx(
|
|
154
|
+
Button,
|
|
155
|
+
{
|
|
156
|
+
variant: "outline",
|
|
157
|
+
size: "sm",
|
|
158
|
+
onClick: fetchBusinessRules,
|
|
159
|
+
children: "Retry"
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
] }) : filteredRules.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-12", children: [
|
|
163
|
+
/* @__PURE__ */ jsx("svg", { className: "w-16 h-16 text-muted mb-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }),
|
|
164
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-2", children: emptyMessage || (searchQuery ? "No business rules found matching your search" : businessRules.length === 0 ? "No business rules exist yet" : "All business rules have already been added") }),
|
|
165
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs mb-3", children: businessRules.length === 0 ? "Create business rules in the Business Rules module first" : searchQuery ? `Showing 0 of ${businessRules.length} total rules` : `${businessRules.length} rules already added` }),
|
|
166
|
+
searchQuery && /* @__PURE__ */ jsx(
|
|
167
|
+
Button,
|
|
168
|
+
{
|
|
169
|
+
variant: "link",
|
|
170
|
+
size: "sm",
|
|
171
|
+
onClick: () => setSearchQuery(""),
|
|
172
|
+
children: "Clear search"
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
176
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-3 text-sm text-muted-foreground", children: [
|
|
177
|
+
filteredRules.length,
|
|
178
|
+
" rule",
|
|
179
|
+
filteredRules.length !== 1 ? "s" : "",
|
|
180
|
+
" available"
|
|
181
|
+
] }),
|
|
182
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-3", children: filteredRules.map((rule) => /* @__PURE__ */ jsxs(
|
|
183
|
+
"button",
|
|
184
|
+
{
|
|
185
|
+
onClick: () => handleSelect(rule),
|
|
186
|
+
className: "text-left p-4 border-2 border-border rounded-lg hover:border-primary hover:bg-accent transition-all group",
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between mb-2", children: [
|
|
189
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
190
|
+
/* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold group-hover:text-primary truncate", children: rule.ruleName }),
|
|
191
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground font-mono mt-0.5 truncate", children: rule.ruleId })
|
|
192
|
+
] }),
|
|
193
|
+
/* @__PURE__ */ jsx(Plus, { className: "size-5 text-muted-foreground group-hover:text-primary transition-colors flex-shrink-0 ml-2" })
|
|
194
|
+
] }),
|
|
195
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2 flex-wrap", children: [
|
|
196
|
+
/* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs", children: rule.ruleType }),
|
|
197
|
+
rule.ruleCategory && /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-xs", children: rule.ruleCategory }),
|
|
198
|
+
rule.enabled ? /* @__PURE__ */ jsx(Badge, { variant: "default", className: "bg-status-success-solid text-status-success-solid-foreground text-xs", children: "Enabled" }) : /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs", children: "Disabled" })
|
|
199
|
+
] }),
|
|
200
|
+
rule.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground line-clamp-2 mb-2", children: rule.description }),
|
|
201
|
+
/* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground space-y-0.5", children: [
|
|
202
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
203
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: "Entity:" }),
|
|
204
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-xs", children: rule.entityType })
|
|
205
|
+
] }),
|
|
206
|
+
rule.eventType && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
207
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: "Event:" }),
|
|
208
|
+
/* @__PURE__ */ jsx("span", { children: rule.eventType })
|
|
209
|
+
] })
|
|
210
|
+
] })
|
|
211
|
+
]
|
|
212
|
+
},
|
|
213
|
+
rule.id
|
|
214
|
+
)) })
|
|
215
|
+
] }) }),
|
|
216
|
+
/* @__PURE__ */ jsxs(DrawerFooter, { children: [
|
|
217
|
+
!disableInlineCreate && /* @__PURE__ */ jsxs(
|
|
218
|
+
Button,
|
|
219
|
+
{
|
|
220
|
+
type: "button",
|
|
221
|
+
variant: "secondary",
|
|
222
|
+
onClick: () => setIsInlineEditorOpen(true),
|
|
223
|
+
children: [
|
|
224
|
+
/* @__PURE__ */ jsx(Plus, { className: "size-4 mr-1" }),
|
|
225
|
+
t("workflows.businessRules.newRule")
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
),
|
|
229
|
+
/* @__PURE__ */ jsx(
|
|
230
|
+
Button,
|
|
231
|
+
{
|
|
232
|
+
type: "button",
|
|
233
|
+
variant: "outline",
|
|
234
|
+
onClick: handleClose,
|
|
235
|
+
children: t("common.cancel", "Cancel")
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
] })
|
|
239
|
+
]
|
|
113
240
|
}
|
|
114
241
|
) }),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Loading business rules..." })
|
|
118
|
-
] }) : error ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-12", children: [
|
|
119
|
-
/* @__PURE__ */ jsx(AlertCircle, { className: "h-16 w-16 text-destructive mb-4" }),
|
|
120
|
-
/* @__PURE__ */ jsx("p", { className: "text-destructive text-sm font-medium mb-2", children: error }),
|
|
121
|
-
/* @__PURE__ */ jsx(
|
|
122
|
-
Button,
|
|
123
|
-
{
|
|
124
|
-
variant: "outline",
|
|
125
|
-
size: "sm",
|
|
126
|
-
onClick: fetchBusinessRules,
|
|
127
|
-
children: "Retry"
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
] }) : filteredRules.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-12", children: [
|
|
131
|
-
/* @__PURE__ */ jsx("svg", { className: "w-16 h-16 text-muted mb-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }),
|
|
132
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-2", children: emptyMessage || (searchQuery ? "No business rules found matching your search" : businessRules.length === 0 ? "No business rules exist yet" : "All business rules have already been added") }),
|
|
133
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs mb-3", children: businessRules.length === 0 ? "Create business rules in the Business Rules module first" : searchQuery ? `Showing 0 of ${businessRules.length} total rules` : `${businessRules.length} rules already added` }),
|
|
134
|
-
searchQuery && /* @__PURE__ */ jsx(
|
|
135
|
-
Button,
|
|
136
|
-
{
|
|
137
|
-
variant: "link",
|
|
138
|
-
size: "sm",
|
|
139
|
-
onClick: () => setSearchQuery(""),
|
|
140
|
-
children: "Clear search"
|
|
141
|
-
}
|
|
142
|
-
)
|
|
143
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
144
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-3 text-sm text-muted-foreground", children: [
|
|
145
|
-
filteredRules.length,
|
|
146
|
-
" rule",
|
|
147
|
-
filteredRules.length !== 1 ? "s" : "",
|
|
148
|
-
" available"
|
|
149
|
-
] }),
|
|
150
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-3", children: filteredRules.map((rule) => /* @__PURE__ */ jsxs(
|
|
151
|
-
"button",
|
|
152
|
-
{
|
|
153
|
-
onClick: () => handleSelect(rule),
|
|
154
|
-
className: "text-left p-4 border-2 border-border rounded-lg hover:border-primary hover:bg-accent transition-all group",
|
|
155
|
-
children: [
|
|
156
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between mb-2", children: [
|
|
157
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
158
|
-
/* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold group-hover:text-primary truncate", children: rule.ruleName }),
|
|
159
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground font-mono mt-0.5 truncate", children: rule.ruleId })
|
|
160
|
-
] }),
|
|
161
|
-
/* @__PURE__ */ jsx(Plus, { className: "size-5 text-muted-foreground group-hover:text-primary transition-colors flex-shrink-0 ml-2" })
|
|
162
|
-
] }),
|
|
163
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2 flex-wrap", children: [
|
|
164
|
-
/* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs", children: rule.ruleType }),
|
|
165
|
-
rule.ruleCategory && /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-xs", children: rule.ruleCategory }),
|
|
166
|
-
rule.enabled ? /* @__PURE__ */ jsx(Badge, { variant: "default", className: "bg-status-success-solid text-status-success-solid-foreground text-xs", children: "Enabled" }) : /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs", children: "Disabled" })
|
|
167
|
-
] }),
|
|
168
|
-
rule.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground line-clamp-2 mb-2", children: rule.description }),
|
|
169
|
-
/* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground space-y-0.5", children: [
|
|
170
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
171
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium", children: "Entity:" }),
|
|
172
|
-
/* @__PURE__ */ jsx("span", { className: "font-mono text-xs", children: rule.entityType })
|
|
173
|
-
] }),
|
|
174
|
-
rule.eventType && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
175
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium", children: "Event:" }),
|
|
176
|
-
/* @__PURE__ */ jsx("span", { children: rule.eventType })
|
|
177
|
-
] })
|
|
178
|
-
] })
|
|
179
|
-
]
|
|
180
|
-
},
|
|
181
|
-
rule.id
|
|
182
|
-
)) })
|
|
183
|
-
] }) }),
|
|
184
|
-
/* @__PURE__ */ jsx(DialogFooter, { children: /* @__PURE__ */ jsx(
|
|
185
|
-
Button,
|
|
242
|
+
!disableInlineCreate && /* @__PURE__ */ jsx(
|
|
243
|
+
InlineRuleEditor,
|
|
186
244
|
{
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
245
|
+
open: isInlineEditorOpen,
|
|
246
|
+
onOpenChange: setIsInlineEditorOpen,
|
|
247
|
+
defaultEntityType: filterEntityType,
|
|
248
|
+
onSaved: handleInlineRuleSaved
|
|
191
249
|
}
|
|
192
|
-
)
|
|
193
|
-
] })
|
|
250
|
+
)
|
|
251
|
+
] });
|
|
194
252
|
}
|
|
195
253
|
export {
|
|
196
254
|
BusinessRulesSelector
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/workflows/components/BusinessRulesSelector.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport { useState, useEffect } from 'react'\nimport { apiFetch } from '@open-mercato/ui/backend/utils/api'\nimport { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from '@open-mercato/ui/primitives/dialog'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { Input } from '@open-mercato/ui/primitives/input'\nimport { Badge } from '@open-mercato/ui/primitives/badge'\nimport { Plus, Loader2, AlertCircle } from 'lucide-react'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\n\nconst logger = createLogger('workflows')\n\nexport interface BusinessRule {\n id: string\n ruleId: string\n ruleName: string\n description: string | null\n ruleType: string\n ruleCategory: string | null\n entityType: string\n eventType: string | null\n enabled: boolean\n}\n\nexport interface BusinessRulesSelectorProps {\n /** Whether the dialog is open */\n isOpen: boolean\n\n /** Callback when dialog is closed */\n onClose: () => void\n\n /** Callback when a rule is selected */\n onSelect: (ruleId: string, rule: BusinessRule) => void\n\n /** Array of rule IDs to exclude from the list (already selected) */\n excludeRuleIds?: string[]\n\n /** Dialog title */\n title?: string\n\n /** Dialog description */\n description?: string\n\n /** Filter rules by entity type */\n filterEntityType?: string\n\n /** Filter rules by rule type */\n filterRuleType?: string\n\n /** Filter rules by category */\n filterCategory?: string\n\n /** Whether to show only enabled rules */\n onlyEnabled?: boolean\n\n /** Custom empty state message */\n emptyMessage?: string\n\n /** Custom search placeholder */\n searchPlaceholder?: string\n}\n\n/**\n * BusinessRulesSelector - Reusable dialog for searching and selecting business rules\n *\n * Features:\n * - Search/filter business rules by name, ID, type, category, description\n * - Filter by entity type, rule type, category\n * - Display rule details (badges, description)\n * - Exclude already-selected rules\n * - Loading and error states\n * - Responsive grid layout\n */\nexport function BusinessRulesSelector({\n isOpen,\n onClose,\n onSelect,\n excludeRuleIds = [],\n title = 'Select Business Rule',\n description = 'Choose a business rule from the list',\n filterEntityType,\n filterRuleType,\n filterCategory,\n onlyEnabled = false,\n emptyMessage,\n searchPlaceholder = 'Search by name, ID, type, category, or description...',\n}: BusinessRulesSelectorProps) {\n const [businessRules, setBusinessRules] = useState<BusinessRule[]>([])\n const [loading, setLoading] = useState(false)\n const [error, setError] = useState<string | null>(null)\n const [searchQuery, setSearchQuery] = useState('')\n\n // Fetch business rules on mount\n useEffect(() => {\n if (isOpen) {\n fetchBusinessRules()\n }\n }, [isOpen])\n\n const fetchBusinessRules = async () => {\n setLoading(true)\n setError(null)\n try {\n // Build query params - only include defined values\n const params = new URLSearchParams()\n params.set('pageSize', '100') // Max allowed by API (business_rules route has max 100)\n\n if (filterEntityType) {\n params.set('entityType', filterEntityType)\n }\n if (filterRuleType) {\n params.set('ruleType', filterRuleType)\n }\n if (filterCategory) {\n params.set('ruleCategory', filterCategory) // Correct parameter name\n }\n if (onlyEnabled) {\n params.set('enabled', 'true')\n }\n\n const url = `/api/business_rules/rules?${params.toString()}`\n const response = await apiFetch(url)\n\n if (response.ok) {\n const data = await response.json()\n setBusinessRules(data.items || [])\n } else {\n let errorMessage = `Failed to load business rules (${response.status})`\n try {\n const errorData = await response.json()\n if (errorData.error) {\n errorMessage = errorData.error\n }\n } catch {\n // If response is not JSON, use status code message\n errorMessage = `Failed to load business rules (${response.status})`\n }\n logger.error('Failed to fetch business rules', {\n url,\n status: response.status,\n message: errorMessage,\n })\n setError(errorMessage)\n }\n } catch (err) {\n logger.error('Failed to fetch business rules', { err })\n const errorMessage = err instanceof Error ? err.message : 'Network error loading business rules'\n setError(errorMessage)\n } finally {\n setLoading(false)\n }\n }\n\n // Filter rules based on search query and exclusions\n const getFilteredRules = (): BusinessRule[] => {\n return businessRules\n .filter(rule => !excludeRuleIds.includes(rule.ruleId))\n .filter(rule => {\n if (!searchQuery) return true\n const query = searchQuery.toLowerCase()\n return (\n rule.ruleName.toLowerCase().includes(query) ||\n rule.ruleId.toLowerCase().includes(query) ||\n rule.description?.toLowerCase().includes(query) ||\n rule.ruleType.toLowerCase().includes(query) ||\n rule.ruleCategory?.toLowerCase().includes(query) ||\n rule.entityType.toLowerCase().includes(query)\n )\n })\n }\n\n const handleSelect = (rule: BusinessRule) => {\n onSelect(rule.ruleId, rule)\n setSearchQuery('') // Clear search on select\n }\n\n const handleClose = () => {\n setSearchQuery('')\n onClose()\n }\n\n const filteredRules = getFilteredRules()\n\n return (\n <Dialog open={isOpen} onOpenChange={handleClose}>\n <DialogContent className=\"sm:max-w-5xl max-h-[85vh] flex flex-col\">\n <DialogHeader>\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n\n {/* Search Input */}\n <div className=\"px-6\">\n <Input\n type=\"text\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n placeholder={searchPlaceholder}\n autoFocus\n disabled={loading}\n />\n </div>\n\n {/* Rules List */}\n <div className=\"flex-1 overflow-y-auto px-6 py-4 min-h-[400px]\">\n {loading ? (\n <div className=\"flex flex-col items-center justify-center py-12\">\n <Loader2 className=\"h-12 w-12 animate-spin text-primary mb-4\" />\n <p className=\"text-muted-foreground text-sm\">Loading business rules...</p>\n </div>\n ) : error ? (\n <div className=\"flex flex-col items-center justify-center py-12\">\n <AlertCircle className=\"h-16 w-16 text-destructive mb-4\" />\n <p className=\"text-destructive text-sm font-medium mb-2\">{error}</p>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={fetchBusinessRules}\n >\n Retry\n </Button>\n </div>\n ) : filteredRules.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center py-12\">\n <svg className=\"w-16 h-16 text-muted mb-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z\" />\n </svg>\n <p className=\"text-muted-foreground text-sm mb-2\">\n {emptyMessage || (\n searchQuery\n ? 'No business rules found matching your search'\n : businessRules.length === 0\n ? 'No business rules exist yet'\n : 'All business rules have already been added'\n )}\n </p>\n <p className=\"text-muted-foreground text-xs mb-3\">\n {businessRules.length === 0\n ? 'Create business rules in the Business Rules module first'\n : searchQuery\n ? `Showing 0 of ${businessRules.length} total rules`\n : `${businessRules.length} rules already added`\n }\n </p>\n {searchQuery && (\n <Button\n variant=\"link\"\n size=\"sm\"\n onClick={() => setSearchQuery('')}\n >\n Clear search\n </Button>\n )}\n </div>\n ) : (\n <>\n <div className=\"mb-3 text-sm text-muted-foreground\">\n {filteredRules.length} rule{filteredRules.length !== 1 ? 's' : ''} available\n </div>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-3\">\n {filteredRules.map((rule) => (\n <button\n key={rule.id}\n onClick={() => handleSelect(rule)}\n className=\"text-left p-4 border-2 border-border rounded-lg hover:border-primary hover:bg-accent transition-all group\"\n >\n <div className=\"flex items-start justify-between mb-2\">\n <div className=\"flex-1 min-w-0\">\n <h4 className=\"text-sm font-semibold group-hover:text-primary truncate\">\n {rule.ruleName}\n </h4>\n <p className=\"text-xs text-muted-foreground font-mono mt-0.5 truncate\">\n {rule.ruleId}\n </p>\n </div>\n <Plus className=\"size-5 text-muted-foreground group-hover:text-primary transition-colors flex-shrink-0 ml-2\" />\n </div>\n\n <div className=\"flex items-center gap-2 mb-2 flex-wrap\">\n <Badge variant=\"secondary\" className=\"text-xs\">\n {rule.ruleType}\n </Badge>\n {rule.ruleCategory && (\n <Badge variant=\"outline\" className=\"text-xs\">\n {rule.ruleCategory}\n </Badge>\n )}\n {rule.enabled ? (\n <Badge variant=\"default\" className=\"bg-status-success-solid text-status-success-solid-foreground text-xs\">\n Enabled\n </Badge>\n ) : (\n <Badge variant=\"secondary\" className=\"text-xs\">\n Disabled\n </Badge>\n )}\n </div>\n\n {rule.description && (\n <p className=\"text-xs text-muted-foreground line-clamp-2 mb-2\">\n {rule.description}\n </p>\n )}\n\n <div className=\"text-xs text-muted-foreground space-y-0.5\">\n <div className=\"flex items-center gap-1\">\n <span className=\"font-medium\">Entity:</span>\n <span className=\"font-mono text-xs\">{rule.entityType}</span>\n </div>\n {rule.eventType && (\n <div className=\"flex items-center gap-1\">\n <span className=\"font-medium\">Event:</span>\n <span>{rule.eventType}</span>\n </div>\n )}\n </div>\n </button>\n ))}\n </div>\n </>\n )}\n </div>\n\n <DialogFooter>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={handleClose}\n >\n Cancel\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport { useState, useEffect } from 'react'\nimport { apiFetch } from '@open-mercato/ui/backend/utils/api'\nimport {\n Drawer,\n DrawerBody,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerTitle,\n} from '@open-mercato/ui/primitives/drawer'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { Input } from '@open-mercato/ui/primitives/input'\nimport { Badge } from '@open-mercato/ui/primitives/badge'\nimport { Plus, Loader2, AlertCircle } from 'lucide-react'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { InlineRuleEditor, type InlineRuleEditorSavedRule } from '@open-mercato/core/modules/business_rules/components/InlineRuleEditor'\n\nconst logger = createLogger('workflows')\n\nexport interface BusinessRule {\n id: string\n ruleId: string\n ruleName: string\n description: string | null\n ruleType: string\n ruleCategory: string | null\n entityType: string\n eventType: string | null\n enabled: boolean\n}\n\nexport interface BusinessRulesSelectorProps {\n /** Whether the dialog is open */\n isOpen: boolean\n\n /** Callback when dialog is closed */\n onClose: () => void\n\n /** Callback when a rule is selected */\n onSelect: (ruleId: string, rule: BusinessRule) => void\n\n /** Array of rule IDs to exclude from the list (already selected) */\n excludeRuleIds?: string[]\n\n /** Dialog title */\n title?: string\n\n /** Dialog description */\n description?: string\n\n /** Filter rules by entity type */\n filterEntityType?: string\n\n /** Filter rules by rule type */\n filterRuleType?: string\n\n /** Filter rules by category */\n filterCategory?: string\n\n /** Whether to show only enabled rules */\n onlyEnabled?: boolean\n\n /** Custom empty state message */\n emptyMessage?: string\n\n /** Custom search placeholder */\n searchPlaceholder?: string\n\n /**\n * Hide the inline \"New rule\" affordance. The inline editor is on by default\n * (#4236) so an author never has to leave the Studio to author a rule.\n */\n disableInlineCreate?: boolean\n}\n\n/**\n * BusinessRulesSelector - Reusable dialog for searching and selecting business rules\n *\n * Features:\n * - Search/filter business rules by name, ID, type, category, description\n * - Filter by entity type, rule type, category\n * - Display rule details (badges, description)\n * - Exclude already-selected rules\n * - Loading and error states\n * - Responsive grid layout\n */\nexport function BusinessRulesSelector({\n isOpen,\n onClose,\n onSelect,\n excludeRuleIds = [],\n title = 'Select Business Rule',\n description = 'Choose a business rule from the list',\n filterEntityType,\n filterRuleType,\n filterCategory,\n onlyEnabled = false,\n emptyMessage,\n searchPlaceholder = 'Search by name, ID, type, category, or description...',\n disableInlineCreate = false,\n}: BusinessRulesSelectorProps) {\n const t = useT()\n const [businessRules, setBusinessRules] = useState<BusinessRule[]>([])\n const [loading, setLoading] = useState(false)\n const [error, setError] = useState<string | null>(null)\n const [searchQuery, setSearchQuery] = useState('')\n const [isInlineEditorOpen, setIsInlineEditorOpen] = useState(false)\n\n // Fetch business rules on mount\n useEffect(() => {\n if (isOpen) {\n fetchBusinessRules()\n }\n }, [isOpen])\n\n const fetchBusinessRules = async (): Promise<BusinessRule[]> => {\n setLoading(true)\n setError(null)\n try {\n // Build query params - only include defined values\n const params = new URLSearchParams()\n params.set('pageSize', '100') // Max allowed by API (business_rules route has max 100)\n\n if (filterEntityType) {\n params.set('entityType', filterEntityType)\n }\n if (filterRuleType) {\n params.set('ruleType', filterRuleType)\n }\n if (filterCategory) {\n params.set('ruleCategory', filterCategory) // Correct parameter name\n }\n if (onlyEnabled) {\n params.set('enabled', 'true')\n }\n\n const url = `/api/business_rules/rules?${params.toString()}`\n const response = await apiFetch(url)\n\n if (response.ok) {\n const data = await response.json()\n const items: BusinessRule[] = data.items || []\n setBusinessRules(items)\n return items\n } else {\n let errorMessage = `Failed to load business rules (${response.status})`\n try {\n const errorData = await response.json()\n if (errorData.error) {\n errorMessage = errorData.error\n }\n } catch {\n // If response is not JSON, use status code message\n errorMessage = `Failed to load business rules (${response.status})`\n }\n logger.error('Failed to fetch business rules', {\n url,\n status: response.status,\n message: errorMessage,\n })\n setError(errorMessage)\n }\n } catch (err) {\n logger.error('Failed to fetch business rules', { err })\n const errorMessage = err instanceof Error ? err.message : 'Network error loading business rules'\n setError(errorMessage)\n } finally {\n setLoading(false)\n }\n return []\n }\n\n const handleInlineRuleSaved = async (saved: InlineRuleEditorSavedRule) => {\n const refreshed = await fetchBusinessRules()\n const created = refreshed.find((rule) => rule.ruleId === saved.ruleId)\n if (created) {\n handleSelect(created)\n }\n }\n\n // Filter rules based on search query and exclusions\n const getFilteredRules = (): BusinessRule[] => {\n return businessRules\n .filter(rule => !excludeRuleIds.includes(rule.ruleId))\n .filter(rule => {\n if (!searchQuery) return true\n const query = searchQuery.toLowerCase()\n return (\n rule.ruleName.toLowerCase().includes(query) ||\n rule.ruleId.toLowerCase().includes(query) ||\n rule.description?.toLowerCase().includes(query) ||\n rule.ruleType.toLowerCase().includes(query) ||\n rule.ruleCategory?.toLowerCase().includes(query) ||\n rule.entityType.toLowerCase().includes(query)\n )\n })\n }\n\n const handleSelect = (rule: BusinessRule) => {\n onSelect(rule.ruleId, rule)\n setSearchQuery('') // Clear search on select\n }\n\n const handleClose = () => {\n setSearchQuery('')\n onClose()\n }\n\n const filteredRules = getFilteredRules()\n\n return (\n <>\n <Drawer open={isOpen} onOpenChange={(next) => { if (!next) handleClose() }}>\n <DrawerContent\n data-testid=\"workflow-business-rules-selector-drawer\"\n className=\"w-full max-w-none sm:w-3/5\"\n closeAriaLabel={t('workflows.selectors.businessRule.close')}\n >\n <DrawerHeader>\n <DrawerTitle>{title}</DrawerTitle>\n <DrawerDescription>{description}</DrawerDescription>\n </DrawerHeader>\n\n {/* Search Input */}\n <div className=\"px-6\">\n <Input\n type=\"text\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n placeholder={searchPlaceholder}\n autoFocus\n disabled={loading}\n />\n </div>\n\n {/* Rules List */}\n <DrawerBody className=\"py-4\">\n {loading ? (\n <div className=\"flex flex-col items-center justify-center py-12\">\n <Loader2 className=\"h-12 w-12 animate-spin text-primary mb-4\" />\n <p className=\"text-muted-foreground text-sm\">Loading business rules...</p>\n </div>\n ) : error ? (\n <div className=\"flex flex-col items-center justify-center py-12\">\n <AlertCircle className=\"h-16 w-16 text-destructive mb-4\" />\n <p className=\"text-destructive text-sm font-medium mb-2\">{error}</p>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={fetchBusinessRules}\n >\n Retry\n </Button>\n </div>\n ) : filteredRules.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center py-12\">\n <svg className=\"w-16 h-16 text-muted mb-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z\" />\n </svg>\n <p className=\"text-muted-foreground text-sm mb-2\">\n {emptyMessage || (\n searchQuery\n ? 'No business rules found matching your search'\n : businessRules.length === 0\n ? 'No business rules exist yet'\n : 'All business rules have already been added'\n )}\n </p>\n <p className=\"text-muted-foreground text-xs mb-3\">\n {businessRules.length === 0\n ? 'Create business rules in the Business Rules module first'\n : searchQuery\n ? `Showing 0 of ${businessRules.length} total rules`\n : `${businessRules.length} rules already added`\n }\n </p>\n {searchQuery && (\n <Button\n variant=\"link\"\n size=\"sm\"\n onClick={() => setSearchQuery('')}\n >\n Clear search\n </Button>\n )}\n </div>\n ) : (\n <>\n <div className=\"mb-3 text-sm text-muted-foreground\">\n {filteredRules.length} rule{filteredRules.length !== 1 ? 's' : ''} available\n </div>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-3\">\n {filteredRules.map((rule) => (\n <button\n key={rule.id}\n onClick={() => handleSelect(rule)}\n className=\"text-left p-4 border-2 border-border rounded-lg hover:border-primary hover:bg-accent transition-all group\"\n >\n <div className=\"flex items-start justify-between mb-2\">\n <div className=\"flex-1 min-w-0\">\n <h4 className=\"text-sm font-semibold group-hover:text-primary truncate\">\n {rule.ruleName}\n </h4>\n <p className=\"text-xs text-muted-foreground font-mono mt-0.5 truncate\">\n {rule.ruleId}\n </p>\n </div>\n <Plus className=\"size-5 text-muted-foreground group-hover:text-primary transition-colors flex-shrink-0 ml-2\" />\n </div>\n\n <div className=\"flex items-center gap-2 mb-2 flex-wrap\">\n <Badge variant=\"secondary\" className=\"text-xs\">\n {rule.ruleType}\n </Badge>\n {rule.ruleCategory && (\n <Badge variant=\"outline\" className=\"text-xs\">\n {rule.ruleCategory}\n </Badge>\n )}\n {rule.enabled ? (\n <Badge variant=\"default\" className=\"bg-status-success-solid text-status-success-solid-foreground text-xs\">\n Enabled\n </Badge>\n ) : (\n <Badge variant=\"secondary\" className=\"text-xs\">\n Disabled\n </Badge>\n )}\n </div>\n\n {rule.description && (\n <p className=\"text-xs text-muted-foreground line-clamp-2 mb-2\">\n {rule.description}\n </p>\n )}\n\n <div className=\"text-xs text-muted-foreground space-y-0.5\">\n <div className=\"flex items-center gap-1\">\n <span className=\"font-medium\">Entity:</span>\n <span className=\"font-mono text-xs\">{rule.entityType}</span>\n </div>\n {rule.eventType && (\n <div className=\"flex items-center gap-1\">\n <span className=\"font-medium\">Event:</span>\n <span>{rule.eventType}</span>\n </div>\n )}\n </div>\n </button>\n ))}\n </div>\n </>\n )}\n </DrawerBody>\n\n <DrawerFooter>\n {!disableInlineCreate && (\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={() => setIsInlineEditorOpen(true)}\n >\n <Plus className=\"size-4 mr-1\" />\n {t('workflows.businessRules.newRule')}\n </Button>\n )}\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={handleClose}\n >\n {t('common.cancel', 'Cancel')}\n </Button>\n </DrawerFooter>\n </DrawerContent>\n </Drawer>\n {!disableInlineCreate && (\n <InlineRuleEditor\n open={isInlineEditorOpen}\n onOpenChange={setIsInlineEditorOpen}\n defaultEntityType={filterEntityType}\n onSaved={handleInlineRuleSaved}\n />\n )}\n </>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AA8NQ,SAqEI,UApEF,KADF;AA5NR,SAAS,UAAU,iBAAiB;AACpC,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;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