WIP - ai process builder codex attempt

This commit is contained in:
Francisco Gaona
2026-01-17 20:16:04 +01:00
parent 20fc90a3fb
commit ded413b99b
34 changed files with 2199 additions and 13 deletions

View 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>

View 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"
}
}

View 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>
)
}

View 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 />)
}

View 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;
}

View File

@@ -0,0 +1,9 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
server: {
port: 5174,
},
})