multiagentos 0.4.0__py3-none-any.whl
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.
- agents/__init__.py +1 -0
- agents/catalog.py +52 -0
- agents/registry.py +11 -0
- core/__init__.py +38 -0
- core/artifacts.py +47 -0
- core/chat_agent_bridge.py +280 -0
- core/chat_agent_registry.py +61 -0
- core/chat_agent_router.py +85 -0
- core/chat_session.py +62 -0
- core/contracts/__init__.py +22 -0
- core/contracts/agent.py +21 -0
- core/contracts/ai.py +25 -0
- core/contracts/capability.py +44 -0
- core/contracts/chat_agent.py +34 -0
- core/contracts/checkpoint.py +78 -0
- core/contracts/discovery.py +30 -0
- core/contracts/execution.py +28 -0
- core/contracts/github.py +74 -0
- core/contracts/handoff.py +56 -0
- core/contracts/health.py +206 -0
- core/contracts/human_review.py +20 -0
- core/contracts/ide.py +113 -0
- core/contracts/mcp.py +76 -0
- core/contracts/model_runtime.py +25 -0
- core/contracts/planning.py +25 -0
- core/contracts/profile.py +66 -0
- core/contracts/quota.py +62 -0
- core/contracts/repository.py +34 -0
- core/contracts/resume.py +55 -0
- core/contracts/runtime.py +19 -0
- core/contracts/vyrelon_runtime.py +118 -0
- core/contracts/work_unit.py +48 -0
- core/delegation.py +33 -0
- core/handoff.py +68 -0
- core/lifecycle.py +85 -0
- core/multi_agent_workflow.py +574 -0
- core/orchestrator.py +51 -0
- core/planning.py +22 -0
- core/registry.py +44 -0
- core/routing.py +195 -0
- core/state.py +155 -0
- installer/__init__.py +1 -0
- installer/init.py +71 -0
- integrations/__init__.py +0 -0
- integrations/github/__init__.py +3 -0
- integrations/github/gateway.py +164 -0
- integrations/openai/__init__.py +1 -0
- integrations/openai/chat_agent.py +147 -0
- multiagentos/__init__.py +1 -0
- multiagentos/cli.py +759 -0
- multiagentos-0.4.0.dist-info/METADATA +7 -0
- multiagentos-0.4.0.dist-info/RECORD +122 -0
- multiagentos-0.4.0.dist-info/WHEEL +5 -0
- multiagentos-0.4.0.dist-info/entry_points.txt +2 -0
- multiagentos-0.4.0.dist-info/top_level.txt +7 -0
- profiles/__init__.py +1 -0
- profiles/common.py +11 -0
- profiles/detector.py +67 -0
- profiles/registry.py +46 -0
- profiles/resolver.py +63 -0
- runtime/__init__.py +5 -0
- runtime/agent/__init__.py +1 -0
- runtime/agent/ide.py +74 -0
- runtime/agent/model.py +197 -0
- runtime/agent/model_backed.py +49 -0
- runtime/agent/process.py +21 -0
- runtime/builtin_tools.py +57 -0
- runtime/capability.py +143 -0
- runtime/chat_adapter_registry.py +43 -0
- runtime/chat_config.py +57 -0
- runtime/chat_execution.py +52 -0
- runtime/config/__init__.py +1 -0
- runtime/config/loader.py +67 -0
- runtime/discovery.py +334 -0
- runtime/execution_config.py +71 -0
- runtime/execution_registry.py +50 -0
- runtime/git.py +84 -0
- runtime/github.py +56 -0
- runtime/github_probe.py +23 -0
- runtime/health.py +14 -0
- runtime/ide/__init__.py +6 -0
- runtime/ide/bridge.py +198 -0
- runtime/ide/registry.py +24 -0
- runtime/ide/runtime.py +35 -0
- runtime/local/__init__.py +18 -0
- runtime/local/filesystem.py +58 -0
- runtime/local/patch.py +79 -0
- runtime/local/path_security.py +31 -0
- runtime/local/permissions.py +20 -0
- runtime/local/process.py +56 -0
- runtime/local/shell.py +97 -0
- runtime/mcp/__init__.py +7 -0
- runtime/mcp/client.py +120 -0
- runtime/mcp/config.py +36 -0
- runtime/mcp/policy.py +57 -0
- runtime/mcp/proxy.py +30 -0
- runtime/mcp/server.py +137 -0
- runtime/mcp/session.py +19 -0
- runtime/model/__init__.py +5 -0
- runtime/model/ai_runtime.py +165 -0
- runtime/model/cli.py +49 -0
- runtime/model/config.py +98 -0
- runtime/model/credentials.py +42 -0
- runtime/model/factory.py +82 -0
- runtime/model/http.py +78 -0
- runtime/model/invoker.py +16 -0
- runtime/model/materializer.py +101 -0
- runtime/model/native.py +244 -0
- runtime/model/providers.py +55 -0
- runtime/model/registry.py +26 -0
- runtime/model/runtime_loader.py +51 -0
- runtime/model_control.py +136 -0
- runtime/multi_agent.py +142 -0
- runtime/policy.py +28 -0
- runtime/process.py +41 -0
- runtime/quota.py +259 -0
- runtime/repository.py +103 -0
- runtime/repository_tools.py +62 -0
- runtime/status.py +87 -0
- runtime/tool_calling.py +134 -0
- runtime/validation.py +121 -0
- runtime/vyrelon.py +1557 -0
core/handoff.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""Handoff and multi-review coordination."""
|
|
2
|
+
|
|
3
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
|
|
6
|
+
from core.contracts.agent import AgentContract
|
|
7
|
+
from core.contracts.handoff import HandoffArtifact, ReviewContext, ReviewResult
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class HandoffManager:
|
|
11
|
+
def create(self, work_unit_id, from_agent, to_agent, summary, artifacts=None, findings=None):
|
|
12
|
+
return HandoffArtifact(
|
|
13
|
+
work_unit_id=work_unit_id,
|
|
14
|
+
from_agent=from_agent.id,
|
|
15
|
+
to_agent=to_agent.id,
|
|
16
|
+
summary=summary,
|
|
17
|
+
artifacts=tuple(artifacts or ()),
|
|
18
|
+
findings=tuple(findings or ()),
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@dataclass(frozen=True)
|
|
23
|
+
class ReviewPanelResult:
|
|
24
|
+
approved: bool
|
|
25
|
+
reviews: tuple[ReviewResult, ...]
|
|
26
|
+
consensus: str
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ReviewPanel:
|
|
30
|
+
def review(self, work_unit_id, reviewers, reviewer_runner, parallel=True, context=None):
|
|
31
|
+
def run(item):
|
|
32
|
+
reviewer, reviewer_context = item
|
|
33
|
+
merged_context = dict(reviewer_context or {})
|
|
34
|
+
if context is not None:
|
|
35
|
+
if isinstance(context, ReviewContext):
|
|
36
|
+
merged_context.update({
|
|
37
|
+
"work_unit_id": context.work_unit_id,
|
|
38
|
+
"artifact_ids": context.artifact_ids,
|
|
39
|
+
"findings": context.findings,
|
|
40
|
+
"last_agent_id": context.last_agent_id,
|
|
41
|
+
"review_cycle": context.review_cycle,
|
|
42
|
+
"metadata": context.metadata,
|
|
43
|
+
})
|
|
44
|
+
else:
|
|
45
|
+
merged_context.update(dict(context))
|
|
46
|
+
result = reviewer_runner(
|
|
47
|
+
review_work_unit_id=work_unit_id,
|
|
48
|
+
reviewer=reviewer,
|
|
49
|
+
context=merged_context,
|
|
50
|
+
)
|
|
51
|
+
if hasattr(result, "reviewer_id"):
|
|
52
|
+
return result
|
|
53
|
+
return ReviewResult(
|
|
54
|
+
reviewer_id=reviewer.id,
|
|
55
|
+
approved=bool(result.approved),
|
|
56
|
+
feedback=str(getattr(result, "feedback", "")),
|
|
57
|
+
)
|
|
58
|
+
if parallel and len(reviewers) > 1:
|
|
59
|
+
with ThreadPoolExecutor(max_workers=len(reviewers)) as pool:
|
|
60
|
+
reviews = tuple(pool.map(run, reviewers))
|
|
61
|
+
else:
|
|
62
|
+
reviews = tuple(run(item) for item in reviewers)
|
|
63
|
+
approved = bool(reviews) and all(review.approved for review in reviews)
|
|
64
|
+
return ReviewPanelResult(
|
|
65
|
+
approved=approved,
|
|
66
|
+
reviews=reviews,
|
|
67
|
+
consensus="approved" if approved else "changes-requested",
|
|
68
|
+
)
|
core/lifecycle.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""Execution lifecycle coordinator for VYRELON."""
|
|
2
|
+
|
|
3
|
+
from core.contracts.agent import AgentContract
|
|
4
|
+
from core.contracts.ai import ModelSpec
|
|
5
|
+
from core.contracts.execution import AgentExecutor, ResultReviewer, ResultVerifier
|
|
6
|
+
from core.contracts.work_unit import WorkStatus, WorkUnit
|
|
7
|
+
from core.delegation import Delegation, DelegationEngine
|
|
8
|
+
from core.routing import RoutingStrategy
|
|
9
|
+
from collections.abc import Callable
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class LifecycleError(RuntimeError):
|
|
13
|
+
"""Raised when execution, verification, or review cannot complete successfully."""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ExecutionInterrupted(LifecycleError):
|
|
17
|
+
"""Raised when execution stops before completion and may be resumed."""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class LifecycleCoordinator:
|
|
21
|
+
"""Run delegated work through execution, verification, review, and completion."""
|
|
22
|
+
|
|
23
|
+
def __init__(self, delegation: DelegationEngine | None = None) -> None:
|
|
24
|
+
self.delegation = delegation or DelegationEngine()
|
|
25
|
+
|
|
26
|
+
def run(
|
|
27
|
+
self,
|
|
28
|
+
work_unit: WorkUnit,
|
|
29
|
+
agent: AgentContract,
|
|
30
|
+
models: list[ModelSpec],
|
|
31
|
+
executor: AgentExecutor,
|
|
32
|
+
verifier: ResultVerifier | None = None,
|
|
33
|
+
reviewer: ResultReviewer | None = None,
|
|
34
|
+
preferred_model_ids: list[str] | None = None,
|
|
35
|
+
routing_strategy: RoutingStrategy | str = RoutingStrategy.POOL,
|
|
36
|
+
checkpoint: Callable[[WorkUnit], None] | None = None,
|
|
37
|
+
) -> tuple[Delegation, object]:
|
|
38
|
+
delegation = self.delegation.delegate(
|
|
39
|
+
work_unit, agent, models, preferred_model_ids, routing_strategy
|
|
40
|
+
)
|
|
41
|
+
try:
|
|
42
|
+
if checkpoint is not None:
|
|
43
|
+
checkpoint(work_unit)
|
|
44
|
+
output = executor.execute(
|
|
45
|
+
agent=agent,
|
|
46
|
+
model_id=delegation.assignment.model_id,
|
|
47
|
+
work_unit=work_unit,
|
|
48
|
+
)
|
|
49
|
+
if verifier is not None:
|
|
50
|
+
work_unit.transition(WorkStatus.VERIFYING)
|
|
51
|
+
if checkpoint is not None:
|
|
52
|
+
checkpoint(work_unit)
|
|
53
|
+
if not verifier.verify(work_unit=work_unit, output=output):
|
|
54
|
+
work_unit.transition(WorkStatus.FAILED)
|
|
55
|
+
raise LifecycleError(f"Verification failed for work unit: {work_unit.id}")
|
|
56
|
+
if reviewer is not None:
|
|
57
|
+
if work_unit.status != WorkStatus.VERIFYING:
|
|
58
|
+
work_unit.transition(WorkStatus.VERIFYING)
|
|
59
|
+
work_unit.transition(WorkStatus.REVIEWING)
|
|
60
|
+
if checkpoint is not None:
|
|
61
|
+
checkpoint(work_unit)
|
|
62
|
+
decision = reviewer.review(work_unit=work_unit, output=output)
|
|
63
|
+
if not decision.approved:
|
|
64
|
+
work_unit.transition(WorkStatus.FAILED)
|
|
65
|
+
raise LifecycleError(f"Review rejected work unit: {work_unit.id}")
|
|
66
|
+
if verifier is not None or reviewer is not None:
|
|
67
|
+
work_unit.transition(WorkStatus.HANDOFF)
|
|
68
|
+
if checkpoint is not None:
|
|
69
|
+
checkpoint(work_unit)
|
|
70
|
+
work_unit.transition(WorkStatus.COMPLETED)
|
|
71
|
+
else:
|
|
72
|
+
work_unit.transition(WorkStatus.COMPLETED)
|
|
73
|
+
if checkpoint is not None:
|
|
74
|
+
checkpoint(work_unit)
|
|
75
|
+
return delegation, output
|
|
76
|
+
except ExecutionInterrupted:
|
|
77
|
+
if checkpoint is not None:
|
|
78
|
+
checkpoint(work_unit)
|
|
79
|
+
raise
|
|
80
|
+
except Exception:
|
|
81
|
+
if work_unit.status not in {WorkStatus.FAILED, WorkStatus.COMPLETED}:
|
|
82
|
+
work_unit.transition(WorkStatus.FAILED)
|
|
83
|
+
if checkpoint is not None:
|
|
84
|
+
checkpoint(work_unit)
|
|
85
|
+
raise
|