roboshed 0.1.0a3__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 (90) hide show
  1. roboshed-0.1.0a3/.gitignore +50 -0
  2. roboshed-0.1.0a3/CHANGELOG.md +96 -0
  3. roboshed-0.1.0a3/LICENSE +201 -0
  4. roboshed-0.1.0a3/PKG-INFO +141 -0
  5. roboshed-0.1.0a3/README.md +125 -0
  6. roboshed-0.1.0a3/pyproject.toml +25 -0
  7. roboshed-0.1.0a3/src/roboshed/__init__.py +1 -0
  8. roboshed-0.1.0a3/src/roboshed/agents/__init__.py +6 -0
  9. roboshed-0.1.0a3/src/roboshed/agents/librarian.py +39 -0
  10. roboshed-0.1.0a3/src/roboshed/agents/orchestrator.py +49 -0
  11. roboshed-0.1.0a3/src/roboshed/capabilities.py +297 -0
  12. roboshed-0.1.0a3/src/roboshed/dependency_health.py +384 -0
  13. roboshed-0.1.0a3/src/roboshed/deployments/__init__.py +1 -0
  14. roboshed-0.1.0a3/src/roboshed/deployments/robosprawl/__init__.py +301 -0
  15. roboshed-0.1.0a3/src/roboshed/identifiers.py +27 -0
  16. roboshed-0.1.0a3/src/roboshed/models.py +242 -0
  17. roboshed-0.1.0a3/src/roboshed/py.typed +1 -0
  18. roboshed-0.1.0a3/src/roboshed/sandbox.py +206 -0
  19. roboshed-0.1.0a3/src/roboshed/skills/__init__.py +8 -0
  20. roboshed-0.1.0a3/src/roboshed/skills/cli_tools/__init__.py +10 -0
  21. roboshed-0.1.0a3/src/roboshed/skills/cli_tools/prompts.py +195 -0
  22. roboshed-0.1.0a3/src/roboshed/skills/email_tools/__init__.py +10 -0
  23. roboshed-0.1.0a3/src/roboshed/skills/email_tools/prompts.py +125 -0
  24. roboshed-0.1.0a3/src/roboshed/skills/file_editing/__init__.py +27 -0
  25. roboshed-0.1.0a3/src/roboshed/skills/file_editing/prompts.py +149 -0
  26. roboshed-0.1.0a3/src/roboshed/skills/robosprawl.py +141 -0
  27. roboshed-0.1.0a3/src/roboshed/tools/__init__.py +21 -0
  28. roboshed-0.1.0a3/src/roboshed/tools/_snapshot_metadata.py +90 -0
  29. roboshed-0.1.0a3/src/roboshed/tools/apply_patch.py +206 -0
  30. roboshed-0.1.0a3/src/roboshed/tools/cli_commands/__init__.py +23 -0
  31. roboshed-0.1.0a3/src/roboshed/tools/cli_commands/run_file_command/__init__.py +12 -0
  32. roboshed-0.1.0a3/src/roboshed/tools/cli_commands/run_file_command/command.py +155 -0
  33. roboshed-0.1.0a3/src/roboshed/tools/cli_commands/run_file_command/resolve.py +404 -0
  34. roboshed-0.1.0a3/src/roboshed/tools/cli_commands/run_file_command/specs.py +131 -0
  35. roboshed-0.1.0a3/src/roboshed/tools/cli_commands/utilities/__init__.py +80 -0
  36. roboshed-0.1.0a3/src/roboshed/tools/cli_commands/utilities/cmd_spec.py +48 -0
  37. roboshed-0.1.0a3/src/roboshed/tools/cli_commands/utilities/constants.py +36 -0
  38. roboshed-0.1.0a3/src/roboshed/tools/cli_commands/utilities/formatting.py +252 -0
  39. roboshed-0.1.0a3/src/roboshed/tools/cli_commands/utilities/path_extractors.py +179 -0
  40. roboshed-0.1.0a3/src/roboshed/tools/compactification/__init__.py +31 -0
  41. roboshed-0.1.0a3/src/roboshed/tools/compactification/compactify_messages.py +276 -0
  42. roboshed-0.1.0a3/src/roboshed/tools/compactification/prompts.py +107 -0
  43. roboshed-0.1.0a3/src/roboshed/tools/compactification/summarize.py +279 -0
  44. roboshed-0.1.0a3/src/roboshed/tools/compactification/summary_prompts.py +61 -0
  45. roboshed-0.1.0a3/src/roboshed/tools/consolidate_memory.py +306 -0
  46. roboshed-0.1.0a3/src/roboshed/tools/consolidate_memory_example.py +110 -0
  47. roboshed-0.1.0a3/src/roboshed/tools/consolidate_memory_prompts.py +110 -0
  48. roboshed-0.1.0a3/src/roboshed/tools/email/__init__.py +51 -0
  49. roboshed-0.1.0a3/src/roboshed/tools/email/contracts.py +224 -0
  50. roboshed-0.1.0a3/src/roboshed/tools/email/drafts.py +425 -0
  51. roboshed-0.1.0a3/src/roboshed/tools/email/factory.py +267 -0
  52. roboshed-0.1.0a3/src/roboshed/tools/email/inputs.py +66 -0
  53. roboshed-0.1.0a3/src/roboshed/tools/email/messages.py +253 -0
  54. roboshed-0.1.0a3/src/roboshed/tools/email/runtime.py +40 -0
  55. roboshed-0.1.0a3/src/roboshed/tools/guard.py +170 -0
  56. roboshed-0.1.0a3/src/roboshed/tools/guard_formatting.py +58 -0
  57. roboshed-0.1.0a3/src/roboshed/tools/librarian_errors.py +8 -0
  58. roboshed-0.1.0a3/src/roboshed/tools/memory_files.py +92 -0
  59. roboshed-0.1.0a3/src/roboshed/tools/purge_files.py +101 -0
  60. roboshed-0.1.0a3/src/roboshed/tools/runner.py +258 -0
  61. roboshed-0.1.0a3/src/roboshed/tools/sleep_between_runs.py +67 -0
  62. roboshed-0.1.0a3/src/roboshed/tools/snapshot_conversation_example.py +38 -0
  63. roboshed-0.1.0a3/src/roboshed/tools/snapshot_conversation_prompts.py +89 -0
  64. roboshed-0.1.0a3/src/roboshed/tools/snapshot_conversations.py +339 -0
  65. roboshed-0.1.0a3/src/roboshed/tools/snapshot_normalize.py +61 -0
  66. roboshed-0.1.0a3/src/roboshed/tools/truncation.py +20 -0
  67. roboshed-0.1.0a3/src/roboshed/tools/types.py +30 -0
  68. roboshed-0.1.0a3/src/roboshed/tools/utils.py +252 -0
  69. roboshed-0.1.0a3/tests/deployments/robosprawl/test_robosprawl_deployment.py +289 -0
  70. roboshed-0.1.0a3/tests/memory/test_consolidate_memory.py +518 -0
  71. roboshed-0.1.0a3/tests/memory/test_librarian.py +383 -0
  72. roboshed-0.1.0a3/tests/memory/test_memory_prompts.py +132 -0
  73. roboshed-0.1.0a3/tests/memory/test_purge_files.py +154 -0
  74. roboshed-0.1.0a3/tests/memory/test_snapshot_conversations.py +697 -0
  75. roboshed-0.1.0a3/tests/memory/test_summarize_conversation.py +287 -0
  76. roboshed-0.1.0a3/tests/test_agent_presets.py +42 -0
  77. roboshed-0.1.0a3/tests/test_apply_patch.py +343 -0
  78. roboshed-0.1.0a3/tests/test_build_guarded_tool_chain.py +147 -0
  79. roboshed-0.1.0a3/tests/test_capabilities.py +101 -0
  80. roboshed-0.1.0a3/tests/test_cli_command_chaining.py +1052 -0
  81. roboshed-0.1.0a3/tests/test_cli_command_utils.py +1218 -0
  82. roboshed-0.1.0a3/tests/test_cli_tools_prompt_examples.py +603 -0
  83. roboshed-0.1.0a3/tests/test_compactify_messages.py +216 -0
  84. roboshed-0.1.0a3/tests/test_compaction_runtime.py +401 -0
  85. roboshed-0.1.0a3/tests/test_dependency_health.py +420 -0
  86. roboshed-0.1.0a3/tests/test_email_factory.py +791 -0
  87. roboshed-0.1.0a3/tests/test_generic_guards.py +87 -0
  88. roboshed-0.1.0a3/tests/test_guard.py +123 -0
  89. roboshed-0.1.0a3/tests/test_path_extractors.py +101 -0
  90. roboshed-0.1.0a3/tests/test_sandbox.py +253 -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,96 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.1.0a3 - 2026-09-10
