@burdenoff/microfe-headshotmarketing 2026.928.2 → 2026.1029.1

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.
Files changed (63) hide show
  1. package/dist/generated/global-types.d.ts +5145 -1627
  2. package/dist/generated/global-types.d.ts.map +1 -1
  3. package/dist/generated/wspace-operations.d.ts +464 -248
  4. package/dist/generated/wspace-operations.d.ts.map +1 -1
  5. package/dist/generated/wspace-operations.js +320 -292
  6. package/dist/generated/wspace-operations.js.map +1 -1
  7. package/dist/generated/wspace-types.d.ts +21251 -468
  8. package/dist/generated/wspace-types.d.ts.map +1 -1
  9. package/dist/generated/wspace-types.js +20 -20
  10. package/dist/generated/wspace-types.js.map +1 -1
  11. package/dist/headshotmarketing/components/PageLayout.d.ts +5 -0
  12. package/dist/headshotmarketing/components/PageLayout.d.ts.map +1 -1
  13. package/dist/headshotmarketing/components/PageLayout.js +12 -6
  14. package/dist/headshotmarketing/components/PageLayout.js.map +1 -1
  15. package/dist/headshotmarketing/components/StatusBadge.d.ts.map +1 -1
  16. package/dist/headshotmarketing/components/StatusBadge.js +3 -0
  17. package/dist/headshotmarketing/components/StatusBadge.js.map +1 -1
  18. package/dist/headshotmarketing/pages/automation/AutomationPage.d.ts.map +1 -1
  19. package/dist/headshotmarketing/pages/automation/AutomationPage.js +172 -167
  20. package/dist/headshotmarketing/pages/automation/AutomationPage.js.map +1 -1
  21. package/dist/headshotmarketing/pages/automation/TriggersPage.d.ts.map +1 -1
  22. package/dist/headshotmarketing/pages/automation/TriggersPage.js +127 -143
  23. package/dist/headshotmarketing/pages/automation/TriggersPage.js.map +1 -1
  24. package/dist/headshotmarketing/pages/automation/WorkflowActions.d.ts +16 -16
  25. package/dist/headshotmarketing/pages/automation/WorkflowActions.d.ts.map +1 -1
  26. package/dist/headshotmarketing/pages/automation/WorkflowActions.js +104 -221
  27. package/dist/headshotmarketing/pages/automation/WorkflowActions.js.map +1 -1
  28. package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.d.ts +16 -0
  29. package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.d.ts.map +1 -1
  30. package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js +470 -549
  31. package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js.map +1 -1
  32. package/dist/headshotmarketing/pages/automation/WorkflowCanvasNode.d.ts +2 -0
  33. package/dist/headshotmarketing/pages/automation/WorkflowCanvasNode.d.ts.map +1 -1
  34. package/dist/headshotmarketing/pages/automation/WorkflowCanvasNode.js +19 -19
  35. package/dist/headshotmarketing/pages/automation/WorkflowCanvasNode.js.map +1 -1
  36. package/dist/headshotmarketing/pages/automation/WorkflowNodeConfigPanel.d.ts.map +1 -1
  37. package/dist/headshotmarketing/pages/automation/WorkflowNodeConfigPanel.js +341 -164
  38. package/dist/headshotmarketing/pages/automation/WorkflowNodeConfigPanel.js.map +1 -1
  39. package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.d.ts +13 -0
  40. package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.d.ts.map +1 -0
  41. package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.js +294 -0
  42. package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.js.map +1 -0
  43. package/dist/headshotmarketing/pages/automation/WorkflowsPage.d.ts +2 -0
  44. package/dist/headshotmarketing/pages/automation/WorkflowsPage.d.ts.map +1 -1
  45. package/dist/headshotmarketing/pages/automation/WorkflowsPage.js +198 -220
  46. package/dist/headshotmarketing/pages/automation/WorkflowsPage.js.map +1 -1
  47. package/dist/headshotmarketing/pages/automation/useAutomationData.d.ts +24 -0
  48. package/dist/headshotmarketing/pages/automation/useAutomationData.d.ts.map +1 -0
  49. package/dist/headshotmarketing/pages/automation/useAutomationData.js +77 -0
  50. package/dist/headshotmarketing/pages/automation/useAutomationData.js.map +1 -0
  51. package/dist/headshotmarketing/pages/automation/workflowBuilderModel.d.ts +73 -16
  52. package/dist/headshotmarketing/pages/automation/workflowBuilderModel.d.ts.map +1 -1
  53. package/dist/headshotmarketing/pages/automation/workflowBuilderModel.js +220 -80
  54. package/dist/headshotmarketing/pages/automation/workflowBuilderModel.js.map +1 -1
  55. package/dist/headshotmarketing/pages/automation/workflowCompiler.d.ts +51 -0
  56. package/dist/headshotmarketing/pages/automation/workflowCompiler.d.ts.map +1 -0
  57. package/dist/headshotmarketing/pages/automation/workflowCompiler.js +453 -0
  58. package/dist/headshotmarketing/pages/automation/workflowCompiler.js.map +1 -0
  59. package/dist/headshotmarketing/utils/automationMapper.d.ts +50 -29
  60. package/dist/headshotmarketing/utils/automationMapper.d.ts.map +1 -1
  61. package/dist/headshotmarketing/utils/automationMapper.js +55 -99
  62. package/dist/headshotmarketing/utils/automationMapper.js.map +1 -1
  63. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"WorkflowNodeConfigPanel.js","names":[],"sources":["../../../../src/headshotmarketing/pages/automation/WorkflowNodeConfigPanel.tsx"],"sourcesContent":["/**\n * Right-hand configuration panel for the selected canvas node.\n * Every field is controlled and writes back into the node's config so the\n * data actually persists through serializeGraph → createHeadshotmarketingWorkflow.\n * @module headshotmarketing/pages/automation\n */\nimport type { FC } from \"react\";\nimport { Settings, X } from \"lucide-react\";\nimport {\n CHIP_TONE,\n TRIGGER_TYPES,\n actionMeta,\n nodeIcon,\n nodeTone,\n type CanvasNode,\n type NodeConfig,\n} from \"./workflowBuilderModel\";\nimport { cn } from \"../../utils/helpers\";\n\nconst FIELD =\n \"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\";\nconst FIELD_LABEL = \"block text-xs font-medium text-text-primary mb-1\";\n\nconst EMAIL_TEMPLATES = [\n \"Welcome Email\",\n \"Onboarding Tips\",\n \"Follow-up\",\n \"Case Study\",\n \"Newsletter\",\n];\n\ninterface WorkflowNodeConfigPanelProps {\n node: CanvasNode;\n onLabelChange: (label: string) => void;\n onConfigChange: (patch: Partial<NodeConfig>) => void;\n onTriggerChange: (type: string) => void;\n onClose?: () => void;\n}\n\nexport const WorkflowNodeConfigPanel: FC<WorkflowNodeConfigPanelProps> = ({\n node,\n onLabelChange,\n onConfigChange,\n onTriggerChange,\n onClose,\n}) => {\n const Icon = nodeIcon(node);\n const tone = nodeTone(node);\n const isTrigger = node.kind === \"trigger\";\n const cfg = node.config;\n const typeLabel = isTrigger\n ? \"Trigger\"\n : (actionMeta(node.actionType)?.label ?? node.actionType);\n\n return (\n <div className=\"rounded-card border border-border-seam bg-gloss-card shadow-pop p-4\">\n <div className=\"mb-4 flex items-center justify-between gap-2\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <span\n className={cn(\n \"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg ring-1 ring-inset\",\n CHIP_TONE[tone],\n )}\n >\n <Icon className=\"h-4 w-4\" />\n </span>\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-semibold text-text-primary\">\n Configure step\n </p>\n <p className=\"truncate text-xs text-text-secondary\">{typeLabel}</p>\n </div>\n </div>\n {onClose && (\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close configuration\"\n className=\"rounded-md p-1 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n\n <div className=\"space-y-4\">\n <div>\n <label className={FIELD_LABEL}>Label</label>\n <input\n type=\"text\"\n value={node.label}\n onChange={(e) => onLabelChange(e.target.value)}\n className={FIELD}\n placeholder=\"Step name\"\n />\n </div>\n\n {isTrigger && (\n <div>\n <label className={FIELD_LABEL}>Trigger type</label>\n <select\n value={node.actionType}\n onChange={(e) => onTriggerChange(e.target.value)}\n className={FIELD}\n >\n {TRIGGER_TYPES.map((t) => (\n <option key={t.type} value={t.type}>\n {t.label}\n </option>\n ))}\n </select>\n </div>\n )}\n\n <div>\n <label className={FIELD_LABEL}>Description</label>\n <input\n type=\"text\"\n value={cfg.description ?? \"\"}\n onChange={(e) => onConfigChange({ description: e.target.value })}\n className={FIELD}\n placeholder=\"What this step does\"\n />\n </div>\n\n {node.actionType === \"send_email\" && (\n <div>\n <label className={FIELD_LABEL}>Email template</label>\n <select\n value={cfg.emailTemplate ?? EMAIL_TEMPLATES[0]}\n onChange={(e) =>\n onConfigChange({ emailTemplate: e.target.value })\n }\n className={FIELD}\n >\n {EMAIL_TEMPLATES.map((tpl) => (\n <option key={tpl} value={tpl}>\n {tpl}\n </option>\n ))}\n </select>\n </div>\n )}\n\n {(node.actionType === \"send_sms\" || node.actionType === \"notify\") && (\n <div>\n <label className={FIELD_LABEL}>Message</label>\n <textarea\n value={cfg.message ?? \"\"}\n onChange={(e) => onConfigChange({ message: e.target.value })}\n rows={3}\n className={cn(FIELD, \"resize-none\")}\n placeholder=\"Message body\"\n />\n </div>\n )}\n\n {node.actionType === \"wait\" && (\n <div className=\"grid grid-cols-2 gap-2\">\n <div>\n <label className={FIELD_LABEL}>Duration</label>\n <input\n type=\"number\"\n min={1}\n value={cfg.waitDuration ?? \"\"}\n onChange={(e) =>\n onConfigChange({\n waitDuration:\n e.target.value === \"\"\n ? undefined\n : Number(e.target.value),\n })\n }\n className={FIELD}\n placeholder=\"3\"\n />\n </div>\n <div>\n <label className={FIELD_LABEL}>Unit</label>\n <select\n value={cfg.waitUnit ?? \"Days\"}\n onChange={(e) => onConfigChange({ waitUnit: e.target.value })}\n className={FIELD}\n >\n <option value=\"Hours\">Hours</option>\n <option value=\"Days\">Days</option>\n <option value=\"Weeks\">Weeks</option>\n </select>\n </div>\n </div>\n )}\n\n {node.actionType === \"condition\" && (\n <div>\n <label className={FIELD_LABEL}>Condition rule</label>\n <input\n type=\"text\"\n value={cfg.conditionRule ?? \"\"}\n onChange={(e) =>\n onConfigChange({ conditionRule: e.target.value })\n }\n className={FIELD}\n placeholder=\"e.g. Opened email\"\n />\n <p className=\"mt-1.5 text-[11px] text-text-secondary\">\n Branches into{\" \"}\n <span className=\"text-status-success-text\">Yes</span> and{\" \"}\n <span className=\"text-status-error-text\">No</span> paths.\n </p>\n </div>\n )}\n\n {node.actionType === \"webhook\" && (\n <div>\n <label className={FIELD_LABEL}>Webhook URL</label>\n <input\n type=\"url\"\n value={cfg.webhookUrl ?? \"\"}\n onChange={(e) => onConfigChange({ webhookUrl: e.target.value })}\n className={FIELD}\n placeholder=\"https://example.com/hook\"\n />\n </div>\n )}\n\n {node.actionType === \"add_tag\" && (\n <div>\n <label className={FIELD_LABEL}>Tag</label>\n <input\n type=\"text\"\n value={cfg.tag ?? \"\"}\n onChange={(e) => onConfigChange({ tag: e.target.value })}\n className={FIELD}\n placeholder=\"e.g. engaged-lead\"\n />\n </div>\n )}\n\n {node.actionType === \"update_score\" && (\n <div>\n <label className={FIELD_LABEL}>Points</label>\n <input\n type=\"number\"\n value={cfg.points ?? \"\"}\n onChange={(e) =>\n onConfigChange({\n points:\n e.target.value === \"\" ? undefined : Number(e.target.value),\n })\n }\n className={FIELD}\n placeholder=\"10\"\n />\n </div>\n )}\n </div>\n </div>\n );\n};\n\n/** Placeholder shown when no node is selected. */\nexport const WorkflowConfigEmpty: FC = () => (\n <div className=\"rounded-card border border-dashed border-border-subtle bg-bg-surface p-6 text-center\">\n <Settings className=\"mx-auto mb-2 h-8 w-8 text-text-secondary\" />\n <p className=\"text-sm font-medium text-text-primary\">No step selected</p>\n <p className=\"mt-1 text-xs text-text-secondary\">\n Click a node — or its gear icon — to configure it.\n </p>\n </div>\n);\n"],"mappings":";;;;;AAmBA,IAAM,IACJ,wKACI,IAAc,oDAEd,IAAkB;CACtB;CACA;CACA;CACA;CACA;CACD,EAUY,KAA6D,EACxE,SACA,kBACA,mBACA,oBACA,iBACI;CACJ,IAAM,IAAO,EAAS,EAAK,EACrB,IAAO,EAAS,EAAK,EACrB,IAAY,EAAK,SAAS,WAC1B,IAAM,EAAK,QACX,IAAY,IACd,YACC,EAAW,EAAK,WAAW,EAAE,SAAS,EAAK;AAEhD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AAA,UAAA,CACE,kBAAC,SAAD;KAAO,WAAW;eAAa;KAAc,CAAA,EAC7C,kBAAC,SAAD;KACE,MAAK;KACL,OAAO,EAAI,UAAU;KACrB,WAAW,MACT,EAAe,EACb,QACE,EAAE,OAAO,UAAU,KAAK,KAAA,IAAY,OAAO,EAAE,OAAO,MAAM,EAC7D,CAAC;KAEJ,WAAW;KACX,aAAY;KACZ,CAAA,CACE,EAAA,CAAA;IAEJ;KACF;;GAKG,UACX,kBAAC,OAAD;CAAK,WAAU;WAAf;EACE,kBAAC,GAAD,EAAU,WAAU,4CAA6C,CAAA;EACjE,kBAAC,KAAD;GAAG,WAAU;aAAwC;GAAoB,CAAA;EACzE,kBAAC,KAAD;GAAG,WAAU;aAAmC;GAE5C,CAAA;EACA"}
