Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions src/uipath/dev/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""UiPath Dev Terminal Application."""
"""UiPath Developer Console Application."""

import asyncio
import json
Expand All @@ -24,22 +24,21 @@
)
from uipath.runtime.errors import UiPathErrorContract, UiPathRuntimeError

from uipath.dev.components.details import RunDetailsPanel
from uipath.dev.components.history import RunHistoryPanel
from uipath.dev.components.new import NewRunPanel
from uipath.dev.models.execution import ExecutionRun
from uipath.dev.models.messages import LogMessage, TraceMessage

from ._utils._exporter import RunContextExporter
from ._utils._logger import RunContextLogHandler, patch_textual_stderr
from uipath.dev.infrastructure import (
RunContextExporter,
RunContextLogHandler,
patch_textual_stderr,
)
from uipath.dev.models import ExecutionRun, LogMessage, TraceMessage
from uipath.dev.ui.panels import NewRunPanel, RunDetailsPanel, RunHistoryPanel


class UiPathDeveloperConsole(App[Any]):
"""UiPath developer console interface."""

TITLE = "UiPath Developer Console"
SUB_TITLE = "Interactive terminal application for building, testing, and debugging UiPath Python runtimes, agents, and automation scripts."
CSS_PATH = Path(__file__).parent / "_styles" / "terminal.tcss"
CSS_PATH = Path(__file__).parent / "ui" / "styles" / "terminal.tcss"

BINDINGS = [
Binding("q", "quit", "Quit"),
Expand Down
13 changes: 13 additions & 0 deletions src/uipath/dev/infrastructure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Infrastructure components for UiPath Developer CLI UI integration."""

from uipath.dev.infrastructure.logging_handlers import (
RunContextLogHandler,
patch_textual_stderr,
)
from uipath.dev.infrastructure.tracing_exporter import RunContextExporter

__all__ = [
"RunContextExporter",
"RunContextLogHandler",
"patch_textual_stderr",
]
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Custom logging handlers for CLI UI integration."""

from __future__ import annotations

import logging
Expand All @@ -20,6 +22,7 @@ def __init__(
run_id: str,
callback: Callable[[LogMessage], None],
):
"""Initialize RunContextLogHandler with run and callback."""
super().__init__(run_id)
self.run_id = run_id
self.callback = callback
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Custom OpenTelemetry trace exporter for CLI UI integration."""

import logging
from datetime import datetime
from typing import Callable, Sequence
Expand All @@ -18,6 +20,7 @@ def __init__(
on_trace: Callable[[TraceMessage], None],
on_log: Callable[[LogMessage], None],
):
"""Initialize RunContextExporter with callbacks for trace and log messages."""
self.on_trace = on_trace
self.on_log = on_log
self.logger = logging.getLogger(__name__)
Expand Down
10 changes: 10 additions & 0 deletions src/uipath/dev/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""UiPath Dev Console models module."""

from uipath.dev.models.execution import ExecutionRun
from uipath.dev.models.messages import LogMessage, TraceMessage

__all__ = [
"ExecutionRun",
"LogMessage",
"TraceMessage",
]
11 changes: 11 additions & 0 deletions src/uipath/dev/ui/panels/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""UiPath Dev Console panels module initialization."""

from uipath.dev.ui.panels.new_run_panel import NewRunPanel
from uipath.dev.ui.panels.run_details_panel import RunDetailsPanel
from uipath.dev.ui.panels.run_history_panel import RunHistoryPanel

__all__ = [
"NewRunPanel",
"RunDetailsPanel",
"RunHistoryPanel",
]
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from textual.reactive import reactive
from textual.widgets import Button, Select, TabbedContent, TabPane, TextArea

from uipath.dev.components.json_input import JsonInput
from uipath.dev.ui.widgets.json_input import JsonInput


def mock_json_from_schema(schema: dict[str, Any]) -> dict[str, Any]:
Expand Down