feat(opencode-web-terminal): complete OpenCode web terminal implementation
- Update OpenCode compose template with web server on port 3000 - Add default_port=3000 and interfaces=[terminal, web] to OpenCode seed data - Remove hardcoded 8080 fallback in tunnel creation - Fail gracefully when tool type has no default_port configured - Update frontend ToolType API to include default_port, category, interfaces - Add port, category, and interfaces fields to tool type creation form - Display port and interfaces in tool type cards - Create migration 0012 to make default_port non-nullable - Set default_port values for existing built-in tool types - Quality gates: typecheck ✓, build ✓, Python syntax ✓
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
"""make default_port non-nullable and set values
|
||||
|
||||
Revision ID: 0012_tool_type_default_port_not_null
|
||||
Revises: 0011_tool_instance_tunnel_fields
|
||||
Create Date: 2026-05-20 15:00:00.000000
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "0012_tool_type_default_port_not_null"
|
||||
down_revision: Union[str, None] = "0011_tool_instance_tunnel_fields"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# Set default_port for existing built-in tool types
|
||||
op.execute("""
|
||||
UPDATE tool_types
|
||||
SET default_port = CASE
|
||||
WHEN name = 'code-server' THEN 8443
|
||||
WHEN name = 'jupyter-notebook' THEN 8888
|
||||
WHEN name = 'opencode' THEN 3000
|
||||
ELSE 8080
|
||||
END
|
||||
WHERE default_port IS NULL
|
||||
""")
|
||||
|
||||
# Make default_port non-nullable
|
||||
op.alter_column(
|
||||
"tool_types",
|
||||
"default_port",
|
||||
existing_type=sa.Integer(),
|
||||
nullable=False,
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.alter_column(
|
||||
"tool_types",
|
||||
"default_port",
|
||||
existing_type=sa.Integer(),
|
||||
nullable=True,
|
||||
)
|
||||
Reference in New Issue
Block a user