1
+ {"version":3,"file":"WorkflowNodeConfigPanel.js","names":[],"sources":["../../../../src/headshotmarketing/pages/automation/WorkflowNodeConfigPanel.tsx"],"sourcesContent":["/**\n * Right-hand configuration panel for the selected canvas node. Every field\n * maps to an engine step setting, so what is configured here is exactly what\n * compileGraph persists and the step engine executes (BOFF-10192).\n * @module headshotmarketing/pages/automation\n */\nimport type { FC, ReactNode } from \"react\";\nimport { Settings, X } from \"lucide-react\";\nimport {\n CHIP_TONE,\n CONDITION_FIELDS,\n CONDITION_OPERATORS,\n TRIGGER_TYPES,\n UPDATABLE_FIELDS,\n actionMeta,\n isBuilderTriggerType,\n nodeIcon,\n nodeTone,\n triggerLabel,\n type CanvasNode,\n type ConditionOperator,\n type NodeConfig,\n type UpdatableField,\n type WaitUnit,\n type WebhookMethod,\n} from \"./workflowBuilderModel\";\nimport { cn } from \"../../utils/helpers\";\n\nconst FIELD =\n \"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\";\nconst FIELD_LABEL = \"block text-xs font-medium text-text-primary mb-1\";\nconst HINT = \"mt-1 text-[11px] text-text-secondary\";\n\ninterface FieldProps {\n id: string;\n label: string;\n hint?: string;\n children: ReactNode;\n}\n\nconst Field: FC<FieldProps> = ({ id, label, hint, children }) => (\n <div>\n <label htmlFor={id} className={FIELD_LABEL}>\n {label}\n </label>\n {children}\n {hint && <p className={HINT}>{hint}</p>}\n </div>\n);\n\nfunction numberOrUndefined(value: string): number | undefined {\n if (value.trim() === \"\") return undefined;\n const n = Number(value);\n return Number.isFinite(n) ? n : undefined;\n}\n\ninterface WorkflowNodeConfigPanelProps {\n node: CanvasNode;\n onLabelChange: (label: string) => void;\n onConfigChange: (patch: Partial<NodeConfig>) => void;\n onTriggerChange: (type: string) => void;\n onClose?: () => void;\n}\n\nexport const WorkflowNodeConfigPanel: FC<WorkflowNodeConfigPanelProps> = ({\n node,\n onLabelChange,\n onConfigChange,\n onTriggerChange,\n onClose,\n}) => {\n const Icon = nodeIcon(node);\n const tone = nodeTone(node);\n const isTrigger = node.kind === \"trigger\";\n const meta = actionMeta(node.actionType);\n const cfg = node.config;\n const id = (name: string): string => `wf-${node.id}-${name}`;\n const typeLabel = isTrigger ? \"Trigger\" : (meta?.label ?? node.actionType);\n\n return (\n <div className=\"rounded-card border border-border-seam bg-gloss-card shadow-pop p-4\">\n <div className=\"mb-4 flex items-center justify-between gap-2\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <span\n className={cn(\n \"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg ring-1 ring-inset\",\n CHIP_TONE[tone],\n )}\n >\n <Icon className=\"h-4 w-4\" />\n </span>\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-semibold text-text-primary\">\n Configure step\n </p>\n <p className=\"truncate text-xs text-text-secondary\">{typeLabel}</p>\n </div>\n </div>\n {onClose && (\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close configuration\"\n className=\"rounded-md p-1 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n\n <div className=\"space-y-4\">\n {isTrigger ? (\n <>\n <Field id={id(\"trigger\")} label=\"Starts when\">\n <select\n id={id(\"trigger\")}\n value={node.actionType}\n onChange={(e) => onTriggerChange(e.target.value)}\n className={FIELD}\n >\n {!isBuilderTriggerType(node.actionType) && (\n <option value={node.actionType}>\n {triggerLabel(node.actionType)}\n </option>\n )}\n {TRIGGER_TYPES.map((t) => (\n <option key={t.type} value={t.type}>\n {t.label}\n </option>\n ))}\n </select>\n </Field>\n {node.actionType === \"SCORE_THRESHOLD\" && (\n <Field\n id={id(\"threshold\")}\n label=\"Score threshold\"\n hint=\"Runs when a lead's score rises to this value or above.\"\n >\n <input\n id={id(\"threshold\")}\n type=\"number\"\n value={cfg.scoreThreshold ?? \"\"}\n onChange={(e) =>\n onConfigChange({\n scoreThreshold: numberOrUndefined(e.target.value),\n })\n }\n className={FIELD}\n placeholder=\"80\"\n />\n </Field>\n )}\n </>\n ) : (\n <Field id={id(\"label\")} label=\"Step name\">\n <input\n id={id(\"label\")}\n type=\"text\"\n value={node.label}\n onChange={(e) => onLabelChange(e.target.value)}\n className={FIELD}\n placeholder={meta?.label ?? \"Step name\"}\n />\n </Field>\n )}\n\n {node.actionType === \"send_email\" && (\n <>\n <Field\n id={id(\"subject\")}\n label=\"Subject\"\n hint=\"Use {{field}} to insert lead or contact data, e.g. {{title}}.\"\n >\n <input\n id={id(\"subject\")}\n type=\"text\"\n value={cfg.subject ?? \"\"}\n onChange={(e) => onConfigChange({ subject: e.target.value })}\n className={FIELD}\n placeholder=\"Welcome aboard\"\n />\n </Field>\n <Field id={id(\"body\")} label=\"Body\">\n <textarea\n id={id(\"body\")}\n value={cfg.body ?? \"\"}\n onChange={(e) => onConfigChange({ body: e.target.value })}\n rows={4}\n className={cn(FIELD, \"resize-y\")}\n placeholder=\"Email body\"\n />\n </Field>\n </>\n )}\n\n {node.actionType === \"notify\" && (\n <>\n <Field\n id={id(\"title\")}\n label=\"Title\"\n hint=\"Sent in-app to the lead's assigned owner.\"\n >\n <input\n id={id(\"title\")}\n type=\"text\"\n value={cfg.title ?? \"\"}\n onChange={(e) => onConfigChange({ title: e.target.value })}\n className={FIELD}\n placeholder=\"Follow up with {{title}}\"\n />\n </Field>\n <Field id={id(\"body\")} label=\"Message\">\n <textarea\n id={id(\"body\")}\n value={cfg.body ?? \"\"}\n onChange={(e) => onConfigChange({ body: e.target.value })}\n rows={3}\n className={cn(FIELD, \"resize-y\")}\n placeholder=\"Message\"\n />\n </Field>\n </>\n )}\n\n {node.actionType === \"wait\" && (\n <div className=\"grid grid-cols-2 gap-2\">\n <Field id={id(\"duration\")} label=\"Wait for\">\n <input\n id={id(\"duration\")}\n type=\"number\"\n min={1}\n value={cfg.waitDuration ?? \"\"}\n onChange={(e) =>\n onConfigChange({\n waitDuration: numberOrUndefined(e.target.value),\n })\n }\n className={FIELD}\n placeholder=\"2\"\n />\n </Field>\n <Field id={id(\"unit\")} label=\"Unit\">\n <select\n id={id(\"unit\")}\n value={cfg.waitUnit ?? \"days\"}\n onChange={(e) =>\n onConfigChange({ waitUnit: e.target.value as WaitUnit })\n }\n className={FIELD}\n >\n <option value=\"minutes\">Minutes</option>\n <option value=\"hours\">Hours</option>\n <option value=\"days\">Days</option>\n </select>\n </Field>\n </div>\n )}\n\n {node.actionType === \"condition\" && (\n <>\n <Field id={id(\"field\")} label=\"Field\">\n <input\n id={id(\"field\")}\n type=\"text\"\n list={id(\"fields\")}\n value={cfg.field ?? \"\"}\n onChange={(e) => onConfigChange({ field: e.target.value })}\n className={FIELD}\n placeholder=\"score\"\n />\n <datalist id={id(\"fields\")}>\n {CONDITION_FIELDS.map((f) => (\n <option key={f.value} value={f.value}>\n {f.label}\n </option>\n ))}\n </datalist>\n </Field>\n <div className=\"grid grid-cols-2 gap-2\">\n <Field id={id(\"operator\")} label=\"Comparison\">\n <select\n id={id(\"operator\")}\n value={cfg.operator ?? \"eq\"}\n onChange={(e) =>\n onConfigChange({\n operator: e.target.value as ConditionOperator,\n })\n }\n className={FIELD}\n >\n {CONDITION_OPERATORS.map((o) => (\n <option key={o.value} value={o.value}>\n {o.label}\n </option>\n ))}\n </select>\n </Field>\n <Field id={id(\"value\")} label=\"Value\">\n <input\n id={id(\"value\")}\n type=\"text\"\n value={cfg.value ?? \"\"}\n onChange={(e) => onConfigChange({ value: e.target.value })}\n className={FIELD}\n placeholder=\"50\"\n />\n </Field>\n </div>\n <p className={HINT}>\n True continues on the{\" \"}\n <span className=\"text-status-success-text\">Yes</span> path. False\n takes the <span className=\"text-status-error-text\">No</span> path,\n or ends the run when it has no steps.\n </p>\n </>\n )}\n\n {node.actionType === \"webhook\" && (\n <div className=\"grid grid-cols-[minmax(0,1fr)_96px] gap-2\">\n <Field id={id(\"url\")} label=\"Webhook URL\">\n <input\n id={id(\"url\")}\n type=\"url\"\n value={cfg.webhookUrl ?? \"\"}\n onChange={(e) => onConfigChange({ webhookUrl: e.target.value })}\n className={FIELD}\n placeholder=\"https://example.com/hook\"\n />\n </Field>\n <Field id={id(\"method\")} label=\"Method\">\n <select\n id={id(\"method\")}\n value={cfg.method ?? \"POST\"}\n onChange={(e) =>\n onConfigChange({ method: e.target.value as WebhookMethod })\n }\n className={FIELD}\n >\n <option value=\"POST\">POST</option>\n <option value=\"PUT\">PUT</option>\n <option value=\"PATCH\">PATCH</option>\n </select>\n </Field>\n </div>\n )}\n\n {node.actionType === \"update_field\" && (\n <div className=\"grid grid-cols-2 gap-2\">\n <Field id={id(\"update-field\")} label=\"Field\">\n <select\n id={id(\"update-field\")}\n value={cfg.updateField ?? \"score\"}\n onChange={(e) =>\n onConfigChange({\n updateField: e.target.value as UpdatableField,\n })\n }\n className={FIELD}\n >\n {UPDATABLE_FIELDS.map((f) => (\n <option key={f.value} value={f.value}>\n {f.label}\n </option>\n ))}\n </select>\n </Field>\n <Field id={id(\"update-value\")} label=\"New value\">\n <input\n id={id(\"update-value\")}\n type=\"text\"\n value={cfg.value ?? \"\"}\n onChange={(e) => onConfigChange({ value: e.target.value })}\n className={FIELD}\n placeholder={cfg.updateField === \"score\" ? \"80\" : \"Value\"}\n />\n </Field>\n </div>\n )}\n\n {node.actionType === \"add_tag\" && (\n <Field id={id(\"tag\")} label=\"Tag\">\n <input\n id={id(\"tag\")}\n type=\"text\"\n value={cfg.tag ?? \"\"}\n onChange={(e) => onConfigChange({ tag: e.target.value })}\n className={FIELD}\n placeholder=\"engaged-lead\"\n />\n </Field>\n )}\n\n {node.actionType === \"goal\" && (\n <Field\n id={id(\"goal\")}\n label=\"Goal\"\n hint=\"Recorded on the run when this point is reached.\"\n >\n <input\n id={id(\"goal\")}\n type=\"text\"\n value={cfg.description ?? \"\"}\n onChange={(e) => onConfigChange({ description: e.target.value })}\n className={FIELD}\n placeholder=\"Lead nurtured\"\n />\n </Field>\n )}\n\n {meta?.retryable && (\n <div className=\"grid grid-cols-2 gap-2 border-t border-border-subtle pt-3\">\n <Field\n id={id(\"retry\")}\n label=\"Attempts on failure\"\n hint=\"1 means no automatic retry.\"\n >\n <input\n id={id(\"retry\")}\n type=\"number\"\n min={1}\n max={10}\n value={cfg.retryMaxAttempts ?? \"\"}\n onChange={(e) =>\n onConfigChange({\n retryMaxAttempts: numberOrUndefined(e.target.value),\n })\n }\n className={FIELD}\n placeholder=\"1\"\n />\n </Field>\n <Field\n id={id(\"backoff\")}\n label=\"Retry after (min)\"\n hint=\"Doubles on each attempt.\"\n >\n <input\n id={id(\"backoff\")}\n type=\"number\"\n min={1}\n max={1440}\n value={cfg.retryBackoffMinutes ?? \"\"}\n onChange={(e) =>\n onConfigChange({\n retryBackoffMinutes: numberOrUndefined(e.target.value),\n })\n }\n className={FIELD}\n placeholder=\"5\"\n />\n </Field>\n </div>\n )}\n </div>\n </div>\n );\n};\n\n/** Placeholder shown when no node is selected. */\nexport const WorkflowConfigEmpty: FC = () => (\n <div className=\"rounded-card border border-dashed border-border-subtle bg-bg-surface p-6 text-center\">\n <Settings className=\"mx-auto mb-2 h-8 w-8 text-text-secondary\" />\n <p className=\"text-sm font-medium text-text-primary\">No step selected</p>\n <p className=\"mt-1 text-xs text-text-secondary\">\n Click a node — or its gear icon — to configure it. New steps are added\n after the selected node.\n </p>\n </div>\n);\n"],"mappings":";;;;;AA4BA,IAAM,IACJ,wKACI,IAAc,oDACd,IAAO,wCASP,KAAyB,EAAE,OAAI,UAAO,SAAM,kBAChD,kBAAC,OAAD,EAAA,UAAA;CACE,kBAAC,SAAD;EAAO,SAAS;EAAI,WAAW;YAC5B;EACK,CAAA;CACP;CACA,KAAQ,kBAAC,KAAD;EAAG,WAAW;YAAO;EAAS,CAAA;CACnC,EAAA,CAAA;AAGR,SAAS,EAAkB,GAAmC;AAC5D,KAAI,EAAM,MAAM,KAAK,GAAI;CACzB,IAAM,IAAI,OAAO,EAAM;AACvB,QAAO,OAAO,SAAS,EAAE,GAAG,IAAI,KAAA;;AAWlC,IAAa,KAA6D,EACxE,SACA,kBACA,mBACA,oBACA,iBACI;CACJ,IAAM,IAAO,EAAS,EAAK,EACrB,IAAO,EAAS,EAAK,EACrB,IAAY,EAAK,SAAS,WAC1B,IAAO,EAAW,EAAK,WAAW,EAClC,IAAM,EAAK,QACX,KAAM,MAAyB,MAAM,EAAK,GAAG,GAAG,KAChD,IAAY,IAAY,YAAa,GAAM,SAAS,EAAK;AAE/D,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KACE,WAAW,EACT,uFACA,EAAU,GACX;eAED,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA;KACvB,CAAA,EACP,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,KAAD;MAAG,WAAU;gBAAmD;MAE5D,CAAA,EACJ,kBAAC,KAAD;MAAG,WAAU;gBAAwC;MAAc,CAAA,CAC/D;OACF;OACL,KACC,kBAAC,UAAD;IACE,MAAK;IACL,SAAS;IACT,cAAW;IACX,WAAU;cAEV,kBAAC,GAAD,EAAG,W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K;OACL,KAAK;OACL,KAAK;OACL,OAAO,EAAI,oBAAoB;OAC/B,WAAW,MACT,EAAe,EACb,kBAAkB,EAAkB,EAAE,OAAO,MAAM,EACpD,CAAC;OAEJ,WAAW;OACX,aAAY;OACZ,CAAA;MACI,CAAA,EACR,kBAAC,GAAD;MACE,IAAI,EAAG,UAAU;MACjB,OAAM;MACN,MAAK;gBAEL,kBAAC,SAAD;OACE,IAAI,EAAG,UAAU;OACjB,MAAK;OACL,KAAK;OACL,KAAK;OACL,OAAO,EAAI,uBAAuB;OAClC,WAAW,MACT,EAAe,EACb,qBAAqB,EAAkB,EAAE,OAAO,MAAM,EACvD,CAAC;OAEJ,WAAW;OACX,aAAY;OACZ,CAAA;MACI,CAAA,CACJ;;IAEJ;KACF;;GAKG,UACX,kBAAC,OAAD;CAAK,WAAU;WAAf;EACE,kBAAC,GAAD,EAAU,WAAU,4CAA6C,CAAA;EACjE,kBAAC,KAAD;GAAG,WAAU;aAAwC;GAAoB,CAAA;EACzE,kBAAC,KAAD;GAAG,WAAU;aAAmC;GAG5C,CAAA;EACA"}
@@ -0,0 +1,13 @@
1
+ import { FC } from 'react';
2
+ import { AutomationWorkflow } from './useAutomationData';
3
+
4
+ interface WorkflowRunsPanelProps {
5
+ workflow: AutomationWorkflow;
6
+ open: boolean;
7
+ onClose: () => void;
8
+ /** Called after a run is started, retried or cancelled. */
9
+ onChanged: () => void;
10
+ }
11
+ export declare const WorkflowRunsPanel: FC<WorkflowRunsPanelProps>;
12
+ export {};
13
+ //# sourceMappingURL=WorkflowRunsPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkflowRunsPanel.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/automation/WorkflowRunsPanel.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAqBnD,OAAO,KAAK,EAAiB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAkE7E,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAwSxD,CAAC"}
@@ -0,0 +1,294 @@
1
+ import { useCancelHeadshotmarketingAutomationWorkflowRunMutation as e, useHeadshotmarketingAutomationWorkflowRunLogsQuery as t, useHeadshotmarketingAutomationWorkflowRunsQuery as n, useRetryHeadshotmarketingAutomationWorkflowRunMutation as r, useTriggerHeadshotmarketingAutomationWorkflowMutation as i } from "../../../generated/wspace-operations.js";
2
+ import { cn as a, formatDate as o } from "../../utils/helpers.js";
3
+ import { HeadshotmarketingAutomationSubjectType as s } from "../../../generated/wspace-types.js";
4
+ import { StatusBadge as c } from "../../components/StatusBadge.js";
5
+ import { EmptyState as l } from "../../components/EmptyState.js";
6
+ import { Modal as u } from "../../components/Modal.js";
7
+ import "../../components/index.js";
8
+ import { useHeadshotmarketingBootstrap as d } from "../../hooks/useHeadshotmarketingBootstrap.js";
9
+ import "../../hooks/index.js";
10
+ import { parseEngineSteps as f } from "./workflowCompiler.js";
11
+ import { isRunCancellable as p, isRunRetryable as m, stepName as h } from "../../utils/automationMapper.js";
12
+ import { useMemo as g, useState as _ } from "react";
13
+ import { Ban as v, ChevronRight as y, Play as b, RotateCcw as x } from "lucide-react";
14
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
15
+ //#region src/headshotmarketing/pages/automation/WorkflowRunsPanel.tsx
16
+ var w = "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", T = "inline-flex min-h-9 items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50";
17
+ function E(e, t) {
18
+ return e instanceof Error && e.message ? e.message : t;
19
+ }
20
+ var D = ({ run: e, steps: n }) => {
21
+ let { data: r, loading: i, error: a } = t({
22
+ variables: { workflowRunId: e.id },
23
+ fetchPolicy: "network-only"
24
+ }), s = r?.headshotmarketingAutomationWorkflowRunLogs ?? [];
25
+ return i ? /* @__PURE__ */ S("p", {
26
+ className: "text-xs text-text-secondary",
27
+ children: "Loading step log…"
28
+ }) : a ? /* @__PURE__ */ C("p", {
29
+ className: "text-xs text-status-error-text",
30
+ children: ["Could not load the step log: ", a.message]
31
+ }) : s.length === 0 ? /* @__PURE__ */ S("p", {
32
+ className: "text-xs text-text-secondary",
33
+ children: "No steps have run yet."
34
+ }) : /* @__PURE__ */ S("ol", {
35
+ className: "space-y-1.5",
36
+ "aria-label": "Step log",
37
+ children: s.map((e) => /* @__PURE__ */ C("li", {
38
+ className: "flex flex-wrap items-center gap-2 rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-xs",
39
+ children: [
40
+ /* @__PURE__ */ C("span", {
41
+ className: "font-medium text-text-primary",
42
+ children: [
43
+ e.stepIndex + 1,
44
+ ". ",
45
+ h(n, e.stepIndex, e.stepType)
46
+ ]
47
+ }),
48
+ /* @__PURE__ */ S(c, { status: e.status.toLowerCase() }),
49
+ e.attempt > 1 && /* @__PURE__ */ C("span", {
50
+ className: "text-text-secondary",
51
+ children: ["attempt ", e.attempt]
52
+ }),
53
+ /* @__PURE__ */ S("span", {
54
+ className: "ml-auto text-text-secondary",
55
+ children: o(e.executedAt, "relative")
56
+ }),
57
+ e.errorMessage && /* @__PURE__ */ S("span", {
58
+ className: "basis-full text-status-error-text",
59
+ children: e.errorMessage
60
+ })
61
+ ]
62
+ }, e.id))
63
+ });
64
+ }, O = ({ workflow: t, open: h, onClose: O, onChanged: k }) => {
65
+ let { data: A } = d(), { data: j, loading: M, error: N, refetch: P } = n({
66
+ variables: {
67
+ filter: { workflowId: t.id },
68
+ pagination: { limit: 50 }
69
+ },
70
+ skip: !h,
71
+ fetchPolicy: "network-only"
72
+ }), [F] = r(), [I] = e(), [L, { loading: R }] = i(), [z, B] = _(null), [V, H] = _(null), [U, W] = _(""), [G, K] = _(null), q = g(() => f(t.steps), [t]), J = j?.headshotmarketingAutomationWorkflowRuns.items ?? [], Y = j?.headshotmarketingAutomationWorkflowRuns.total ?? 0, X = g(() => {
73
+ let e = A?.headshotmarketingLeads.items ?? [], t = A?.headshotmarketingContacts.items ?? [];
74
+ return {
75
+ leads: e.map((e) => ({
76
+ key: `LEAD:${e.id}`,
77
+ label: e.title
78
+ })),
79
+ contacts: t.map((e) => ({
80
+ key: `CONTACT:${e.id}`,
81
+ label: `${e.firstName ?? ""} ${e.lastName ?? ""}`.trim() || e.email || e.id
82
+ }))
83
+ };
84
+ }, [A]), Z = g(() => {
85
+ let e = /* @__PURE__ */ new Map();
86
+ for (let t of [...X.leads, ...X.contacts]) e.set(t.key, t.label);
87
+ return (t) => e.get(`${t.subjectType}:${t.subjectId}`) ?? `${t.subjectType.toLowerCase()} ${t.subjectId.slice(0, 8)}`;
88
+ }, [X]), Q = async (e) => {
89
+ K({
90
+ tone: "success",
91
+ text: e
92
+ }), await P(), k();
93
+ }, $ = async (e) => {
94
+ H(e.id), K(null);
95
+ try {
96
+ await Q(`Retried the failed step — run is now ${((await F({ variables: { id: e.id } })).data?.retryHeadshotmarketingAutomationWorkflowRun.status ?? "").toLowerCase()}.`), B(e.id);
97
+ } catch (e) {
98
+ K({
99
+ tone: "error",
100
+ text: E(e, "Retry failed.")
101
+ });
102
+ } finally {
103
+ H(null);
104
+ }
105
+ }, ee = async (e) => {
106
+ H(e.id), K(null);
107
+ try {
108
+ await I({ variables: { id: e.id } }), await Q("Run cancelled.");
109
+ } catch (e) {
110
+ K({
111
+ tone: "error",
112
+ text: E(e, "Cancel failed.")
113
+ });
114
+ } finally {
115
+ H(null);
116
+ }
117
+ }, te = async () => {
118
+ let [e, n] = U.split(":");
119
+ if (!e || !n) {
120
+ K({
121
+ tone: "error",
122
+ text: "Choose a lead or contact first."
123
+ });
124
+ return;
125
+ }
126
+ K(null);
127
+ try {
128
+ let r = (await L({ variables: {
129
+ workflowId: t.id,
130
+ subjectType: e === "CONTACT" ? s.Contact : s.Lead,
131
+ subjectId: n,
132
+ context: {}
133
+ } })).data?.hmTriggerAutomationWorkflow;
134
+ await Q(`Run started — ${r ? r.status.toLowerCase() : "queued"}.`), r && B(r.id);
135
+ } catch (e) {
136
+ K({
137
+ tone: "error",
138
+ text: E(e, "Could not start.")
139
+ });
140
+ }
141
+ };
142
+ return /* @__PURE__ */ S(u, {
143
+ open: h,
144
+ onClose: O,
145
+ title: `Runs · ${t.name}`,
146
+ description: `${Y} run${Y === 1 ? "" : "s"} in total. Open a run to see each step it executed.`,
147
+ size: "xl",
148
+ children: /* @__PURE__ */ C("div", {
149
+ className: "space-y-4",
150
+ children: [
151
+ t.status === "ACTIVE" ? /* @__PURE__ */ C("div", {
152
+ className: "flex flex-wrap items-end gap-2 rounded-lg border border-border-subtle bg-bg-sunken p-3",
153
+ children: [/* @__PURE__ */ C("div", {
154
+ className: "min-w-[220px] flex-1",
155
+ children: [/* @__PURE__ */ S("label", {
156
+ htmlFor: `run-subject-${t.id}`,
157
+ className: "mb-1 block text-xs font-medium text-text-primary",
158
+ children: "Run now for"
159
+ }), /* @__PURE__ */ C("select", {
160
+ id: `run-subject-${t.id}`,
161
+ value: U,
162
+ onChange: (e) => W(e.target.value),
163
+ className: w,
164
+ children: [
165
+ /* @__PURE__ */ S("option", {
166
+ value: "",
167
+ children: "Choose a lead or contact…"
168
+ }),
169
+ X.leads.length > 0 && /* @__PURE__ */ S("optgroup", {
170
+ label: "Leads",
171
+ children: X.leads.map((e) => /* @__PURE__ */ S("option", {
172
+ value: e.key,
173
+ children: e.label
174
+ }, e.key))
175
+ }),
176
+ X.contacts.length > 0 && /* @__PURE__ */ S("optgroup", {
177
+ label: "Contacts",
178
+ children: X.contacts.map((e) => /* @__PURE__ */ S("option", {
179
+ value: e.key,
180
+ children: e.label
181
+ }, e.key))
182
+ })
183
+ ]
184
+ })]
185
+ }), /* @__PURE__ */ C("button", {
186
+ type: "button",
187
+ onClick: () => void te(),
188
+ disabled: R || !U,
189
+ className: "inline-flex min-h-10 items-center gap-2 rounded-md bg-action-primary-bg px-3.5 py-2 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bgHover disabled:opacity-60",
190
+ children: [/* @__PURE__ */ S(b, { className: "h-4 w-4" }), R ? "Starting…" : "Run now"]
191
+ })]
192
+ }) : /* @__PURE__ */ S("p", {
193
+ className: "rounded-lg border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
194
+ children: "Publish this workflow to run it. Draft and paused workflows never start new runs."
195
+ }),
196
+ G && /* @__PURE__ */ S("div", {
197
+ role: "status",
198
+ className: a("rounded-lg border px-3 py-2 text-sm", G.tone === "error" ? "border-status-error-border bg-status-error-bg text-status-error-text" : "border-status-success-border bg-status-success-bg text-status-success-text"),
199
+ children: G.text
200
+ }),
201
+ M && J.length === 0 ? /* @__PURE__ */ S("p", {
202
+ className: "text-sm text-text-secondary",
203
+ children: "Loading runs…"
204
+ }) : N ? /* @__PURE__ */ C("p", {
205
+ className: "text-sm text-status-error-text",
206
+ children: ["Could not load runs: ", N.message]
207
+ }) : J.length === 0 ? /* @__PURE__ */ S(l, {
208
+ illustration: "empty-generic",
209
+ title: "No runs yet",
210
+ description: "Runs appear here when the trigger fires or you run the workflow."
211
+ }) : /* @__PURE__ */ S("ul", {
212
+ className: "space-y-2",
213
+ "aria-label": "Workflow runs",
214
+ children: J.map((e) => {
215
+ let t = z === e.id;
216
+ return /* @__PURE__ */ C("li", {
217
+ className: "rounded-lg border border-border-seam bg-gloss-card p-3",
218
+ children: [
219
+ /* @__PURE__ */ C("div", {
220
+ className: "flex flex-wrap items-center gap-2",
221
+ children: [
222
+ /* @__PURE__ */ C("button", {
223
+ type: "button",
224
+ onClick: () => B(t ? null : e.id),
225
+ "aria-expanded": t,
226
+ className: "flex min-w-0 flex-1 items-center gap-2 text-left",
227
+ children: [
228
+ /* @__PURE__ */ S(y, { className: a("h-4 w-4 flex-shrink-0 text-text-secondary transition-transform", t && "rotate-90") }),
229
+ /* @__PURE__ */ S("span", {
230
+ className: "truncate text-sm font-medium text-text-primary",
231
+ children: Z(e)
232
+ }),
233
+ /* @__PURE__ */ S(c, { status: e.status.toLowerCase() }),
234
+ /* @__PURE__ */ S("span", {
235
+ className: "text-xs text-text-secondary",
236
+ children: o(e.startedAt, "relative")
237
+ }),
238
+ e.retryCount > 0 && /* @__PURE__ */ C("span", {
239
+ className: "text-xs text-text-secondary",
240
+ children: [
241
+ "· retried ",
242
+ e.retryCount,
243
+ "×"
244
+ ]
245
+ })
246
+ ]
247
+ }),
248
+ m(e.status) && /* @__PURE__ */ C("button", {
249
+ type: "button",
250
+ onClick: () => void $(e),
251
+ disabled: V === e.id,
252
+ className: T,
253
+ children: [/* @__PURE__ */ S(x, { className: "h-3.5 w-3.5" }), "Retry"]
254
+ }),
255
+ p(e.status) && /* @__PURE__ */ C("button", {
256
+ type: "button",
257
+ onClick: () => void ee(e),
258
+ disabled: V === e.id,
259
+ className: a(T, "text-status-error-text"),
260
+ children: [/* @__PURE__ */ S(v, { className: "h-3.5 w-3.5" }), "Cancel"]
261
+ })
262
+ ]
263
+ }),
264
+ e.errorMessage && /* @__PURE__ */ S("p", {
265
+ className: "mt-1.5 pl-6 text-xs text-status-error-text",
266
+ children: e.errorMessage
267
+ }),
268
+ e.status === "WAITING" && e.nextStepDueAt && /* @__PURE__ */ C("p", {
269
+ className: "mt-1.5 pl-6 text-xs text-text-secondary",
270
+ children: [
271
+ "Next step due",
272
+ " ",
273
+ new Date(e.nextStepDueAt).toLocaleString()
274
+ ]
275
+ }),
276
+ t && /* @__PURE__ */ S("div", {
277
+ className: "mt-3 pl-6",
278
+ children: /* @__PURE__ */ S(D, {
279
+ run: e,
280
+ steps: q
281
+ })
282
+ })
283
+ ]
284
+ }, e.id);
285
+ })
286
+ })
287
+ ]
288
+ })
289
+ });
290
+ };
291
+ //#endregion
292
+ export { O as WorkflowRunsPanel };
293
+
294
+ //# sourceMappingURL=WorkflowRunsPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkflowRunsPanel.js","names":[],"sources":["../../../../src/headshotmarketing/pages/automation/WorkflowRunsPanel.tsx"],"sourcesContent":["/**\n * Run history for one workflow (BOFF-10192): every run with its status,\n * per-step logs, Retry for failed runs, Cancel for unfinished runs, and a\n * \"Run now\" for active workflows against a chosen lead or contact.\n * @module headshotmarketing/pages/automation\n */\nimport { useMemo, useState, type FC } from \"react\";\nimport { Play, RotateCcw, Ban, ChevronRight } from \"lucide-react\";\nimport {\n useCancelHeadshotmarketingAutomationWorkflowRunMutation,\n useHeadshotmarketingAutomationWorkflowRunLogsQuery,\n useHeadshotmarketingAutomationWorkflowRunsQuery,\n useRetryHeadshotmarketingAutomationWorkflowRunMutation,\n useTriggerHeadshotmarketingAutomationWorkflowMutation,\n type HeadshotmarketingAutomationWorkflowRunLogsQuery,\n type HeadshotmarketingBootstrapDataQuery,\n} from \"../../../generated/wspace-operations\";\nimport { HeadshotmarketingAutomationSubjectType } from \"../../../generated/wspace-types\";\nimport { Modal, StatusBadge, EmptyState } from \"../../components\";\nimport { useHeadshotmarketingBootstrap } from \"../../hooks\";\nimport { cn, formatDate } from \"../../utils/helpers\";\nimport {\n isRunCancellable,\n isRunRetryable,\n stepName,\n} from \"../../utils/automationMapper\";\nimport { parseEngineSteps, type EngineStep } from \"./workflowCompiler\";\nimport type { AutomationRun, AutomationWorkflow } from \"./useAutomationData\";\n\nconst FIELD =\n \"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\";\nconst BUTTON =\n \"inline-flex min-h-9 items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50\";\n\nfunction errorText(err: unknown, fallback: string): string {\n return err instanceof Error && err.message ? err.message : fallback;\n}\n\nconst RunLogs: FC<{ run: AutomationRun; steps: EngineStep[] }> = ({\n run,\n steps,\n}) => {\n const { data, loading, error } =\n useHeadshotmarketingAutomationWorkflowRunLogsQuery({\n variables: { workflowRunId: run.id },\n fetchPolicy: \"network-only\",\n });\n // Generated hooks resolve their data type loosely, so pin it here.\n const logs: HeadshotmarketingAutomationWorkflowRunLogsQuery[\"headshotmarketingAutomationWorkflowRunLogs\"] =\n data?.headshotmarketingAutomationWorkflowRunLogs ?? [];\n if (loading) {\n return <p className=\"text-xs text-text-secondary\">Loading step log…</p>;\n }\n if (error) {\n return (\n <p className=\"text-xs text-status-error-text\">\n Could not load the step log: {error.message}\n </p>\n );\n }\n if (logs.length === 0) {\n return (\n <p className=\"text-xs text-text-secondary\">No steps have run yet.</p>\n );\n }\n return (\n <ol className=\"space-y-1.5\" aria-label=\"Step log\">\n {logs.map((log) => (\n <li\n key={log.id}\n className=\"flex flex-wrap items-center gap-2 rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-xs\"\n >\n <span className=\"font-medium text-text-primary\">\n {log.stepIndex + 1}. {stepName(steps, log.stepIndex, log.stepType)}\n </span>\n <StatusBadge status={log.status.toLowerCase()} />\n {log.attempt > 1 && (\n <span className=\"text-text-secondary\">attempt {log.attempt}</span>\n )}\n <span className=\"ml-auto text-text-secondary\">\n {formatDate(log.executedAt, \"relative\")}\n </span>\n {log.errorMessage && (\n <span className=\"basis-full text-status-error-text\">\n {log.errorMessage}\n </span>\n )}\n </li>\n ))}\n </ol>\n );\n};\n\ninterface WorkflowRunsPanelProps {\n workflow: AutomationWorkflow;\n open: boolean;\n onClose: () => void;\n /** Called after a run is started, retried or cancelled. */\n onChanged: () => void;\n}\n\nexport const WorkflowRunsPanel: FC<WorkflowRunsPanelProps> = ({\n workflow,\n open,\n onClose,\n onChanged,\n}) => {\n const { data: bootstrap } = useHeadshotmarketingBootstrap();\n const { data, loading, error, refetch } =\n useHeadshotmarketingAutomationWorkflowRunsQuery({\n variables: {\n filter: { workflowId: workflow.id },\n pagination: { limit: 50 },\n },\n skip: !open,\n fetchPolicy: \"network-only\",\n });\n const [retryRun] = useRetryHeadshotmarketingAutomationWorkflowRunMutation();\n const [cancelRun] = useCancelHeadshotmarketingAutomationWorkflowRunMutation();\n const [triggerRun, { loading: starting }] =\n useTriggerHeadshotmarketingAutomationWorkflowMutation();\n const [expandedId, setExpandedId] = useState<string | null>(null);\n const [busyRunId, setBusyRunId] = useState<string | null>(null);\n const [subject, setSubject] = useState(\"\");\n const [message, setMessage] = useState<{\n tone: \"error\" | \"success\";\n text: string;\n } | null>(null);\n\n const steps = useMemo(() => parseEngineSteps(workflow.steps), [workflow]);\n const runs: AutomationRun[] =\n data?.headshotmarketingAutomationWorkflowRuns.items ?? [];\n const total: number =\n data?.headshotmarketingAutomationWorkflowRuns.total ?? 0;\n\n const subjects = useMemo(() => {\n const leadItems: HeadshotmarketingBootstrapDataQuery[\"headshotmarketingLeads\"][\"items\"] =\n bootstrap?.headshotmarketingLeads.items ?? [];\n const contactItems: HeadshotmarketingBootstrapDataQuery[\"headshotmarketingContacts\"][\"items\"] =\n bootstrap?.headshotmarketingContacts.items ?? [];\n const leads = leadItems.map((l) => ({\n key: `LEAD:${l.id}`,\n label: l.title,\n }));\n const contacts = contactItems.map((c) => ({\n key: `CONTACT:${c.id}`,\n label:\n `${c.firstName ?? \"\"} ${c.lastName ?? \"\"}`.trim() || c.email || c.id,\n }));\n return { leads, contacts };\n }, [bootstrap]);\n\n const subjectName = useMemo(() => {\n const map = new Map<string, string>();\n for (const s of [...subjects.leads, ...subjects.contacts])\n map.set(s.key, s.label);\n return (run: AutomationRun): string =>\n map.get(`${run.subjectType}:${run.subjectId}`) ??\n `${run.subjectType.toLowerCase()} ${run.subjectId.slice(0, 8)}`;\n }, [subjects]);\n\n const after = async (text: string): Promise<void> => {\n setMessage({ tone: \"success\", text });\n await refetch();\n onChanged();\n };\n\n const handleRetry = async (run: AutomationRun): Promise<void> => {\n setBusyRunId(run.id);\n setMessage(null);\n try {\n const res = await retryRun({ variables: { id: run.id } });\n const status =\n res.data?.retryHeadshotmarketingAutomationWorkflowRun.status ?? \"\";\n await after(\n `Retried the failed step — run is now ${status.toLowerCase()}.`,\n );\n setExpandedId(run.id);\n } catch (err) {\n setMessage({ tone: \"error\", text: errorText(err, \"Retry failed.\") });\n } finally {\n setBusyRunId(null);\n }\n };\n\n const handleCancel = async (run: AutomationRun): Promise<void> => {\n setBusyRunId(run.id);\n setMessage(null);\n try {\n await cancelRun({ variables: { id: run.id } });\n await after(\"Run cancelled.\");\n } catch (err) {\n setMessage({ tone: \"error\", text: errorText(err, \"Cancel failed.\") });\n } finally {\n setBusyRunId(null);\n }\n };\n\n const handleStart = async (): Promise<void> => {\n const [type, id] = subject.split(\":\");\n if (!type || !id) {\n setMessage({ tone: \"error\", text: \"Choose a lead or contact first.\" });\n return;\n }\n setMessage(null);\n try {\n const res = await triggerRun({\n variables: {\n workflowId: workflow.id,\n subjectType:\n type === \"CONTACT\"\n ? HeadshotmarketingAutomationSubjectType.Contact\n : HeadshotmarketingAutomationSubjectType.Lead,\n subjectId: id,\n context: {},\n },\n });\n const run = res.data?.hmTriggerAutomationWorkflow;\n await after(\n `Run started — ${run ? run.status.toLowerCase() : \"queued\"}.`,\n );\n if (run) setExpandedId(run.id);\n } catch (err) {\n setMessage({ tone: \"error\", text: errorText(err, \"Could not start.\") });\n }\n };\n\n return (\n <Modal\n open={open}\n onClose={onClose}\n title={`Runs · ${workflow.name}`}\n description={`${total} run${total === 1 ? \"\" : \"s\"} in total. Open a run to see each step it executed.`}\n size=\"xl\"\n >\n <div className=\"space-y-4\">\n {workflow.status === \"ACTIVE\" ? (\n <div className=\"flex flex-wrap items-end gap-2 rounded-lg border border-border-subtle bg-bg-sunken p-3\">\n <div className=\"min-w-[220px] flex-1\">\n <label\n htmlFor={`run-subject-${workflow.id}`}\n className=\"mb-1 block text-xs font-medium text-text-primary\"\n >\n Run now for\n </label>\n <select\n id={`run-subject-${workflow.id}`}\n value={subject}\n onChange={(e) => setSubject(e.target.value)}\n className={FIELD}\n >\n <option value=\"\">Choose a lead or contact…</option>\n {subjects.leads.length > 0 && (\n <optgroup label=\"Leads\">\n {subjects.leads.map((s) => (\n <option key={s.key} value={s.key}>\n {s.label}\n </option>\n ))}\n </optgroup>\n )}\n {subjects.contacts.length > 0 && (\n <optgroup label=\"Contacts\">\n {subjects.contacts.map((s) => (\n <option key={s.key} value={s.key}>\n {s.label}\n </option>\n ))}\n </optgroup>\n )}\n </select>\n </div>\n <button\n type=\"button\"\n onClick={() => void handleStart()}\n disabled={starting || !subject}\n className=\"inline-flex min-h-10 items-center gap-2 rounded-md bg-action-primary-bg px-3.5 py-2 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bgHover disabled:opacity-60\"\n >\n <Play className=\"h-4 w-4\" />\n {starting ? \"Starting…\" : \"Run now\"}\n </button>\n </div>\n ) : (\n <p className=\"rounded-lg border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary\">\n Publish this workflow to run it. Draft and paused workflows never\n start new runs.\n </p>\n )}\n\n {message && (\n <div\n role=\"status\"\n className={cn(\n \"rounded-lg border px-3 py-2 text-sm\",\n message.tone === \"error\"\n ? \"border-status-error-border bg-status-error-bg text-status-error-text\"\n : \"border-status-success-border bg-status-success-bg text-status-success-text\",\n )}\n >\n {message.text}\n </div>\n )}\n\n {loading && runs.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">Loading runs…</p>\n ) : error ? (\n <p className=\"text-sm text-status-error-text\">\n Could not load runs: {error.message}\n </p>\n ) : runs.length === 0 ? (\n <EmptyState\n illustration=\"empty-generic\"\n title=\"No runs yet\"\n description=\"Runs appear here when the trigger fires or you run the workflow.\"\n />\n ) : (\n <ul className=\"space-y-2\" aria-label=\"Workflow runs\">\n {runs.map((run) => {\n const expanded = expandedId === run.id;\n return (\n <li\n key={run.id}\n className=\"rounded-lg border border-border-seam bg-gloss-card p-3\"\n >\n <div className=\"flex flex-wrap items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setExpandedId(expanded ? null : run.id)}\n aria-expanded={expanded}\n className=\"flex min-w-0 flex-1 items-center gap-2 text-left\"\n >\n <ChevronRight\n className={cn(\n \"h-4 w-4 flex-shrink-0 text-text-secondary transition-transform\",\n expanded && \"rotate-90\",\n )}\n />\n <span className=\"truncate text-sm font-medium text-text-primary\">\n {subjectName(run)}\n </span>\n <StatusBadge status={run.status.toLowerCase()} />\n <span className=\"text-xs text-text-secondary\">\n {formatDate(run.startedAt, \"relative\")}\n </span>\n {run.retryCount > 0 && (\n <span className=\"text-xs text-text-secondary\">\n · retried {run.retryCount}×\n </span>\n )}\n </button>\n {isRunRetryable(run.status) && (\n <button\n type=\"button\"\n onClick={() => void handleRetry(run)}\n disabled={busyRunId === run.id}\n className={BUTTON}\n >\n <RotateCcw className=\"h-3.5 w-3.5\" />\n Retry\n </button>\n )}\n {isRunCancellable(run.status) && (\n <button\n type=\"button\"\n onClick={() => void handleCancel(run)}\n disabled={busyRunId === run.id}\n className={cn(BUTTON, \"text-status-error-text\")}\n >\n <Ban className=\"h-3.5 w-3.5\" />\n Cancel\n </button>\n )}\n </div>\n {run.errorMessage && (\n <p className=\"mt-1.5 pl-6 text-xs text-status-error-text\">\n {run.errorMessage}\n </p>\n )}\n {run.status === \"WAITING\" && run.nextStepDueAt && (\n <p className=\"mt-1.5 pl-6 text-xs text-text-secondary\">\n Next step due{\" \"}\n {new Date(run.nextStepDueAt).toLocaleString()}\n </p>\n )}\n {expanded && (\n <div className=\"mt-3 pl-6\">\n <RunLogs run={run} steps={steps} />\n </div>\n )}\n </li>\n );\n })}\n </ul>\n )}\n </div>\n </Modal>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AA6BA,IAAM,IACJ,wKACI,IACJ;AAEF,SAAS,EAAU,GAAc,GAA0B;AACzD,QAAO,a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;UACvC;UACb,IAAI,KAAK,EAAI,cAAc,CAAC,gBAAgB;UAC3C;;QAEL,KACC,kBAAC,OAAD;SAAK,WAAU;mBACb,kBAAC,GAAD;UAAc;UAAY;UAAS,CAAA;SAC/B,CAAA;QAEL;SApEE,EAAI,GAoEN;OAEP;KACC,CAAA;IAEH;;EACA,CAAA"}
@@ -1,4 +1,6 @@
1
1
  import { FC } from 'react';
2
+ import { LucideIcon } from 'lucide-react';
2
3
 
4
+ export declare const TRIGGER_ICONS: Record<string, LucideIcon>;
3
5
  export declare const WorkflowsPage: FC;
4
6
  //# sourceMappingURL=WorkflowsPage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WorkflowsPage.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/automation/WorkflowsPage.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAgC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAsB9D,eAAO,MAAM,aAAa,EAAE,EAgU3B,CAAC"}
1
+ {"version":3,"file":"WorkflowsPage.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/automation/WorkflowsPage.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAgC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAYL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAiCtB,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAOpD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,EAyR3B,CAAC"}