roboz 0.1.2.dev2__tar.gz → 0.1.2.dev3__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 → roboz-0.1.2.dev3}/CHANGELOG.md +17 -1
  2. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/PKG-INFO +11 -9
  3. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/README.md +10 -6
  4. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/pyproject.toml +1 -2
  5. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/deployment.py +71 -29
  6. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/.gitignore +0 -0
  7. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/LICENSE +0 -0
  8. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/__init__.py +0 -0
  9. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/_naming.py +0 -0
  10. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/agent/__init__.py +0 -0
  11. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/agent/_execution_context.py +0 -0
  12. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/agent/_identifiers.py +0 -0
  13. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/agent/_notifications.py +0 -0
  14. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/agent/_prompts.py +0 -0
  15. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/agent/_tool_observer.py +0 -0
  16. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/agent/background_agent.py +0 -0
  17. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/agent/core.py +0 -0
  18. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/agent/prompt_agent_tool.py +0 -0
  19. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/agent/subagent.py +0 -0
  20. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/dependencies.py +0 -0
  21. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/exceptions.py +0 -0
  22. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/llm/__init__.py +0 -0
  23. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/llm/_diagnostics.py +0 -0
  24. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/llm/_retry.py +0 -0
  25. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/llm/_truncation.py +0 -0
  26. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/llm/binding.py +0 -0
  27. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/llm/calls.py +0 -0
  28. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/llm/completion.py +0 -0
  29. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/llm/endpoints.py +0 -0
  30. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/llm/openrouter.py +0 -0
  31. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/llm/prompts.py +0 -0
  32. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/models/__init__.py +0 -0
  33. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/models/_schema.py +0 -0
  34. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/models/_serialization.py +0 -0
  35. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/models/_telemetry.py +0 -0
  36. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/models/core.py +0 -0
  37. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/models/truncation.py +0 -0
  38. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/py.typed +0 -0
  39. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/runtime/__init__.py +0 -0
  40. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/runtime/_environment.py +0 -0
  41. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/runtime/_external.py +0 -0
  42. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/runtime/_logging.py +0 -0
  43. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/runtime/_paths.py +0 -0
  44. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/runtime/events.py +0 -0
  45. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/runtime/io.py +0 -0
  46. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/runtime/observability.py +0 -0
  47. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/runtime/persistence/__init__.py +0 -0
  48. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/runtime/persistence/activity.py +0 -0
  49. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/runtime/persistence/schema.py +0 -0
  50. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/runtime/pipe.py +0 -0
  51. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/runtime/sinks.py +0 -0
  52. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/skill/__init__.py +0 -0
  53. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/skill/_prompts.py +0 -0
  54. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/skill/core.py +0 -0
  55. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/tooling/__init__.py +0 -0
  56. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/tooling/_prompts.py +0 -0
  57. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/tooling/_protocols.py +0 -0
  58. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/tooling/_typing.py +0 -0
  59. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/tooling/context.py +0 -0
  60. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/tooling/core.py +0 -0
  61. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/tooling/decorators.py +0 -0
  62. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/tools/__init__.py +0 -0
  63. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/tools/_identifiers.py +0 -0
  64. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/tools/control.py +0 -0
  65. {roboz-0.1.2.dev2 → roboz-0.1.2.dev3}/src/roboz/tools/interaction.py +0 -0
@@ -2,6 +2,22 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.1.2.dev3 - 2026-09-11
6
+
7
+ - Breaking: remove the redundant `roboz[shed]` installation extra. Install
8
+ `roboshed` directly; it installs its compatible core Roboz dependency.
9
+
10
+ - Add `DeployableAgent.build_graph()` to return the root agent and all background
11
+ handles for host lifecycle control. `build()` still returns the root alone.
12
+
13
+ - Breaking: replace `AgentDefinition` and `SubAgentSpec` with recursive
14
+ `DeployableAgent` definitions. Put child definitions directly in `subagents`
15
+ or `background_agents`; delegation tools use the child's name and description,
16
+ and background agents start through default tools. Construct generic
17
+ definitions directly with `DeployableAgent(...)`.
18
+ Sandbox-aware `Deployment` lives in `roboshed.deployments`, not core.
19
+ See `docs/agent-factories.md` for migration.
20
+
5
21
  ## 0.1.2.dev2 - 2026-09-09
