uipath 2.1.104__py3-none-any.whl → 2.1.106__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of uipath might be problematic. Click here for more details.
- uipath/_cli/_auth/_portal_service.py +8 -12
- uipath/_cli/_debug/_bridge.py +181 -13
- uipath/_cli/_debug/_runtime.py +21 -5
- uipath/_cli/_runtime/_contracts.py +43 -4
- uipath/_cli/_runtime/_hitl.py +7 -6
- uipath/_cli/_runtime/_runtime.py +2 -1
- uipath/_cli/_runtime/_script_executor.py +9 -12
- {uipath-2.1.104.dist-info → uipath-2.1.106.dist-info}/METADATA +1 -1
- {uipath-2.1.104.dist-info → uipath-2.1.106.dist-info}/RECORD +12 -12
- {uipath-2.1.104.dist-info → uipath-2.1.106.dist-info}/WHEEL +0 -0
- {uipath-2.1.104.dist-info → uipath-2.1.106.dist-info}/entry_points.txt +0 -0
- {uipath-2.1.104.dist-info → uipath-2.1.106.dist-info}/licenses/LICENSE +0 -0
|
@@ -7,20 +7,16 @@ import httpx
|
|
|
7
7
|
from ..._utils._auth import update_env_file
|
|
8
8
|
from ..._utils._ssl_context import get_httpx_client_kwargs
|
|
9
9
|
from ...models.auth import TokenData
|
|
10
|
-
from .._runtime._contracts import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
TenantInfo,
|
|
15
|
-
TenantsAndOrganizationInfoResponse,
|
|
10
|
+
from .._runtime._contracts import (
|
|
11
|
+
UiPathErrorCategory,
|
|
12
|
+
UiPathErrorCode,
|
|
13
|
+
UiPathRuntimeError,
|
|
16
14
|
)
|
|
15
|
+
from .._utils._console import ConsoleLogger
|
|
16
|
+
from ._models import OrganizationInfo, TenantInfo, TenantsAndOrganizationInfoResponse
|
|
17
17
|
from ._oidc_utils import OidcUtils
|
|
18
18
|
from ._url_utils import build_service_url
|
|
19
|
-
from ._utils import
|
|
20
|
-
get_auth_data,
|
|
21
|
-
get_parsed_token_data,
|
|
22
|
-
update_auth_file,
|
|
23
|
-
)
|
|
19
|
+
from ._utils import get_auth_data, get_parsed_token_data, update_auth_file
|
|
24
20
|
|
|
25
21
|
|
|
26
22
|
class PortalService:
|
|
@@ -142,7 +138,7 @@ class PortalService:
|
|
|
142
138
|
refresh_token = auth_data.refresh_token
|
|
143
139
|
if not refresh_token:
|
|
144
140
|
raise UiPathRuntimeError(
|
|
145
|
-
|
|
141
|
+
UiPathErrorCode.REFRESH_TOKEN_MISSING,
|
|
146
142
|
"No refresh token found",
|
|
147
143
|
"The refresh token could not be retrieved. Please retry authenticating.",
|
|
148
144
|
UiPathErrorCategory.SYSTEM,
|
uipath/_cli/_debug/_bridge.py
CHANGED
|
@@ -3,7 +3,8 @@ import json
|
|
|
3
3
|
import logging
|
|
4
4
|
import os
|
|
5
5
|
from abc import ABC, abstractmethod
|
|
6
|
-
from
|
|
6
|
+
from enum import Enum
|
|
7
|
+
from typing import Any, Dict, List, Optional, Set
|
|
7
8
|
|
|
8
9
|
from pydantic import BaseModel
|
|
9
10
|
from pysignalr.client import SignalRClient
|
|
@@ -22,6 +23,50 @@ from uipath._events._events import UiPathAgentStateEvent
|
|
|
22
23
|
logger = logging.getLogger(__name__)
|
|
23
24
|
|
|
24
25
|
|
|
26
|
+
class DebuggerQuitException(Exception):
|
|
27
|
+
"""Raised when user quits the debugger."""
|
|
28
|
+
|
|
29
|
+
pass
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class DebugCommand(str, Enum):
|
|
33
|
+
"""Available debug commands."""
|
|
34
|
+
|
|
35
|
+
CONTINUE = "continue"
|
|
36
|
+
STEP = "step"
|
|
37
|
+
BREAKPOINT = "breakpoint"
|
|
38
|
+
LIST_BREAKPOINTS = "list"
|
|
39
|
+
CLEAR_BREAKPOINT = "clear"
|
|
40
|
+
HELP = "help"
|
|
41
|
+
QUIT = "quit"
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class DebuggerState:
|
|
45
|
+
"""Maintains debugger state across execution."""
|
|
46
|
+
|
|
47
|
+
def __init__(self):
|
|
48
|
+
self.breakpoints: Set[str] = set()
|
|
49
|
+
self.step_mode: bool = False
|
|
50
|
+
|
|
51
|
+
def add_breakpoint(self, node_name: str) -> None:
|
|
52
|
+
"""Add a breakpoint at a node."""
|
|
53
|
+
self.breakpoints.add(node_name)
|
|
54
|
+
|
|
55
|
+
def remove_breakpoint(self, node_name: str) -> None:
|
|
56
|
+
"""Remove a breakpoint from a node."""
|
|
57
|
+
self.breakpoints.discard(node_name)
|
|
58
|
+
|
|
59
|
+
def clear_all_breakpoints(self) -> None:
|
|
60
|
+
"""Clear all breakpoints."""
|
|
61
|
+
self.breakpoints.clear()
|
|
62
|
+
|
|
63
|
+
def should_break(self, node_name: str) -> bool:
|
|
64
|
+
"""Check if execution should break at this node."""
|
|
65
|
+
if self.step_mode:
|
|
66
|
+
return True
|
|
67
|
+
return node_name in self.breakpoints
|
|
68
|
+
|
|
69
|
+
|
|
25
70
|
class UiPathDebugBridge(ABC):
|
|
26
71
|
"""Abstract interface for debug communication.
|
|
27
72
|
|
|
@@ -77,6 +122,15 @@ class UiPathDebugBridge(ABC):
|
|
|
77
122
|
"""Wait for resume command from debugger."""
|
|
78
123
|
pass
|
|
79
124
|
|
|
125
|
+
@abstractmethod
|
|
126
|
+
def get_breakpoints(self) -> List[str]:
|
|
127
|
+
"""Get nodes to suspend execution at.
|
|
128
|
+
|
|
129
|
+
Returns:
|
|
130
|
+
List of node names to suspend at, or ["*"] for all nodes (step mode)
|
|
131
|
+
"""
|
|
132
|
+
pass
|
|
133
|
+
|
|
80
134
|
|
|
81
135
|
class ConsoleDebugBridge(UiPathDebugBridge):
|
|
82
136
|
"""Console-based debug bridge for local development."""
|
|
@@ -89,15 +143,12 @@ class ConsoleDebugBridge(UiPathDebugBridge):
|
|
|
89
143
|
"""
|
|
90
144
|
self.console = Console()
|
|
91
145
|
self.verbose = verbose
|
|
146
|
+
self.state = DebuggerState()
|
|
92
147
|
|
|
93
148
|
async def connect(self) -> None:
|
|
94
149
|
"""Connect to console debugger."""
|
|
95
150
|
self.console.print()
|
|
96
|
-
self.
|
|
97
|
-
self.console.print("[bold cyan]Debug Mode")
|
|
98
|
-
self.console.print("[dim]Press ENTER to continue | Type 'quit' to exit")
|
|
99
|
-
self.console.print("[bold cyan]─" * 40)
|
|
100
|
-
self.console.print()
|
|
151
|
+
self._print_help()
|
|
101
152
|
|
|
102
153
|
async def disconnect(self) -> None:
|
|
103
154
|
"""Cleanup."""
|
|
@@ -182,18 +233,128 @@ class ConsoleDebugBridge(UiPathDebugBridge):
|
|
|
182
233
|
|
|
183
234
|
async def wait_for_resume(self) -> Any:
|
|
184
235
|
"""Wait for user to press Enter or type commands."""
|
|
185
|
-
|
|
186
|
-
|
|
236
|
+
while True: # Keep looping until we get a resume command
|
|
237
|
+
self.console.print()
|
|
187
238
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
239
|
+
# Run input() in executor to not block async loop
|
|
240
|
+
loop = asyncio.get_running_loop()
|
|
241
|
+
user_input = await loop.run_in_executor(None, lambda: input("> "))
|
|
191
242
|
|
|
192
|
-
|
|
243
|
+
command_result = self._parse_command(user_input.strip())
|
|
244
|
+
|
|
245
|
+
# Handle commands that need another prompt
|
|
246
|
+
if command_result["command"] in [
|
|
247
|
+
DebugCommand.BREAKPOINT,
|
|
248
|
+
DebugCommand.LIST_BREAKPOINTS,
|
|
249
|
+
DebugCommand.CLEAR_BREAKPOINT,
|
|
250
|
+
DebugCommand.HELP,
|
|
251
|
+
]:
|
|
252
|
+
# These commands don't resume execution, loop again
|
|
253
|
+
continue
|
|
254
|
+
|
|
255
|
+
# Reset step modes if continuing
|
|
256
|
+
if command_result["command"] == DebugCommand.CONTINUE:
|
|
257
|
+
self.state.step_mode = False
|
|
258
|
+
|
|
259
|
+
if command_result["command"] == DebugCommand.QUIT:
|
|
260
|
+
raise DebuggerQuitException("User requested exit")
|
|
261
|
+
|
|
262
|
+
# Commands that resume execution: CONTINUE, STEP
|
|
263
|
+
self.console.print()
|
|
264
|
+
return command_result
|
|
265
|
+
|
|
266
|
+
def get_breakpoints(self) -> List[str]:
|
|
267
|
+
"""Get nodes to suspend execution at."""
|
|
268
|
+
if self.state.step_mode:
|
|
269
|
+
return ["*"] # Suspend at all nodes
|
|
270
|
+
return list(self.state.breakpoints) # Only suspend at breakpoints
|
|
271
|
+
|
|
272
|
+
def _parse_command(self, user_input: str) -> Dict[str, Any]:
|
|
273
|
+
"""Parse user command input.
|
|
274
|
+
|
|
275
|
+
Returns:
|
|
276
|
+
Dict with 'command' and optional 'args'
|
|
277
|
+
"""
|
|
278
|
+
if not user_input:
|
|
279
|
+
return {"command": DebugCommand.CONTINUE, "args": None}
|
|
280
|
+
|
|
281
|
+
parts = user_input.lower().split()
|
|
282
|
+
cmd = parts[0]
|
|
283
|
+
args = parts[1:] if len(parts) > 1 else []
|
|
284
|
+
|
|
285
|
+
if cmd in ["c", "continue"]:
|
|
286
|
+
return {"command": DebugCommand.CONTINUE, "args": None}
|
|
287
|
+
|
|
288
|
+
elif cmd in ["s", "step"]:
|
|
289
|
+
self.state.step_mode = True
|
|
290
|
+
return {"command": DebugCommand.STEP, "args": None}
|
|
291
|
+
|
|
292
|
+
elif cmd in ["b", "break", "breakpoint"]:
|
|
293
|
+
if not args:
|
|
294
|
+
self.console.print(
|
|
295
|
+
"[red]Error: breakpoint command requires a node name[/red]"
|
|
296
|
+
)
|
|
297
|
+
return {"command": DebugCommand.HELP, "args": None}
|
|
298
|
+
node_name = " ".join(args)
|
|
299
|
+
self.state.add_breakpoint(node_name)
|
|
300
|
+
self.console.print(f"[green]✓ Breakpoint set at: {node_name}[/green]")
|
|
301
|
+
return {"command": DebugCommand.BREAKPOINT, "args": {"node": node_name}}
|
|
302
|
+
|
|
303
|
+
elif cmd in ["l", "list"]:
|
|
304
|
+
self._list_breakpoints()
|
|
305
|
+
return {"command": DebugCommand.LIST_BREAKPOINTS, "args": None}
|
|
306
|
+
|
|
307
|
+
elif cmd in ["r", "remove", "delete"]:
|
|
308
|
+
if not args:
|
|
309
|
+
self.console.print("[yellow]Removing all breakpoints[/yellow]")
|
|
310
|
+
self.state.clear_all_breakpoints()
|
|
311
|
+
else:
|
|
312
|
+
node_name = " ".join(args)
|
|
313
|
+
self.state.remove_breakpoint(node_name)
|
|
314
|
+
self.console.print(f"[green]✓ Breakpoint removed: {node_name}[/green]")
|
|
315
|
+
return {
|
|
316
|
+
"command": DebugCommand.CLEAR_BREAKPOINT,
|
|
317
|
+
"args": {"node": " ".join(args) if args else None},
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
elif cmd in ["q", "quit", "exit"]:
|
|
193
321
|
raise KeyboardInterrupt("User requested exit")
|
|
194
322
|
|
|
323
|
+
elif cmd in ["h", "help", "?"]:
|
|
324
|
+
self._print_help()
|
|
325
|
+
return {"command": DebugCommand.HELP, "args": None}
|
|
326
|
+
|
|
327
|
+
else:
|
|
328
|
+
self.console.print(f"[red]Unknown command: {cmd}[/red]")
|
|
329
|
+
self.console.print("[dim]Type 'help' for available commands[/dim]")
|
|
330
|
+
return {"command": DebugCommand.HELP, "args": None}
|
|
331
|
+
|
|
332
|
+
def _list_breakpoints(self) -> None:
|
|
333
|
+
"""List all active breakpoints."""
|
|
334
|
+
if not self.state.breakpoints:
|
|
335
|
+
self.console.print("[dim]No breakpoints set[/dim]")
|
|
336
|
+
else:
|
|
337
|
+
self.console.print("[yellow]Active breakpoints:[/yellow]")
|
|
338
|
+
for i, bp in enumerate(sorted(self.state.breakpoints), 1):
|
|
339
|
+
self.console.print(f" {i}. [cyan]{bp}[/cyan]")
|
|
340
|
+
|
|
341
|
+
def _print_help(self) -> None:
|
|
342
|
+
"""Print available commands."""
|
|
343
|
+
self.console.print("[bold cyan]Debug Mode Commands[/bold cyan]")
|
|
344
|
+
self.console.print(
|
|
345
|
+
" [yellow]c, continue[/yellow] Continue until next breakpoint"
|
|
346
|
+
)
|
|
347
|
+
self.console.print(" [yellow]s, step[/yellow] Step to next node")
|
|
348
|
+
self.console.print(
|
|
349
|
+
" [yellow]b <node>[/yellow] Set breakpoint at <node>"
|
|
350
|
+
)
|
|
351
|
+
self.console.print(" [yellow]l, list[/yellow] List all breakpoints")
|
|
352
|
+
self.console.print(
|
|
353
|
+
" [yellow]r <node>[/yellow] Remove breakpoint at <node>"
|
|
354
|
+
)
|
|
355
|
+
self.console.print(" [yellow]h, help[/yellow] Show help")
|
|
356
|
+
self.console.print(" [yellow]q, quit[/yellow] Exit debugger")
|
|
195
357
|
self.console.print()
|
|
196
|
-
return user_input
|
|
197
358
|
|
|
198
359
|
def _print_json(self, data: Dict[str, Any], label: str = "data") -> None:
|
|
199
360
|
"""Print JSON data with enhanced hierarchy."""
|
|
@@ -289,6 +450,7 @@ class SignalRDebugBridge(UiPathDebugBridge):
|
|
|
289
450
|
self.hub_url = hub_url
|
|
290
451
|
self.access_token = access_token
|
|
291
452
|
self.headers = headers or {}
|
|
453
|
+
self.state = DebuggerState()
|
|
292
454
|
self._client: Optional[SignalRClient] = None
|
|
293
455
|
self._connected_event = asyncio.Event()
|
|
294
456
|
self._resume_event: Optional[asyncio.Event] = None
|
|
@@ -396,6 +558,12 @@ class SignalRDebugBridge(UiPathDebugBridge):
|
|
|
396
558
|
logger.info("Resume command received")
|
|
397
559
|
return self._resume_data
|
|
398
560
|
|
|
561
|
+
def get_breakpoints(self) -> List[str]:
|
|
562
|
+
"""Get nodes to suspend execution at."""
|
|
563
|
+
if self.state.step_mode:
|
|
564
|
+
return ["*"] # Suspend at all nodes
|
|
565
|
+
return list(self.state.breakpoints) # Only suspend at breakpoints
|
|
566
|
+
|
|
399
567
|
async def _send(self, method: str, data: Dict[str, Any]) -> None:
|
|
400
568
|
"""Send message to SignalR hub."""
|
|
401
569
|
if not self._client:
|
uipath/_cli/_debug/_runtime.py
CHANGED
|
@@ -11,9 +11,10 @@ from .._runtime._contracts import (
|
|
|
11
11
|
UiPathRuntimeContext,
|
|
12
12
|
UiPathRuntimeFactory,
|
|
13
13
|
UiPathRuntimeResult,
|
|
14
|
+
UiPathRuntimeStatus,
|
|
14
15
|
UiPathRuntimeStreamNotSupportedError,
|
|
15
16
|
)
|
|
16
|
-
from ._bridge import UiPathDebugBridge
|
|
17
|
+
from ._bridge import DebuggerQuitException, UiPathDebugBridge
|
|
17
18
|
|
|
18
19
|
logger = logging.getLogger(__name__)
|
|
19
20
|
|
|
@@ -91,8 +92,15 @@ class UiPathDebugRuntime(UiPathBaseRuntime, Generic[T, C]):
|
|
|
91
92
|
final_result: Optional[UiPathRuntimeResult] = None
|
|
92
93
|
execution_completed = False
|
|
93
94
|
|
|
95
|
+
# Starting in paused state - wait for breakpoints and resume
|
|
96
|
+
await self.debug_bridge.wait_for_resume()
|
|
97
|
+
|
|
94
98
|
# Keep streaming until execution completes (not just paused at breakpoint)
|
|
95
99
|
while not execution_completed:
|
|
100
|
+
# Update breakpoints from debug bridge
|
|
101
|
+
self._inner_runtime.context.breakpoints = (
|
|
102
|
+
self.debug_bridge.get_breakpoints()
|
|
103
|
+
)
|
|
96
104
|
# Stream events from inner runtime
|
|
97
105
|
async for event in self._inner_runtime.stream():
|
|
98
106
|
# Handle final result
|
|
@@ -101,10 +109,18 @@ class UiPathDebugRuntime(UiPathBaseRuntime, Generic[T, C]):
|
|
|
101
109
|
|
|
102
110
|
# Check if it's a breakpoint result
|
|
103
111
|
if isinstance(event, UiPathBreakpointResult):
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
try:
|
|
113
|
+
# Hit a breakpoint - wait for resume and continue
|
|
114
|
+
await self.debug_bridge.emit_breakpoint_hit(event)
|
|
115
|
+
await self.debug_bridge.wait_for_resume()
|
|
116
|
+
|
|
117
|
+
self._inner_runtime.context.resume = True
|
|
118
|
+
|
|
119
|
+
except DebuggerQuitException:
|
|
120
|
+
final_result = UiPathRuntimeResult(
|
|
121
|
+
status=UiPathRuntimeStatus.SUCCESSFUL,
|
|
122
|
+
)
|
|
123
|
+
execution_completed = True
|
|
108
124
|
else:
|
|
109
125
|
# Normal completion or suspension with dynamic interrupt
|
|
110
126
|
execution_completed = True
|
|
@@ -93,6 +93,42 @@ class UiPathErrorCategory(str, Enum):
|
|
|
93
93
|
USER = "User" # Business logic or domain-level errors
|
|
94
94
|
|
|
95
95
|
|
|
96
|
+
class UiPathErrorCode(str, Enum):
|
|
97
|
+
"""Standard error codes for UiPath runtime errors."""
|
|
98
|
+
|
|
99
|
+
# Entrypoint related errors
|
|
100
|
+
ENTRYPOINT_MISSING = "ENTRYPOINT_MISSING"
|
|
101
|
+
ENTRYPOINT_NOT_FOUND = "ENTRYPOINT_NOT_FOUND"
|
|
102
|
+
ENTRYPOINT_FUNCTION_MISSING = "ENTRYPOINT_FUNCTION_MISSING"
|
|
103
|
+
|
|
104
|
+
# Module and execution errors
|
|
105
|
+
IMPORT_ERROR = "IMPORT_ERROR"
|
|
106
|
+
MODULE_EXECUTION_ERROR = "MODULE_EXECUTION_ERROR"
|
|
107
|
+
FUNCTION_EXECUTION_ERROR = "FUNCTION_EXECUTION_ERROR"
|
|
108
|
+
EXECUTION_ERROR = "EXECUTION_ERROR"
|
|
109
|
+
|
|
110
|
+
# Input validation errors
|
|
111
|
+
INVALID_INPUT_FILE_EXTENSION = "INVALID_INPUT_FILE_EXTENSION"
|
|
112
|
+
INPUT_INVALID_JSON = "INPUT_INVALID_JSON"
|
|
113
|
+
|
|
114
|
+
# Process and job related errors
|
|
115
|
+
INVOKED_PROCESS_FAILURE = "INVOKED_PROCESS_FAILURE"
|
|
116
|
+
API_CONNECTION_ERROR = "API_CONNECTION_ERROR"
|
|
117
|
+
|
|
118
|
+
# HITL (Human-In-The-Loop) related errors
|
|
119
|
+
HITL_FEEDBACK_FAILURE = "HITL_FEEDBACK_FAILURE"
|
|
120
|
+
UNKNOWN_HITL_MODEL = "UNKNOWN_HITL_MODEL"
|
|
121
|
+
HITL_ACTION_CREATION_FAILED = "HITL_ACTION_CREATION_FAILED"
|
|
122
|
+
|
|
123
|
+
# Trigger type errors
|
|
124
|
+
UNKNOWN_TRIGGER_TYPE = "UNKNOWN_TRIGGER_TYPE"
|
|
125
|
+
|
|
126
|
+
# Runtime shutdown errors
|
|
127
|
+
RUNTIME_SHUTDOWN_ERROR = "RUNTIME_SHUTDOWN_ERROR"
|
|
128
|
+
|
|
129
|
+
REFRESH_TOKEN_MISSING = "REFRESH_TOKEN_MISSING"
|
|
130
|
+
|
|
131
|
+
|
|
96
132
|
class UiPathErrorContract(BaseModel):
|
|
97
133
|
"""Standard error contract used across the runtime."""
|
|
98
134
|
|
|
@@ -346,6 +382,7 @@ class UiPathRuntimeContext(BaseModel):
|
|
|
346
382
|
log_handler: Optional[logging.Handler] = None
|
|
347
383
|
chat_handler: Optional[UiPathConversationHandler] = None
|
|
348
384
|
is_conversational: Optional[bool] = None
|
|
385
|
+
breakpoints: Optional[List[str]] = None
|
|
349
386
|
|
|
350
387
|
model_config = {"arbitrary_types_allowed": True, "extra": "allow"}
|
|
351
388
|
|
|
@@ -428,7 +465,7 @@ class UiPathRuntimeError(Exception):
|
|
|
428
465
|
|
|
429
466
|
def __init__(
|
|
430
467
|
self,
|
|
431
|
-
code:
|
|
468
|
+
code: UiPathErrorCode,
|
|
432
469
|
title: str,
|
|
433
470
|
detail: str,
|
|
434
471
|
category: UiPathErrorCategory = UiPathErrorCategory.UNKNOWN,
|
|
@@ -447,8 +484,10 @@ class UiPathRuntimeError(Exception):
|
|
|
447
484
|
if status is None:
|
|
448
485
|
status = self._extract_http_status()
|
|
449
486
|
|
|
487
|
+
code_value = code.value
|
|
488
|
+
|
|
450
489
|
self.error_info = UiPathErrorContract(
|
|
451
|
-
code=f"{prefix}.{
|
|
490
|
+
code=f"{prefix}.{code_value}",
|
|
452
491
|
title=title,
|
|
453
492
|
detail=detail,
|
|
454
493
|
category=category,
|
|
@@ -547,7 +586,7 @@ class UiPathBaseRuntime(ABC):
|
|
|
547
586
|
_, file_extension = os.path.splitext(self.context.input_file)
|
|
548
587
|
if file_extension != ".json":
|
|
549
588
|
raise UiPathRuntimeError(
|
|
550
|
-
code=
|
|
589
|
+
code=UiPathErrorCode.INVALID_INPUT_FILE_EXTENSION,
|
|
551
590
|
title="Invalid Input File Extension",
|
|
552
591
|
detail="The provided input file must be in JSON format.",
|
|
553
592
|
)
|
|
@@ -561,7 +600,7 @@ class UiPathBaseRuntime(ABC):
|
|
|
561
600
|
self.context.input_json = {}
|
|
562
601
|
except json.JSONDecodeError as e:
|
|
563
602
|
raise UiPathRuntimeError(
|
|
564
|
-
|
|
603
|
+
UiPathErrorCode.INPUT_INVALID_JSON,
|
|
565
604
|
"Invalid JSON input",
|
|
566
605
|
f"The input data is not valid JSON: {str(e)}",
|
|
567
606
|
UiPathErrorCategory.USER,
|
uipath/_cli/_runtime/_hitl.py
CHANGED
|
@@ -10,6 +10,7 @@ from uipath.models import CreateAction, InvokeProcess, WaitAction, WaitJob
|
|
|
10
10
|
from .._runtime._contracts import (
|
|
11
11
|
UiPathApiTrigger,
|
|
12
12
|
UiPathErrorCategory,
|
|
13
|
+
UiPathErrorCode,
|
|
13
14
|
UiPathResumeTrigger,
|
|
14
15
|
UiPathResumeTriggerType,
|
|
15
16
|
UiPathRuntimeError,
|
|
@@ -87,7 +88,7 @@ class HitlReader:
|
|
|
87
88
|
== UiPathRuntimeStatus.SUCCESSFUL.value.lower()
|
|
88
89
|
):
|
|
89
90
|
raise UiPathRuntimeError(
|
|
90
|
-
|
|
91
|
+
UiPathErrorCode.INVOKED_PROCESS_FAILURE,
|
|
91
92
|
"Invoked process did not finish successfully.",
|
|
92
93
|
_try_convert_to_json_format(str(job.job_error or job.info))
|
|
93
94
|
or "Job error unavailable.",
|
|
@@ -103,21 +104,21 @@ class HitlReader:
|
|
|
103
104
|
)
|
|
104
105
|
except Exception as e:
|
|
105
106
|
raise UiPathRuntimeError(
|
|
106
|
-
|
|
107
|
+
UiPathErrorCode.API_CONNECTION_ERROR,
|
|
107
108
|
"Failed to get trigger payload",
|
|
108
109
|
f"Error fetching API trigger payload for inbox {resume_trigger.api_resume.inbox_id}: {str(e)}",
|
|
109
110
|
UiPathErrorCategory.SYSTEM,
|
|
110
111
|
) from e
|
|
111
112
|
case _:
|
|
112
113
|
raise UiPathRuntimeError(
|
|
113
|
-
|
|
114
|
+
UiPathErrorCode.UNKNOWN_TRIGGER_TYPE,
|
|
114
115
|
"Unexpected trigger type received",
|
|
115
116
|
f"Trigger type :{type(resume_trigger.trigger_type)} is invalid",
|
|
116
117
|
UiPathErrorCategory.USER,
|
|
117
118
|
)
|
|
118
119
|
|
|
119
120
|
raise UiPathRuntimeError(
|
|
120
|
-
|
|
121
|
+
UiPathErrorCode.HITL_FEEDBACK_FAILURE,
|
|
121
122
|
"Failed to receive payload from HITL action",
|
|
122
123
|
detail="Failed to receive payload from HITL action",
|
|
123
124
|
category=UiPathErrorCategory.SYSTEM,
|
|
@@ -242,14 +243,14 @@ class HitlProcessor:
|
|
|
242
243
|
)
|
|
243
244
|
case _:
|
|
244
245
|
raise UiPathRuntimeError(
|
|
245
|
-
|
|
246
|
+
UiPathErrorCode.UNKNOWN_HITL_MODEL,
|
|
246
247
|
"Unexpected model received",
|
|
247
248
|
f"{type(hitl_input)} is not a valid Human(Robot/Agent)-In-The-Loop model",
|
|
248
249
|
UiPathErrorCategory.USER,
|
|
249
250
|
)
|
|
250
251
|
except Exception as e:
|
|
251
252
|
raise UiPathRuntimeError(
|
|
252
|
-
|
|
253
|
+
UiPathErrorCode.HITL_ACTION_CREATION_FAILED,
|
|
253
254
|
"Failed to create HITL action",
|
|
254
255
|
f"{str(e)}",
|
|
255
256
|
UiPathErrorCategory.SYSTEM,
|
uipath/_cli/_runtime/_runtime.py
CHANGED
|
@@ -16,6 +16,7 @@ from ..models.runtime_schema import BindingResource, Entrypoint
|
|
|
16
16
|
from ._contracts import (
|
|
17
17
|
UiPathBaseRuntime,
|
|
18
18
|
UiPathErrorCategory,
|
|
19
|
+
UiPathErrorCode,
|
|
19
20
|
UiPathRuntimeContext,
|
|
20
21
|
UiPathRuntimeError,
|
|
21
22
|
UiPathRuntimeResult,
|
|
@@ -66,7 +67,7 @@ class UiPathRuntime(UiPathBaseRuntime):
|
|
|
66
67
|
raise
|
|
67
68
|
|
|
68
69
|
raise UiPathRuntimeError(
|
|
69
|
-
|
|
70
|
+
UiPathErrorCode.EXECUTION_ERROR,
|
|
70
71
|
"Python script execution failed",
|
|
71
72
|
f"Error: {str(e)}",
|
|
72
73
|
UiPathErrorCategory.SYSTEM,
|
|
@@ -8,10 +8,7 @@ from typing import Any, Dict, Type, TypeVar, cast, get_type_hints
|
|
|
8
8
|
|
|
9
9
|
from pydantic import BaseModel
|
|
10
10
|
|
|
11
|
-
from ._contracts import
|
|
12
|
-
UiPathErrorCategory,
|
|
13
|
-
UiPathRuntimeError,
|
|
14
|
-
)
|
|
11
|
+
from ._contracts import UiPathErrorCategory, UiPathErrorCode, UiPathRuntimeError
|
|
15
12
|
|
|
16
13
|
T = TypeVar("T")
|
|
17
14
|
|
|
@@ -28,7 +25,7 @@ class ScriptExecutor:
|
|
|
28
25
|
"""Validate runtime inputs."""
|
|
29
26
|
if not self.entrypoint:
|
|
30
27
|
raise UiPathRuntimeError(
|
|
31
|
-
|
|
28
|
+
UiPathErrorCode.ENTRYPOINT_MISSING,
|
|
32
29
|
"No entrypoint specified",
|
|
33
30
|
"Please provide a path to a Python script.",
|
|
34
31
|
UiPathErrorCategory.USER,
|
|
@@ -36,7 +33,7 @@ class ScriptExecutor:
|
|
|
36
33
|
|
|
37
34
|
if not os.path.exists(self.entrypoint):
|
|
38
35
|
raise UiPathRuntimeError(
|
|
39
|
-
|
|
36
|
+
UiPathErrorCode.ENTRYPOINT_NOT_FOUND,
|
|
40
37
|
"Script not found",
|
|
41
38
|
f"Script not found at path {self.entrypoint}.",
|
|
42
39
|
UiPathErrorCategory.USER,
|
|
@@ -47,7 +44,7 @@ class ScriptExecutor:
|
|
|
47
44
|
spec = importlib.util.spec_from_file_location("dynamic_module", self.entrypoint)
|
|
48
45
|
if not spec or not spec.loader:
|
|
49
46
|
raise UiPathRuntimeError(
|
|
50
|
-
|
|
47
|
+
UiPathErrorCode.IMPORT_ERROR,
|
|
51
48
|
"Module import failed",
|
|
52
49
|
f"Could not load spec for {self.entrypoint}",
|
|
53
50
|
UiPathErrorCategory.USER,
|
|
@@ -58,7 +55,7 @@ class ScriptExecutor:
|
|
|
58
55
|
spec.loader.exec_module(module)
|
|
59
56
|
except Exception as e:
|
|
60
57
|
raise UiPathRuntimeError(
|
|
61
|
-
|
|
58
|
+
UiPathErrorCode.MODULE_EXECUTION_ERROR,
|
|
62
59
|
"Module execution failed",
|
|
63
60
|
f"Error executing module: {str(e)}",
|
|
64
61
|
UiPathErrorCategory.USER,
|
|
@@ -84,7 +81,7 @@ class ScriptExecutor:
|
|
|
84
81
|
)
|
|
85
82
|
except Exception as e:
|
|
86
83
|
raise UiPathRuntimeError(
|
|
87
|
-
|
|
84
|
+
UiPathErrorCode.FUNCTION_EXECUTION_ERROR,
|
|
88
85
|
f"Error executing {func_name} function",
|
|
89
86
|
f"Error: {str(e)}",
|
|
90
87
|
UiPathErrorCategory.USER,
|
|
@@ -114,7 +111,7 @@ class ScriptExecutor:
|
|
|
114
111
|
)
|
|
115
112
|
except Exception as e:
|
|
116
113
|
raise UiPathRuntimeError(
|
|
117
|
-
|
|
114
|
+
UiPathErrorCode.FUNCTION_EXECUTION_ERROR,
|
|
118
115
|
f"Error executing {func_name} function with typed input",
|
|
119
116
|
f"Error: {str(e)}",
|
|
120
117
|
UiPathErrorCategory.USER,
|
|
@@ -135,14 +132,14 @@ class ScriptExecutor:
|
|
|
135
132
|
)
|
|
136
133
|
except Exception as e:
|
|
137
134
|
raise UiPathRuntimeError(
|
|
138
|
-
|
|
135
|
+
UiPathErrorCode.FUNCTION_EXECUTION_ERROR,
|
|
139
136
|
f"Error executing {func_name} function with dictionary input",
|
|
140
137
|
f"Error: {str(e)}",
|
|
141
138
|
UiPathErrorCategory.USER,
|
|
142
139
|
) from e
|
|
143
140
|
|
|
144
141
|
raise UiPathRuntimeError(
|
|
145
|
-
|
|
142
|
+
UiPathErrorCode.ENTRYPOINT_FUNCTION_MISSING,
|
|
146
143
|
"No entry function found",
|
|
147
144
|
f"No main function (main, run, or execute) found in {self.entrypoint}",
|
|
148
145
|
UiPathErrorCategory.USER,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uipath
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.106
|
|
4
4
|
Summary: Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools.
|
|
5
5
|
Project-URL: Homepage, https://uipath.com
|
|
6
6
|
Project-URL: Repository, https://github.com/UiPath/uipath-python
|
|
@@ -25,15 +25,15 @@ uipath/_cli/_auth/_auth_server.py,sha256=v_b8KNwn0tAv8jxpeKdllOVzl31q9AcdwpE_koA
|
|
|
25
25
|
uipath/_cli/_auth/_auth_service.py,sha256=gyOtaHnDmjYccW0R1HVmFgV69a7w53Dx1Mq-PM0uVag,5405
|
|
26
26
|
uipath/_cli/_auth/_models.py,sha256=kWhqd5FqBo_oi3DW2x1IaJHsEloXq0I24f-pX5zb_O4,753
|
|
27
27
|
uipath/_cli/_auth/_oidc_utils.py,sha256=qGpognkz-Ks-8pt-QabSNTix5HE06lQpY3WZxptoJUE,3394
|
|
28
|
-
uipath/_cli/_auth/_portal_service.py,sha256=
|
|
28
|
+
uipath/_cli/_auth/_portal_service.py,sha256=nbJzMEg4MAhUGrXD90Jwd5b1SzxLiHri-ZgiHQwLzu8,8011
|
|
29
29
|
uipath/_cli/_auth/_url_utils.py,sha256=MuMYesMQDgetLBzkwd19dPxw3fctys7EVpByDUQMyLE,2844
|
|
30
30
|
uipath/_cli/_auth/_utils.py,sha256=To4Ara_UF4g7nzUfKqFA11lTjhQWIZWNm4xwa5nNKmU,896
|
|
31
31
|
uipath/_cli/_auth/auth_config.json,sha256=o8J5BBFwiEtjZLHpJ_64lvnTeYeRIHaJ-Bhg0QvcUX8,521
|
|
32
32
|
uipath/_cli/_auth/index.html,sha256=uGK0CDTP8Rys_p4O_Pbd2x4tz0frKNVcumjrXnal5Nc,22814
|
|
33
33
|
uipath/_cli/_auth/localhost.crt,sha256=oGl9oLLOiouHubAt39B4zEfylFvKEtbtr_43SIliXJc,1226
|
|
34
34
|
uipath/_cli/_auth/localhost.key,sha256=X31VYXD8scZtmGA837dGX5l6G-LXHLo5ItWJhZXaz3c,1679
|
|
35
|
-
uipath/_cli/_debug/_bridge.py,sha256=
|
|
36
|
-
uipath/_cli/_debug/_runtime.py,sha256=
|
|
35
|
+
uipath/_cli/_debug/_bridge.py,sha256=_CArFkZlwBYUkmpfqehcXyPNVDXv00vPNFfKJiOVJoA,22269
|
|
36
|
+
uipath/_cli/_debug/_runtime.py,sha256=iQ0L7WVvh0eF85D6sckZTTjE5wc_KQjCncT23hEdC6k,5596
|
|
37
37
|
uipath/_cli/_dev/_terminal/__init__.py,sha256=di_RiN9Mcp9wqyKRRqXag28vbSw8_78mCnQZNn9H-Ss,14027
|
|
38
38
|
uipath/_cli/_dev/_terminal/_components/_chat.py,sha256=NLRoy49QScHiI-q0FGykkaU8ajv1d23fx7issSALcFA,4119
|
|
39
39
|
uipath/_cli/_dev/_terminal/_components/_details.py,sha256=FbLYtJ56gqHV6CIrpzO_n9Sk_YNg4nzRKTSsbj-DBPQ,17257
|
|
@@ -68,13 +68,13 @@ uipath/_cli/_evals/mocks/mocker_factory.py,sha256=V5QKSTtQxztTo4-fK1TyAaXw2Z3mHf
|
|
|
68
68
|
uipath/_cli/_evals/mocks/mockito_mocker.py,sha256=AO2BmFwA6hz3Lte-STVr7aJDPvMCqKNKa4j2jeNZ_U4,2677
|
|
69
69
|
uipath/_cli/_evals/mocks/mocks.py,sha256=HY0IaSqqO8hioBB3rp5XwAjSpQE4K5hoH6oJQ-sH72I,2207
|
|
70
70
|
uipath/_cli/_push/sw_file_handler.py,sha256=DrGOpX7-dodrROh7YcjHlCBUuOEdVMh8o0550TL-ZYA,22520
|
|
71
|
-
uipath/_cli/_runtime/_contracts.py,sha256=
|
|
71
|
+
uipath/_cli/_runtime/_contracts.py,sha256=DvpDLkmCESMID2S_ryUu7Y1N26-QIRrDNgk-pPGoOSU,35697
|
|
72
72
|
uipath/_cli/_runtime/_escalation.py,sha256=x3vI98qsfRA-fL_tNkRVTFXioM5Gv2w0GFcXJJ5eQtg,7981
|
|
73
|
-
uipath/_cli/_runtime/_hitl.py,sha256=
|
|
73
|
+
uipath/_cli/_runtime/_hitl.py,sha256=JAwTUKvxO4HpnZMwE4E0AegAPw_uYOwgt0OYcu6EvTg,11474
|
|
74
74
|
uipath/_cli/_runtime/_logging.py,sha256=srjAi3Cy6g7b8WNHiYNjaZT4t40F3XRqquuoGd2kh4Y,14019
|
|
75
|
-
uipath/_cli/_runtime/_runtime.py,sha256=
|
|
75
|
+
uipath/_cli/_runtime/_runtime.py,sha256=Y20NFvnrLvnRi9u6D1HmUT9H7vbbsa423w-CkIRtTlA,4756
|
|
76
76
|
uipath/_cli/_runtime/_runtime_factory.py,sha256=8wbJeTTFQwCZ-Zm7tRec2YjBCJGhWdEwxl9yMkPwz6U,640
|
|
77
|
-
uipath/_cli/_runtime/_script_executor.py,sha256=
|
|
77
|
+
uipath/_cli/_runtime/_script_executor.py,sha256=zRAGQw_7gM93W3hGH4ml_Qn6KEEUxwJIe96odu-dMNA,9803
|
|
78
78
|
uipath/_cli/_templates/.psmdcp.template,sha256=C7pBJPt98ovEljcBvGtEUGoWjjQhu9jls1bpYjeLOKA,611
|
|
79
79
|
uipath/_cli/_templates/.rels.template,sha256=-fTcw7OA1AcymHr0LzBqbMAAtzZTRXLTNa_ljq087Jk,406
|
|
80
80
|
uipath/_cli/_templates/[Content_Types].xml.template,sha256=bYsKDz31PkIF9QksjgAY_bqm57YC8U_owsZeNZAiBxQ,584
|
|
@@ -191,8 +191,8 @@ uipath/tracing/_utils.py,sha256=X-LFsyIxDeNOGuHPvkb6T5o9Y8ElYhr_rP3CEBJSu4s,1383
|
|
|
191
191
|
uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
|
|
192
192
|
uipath/utils/_endpoints_manager.py,sha256=tnF_FiCx8qI2XaJDQgYkMN_gl9V0VqNR1uX7iawuLp8,8230
|
|
193
193
|
uipath/utils/dynamic_schema.py,sha256=w0u_54MoeIAB-mf3GmwX1A_X8_HDrRy6p998PvX9evY,3839
|
|
194
|
-
uipath-2.1.
|
|
195
|
-
uipath-2.1.
|
|
196
|
-
uipath-2.1.
|
|
197
|
-
uipath-2.1.
|
|
198
|
-
uipath-2.1.
|
|
194
|
+
uipath-2.1.106.dist-info/METADATA,sha256=RgKVCUJN_vpJ5woMYAfyoSUT6OGKc4KxdgMIYhrQT3U,6626
|
|
195
|
+
uipath-2.1.106.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
196
|
+
uipath-2.1.106.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
|
|
197
|
+
uipath-2.1.106.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
|
|
198
|
+
uipath-2.1.106.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|