@arbidocs/blocks 0.4.76 → 0.4.77

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 (97) hide show
  1. package/dist/agents/index.cjs +331 -255
  2. package/dist/agents/index.js +2 -2
  3. package/dist/agents/tasks/TaskActivityTimeline.d.ts +1 -1
  4. package/dist/agents/tasks/WorkflowThreadStrip.d.ts +7 -1
  5. package/dist/agents/workflows/SchemaForm.d.ts +6 -1
  6. package/dist/agents/workflows/StepParts.d.ts +109 -0
  7. package/dist/agents/workflows/WorkflowRunner.d.ts +11 -2
  8. package/dist/agents/workflows/index.d.ts +3 -2
  9. package/dist/agents/workflows/planSteps.d.ts +8 -1
  10. package/dist/agents/workflows/run.d.ts +61 -8
  11. package/dist/agents/workflows/types.d.ts +133 -4
  12. package/dist/agents/workflows/useWorkflowPreview.d.ts +2 -1
  13. package/dist/agents/workflows/useWorkflowView.d.ts +19 -0
  14. package/dist/chat/ChatPage.d.ts +1 -1
  15. package/dist/chat/WorkflowStepChip.d.ts +24 -0
  16. package/dist/chat/chat-page-types.d.ts +4 -0
  17. package/dist/chat/index.cjs +130 -122
  18. package/dist/chat/index.d.ts +1 -0
  19. package/dist/chat/index.js +2 -2
  20. package/dist/{chunk-22P5KNIM.js → chunk-34UW6XUQ.js} +928 -38
  21. package/dist/chunk-34UW6XUQ.js.map +1 -0
  22. package/dist/{chunk-VYRKO3XU.cjs → chunk-3XR3IEGU.cjs} +944 -35
  23. package/dist/chunk-3XR3IEGU.cjs.map +1 -0
  24. package/dist/{chunk-ZWA7UUZL.cjs → chunk-7YUFMNFW.cjs} +2 -54
  25. package/dist/chunk-7YUFMNFW.cjs.map +1 -0
  26. package/dist/chunk-A24C6BNA.js +92 -0
  27. package/dist/chunk-A24C6BNA.js.map +1 -0
  28. package/dist/chunk-AINNADMT.cjs +62 -0
  29. package/dist/chunk-AINNADMT.cjs.map +1 -0
  30. package/dist/{chunk-7CVF3DK2.cjs → chunk-EKIUMNCN.cjs} +5 -5
  31. package/dist/{chunk-7CVF3DK2.cjs.map → chunk-EKIUMNCN.cjs.map} +1 -1
  32. package/dist/chunk-FE4ULGOR.js +151 -0
  33. package/dist/chunk-FE4ULGOR.js.map +1 -0
  34. package/dist/chunk-FT5FFXSJ.js +60 -0
  35. package/dist/chunk-FT5FFXSJ.js.map +1 -0
  36. package/dist/{chunk-HITAN7JF.cjs → chunk-GTXOV7IJ.cjs} +4 -4
  37. package/dist/{chunk-HITAN7JF.cjs.map → chunk-GTXOV7IJ.cjs.map} +1 -1
  38. package/dist/{chunk-TKB7TVMW.js → chunk-HEVVT6IT.js} +78 -14
  39. package/dist/chunk-HEVVT6IT.js.map +1 -0
  40. package/dist/{chunk-IPGKTUF7.cjs → chunk-HOD6OM7L.cjs} +68 -3
  41. package/dist/chunk-HOD6OM7L.cjs.map +1 -0
  42. package/dist/{chunk-7FKARMA3.cjs → chunk-JFUN4D7D.cjs} +101 -37
  43. package/dist/chunk-JFUN4D7D.cjs.map +1 -0
  44. package/dist/{chunk-UIWLDSTF.js → chunk-NIP5BOP7.js} +68 -5
  45. package/dist/chunk-NIP5BOP7.js.map +1 -0
  46. package/dist/{chunk-MK6NJQGF.js → chunk-OEM5ARVM.js} +3 -3
  47. package/dist/{chunk-MK6NJQGF.js.map → chunk-OEM5ARVM.js.map} +1 -1
  48. package/dist/{chunk-5EBGRG3X.js → chunk-OPA2Y6YZ.js} +3 -54
  49. package/dist/chunk-OPA2Y6YZ.js.map +1 -0
  50. package/dist/chunk-TZR36PPP.cjs +95 -0
  51. package/dist/chunk-TZR36PPP.cjs.map +1 -0
  52. package/dist/{chunk-WJEKRSPH.js → chunk-UEU23PTW.js} +3 -3
  53. package/dist/{chunk-WJEKRSPH.js.map → chunk-UEU23PTW.js.map} +1 -1
  54. package/dist/chunk-ZVBPRMHJ.cjs +153 -0
  55. package/dist/chunk-ZVBPRMHJ.cjs.map +1 -0
  56. package/dist/connect/docx.cjs +10 -88
  57. package/dist/connect/docx.cjs.map +1 -1
  58. package/dist/connect/docx.js +6 -86
  59. package/dist/connect/docx.js.map +1 -1
  60. package/dist/connect/index.cjs +293 -30
  61. package/dist/connect/index.cjs.map +1 -1
  62. package/dist/connect/index.js +278 -15
  63. package/dist/connect/index.js.map +1 -1
  64. package/dist/connection/ConnectedWorkflowRunner.d.ts +16 -2
  65. package/dist/connection/WorkflowRunnerDialogs.d.ts +37 -0
  66. package/dist/connection/useWorkflowThread.d.ts +12 -0
  67. package/dist/document-tools/index.cjs +7 -143
  68. package/dist/document-tools/index.cjs.map +1 -1
  69. package/dist/document-tools/index.js +5 -144
  70. package/dist/document-tools/index.js.map +1 -1
  71. package/dist/docx/index.cjs +18 -17
  72. package/dist/docx/index.cjs.map +1 -1
  73. package/dist/docx/index.js +3 -2
  74. package/dist/docx/index.js.map +1 -1
  75. package/dist/index.cjs +467 -383
  76. package/dist/index.js +5 -5
  77. package/dist/studio/index.cjs +3 -3
  78. package/dist/studio/index.js +2 -2
  79. package/dist/workflow-canvas/StepActionSettings.d.ts +132 -0
  80. package/dist/workflow-canvas/StepInspector.d.ts +25 -2
  81. package/dist/workflow-canvas/WorkflowBuilder.d.ts +11 -3
  82. package/dist/workflow-canvas/WorkflowCanvas.d.ts +27 -2
  83. package/dist/workflow-canvas/edit.d.ts +9 -1
  84. package/dist/workflow-canvas/index.cjs +879 -99
  85. package/dist/workflow-canvas/index.cjs.map +1 -1
  86. package/dist/workflow-canvas/index.js +846 -66
  87. package/dist/workflow-canvas/index.js.map +1 -1
  88. package/package.json +4 -4
  89. package/src/workflow-canvas/canvas.css +9 -0
  90. package/dist/chunk-22P5KNIM.js.map +0 -1
  91. package/dist/chunk-5EBGRG3X.js.map +0 -1
  92. package/dist/chunk-7FKARMA3.cjs.map +0 -1
  93. package/dist/chunk-IPGKTUF7.cjs.map +0 -1
  94. package/dist/chunk-TKB7TVMW.js.map +0 -1
  95. package/dist/chunk-UIWLDSTF.js.map +0 -1
  96. package/dist/chunk-VYRKO3XU.cjs.map +0 -1
  97. package/dist/chunk-ZWA7UUZL.cjs.map +0 -1
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- export { AgentAvatarField, AgentBar, AgentBarIconButton, AgentBarMenu, AgentBarNotes, AgentBarProbeAnswer, AgentBarQueuedNote, AgentBarStatus, AgentCard, AgentCreateView, AgentCreatedView, AgentCreator, AgentEditView, AgentGallery, AgentMainView, AgentSelect, AgentTypeSelector, CapabilityGrid, CapabilityTile, ConfigField, ConfigForm, ConsentActions, ConsentBulletList, ConsentCard, ConsentFootnote, ConsentHeader, ConsentMessage, ConsentNotice, ConsentPage, ConsentPermissionList, ConsentSection, ConsentStrong, ConsentText, ConversationListView, ConversationTurnSpeaker, CopyableUrl, DEFAULT_AGENT_AVATAR_FIELD_LABELS, DEFAULT_AGENT_BAR_LABELS, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_CREATOR_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_AGENT_STEPS_LABELS, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AUTHORIZE_AGENT_LABELS, DEFAULT_CONFIG_FIELD_LABELS, DEFAULT_CONFIG_FORM_LABELS, DEFAULT_CONSENT_ACTIONS_LABELS, DEFAULT_COPYABLE_URL_LABELS, DEFAULT_NEW_THREAD_DIALOG_LABELS, DEFAULT_PILL_SELECT_LABELS, DEFAULT_RECURRENCE, DEFAULT_RECURRENCE_BUILDER_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_EDIT_FORM_LABELS, DEFAULT_SKILL_GENERATE_FORM_LABELS, DEFAULT_SKILL_GLOBAL_BADGE_LABELS, DEFAULT_SKILL_ROW_LABELS, DEFAULT_SKILL_VIEW_TOGGLE_LABELS, DEFAULT_SUBAGENT_ROSTER_LABELS, DEFAULT_TASKS_CHROME_LABELS, DEFAULT_TASK_ACTIVITY_LABELS, DEFAULT_TASK_COMPOSER_LABELS, DEFAULT_TASK_LIST_LABELS, DEFAULT_TASK_OUTPUTS_CELL_LABELS, DEFAULT_TASK_PLAN_LABELS, DEFAULT_TASK_RUNS_DIALOG_LABELS, DEFAULT_TASK_STATUS_PILL_LABELS, DEFAULT_TASK_THREAD_CHIP_LABELS, DEFAULT_TASK_TRIGGER_CHIP_LABELS, DEFAULT_TUPLE_ARRAY_FIELD_LABELS, DEFAULT_UPLOAD_TASK_ITEM_LABELS, DEFAULT_UPLOAD_TASK_LIST_LABELS, DEFAULT_WORKFLOWS_CHROME_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, DEFAULT_WORKFLOW_LIST_LABELS, DEFAULT_WORKFLOW_THREAD_STRIP_LABELS, DERIVED_NAME_WORDS, EMPTY_NEW_THREAD, GoalCriteria, MAX_TASK_DEPTH, NewThreadDialog, PersonPill, PillSelect, RecurrenceBuilder, STATUS_LABELS, STATUS_ORDER, STATUS_TONE, SkillActionButton, SkillCard, SkillDetail, SkillDetailSection, SkillEditForm, SkillFilterChips, SkillGenerateForm, SkillGlobalBadge, SkillRow, SkillTile, SkillTypeBadge, SkillViewToggle, StepDetail, StepNarration, StepOutcome, StepParams, StepRow, StepSummary, StepTrace, StepTraceSummary, SubAgentLane, SubStepGroup, SubagentRoster, TASK_COLUMN_ORDER, TRIGGER_LABELS, TaskActivityDialog, TaskActivityTimeline, TaskComposer, TaskFlow, TaskInbox, TaskMoveDialog, TaskOutputsCell, TaskPlan, TaskRunsDialog, TaskStartDialog, TaskStatusPill, TaskTable, TaskThreadChip, TaskTriggerChip, TasksToolbar, ThreadActivity, ThreadNotifyDialog, TupleArrayField, UploadTaskItem, UploadTaskList, WEEKDAYS, WORKFLOW_COLUMN_ORDER, WorkflowConfigDialog, WorkflowDocumentsField, WorkflowLauncher, WorkflowThreadStartedBy, WorkflowThreadStrip, WorkflowsTable, WorkflowsToolbar, agentConfigSectionToValues, agentCreatorToConfigSection, asTaskStatus, authModeFor, buildRRule, buildTaskRows, buildWorkflowScopeSource, compactThreadActivity, composePersona, composerToTaskQuery, composerToWorkRequest, composerToWorkflowRequest, composerToWorkflowUpdate, createTaskColumns, createWorkflowColumns, createsWork, defaultScopeRenderer, defaultTaskComposerValues, deriveAgentName, deriveWorkflowName, descendantIds, describeRRule, filterConversationRows, firstWords, formatElapsed, goalProgress, groupThreadActivity, hasTaskFields, hasTrigger, humanizeSection, indexTasks, inferType, inputDocumentIds, isAgenticWorkflow, isOutOfBounds, isPlainTodo, isSkillRow, isValidAgentName, isoToLocalInput, linkedRunsFromActivity, localInputToIso, matchWorkflowScope, moveTargets, newThreadToRequest, nextCriterionId, ownerExtId, parseRRule, prettifyKey, resolveScopeInputs, skillSlug, stripPersonaPreamble, summarizeAgent, summarizeCapabilities, taskComposerToCreateRequest, taskComposerToUpdateRequest, taskNeedsAccess, taskToComposerValues, useWorkflowPreview, workflowFromSkillMarkdown, workflowStatus, workflowTaskFields, workflowToComposerValues, workflowToSkillMarkdown, workflowTriggerType, workflowWhen } from '../chunk-TKB7TVMW.js';
2
+ export { AgentAvatarField, AgentBar, AgentBarIconButton, AgentBarMenu, AgentBarNotes, AgentBarProbeAnswer, AgentBarQueuedNote, AgentBarStatus, AgentCard, AgentCreateView, AgentCreatedView, AgentCreator, AgentEditView, AgentGallery, AgentMainView, AgentSelect, AgentTypeSelector, CapabilityGrid, CapabilityTile, ConfigField, ConfigForm, ConsentActions, ConsentBulletList, ConsentCard, ConsentFootnote, ConsentHeader, ConsentMessage, ConsentNotice, ConsentPage, ConsentPermissionList, ConsentSection, ConsentStrong, ConsentText, ConversationListView, ConversationTurnSpeaker, CopyableUrl, DEFAULT_AGENT_AVATAR_FIELD_LABELS, DEFAULT_AGENT_BAR_LABELS, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_CREATOR_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_AGENT_STEPS_LABELS, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AUTHORIZE_AGENT_LABELS, DEFAULT_CONFIG_FIELD_LABELS, DEFAULT_CONFIG_FORM_LABELS, DEFAULT_CONSENT_ACTIONS_LABELS, DEFAULT_COPYABLE_URL_LABELS, DEFAULT_NEW_THREAD_DIALOG_LABELS, DEFAULT_PILL_SELECT_LABELS, DEFAULT_RECURRENCE, DEFAULT_RECURRENCE_BUILDER_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_EDIT_FORM_LABELS, DEFAULT_SKILL_GENERATE_FORM_LABELS, DEFAULT_SKILL_GLOBAL_BADGE_LABELS, DEFAULT_SKILL_ROW_LABELS, DEFAULT_SKILL_VIEW_TOGGLE_LABELS, DEFAULT_SUBAGENT_ROSTER_LABELS, DEFAULT_TASKS_CHROME_LABELS, DEFAULT_TASK_ACTIVITY_LABELS, DEFAULT_TASK_COMPOSER_LABELS, DEFAULT_TASK_LIST_LABELS, DEFAULT_TASK_OUTPUTS_CELL_LABELS, DEFAULT_TASK_PLAN_LABELS, DEFAULT_TASK_RUNS_DIALOG_LABELS, DEFAULT_TASK_STATUS_PILL_LABELS, DEFAULT_TASK_THREAD_CHIP_LABELS, DEFAULT_TASK_TRIGGER_CHIP_LABELS, DEFAULT_TUPLE_ARRAY_FIELD_LABELS, DEFAULT_UPLOAD_TASK_ITEM_LABELS, DEFAULT_UPLOAD_TASK_LIST_LABELS, DEFAULT_WORKFLOWS_CHROME_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, DEFAULT_WORKFLOW_LIST_LABELS, DEFAULT_WORKFLOW_THREAD_STRIP_LABELS, DERIVED_NAME_WORDS, EMPTY_NEW_THREAD, GoalCriteria, MAX_TASK_DEPTH, NewThreadDialog, PersonPill, PillSelect, RecurrenceBuilder, STATUS_LABELS, STATUS_ORDER, STATUS_TONE, SkillActionButton, SkillCard, SkillDetail, SkillDetailSection, SkillEditForm, SkillFilterChips, SkillGenerateForm, SkillGlobalBadge, SkillRow, SkillTile, SkillTypeBadge, SkillViewToggle, StepDetail, StepNarration, StepOutcome, StepParams, StepRow, StepSummary, StepTrace, StepTraceSummary, SubAgentLane, SubStepGroup, SubagentRoster, TASK_COLUMN_ORDER, TRIGGER_LABELS, TaskActivityDialog, TaskActivityTimeline, TaskComposer, TaskFlow, TaskInbox, TaskMoveDialog, TaskOutputsCell, TaskPlan, TaskRunsDialog, TaskStartDialog, TaskStatusPill, TaskTable, TaskThreadChip, TaskTriggerChip, TasksToolbar, ThreadActivity, ThreadNotifyDialog, TupleArrayField, UploadTaskItem, UploadTaskList, WEEKDAYS, WORKFLOW_COLUMN_ORDER, WorkflowConfigDialog, WorkflowDocumentsField, WorkflowLauncher, WorkflowThreadStartedBy, WorkflowThreadStrip, WorkflowsTable, WorkflowsToolbar, agentConfigSectionToValues, agentCreatorToConfigSection, asTaskStatus, authModeFor, buildRRule, buildTaskRows, buildWorkflowScopeSource, compactThreadActivity, composePersona, composerToTaskQuery, composerToWorkRequest, composerToWorkflowRequest, composerToWorkflowUpdate, createTaskColumns, createWorkflowColumns, createsWork, defaultScopeRenderer, defaultTaskComposerValues, deriveAgentName, deriveWorkflowName, descendantIds, describeRRule, filterConversationRows, firstWords, formatElapsed, goalProgress, groupThreadActivity, hasTaskFields, hasTrigger, humanizeSection, indexTasks, inferType, inputDocumentIds, isAgenticWorkflow, isOutOfBounds, isPlainTodo, isSkillRow, isValidAgentName, isoToLocalInput, linkedRunsFromActivity, localInputToIso, matchWorkflowScope, moveTargets, newThreadToRequest, nextCriterionId, ownerExtId, parseRRule, prettifyKey, resolveScopeInputs, skillSlug, stripPersonaPreamble, summarizeAgent, summarizeCapabilities, taskComposerToCreateRequest, taskComposerToUpdateRequest, taskNeedsAccess, taskToComposerValues, useWorkflowPreview, workflowFromSkillMarkdown, workflowStatus, workflowTaskFields, workflowToComposerValues, workflowToSkillMarkdown, workflowTriggerType, workflowWhen } from '../chunk-HEVVT6IT.js';
3
3
  import '../chunk-CKB64Z4R.js';