6
22
 
7
23
  - Breaking: remove the `roboz[openai]` extra. Install
@@ -20,7 +36,7 @@
20
36
  references retain identity and deferred resolution. See
21
37
  `docs/agent-factories.md` for builder migration.
22
38
 
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.
39
+ - Breaking: move the Librarian and its memory/summarization tools out of core into `roboshed.agents` and `roboshed.tools`. Use `librarian(sandbox, agent_names, agent_endpoint=...)` instead of `LibrarianConstructor` and its path record; see `docs/agent-factories.md`. Core retains control, interaction, and generic construction primitives.
24
40
 
25
41
  - 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
42
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: roboz
3
- Version: 0.1.2.dev2
3
+ Version: 0.1.2.dev3
4
4
  Import-Name: roboz
5
5
  Summary: Typed primitives for composable agentic workflows
6
6
  Project-URL: Homepage, https://github.com/Tachion-Oy/roboz
@@ -25,8 +25,6 @@ Requires-Dist: python-dotenv>=1.2.1
25
25
  Requires-Dist: rich>=14.2.0
26
26
  Provides-Extra: proton-bridge-beta
27
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
28
  Description-Content-Type: text/markdown
31
29
 
32
30
  # Roboz
@@ -170,12 +168,16 @@ Install `roboz-endpoints[openai]` for the initial OpenRouter, Cerebras, and Groq
170
168
  catalogues; it installs core automatically. See the
171
169
  [endpoint guide](packages/endpoints/README.md) for model selection and SDK adapters.
172
170
 
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`.
171
+ `roboz.deployment` supplies recursive `DeployableAgent` definitions and
172
+ capability contracts. Put definitions directly in `subagents` or
173
+ `background_agents`. Capabilities accept tool-specific endpoints and use the
174
+ owning agent's endpoint as their default. `roboshed` supplies reusable
175
+ orchestrator and Librarian constructors, concrete capabilities, memory tools,
176
+ and sandbox structure. Import the constructors from `roboshed.agents`; concrete
177
+ RoboSprawl configuration belongs to the external application. Sandbox-aware
178
+ assembly lives in `roboshed.deployments.Deployment`: configure
179
+ `deployment.sandbox.configure_scope(folder)` and `deployment.event_sinks`, then
180
+ unpack `agent, background_agents = deployment.build()`.
179
181
 
180
182
  ## Documentation
181
183
 
@@ -139,12 +139,16 @@ Install `roboz-endpoints[openai]` for the initial OpenRouter, Cerebras, and Groq
139
139
  catalogues; it installs core automatically. See the
140
140
  [endpoint guide](packages/endpoints/README.md) for model selection and SDK adapters.
141
141
 
142
- `roboz.deployment` supplies generic agent definitions, capability contracts,
143
- and specialist composition. Capabilities accept tool-specific endpoints and pass
144
- them directly to their tools, using the owning agent's endpoint as the default. `roboshed` supplies orchestrator/Librarian
145
- 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`,
146
- alongside `roboshed.tools` and `roboshed.skills`. The project deployment lives in
147
- `roboshed.deployments.robosprawl`; agent presets live in `roboshed.agents`.
142
+ `roboz.deployment` supplies recursive `DeployableAgent` definitions and
143
+ capability contracts. Put definitions directly in `subagents` or
144
+ `background_agents`. Capabilities accept tool-specific endpoints and use the
145
+ owning agent's endpoint as their default. `roboshed` supplies reusable
146
+ orchestrator and Librarian constructors, concrete capabilities, memory tools,
147
+ and sandbox structure. Import the constructors from `roboshed.agents`; concrete
148
+ RoboSprawl configuration belongs to the external application. Sandbox-aware
149
+ assembly lives in `roboshed.deployments.Deployment`: configure
150
+ `deployment.sandbox.configure_scope(folder)` and `deployment.event_sinks`, then
151
+ unpack `agent, background_agents = deployment.build()`.
148
152
 
