uipath 2.1.86__py3-none-any.whl → 2.1.87__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/__init__.py CHANGED
@@ -8,7 +8,6 @@ from .cli_auth import auth as auth
8
8
  from .cli_deploy import deploy as deploy # type: ignore
9
9
  from .cli_dev import dev as dev
10
10
  from .cli_eval import eval as eval # type: ignore
11
- from .cli_init import generate_agents_md as generate_agents_md # type: ignore
12
11
  from .cli_init import init as init # type: ignore
13
12
  from .cli_invoke import invoke as invoke # type: ignore
14
13
  from .cli_new import new as new # type: ignore
@@ -2,6 +2,7 @@ import importlib.util
2
2
  import inspect
3
3
  import sys
4
4
  from dataclasses import fields, is_dataclass
5
+ from enum import Enum
5
6
  from types import ModuleType
6
7
  from typing import (
7
8
  Any,
@@ -16,11 +17,11 @@ from typing import (
16
17
 
17
18
  from pydantic import BaseModel
18
19
 
19
- SchemaType = Literal["object", "integer", "double", "string", "boolean", "array"]
20
+ SchemaType = Literal["object", "integer", "number", "string", "boolean", "array"]
20
21
 
21
22
  TYPE_MAP: Dict[str, SchemaType] = {
22
23
  "int": "integer",
23
- "float": "double",
24
+ "float": "number",
24
25
  "str": "string",
25
26
  "bool": "boolean",
26
27
  "list": "array",
@@ -52,7 +53,25 @@ def get_type_schema(type_hint: Any) -> Dict[str, Any]:
52
53
  return {"type": "object"}
53
54
 
54
55
  if inspect.isclass(type_hint):
55
- # Handle Pydantic models
56
+ if issubclass(type_hint, Enum):
57
+ enum_values = [member.value for member in type_hint]
58
+ if not enum_values:
59
+ return {"type": "string", "enum": []}
60
+
61
+ first_value = enum_values[0]
62
+ if isinstance(first_value, str):
63
+ enum_type = "string"
64
+ elif isinstance(first_value, int):
65
+ enum_type = "integer"
66
+ elif isinstance(first_value, float):
67
+ enum_type = "number"
68
+ elif isinstance(first_value, bool):
69
+ enum_type = "boolean"
70
+ else:
71
+ enum_type = "string"
72
+
73
+ return {"type": enum_type, "enum": enum_values}
74
+
56
75
  if issubclass(type_hint, BaseModel):
57
76
  properties = {}
58
77
  required = []
uipath/_cli/cli_init.py CHANGED
@@ -58,32 +58,28 @@ def generate_env_file(target_directory):
58
58
  console.success(f" Created '{relative_path}' file.")
59
59
 
60
60
 
61
- def generate_agents_md(target_directory: str) -> None:
62
- """Generate AGENTS.md file from the packaged resource.
61
+ def generate_agent_specific_file_md(target_directory: str, file_name: str) -> None:
62
+ """Generate an agent-specific file from the packaged resource.
63
63
 
64
64
  Args:
65
- target_directory: The directory where AGENTS.md should be created.
65
+ target_directory: The directory where the file should be created.
66
+ file_name: The name of the file should be created.
66
67
  """
67
- target_path = os.path.join(target_directory, "AGENTS.md")
68
+ target_path = os.path.join(target_directory, file_name)
68
69
 
69
- # Skip if file already exists
70
70
  if os.path.exists(target_path):
71
- console.info("Skipping 'AGENTS.md' creation as it already exists.")
71
+ console.info(f"Skipping '{file_name}' creation as it already exists.")
72
72
  return
73
73
 
74
74
  try:
75
- # Get the resource path using importlib.resources
76
- source_path = importlib.resources.files("uipath._resources").joinpath(
77
- "AGENTS.md"
78
- )
75
+ source_path = importlib.resources.files("uipath._resources").joinpath(file_name)
79
76
 
80
- # Copy the file to the target directory
81
77
  with importlib.resources.as_file(source_path) as s_path:
82
78
  shutil.copy(s_path, target_path)
83
79
 
84
- console.success(" Created 'AGENTS.md' file.")
80
+ console.success(f" Created '{file_name}' file.")
85
81
  except Exception as e:
86
- console.warning(f"Could not create AGENTS.md: {e}")
82
+ console.warning(f"Could not create {file_name}: {e}")
87
83
 
88
84
 
89
85
  def get_existing_settings(config_path: str) -> Optional[Dict[str, Any]]:
@@ -160,7 +156,17 @@ def init(entrypoint: str, infer_bindings: bool) -> None:
160
156
  current_directory = os.getcwd()
161
157
  generate_env_file(current_directory)
162
158
  create_telemetry_config_file(current_directory)
163
- generate_agents_md(current_directory)
159
+ generate_agent_specific_file_md(current_directory, "AGENTS.md")
160
+ generate_agent_specific_file_md(
161
+ os.path.join(current_directory, ".agent"), "CLI_REFERENCE.md"
162
+ )
163
+ generate_agent_specific_file_md(
164
+ os.path.join(current_directory, ".agent"), "REQUIRED_STRUCTURE.md"
165
+ )
166
+ generate_agent_specific_file_md(
167
+ os.path.join(current_directory, ".agent"), "SDK_REFERENCE.md"
168
+ )
169
+ generate_agent_specific_file_md(current_directory, "CLAUDE.md")
164
170
 
165
171
  result = Middlewares.next(
166
172
  "init",