@llamaindex/workflow-debugger 0.2.0 → 0.2.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.
- package/dist/debugger.v0.2.1.css +10 -0
- package/dist/debugger.v0.2.1.js +633 -0
- package/package.json +7 -1
- package/CHANGELOG.md +0 -205
- package/eslint.config.js +0 -26
- package/index.html +0 -12
- package/postcss.config.js +0 -6
- package/src/App.tsx +0 -18
- package/src/components/code-block.tsx +0 -48
- package/src/components/error-boundary.tsx +0 -85
- package/src/components/json-schema-editor.tsx +0 -291
- package/src/components/run-details-panel.tsx +0 -290
- package/src/components/run-list-panel.tsx +0 -83
- package/src/components/send-event-dialog.tsx +0 -299
- package/src/components/workflow-config-panel.tsx +0 -247
- package/src/components/workflow-debugger.tsx +0 -342
- package/src/components/workflow-visualization.tsx +0 -720
- package/src/index.css +0 -86
- package/src/main.tsx +0 -24
- package/tailwind.config.js +0 -9
- package/tests/json-schema-editor.test.tsx +0 -62
- package/tests/test-setup.ts +0 -1
- package/tsconfig.build.json +0 -5
- package/tsconfig.json +0 -16
- package/ui_sample.png +0 -0
- package/vite.config.ts +0 -46
- package/vitest.config.ts +0 -16
package/src/index.css
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
@import "tailwindcss";
|
|
2
|
-
@import "@llamaindex/ui/styles.css";
|
|
3
|
-
|
|
4
|
-
:root {
|
|
5
|
-
font-synthesis: none;
|
|
6
|
-
text-rendering: optimizeLegibility;
|
|
7
|
-
-webkit-font-smoothing: antialiased;
|
|
8
|
-
-moz-osx-font-smoothing: grayscale;
|
|
9
|
-
|
|
10
|
-
/* Workflow edge colors for better visibility */
|
|
11
|
-
--wf-edge-stroke: #9ca3af;
|
|
12
|
-
--wf-edge-stroke-hover: #6b7280;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.dark {
|
|
16
|
-
--wf-edge-stroke: #6b7280;
|
|
17
|
-
--wf-edge-stroke-hover: #9ca3af;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/* Reset body to allow UI package to handle layout */
|
|
21
|
-
body {
|
|
22
|
-
margin: 0;
|
|
23
|
-
min-width: 320px;
|
|
24
|
-
min-height: 100vh;
|
|
25
|
-
overflow: hidden; /* Prevent scrolling on the body */
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/* Smooth transitions for theme changes */
|
|
29
|
-
* {
|
|
30
|
-
transition:
|
|
31
|
-
background-color 0.2s ease,
|
|
32
|
-
border-color 0.2s ease,
|
|
33
|
-
color 0.2s ease;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* Dev tools styling */
|
|
37
|
-
#root {
|
|
38
|
-
height: 100vh;
|
|
39
|
-
overflow: hidden;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/* Smooth sidebar transitions */
|
|
43
|
-
.sidebar-transition {
|
|
44
|
-
transition:
|
|
45
|
-
width 0.2s ease-in-out,
|
|
46
|
-
margin 0.2s ease-in-out;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/* Vertical text for collapsed panels */
|
|
50
|
-
.writing-mode-vertical {
|
|
51
|
-
writing-mode: vertical-rl;
|
|
52
|
-
text-orientation: mixed;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/* ReactFlow edge styling for better visibility */
|
|
56
|
-
.react-flow__edge-path {
|
|
57
|
-
stroke: var(--wf-edge-stroke) !important;
|
|
58
|
-
stroke-width: 2px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.react-flow__edge:hover .react-flow__edge-path {
|
|
62
|
-
stroke: var(--wf-edge-stroke-hover) !important;
|
|
63
|
-
stroke-width: 3px;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.react-flow__edge-textwrapper {
|
|
67
|
-
pointer-events: all;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/* ReactFlow arrow markers */
|
|
71
|
-
.react-flow__arrowhead {
|
|
72
|
-
fill: var(--wf-edge-stroke);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.react-flow__edge:hover .react-flow__arrowhead {
|
|
76
|
-
fill: var(--wf-edge-stroke-hover);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* Make sure edges are visible over background */
|
|
80
|
-
.react-flow__edges {
|
|
81
|
-
z-index: 1;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.react-flow__nodes {
|
|
85
|
-
z-index: 2;
|
|
86
|
-
}
|
package/src/main.tsx
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { StrictMode } from "react";
|
|
2
|
-
import { createRoot } from "react-dom/client";
|
|
3
|
-
import "./index.css";
|
|
4
|
-
import App from "./App";
|
|
5
|
-
|
|
6
|
-
// Apply dark mode based on system preference
|
|
7
|
-
function applySystemTheme() {
|
|
8
|
-
const isDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
9
|
-
document.documentElement.classList.toggle("dark", isDark);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// Apply theme immediately to prevent flash
|
|
13
|
-
applySystemTheme();
|
|
14
|
-
|
|
15
|
-
// Listen for system theme changes
|
|
16
|
-
window
|
|
17
|
-
.matchMedia("(prefers-color-scheme: dark)")
|
|
18
|
-
.addEventListener("change", applySystemTheme);
|
|
19
|
-
|
|
20
|
-
createRoot(document.getElementById("root")!).render(
|
|
21
|
-
<StrictMode>
|
|
22
|
-
<App />
|
|
23
|
-
</StrictMode>,
|
|
24
|
-
);
|
package/tailwind.config.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi } from "vitest";
|
|
2
|
-
import { render, screen, fireEvent } from "@testing-library/react";
|
|
3
|
-
import { JsonSchemaEditor } from "../src/components/json-schema-editor";
|
|
4
|
-
|
|
5
|
-
describe("JsonSchemaEditor (debugger)", () => {
|
|
6
|
-
const baseSchema = {
|
|
7
|
-
properties: {
|
|
8
|
-
title: { type: "string", title: "Title" },
|
|
9
|
-
count: { type: "number", title: "Count" },
|
|
10
|
-
enabled: { type: "boolean", title: "Enabled" },
|
|
11
|
-
tags: { type: "array", title: "Tags" },
|
|
12
|
-
},
|
|
13
|
-
required: ["title"] as string[],
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
it("updates primitive fields and validates arrays", () => {
|
|
17
|
-
const onChange = vi.fn();
|
|
18
|
-
const onErrors = vi.fn();
|
|
19
|
-
render(
|
|
20
|
-
<JsonSchemaEditor
|
|
21
|
-
schema={baseSchema}
|
|
22
|
-
values={{}}
|
|
23
|
-
onChange={onChange}
|
|
24
|
-
onErrorsChange={onErrors}
|
|
25
|
-
/>,
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
// string
|
|
29
|
-
fireEvent.change(screen.getByLabelText(/Title/i), {
|
|
30
|
-
target: { value: "x" },
|
|
31
|
-
});
|
|
32
|
-
expect(onChange).toHaveBeenCalledWith(
|
|
33
|
-
expect.objectContaining({ title: "x" }),
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
// number
|
|
37
|
-
fireEvent.change(screen.getByLabelText(/Count/i), {
|
|
38
|
-
target: { value: "1" },
|
|
39
|
-
});
|
|
40
|
-
expect(onChange).toHaveBeenCalledWith(
|
|
41
|
-
expect.objectContaining({ count: 1 }),
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
// boolean
|
|
45
|
-
fireEvent.click(screen.getByRole("combobox"));
|
|
46
|
-
fireEvent.click(screen.getByText("True"));
|
|
47
|
-
expect(onChange).toHaveBeenCalledWith(
|
|
48
|
-
expect.objectContaining({ enabled: true }),
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
// array invalid then valid
|
|
52
|
-
const tags = screen.getByLabelText(/Tags \(JSON\)/i);
|
|
53
|
-
fireEvent.change(tags, { target: { value: "[" } });
|
|
54
|
-
expect(onErrors).toHaveBeenCalledWith(
|
|
55
|
-
expect.objectContaining({ tags: "Invalid JSON" }),
|
|
56
|
-
);
|
|
57
|
-
fireEvent.change(tags, { target: { value: '["a"]' } });
|
|
58
|
-
expect(onErrors).toHaveBeenLastCalledWith(
|
|
59
|
-
expect.objectContaining({ tags: null }),
|
|
60
|
-
);
|
|
61
|
-
});
|
|
62
|
-
});
|
package/tests/test-setup.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "@testing-library/jest-dom";
|
package/tsconfig.build.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
5
|
-
"noEmit": true,
|
|
6
|
-
"types": ["vite/client", "node"],
|
|
7
|
-
"baseUrl": ".",
|
|
8
|
-
"paths": {
|
|
9
|
-
"@/*": ["../ui/*"],
|
|
10
|
-
"@llamaindex/ui": ["../ui/src"],
|
|
11
|
-
"@llamaindex/workflows-client": ["../workflows-client/src"],
|
|
12
|
-
"@shared/*": ["../../shared/*"]
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"include": ["src"]
|
|
16
|
-
}
|
package/ui_sample.png
DELETED
|
Binary file
|
package/vite.config.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "vite";
|
|
2
|
-
import react from "@vitejs/plugin-react-swc";
|
|
3
|
-
import { createRequire } from "module";
|
|
4
|
-
import path from "path";
|
|
5
|
-
|
|
6
|
-
const require = createRequire(import.meta.url);
|
|
7
|
-
const { version } = require("./package.json");
|
|
8
|
-
|
|
9
|
-
// Build as a library that emits only JS/CSS assets with versioned filenames
|
|
10
|
-
export default defineConfig(({ mode }) => ({
|
|
11
|
-
plugins: [react()],
|
|
12
|
-
resolve: {
|
|
13
|
-
alias: {
|
|
14
|
-
"@shared": path.resolve(__dirname, "../shared"),
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
define: {
|
|
18
|
-
"process.env.NODE_ENV": JSON.stringify(
|
|
19
|
-
mode === "production" ? "production" : "development",
|
|
20
|
-
),
|
|
21
|
-
},
|
|
22
|
-
build: {
|
|
23
|
-
lib: {
|
|
24
|
-
entry: "src/main.tsx",
|
|
25
|
-
name: "WorkflowDebugger",
|
|
26
|
-
formats: ["iife"],
|
|
27
|
-
fileName: () => `debugger.v${version}.js`,
|
|
28
|
-
},
|
|
29
|
-
cssCodeSplit: false,
|
|
30
|
-
rollupOptions: {
|
|
31
|
-
external: [],
|
|
32
|
-
output: {
|
|
33
|
-
inlineDynamicImports: true,
|
|
34
|
-
assetFileNames: (assetInfo) => {
|
|
35
|
-
// Force CSS to use versioned filename as well
|
|
36
|
-
const name =
|
|
37
|
-
assetInfo.name || (assetInfo.names && assetInfo.names[0]) || "";
|
|
38
|
-
if (typeof name === "string" && name.endsWith(".css")) {
|
|
39
|
-
return `debugger.v${version}.css`;
|
|
40
|
-
}
|
|
41
|
-
return "assets/[name][extname]";
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
}));
|
package/vitest.config.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "vitest/config";
|
|
2
|
-
import react from "@vitejs/plugin-react-swc";
|
|
3
|
-
import path from "path";
|
|
4
|
-
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
plugins: [react()],
|
|
7
|
-
test: {
|
|
8
|
-
environment: "jsdom",
|
|
9
|
-
globals: true,
|
|
10
|
-
setupFiles: [path.resolve(__dirname, "tests/test-setup.ts")],
|
|
11
|
-
include: ["tests/**/*.{test,spec}.{ts,tsx}"],
|
|
12
|
-
},
|
|
13
|
-
define: {
|
|
14
|
-
"process.env": process.env,
|
|
15
|
-
},
|
|
16
|
-
});
|