roboz 0.1.2.dev2__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 (65) hide show
  1. roboz-0.1.2.dev2/.gitignore +50 -0
  2. roboz-0.1.2.dev2/CHANGELOG.md +68 -0
  3. roboz-0.1.2.dev2/LICENSE +201 -0
  4. roboz-0.1.2.dev2/PKG-INFO +215 -0
  5. roboz-0.1.2.dev2/README.md +184 -0
  6. roboz-0.1.2.dev2/pyproject.toml +87 -0
  7. roboz-0.1.2.dev2/src/roboz/__init__.py +91 -0
  8. roboz-0.1.2.dev2/src/roboz/_naming.py +19 -0
  9. roboz-0.1.2.dev2/src/roboz/agent/__init__.py +21 -0
  10. roboz-0.1.2.dev2/src/roboz/agent/_execution_context.py +53 -0
  11. roboz-0.1.2.dev2/src/roboz/agent/_identifiers.py +15 -0
  12. roboz-0.1.2.dev2/src/roboz/agent/_notifications.py +25 -0
  13. roboz-0.1.2.dev2/src/roboz/agent/_prompts.py +154 -0
  14. roboz-0.1.2.dev2/src/roboz/agent/_tool_observer.py +159 -0
  15. roboz-0.1.2.dev2/src/roboz/agent/background_agent.py +157 -0
  16. roboz-0.1.2.dev2/src/roboz/agent/core.py +769 -0
  17. roboz-0.1.2.dev2/src/roboz/agent/prompt_agent_tool.py +37 -0
  18. roboz-0.1.2.dev2/src/roboz/agent/subagent.py +28 -0
  19. roboz-0.1.2.dev2/src/roboz/dependencies.py +297 -0
  20. roboz-0.1.2.dev2/src/roboz/deployment.py +151 -0
  21. roboz-0.1.2.dev2/src/roboz/exceptions.py +115 -0
  22. roboz-0.1.2.dev2/src/roboz/llm/__init__.py +56 -0
  23. roboz-0.1.2.dev2/src/roboz/llm/_diagnostics.py +521 -0
  24. roboz-0.1.2.dev2/src/roboz/llm/_retry.py +118 -0
  25. roboz-0.1.2.dev2/src/roboz/llm/_truncation.py +125 -0
  26. roboz-0.1.2.dev2/src/roboz/llm/binding.py +150 -0
  27. roboz-0.1.2.dev2/src/roboz/llm/calls.py +760 -0
  28. roboz-0.1.2.dev2/src/roboz/llm/completion.py +246 -0
  29. roboz-0.1.2.dev2/src/roboz/llm/endpoints.py +296 -0
  30. roboz-0.1.2.dev2/src/roboz/llm/openrouter.py +107 -0
  31. roboz-0.1.2.dev2/src/roboz/llm/prompts.py +79 -0
  32. roboz-0.1.2.dev2/src/roboz/models/__init__.py +61 -0
  33. roboz-0.1.2.dev2/src/roboz/models/_schema.py +82 -0
  34. roboz-0.1.2.dev2/src/roboz/models/_serialization.py +60 -0
  35. roboz-0.1.2.dev2/src/roboz/models/_telemetry.py +26 -0
  36. roboz-0.1.2.dev2/src/roboz/models/core.py +155 -0
  37. roboz-0.1.2.dev2/src/roboz/models/truncation.py +68 -0
  38. roboz-0.1.2.dev2/src/roboz/py.typed +1 -0
  39. roboz-0.1.2.dev2/src/roboz/runtime/__init__.py +82 -0
  40. roboz-0.1.2.dev2/src/roboz/runtime/_environment.py +19 -0
  41. roboz-0.1.2.dev2/src/roboz/runtime/_external.py +340 -0
  42. roboz-0.1.2.dev2/src/roboz/runtime/_logging.py +87 -0
  43. roboz-0.1.2.dev2/src/roboz/runtime/_paths.py +60 -0
  44. roboz-0.1.2.dev2/src/roboz/runtime/events.py +84 -0
  45. roboz-0.1.2.dev2/src/roboz/runtime/io.py +108 -0
  46. roboz-0.1.2.dev2/src/roboz/runtime/observability.py +108 -0
  47. roboz-0.1.2.dev2/src/roboz/runtime/persistence/__init__.py +39 -0
  48. roboz-0.1.2.dev2/src/roboz/runtime/persistence/activity.py +106 -0
  49. roboz-0.1.2.dev2/src/roboz/runtime/persistence/schema.py +155 -0
  50. roboz-0.1.2.dev2/src/roboz/runtime/pipe.py +384 -0
  51. roboz-0.1.2.dev2/src/roboz/runtime/sinks.py +277 -0
  52. roboz-0.1.2.dev2/src/roboz/skill/__init__.py +5 -0
  53. roboz-0.1.2.dev2/src/roboz/skill/_prompts.py +50 -0
  54. roboz-0.1.2.dev2/src/roboz/skill/core.py +140 -0
  55. roboz-0.1.2.dev2/src/roboz/tooling/__init__.py +6 -0
  56. roboz-0.1.2.dev2/src/roboz/tooling/_prompts.py +124 -0
  57. roboz-0.1.2.dev2/src/roboz/tooling/_protocols.py +61 -0
  58. roboz-0.1.2.dev2/src/roboz/tooling/_typing.py +20 -0
  59. roboz-0.1.2.dev2/src/roboz/tooling/context.py +101 -0
  60. roboz-0.1.2.dev2/src/roboz/tooling/core.py +289 -0
  61. roboz-0.1.2.dev2/src/roboz/tooling/decorators.py +236 -0
  62. roboz-0.1.2.dev2/src/roboz/tools/__init__.py +20 -0
  63. roboz-0.1.2.dev2/src/roboz/tools/_identifiers.py +8 -0
  64. roboz-0.1.2.dev2/src/roboz/tools/control.py +54 -0
  65. roboz-0.1.2.dev2/src/roboz/tools/interaction.py +68 -0
