@arbidocs/blocks 0.4.72 → 0.4.73

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 (89) hide show
  1. package/dist/agents/index.cjs +400 -261
  2. package/dist/agents/index.js +6 -3
  3. package/dist/agents/tasks/TaskActivityTimeline.d.ts +1 -1
  4. package/dist/agents/tasks/WorkflowThreadStrip.d.ts +58 -0
  5. package/dist/agents/tasks/index.d.ts +1 -0
  6. package/dist/agents/workflows/WorkflowRunner.d.ts +70 -0
  7. package/dist/agents/workflows/index.d.ts +7 -1
  8. package/dist/agents/workflows/planSteps.d.ts +28 -0
  9. package/dist/agents/workflows/run.d.ts +97 -0
  10. package/dist/agents/workflows/skillMarkdown.d.ts +15 -0
  11. package/dist/agents/workflows/types.d.ts +109 -0
  12. package/dist/agents/workflows/useWorkflowPreview.d.ts +14 -0
  13. package/dist/agents/workflows/useWorkflowView.d.ts +54 -0
  14. package/dist/agents/workflows/workflow.d.ts +3 -1
  15. package/dist/chunk-2P3T23C7.js +1250 -0
  16. package/dist/chunk-2P3T23C7.js.map +1 -0
  17. package/dist/chunk-7D737FLE.cjs +43 -0
  18. package/dist/chunk-7D737FLE.cjs.map +1 -0
  19. package/dist/{chunk-LFGJAZ5H.js → chunk-DDF5GPIJ.js} +6 -36
  20. package/dist/chunk-DDF5GPIJ.js.map +1 -0
  21. package/dist/chunk-DETZZBG2.cjs +91 -0
  22. package/dist/chunk-DETZZBG2.cjs.map +1 -0
  23. package/dist/chunk-EVUEIBNU.js +89 -0
  24. package/dist/chunk-EVUEIBNU.js.map +1 -0
  25. package/dist/chunk-GTNUQBXI.cjs +1296 -0
  26. package/dist/chunk-GTNUQBXI.cjs.map +1 -0
  27. package/dist/{chunk-DH7C2UJO.cjs → chunk-IUR565UW.cjs} +297 -524
  28. package/dist/chunk-IUR565UW.cjs.map +1 -0
  29. package/dist/{chunk-THO7DZNN.cjs → chunk-MUMH3Z6K.cjs} +20 -15
  30. package/dist/chunk-MUMH3Z6K.cjs.map +1 -0
  31. package/dist/{chunk-KOXUBCLL.js → chunk-ORA2XE7U.js} +3 -3
  32. package/dist/{chunk-KOXUBCLL.js.map → chunk-ORA2XE7U.js.map} +1 -1
  33. package/dist/{chunk-5HOAOKZL.js → chunk-OYMWV45N.js} +21 -16
  34. package/dist/chunk-OYMWV45N.js.map +1 -0
  35. package/dist/{chunk-IMC2Z32C.js → chunk-QDNXEB3T.js} +268 -484
  36. package/dist/chunk-QDNXEB3T.js.map +1 -0
  37. package/dist/{chunk-G5QTGKDJ.cjs → chunk-WOYUXVVQ.cjs} +6 -6
  38. package/dist/{chunk-G5QTGKDJ.cjs.map → chunk-WOYUXVVQ.cjs.map} +1 -1
  39. package/dist/chunk-XD2M6LIG.js +41 -0
  40. package/dist/chunk-XD2M6LIG.js.map +1 -0
  41. package/dist/{chunk-WBDK4PIA.cjs → chunk-Z5VUZ6YD.cjs} +6 -37
  42. package/dist/chunk-Z5VUZ6YD.cjs.map +1 -0
  43. package/dist/connect/docx.cjs +2 -2
  44. package/dist/connect/docx.js +1 -1
  45. package/dist/connect/index.cjs +316 -23
  46. package/dist/connect/index.cjs.map +1 -1
  47. package/dist/connect/index.d.ts +1 -0
  48. package/dist/connect/index.js +300 -8
  49. package/dist/connect/index.js.map +1 -1
  50. package/dist/connection/ConnectedWorkflowBuilder.d.ts +44 -0
  51. package/dist/connection/ConnectedWorkflowRunner.d.ts +27 -0
  52. package/dist/connection/useWorkflowThread.d.ts +34 -0
  53. package/dist/facts/index.cjs +1 -1
  54. package/dist/facts/index.js +1 -1
  55. package/dist/files/index.cjs +9 -83
  56. package/dist/files/index.cjs.map +1 -1
  57. package/dist/files/index.js +6 -83
  58. package/dist/files/index.js.map +1 -1
  59. package/dist/home/index.cjs +22 -21
  60. package/dist/home/index.cjs.map +1 -1
  61. package/dist/home/index.js +4 -3
  62. package/dist/home/index.js.map +1 -1
  63. package/dist/index.cjs +450 -311
  64. package/dist/index.cjs.map +1 -1
  65. package/dist/index.js +7 -4
  66. package/dist/index.js.map +1 -1
  67. package/dist/shell/index.cjs +1 -1
  68. package/dist/shell/index.js +1 -1
  69. package/dist/studio/index.cjs +5 -5
  70. package/dist/studio/index.js +3 -3
  71. package/dist/workflow-canvas/StepInspector.d.ts +46 -0
  72. package/dist/workflow-canvas/TriggerInspector.d.ts +46 -0
  73. package/dist/workflow-canvas/WorkflowBuilder.d.ts +55 -0
  74. package/dist/workflow-canvas/WorkflowCanvas.d.ts +65 -0
  75. package/dist/workflow-canvas/edit.d.ts +54 -0
  76. package/dist/workflow-canvas/index.cjs +1609 -0
  77. package/dist/workflow-canvas/index.cjs.map +1 -0
  78. package/dist/workflow-canvas/index.d.ts +13 -0
  79. package/dist/workflow-canvas/index.js +1579 -0
  80. package/dist/workflow-canvas/index.js.map +1 -0
  81. package/dist/workflow-canvas/trigger.d.ts +51 -0
  82. package/package.json +25 -14
  83. package/src/workflow-canvas/canvas.css +113 -0
  84. package/dist/chunk-5HOAOKZL.js.map +0 -1
  85. package/dist/chunk-DH7C2UJO.cjs.map +0 -1
  86. package/dist/chunk-IMC2Z32C.js.map +0 -1
  87. package/dist/chunk-LFGJAZ5H.js.map +0 -1
  88. package/dist/chunk-THO7DZNN.cjs.map +0 -1
  89. package/dist/chunk-WBDK4PIA.cjs.map +0 -1
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Build a workflow visually: what starts it (the trigger node), its named steps (forms, uploads,
3
+ * agent steps running a skill or an instruction, branches, a person's approval), wired on a
4
+ * canvas, each set in the inspector; and a preview of a run (the real runner with a stand-in
5
+ * agent). The value saves as a workflow (`builderToWorkflowRequest`): every firing is a work
6
+ * thread that runs the steps.
7
+ */
8
+ import { type ReactNode } from 'react';
9
+ import { type AgentOption, type StepComposeOptions, type WorkflowDefinition, type WorkflowGraphProblem } from '../agents';
10
+ import { type StepInspectorLabels } from './StepInspector';
11
+ import { type TriggerInspectorLabels } from './TriggerInspector';
12
+ import type { WorkflowBuilderValue } from './trigger';
13
+ import { type WorkflowCanvasLabels } from './WorkflowCanvas';
14
+ export interface WorkflowBuilderLabels {
15
+ addStep: string;
16
+ tidy: string;
17
+ settings: string;
18
+ closePanel: string;
19
+ design: string;
20
+ preview: string;
21
+ /** The trigger node's heading. */
22
+ start: string;
23
+ /** What the preview's stand-in agent answers; `{prompt}` is replaced. */
24
+ previewAnswer: string;
25
+ problems: Record<WorkflowGraphProblem['code'], string>;
26
+ }
27
+ export declare const DEFAULT_WORKFLOW_BUILDER_LABELS: WorkflowBuilderLabels;
28
+ export interface WorkflowBuilderProps extends Pick<StepComposeOptions, 'compose'> {
29
+ value: WorkflowBuilderValue;
30
+ onChange: (value: WorkflowBuilderValue) => void;
31
+ /** What agent steps can run (skills and other workflows); the preview composes from them. */
32
+ workflows?: WorkflowDefinition[];
33
+ /** Who can run it. */
34
+ agents?: AgentOption[];
35
+ /** The workspace events it can start on. */
36
+ eventKinds?: Array<{
37
+ value: string;
38
+ label: string;
39
+ }>;
40
+ /** Tasks it can wait on. */
41
+ tasks?: Array<{
42
+ value: string;
43
+ label: string;
44
+ }>;
45
+ renderIcon?: (key: string) => ReactNode;
46
+ /** The host's buttons (save, run). */
47
+ actions?: ReactNode;
48
+ labels?: Partial<WorkflowBuilderLabels>;
49
+ canvasLabels?: Partial<WorkflowCanvasLabels>;
50
+ inspectorLabels?: Partial<StepInspectorLabels>;
51
+ triggerLabels?: Partial<TriggerInspectorLabels>;
52
+ testId?: string;
53
+ className?: string;
54
+ }
55
+ export declare function WorkflowBuilder({ value, onChange, workflows, agents, eventKinds, tasks, compose, renderIcon, actions, labels, canvasLabels, inspectorLabels, triggerLabels, testId, className, }: WorkflowBuilderProps): import("react").JSX.Element;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * A workflow as a graph on a canvas: its start, then each step a card, each "waits for" an edge.
3
+ * Build by clicking "+" on a card (the next step lands beside it), drag to arrange, draw from a
4
+ * card's right handle to another's left to make it wait, select and press Delete to remove.
5
+ * Read-only with live `phases` it shows a run's progress on the same graph.
6
+ */
7
+ import { type ReactNode } from 'react';
8
+ import { type WorkflowDefinition, type WorkflowStepPhase } from '../agents';
9
+ import { type WorkflowStepKind } from './edit';
10
+ export interface WorkflowCanvasLabels {
11
+ form: string;
12
+ upload: string;
13
+ agent: string;
14
+ review: string;
15
+ /** An agent step that runs on a branch and delivers its result to the thread. */
16
+ branch: string;
17
+ /** What each kind is for, in the "+" menu. */
18
+ kindHints: Record<WorkflowStepKind, string>;
19
+ addNext: string;
20
+ /** Summaries on the cards. */
21
+ runs: string;
22
+ instruction: string;
23
+ fields: string;
24
+ noFields: string;
25
+ approvedBy: string;
26
+ emptyTitle: string;
27
+ emptyHint: string;
28
+ }
29
+ export declare const DEFAULT_WORKFLOW_CANVAS_LABELS: WorkflowCanvasLabels;
30
+ export interface WorkflowCanvasProps {
31
+ workflow: WorkflowDefinition;
32
+ /** Edits (move, connect, disconnect, delete). Absent = read-only. */
33
+ onChange?: (workflow: WorkflowDefinition) => void;
34
+ selected?: string | null;
35
+ onSelect?: (stepId: string | null) => void;
36
+ /** Add a step after this one (`TRIGGER_NODE`: one that starts with the run). Absent = no "+". */
37
+ onAddAfter?: (stepId: string, kind: WorkflowStepKind) => void;
38
+ /** A run's progress, by step id: colours the nodes. */
39
+ phases?: Record<string, WorkflowStepPhase>;
40
+ /** Names the workflow an agent step runs (its card's summary). */
41
+ workflowTitle?: (id: string) => string | undefined;
42
+ /**
43
+ * The workflow's start, drawn as the first node (id `TRIGGER_NODE`): an edge from it into each
44
+ * step that starts with the run. Drawing one from it into a step makes that step start the run.
45
+ */
46
+ trigger?: {
47
+ title: string;
48
+ summary: string;
49
+ };
50
+ renderIcon?: (key: string) => ReactNode;
51
+ labels?: Partial<WorkflowCanvasLabels>;
52
+ className?: string;
53
+ /** Pixels on the right covered by a floating panel: the opening view keeps clear of them. */
54
+ reserveRight?: number;
55
+ testId?: string;
56
+ }
57
+ /** The id of the trigger node (selecting it selects the workflow's start). */
58
+ export declare const TRIGGER_NODE = "__trigger";
59
+ export declare const STEP_KIND_ICONS: {
60
+ readonly form: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
61
+ readonly upload: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
62
+ readonly agent: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
63
+ readonly review: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
64
+ };
65
+ export declare function WorkflowCanvas({ workflow, onChange, selected, onSelect, onAddAfter, phases, workflowTitle, trigger, renderIcon, labels, className, reserveRight, testId, }: WorkflowCanvasProps): import("react").JSX.Element;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Editing a stepped workflow as a graph: the designer's operations, pure so they are tested on
3
+ * their own. Every result keeps the steps in dependency order with every edge written out
4
+ * (`after`), so a reordering never changes what a step waits for.
5
+ */
6
+ import { type WorkflowDefinition, type WorkflowStep } from '../agents';
7
+ type Steps = Extract<WorkflowDefinition['run'], {
8
+ kind: 'steps';
9
+ }>;
10
+ export type WorkflowLayout = NonNullable<Steps['layout']>;
11
+ export type WorkflowStepKind = WorkflowStep['kind'];
12
+ /** A new, empty stepped workflow. */
13
+ export declare function newSteppedWorkflow(id: string, title: string): WorkflowDefinition;
14
+ /** A step id from a title: lowercase words joined by hyphens, unique within the workflow. */
15
+ export declare function stepIdFor(steps: WorkflowStep[], title: string): string;
16
+ /**
17
+ * Add a step. With `after`, it waits for that step (the usual "add the next step"); otherwise it
18
+ * starts with the run. Resolves with the workflow and the new step's id.
19
+ */
20
+ export declare function addStep(workflow: WorkflowDefinition, kind: WorkflowStepKind, options?: {
21
+ after?: string;
22
+ title?: string;
23
+ position?: {
24
+ x: number;
25
+ y: number;
26
+ };
27
+ }): {
28
+ workflow: WorkflowDefinition;
29
+ id: string;
30
+ };
31
+ /** Remove a step; what waited for it waits for what it waited for instead (the chain holds). */
32
+ export declare function removeStep(workflow: WorkflowDefinition, id: string): WorkflowDefinition;
33
+ /** `to` now waits for `from`. Refused (unchanged) when that would make a cycle. */
34
+ export declare function connectSteps(workflow: WorkflowDefinition, from: string, to: string): WorkflowDefinition;
35
+ export declare const wouldCycle: (workflow: WorkflowDefinition, from: string, to: string) => boolean;
36
+ /** `to` no longer waits for `from`. */
37
+ export declare function disconnectSteps(workflow: WorkflowDefinition, from: string, to: string): WorkflowDefinition;
38
+ /** Change a step's settings (its id and kind stay). */
39
+ export declare function updateStep(workflow: WorkflowDefinition, id: string, patch: Partial<WorkflowStep>): WorkflowDefinition;
40
+ /**
41
+ * A run input renamed (a form field's code following its label): every step that reads it is
42
+ * updated, so the workflow keeps working.
43
+ */
44
+ export declare function renameInput(workflow: WorkflowDefinition, from: string, to: string): WorkflowDefinition;
45
+ /** Where a step sits on the canvas. */
46
+ export declare function moveStep(workflow: WorkflowDefinition, id: string, position: {
47
+ x: number;
48
+ y: number;
49
+ }): WorkflowDefinition;
50
+ /** Positions by depth: columns left to right, parallel steps stacked. */
51
+ export declare function autoLayout(steps: WorkflowStep[]): WorkflowLayout;
52
+ /** The workflow's layout, with any unplaced step placed by depth. */
53
+ export declare function layoutWithDefaults(workflow: WorkflowDefinition): WorkflowLayout;
54
+ export {};