Skip to content

Commit 682163c

Browse files
authored
feat: generate .uiproj and studio_metadata files on init (#1450)
1 parent 756a92e commit 682163c

21 files changed

Lines changed: 919 additions & 114 deletions

File tree

packages/uipath-platform/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-platform"
3-
version = "0.0.27"
3+
version = "0.0.28"
44
description = "HTTP client library for programmatic access to UiPath Platform"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

packages/uipath-platform/src/uipath/platform/common/_config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ def entry_points_file_path(self) -> Path:
130130

131131
return Path(ENTRY_POINTS_FILE)
132132

133+
@property
134+
def uiproj_file_path(self) -> Path:
135+
from uipath.platform.common.constants import UIPROJ_FILE
136+
137+
return Path(UIPROJ_FILE)
138+
133139
@property
134140
def studio_metadata_file_path(self) -> Path:
135141
from uipath.platform.common.constants import STUDIO_METADATA_FILE

packages/uipath-platform/src/uipath/platform/common/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
UIPATH_BINDINGS_FILE = "bindings.json"
7979
ENTRY_POINTS_FILE = "entry-points.json"
8080
STUDIO_METADATA_FILE = "studio_metadata.json"
81+
UIPROJ_FILE = "project.uiproj"
8182

8283

8384
# Folder names

packages/uipath-platform/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/uipath/docs/cli/index.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,20 @@ Selected tenant: Tenant1
4040
:depth: 1
4141
:style: table
4242

43-
Package requirements (bindings) are dependencies that are required by the automation package for successful execution.
43+
Initializes a UiPath project by generating all required configuration and metadata files. Run this command when setting up a new project and after modifying your agent's or function's input/output schema.
4444

45-
For more information about package requirements, see [the official documentation](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/managing-package-requirements)
45+
### Generated Files
46+
47+
| File | Description |
48+
|------|-------------|
49+
| `uipath.json` | Project configuration with entrypoint definitions |
50+
| `bindings.json` | Resource bindings (assets, processes, buckets, etc.) |
51+
| `entry-points.json` | Entry point definitions with input/output schemas |
52+
| `project.uiproj` | Project metadata for StudioWeb integration |
53+
| `.uipath/studio_metadata.json` | Studio metadata (schema and code version) |
54+
| `.env` | Environment variables file |
55+
| `AGENTS.md`, `CLAUDE.md` | Agent documentation and coding assistant instructions |
56+
| `.agent/CLI_REFERENCE.md`, `.agent/SDK_REFERENCE.md`, `.agent/REQUIRED_STRUCTURE.md` | Agent reference docs |
4657

4758
/// warning
4859

@@ -63,7 +74,13 @@ Running `uipath init` will process these function definitions and create the cor
6374
```shell
6475
> uipath init
6576
⠋ Initializing UiPath project ...
66-
✓ Created 'entry-points.json' file.
77+
✓ Created 'uipath.json' file.
78+
✓ Created 'bindings.json' file.
79+
✓ Created 'entry-points.json' file with 1 entrypoint(s).
80+
✓ Created 1 mermaid diagram file(s).
81+
✓ Updated 'project.uiproj' file.
82+
✓ Created '.uipath/studio_metadata.json' file.
83+
✓ Created: CLAUDE.md, CLI_REFERENCE.md, SDK_REFERENCE.md, AGENTS.md, REQUIRED_STRUCTURE.md.
6784
```
6885
---
6986

packages/uipath/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[project]
22
name = "uipath"
3-
version = "2.10.18"
3+
version = "2.10.19"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
77
dependencies = [
88
"uipath-core>=0.5.2, <0.6.0",
99
"uipath-runtime>=0.9.1, <0.10.0",
10-
"uipath-platform>=0.0.25, <0.1.0",
10+
"uipath-platform>=0.0.28, <0.1.0",
1111
"click>=8.3.1",
1212
"httpx>=0.28.1",
1313
"pyjwt>=2.10.1",

packages/uipath/specs/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,9 @@ Entry point definitions with JSON Schema-based input/output contracts.
1919

2020
- [Spec](entry-points.spec.md) | [Schema](entry-points.schema.json)
2121

22+
### `project.uiproj` - Project Metadata
23+
Project-level metadata for StudioWeb integration. Auto-generated and auto-updated by `uipath init`.
24+
25+
- [Spec](uiproj.spec.md) | [Schema](uiproj.schema.json)
26+
2227

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://cloud.uipath.com/draft/2024-12/uiproj",
4+
"title": "UiPath Project Configuration",
5+
"description": "Project-level metadata for UiPath coded automation projects, used by StudioWeb",
6+
"type": "object",
7+
"required": ["ProjectType", "Name", "MainFile"],
8+
"properties": {
9+
"ProjectType": {
10+
"type": "string",
11+
"description": "The type of project, determined from uipath.json entrypoints",
12+
"enum": ["Agent", "Function"]
13+
},
14+
"Name": {
15+
"type": "string",
16+
"description": "Project name, sourced from pyproject.toml [project].name"
17+
},
18+
"Description": {
19+
"type": ["string", "null"],
20+
"description": "Project description, sourced from pyproject.toml [project].description"
21+
},
22+
"MainFile": {
23+
"type": ["string", "null"],
24+
"description": "Main file path. Required by StudioWeb but not used for coded agents",
25+
"default": null
26+
}
27+
},
28+
"additionalProperties": false
29+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# UiPath Project Configuration Specification
2+
3+
## Overview
4+
5+
The `project.uiproj` file defines project-level metadata for UiPath coded projects. It is used by StudioWeb to identify the project type, name, and description. This file is auto-generated and auto-updated by `uipath init`.
6+
7+
**File Name:** `project.uiproj`
8+
9+
---
10+
11+
## File Structure
12+
13+
```json
14+
{
15+
"ProjectType": "Agent",
16+
"Name": "my-project",
17+
"Description": "Project description",
18+
"MainFile": null
19+
}
20+
```
21+
22+
---
23+
24+
## Properties
25+
26+
| Property | Type | Required | Description |
27+
|----------|------|----------|-------------|
28+
| `ProjectType` | `string` | Yes | The type of project: `"Agent"` or `"Function"` |
29+
| `Name` | `string` | Yes | Project name, taken from `pyproject.toml` `[project].name` |
30+
| `Description` | `string\|null` | No | Project description, taken from `pyproject.toml` `[project].description` |
31+
| `MainFile` | `string\|null` | Yes | Main file path. Required by StudioWeb but not used for coded agents; always `null` for coded projects |
32+
33+
---
34+
35+
## ProjectType
36+
37+
The `ProjectType` is determined automatically from the entrypoints defined in `uipath.json`:
38+
39+
- **`"Agent"`** — when all entrypoints are declared under the `"agents"` key
40+
- **`"Function"`** — when at least one entrypoint is declared under the `"functions"` key, or when no entrypoints exist
41+
42+
If `uipath.json` contains both `"agents"` and `"functions"` (mixed types), a warning is emitted and the type defaults to the first entrypoint's type.
43+
44+
If the project type changes between runs of `uipath init` (e.g., an existing `project.uiproj` has `"Agent"` but the current entrypoints are all functions), a warning is displayed.
45+
46+
---
47+
48+
## Lifecycle
49+
50+
- **Created by:** `uipath init` (when `project.uiproj` does not exist)
51+
- **Updated by:** `uipath init` (when `project.uiproj` already exists)
52+
- **Consumed by:** StudioWeb for project integration
53+
54+
---
55+
56+
## Complete Examples
57+
58+
### Agent Project
59+
60+
```json
61+
{
62+
"ProjectType": "Agent",
63+
"Name": "invoice-processor",
64+
"Description": "An agent that processes invoices using DU",
65+
"MainFile": null
66+
}
67+
```
68+
69+
### Function Project
70+
71+
```json
72+
{
73+
"ProjectType": "Function",
74+
"Name": "calculator",
75+
"Description": "A simple calculator function",
76+
"MainFile": null
77+
}
78+
```

packages/uipath/src/uipath/_cli/_push/sw_file_handler.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,14 @@ def get_author_from_token_or_toml() -> str:
443443
with open(local_metadata_file, "r") as f:
444444
metadata = json.load(f)
445445

446+
# ensure push-related fields are always present for cloud workspace
447+
# context: on initial init the CLI creates a minimal studio_metadata.json file
448+
# which does not contain lastPushAuthor and lastPushDate
449+
if "lastPushAuthor" not in metadata:
450+
metadata["lastPushAuthor"] = author
451+
if "lastPushDate" not in metadata:
452+
metadata["lastPushDate"] = datetime.now(timezone.utc).isoformat()
453+
446454
existing = remote_files.get(".uipath/studio_metadata.json")
447455
if existing:
448456
try:

0 commit comments

Comments
 (0)