WIP - ai process builder codex attempt
This commit is contained in:
12
frontend/ai-processes-editor/index.html
Normal file
12
frontend/ai-processes-editor/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>AI Process Builder</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
23
frontend/ai-processes-editor/package.json
Normal file
23
frontend/ai-processes-editor/package.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "ai-processes-editor",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --port 5174",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview --port 5174"
|
||||
},
|
||||
"dependencies": {
|
||||
"@xyflow/react": "^12.0.4",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.3.4",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@vitejs/plugin-react": "^4.3.1",
|
||||
"typescript": "^5.6.2",
|
||||
"vite": "^5.4.2"
|
||||
}
|
||||
}
|
||||
43
frontend/ai-processes-editor/src/App.tsx
Normal file
43
frontend/ai-processes-editor/src/App.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import { Background, Controls, MiniMap, ReactFlow, useEdgesState, useNodesState } from '@xyflow/react'
|
||||
import '@xyflow/react/dist/style.css'
|
||||
import './styles.css'
|
||||
|
||||
const initialNodes = [
|
||||
{ id: 'start', data: { label: 'Start' }, position: { x: 0, y: 0 } },
|
||||
{ id: 'llm', data: { label: 'LLM Decision' }, position: { x: 220, y: 0 } },
|
||||
{ id: 'tool', data: { label: 'Tool Node' }, position: { x: 440, y: 0 } },
|
||||
{ id: 'end', data: { label: 'End' }, position: { x: 660, y: 0 } },
|
||||
]
|
||||
|
||||
const initialEdges = [
|
||||
{ id: 'e1-2', source: 'start', target: 'llm' },
|
||||
{ id: 'e2-3', source: 'llm', target: 'tool' },
|
||||
{ id: 'e3-4', source: 'tool', target: 'end' },
|
||||
]
|
||||
|
||||
export const App = () => {
|
||||
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes)
|
||||
const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges)
|
||||
|
||||
return (
|
||||
<div className="editor-shell">
|
||||
<header className="editor-header">
|
||||
<h1>AI Process Builder</h1>
|
||||
<p>Design tenant workflows with deterministic execution.</p>
|
||||
</header>
|
||||
<div className="editor-canvas">
|
||||
<ReactFlow
|
||||
nodes={nodes}
|
||||
edges={edges}
|
||||
onNodesChange={onNodesChange}
|
||||
onEdgesChange={onEdgesChange}
|
||||
fitView
|
||||
>
|
||||
<MiniMap />
|
||||
<Controls />
|
||||
<Background />
|
||||
</ReactFlow>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
7
frontend/ai-processes-editor/src/main.tsx
Normal file
7
frontend/ai-processes-editor/src/main.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { App } from './App'
|
||||
|
||||
const root = document.getElementById('root')
|
||||
if (root) {
|
||||
createRoot(root).render(<App />)
|
||||
}
|
||||
33
frontend/ai-processes-editor/src/styles.css
Normal file
33
frontend/ai-processes-editor/src/styles.css
Normal file
@@ -0,0 +1,33 @@
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.editor-shell {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.editor-header {
|
||||
padding: 16px 20px;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.editor-header h1 {
|
||||
margin: 0 0 4px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.editor-header p {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.editor-canvas {
|
||||
flex: 1;
|
||||
background: #f8fafc;
|
||||
}
|
||||
9
frontend/ai-processes-editor/vite.config.ts
Normal file
9
frontend/ai-processes-editor/vite.config.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
port: 5174,
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user