@arbidocs/blocks 0.4.82 → 0.4.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/index.cjs +279 -279
- package/dist/agents/index.js +4 -4
- package/dist/agents/workflows/StepBarFrame.d.ts +12 -4
- package/dist/{chunk-5XVWGJ2H.cjs → chunk-B3WCKBJ7.cjs} +3 -3
- package/dist/{chunk-5XVWGJ2H.cjs.map → chunk-B3WCKBJ7.cjs.map} +1 -1
- package/dist/{chunk-THCFZKTM.js → chunk-CONIA2ZA.js} +8 -8
- package/dist/chunk-CONIA2ZA.js.map +1 -0
- package/dist/{chunk-O35LRB3P.js → chunk-GJV2G4FC.js} +3 -3
- package/dist/{chunk-O35LRB3P.js.map → chunk-GJV2G4FC.js.map} +1 -1
- package/dist/{chunk-COP6GVKN.js → chunk-RSKSXEPW.js} +57 -19
- package/dist/chunk-RSKSXEPW.js.map +1 -0
- package/dist/{chunk-IRG5LPDP.js → chunk-RX35SMPR.js} +6 -6
- package/dist/{chunk-IRG5LPDP.js.map → chunk-RX35SMPR.js.map} +1 -1
- package/dist/{chunk-BX7JWZWE.cjs → chunk-RYYYHPFU.cjs} +8 -8
- package/dist/chunk-RYYYHPFU.cjs.map +1 -0
- package/dist/{chunk-VWK24TEY.cjs → chunk-XA5S4776.cjs} +45 -45
- package/dist/chunk-XA5S4776.cjs.map +1 -0
- package/dist/{chunk-LRRJ2HBW.cjs → chunk-ZQYE7J3J.cjs} +54 -14
- package/dist/chunk-ZQYE7J3J.cjs.map +1 -0
- package/dist/connect/index.cjs +44 -44
- package/dist/connect/index.js +4 -4
- package/dist/connection/ConnectedWorkflowBuilder.d.ts +9 -2
- package/dist/facts/index.cjs +1 -1
- package/dist/facts/index.js +1 -1
- package/dist/files/index.cjs +22 -3
- package/dist/files/index.cjs.map +1 -1
- package/dist/files/index.js +22 -4
- package/dist/files/index.js.map +1 -1
- package/dist/files/views/TagFormParts.d.ts +8 -0
- package/dist/files/views/index.d.ts +1 -1
- package/dist/home/index.cjs +1 -1
- package/dist/home/index.js +1 -1
- package/dist/index.cjs +891 -609
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +283 -12
- package/dist/index.js.map +1 -1
- package/dist/settings/index.cjs +35 -35
- package/dist/settings/index.js +3 -3
- package/dist/shell/index.cjs +1 -1
- package/dist/shell/index.js +1 -1
- package/dist/studio/index.cjs +1 -1
- package/dist/studio/index.js +1 -1
- package/dist/tags/TagDetail.d.ts +38 -0
- package/dist/tags/TagMatrix.d.ts +27 -8
- package/dist/tags/TagsNav.d.ts +44 -0
- package/dist/tags/index.d.ts +8 -3
- package/dist/tags/tagMatrixDocx.d.ts +4 -1
- package/dist/tags/tagMatrixModel.d.ts +10 -6
- package/dist/workflow-canvas/index.cjs +82 -64
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/index.js +40 -22
- package/dist/workflow-canvas/index.js.map +1 -1
- package/dist/workspaces/index.cjs +1 -1
- package/dist/workspaces/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-BX7JWZWE.cjs.map +0 -1
- package/dist/chunk-COP6GVKN.js.map +0 -1
- package/dist/chunk-LRRJ2HBW.cjs.map +0 -1
- package/dist/chunk-THCFZKTM.js.map +0 -1
- package/dist/chunk-VWK24TEY.cjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useConnection } from '../chunk-OYMWV45N.js';
|
|
3
|
-
import { workflowWhen, isoToLocalInput, describeRRule, RecurrenceBuilder, AgentSelect, useWorkflowPreview, localInputToIso } from '../chunk-
|
|
3
|
+
import { workflowWhen, isoToLocalInput, describeRRule, RecurrenceBuilder, AgentSelect, useWorkflowPreview, localInputToIso } from '../chunk-RX35SMPR.js';
|
|
4
4
|
import '../chunk-CKB64Z4R.js';
|
|
5
5
|
import '../chunk-P6GHJSLR.js';
|
|
6
|
-
import { workflowSteps, dependsOn, stepLevels, isIncompleteSignal, runFields, upstreamSteps, stepDependencies, canAssign, fromPlanSteps, layoutFromPlanSteps, validateWorkflowGraph, stepConfigProblems, WorkflowRunner, skillToWorkflow, assigneeName, orderSteps, toPlanSteps } from '../chunk-
|
|
6
|
+
import { workflowSteps, dependsOn, stepLevels, isIncompleteSignal, runFields, upstreamSteps, stepDependencies, canAssign, fromPlanSteps, layoutFromPlanSteps, validateWorkflowGraph, stepConfigProblems, WorkflowRunner, skillToWorkflow, assigneeName, orderSteps, toPlanSteps } from '../chunk-CONIA2ZA.js';
|
|
7
7
|
import '../chunk-4WWM3GQ5.js';
|
|
8
8
|
import '../chunk-RFXJYIDV.js';
|
|
9
9
|
import '../chunk-DPLRHEJZ.js';
|
|
@@ -14,19 +14,19 @@ import '../chunk-ZPLG7QYF.js';
|
|
|
14
14
|
import '../chunk-DDF5GPIJ.js';
|
|
15
15
|
import '../chunk-XD2M6LIG.js';
|
|
16
16
|
import '../chunk-S7PSMMRG.js';
|
|
17
|
-
import '../chunk-76JDDMSP.js';
|
|
18
|
-
import '../chunk-TX2ZICS7.js';
|
|
19
17
|
import '../chunk-HOXKR26S.js';
|
|
20
18
|
import '../chunk-AA3PT6KR.js';
|
|
21
19
|
import '../chunk-SLSBJRWW.js';
|
|
22
20
|
import '../chunk-NPLYHR2E.js';
|
|
21
|
+
import '../chunk-76JDDMSP.js';
|
|
23
22
|
import '../chunk-OXF2IFXG.js';
|
|
23
|
+
import '../chunk-TX2ZICS7.js';
|
|
24
24
|
import '../chunk-7F6CBP3Z.js';
|
|
25
25
|
import '../chunk-VUNV25KB.js';
|
|
26
26
|
import { useMemo, useState, useEffect, useCallback, useRef } from 'react';
|
|
27
27
|
import { useWorkspaceUsers, useTags, useDocuments, useWorkflows, useSkills, useAgents, useConversations, useCreateWorkflow, useUpdateWorkflow, useRunWorkflow } from '@arbidocs/react';
|
|
28
28
|
import { Label, Input, cn, Button, Textarea, Checkbox, Popover, PopoverTrigger, PopoverContent } from '@arbidocs/react/ui';
|
|
29
|
-
import { X, Plus, Trash2, Maximize, Table2, Mail, PenLine, ClipboardCheck, Bot, Upload, FileInput, PencilRuler, Eye, LayoutGrid, Settings2,
|
|
29
|
+
import { X, Plus, Trash2, Maximize, Table2, Mail, PenLine, ClipboardCheck, Bot, Upload, FileInput, PencilRuler, Eye, LayoutGrid, Settings2, Loader2, Play, Save, Zap, GitBranch, FilePenLine, UserRound, Hourglass, Check, AlertTriangle, MinusCircle } from 'lucide-react';
|
|
30
30
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
31
31
|
import { MarkerType, applyNodeChanges, ReactFlow, Background, BackgroundVariant, Controls, ControlButton, MiniMap, Handle, Position } from '@xyflow/react';
|
|
32
32
|
|
|
@@ -2604,7 +2604,9 @@ var DEFAULT_CONNECTED_WORKFLOW_BUILDER_LABELS = {
|
|
|
2604
2604
|
saving: "Saving\u2026",
|
|
2605
2605
|
runNow: "Run now",
|
|
2606
2606
|
saved: "Saved.",
|
|
2607
|
-
needTrigger: "Finish setting when it starts."
|
|
2607
|
+
needTrigger: "Finish setting when it starts.",
|
|
2608
|
+
running: "Starting\u2026",
|
|
2609
|
+
failed: "Something went wrong."
|
|
2608
2610
|
};
|
|
2609
2611
|
var DEFAULT_WORKFLOW_EVENT_KINDS = [
|
|
2610
2612
|
{ value: "conversation_done", label: "A task is marked done" },
|
|
@@ -2654,6 +2656,8 @@ function ConnectedWorkflowBuilder({
|
|
|
2654
2656
|
const [id, setId] = useState(workflowId);
|
|
2655
2657
|
const [value, setValue] = useState(initial);
|
|
2656
2658
|
const [message, setMessage] = useState(null);
|
|
2659
|
+
const [error, setError] = useState(null);
|
|
2660
|
+
const [pending, setPending] = useState();
|
|
2657
2661
|
const record = saved.data?.find((w) => w.external_id === id);
|
|
2658
2662
|
const [loaded, setLoaded] = useState(void 0);
|
|
2659
2663
|
useEffect(() => {
|
|
@@ -2683,17 +2687,36 @@ function ConnectedWorkflowBuilder({
|
|
|
2683
2687
|
const tasks = (conversations.data ?? []).filter((c) => c.status && c.status !== "done").map((c) => ({ value: c.external_id, label: c.title || c.external_id }));
|
|
2684
2688
|
const options = { resolveWorkflow: (wid) => workflows.find((w) => w.id === wid), compose };
|
|
2685
2689
|
const problem = triggerProblem(value.trigger) ?? (validateWorkflowGraph(workflowSteps(value.workflow)).length || stepConfigProblems(workflowSteps(value.workflow)).length ? "graph" : null);
|
|
2686
|
-
const busy = create.isPending || update.isPending || run.isPending;
|
|
2690
|
+
const busy = !!pending || create.isPending || update.isPending || run.isPending;
|
|
2687
2691
|
const save = async () => {
|
|
2688
2692
|
if (!workspaceId) return void 0;
|
|
2689
|
-
setMessage(null);
|
|
2690
2693
|
const result = id ? await update.mutateAsync({ workflowId: id, patch: builderToWorkflowUpdate(value, options) }) : await create.mutateAsync(builderToWorkflowRequest(value, workspaceId, options));
|
|
2691
2694
|
setId(result.external_id);
|
|
2692
2695
|
setLoaded(result.external_id);
|
|
2693
|
-
|
|
2694
|
-
onSaved?.(result.external_id);
|
|
2696
|
+
await onSaved?.(result.external_id, value);
|
|
2695
2697
|
return result.external_id;
|
|
2696
2698
|
};
|
|
2699
|
+
const attempt = async (andRun) => {
|
|
2700
|
+
setMessage(null);
|
|
2701
|
+
setError(null);
|
|
2702
|
+
setPending({ action: andRun ? "run" : "save", phase: "saving" });
|
|
2703
|
+
try {
|
|
2704
|
+
const savedId = await save();
|
|
2705
|
+
if (!savedId) return;
|
|
2706
|
+
if (!andRun) {
|
|
2707
|
+
setMessage(l.saved);
|
|
2708
|
+
return;
|
|
2709
|
+
}
|
|
2710
|
+
setPending({ action: "run", phase: "running" });
|
|
2711
|
+
const started = await run.mutateAsync(savedId);
|
|
2712
|
+
if (started.error) throw new Error(started.error);
|
|
2713
|
+
onRun?.(started.conversation_ext_id ?? void 0);
|
|
2714
|
+
} catch (e) {
|
|
2715
|
+
setError(e instanceof Error && e.message ? e.message : l.failed);
|
|
2716
|
+
} finally {
|
|
2717
|
+
setPending(void 0);
|
|
2718
|
+
}
|
|
2719
|
+
};
|
|
2697
2720
|
return /* @__PURE__ */ jsx(
|
|
2698
2721
|
WorkflowBuilder,
|
|
2699
2722
|
{
|
|
@@ -2713,6 +2736,7 @@ function ConnectedWorkflowBuilder({
|
|
|
2713
2736
|
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2714
2737
|
actions,
|
|
2715
2738
|
message && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: message }),
|
|
2739
|
+
error && /* @__PURE__ */ jsx("span", { role: "alert", className: "text-xs text-destructive", "data-testid": `${testId}-error`, children: error }),
|
|
2716
2740
|
problem && problem !== "graph" && /* @__PURE__ */ jsx("span", { className: "text-xs text-destructive", children: l.needTrigger }),
|
|
2717
2741
|
/* @__PURE__ */ jsxs(
|
|
2718
2742
|
Button,
|
|
@@ -2720,17 +2744,11 @@ function ConnectedWorkflowBuilder({
|
|
|
2720
2744
|
variant: "outline",
|
|
2721
2745
|
size: "sm",
|
|
2722
2746
|
disabled: !!problem || busy || !workspaceId,
|
|
2723
|
-
onClick:
|
|
2724
|
-
const saved2 = await save();
|
|
2725
|
-
if (!saved2) return;
|
|
2726
|
-
const started = await run.mutateAsync(saved2);
|
|
2727
|
-
onRun?.(started.conversation_ext_id ?? void 0);
|
|
2728
|
-
},
|
|
2747
|
+
onClick: () => void attempt(true),
|
|
2729
2748
|
"data-testid": `${testId}-run`,
|
|
2730
2749
|
children: [
|
|
2731
|
-
/* @__PURE__ */ jsx(Play, { className: "size-4" }),
|
|
2732
|
-
" "
|
|
2733
|
-
l.runNow
|
|
2750
|
+
pending?.action === "run" ? /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsx(Play, { className: "size-4" }),
|
|
2751
|
+
pending?.action === "run" ? pending.phase === "saving" ? l.saving : l.running : l.runNow
|
|
2734
2752
|
]
|
|
2735
2753
|
}
|
|
2736
2754
|
),
|
|
@@ -2739,11 +2757,11 @@ function ConnectedWorkflowBuilder({
|
|
|
2739
2757
|
{
|
|
2740
2758
|
size: "sm",
|
|
2741
2759
|
disabled: !!problem || busy || !workspaceId,
|
|
2742
|
-
onClick: () => void
|
|
2760
|
+
onClick: () => void attempt(false),
|
|
2743
2761
|
"data-testid": `${testId}-save`,
|
|
2744
2762
|
children: [
|
|
2745
|
-
|
|
2746
|
-
|
|
2763
|
+
pending?.action === "save" ? /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsx(Save, { className: "size-4" }),
|
|
2764
|
+
pending?.action === "save" ? l.saving : l.save
|
|
2747
2765
|
]
|
|
2748
2766
|
}
|
|
2749
2767
|
)
|