149
153
  ## Documentation
150
154
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "roboz"
3
- version = "0.1.2.dev2"
3
+ version = "0.1.2.dev3"
4
4
  description = "Typed primitives for composable agentic workflows"
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Tachion Oy" }]
@@ -30,7 +30,6 @@ requires = ["hatchling>=1.32"]
30
30
  build-backend = "hatchling.build"
31
31
 
32
32
  [project.optional-dependencies]
33
- shed = ["roboshed>=0.1.0a2,<0.2.0"]
34
33
  proton-bridge-beta = ["roboz-proton-bridge>=0.1.0b1,<0.2.0"]
35
34
 
36
35
  [tool.uv.workspace]
@@ -1,11 +1,13 @@
1
1
  """Data-driven agent definitions and runtime-bound capabilities."""
2
2
 
3
+ from __future__ import annotations
4
+
3
5
  from collections.abc import Callable, Sequence
4
6
  from dataclasses import dataclass
5
7
  from pathlib import Path
6
8
  from typing import Protocol
7
9
 
8
- from roboz.agent import Agent, run_subagent
10
+ from roboz.agent import Agent, run_background_agent, run_subagent
9
11
  from roboz.llm import EndpointLike
10
12
  from roboz.runtime import EventPipe, EventSink, Output
11
13
  from roboz.skill import Skill
@@ -48,24 +50,19 @@ class Capability(AgentCapability):
48
50
  return self
49
51
 
50
52
 
51
- @dataclass(frozen=True)
52
- class SubAgentSpec:
53
- """A specialist definition and its parent-facing tool identity."""
54
-
55
- definition: "AgentDefinition"
56
- tool_name: str
57
- tool_description: str
58
-
59
-
60
53
  @dataclass(frozen=True, kw_only=True)
61
- class AgentDefinition:
62
- """Configured inputs for independently constructing an agent runtime.
54
+ class DeployableAgent:
55
+ """One agent's configuration, including its sub-agents and background agents.
63
56
 
64
57
  All tools and skills enter through capabilities. Already-bound inputs and
65
58
  endpoint dependencies are supplied objects; callers own their reuse. Scripted
66
59
  mock endpoints that consume responses must be recreated for each run.
67
- Each capability selects its tool endpoints, using the agent endpoint as
68
- the default. Endpoint objects remain independent of runtime controls.
60
+ Configure definitions before building; do not mutate them concurrently with
61
+ construction. Each capability selects its tool endpoints, using the agent
62
+ endpoint as the default. Endpoint objects remain independent of runtime controls.
63
+ Sub-agents become named delegation tools. Background agents are started
64
+ through default tools when their parent runs. Both slots contain the same
65
+ recursive definition type.
69
66
  """
70
67
 
71
68
  name: str
@@ -76,14 +73,24 @@ class AgentDefinition:
76
73
  is_agentic: bool = True
77
74
  automatic_tool_prompt: bool = True
78
75
  capabilities: tuple[AgentCapability, ...] = ()
79
- subagents: tuple[SubAgentSpec, ...] = ()
76
+ subagents: tuple["DeployableAgent", ...] = ()
77
+ background_agents: tuple["DeployableAgent", ...] = ()
80
78
  initial_messages: tuple[Path | str, ...] = ()
81
79
 
82
- def agent_names(self) -> frozenset[str]:
83
- """Return recursive agent identities, rejecting ambiguous names."""
80
+ def agent_names(self, *, include_background: bool = True) -> frozenset[str]:
81
+ """Validate all names and return identities in the selected branches.
82
+
83
+ Excluding background agents also excludes their descendants, for
84
+ foreground-only consumers such as conversation maintenance.
85
+ """
86
+ if not include_background:
87
+ self.agent_names()
84
88
  names = {self.name}
85
- for spec in self.subagents:
86
- children = spec.definition.agent_names()
89
+ definitions = self.subagents
90
+ if include_background:
91
+ definitions += self.background_agents
92
+ for definition in definitions:
93
+ children = definition.agent_names(include_background=include_background)
87
94
  if names & children:
88
95
  raise ValueError("agent names must be unique")
89
96
  names.update(children)
@@ -97,9 +104,28 @@ class AgentDefinition:
97
104
  ) -> Agent:
98
105
  """Create fresh pipes, resolve capabilities, and construct the agent once.