4
4
  import '../chunk-P6GHJSLR.js';
5
- export { DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_WORKFLOW_RUNNER_LABELS, EMPTY_WORKFLOW_SCOPE, SKILL_PROMPT_FALLBACK_PLACEHOLDER, SKILL_PROMPT_LABEL, SchemaForm, WorkflowRunner, buildLaunch, composeStepPrompt, composeWorkflowPrompt, defaultInputs, dependsOn, fieldToFrontmatter, fillRunText, fillStepInputs, fromPlanSteps, initialRunInputs, inputsFromContext, isEmptyWorkflowScope, isIncompleteSignal, isPersonStep, isRunFinished, isSteppedWorkflow, isWorkflowScope, layoutFromPlanSteps, nextAction, orderSteps, promptFieldName, reviewInstructions, runFields, runThreadTitle, skillToWorkflow, stepDependencies, stepLevels, stepPhase, stepStatesFromActivity, toPlanSteps, useWorkflowView, validateInputs, validateStep, validateWorkflowGraph, workflowAccepts, workflowFromFrontmatter, workflowSteps, workflowsAccepting, workflowsForHost } from '../chunk-22P5KNIM.js';
5
+ export { ActionStepBody, ApprovalEvidence, AssigneeLine, DEFAULT_ASSIGNEE_WORDING, DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_WORKFLOW_RUNNER_LABELS, DEFAULT_WORKFLOW_STEP_PARTS_LABELS, EMPTY_WORKFLOW_SCOPE, SKILL_PROMPT_FALLBACK_PLACEHOLDER, SKILL_PROMPT_LABEL, SchemaForm, SendBackControl, WorkflowRunner, assigneeName, buildLaunch, canAssign, composeStepPrompt, composeWorkflowPrompt, defaultInputs, dependsOn, fieldToFrontmatter, fillRunText, fillStepInputs, fromPlanAssignee, fromPlanDocumentRef, fromPlanSteps, initialRunInputs, inputsFromContext, isEmptyWorkflowScope, isIncompleteSignal, isPersonAction, isPersonStep, isRunFinished, isSteppedWorkflow, isWorkflowScope, layoutFromPlanSteps, nextAction, orderSteps, promptFieldName, reviewInstructions, runFields, runFieldsOf, runThreadTitle, sendBackTargets, skillToWorkflow, splitDocRef, stepConfigProblems, stepDependencies, stepFields, stepLevels, stepPhase, stepStatesFromActivity, toPlanAssignee, toPlanDocumentRef, toPlanSteps, upstreamSteps, useWorkflowView, validateInputs, validateStep, validateWorkflowGraph, workflowAccepts, workflowFromFrontmatter, workflowSteps, workflowsAccepting, workflowsForHost } from '../chunk-34UW6XUQ.js';
6
6
  import '../chunk-4WWM3GQ5.js';
