feat: initial bootstrap — structure, task_brief, blackboard, adapter bases, escalation, prompts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 02:19:14 -04:00
commit eaf7fd8f6f
33 changed files with 2141 additions and 0 deletions

64
adapters/base/runtime.py Normal file
View File

@@ -0,0 +1,64 @@
"""
adapters/base/runtime.py
Abstract base class for all agent-runtime adapters.
"""
from abc import ABC, abstractmethod
class RuntimeAdapter(ABC):
"""
Contract that every agent runtime adapter must fulfil.
A "runtime" is responsible for dispatching a task to an actual agent
(e.g. an OpenClaw worker, a Claude Code sub-agent, a local subprocess)
and retrieving its result.
"""
@abstractmethod
def spawn(self, task: str, capability: str, context: dict) -> str:
"""
Start an agent to work on the given task.
Parameters
----------
task : Natural-language description of the work to perform.
capability : Capability hint — "reasoning-heavy" | "capable" | "fast-cheap".
context : Arbitrary key/value bag (e.g. files, constraints, brief payload).
Returns
-------
A provider-specific agent_id string that can be used to poll for results.
"""
...
@abstractmethod
def get_result(self, agent_id: str, timeout_s: int) -> dict:
"""
Block until the agent completes or the timeout elapses.
Parameters
----------
agent_id : The id returned by spawn().
timeout_s : Maximum seconds to wait before raising TimeoutError.
Returns
-------
A dict containing at minimum:
{
"status": "done" | "failed" | "partial" | "blocked",
"output": <str or dict>,
"artifacts": [...], # optional
}
"""
...
@abstractmethod
def kill(self, agent_id: str) -> None:
"""
Terminate a running agent unconditionally.
Parameters
----------
agent_id : The id returned by spawn().
"""
...