99
106
 
100
- Caller sinks follow specialists. The optional factory supplies fresh
107
+ Caller sinks follow synchronous children. The optional factory supplies fresh
101
108
  agent-specific sinks by name; these are never inherited by children.
102
109
  Without supplied sinks, construction selects no output or persistence.
110
+ Use build_graph() to retain background agents for host control.
111
+ """
112
+ return self.build_graph(
113
+ event_sinks=event_sinks, event_sink_factory=event_sink_factory
114
+ )[0]
115
+
116
+ def build_graph(
117
+ self,
118
+ *,
119
+ event_sinks: Sequence[EventSink] = (),
120
+ event_sink_factory: Callable[[str], Sequence[EventSink]] | None = None,
121
+ ) -> tuple[Agent, tuple[Agent, ...]]:
122
+ """Build fresh agents and return the root and all background handles.
123
+
124
+ Validate names before constructing capabilities or sinks. Sink routing
125
+ follows build(): caller sinks reach foreground branches only, and the
126
+ factory supplies each agent's own sinks. Background handles include
127
+ descendants of both child slots. No agents are started by construction;
128
+ callers own their invocation and shutdown.
103
129
  """
104
130
  self.agent_names()
105
131
  pipe = EventPipe(
@@ -115,16 +141,32 @@ class AgentDefinition:
115
141
  )
116
142
 
117
143
  tools = [tool for contribution in contributions for tool in contribution.tools]
118
- for spec in self.subagents:
119
- child = spec.definition.build(
144
+ default_tools = [tool for c in contributions for tool in c.default_tools]
145
+ background_agents: list[Agent] = []
146
+ for definition in self.subagents:
147
+ child, descendants = definition.build_graph(
120
148
  event_sinks=event_sinks, event_sink_factory=event_sink_factory
121
149
  )
122
- delegation = run_subagent(Ctx(agent=child)).copy(
123
- name=spec.tool_name, description=spec.tool_description
150
+ tools.append(
151
+ run_subagent(Ctx(agent=child)).copy(
152
+ name=child.name,
153
+ description=child.description,
154
+ )
155
+ )
156
+ background_agents.extend(descendants)
157
+ for definition in self.background_agents:
158
+ child, descendants = definition.build_graph(
159
+ event_sink_factory=event_sink_factory
160
+ )
161
+ default_tools.append(
162
+ run_background_agent(Ctx(agent=child)).copy(
163
+ name=f"start_background_agent_{child.name}",
164
+ )
124
165
  )
125
- tools.append(delegation)
166
+ background_agents.append(child)
167
+ background_agents.extend(descendants)
126
168
 
127
- return Agent(
169
+ agent = Agent(
128
170
  name=self.name,
129
171
  description=self.description,
130
172
  agent_endpoint=self.agent_endpoint,
@@ -134,18 +176,18 @@ class AgentDefinition:
134
176
  automatic_tool_prompt=self.automatic_tool_prompt,
135
177
  system_prompt=self.system_prompt,
136
178
  tools=tools,
137
- default_tools=[tool for c in contributions for tool in c.default_tools],
179
+ default_tools=default_tools,
138
180
  skills=[skill for c in contributions for skill in c.skills],
139
181
  auto_loaded_skills=[
140
182
  skill for c in contributions for skill in c.auto_loaded_skills
141
183
  ],
142
184
  initial_messages=self.initial_messages,
143
185
  )
186
+ return agent, tuple(background_agents)
144
187
 
145
188
 
146
189
  __all__ = [
147
190
  "AgentCapability",
148
- "AgentDefinition",
149
191
  "Capability",
150
- "SubAgentSpec",
192
+ "DeployableAgent",
151
193
  ]
File without changes
File without changes