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
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[project]
name = "uipath-dev"
version = "0.0.4"
version = "0.0.5"
description = "UiPath Developer Console"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
dependencies = [
"uipath-runtime>=0.0.11, <0.1.0",
"uipath-runtime>=0.0.15, <0.1.0",
"textual>=6.6.0, <7.0.0",
"pyperclip>=1.11.0, <2.0.0",
]
Expand Down
4 changes: 3 additions & 1 deletion src/uipath/dev/_demo/mock_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
class MockRuntimeFactory:
"""Runtime factory compatible with UiPathRuntimeFactoryProtocol."""

async def new_runtime(self, entrypoint: str) -> UiPathRuntimeProtocol:
async def new_runtime(
self, entrypoint: str, runtime_id: str
) -> UiPathRuntimeProtocol:
"""Create a new runtime instance for the given entrypoint."""
if entrypoint == ENTRYPOINT_GREETING:
return MockGreetingRuntime(entrypoint=entrypoint)
Expand Down
7 changes: 6 additions & 1 deletion src/uipath/dev/services/run_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ async def execute(self, run: ExecutionRun) -> None:

This is the extracted version of the old `_execute_runtime` method.
"""
new_runtime: UiPathRuntimeProtocol | None = None
try:
execution_input: dict[str, Any] | None = {}
execution_options: UiPathExecuteOptions = UiPathExecuteOptions()
Expand All @@ -100,7 +101,8 @@ async def execute(self, run: ExecutionRun) -> None:
)

new_runtime = await self.runtime_factory.new_runtime(
entrypoint=run.entrypoint
entrypoint=run.entrypoint,
runtime_id=run.id,
)

runtime: UiPathRuntimeProtocol
Expand Down Expand Up @@ -177,6 +179,9 @@ async def execute(self, run: ExecutionRun) -> None:
title=str(e),
detail=traceback.format_exc(),
)
finally:
if new_runtime is not None:
await new_runtime.dispose()

self.runs[run.id] = run
self._emit_run_updated(run)
Expand Down
12 changes: 8 additions & 4 deletions src/uipath/dev/ui/panels/new_run_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from textual.containers import Container, Horizontal, Vertical
from textual.reactive import reactive
from textual.widgets import Button, Select, TabbedContent, TabPane, TextArea
from uipath.runtime import UiPathRuntimeFactoryProtocol
from uipath.runtime import UiPathRuntimeFactoryProtocol, UiPathRuntimeProtocol

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

Expand Down Expand Up @@ -182,18 +182,22 @@ async def _load_schema_and_update_input(self, entrypoint: str) -> None:
schema = self.entrypoint_schemas.get(entrypoint)

if schema is None:
runtime: UiPathRuntimeProtocol | None = None
try:
runtime = await self._runtime_factory.new_runtime(entrypoint)
runtime = await self._runtime_factory.new_runtime(
entrypoint, runtime_id="default"
)
schema_obj = await runtime.get_schema()

input_schema = schema_obj.input or {}
self.entrypoint_schemas[entrypoint] = input_schema
schema = input_schema

await runtime.dispose()
except Exception:
schema = {}
self.entrypoint_schemas[entrypoint] = schema
finally:
if runtime is not None:
await runtime.dispose()

json_input.text = json.dumps(
mock_json_from_schema(schema),
Expand Down
17 changes: 8 additions & 9 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.