feat: brain-engine + brain-ui + docs — template full stack standalone

- brain-engine: server, embed, search, RAG, MCP, start.sh (standalone)
- brain-ui: source React complète, build.sh, DocsView avec tier colors
- docs: 14 pages guides humains (getting-started, architecture, sessions, workflows, agents, vues tier)
- brain-compose.yml v0.9.0: tier featured ajouté, sessions/agents par tier, coach_level, API key schema
- DISTRIBUTION_CHECKLIST v1.2: brain-engine + brain-ui + docs dans la checklist
This commit is contained in:
2026-03-20 20:25:40 +01:00
parent c249d417f5
commit 8244a07881
93 changed files with 12088 additions and 34 deletions

View File

@@ -0,0 +1,33 @@
import { useMemo } from 'react'
import { useBrainStore } from '../store/brain.store'
import type { WorkspaceWorkflow } from '../types'
const WORKFLOW_COLORS = ['#6366f1', '#f59e0b', '#22c55e', '#ef4444', '#8b5cf6', '#06b6d4']
function computeLayout(workflows: ReturnType<typeof useBrainStore.getState>['workflows']): WorkspaceWorkflow[] {
return workflows.map((wf, wfIdx) => {
const baseX = (wfIdx - workflows.length / 2) * 4
const color = WORKFLOW_COLORS[wfIdx % WORKFLOW_COLORS.length]
const steps = (wf.steps ?? []).map((step, stepIdx) => {
const z = step.status === 'done' ? -stepIdx * 0.5 : stepIdx === 0 ? 1 : 0
return {
id: step.id,
label: step.label,
status: step.status as WorkspaceWorkflow['steps'][number]['status'],
isGate: step.isGate ?? false,
x: baseX + Math.sin(stepIdx * 0.8) * 0.5,
y: (workflows.length / 2 - stepIdx) * 1.5,
z,
}
})
return { id: wf.id, name: wf.name, steps, teamId: undefined, color }
})
}
export function useWorkspaceData() {
const workflows = useBrainStore((s) => s.workflows)
const workspaceWorkflows = useMemo(() => computeLayout(workflows), [workflows])
return { workflows: workspaceWorkflows }
}