uipath-claude-sdk 0.1.0__tar.gz

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.
Files changed (141) hide show
  1. uipath_claude_sdk-0.1.0/.gitignore +195 -0
  2. uipath_claude_sdk-0.1.0/.python-version +1 -0
  3. uipath_claude_sdk-0.1.0/CONTRIBUTING.md +52 -0
  4. uipath_claude_sdk-0.1.0/PKG-INFO +356 -0
  5. uipath_claude_sdk-0.1.0/README.md +332 -0
  6. uipath_claude_sdk-0.1.0/pyproject.toml +144 -0
  7. uipath_claude_sdk-0.1.0/samples/README.md +162 -0
  8. uipath_claude_sdk-0.1.0/samples/action-center-hitl-agent/.env.example +4 -0
  9. uipath_claude_sdk-0.1.0/samples/action-center-hitl-agent/README.md +128 -0
  10. uipath_claude_sdk-0.1.0/samples/action-center-hitl-agent/claude.json +5 -0
  11. uipath_claude_sdk-0.1.0/samples/action-center-hitl-agent/input.json +7 -0
  12. uipath_claude_sdk-0.1.0/samples/action-center-hitl-agent/main.py +103 -0
  13. uipath_claude_sdk-0.1.0/samples/action-center-hitl-agent/pyproject.toml +15 -0
  14. uipath_claude_sdk-0.1.0/samples/action-center-hitl-agent/uipath.json +1 -0
  15. uipath_claude_sdk-0.1.0/samples/autonomous-agent/README.md +17 -0
  16. uipath_claude_sdk-0.1.0/samples/autonomous-agent/claude.json +5 -0
  17. uipath_claude_sdk-0.1.0/samples/autonomous-agent/main.py +29 -0
  18. uipath_claude_sdk-0.1.0/samples/autonomous-agent/pyproject.toml +17 -0
  19. uipath_claude_sdk-0.1.0/samples/autonomous-agent/uipath.json +11 -0
  20. uipath_claude_sdk-0.1.0/samples/chat-agent/.env.example +4 -0
  21. uipath_claude_sdk-0.1.0/samples/chat-agent/README.md +179 -0
  22. uipath_claude_sdk-0.1.0/samples/chat-agent/claude.json +5 -0
  23. uipath_claude_sdk-0.1.0/samples/chat-agent/input.json +15 -0
  24. uipath_claude_sdk-0.1.0/samples/chat-agent/main.py +57 -0
  25. uipath_claude_sdk-0.1.0/samples/chat-agent/next_message.json +15 -0
  26. uipath_claude_sdk-0.1.0/samples/chat-agent/pyproject.toml +16 -0
  27. uipath_claude_sdk-0.1.0/samples/chat-agent/uipath.json +6 -0
  28. uipath_claude_sdk-0.1.0/samples/integration-event-agent/.env.example +4 -0
  29. uipath_claude_sdk-0.1.0/samples/integration-event-agent/README.md +126 -0
  30. uipath_claude_sdk-0.1.0/samples/integration-event-agent/claude.json +5 -0
  31. uipath_claude_sdk-0.1.0/samples/integration-event-agent/input.json +3 -0
  32. uipath_claude_sdk-0.1.0/samples/integration-event-agent/main.py +80 -0
  33. uipath_claude_sdk-0.1.0/samples/integration-event-agent/pyproject.toml +15 -0
  34. uipath_claude_sdk-0.1.0/samples/integration-event-agent/uipath.json +1 -0
  35. uipath_claude_sdk-0.1.0/samples/multi-agent/.env.example +4 -0
  36. uipath_claude_sdk-0.1.0/samples/multi-agent/README.md +118 -0
  37. uipath_claude_sdk-0.1.0/samples/multi-agent/agent.mermaid +11 -0
  38. uipath_claude_sdk-0.1.0/samples/multi-agent/claude.json +5 -0
  39. uipath_claude_sdk-0.1.0/samples/multi-agent/input.json +3 -0
  40. uipath_claude_sdk-0.1.0/samples/multi-agent/main.py +70 -0
  41. uipath_claude_sdk-0.1.0/samples/multi-agent/project.uiproj +6 -0
  42. uipath_claude_sdk-0.1.0/samples/multi-agent/pyproject.toml +15 -0
  43. uipath_claude_sdk-0.1.0/samples/multi-agent/uipath.json +3 -0
  44. uipath_claude_sdk-0.1.0/samples/quickstart-agent/.env.example +4 -0
  45. uipath_claude_sdk-0.1.0/samples/quickstart-agent/README.md +69 -0
  46. uipath_claude_sdk-0.1.0/samples/quickstart-agent/agent.mermaid +11 -0
  47. uipath_claude_sdk-0.1.0/samples/quickstart-agent/claude.json +5 -0
  48. uipath_claude_sdk-0.1.0/samples/quickstart-agent/input.json +5 -0
  49. uipath_claude_sdk-0.1.0/samples/quickstart-agent/main.py +63 -0
  50. uipath_claude_sdk-0.1.0/samples/quickstart-agent/project.uiproj +6 -0
  51. uipath_claude_sdk-0.1.0/samples/quickstart-agent/pyproject.toml +15 -0
  52. uipath_claude_sdk-0.1.0/samples/quickstart-agent/uipath.json +3 -0
  53. uipath_claude_sdk-0.1.0/samples/simple-hitl-agent/.env.example +4 -0
  54. uipath_claude_sdk-0.1.0/samples/simple-hitl-agent/README.md +98 -0
  55. uipath_claude_sdk-0.1.0/samples/simple-hitl-agent/claude.json +5 -0
  56. uipath_claude_sdk-0.1.0/samples/simple-hitl-agent/input.json +5 -0
  57. uipath_claude_sdk-0.1.0/samples/simple-hitl-agent/main.py +80 -0
  58. uipath_claude_sdk-0.1.0/samples/simple-hitl-agent/pyproject.toml +15 -0
  59. uipath_claude_sdk-0.1.0/samples/simple-hitl-agent/uipath.json +1 -0
  60. uipath_claude_sdk-0.1.0/samples/simple-local-mcp-agent/.env.example +4 -0
  61. uipath_claude_sdk-0.1.0/samples/simple-local-mcp-agent/README.md +105 -0
  62. uipath_claude_sdk-0.1.0/samples/simple-local-mcp-agent/claude.json +5 -0
  63. uipath_claude_sdk-0.1.0/samples/simple-local-mcp-agent/input.json +9 -0
  64. uipath_claude_sdk-0.1.0/samples/simple-local-mcp-agent/ledger_server.py +43 -0
  65. uipath_claude_sdk-0.1.0/samples/simple-local-mcp-agent/main.py +50 -0
  66. uipath_claude_sdk-0.1.0/samples/simple-local-mcp-agent/pyproject.toml +15 -0
  67. uipath_claude_sdk-0.1.0/samples/simple-local-mcp-agent/uipath.json +1 -0
  68. uipath_claude_sdk-0.1.0/samples/simple-remote-mcp-agent/.env.example +5 -0
  69. uipath_claude_sdk-0.1.0/samples/simple-remote-mcp-agent/README.md +95 -0
  70. uipath_claude_sdk-0.1.0/samples/simple-remote-mcp-agent/claude.json +5 -0
  71. uipath_claude_sdk-0.1.0/samples/simple-remote-mcp-agent/input.json +3 -0
  72. uipath_claude_sdk-0.1.0/samples/simple-remote-mcp-agent/main.py +46 -0
  73. uipath_claude_sdk-0.1.0/samples/simple-remote-mcp-agent/pyproject.toml +15 -0
  74. uipath_claude_sdk-0.1.0/samples/simple-remote-mcp-agent/uipath.json +1 -0
  75. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/__init__.py +47 -0
  76. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/_cli/__init__.py +0 -0
  77. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/_cli/_templates/claude.json.template +5 -0
  78. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/_cli/_templates/main.py.template +65 -0
  79. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/_cli/cli_new.py +72 -0
  80. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/agent.py +51 -0
  81. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/interrupts.py +625 -0
  82. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/mcp.py +176 -0
  83. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/middlewares.py +8 -0
  84. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/models.py +33 -0
  85. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/__init__.py +35 -0
  86. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/_telemetry.py +341 -0
  87. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/config.py +53 -0
  88. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/conversational_runtime.py +330 -0
  89. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/errors.py +59 -0
  90. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/factory.py +444 -0
  91. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/gateway/__init__.py +211 -0
  92. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/gateway/catalog.py +274 -0
  93. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/gateway/env.py +52 -0
  94. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/gateway/errors.py +188 -0
  95. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/gateway/records.py +161 -0
  96. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/gateway/router.py +403 -0
  97. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/gateway/strategies.py +225 -0
  98. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/gateway/upstream.py +90 -0
  99. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/loader.py +167 -0
  100. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/runtime.py +963 -0
  101. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/schema.py +237 -0
  102. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/session_paths.py +164 -0
  103. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/session_store.py +226 -0
  104. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/storage.py +110 -0
  105. uipath_claude_sdk-0.1.0/src/uipath_claude_sdk/runtime/suspend.py +123 -0
  106. uipath_claude_sdk-0.1.0/template/README.md +112 -0
  107. uipath_claude_sdk-0.1.0/template/agent.mermaid +11 -0
  108. uipath_claude_sdk-0.1.0/template/bindings.json +4 -0
  109. uipath_claude_sdk-0.1.0/template/claude.json +5 -0
  110. uipath_claude_sdk-0.1.0/template/entry-points.json +116 -0
  111. uipath_claude_sdk-0.1.0/template/evaluations/eval-sets/evaluation-set-default.json +33 -0
  112. uipath_claude_sdk-0.1.0/template/evaluations/evaluators/llm-judge-output.json +20 -0
  113. uipath_claude_sdk-0.1.0/template/evaluations/evaluators/tool-call-arguments.json +24 -0
  114. uipath_claude_sdk-0.1.0/template/evaluations/evaluators/tool-call-count.json +21 -0
  115. uipath_claude_sdk-0.1.0/template/evaluations/evaluators/tool-call-order.json +18 -0
  116. uipath_claude_sdk-0.1.0/template/input.json +3 -0
  117. uipath_claude_sdk-0.1.0/template/main.py +65 -0
  118. uipath_claude_sdk-0.1.0/template/project.uiproj +6 -0
  119. uipath_claude_sdk-0.1.0/template/pyproject.toml +14 -0
  120. uipath_claude_sdk-0.1.0/template/uipath.json +15 -0
  121. uipath_claude_sdk-0.1.0/tests/__init__.py +0 -0
  122. uipath_claude_sdk-0.1.0/tests/conftest.py +164 -0
  123. uipath_claude_sdk-0.1.0/tests/test_background_tasks_live.py +105 -0
  124. uipath_claude_sdk-0.1.0/tests/test_cli_contract.py +94 -0
  125. uipath_claude_sdk-0.1.0/tests/test_cli_new.py +82 -0
  126. uipath_claude_sdk-0.1.0/tests/test_config_and_loader.py +85 -0
  127. uipath_claude_sdk-0.1.0/tests/test_conversational.py +354 -0
  128. uipath_claude_sdk-0.1.0/tests/test_debug.py +242 -0
  129. uipath_claude_sdk-0.1.0/tests/test_defer_contract.py +581 -0
  130. uipath_claude_sdk-0.1.0/tests/test_factory.py +142 -0
  131. uipath_claude_sdk-0.1.0/tests/test_gateway.py +568 -0
  132. uipath_claude_sdk-0.1.0/tests/test_instrumentation.py +244 -0
  133. uipath_claude_sdk-0.1.0/tests/test_interrupt_tools.py +460 -0
  134. uipath_claude_sdk-0.1.0/tests/test_mcp.py +198 -0
  135. uipath_claude_sdk-0.1.0/tests/test_resume_payload_shapes.py +136 -0
  136. uipath_claude_sdk-0.1.0/tests/test_runtime.py +299 -0
  137. uipath_claude_sdk-0.1.0/tests/test_schema.py +106 -0
  138. uipath_claude_sdk-0.1.0/tests/test_session_store_records.py +157 -0
  139. uipath_claude_sdk-0.1.0/tests/test_suspend_resume.py +397 -0
  140. uipath_claude_sdk-0.1.0/tests/test_telemetry.py +739 -0
  141. uipath_claude_sdk-0.1.0/uv.lock +2797 -0