7
7
  import '../chunk-RFXJYIDV.js';
8
8
  import '../chunk-DPLRHEJZ.js';
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- export type TaskActivityKind = 'created' | 'run_started' | 'awaiting_access' | 'access_granted' | 'done' | 'reopened' | 'failed' | 'participant_joined' | 'assistant_responded' | 'assistant_stopped' | 'artifact_created' | 'artifact_edited' | 'document_added' | 'document_removed' | 'notified' | 'step_started' | 'step_done' | 'step_skipped' | 'step_failed' | 'step_signal' | 'linked_run';
2
+ export type TaskActivityKind = 'created' | 'run_started' | 'awaiting_access' | 'access_granted' | 'done' | 'reopened' | 'failed' | 'participant_joined' | 'assistant_responded' | 'assistant_stopped' | 'artifact_created' | 'artifact_edited' | 'document_added' | 'document_removed' | 'notified' | 'step_started' | 'step_done' | 'step_skipped' | 'step_failed' | 'step_waiting' | 'step_progress' | 'step_sent_back' | 'step_ready' | 'step_reminded' | 'step_signal' | 'linked_run';
3
3
  /** One event of a task's history, as the backend returns it (oldest first). */
4
4
  export interface TaskActivityEvent {
5
5
  external_id: string;
@@ -44,6 +44,10 @@ export interface WorkflowThreadStripLabels {
44
44
  signalled: string;
45
45
  /** A linked thread's tooltip; `{signal}` is replaced. */
46
46
  linkedRun: string;
47
+ /** A step that waits for someone; `{name}` is replaced. */
48
+ waitingFor: string;
49
+ /** A step the work was sent back to. */
50
+ sentBack: string;
47
51
  }
48
52
  export declare const DEFAULT_WORKFLOW_THREAD_STRIP_LABELS: WorkflowThreadStripLabels;
49
53
  /** A linked thread a signal started, as the host names it. */
@@ -84,6 +88,8 @@ export interface WorkflowThreadStripProps {
84
88
  signals?: readonly WorkflowThreadSignal[];
85
89
  /** For a thread a signal started: where it came from. */
86
90
  startedBy?: WorkflowThreadOrigin;
91
+ /** Who a step is for, in words (`assigneeName`): shown on the step while it waits for them. */
92
+ assigneeOf?: (step: WorkflowStep) => string | undefined;
87
93
  labels?: Partial<WorkflowThreadStripLabels>;
88
94
  className?: string;
89
95
  }
@@ -92,4 +98,4 @@ export declare function WorkflowThreadStartedBy({ origin, labels, }: {
92
98
  origin: WorkflowThreadOrigin;
93
99
  labels?: Partial<WorkflowThreadStripLabels>;
94
100
  }): import("react").JSX.Element;
95
- export declare function WorkflowThreadStrip({ steps, states, items, renderIcon, onSkip, renderStepAction, signals, startedBy, labels, className, }: WorkflowThreadStripProps): import("react").JSX.Element;
101
+ export declare function WorkflowThreadStrip({ steps, states, items, renderIcon, onSkip, renderStepAction, signals, startedBy, assigneeOf, labels, className, }: WorkflowThreadStripProps): import("react").JSX.Element;
@@ -20,6 +20,11 @@ export interface SchemaFormProps {
20
20
  renderDocuments?: (field: WorkflowField, value: WorkflowScope, onChange: (s: WorkflowScope) => void) => ReactNode;
21
21
  /** Maps an option's `icon` key to a mark. */
22
22
  renderIcon?: (key: string) => ReactNode;
23
+ /** Who a `person` field offers (the workspace's members); without them it takes an id. */
24
+ people?: ReadonlyArray<{
25
+ value: string;
26
+ label: string;
27
+ }>;
23
28
  /**
24
29
  * Plain Enter in a multi-line field submits the form (Shift+Enter inserts the newline), the
25
30
  * chat's own convention. Single-line fields submit natively.
@@ -34,4 +39,4 @@ export interface SchemaFormProps {
34
39
  * Renders a workflow's declared inputs as a form. Controlled: the caller owns `values` (see
35
40
  * `defaultInputs`) and decides when to validate (`validateInputs`) and show `errors`.
36
41
  */
37
- export declare function SchemaForm({ fields, values, onChange, errors, renderScope, renderDocuments, renderIcon, onEnterSubmit, testIdPrefix, labels, className, }: SchemaFormProps): import("react").JSX.Element;
42
+ export declare function SchemaForm({ fields, values, onChange, errors, renderScope, renderDocuments, renderIcon, onEnterSubmit, people, testIdPrefix, labels, className, }: SchemaFormProps): import("react").JSX.Element;
@@ -0,0 +1,109 @@
1
+ /**
2
+ * The runner's step parts beyond a form, an upload and an agent's answer: an action step (a
3
+ * signature, an email draft, a tabular review), a review's fields, its send-back and what it
4
+ * approved, the "Waiting for <person>" line, and "Open in Word" for a tracked-changes version.
5
+ * Everything that leaves the runner (opening a document, mail, a grid, the sign flow) goes through
6
+ * the host's `WorkflowRunnerActions`.
7
+ */
8
+ import { type ReactNode } from 'react';
9
+ import type { WorkflowRunView } from './useWorkflowView';
10
+ import type { WorkflowActionStep, WorkflowAgentStep, WorkflowReviewStep, WorkflowStepState } from './types';
11
+ /** Where the runner hands off to the host. Each is optional: absent, its button is not shown. */
12
+ export interface WorkflowRunnerActions {
13
+ /** Open a document, or one version of it (`doc-…@v3`). */
14
+ openDocument?: (ref: string) => void;
15
+ /** Open the document of a signature step to sign it (the signer's turn). */
16
+ sign?: (step: WorkflowActionStep, state: WorkflowStepState) => void;
17
+ /** Open an email step's draft in native mail. */
18
+ openDraft?: (draftId: string, mailbox?: string) => void;
19
+ /** Open a finished tabular review's grid: its columns (labels) over its documents. */
20
+ openReview?: (tags: string[], documents: string[]) => void;
21
+ /** Open a tracked-changes version in the Word editor, to accept or reject the changes. */
22
+ openRedline?: (ref: string) => void;
23
+ /** Show a step's answer where it is in the thread. */
24
+ openMessage?: (messageId: string) => void;
25
+ /** The person on screen (`usr-…`): a signature offers "Open and sign" to its signers only. */
26
+ me?: string;
27
+ }
28
+ export interface WorkflowStepPartsLabels {
29
+ waitingFor: string;
30
+ sendBack: string;
31
+ sendBackTo: string;
32
+ sendBackNote: string;
33
+ cancel: string;
34
+ sentBackHere: string;
35
+ approvedBy: string;
36
+ approvedAt: string;
37
+ approvedWhat: string;
38
+ viewAnswer: string;
39
+ fieldsHeading: string;
40
+ signers: string;
41
+ signed: string;
42
+ notSigned: string;
43
+ openAndSign: string;
44
+ decline: string;
45
+ declineNote: string;
46
+ declineConfirm: string;
47
+ declined: string;
48
+ signedVersion: string;
49
+ preparingSign: string;
50
+ expires: string;
51
+ preparingDraft: string;
52
+ draftReady: string;
53
+ openDraft: string;
54
+ emailSent: string;
55
+ reviewRunning: string;
56
+ reviewDone: string;
57
+ openReview: string;
58
+ openInWord: string;
59
+ redlineHint: string;
60
+ someone: string;
61
+ }
62
+ export declare const DEFAULT_WORKFLOW_STEP_PARTS_LABELS: WorkflowStepPartsLabels;
63
+ /** "Waiting for Sophie Lindqvist" on a step a person has to do. */
64
+ export declare function AssigneeLine({ run, stepId, l, testId, }: {
65
+ run: WorkflowRunView;
66
+ stepId: string;
67
+ l: WorkflowStepPartsLabels;
68
+ testId: string;
69
+ }): import("react").JSX.Element | null;
70
+ /** A step reopened by a send-back says so. */
71
+ export declare function SentBackNote({ state, l, testId, }: {
72
+ state: WorkflowStepState | undefined;
73
+ l: WorkflowStepPartsLabels;
74
+ testId: string;
75
+ }): import("react").JSX.Element | null;
76
+ /** "Send back" on a ready step: pick the earlier step to redo and say what needs to change. */
77
+ export declare function SendBackControl({ run, step, l, testId, }: {
78
+ run: WorkflowRunView;
79
+ step: WorkflowReviewStep;
80
+ l: WorkflowStepPartsLabels;
81
+ testId: string;
82
+ }): import("react").JSX.Element | null;
83
+ /** What a completed review recorded: who approved, the answers and versions, the fields. */
84
+ export declare function ApprovalEvidence({ run, step, actions, nameOfDoc, l, testId, }: {
85
+ run: WorkflowRunView;
86
+ step: WorkflowReviewStep;
87
+ actions?: WorkflowRunnerActions;
88
+ nameOfDoc?: (id: string) => string | undefined;
89
+ l: WorkflowStepPartsLabels;
90
+ testId: string;
91
+ }): import("react").JSX.Element | null;
92
+ /** "Open in Word" for an agent step that edited a document with tracked changes. */
93
+ export declare function RedlineOpen({ step, state, actions, l, testId, }: {
94
+ step: WorkflowAgentStep;
95
+ state: WorkflowStepState | undefined;
96
+ actions?: WorkflowRunnerActions;
97
+ l: WorkflowStepPartsLabels;
98
+ testId: string;
99
+ }): import("react").JSX.Element | null;
100
+ /** A platform action step: where it is, and what its person can do now. */
101
+ export declare function ActionStepBody({ step, run, actions, nameOfDoc, heading, l, testId, }: {
102
+ step: WorkflowActionStep;
103
+ run: WorkflowRunView;
104
+ actions?: WorkflowRunnerActions;
105
+ nameOfDoc?: (id: string) => string | undefined;
106
+ heading: ReactNode;
107
+ l: WorkflowStepPartsLabels;
108
+ testId: string;
109
+ }): import("react").JSX.Element;
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { type ReactNode } from 'react';
8
8
  import { type SchemaFormProps } from './SchemaForm';
9
+ import { type WorkflowRunnerActions, type WorkflowStepPartsLabels } from './StepParts';
9
10
  import type { WorkflowRunView } from './useWorkflowView';
10
11
  import type { WorkflowAgentStep, WorkflowDefinition, WorkflowReviewStep, WorkflowStep, WorkflowStepState, WorkflowUploadStep } from './types';
11
12
  export interface WorkflowRunnerLabels {
@@ -44,6 +45,8 @@ export interface WorkflowRunnerLabels {
44
45
  fileFailed: string;
45
46
  /** Continue on an upload step while its files are read; `{current}` and `{count}` are replaced. */
46
47
  readingFiles: string;
48
+ /** The primary button on an email step waiting to be sent. */
49
+ markSent: string;
47
50
  }
48
51
  export declare const DEFAULT_WORKFLOW_RUNNER_LABELS: WorkflowRunnerLabels;
49
52
  /** A file the upload step lists (what is in the run's workspace). */
@@ -55,7 +58,7 @@ export interface WorkflowRunnerFile {
55
58
  /** The upload step it was added on in this run (listed first there, and holds it while read). */
56
59
  addedFor?: string;
57
60
  }
58
- export interface WorkflowRunnerProps extends Pick<SchemaFormProps, 'renderScope' | 'renderDocuments' | 'renderIcon'> {
61
+ export interface WorkflowRunnerProps extends Pick<SchemaFormProps, 'renderScope' | 'renderDocuments' | 'renderIcon' | 'people'> {
59
62
  workflow: WorkflowDefinition;
60
63
  run: WorkflowRunView;
61
64
  /** An agent step's output (its answer, a drafted document). */
@@ -73,7 +76,13 @@ export interface WorkflowRunnerProps extends Pick<SchemaFormProps, 'renderScope'
73
76
  renderStepNote?: (step: WorkflowStep, run: WorkflowRunView) => ReactNode;
74
77
  /** Replaces the finish screen. */
75
78
  renderComplete?: (run: WorkflowRunView) => ReactNode;
79
+ /** Where the runner hands off to the host: documents, the sign flow, mail, a review grid. */
80
+ actions?: WorkflowRunnerActions;
81
+ /** A document's name by id (chips show it instead of the id). */
82
+ nameOfDoc?: (id: string) => string | undefined;
76
83
  labels?: Partial<WorkflowRunnerLabels>;
84
+ /** The wording of action steps, assignees, send-backs and approvals. */
85
+ partsLabels?: Partial<WorkflowStepPartsLabels>;
77
86
  /**
78
87
  * Test ids: `<prefix>-step-<id>` (pill), `<prefix>-<id>` (body), `<prefix>-field-<name>`,
79
88
  * `<prefix>-next` / `-back`, `<prefix>-done`.
@@ -81,6 +90,6 @@ export interface WorkflowRunnerProps extends Pick<SchemaFormProps, 'renderScope'
81
90
  testIdPrefix?: string;
82
91
  className?: string;
83
92
  }
84
- export declare function WorkflowRunner({ workflow, run, renderAgentOutput, renderReview, onUpload, uploading, files, renderUpload, renderStepNote, renderComplete, renderScope, renderDocuments, renderIcon, labels, testIdPrefix, className, }: WorkflowRunnerProps): import("react").JSX.Element;
93
+ export declare function WorkflowRunner({ workflow, run, renderAgentOutput, renderReview, onUpload, uploading, files, renderUpload, renderStepNote, renderComplete, renderScope, renderDocuments, renderIcon, people, actions, nameOfDoc, labels, partsLabels, testIdPrefix, className, }: WorkflowRunnerProps): import("react").JSX.Element;
85
94
  /** m:ss (h:mm:ss past an hour). */
86
95
  export declare function formatElapsed(ms: number): string;
@@ -7,9 +7,10 @@ export { defaultScopeRenderer, resolveScopeInputs } from './scopeRender';
7
7
  export { WorkflowLauncher, type WorkflowLauncherProps } from './WorkflowLauncher';
8
8
  export { buildWorkflowScopeSource, matchWorkflowScope, type WorkflowScopeDocument, type WorkflowScopeLabel, } from './workspaceScope';
9
9
  export { WorkflowDocumentsField, type WorkflowDocumentsFieldProps } from './WorkflowDocumentsField';
10
- export { workflowSteps, isSteppedWorkflow, stepDependencies, dependsOn, orderSteps, validateWorkflowGraph, stepLevels, stepStatesFromActivity, runFields, initialRunInputs, stepPhase, isRunFinished, isPersonStep, nextAction, validateStep, fillRunText, fillStepInputs, runThreadTitle, reviewInstructions, composeStepPrompt, type StepComposeOptions, type WorkflowActivityEvent, type WorkflowGraphProblem, type WorkflowStepPhase, type WorkflowNextAction, } from './run';
11
- export { toPlanSteps, fromPlanSteps, layoutFromPlanSteps, isIncompleteSignal, type TaskPlanStep, type ToPlanOptions, } from './planSteps';
10
+ export { workflowSteps, isSteppedWorkflow, stepDependencies, dependsOn, orderSteps, validateWorkflowGraph, stepLevels, stepStatesFromActivity, runFields, initialRunInputs, stepPhase, isRunFinished, isPersonStep, nextAction, validateStep, fillRunText, fillStepInputs, runThreadTitle, reviewInstructions, composeStepPrompt, stepFields, runFieldsOf, isPersonAction, canAssign, upstreamSteps, sendBackTargets, stepConfigProblems, splitDocRef, assigneeName, DEFAULT_ASSIGNEE_WORDING, type AssigneeWording, type WorkflowStepProblem, type StepComposeOptions, type WorkflowActivityEvent, type WorkflowGraphProblem, type WorkflowStepPhase, type WorkflowNextAction, } from './run';
11
+ export { toPlanSteps, fromPlanSteps, layoutFromPlanSteps, isIncompleteSignal, toPlanAssignee, fromPlanAssignee, toPlanDocumentRef, fromPlanDocumentRef, type TaskPlanStep, type ToPlanOptions, } from './planSteps';
12
12
  export { workflowToSkillMarkdown, workflowFromSkillMarkdown, skillSlug } from './skillMarkdown';
13
13
  export { useWorkflowView, type UseWorkflowViewOptions, type WorkflowRunView, } from './useWorkflowView';
14
14
  export { useWorkflowPreview, type UseWorkflowPreviewOptions } from './useWorkflowPreview';
15
15
  export { WorkflowRunner, DEFAULT_WORKFLOW_RUNNER_LABELS, type WorkflowRunnerProps, type WorkflowRunnerLabels, type WorkflowRunnerFile, } from './WorkflowRunner';
16
+ export { ActionStepBody, ApprovalEvidence, AssigneeLine, SendBackControl, DEFAULT_WORKFLOW_STEP_PARTS_LABELS, type WorkflowRunnerActions, type WorkflowStepPartsLabels, } from './StepParts';
@@ -6,9 +6,15 @@
6
6
  */
7
7
  import type { components } from '@arbidocs/client';
8
8
  import { type StepComposeOptions } from './run';
9
- import type { WorkflowDefinition, WorkflowInputs, WorkflowSignal, WorkflowStep } from './types';
9
+ import type { WorkflowAssignee, WorkflowDefinition, WorkflowDocumentRef, WorkflowInputs, WorkflowSignal, WorkflowStep } from './types';
10
10
  export type TaskPlanStep = components['schemas']['TaskPlanStep'];
11
+ type StepAssignee = components['schemas']['StepAssignee'];
12
+ type PlanDocumentRef = string | components['schemas']['StepDocumentRef'];
11
13
  export type TaskPlan = components['schemas']['TaskPlan'];
14
+ export declare function toPlanAssignee(a: WorkflowAssignee): StepAssignee;
15
+ export declare function fromPlanAssignee(a: StepAssignee | null | undefined): WorkflowAssignee | undefined;
16
+ export declare function toPlanDocumentRef(ref: WorkflowDocumentRef): PlanDocumentRef;
17
+ export declare function fromPlanDocumentRef(ref: PlanDocumentRef | null | undefined): WorkflowDocumentRef | undefined;
12
18
  export interface ToPlanOptions extends StepComposeOptions {
13
19
  /**
14
20
  * The run's inputs when it starts: prompts are composed with them. Fields not given yet (or
@@ -28,3 +34,4 @@ export declare function layoutFromPlanSteps(steps: TaskPlanStep[] | null | undef
28
34
  x: number;
29
35
  y: number;
30
36
  }> | undefined;
37
+ export {};
@@ -4,7 +4,7 @@
4
4
  * run's thread records it (`stepStatesFromActivity`). Pure functions, shared by the thread runner
5
5
  * (`useWorkflowThread`), the builder's preview and the thread's top bar.
6
6
  */
7
- import type { WorkflowAgentStep, WorkflowDefinition, WorkflowErrors, WorkflowInputs, WorkflowReviewStep, WorkflowStep, WorkflowStepState } from './types';
7
+ import type { WorkflowActionStep, WorkflowAgentStep, WorkflowAssignee, WorkflowField, WorkflowDefinition, WorkflowErrors, WorkflowInputs, WorkflowReviewStep, WorkflowStep, WorkflowStepState } from './types';
8
8
  /** A stepped workflow's steps; empty for a single-run one. */
9
9
  export declare function workflowSteps(workflow: WorkflowDefinition): WorkflowStep[];
10
10
  export declare const isSteppedWorkflow: (workflow: WorkflowDefinition) => boolean;
@@ -45,23 +45,37 @@ export declare function stepLevels(steps: WorkflowStep[]): WorkflowStep[][];
45
45
  export interface WorkflowActivityEvent {
46
46
  kind: string;
47
47
  detail?: Record<string, unknown> | null;
48
+ actor_ext_id?: string | null;
48
49
  created_at?: string;
49
50
  }
50
- /** Each step's state from the thread's activity log (oldest first): its latest step event wins. */
51
+ /**
52
+ * Each step's state from the thread's activity log (oldest first): its latest step event wins.
53
+ * A send-back reopens the steps it lists as pending (only the one it went `to` is `sentBack`); a
54
+ * `step_ready` records who was told and a `step_progress` what a waiting step now waits on, until
55
+ * the step's next change. Mirrors the server (`workflow_steps.progress`).
56
+ */
51
57
  export declare function stepStatesFromActivity(events: WorkflowActivityEvent[]): Record<string, WorkflowStepState>;
52
- /** Every field the run asks for: the launch form's, then each form step's. */
53
- export declare function runFields(workflow: WorkflowDefinition): import("./types").WorkflowField[];
58
+ /** The fields a person fills in on a step: a form's inputs, a review's fields. */
59
+ export declare function stepFields(step: WorkflowStep): WorkflowField[];
60
+ /** The fields the steps ask for (forms and reviews), in plan order. */
61
+ export declare const runFieldsOf: (steps: WorkflowStep[]) => WorkflowField[];
62
+ /** Every field the run asks for: the launch form's, then each form's and review's. */
63
+ export declare function runFields(workflow: WorkflowDefinition): WorkflowField[];
54
64
  /** A fresh run's inputs: every field at its default, then the prefills. */
55
65
  export declare function initialRunInputs(workflow: WorkflowDefinition, inputs?: WorkflowInputs): WorkflowInputs;
56
66
  /**
57
67
  * Where a step stands: `blocked` until everything it waits for has finished (done or skipped),
58
- * then `ready`, then its own status.
68
+ * then `ready`, then its own status (`waiting`: an action step waiting on its people).
59
69
  */
60
- export type WorkflowStepPhase = 'blocked' | 'ready' | 'running' | 'done' | 'skipped' | 'failed';
70
+ export type WorkflowStepPhase = 'blocked' | 'ready' | 'running' | 'waiting' | 'done' | 'skipped' | 'failed';
61
71
  export declare function stepPhase(steps: WorkflowStep[], states: Record<string, WorkflowStepState>, id: string): WorkflowStepPhase;
62
72
  export declare const isRunFinished: (steps: WorkflowStep[], states: Record<string, WorkflowStepState>) => boolean;
63
- /** A step a person does (form, upload, review); agent steps run themselves. */
73
+ /** A step a person does (form, upload, review); agent and action steps start by themselves. */
64
74
  export declare const isPersonStep: (step: WorkflowStep) => boolean;
75
+ /** An action step whose waiting phase is a person's: signing, sending the email. */
76
+ export declare const isPersonAction: (step: WorkflowStep) => step is WorkflowActionStep;
77
+ /** A step that can have an assignee and a reminder: a person step, or a signature or email. */
78
+ export declare const canAssign: (step: WorkflowStep) => boolean;
65
79
  /**
66
80
  * What the primary button does on the step in view:
67
81
  * - `complete`: finish this form, upload or review (approve) and move on;
@@ -72,8 +86,47 @@ export declare const isPersonStep: (step: WorkflowStep) => boolean;
72
86
  */
73
87
  export type WorkflowNextAction = 'complete' | 'move' | 'skip' | 'finish' | 'wait';
74
88
  export declare function nextAction(steps: WorkflowStep[], states: Record<string, WorkflowStepState>, current: string | null): WorkflowNextAction;
75
- /** A form step's problems (empty = it can move on); other steps have none. */
89
+ /** A form's or a fielded review's problems (empty = it can move on); other steps have none. */
76
90
  export declare function validateStep(step: WorkflowStep, inputs: WorkflowInputs): WorkflowErrors;
91
+ /** Every step `id` waits for, directly or through others, in plan order. */
92
+ export declare function upstreamSteps(steps: WorkflowStep[], id: string): WorkflowStep[];
93
+ /**
94
+ * Where a ready step can send the work back to: an earlier step it waits for that has something
95
+ * to redo (done, skipped or failed), nearest first.
96
+ */
97
+ export declare function sendBackTargets(steps: WorkflowStep[], states: Record<string, WorkflowStepState>, id: string): WorkflowStep[];
98
+ /** Something a step still needs before it can run, for the builder to point out. */
99
+ export interface WorkflowStepProblem {
100
+ step: string;
101
+ missing: 'document' | 'signers' | 'recipients' | 'tags' | 'documents';
102
+ }
103
+ /** What the steps still need before they can run: an action's document, signers, … */
104
+ export declare function stepConfigProblems(steps: WorkflowStep[]): WorkflowStepProblem[];
105
+ /** A document version id (`doc-…@v3`) split into the document and its version. */
106
+ export declare function splitDocRef(ref: string): {
107
+ id: string;
108
+ version?: number;
109
+ };
110
+ /** How an assignee that names no one directly is described. */
111
+ export interface AssigneeWording {
112
+ runOwner: string;
113
+ projectLead: string;
114
+ /** `{field}`: the person field's label. */
115
+ input: string;
116
+ }
117
+ export declare const DEFAULT_ASSIGNEE_WORDING: AssigneeWording;
118
+ /**
119
+ * Who a step is for, in words: the person it was announced to, the member it names, the person a
120
+ * form field holds (each through `nameOf`), else its role. Undefined when it names no one.
121
+ */
122
+ export declare function assigneeName(assignee: WorkflowAssignee | undefined, options?: {
123
+ nameOf?: (id: string) => string | undefined;
124
+ inputs?: WorkflowInputs;
125
+ fields?: WorkflowField[];
126
+ /** Who the server told (the assignee resolved): wins over a role. */
127
+ announcedTo?: string | null;
128
+ wording?: Partial<AssigneeWording>;
129
+ }): string | undefined;
77
130
  /**
78
131
  * Fill a step's `with` templates from the run's inputs: `{{a}}`, `{{a || b}}` (first non-blank).
79
132
  * A template that is exactly one bare reference passes the value through untouched.
@@ -6,7 +6,9 @@
6
6
  * `workflowFromFrontmatter`), so the backend can adopt it without a UI change. Blocks hold no
7
7
  * domain wording: titles, labels and prompt text are data supplied by the host.
8
8
  */
9
- export type WorkflowFieldType = 'text' | 'longtext' | 'boolean' | 'select' | 'number' | 'date' | 'scope' | 'documents';
9
+ export type WorkflowFieldType = 'text' | 'longtext' | 'boolean' | 'select' | 'number' | 'date' | 'scope' | 'documents'
10
+ /** A workspace member (`usr-…` / `agt-…`): what a step's assignee or a signer can name. */
11
+ | 'person';
10
12
  /**
11
13
  * What a launching surface can hand a workflow without asking the user: the files it is looking at
12
14
  * (`documents`), the text the user selected (`selection`), or the image on screen (`image`, a file
@@ -140,7 +142,74 @@ interface WorkflowStepBase {
140
142
  after?: string[];
141
143
  /** Signals the step raises when it is done and their condition holds. */
142
144
  signals?: WorkflowSignal[];
145
+ /**
146
+ * Who the step is for (a person step, or a signature or email step): they are told when it is
147
+ * ready, and only they (or the run's owner) can do it. Absent: whoever is on the run.
148
+ */
149
+ assignee?: WorkflowAssignee;
150
+ /** A person step left this many hours is announced again (once). */
151
+ remindAfterHours?: number;
152
+ }
153
+ /**
154
+ * Who a step is for: a named member (`usr-…` / `agt-…`), whoever started the run, the person a
155
+ * form's `person` field names (`input`: its name), or the project's lead.
156
+ */
157
+ export type WorkflowAssignee = {
158
+ user: string;
159
+ } | {
160
+ runOwner: true;
161
+ } | {
162
+ input: string;
163
+ } | {
164
+ projectLead: true;
165
+ };
166
+ /**
167
+ * A document a step works on, named by where it comes from: what an earlier step produced or was
168
+ * given (an upload's files, an agent's draft, a signed copy, an edited version), what a run input
169
+ * names (a document pick), or one document by id (`doc-…`, optionally `@v<n>`).
170
+ */
171
+ export type WorkflowDocumentRef = {
172
+ step: string;
173
+ } | {
174
+ input: string;
175
+ } | {
176
+ id: string;
177
+ };
178
+ /** Ask people to e-sign a document. The step waits until every signer has signed. */
179
+ export interface WorkflowSignAction {
180
+ type: 'sign';
181
+ document?: WorkflowDocumentRef;
182
+ signers: WorkflowAssignee[];
183
+ /** Shown to the signers. */
184
+ message?: string;
185
+ /** Unsigned this long after it starts, the step fails. */
186
+ expiresAfterHours?: number;
187
+ }
188
+ /**
189
+ * Prepare an email in native mail, never sent by itself: its person sends it, and the step is done
190
+ * when they say so (or send it). Every text is a template over the run (`{{field}}`,
191
+ * `{{step.answer}}`).
192
+ */
193
+ export interface WorkflowEmailDraftAction {
194
+ type: 'email_draft';
195
+ to: string[];
196
+ cc?: string[];
197
+ subject: string;
198
+ body: string;
199
+ attachments?: WorkflowDocumentRef[];
143
200
  }
201
+ /** Run review columns (labels with instructions) over documents, then open the grid. */
202
+ export interface WorkflowTabularReviewAction {
203
+ type: 'tabular_review';
204
+ /** Label (tag) ids: the columns. */
205
+ tags: string[];
206
+ /** Every file the run's uploads took, every document of the workspace, or these documents. */
207
+ documents: 'run_uploads' | 'workspace' | WorkflowDocumentRef[];
208
+ /** Fill cells that already have a value again. */
209
+ overwrite?: boolean;
210
+ }
211
+ export type WorkflowAction = WorkflowSignAction | WorkflowEmailDraftAction | WorkflowTabularReviewAction;
212
+ export type WorkflowActionType = WorkflowAction['type'];
144
213
  /** Ask for inputs. Every step's fields share the run's one input namespace (`{{name}}`). */
145
214
  export interface WorkflowFormStep extends WorkflowStepBase {
146
215
  kind: 'form';
@@ -180,14 +249,29 @@ export interface WorkflowAgentStep extends WorkflowStepBase {
180
249
  output?: 'answer' | 'artifact';
181
250
  /** Runs off the thread's main line and delivers only its result to it. */
182
251
  branch?: boolean;
252
+ /**
253
+ * Edit this Word document with tracked changes (the instruction says what to change); the
254
+ * edited copy is its next version, to accept or reject change by change. Main line only.
255
+ */
256
+ editDocument?: WorkflowDocumentRef;
183
257
  }
184
258
  /** A person's review or approval: whoever completes it on the thread approves it. */
185
259
  export interface WorkflowReviewStep extends WorkflowStepBase {
186
260
  kind: 'review';
187
261
  /** What to review, a template over the run's inputs. */
188
262
  instructions?: string;
263
+ /** What the approver fills in when approving (e.g. a rating): they join the run's inputs. */
264
+ fields?: WorkflowField[];
189
265
  }
190
- export type WorkflowStep = WorkflowFormStep | WorkflowUploadStep | WorkflowAgentStep | WorkflowReviewStep;
266
+ /**
267
+ * A step that uses a platform feature rather than producing text: an e-signature, an email draft
268
+ * or a tabular review. It starts by itself; a signature and an email then wait for their people.
269
+ */
270
+ export interface WorkflowActionStep extends WorkflowStepBase {
271
+ kind: 'action';
272
+ action: WorkflowAction;
273
+ }
274
+ export type WorkflowStep = WorkflowFormStep | WorkflowUploadStep | WorkflowAgentStep | WorkflowReviewStep | WorkflowActionStep;
191
275
  /** The finish screen of a stepped run. */
192
276
  export interface WorkflowCompletion {
193
277
  title: string;
@@ -196,9 +280,33 @@ export interface WorkflowCompletion {
196
280
  }
197
281
  /**
198
282
  * Where a step of a run is, as the thread records it: not reached yet (`pending`), `running`,
199
- * `done`, `skipped`, or `failed` (it can be retried or skipped).
283
+ * `waiting` (an action step waiting on its signers or on its email being sent), `done`,
284
+ * `skipped`, or `failed` (it can be retried or skipped).
200
285
  */
201
- export type WorkflowStepStatus = 'pending' | 'running' | 'done' | 'skipped' | 'failed';
286
+ export type WorkflowStepStatus = 'pending' | 'running' | 'waiting' | 'done' | 'skipped' | 'failed';
287
+ /** What an action step waits on (ids only), as its latest event says. */
288
+ export interface WorkflowActionWaiting {
289
+ /** A signature: the document and version to sign, who signs, who has signed. */
290
+ doc_ext_id?: string;
291
+ version?: number;
292
+ signers?: string[];
293
+ signed?: string[];
294
+ expires_at?: string;
295
+ /** An email: the draft in native mail and whose mailbox it is in. */
296
+ draft_id?: string;
297
+ mailbox?: string;
298
+ [key: string]: unknown;
299
+ }
300
+ /** What a review recorded it approved: each step it waited for, as it stood then. */
301
+ export interface WorkflowApprovalEvidence {
302
+ step: string;
303
+ status: string;
304
+ /** That step's answer (a message in the thread). */
305
+ response_id?: string;
306
+ /** The document versions it had (`doc-…@v<n>`). */
307
+ documents?: string[];
308
+ output?: Record<string, unknown>;
309
+ }
202
310
  export interface WorkflowStepState {
203
311
  status: WorkflowStepStatus;
204
312
  /** The step's answer in the thread (an agent step), or the result a branch delivered. */
@@ -208,6 +316,27 @@ export interface WorkflowStepState {
208
316
  error?: string | null;
209
317
  /** When it started running (ISO), for the elapsed time while it runs. */
210
318
  startedAt?: string;
319
+ /** An action step's type, once it has started. */
320
+ action?: WorkflowActionType;
321
+ /** What a `waiting` action step waits on. */
322
+ waiting?: WorkflowActionWaiting;
323
+ /** What a done action step produced (ids: the signed version, the draft, the reviewed labels). */
324
+ output?: Record<string, unknown>;
325
+ /** The document versions the step produced or was given (`doc-…@v<n>`). */
326
+ documents?: string[];
327
+ /** Reopened by a send-back to this step and not touched since (`hasNote`: with a note). */
328
+ sentBack?: boolean;
329
+ hasNote?: boolean;
330
+ /** Who was told the step is ready (`usr-…` / `agt-…`), since it last changed. */
331
+ announcedTo?: string | null;
332
+ /** Who finished it (completed, approved, skipped, declined). */
333
+ by?: string | null;
334
+ /** When it finished (ISO). */
335
+ at?: string;
336
+ /** A review: what it approved. */
337
+ approved?: WorkflowApprovalEvidence[];
338
+ /** A declined signature: who declined. */
339
+ declinedBy?: string;
211
340
  }
212
341
  export interface WorkflowDefinition {
213
342
  /** Execute a document operation directly, without creating a chat. */
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * A stepped workflow run on screen only (the builder's preview): agent steps run one at a time,
3
- * the way the server does, and answer with the prompt they would send. No thread, no agent.
3
+ * the way the server does, and answer with the prompt they would send; action steps just finish.
4
+ * No thread, no agent.
4
5
  */
5
6
  import { type StepComposeOptions } from './run';
6
7
  import type { WorkflowDefinition } from './types';
@@ -20,6 +20,17 @@ export interface UseWorkflowViewOptions {
20
20
  retry?: (stepId: string) => Promise<void>;
21
21
  /** A form step whose inputs can no longer change (committed, or recorded on the thread). */
22
22
  isLocked?: (stepId: string) => boolean;
23
+ /**
24
+ * Whether `states` are known yet (a run opened later: its thread's log has arrived). Until then
25
+ * the view waits to open the run where it is, instead of at its first step. Default true.
26
+ */
27
+ loaded?: boolean;
28
+ /** Send the work back from a ready step to an earlier one, with a note. */
29
+ sendBack?: (stepId: string, to: string, note?: string) => Promise<void>;
30
+ /** A signer refuses a signature step, with a note. */
31
+ decline?: (stepId: string, note?: string) => Promise<void>;
32
+ /** A member's name by id (`usr-…` / `agt-…`): assignees and signers are shown by name. */
33
+ nameOf?: (id: string) => string | undefined;
23
34
  }
24
35
  /** What `WorkflowRunner` shows and does. */
25
36
  export interface WorkflowRunView {
@@ -48,6 +59,14 @@ export interface WorkflowRunView {
48
59
  goTo: (stepId: string) => void;
49
60
  skip: (stepId: string) => Promise<void>;
50
61
  retry?: (stepId: string) => Promise<void>;
62
+ /** Send the work back from `stepId` to `to` (it is then in view). Absent = not offered. */
63
+ sendBack?: (stepId: string, to: string, note?: string) => Promise<void>;
64
+ /** Decline a signature step. Absent = not offered. */
65
+ decline?: (stepId: string, note?: string) => Promise<void>;
66
+ /** A member's name by id. */
67
+ nameOf?: (id: string) => string | undefined;
68
+ /** Who a step is for, in words (a person step, a signature, an email), if anyone. */
69
+ assigneeOf: (stepId: string) => string | undefined;
51
70
  /** Show the run from the start again (a host that starts a new run resets its own state). */
52
71
  restart: () => void;
53
72
  }
@@ -16,4 +16,4 @@ import { type ChatPageProps } from './chat-page-types';
16
16
  * With `surface="page"` it claims the page-chat slot, so `useChatSurface()` tells the host's dock
17
17
  * to yield: one chat on screen, never two.
18
18
  */
19
- export declare function ChatPage({ chat, surface, header, headerActions, aside, prompts, documentsRequired, emptyTitle, emptyDescription, identity, renderContent, onOpenCitation, targetMessageId, asideBreakpoint, fillHeight, minHeight, compactHeader, accept, labels, className, testIds, }: ChatPageProps): import("react").JSX.Element;
19
+ export declare function ChatPage({ chat, surface, header, headerActions, aside, prompts, documentsRequired, emptyTitle, emptyDescription, identity, renderContent, onOpenCitation, workflowStepTitle, targetMessageId, asideBreakpoint, fillHeight, minHeight, compactHeader, accept, labels, className, testIds, }: ChatPageProps): import("react").JSX.Element;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * A message the server sent to start a workflow's step, shown as that step: a compact chip
3
+ * ("Workflow step · Draft the letter") that expands to the full instruction. Any chat that knows a
4
+ * message's step (its `tools.workflow_step`) renders this instead of the raw instruction.
5
+ */
6
+ export interface WorkflowStepChipLabels {
7
+ /** `{title}` is the step's title (its id when the title is not known). */
8
+ chip: string;
9
+ show: string;
10
+ hide: string;
11
+ }
12
+ export declare const DEFAULT_WORKFLOW_STEP_CHIP_LABELS: WorkflowStepChipLabels;
13
+ export interface WorkflowStepChipProps {
14
+ /** The step's id. */
15
+ step: string;
16
+ /** The step's title, when the host knows it (from the run's plan). */
17
+ title?: string;
18
+ /** The instruction the step sent. */
19
+ content: string;
20
+ labels?: Partial<WorkflowStepChipLabels>;
21
+ className?: string;
22
+ testId?: string;
23
+ }
24
+ export declare function WorkflowStepChip({ step, title, content, labels, className, testId, }: WorkflowStepChipProps): import("react").JSX.Element;