v1.0 - Version stable: multi-PC, détection UI-DETR-1, 3 modes exécution
- Frontend v4 accessible sur réseau local (192.168.1.40) - Ports ouverts: 3002 (frontend), 5001 (backend), 5004 (dashboard) - Ollama GPU fonctionnel - Self-healing interactif - Dashboard confiance Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
"""Initial schema with workflow metadata
|
||||
|
||||
Revision ID: 001_initial
|
||||
Revises:
|
||||
Create Date: 2026-01-23
|
||||
|
||||
Tables:
|
||||
- workflows: Workflow definitions with metadata (tags, trigger examples)
|
||||
- steps: Workflow steps with action types and parameters
|
||||
- visual_anchors: Visual anchors for UI element detection
|
||||
- executions: Workflow execution history
|
||||
- execution_steps: Individual step execution results
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '001_initial'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# Workflows table
|
||||
op.create_table('workflows',
|
||||
sa.Column('id', sa.String(64), primary_key=True),
|
||||
sa.Column('name', sa.String(255), nullable=False),
|
||||
sa.Column('description', sa.Text(), nullable=True),
|
||||
sa.Column('tags_json', sa.Text(), nullable=True),
|
||||
sa.Column('trigger_examples_json', sa.Text(), nullable=True),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('is_active', sa.Boolean(), default=True),
|
||||
)
|
||||
|
||||
# Visual Anchors table
|
||||
op.create_table('visual_anchors',
|
||||
sa.Column('id', sa.String(64), primary_key=True),
|
||||
sa.Column('image_path', sa.String(512), nullable=True),
|
||||
sa.Column('thumbnail_path', sa.String(512), nullable=True),
|
||||
sa.Column('bbox_x', sa.Float(), nullable=True),
|
||||
sa.Column('bbox_y', sa.Float(), nullable=True),
|
||||
sa.Column('bbox_width', sa.Float(), nullable=True),
|
||||
sa.Column('bbox_height', sa.Float(), nullable=True),
|
||||
sa.Column('screen_width', sa.Integer(), nullable=True),
|
||||
sa.Column('screen_height', sa.Integer(), nullable=True),
|
||||
sa.Column('description', sa.Text(), nullable=True),
|
||||
sa.Column('confidence_threshold', sa.Float(), default=0.8),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('capture_method', sa.String(64), default='screen_capture'),
|
||||
)
|
||||
|
||||
# Steps table
|
||||
op.create_table('steps',
|
||||
sa.Column('id', sa.String(64), primary_key=True),
|
||||
sa.Column('workflow_id', sa.String(64), sa.ForeignKey('workflows.id'), nullable=False),
|
||||
sa.Column('action_type', sa.String(64), nullable=False),
|
||||
sa.Column('order', sa.Integer(), nullable=False, default=0),
|
||||
sa.Column('position_x', sa.Float(), default=0),
|
||||
sa.Column('position_y', sa.Float(), default=0),
|
||||
sa.Column('parameters_json', sa.Text(), default='{}'),
|
||||
sa.Column('anchor_id', sa.String(64), sa.ForeignKey('visual_anchors.id'), nullable=True),
|
||||
sa.Column('label', sa.String(255), nullable=True),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
||||
)
|
||||
|
||||
# Executions table
|
||||
op.create_table('executions',
|
||||
sa.Column('id', sa.String(64), primary_key=True),
|
||||
sa.Column('workflow_id', sa.String(64), sa.ForeignKey('workflows.id'), nullable=False),
|
||||
sa.Column('status', sa.String(32), default='pending'),
|
||||
sa.Column('started_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('ended_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('current_step_index', sa.Integer(), default=0),
|
||||
sa.Column('total_steps', sa.Integer(), default=0),
|
||||
sa.Column('completed_steps', sa.Integer(), default=0),
|
||||
sa.Column('failed_steps', sa.Integer(), default=0),
|
||||
sa.Column('error_message', sa.Text(), nullable=True),
|
||||
)
|
||||
|
||||
# Execution Steps table
|
||||
op.create_table('execution_steps',
|
||||
sa.Column('id', sa.Integer(), primary_key=True, autoincrement=True),
|
||||
sa.Column('execution_id', sa.String(64), sa.ForeignKey('executions.id'), nullable=False),
|
||||
sa.Column('step_id', sa.String(64), nullable=False),
|
||||
sa.Column('status', sa.String(32), default='pending'),
|
||||
sa.Column('started_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('ended_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('duration_ms', sa.Integer(), nullable=True),
|
||||
sa.Column('error_message', sa.Text(), nullable=True),
|
||||
sa.Column('evidence_path', sa.String(512), nullable=True),
|
||||
sa.Column('output_json', sa.Text(), default='{}'),
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('execution_steps')
|
||||
op.drop_table('executions')
|
||||
op.drop_table('steps')
|
||||
op.drop_table('visual_anchors')
|
||||
op.drop_table('workflows')
|
||||
Reference in New Issue
Block a user