@@ -0,0 +1,195 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ .idea/
169
+
170
+ # Ruff stuff:
171
+ .ruff_cache/
172
+
173
+ # PyPI configuration file
174
+ .pypirc
175
+
176
+ **/uipath.db
177
+ **/.uipath
178
+ **/**.nupkg
179
+ **/__uipath/
180
+ .claude/settings.local.json
181
+
182
+ .vscode/
183
+
184
+ playground.py
185
+
186
+ # Samples generated files
187
+ **/samples/**/.agent/
188
+ **/samples/**/.claude/
189
+ **/samples/**/.vscode/
190
+ **/samples/**/AGENTS.md
191
+ **/samples/**/CLAUDE.md
192
+ **/samples/**/bindings.json
193
+ **/samples/**/entry-points.json
194
+ **/samples/**/uv.lock
195
+ **/**/.claude/settings.local.json
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,52 @@
1
+ # Contributing to UiPath Claude Agent SDK
2
+
3
+ ## Local Development Setup
4
+
5
+ ### Prerequisites
6
+
7
+ 1. **Install Python 3.11 or later**:
8
+ - Download and install Python from the official [Python website](https://www.python.org/downloads/)
9
+ - Verify the installation by running:
10
+ ```sh
11
+ python3.11 --version
12
+ ```
13
+
14
+ Alternative: [mise](https://mise.jdx.dev/lang/python.html)
15
+
16
+ The package is pinned to 3.11 through `.python-version` and is tested on 3.11, 3.12 and 3.13.
17
+
18
+ 2. **Install [uv](https://docs.astral.sh/uv/)**:
19
+ ```sh
20
+ pip install uv
21
+ ```
22
+
23
+ 3. **Create a virtual environment in the current working directory**:
24
+ ```sh
25
+ uv venv
26
+ ```
27
+
28
+ 4. **Install dependencies**:
29
+ ```sh
30
+ uv sync --all-extras
31
+ ```
32
+
33
+ ### Checks
34
+
35
+ Run these from `packages/uipath-claude-sdk`. They are the same commands CI runs:
36
+
37
+ ```sh
38
+ uv run mypy --config-file pyproject.toml .
39
+ uv run ruff check .
40
+ uv run ruff format --check .
41
+ uv run pytest
42
+ ```
43
+
44
+ `uv run ruff format .` rewrites the files in place instead of only reporting.
45
+
46
+ ### Use SDK Locally
47
+ 1. Create a folder on your own device `mkdir project; cd project`
48
+ 2. Initialize the python project `uv` `uv init . --python 3.11`
49
+ 3. Obtain the project path `PATH_TO_SDK=/Users/YOUR_USER/uipath-integrations-python/packages/uipath-claude-sdk/`
50
+ 4. Install the sdk in editable mode `uv add --editable ${PATH_TO_SDK}`
51
+
52
+ :information_source: Instead of cloning the project into `.venv/lib/python3.11/site-packages/uipath-claude-sdk`, this mode creates a file named `_uipath-claude-sdk.pth` inside `.venv/lib/python3.11/site-packages`. That file contains the value of `PATH_TO_SDK`, which is added to `sys.path`, the list of directories where python searches for packages. (Run `python -c 'import sys; print(sys.path)'` to see the entries.)
@@ -0,0 +1,356 @@
1
+ Metadata-Version: 2.4
2
+ Name: uipath-claude-sdk
3
+ Version: 0.1.0
4
+ Summary: Python SDK that enables developers to build and deploy Claude Agent SDK agents to the UiPath Cloud Platform
5
+ Project-URL: Homepage, https://uipath.com
6
+ Project-URL: Repository, https://github.com/UiPath/uipath-integrations-python
7
+ Maintainer-email: Radu Mocanu <radu.mocanu@uipath.com>
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Topic :: Software Development :: Build Tools
13
+ Requires-Python: >=3.11
14
+ Requires-Dist: aiohttp>=3.9.0
15
+ Requires-Dist: aiosqlite>=0.19.0
16
+ Requires-Dist: botocore>=1.34.0
17
+ Requires-Dist: claude-agent-sdk<0.3.0,>=0.2.132
18
+ Requires-Dist: httpx>=0.27.0
19
+ Requires-Dist: openinference-instrumentation-claude-agent-sdk<0.2.0,>=0.1.9
20
+ Requires-Dist: uipath-llm-client<1.18.0,>=1.17.1
21
+ Requires-Dist: uipath-runtime<0.14.0,>=0.13.0
22
+ Requires-Dist: uipath<2.15.0,>=2.14.0
23
+ Description-Content-Type: text/markdown
24
+
25
+ # UiPath Claude Agent SDK
26
+
27
+ A Python SDK that enables developers to build and deploy [Claude Agent SDK](https://docs.claude.com/en/api/agent-sdk/overview) agents to the UiPath Cloud Platform.
28
+
29
+ You define an agent in Python, point a `claude.json` file at it, and the UiPath runtime discovers it, generates its entry points, and executes it. Routing model calls through the UiPath LLM Gateway is an explicit opt-in, described under [Model routing](#model-routing).
30
+
31
+ This package is an extension to the [UiPath Python SDK](https://github.com/UiPath/uipath-python) and implements the [UiPath Runtime Protocol](https://github.com/UiPath/uipath-runtime-python).
32
+
33
+ Check out these [sample projects](https://github.com/UiPath/uipath-integrations-python/tree/main/packages/uipath-claude-sdk/samples) to see the SDK in action.
34
+
35
+ ## Requirements
36
+
37
+ - Python 3.11 or higher
38
+ - UiPath Automation Cloud account
39
+
40
+ ## Installation
41
+
42
+ ```bash
43
+ pip install uipath-claude-sdk
44
+ ```
45
+
46
+ using `uv`:
47
+
48
+ ```bash
49
+ uv add uipath-claude-sdk
50
+ ```
51
+
52
+ ## Quickstart
53
+
54
+ ```bash
55
+ uipath auth # authenticate against UiPath
56
+ uipath new my-agent # scaffold main.py, claude.json and pyproject.toml
57
+ uipath init # generate uipath.json, entry-points.json, bindings.json and agent.mermaid
58
+ uipath run agent '{"city": "London"}'
59
+ ```
60
+
61
+ `uipath new` writes into the current directory. The scaffolded agent is a weather agent with typed input and output, and its only input field is `city`, which is why the run command above passes `{"city": "London"}`:
62
+
63
+ ```python
64
+ from claude_agent_sdk import ClaudeAgentOptions, create_sdk_mcp_server, tool
65
+ from pydantic import BaseModel, Field
66
+
67
+ from uipath_claude_sdk import UiPathClaudeAgent, UiPathModel
68
+
69
+
70
+ @tool(
71
+ "get_weather",
72
+ "Get the current weather reading for a city, e.g. London.",
73
+ {"city": str},
74
+ )
75
+ async def get_weather(args: dict) -> dict:
76
+ ...
77
+
78
+
79
+ weather_server = create_sdk_mcp_server(
80
+ name="weather",
81
+ tools=[get_weather],
82
+ )
83
+
84
+
85
+ class WeatherRequest(BaseModel):
86
+ city: str = Field(description="City to report the weather for, e.g. 'London'.")
87
+
88
+
89
+ class WeatherReport(BaseModel):
90
+ city: str = Field(description="City the reading refers to.")
91
+ temperature_celsius: float = Field(description="Temperature returned by the tool.")
92
+ summary: str = Field(description="One sentence description of the weather.")
93
+
94
+
95
+ agent = UiPathClaudeAgent(
96
+ options=ClaudeAgentOptions(
97
+ system_prompt=(
98
+ "You are a weather assistant. "
99
+ "Always call the get_weather tool before answering, and report only "
100
+ "the values it returns."
101
+ ),
102
+ max_turns=10,
103
+ permission_mode="bypassPermissions",
104
+ tools=[],
105
+ mcp_servers={"weather": weather_server},
106
+ ),
107
+ uipath_llm=UiPathModel("claude-sonnet-4-5"),
108
+ input_schema=WeatherRequest,
109
+ output_schema=WeatherReport,
110
+ prompt="Report the current weather in {city}.",
111
+ )
112
+ ```
113
+
114
+ The `get_weather` tool is defined with `@tool` and served in process through `create_sdk_mcp_server`, which is how you attach custom Python tools to an agent without running an external MCP process.
115
+
116
+ Anything the Claude Agent SDK accepts on `ClaudeAgentOptions` (system prompt, allowed tools, MCP servers, `output_format`, ...) is yours to set. The runtime only injects execution-scoped fields (`cwd`, `env`, `resume`, `model` when `uipath_llm` is set, and `output_format` when an `output_schema` is declared) and leaves the rest of your configuration untouched.
117
+
118
+ An agent is what its code says. No tools, no MCP servers and no prompt text are added on your behalf, so an agent written for the Claude Agent SDK runs on UiPath unchanged, and an agent written here runs anywhere else. Everything UiPath-specific, model routing and human in the loop alike, is an explicit opt-in.
119
+
120
+ ## The agent definition
121
+
122
+ `UiPathClaudeAgent` wraps the SDK options with the pieces the UiPath runtime needs:
123
+
124
+ | Field | Purpose |
125
+ |-------|---------|
126
+ | `options` | The `ClaudeAgentOptions` passed to the Claude Agent SDK |
127
+ | `uipath_llm` | Optional `UiPathModel`. Set it to route model calls through the UiPath LLM Gateway. Left unset, the Claude Agent SDK reaches Anthropic on its own credentials |
128
+ | `input_schema` | Optional Pydantic model. Input is validated against it before the run |
129
+ | `output_schema` | Optional Pydantic model. The runtime requests native structured output and validates the result against it |
130
+ | `prompt` | Optional user-message template rendered with `str.format` from the validated input, for example `"Report the current weather in {city}"` |
131
+ | `name` | Display name used in the runtime graph |
132
+
133
+ `ClaudeAgent` is kept as an alias of `UiPathClaudeAgent`, so existing agents keep working unchanged.
134
+
135
+ The schemas are what `uipath init` writes into `entry-points.json`, so they also drive the input and output contract shown in the UiPath platform.
136
+
137
+ Exporting a bare `ClaudeAgentOptions` also works. The loader wraps it in a `UiPathClaudeAgent` with defaults, in which case the entry point falls back to a single `input` string in and a single `result` string out, unless you set `options.output_format` yourself. An agent exported this way has no `uipath_llm`, so it runs on the direct Anthropic path.
138
+
139
+ ## Model routing
140
+
141
+ `uipath_llm` decides where model traffic goes. There is no automatic fallback between the two paths.
142
+
143
+ ### With `uipath_llm` set
144
+
145
+ ```python
146
+ from uipath_claude_sdk import UiPathClaudeAgent, UiPathModel
147
+
148
+ agent = UiPathClaudeAgent(
149
+ options=ClaudeAgentOptions(system_prompt="..."),
150
+ uipath_llm=UiPathModel("claude-sonnet-4-5"),
151
+ )
152
+ ```
153
+
154
+ `UiPathModel` is a routing descriptor, not a client. It holds no connection, opens no socket and is not callable. It records which model to use and how to route to it, and the runtime reads it when it builds the environment for the Claude Agent SDK subprocess.
155
+
156
+ On this path the runtime starts a local gateway shim, binds a loopback listener, and injects `ANTHROPIC_BASE_URL` and a per-run secret so the SDK talks to the shim instead of Anthropic. The shim forwards every call to your tenant, which is why this path needs `UIPATH_URL` and `UIPATH_ACCESS_TOKEN` (see [Environment variables](#environment-variables)).
157
+
158
+ Write a plain model id. The shim resolves it against the tenant's model discovery, so you do not need to know the id the tenant actually serves. It matches, in order:
159
+
160
+ - the exact name discovery reported
161
+ - its lowercase form
162
+ - the same name with an `anthropic.` prefix stripped
163
+ - the same name with a `-YYYYMMDD-vN:N` version suffix or an `@version` suffix stripped
164
+ - the family words `opus`, `sonnet` and `haiku`, which resolve to the newest matching model
165
+
166
+ `options.model` is overwritten with the resolved id on this path, so setting it alongside `uipath_llm` has no effect. The auxiliary models the Claude Code CLI picks for background work are pinned to catalog-resolved ids too, so no traffic escapes to a default model name the tenant does not host.
167
+
168
+ `UiPathModel` takes the model name and nothing else. How to reach that model is discovery's to report, not yours to declare, which is what keeps a name that works in `uipath-langchain` working here.
169
+
170
+ ### Without `uipath_llm`
171
+
172
+ No shim starts and no LLM environment is injected. The Claude Agent SDK reaches Anthropic on whatever credentials it finds for itself, so set `ANTHROPIC_API_KEY` and put a plain Anthropic model id on the options:
173
+
174
+ ```python
175
+ agent = UiPathClaudeAgent(
176
+ options=ClaudeAgentOptions(model="claude-sonnet-4-5", system_prompt="..."),
177
+ )
178
+ ```
179
+
180
+ Usage on this path is billed to your Anthropic account.
181
+
182
+ ## Human in the loop
183
+
184
+ Suspending a run is opt-in and lives in your own tools. Nothing is injected: an agent that never calls `interrupt()` has no UiPath surface at all.
185
+
186
+ Write an ordinary SDK tool, call `interrupt()` inside it with a model imported from `uipath.platform.common`, and register the tool through `uipath_tool_server`:
187
+
188
+ ```python
189
+ from typing import Any
190
+
191
+ from claude_agent_sdk import ClaudeAgentOptions, tool
192
+ from uipath.platform.common import CreateTask
193
+
194
+ from uipath_claude_sdk import UiPathClaudeAgent, interrupt, uipath_tool_server
195
+
196
+
197
+ @tool(
198
+ "review_classification",
199
+ "Get a human to review the classification.",
200
+ {"ticket_id": str, "label": str},
201
+ )
202
+ async def review_classification(args: dict[str, Any]) -> dict[str, Any]:
203
+ action_data = await interrupt(
204
+ CreateTask(
205
+ app_name="escalation_agent_app",
206
+ title="Action Required: Review classification",
207
+ data={"AgentOutput": f"Classified {args['ticket_id']} as {args['label']}"},
208
+ app_folder_path="Shared",
209
+ )
210
+ )
211
+ approved = action_data.get("Answer") is True
212
+ return {"content": [{"type": "text", "text": f"Approved: {approved}"}]}
213
+
214
+
215
+ tickets_server = uipath_tool_server("tickets", tools=[review_classification])
216
+
217
+ agent = UiPathClaudeAgent(
218
+ options=ClaudeAgentOptions(mcp_servers={"tickets": tickets_server}),
219
+ )
220
+ ```
221
+
222
+ `uipath_tool_server` returns a plain `McpSdkServerConfig`. Register it under whatever key you like, and the model sees the tools as `mcp__<key>__<tool-name>`. Tools that never suspend belong in a normal `create_sdk_mcp_server`.
223
+
224
+ ### The value decides the trigger
225
+
226
+ Whatever you pass to `interrupt()` reaches the platform untouched, and the platform picks the resume trigger from its type:
227
+
228
+ | Value | Resume trigger |
229
+ |-------|----------------|
230
+ | `CreateTask`, `WaitTask`, `CreateEscalation`, `WaitEscalation` | Action Center task |
231
+ | `InvokeProcess`, `WaitJob` | Orchestrator job |
232
+ | `WaitIntegrationEvent` | Integration Services event |
233
+ | `WaitUntil` | Timer |
234
+ | Anything else, including a plain string | API trigger, answered by the resume input |
235
+
236
+ A list or tuple becomes sibling triggers under one interrupt, resolved by whichever fires first. Every current and future model in `uipath.platform.common` works without any change in this package.
237
+
238
+ `interrupt()` returns whatever the fired trigger carried back: the completed action's data, the finished job's output, the delivered event's payload, or the JSON passed to `uipath run agent ... --resume`. Mapping that onto the result the model reads is your tool's job.
239
+
240
+ ### The tool body runs twice
241
+
242
+ A tool handler cannot pause across a process boundary, so the body is executed by a `PreToolUse` hook instead. On the suspend pass `interrupt()` raises, the hook parks the call and the run reports SUSPENDED. On resume the same body runs again in a fresh process, `interrupt()` returns the resolved payload, and the body's return value is delivered as the parked call's tool result.
243
+
244
+ This is the same replay a LangGraph node does, with the same caveat: **work performed before the `interrupt()` call happens twice.** Keep side effects after the call, or make them idempotent.
245
+
246
+ Two further constraints, both measured against the Claude Code CLI:
247
+
248
+ - Only one interrupt can be in flight per run. A second suspending call while one is pending is denied and the model is told to retry it on its own.
249
+ - A suspending tool call must be the last tool call of its turn. Say so in the system prompt.
250
+
251
+ Outside a UiPath run the tools simply execute their bodies, and `interrupt()` raises `InterruptOutsideRunError`.
252
+
253
+ ## Configuration
254
+
255
+ ### claude.json
256
+
257
+ `claude.json` maps an entry-point name to the module attribute holding the agent definition, in `file.py:variable` form:
258
+
259
+ ```json
260
+ {
261
+ "agents": {
262
+ "agent": "main.py:agent"
263
+ }
264
+ }
265
+ ```
266
+
267
+ Every key under `agents` becomes an entry point, so a project can expose several agents from one package:
268
+
269
+ ```json
270
+ {
271
+ "agents": {
272
+ "researcher": "research.py:agent",
273
+ "reviewer": "review.py:agent"
274
+ }
275
+ }
276
+ ```
277
+
278
+ `uipath init` reads this file and produces the `uipath.json`, `entry-points.json` and `bindings.json` that packaging and deployment need. For more details on the configuration format, see the [UiPath configuration specifications](https://github.com/UiPath/uipath-python/blob/main/specs/README.md).
279
+
280
+ ### Environment variables
281
+
282
+ `uipath auth` writes the UiPath credentials into a `.env` file in your project root:
283
+
284
+ ```
285
+ UIPATH_URL=https://cloud.uipath.com/ACCOUNT_NAME/TENANT_NAME
286
+ UIPATH_ACCESS_TOKEN=YOUR_TOKEN_HERE
287
+ UIPATH_TENANT_ID=YOUR_TENANT_ID
288
+ UIPATH_ORGANIZATION_ID=YOUR_ORGANIZATION_ID
289
+ ```
290
+
291
+ An agent that declares `uipath_llm` uses those credentials to resolve its model and to route every call. An agent without `uipath_llm` needs `ANTHROPIC_API_KEY` instead for model access, and still needs the UiPath credentials to publish.
292
+
293
+ ### Conversational agents
294
+
295
+ Set `runtimeOptions.isConversational` in `uipath.json` to run the agent as a multi-turn chat agent:
296
+
297
+ ```json
298
+ {
299
+ "runtimeOptions": {
300
+ "isConversational": true
301
+ }
302
+ }
303
+ ```
304
+
305
+ The conversational runtime handles one exchange per invocation. It streams the assistant response as UiPath conversation message events, then suspends with an API resume trigger to wait for the next user message. The Claude session id is persisted so the SDK re-attaches to the same session, and a stable per-conversation workspace directory keeps files written by the agent across exchanges. Input and output then use the UiPath conversation message format rather than the agent's own input and output schemas.
306
+
307
+ ## Command line interface
308
+
309
+ The `uipath` CLI commands all work against a Claude SDK project:
310
+
311
+ | Command | Purpose |
312
+ |---------|---------|
313
+ | `uipath auth` | Authenticate and populate `.env` |
314
+ | `uipath new NAME` | Scaffold a new Claude SDK agent project in the current directory |
315
+ | `uipath init` | Generate `uipath.json`, `entry-points.json`, `bindings.json` and the mermaid graph from `claude.json` |
316
+ | `uipath run AGENT [INPUT]` | Execute an agent locally with JSON input, inline or with `-f/--file` |
317
+ | `uipath pack` | Package the project into a `.nupkg` |
318
+ | `uipath publish` | Publish the package to Orchestrator |
319
+
320
+ `uipath pack` requires a `description` field and author information in `pyproject.toml`.
321
+
322
+ ## Project structure
323
+
324
+ To use the CLI for packaging and publishing, your project should include:
325
+
326
+ - A `pyproject.toml` file with project metadata
327
+ - A `claude.json` file with your agent definitions (for example `"agents": {"agent": "main.py:agent"}`)
328
+ - A `uipath.json` file (generated by `uipath init`)
329
+ - An `entry-points.json` file (generated by `uipath init`)
330
+ - A `bindings.json` file (generated by `uipath init`) to configure resource overrides
331
+ - Any Python files needed for your agent
332
+
333
+ ## Not yet supported
334
+
335
+ These are not implemented in this package today. Do not rely on them yet.
336
+
337
+ - Tool approval. A tool call is never routed to a human for permission. What is supported is the developer-driven suspension described under [Human in the loop](#human-in-the-loop)
338
+ - Evaluations
339
+ - Interactive debugging
340
+
341
+ ## Development
342
+
343
+ ### Developer tools
344
+
345
+ Check out [uipath-dev](https://github.com/uipath/uipath-dev-python), an interactive application for building, testing, and debugging UiPath Python runtimes, agents, and automation scripts.
346
+
347
+ ### Setting up a development environment
348
+
349
+ Please read our [contribution guidelines](https://github.com/UiPath/uipath-integrations-python/blob/main/packages/uipath-claude-sdk/CONTRIBUTING.md) before submitting a pull request.
350
+
351
+ ### Special thanks
352
+
353
+ A huge thank-you to the open-source community and the maintainers of the libraries that make this project possible:
354
+
355
+ - [Claude Agent SDK](https://github.com/anthropics/claude-agent-sdk-python) for the agent harness this package builds on.
356
+ - [Pydantic](https://github.com/pydantic/pydantic) for reliable, typed configuration and validation.