@@ -0,0 +1,50 @@
1
+ # Python bytecode
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Virtual environments and local configuration
7
+ .venv/
8
+ venv/
9
+ .env
10
+ .env.*
11
+ !.env.example
12
+
13
+ # Tests, coverage, and static analysis
14
+ .coverage
15
+ .coverage.*
16
+ htmlcov/
17
+ coverage.xml
18
+ junit.xml
19
+ .pytest_cache/
20
+ .ruff_cache/
21
+ .mypy_cache/
22
+ .pyright/
23
+ .hypothesis/
24
+ .tox/
25
+ .nox/
26
+
27
+ # Packaging and generated documentation
28
+ build/
29
+ dist/
30
+ wheels/
31
+ *.egg-info/
32
+ .eggs/
33
+ site/
34
+
35
+ # Editors and operating systems
36
+ .idea/
37
+ .vscode/
38
+ .VSCodeCounter/
39
+ *.swp
40
+ *.swo
41
+ *~
42
+ .DS_Store
43
+ Thumbs.db
44
+
45
+ # Robozium local runtime output
46
+ rbz_data/
47
+ worktrees/
48
+
49
+ # CI diagnostics
50
+ reports/
@@ -0,0 +1,68 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.1.2.dev2 - 2026-09-09
6
+
7
+ - Breaking: remove the `roboz[openai]` extra. Install
8
+ `roboz-endpoints[openai]` directly for the endpoint catalogue and SDK adapter;
9
+ it installs core automatically. See `packages/endpoints/README.md` for migration.
10
+
11
+ - Breaking: move dependency primitives from `roboz.tooling.dependencies` and
12
+ `roboz.tooling` to `roboz.dependencies`. Update those imports; the existing
13
+ top-level `roboz` authoring API remains available. See `docs/context-migration.md`.
14
+
15
+ - Add `DependencyRoute` for live caller-owned selections. Materialization and discovery delegate to the current target without introducing a separate identity or caching the selection.
16
+
17
+ - Breaking: capability builders receive `build(pipe, *, default_endpoint)`.
18
+ Capabilities own their tool-specific endpoint choices and receive the agent
19
+ endpoint as a fallback, independently of runtime controls. Lazy/live
20
+ references retain identity and deferred resolution. See
21
+ `docs/agent-factories.md` for builder migration.
22
+
23
+ - Breaking: move the Librarian and its memory/summarization tools out of core into `roboshed.agents` and `roboshed.tools`. Use `librarian(capabilities=..., agent_endpoint=...)` instead of `LibrarianConstructor` and its path record; see `docs/agent-factories.md`. Core retains control, interaction, and generic construction primitives.
24
+
25
+ - Add generic `AgentDefinition`, `AgentCapability`, `Capability`, and `SubAgentSpec` in `roboz.deployment`. Configure all tools and skills through capabilities, with fresh agent pipes and explicit sink configuration; definitions select no project, memory, or persistence conventions. See `docs/agent-factories.md`.
26
+
27
+ - Breaking: `roboz[shed]` now installs `roboshed` instead of `roboz-shed`. Update direct requirements to `roboshed` and imports from `roboz_shed` to `roboshed`; no compatibility package is provided.
28
+
29
+ ### Added
30
+
31
+ - Select lazy model endpoints with `ModelSelector` from `roboz.llm` or
32
+ `roboz.llm.endpoints`, without requiring Shed or constructing clients.
33
+
34
+ - Bind exact dependency registrations with `roboz.dependencies`, independently
35
+ of Shed. Registration types, checker callbacks, and contract errors now live
36
+ alongside dependency discovery and resolution primitives.
37
+
38
+ - Add `ExternalDependencyReference` for replaceable resources. Endpoint helpers
39
+ preserve live selection and discovery through contexts, tools, and agents,
40
+ while lazy resources retain their identity validation and cached clients.
41
+
42
+ - Inspect resources before binding tools with `Ctx.external_dependencies()`.
43
+ Contexts implement `ExternalDependencySource`, preserving resource identity
44
+ and reflecting live nested contexts, agents, and catalogs without resolving
45
+ lazy resources. `external_dependencies` is now a reserved context field name;
46
+ see `docs/context-migration.md`.
47
+
48
+ ### Fixed
49
+
50
+ - Refresh lifecycle endpoint metadata when invoking an agent again after a live
51
+ reference switches models, while retaining each lazy dependency's client cache.
52
+
53
+ ### Changed
54
+
55
+ - **Breaking:** Construct tool contexts with `Ctx(**values)` and pass resources
56
+ directly. Remove `FactoryCtx`, specialized context classes, `ToolDependency`,
57
+ and endpoint binding wrappers; `Tool.dependencies` now returns resources.
58
+ See `docs/context-migration.md` for replacements and state ownership.
59
+
60
+ - Define and enforce Google-style source docstrings, and normalize tool
61
+ docstrings before including them in agent prompts.
62
+
63
+ ## 0.1.1
64
+
65
+ - Preserve concrete nested model types across in-memory tool handoffs while
66
+ keeping field projection, excluded fields, validation, and detached inputs.
67
+ - Add optional companion extras and independent package release workflows.
68
+ - Keep the core's runtime dependency set unchanged.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,215 @@
1
+ Metadata-Version: 2.5
2
+ Name: roboz
3
+ Version: 0.1.2.dev2
4
+ Import-Name: roboz
5
+ Summary: Typed primitives for composable agentic workflows
6
+ Project-URL: Homepage, https://github.com/Tachion-Oy/roboz
7
+ Project-URL: Repository, https://github.com/Tachion-Oy/roboz
8
+ Project-URL: Issues, https://github.com/Tachion-Oy/roboz/issues
9
+ Project-URL: Documentation, https://github.com/Tachion-Oy/roboz/tree/main/docs
10
+ Author: Tachion Oy
11
+ License-Expression: Apache-2.0
12
+ License-File: LICENSE
13
+ Keywords: agents,llm,tool-calling,typing,workflows
14
+ Classifier: Development Status :: 2 - Pre-Alpha
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.13
23
+ Requires-Dist: pydantic>=2.12.4
24
+ Requires-Dist: python-dotenv>=1.2.1
25
+ Requires-Dist: rich>=14.2.0
26
+ Provides-Extra: proton-bridge-beta
27
+ Requires-Dist: roboz-proton-bridge<0.2.0,>=0.1.0b1; extra == 'proton-bridge-beta'
28
+ Provides-Extra: shed
29
+ Requires-Dist: roboshed<0.2.0,>=0.1.0a2; extra == 'shed'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Roboz
33
+
34
+ [![CI](https://github.com/Tachion-Oy/roboz/actions/workflows/ci.yml/badge.svg)](https://github.com/Tachion-Oy/roboz/actions/workflows/ci.yml)
35
+ [![Python 3.13+](https://img.shields.io/badge/Python-3.13%2B-blue.svg)](https://www.python.org/downloads/)
36
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE)
37
+
38
+ Typed control flow and context management for reliable agentic workflows. Roboz
39
+ lets the model decide what needs judgment, then hands the result to ordinary,
40
+ typed Python for the steps that should not be probabilistic.
41
+
42
+ > [!WARNING]
43
+ > Roboz is pre-release software requiring Python 3.13 or newer. APIs may change
44
+ > before 1.0.
45
+
46
+ ## Why Roboz
47
+
48
+ **Chain tools instead of prompting through every step.** The model chooses an
49
+ active tool; successful output can flow directly into typed, passive tools with
50
+ no additional model decision. Conditions can route by output value or type,
51
+ external policy, or current state. Branches can converge on a shared successor.
52
+ Only active tools enter the model's tool surface, keeping orchestration details
53
+ out of the prompt while Python and Pydantic enforce the handoffs.
54
+
55
+ **Treat context as a lifecycle, not an ever-growing transcript.** Every message
56
+ can carry its own truncation policy. Keep an operational result intact while it
57
+ is recent, reduce it to a stub later, and remove it from model context when it is
58
+ stale. `NO_MESSAGE` hides internal chatter immediately. These policies change
59
+ only the view sent to the model; runtime events and persisted messages retain the
60
+ full record.
61
+
62
+ ## Install
63
+
64
+ The PyPI commands below require a published release. For an unpublished checkout,
65
+ [build and test the local wheels](docs/build-and-test.md). Maintainers publish
66
+ [reviewed package tags directly to PyPI](docs/build-and-test.md#preparing-and-publishing-a-release).
67
+
68
+ ```bash
69
+ uv add roboz
70
+ ```
71
+
72
+ Or with pip:
73
+
74
+ ```bash
75
+ python -m pip install roboz
76
+ ```
77
+
78
+ Optional tools and adapters are separate distributions in this repository:
79
+ `roboshed`, `roboz-endpoints`, and `roboz-proton-bridge`. Start with the
80
+ [installation and add-on guide](docs/addons.md) to build their wheels and compose
81
+ agents from capabilities. These companion releases must be
82
+ published before their named PyPI installs and convenience extras are usable.
83
+
84
+ ## Quick start
85
+
86
+ ```python
87
+ from builtins import input as read_input
88
+
89
+ import roboz as rz
90
+
91
+
92
+ @rz.tool
93
+ def ask_number(input: rz.Empty, messages: list[rz.Message]) -> rz.Int:
94
+ """Ask the user for an integer, repeating until the response is valid."""
95
+ while True:
96
+ try:
97
+ reply = read_input("Enter an integer: ")
98
+ except EOFError: # Keep the example runnable in non-interactive checks.
99
+ reply = "7"
100
+ try:
101
+ return rz.Int(value=int(reply))
102
+ except ValueError:
103
+ print("Please enter a whole number.")
104
+
105
+
106
+ @rz.tool(
107
+ chained_to=ask_number,
108
+ chain_condition=lambda output: output.value % 2 == 0,
109
+ )
110
+ def report_even(input: rz.Int, messages: list[rz.Message]) -> rz.Stop:
111
+ """Report that the supplied integer is even."""
112
+ print(f"{input.value} is even.")
113
+ return rz.Stop(value="even")
114
+
115
+
116
+ @rz.tool(
117
+ chained_to=ask_number,
118
+ chain_condition=lambda output: output.value % 2 != 0,
119
+ )
120
+ def report_odd(input: rz.Int, messages: list[rz.Message]) -> rz.Stop:
121
+ """Report that the supplied integer is odd."""
122
+ print(f"{input.value} is odd.")
123
+ return rz.Stop(value="odd")
124
+
125
+
126
+ agent = rz.Agent(
127
+ name="demo",
128
+ is_agentic=False,
129
+ agent_endpoint=None,
130
+ default_tools=[ask_number],
131
+ tools=[report_even, report_odd],
132
+ )
133
+
134
+ agent.invoke()
135
+ ```
136
+
137
+ `ask_number` starts with `Empty`, handles input validation locally, and returns a
138
+ typed `Int`. Roboz then evaluates both conditions and runs exactly one passive
139
+ successor. The routing is ordinary, testable Python; no model needs to interpret
140
+ the reply or choose the next step.
141
+
142
+ The same program is available in [`examples/quickstart.py`](examples/quickstart.py).
143
+ See [`examples/tool_chaining.py`](examples/tool_chaining.py) for conditional
144
+ routing and convergence, and
145
+ [`examples/message_truncation.py`](examples/message_truncation.py) for a sliding
146
+ message-visibility window.
147
+
148
+ ## Primitives
149
+
150
+ | Primitive | Role |
151
+ | --- | --- |
152
+ | `rz.Agent` | Owns the tool surface, prompt assembly, invoke loop, and runtime events. |
153
+ | `@rz.tool` | Creates an action from typed input, messages, and output models. |
154
+ | `rz.Ctx` | Binds keyword configuration and dependency objects without a custom class. |
155
+ | `@rz.factory` | Creates a tool whose runtime context declares external dependencies. |
156
+ | `rz.Skill` | Packages reusable instructions and optional tools. |
157
+ | `rz.Message` | Carries content plus its model-context truncation lifecycle. |
158
+ | `roboz.runtime.EventPipe` | Emits lifecycle, message, and runtime events to explicit sinks. |
159
+
160
+ The package contains agent and LLM primitives, models, runtime and persistence
161
+ infrastructure, dependencies, skills, tooling, and foundational control/interaction tools.
162
+ `roboz.dependencies` also validates exact dependency registrations and binds
163
+ checker callbacks without running them. Shed supplies health probes and scheduling
164
+ through `roboshed.dependency_health`.
165
+ `roboz.llm.ModelSelector` selects among lazy model endpoints without constructing
166
+ clients and can supply the current endpoint to a `DependencyRoute`.
167
+ Provider catalogs and SDK integrations, guarded file and CLI tools, and application
168
+ integrations belong in companion packages and are not dependencies of Roboz.
169
+ Install `roboz-endpoints[openai]` for the initial OpenRouter, Cerebras, and Groq
170
+ catalogues; it installs core automatically. See the
171
+ [endpoint guide](packages/endpoints/README.md) for model selection and SDK adapters.
172
+
173
+ `roboz.deployment` supplies generic agent definitions, capability contracts,
174
+ and specialist composition. Capabilities accept tool-specific endpoints and pass
175
+ them directly to their tools, using the owning agent's endpoint as the default. `roboshed` supplies orchestrator/Librarian
176
+ factories, concrete capabilities, memory tools, and workspace structure. These are described in [agent factories](docs/agent-factories.md). Configured file and compaction capabilities live in `roboshed.capabilities`,
177
+ alongside `roboshed.tools` and `roboshed.skills`. The project deployment lives in
178
+ `roboshed.deployments.robosprawl`; agent presets live in `roboshed.agents`.
179
+
180
+ ## Documentation
181
+
182
+ | Guide | Contents |
183
+ | --- | --- |
184
+ | [`docs/reference.md`](docs/reference.md) | Concise API and runtime reference |
185
+ | [`docs/agent-authoring.md`](docs/agent-authoring.md) | Agent composition and prompt policy |
186
+ | [`docs/tool-authoring.md`](docs/tool-authoring.md) | Tools, factories, dependencies, and chaining |
187
+ | [`docs/docstrings.md`](docs/docstrings.md) | Python and agent-facing tool docstring conventions |
188
+ | [`docs/testing-practices.md`](docs/testing-practices.md) | Test design and review expectations |
189
+ | [`docs/build-and-test.md`](docs/build-and-test.md) | Local setup and CI-equivalent validation |
190
+ | [`docs/port-parity.md`](docs/port-parity.md) | Audited source-commit parity and deliberate exclusions |
191
+ | [`docs/addons.md`](docs/addons.md) | Optional packages, composition, and releases |
192
+ | [`docs/maintainer-basics.md`](docs/maintainer-basics.md) | Practical changelog, versioning, release, and open-source basics |
193
+
194
+ ## Development
195
+
196
+ ```bash
197
+ uv sync --locked --dev
198
+ uv run pytest
199
+ uv run ruff check
200
+ uv run pyright
201
+ bash scripts/run_type_tests.sh
202
+ uv build
203
+ ```
204
+
205
+ Build companions with `uv build --all-packages --out-dir dist/first-slice`.
206
+
207
+ Roboz is typed and ships a PEP 561 `py.typed` marker.
208
+
209
+ ## License
210
+
211
+ Roboz is licensed under the [Apache License 2.0](LICENSE). Copyright © 2026 Tachion Oy.
212
+
213
+ Context-aware tools use `ctx: rz.Ctx` and bind with `rz.Ctx(prefix="hello")`.
214
+ See [tool authoring](docs/tool-authoring.md) and the
215
+ [context API migration](docs/context-migration.md).