6
+
7
+ - Breaking: replace the public Shed `Workspace` and `Project` primitives with a
8
+ single `Sandbox`. Configure tier and persistence paths once, derive the policy
9
+ with `sandbox.permissions(project_slug)`, and pass the sandbox plus slug to
10
+ RoboSprawl deployment factories. Import `Sandbox` and the standalone
11
+ `PermissionPolicy` from `roboshed.sandbox`. The tiered permission behavior is
12
+ unchanged.
13
+
14
+ ## 0.1.0a2 - 2026-09-09
15
+
16
+ - Treat wildcard characters in project and workspace names literally when
17
+ deriving permissions, preventing writes from extending into other directories.
18
+ - Keep dependency health scheduling alive after observation failures and allow
19
+ a stopped scheduler task to restart, with sanitized diagnostics. Infer checker
20
+ registrations from the first dependency for each ID, matching core binding.
21
+
22
+ - Allow `RoboSprawl.librarian_capabilities` to configure maintenance per project
23
+ and recursive foreground names. The default remains snapshots, consolidation,
24
+ retention, and a 120-second cadence, in that order.
25
+
26
+ - Add the `robosprawl` orientation skill following PeffaHub’s hub, Librarian, and HUD guidance. Resolve actual paths separately through `RoboSprawl.project_context`; obsolete safe-script behavior is omitted.
27
+
28
+ - Configure `RoboSprawl` with a capability sequence and project instruction template; permission factories bind during each recipe invocation, so consumers need no configuration callbacks.
29
+
30
+ - Move `ModelSelector` from `roboshed.deployments.models` to
31
+ `roboz.llm.endpoints`, also exported by `roboz.llm`. Update imports; selection
32
+ behavior is unchanged. See `docs/context-migration.md`.
33
+
34
+ - Move registration and binding from `roboshed.dependencies.contract` to
35
+ `roboz.dependencies`, and health checks from `roboshed.dependencies.health` to
36
+ `roboshed.dependency_health`. Update imports to these paths; the former
37
+ dependency package is removed. See `docs/context-migration.md`.
38
+
39
+ - Add the `RoboSprawl` deployment recipe: consumers select project capabilities and models while shared composition derives project instructions, recursive agent names, and Librarian maintenance. Host-specific instructions and interaction channels remain explicit inputs.
40
+
41
+ - Derive standard workspace boundaries with `Project.permissions`: workspace reads, project writes, confirmation for shared writes, and denial elsewhere. No application permission factory is needed.
42
+
43
+ - Add recipe-driven `DeploymentFactory`, reusable `RunFactory` and model selection, isolated dependency inspection, and exact registrations with safe health monitoring. Recipes explicitly own dependency reuse; construction starts no agents or background tasks.
44
+
45
+ - Breaking: move email input models into `roboshed.tools.email.inputs`; they
46
+ remain exported from `roboshed.tools.email`. Remove `roboshed.assistant`,
47
+ `roboshed.demo`, and the `roboz-demo` command. Compose file agents directly
48
+ from `AgentDefinition` and Shed capabilities; see `docs/agent-factories.md`.
49
+
50
+ - Breaking: compose the Librarian through its `capabilities` argument, like the
51
+ orchestrator. Public `ConversationSnapshots`, `MemoryConsolidation`,
52
+ `ArtifactRetention`, and `MaintenanceCadence` live in `roboshed.capabilities`.
53
+ Move project inputs and `LibrarianTuning` settings to the relevant capability;
54
+ the aggregate tuning class is removed. See `docs/agent-factories.md`.
55
+
56
+ - Breaking: capabilities pass configured endpoints directly to their tools,
57
+ falling back to the agent's model when unset. Librarian snapshotting and
58
+ consolidation can use separate models. Use `librarian(agent_endpoint=...)`
59
+ for a shared default, with `endpoint` overrides on `ConversationSnapshots`
60
+ and `MemoryConsolidation`. Its special `endpoint_factory` argument
61
+ is removed; endpoints and runtime cancellation remain independent inputs.
62
+ See `docs/agent-factories.md`.
63
+
64
+ - Add `roboshed.deployments.robosprawl.AgenticFactory` to bind project persistence, initial memory, and background-start capabilities to configured definitions. Builds return `RoboSprawlBundle(agent, background_agents)`, a named tuple for direct invocation and host cancellation; construction starts no threads. See `docs/agent-factories.md`.
65
+
66
+ - Breaking: own orchestrator/Librarian presets, workspace/project structure, reusable capabilities, and memory/summarization tools. Import presets from `roboshed.agents`, feature implementations from `roboshed.capabilities`, and explicit paths/permission inputs from `roboshed.workspace`. Both presets return `AgentDefinition`; the orchestrator remains available across tasks until asked to stop. Preset extensions use only `capabilities`; move separate tool/skill inputs into capability builds. See `docs/agent-factories.md`.
67
+
68
+ - Breaking: rename the distribution from `roboz-shed` to `roboshed` and the import namespace from `roboz_shed` to `roboshed`. Update dependency declarations and imports. No compatibility package is provided.
69
+
70
+ ### Added
71
+
72
+ - Compact active conversations with configurable continuation prompts, context thresholds, cancellation, and optional per-attempt timeouts.
73
+
74
+ ### Changed
75
+
76
+ - **Breaking:** Replace specialized tool contexts with `roboz.Ctx(**values)`
77
+ and use service/executable resources directly. Existing builders retain their
78
+ defaults and guard behavior. See `docs/context-migration.md` in the repository
79
+ for the low-level API migration.
80
+
81
+ - Document Shed's agent-facing tools under the shared docstring contract.
82
+
83
+ ### Fixed
84
+
85
+ - Reject relative project persistence paths that escape through traversal or
86
+ symlinks. External logs, snapshots, and memory require explicit absolute paths;
87
+ see `docs/agent-factories.md` for migration guidance.
88
+ - Skip conversation files with invalid UTF-8 during snapshot processing without
89
+ modifying the source or preventing valid conversations from being summarized.
90
+ - Direct targeted reads in file-editing guidance to the configured command tool.
91
+
92
+ - Preserve conversation history when compaction cannot produce a replacement within its context budget, and report current usage and headroom after successful compaction.
93
+
94
+ ## 0.1.0a1
95
+
96
+ Initial independently installable package. See README for capabilities and setup.
@@ -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,141 @@
1
+ Metadata-Version: 2.5
2
+ Name: roboshed
3
+ Version: 0.1.0a3
4
+ Import-Name: roboshed
5
+ Summary: roboshed: optional building blocks for Roboz
6
+ Project-URL: Repository, https://github.com/Tachion-Oy/roboz
7
+ Author: Tachion Oy
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Typing :: Typed
12
+ Requires-Python: >=3.13
13
+ Requires-Dist: pydantic>=2.12.4
14
+ Requires-Dist: roboz<0.2.0,>=0.1.2.dev2
15
+ Description-Content-Type: text/markdown
16
+
17
+ # roboshed
18
+
19
+ Reusable agent factories, capabilities, sandbox policies, tools, and skills built on Roboz. Version `0.1.0a1`
20
+ is alpha; APIs may change before 1.0. Dependencies are Roboz and Pydantic only.
21
+
22
+ Includes guarded Unix file commands, Python patch editing, CLI/file/email
23
+ instructions, and provider-neutral email contracts and tools. It does not
24
+ install any model SDK, Proton, document SDK, web service, or backend framework.
25
+
26
+ ```python
27
+ from pathlib import Path
28
+ from roboz import stop
29
+ from roboz.deployment import AgentDefinition, Capability
30
+ from roboz.llm import MockLLMEndpoint
31
+ from roboshed.capabilities import FileCommands, FileEditing
32
+ from roboshed.sandbox import PermissionPolicy
33
+
34
+ permissions = PermissionPolicy.local(Path("./sandbox"))
35
+ agent = AgentDefinition(
36
+ name="file_worker",
37
+ system_prompt="Complete the user's task, then call stop.",
38
+ agent_endpoint=MockLLMEndpoint([
39
+ {"action": "stop", "rationale": "done", "value": "Ready."}
40
+ ]),
41
+ capabilities=(
42
+ Capability(tools=(stop,)),
43
+ FileCommands(permissions),
44
+ FileEditing(permissions),
45
+ ),
46
+ ).build()
47
+ result, messages = agent.invoke()
48
+ ```
49
+
50
+ `roboshed.capabilities` provides `FileCommands`, `FileEditing`, `Compactification`,
51
+ `ConversationSnapshots`, `MemoryConsolidation`, `ArtifactRetention`, and
52
+ `MaintenanceCadence`, alongside the `tools` and `skills` modules. Applications
53
+ choose and configure these capabilities through the presets’ single `capabilities`
54
+ extension argument. A capability owns its tools and any skills used for instructions. `roboshed.deployments.robosprawl`
55
+ provides project composition. `roboshed.agents` supplies the reusable
56
+ orchestrator/Librarian presets. Generic definitions and
57
+ capability contracts live in `roboz.deployment`. Each capability
58
+ builds its tools with explicit endpoint overrides or the agent's default.
59
+ Runtime controls remain separate from endpoints. The Librarian accepts an ordered
60
+ `capabilities` sequence. Snapshot and consolidation capabilities each expose an
61
+ `endpoint`; `agent_endpoint` supplies their shared default. Retention and cadence
62
+ need no model. Each capability owns its settings and project inputs. Select permission policies through
63
+ `roboshed.sandbox.PermissionPolicy`, or configure one `Sandbox` and derive
64
+ the standard tiered policy with `sandbox.permissions(project_slug)`. The sandbox
65
+ also derives all project persistence paths. Compose task-oriented agents directly
66
+ with `AgentDefinition`.
67
+
68
+ See the [factory and migration guide](../../docs/agent-factories.md).
69
+
70
+ ## Conversation compaction
71
+
72
+ The following fragment belongs inside an agent or tool builder. `endpoint` is
73
+ the selected compaction model, and `agent_pipe` is the owning agent's event
74
+ pipe. These are independent inputs to the tool.
75
+
76
+ ```python
77
+ from roboshed.tools import get_compactify_messages_when_needed_tool
78
+
79
+ compact = get_compactify_messages_when_needed_tool(
80
+ endpoint=endpoint, threshold_percent=60, pipe=agent_pipe, timeout_s=60,
81
+ )
82
+ ```
83
+
84
+ Include this tool in an agent's `default_tools` and pass that agent's owning
85
+ `EventPipe`. The standalone factory defaults to an 80% threshold and no timeout;
86
+ `system_prompt` and `skill_message` override the full continuation instructions.
87
+ The tool preserves the contiguous bootstrap prefix and folds the remaining
88
+ history, including previous summaries, into a new continuation message. Its
89
+ status also carries the summary for event persistence. Each constructed tool
90
+ owns its compaction count; constructing one per agent keeps counters independent.
91
+
92
+ Successful status reports describe the compacted history's current usage and
93
+ headroom. Summaries are budgeted below the configured threshold and endpoint
94
+ capacity, including the preserved prefix and continuation payload. If there is
95
+ no room for a summary, or the returned replacement still exceeds the budget
96
+ after summarization retries, the tool returns `blocked` without changing history
97
+ or the counter. The continuation payload retains `percent_used_before`.
98
+
99
+ Cancellation and interruption propagate through the existing Roboz summarizer.
100
+ An optional positive, finite `timeout_s` bounds each provider attempt, not the
101
+ whole compaction. Failed attempts leave history and the counter unchanged;
102
+ late provider results are ignored without forcibly killing worker threads.
103
+ Summarization messages and model-call events use the supplied pipe.
104
+
105
+ The public tool name and persisted caller are `compactify_messages_when_needed`.
106
+ This tool owns the shared continuation prompts and retains RoboSprawl's caller
107
+ name. The old `robosprawl.compaction` import is
108
+ replaced by `roboshed.tools`. Shed also owns the shared summarizer and Librarian
109
+ memory pipeline; core provides the mechanisms they use.
110
+
111
+ ## Context API migration
112
+
113
+ Low-level tool factories now use `roboz.Ctx(**values)` directly, with service,
114
+ endpoint, and executable objects supplied without wrappers. The specialized
115
+ context classes have been removed. Existing tool builders retain their keyword
116
+ arguments, defaults, permission checks, cancellation, and timeout behavior.
117
+ See the [migration guide](https://github.com/Tachion-Oy/roboz/blob/main/docs/context-migration.md)
118
+ for low-level context fields and state ownership.
119
+
120
+
121
+ Use `RoboSprawl` from `roboshed.deployments.robosprawl` to configure project
122
+ capabilities and a memory endpoint. It derives the persistent orchestrator,
123
+ project instructions, and Librarian maintenance. Its `librarian_capabilities`
124
+ callable can override the default maintenance sequence using each run's project
125
+ and recursive foreground names. For repeatable CLI or server
126
+ construction, pass this recipe to `DeploymentFactory`; custom recipes can return
127
+ `AgenticFactory` directly. Use core's `roboz.llm.ModelSelector` for lazy model
128
+ selection. Recipes allocate fresh stateful inputs while allowing
129
+ explicitly shared lazy clients. The factory returns uninvoked agents; consumers
130
+ own interaction and shutdown. `roboz.dependencies` supplies exact dependency
131
+ registration and binding; `roboshed.dependency_health` supplies probes and health
132
+ monitoring without a web framework or provider SDK.
133
+ Permission policies treat configured folder names literally. Health scheduling
134
+ retries observation failures; timed-out workers retain their concurrency slots
135
+ until completion.
136
+ See [agent factories](../../docs/agent-factories.md) for the contracts and examples.
137
+
138
+ The `robosprawl` skill from `roboshed.skills` covers sandbox orientation and the HUD
139
+ file-link/markdown contract. Select it through
140
+ `Capability(auto_loaded_skills=(robosprawl,))` for compatible consumers. It uses project
141
+ paths supplied through `RoboSprawl.project_context` instead of choosing a sandbox layout.
@@ -0,0 +1,125 @@
1
+ # roboshed
2
+
3
+ Reusable agent factories, capabilities, sandbox policies, tools, and skills built on Roboz. Version `0.1.0a1`
4
+ is alpha; APIs may change before 1.0. Dependencies are Roboz and Pydantic only.
5
+
6
+ Includes guarded Unix file commands, Python patch editing, CLI/file/email
7
+ instructions, and provider-neutral email contracts and tools. It does not
8
+ install any model SDK, Proton, document SDK, web service, or backend framework.
9
+
10
+ ```python
11
+ from pathlib import Path
12
+ from roboz import stop
13
+ from roboz.deployment import AgentDefinition, Capability
14
+ from roboz.llm import MockLLMEndpoint
15
+ from roboshed.capabilities import FileCommands, FileEditing
16
+ from roboshed.sandbox import PermissionPolicy
17
+
18
+ permissions = PermissionPolicy.local(Path("./sandbox"))
19
+ agent = AgentDefinition(
20
+ name="file_worker",
21
+ system_prompt="Complete the user's task, then call stop.",
22
+ agent_endpoint=MockLLMEndpoint([
23
+ {"action": "stop", "rationale": "done", "value": "Ready."}
24
+ ]),
25
+ capabilities=(
26
+ Capability(tools=(stop,)),
27
+ FileCommands(permissions),
28
+ FileEditing(permissions),
29
+ ),
30
+ ).build()
31
+ result, messages = agent.invoke()
32
+ ```
33
+
34
+ `roboshed.capabilities` provides `FileCommands`, `FileEditing`, `Compactification`,
35
+ `ConversationSnapshots`, `MemoryConsolidation`, `ArtifactRetention`, and
36
+ `MaintenanceCadence`, alongside the `tools` and `skills` modules. Applications
37
+ choose and configure these capabilities through the presets’ single `capabilities`
38
+ extension argument. A capability owns its tools and any skills used for instructions. `roboshed.deployments.robosprawl`
39
+ provides project composition. `roboshed.agents` supplies the reusable
40
+ orchestrator/Librarian presets. Generic definitions and
41
+ capability contracts live in `roboz.deployment`. Each capability
42
+ builds its tools with explicit endpoint overrides or the agent's default.
43
+ Runtime controls remain separate from endpoints. The Librarian accepts an ordered
44
+ `capabilities` sequence. Snapshot and consolidation capabilities each expose an
45
+ `endpoint`; `agent_endpoint` supplies their shared default. Retention and cadence
46
+ need no model. Each capability owns its settings and project inputs. Select permission policies through
47
+ `roboshed.sandbox.PermissionPolicy`, or configure one `Sandbox` and derive
48
+ the standard tiered policy with `sandbox.permissions(project_slug)`. The sandbox
49
+ also derives all project persistence paths. Compose task-oriented agents directly
50
+ with `AgentDefinition`.
51
+
52
+ See the [factory and migration guide](../../docs/agent-factories.md).
53
+
54
+ ## Conversation compaction
55
+
56
+ The following fragment belongs inside an agent or tool builder. `endpoint` is
57
+ the selected compaction model, and `agent_pipe` is the owning agent's event
58
+ pipe. These are independent inputs to the tool.
59
+
60
+ ```python
61
+ from roboshed.tools import get_compactify_messages_when_needed_tool
62
+
63
+ compact = get_compactify_messages_when_needed_tool(
64
+ endpoint=endpoint, threshold_percent=60, pipe=agent_pipe, timeout_s=60,
65
+ )
66
+ ```
67
+
68
+ Include this tool in an agent's `default_tools` and pass that agent's owning
69
+ `EventPipe`. The standalone factory defaults to an 80% threshold and no timeout;
70
+ `system_prompt` and `skill_message` override the full continuation instructions.
71
+ The tool preserves the contiguous bootstrap prefix and folds the remaining
72
+ history, including previous summaries, into a new continuation message. Its
73
+ status also carries the summary for event persistence. Each constructed tool
74
+ owns its compaction count; constructing one per agent keeps counters independent.
75
+
76
+ Successful status reports describe the compacted history's current usage and
77
+ headroom. Summaries are budgeted below the configured threshold and endpoint
78
+ capacity, including the preserved prefix and continuation payload. If there is
79
+ no room for a summary, or the returned replacement still exceeds the budget
80
+ after summarization retries, the tool returns `blocked` without changing history
81
+ or the counter. The continuation payload retains `percent_used_before`.
82
+
83
+ Cancellation and interruption propagate through the existing Roboz summarizer.
84
+ An optional positive, finite `timeout_s` bounds each provider attempt, not the
85
+ whole compaction. Failed attempts leave history and the counter unchanged;
86
+ late provider results are ignored without forcibly killing worker threads.
87
+ Summarization messages and model-call events use the supplied pipe.
88
+
89
+ The public tool name and persisted caller are `compactify_messages_when_needed`.
90
+ This tool owns the shared continuation prompts and retains RoboSprawl's caller
91
+ name. The old `robosprawl.compaction` import is
92
+ replaced by `roboshed.tools`. Shed also owns the shared summarizer and Librarian
93
+ memory pipeline; core provides the mechanisms they use.
94
+
95
+ ## Context API migration
96
+
97
+ Low-level tool factories now use `roboz.Ctx(**values)` directly, with service,
98
+ endpoint, and executable objects supplied without wrappers. The specialized
99
+ context classes have been removed. Existing tool builders retain their keyword
100
+ arguments, defaults, permission checks, cancellation, and timeout behavior.
101
+ See the [migration guide](https://github.com/Tachion-Oy/roboz/blob/main/docs/context-migration.md)
102
+ for low-level context fields and state ownership.
103
+
104
+
105
+ Use `RoboSprawl` from `roboshed.deployments.robosprawl` to configure project
106
+ capabilities and a memory endpoint. It derives the persistent orchestrator,
107
+ project instructions, and Librarian maintenance. Its `librarian_capabilities`
108
+ callable can override the default maintenance sequence using each run's project
109
+ and recursive foreground names. For repeatable CLI or server
110
+ construction, pass this recipe to `DeploymentFactory`; custom recipes can return
111
+ `AgenticFactory` directly. Use core's `roboz.llm.ModelSelector` for lazy model
112
+ selection. Recipes allocate fresh stateful inputs while allowing
113
+ explicitly shared lazy clients. The factory returns uninvoked agents; consumers
114
+ own interaction and shutdown. `roboz.dependencies` supplies exact dependency
115
+ registration and binding; `roboshed.dependency_health` supplies probes and health
116
+ monitoring without a web framework or provider SDK.
117
+ Permission policies treat configured folder names literally. Health scheduling
118
+ retries observation failures; timed-out workers retain their concurrency slots
119
+ until completion.
120
+ See [agent factories](../../docs/agent-factories.md) for the contracts and examples.
121
+
122
+ The `robosprawl` skill from `roboshed.skills` covers sandbox orientation and the HUD
123
+ file-link/markdown contract. Select it through
124
+ `Capability(auto_loaded_skills=(robosprawl,))` for compatible consumers. It uses project
125
+ paths supplied through `RoboSprawl.project_context` instead of choosing a sandbox layout.
@@ -0,0 +1,25 @@
1
+ [project]
2
+ name = "roboshed"
3
+ version = "0.1.0a3"
4
+ description = "roboshed: optional building blocks for Roboz"
5
+ readme = "README.md"
6
+ requires-python = ">=3.13"
7
+ authors = [{ name = "Tachion Oy" }]
8
+ license = "Apache-2.0"
9
+ license-files = ["LICENSE"]
10
+ import-names = ["roboshed"]
11
+ classifiers = ["Development Status :: 3 - Alpha", "Typing :: Typed"]
12
+ dependencies = ["roboz>=0.1.2.dev2,<0.2.0","pydantic>=2.12.4"]
13
+
14
+ [build-system]
15
+ requires = ["hatchling>=1.32"]
16
+ build-backend = "hatchling.build"
17
+
18
+ [tool.hatch.build.targets.wheel]
19
+ packages = ["src/roboshed"]
20
+
21
+ [project.urls]
22
+ Repository = "https://github.com/Tachion-Oy/roboz"
23
+
24
+ [tool.pytest.ini_options]
25
+ testpaths = ["tests"]
@@ -0,0 +1 @@
1
+ """Reusable tools and compositions built on Roboz."""
@@ -0,0 +1,6 @@
1
+ """Reusable agent presets built from Roboz primitives."""
2
+
3
+ from .librarian import librarian
4
+ from .orchestrator import orchestrator
5
+
6
+ __all__ = ["librarian", "orchestrator"]