multi-agent-platform 0.1.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.
- cli/__init__.py +0 -0
- cli/action_item_escalation.py +177 -0
- cli/agent_client.py +554 -0
- cli/bridge_state.py +43 -0
- cli/commands/__init__.py +13 -0
- cli/commands/action.py +142 -0
- cli/commands/agent.py +117 -0
- cli/commands/audit.py +68 -0
- cli/commands/docs.py +179 -0
- cli/commands/experiment.py +755 -0
- cli/commands/feedback.py +106 -0
- cli/commands/notification.py +213 -0
- cli/commands/persona.py +63 -0
- cli/commands/project.py +87 -0
- cli/commands/runtime.py +105 -0
- cli/commands/topic.py +361 -0
- cli/e2e_collab.py +602 -0
- cli/git_checkpoint.py +68 -0
- cli/host_worker_types.py +151 -0
- cli/main.py +1553 -0
- cli/map_command_client.py +497 -0
- cli/participant_worker.py +255 -0
- cli/reviewer_worker.py +263 -0
- cli/runtime/__init__.py +5 -0
- cli/runtime/run_lock.py +497 -0
- cli/runtime_chat.py +317 -0
- cli/session_wake_log.py +235 -0
- cli/simple_waker.py +950 -0
- cli/table_render.py +113 -0
- cli/wake_backend.py +236 -0
- cli/worker_cycle_log.py +36 -0
- map_client/__init__.py +37 -0
- map_client/bootstrap.py +193 -0
- map_client/client.py +1045 -0
- map_client/config.py +21 -0
- map_client/errors.py +283 -0
- map_client/exceptions.py +130 -0
- map_client/plan_evidence.py +159 -0
- map_client/project_config.py +153 -0
- map_client/result_template.py +167 -0
- map_client/testing.py +27 -0
- map_mcp/__init__.py +4 -0
- map_mcp/_utils.py +28 -0
- map_mcp/auth.py +34 -0
- map_mcp/config.py +50 -0
- map_mcp/context.py +39 -0
- map_mcp/main.py +75 -0
- map_mcp/server.py +573 -0
- map_mcp/session.py +79 -0
- map_sdk/__init__.py +29 -0
- map_sdk/evidence.py +68 -0
- map_types/__init__.py +203 -0
- map_types/enums.py +199 -0
- map_types/schemas.py +1351 -0
- multi_agent_platform-0.1.0.dist-info/METADATA +298 -0
- multi_agent_platform-0.1.0.dist-info/RECORD +144 -0
- multi_agent_platform-0.1.0.dist-info/WHEEL +5 -0
- multi_agent_platform-0.1.0.dist-info/entry_points.txt +6 -0
- multi_agent_platform-0.1.0.dist-info/licenses/LICENSE +21 -0
- multi_agent_platform-0.1.0.dist-info/top_level.txt +6 -0
- server/__init__.py +0 -0
- server/__version__.py +14 -0
- server/api/__init__.py +0 -0
- server/api/action_items.py +138 -0
- server/api/agents.py +412 -0
- server/api/audit.py +54 -0
- server/api/background_tasks.py +18 -0
- server/api/common.py +117 -0
- server/api/deps.py +30 -0
- server/api/experiments.py +858 -0
- server/api/feedback.py +75 -0
- server/api/notifications.py +22 -0
- server/api/projects.py +209 -0
- server/api/router.py +25 -0
- server/api/status.py +33 -0
- server/api/topics.py +302 -0
- server/api/webhooks.py +74 -0
- server/auth/__init__.py +8 -0
- server/auth/experiment_access.py +66 -0
- server/config.py +38 -0
- server/db/__init__.py +3 -0
- server/db/base.py +5 -0
- server/db/deadlock_retry.py +146 -0
- server/db/session.py +41 -0
- server/domain/__init__.py +3 -0
- server/domain/encrypted_types.py +63 -0
- server/domain/models.py +713 -0
- server/domain/schemas.py +3 -0
- server/domain/state_machine.py +79 -0
- server/domain/topic_ack_constants.py +9 -0
- server/main.py +148 -0
- server/scripts/__init__.py +0 -0
- server/scripts/migrate_notification_unique.py +231 -0
- server/scripts/purge_audit_pollution.py +116 -0
- server/services/__init__.py +0 -0
- server/services/_lookups.py +26 -0
- server/services/acceptance_service.py +90 -0
- server/services/action_item_migration_service.py +190 -0
- server/services/action_item_service.py +200 -0
- server/services/agent_work_service.py +405 -0
- server/services/archive_lint_service.py +156 -0
- server/services/audit_service.py +457 -0
- server/services/auth.py +66 -0
- server/services/comment_service.py +173 -0
- server/services/errors.py +65 -0
- server/services/escalation_resolver.py +248 -0
- server/services/evidence_service.py +88 -0
- server/services/experiment_capabilities_service.py +277 -0
- server/services/inbound_event_service.py +111 -0
- server/services/lock_service.py +273 -0
- server/services/log_service.py +202 -0
- server/services/mention_service.py +730 -0
- server/services/notification_service.py +939 -0
- server/services/notification_stream.py +138 -0
- server/services/permissions.py +147 -0
- server/services/persona_activity_service.py +108 -0
- server/services/phase_owner_resolver.py +95 -0
- server/services/phase_service.py +381 -0
- server/services/plan_marker_service.py +235 -0
- server/services/plan_service.py +186 -0
- server/services/platform_feedback_service.py +114 -0
- server/services/project_service.py +534 -0
- server/services/project_status_service.py +132 -0
- server/services/review_service.py +707 -0
- server/services/secret_encryption.py +97 -0
- server/services/similarity_service.py +119 -0
- server/services/sse_event_schemas.py +17 -0
- server/services/status_service.py +68 -0
- server/services/template_service.py +134 -0
- server/services/text_utils.py +19 -0
- server/services/thread_activity.py +180 -0
- server/services/todo_persona_filter.py +73 -0
- server/services/todo_service.py +604 -0
- server/services/topic_ack_service.py +312 -0
- server/services/topic_action_item_ops.py +538 -0
- server/services/topic_comment_kind.py +14 -0
- server/services/topic_comment_service.py +237 -0
- server/services/topic_helpers.py +32 -0
- server/services/topic_lifecycle_service.py +478 -0
- server/services/topic_progress_service.py +40 -0
- server/services/topic_resolve_service.py +234 -0
- server/services/topic_service.py +102 -0
- server/services/topic_work_item_service.py +570 -0
- server/services/webhook_service.py +273 -0
cli/host_worker_types.py
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Any, Protocol
|
|
6
|
+
|
|
7
|
+
DEFAULT_REPLY_TEMPLATE = """已收到这个 thread 的反馈。
|
|
8
|
+
|
|
9
|
+
- 评论摘要:{excerpt}
|
|
10
|
+
- 处理状态:已纳入主持跟进;如需进入实验,我会在本话题完成必要讨论后从 host persona 创建关联实验。
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class WorkerError(RuntimeError):
|
|
15
|
+
pass
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class MapClientProtocol(Protocol):
|
|
19
|
+
def whoami(self) -> dict[str, Any]:
|
|
20
|
+
...
|
|
21
|
+
|
|
22
|
+
def todos(self) -> dict[str, Any]:
|
|
23
|
+
...
|
|
24
|
+
|
|
25
|
+
def topic_show(self, topic_id: str) -> dict[str, Any]:
|
|
26
|
+
...
|
|
27
|
+
|
|
28
|
+
def topic_comment(self, topic_id: str, body: str, parent_id: str | None = None) -> dict[str, Any] | None:
|
|
29
|
+
...
|
|
30
|
+
|
|
31
|
+
def topic_advance_round(self, topic_id: str) -> dict[str, Any] | None:
|
|
32
|
+
...
|
|
33
|
+
|
|
34
|
+
def topic_resolve(self, topic_id: str, payload: dict[str, Any]) -> dict[str, Any] | None:
|
|
35
|
+
...
|
|
36
|
+
|
|
37
|
+
def experiment_create(
|
|
38
|
+
self,
|
|
39
|
+
title: str,
|
|
40
|
+
plan_file: Path,
|
|
41
|
+
*,
|
|
42
|
+
topic_id: str,
|
|
43
|
+
submit_for_review: bool,
|
|
44
|
+
) -> dict[str, Any] | None:
|
|
45
|
+
...
|
|
46
|
+
|
|
47
|
+
def experiment_status(self, experiment_id: str) -> dict[str, Any]:
|
|
48
|
+
...
|
|
49
|
+
|
|
50
|
+
def experiment_submit_review(self, experiment_id: str) -> dict[str, Any] | None:
|
|
51
|
+
...
|
|
52
|
+
|
|
53
|
+
def experiment_reviews_list(self, experiment_id: str) -> list[dict[str, Any]]:
|
|
54
|
+
...
|
|
55
|
+
|
|
56
|
+
def plan_revise(
|
|
57
|
+
self,
|
|
58
|
+
experiment_id: str,
|
|
59
|
+
plan_file: Path,
|
|
60
|
+
*,
|
|
61
|
+
note: str | None,
|
|
62
|
+
addressed_item_ids: list[str],
|
|
63
|
+
) -> dict[str, Any] | None:
|
|
64
|
+
...
|
|
65
|
+
|
|
66
|
+
def experiment_approve(self, experiment_id: str) -> dict[str, Any] | None:
|
|
67
|
+
...
|
|
68
|
+
|
|
69
|
+
def experiment_start(self, experiment_id: str) -> dict[str, Any] | None:
|
|
70
|
+
...
|
|
71
|
+
|
|
72
|
+
def experiment_complete(self, experiment_id: str, *, summary: str, log_file: Path) -> dict[str, Any] | None:
|
|
73
|
+
...
|
|
74
|
+
|
|
75
|
+
def experiment_acquire_lock(self, experiment_id: str, *, ttl_seconds: int) -> dict[str, Any] | None:
|
|
76
|
+
...
|
|
77
|
+
|
|
78
|
+
def experiment_release_lock(self, experiment_id: str) -> dict[str, Any] | None:
|
|
79
|
+
...
|
|
80
|
+
|
|
81
|
+
def experiment_force_release_lock(
|
|
82
|
+
self, experiment_id: str, *, reason: str, actor: str | None = None
|
|
83
|
+
) -> dict[str, Any] | None:
|
|
84
|
+
...
|
|
85
|
+
|
|
86
|
+
def experiment_record_skip(
|
|
87
|
+
self, experiment_id: str, *, next_attempt_at: str
|
|
88
|
+
) -> dict[str, Any] | None:
|
|
89
|
+
...
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
@dataclass
|
|
93
|
+
class WorkerConfig:
|
|
94
|
+
interval: float = 30.0
|
|
95
|
+
once: bool = False
|
|
96
|
+
max_cycles: int | None = None
|
|
97
|
+
dry_run: bool = False
|
|
98
|
+
reply_template: str = DEFAULT_REPLY_TEMPLATE
|
|
99
|
+
manage_topic_lifecycle: bool = True
|
|
100
|
+
promote_ready_topics: bool = False
|
|
101
|
+
submit_created_experiment_for_review: bool = False
|
|
102
|
+
min_participant_comments: int = 1
|
|
103
|
+
min_round_summaries: int = 2
|
|
104
|
+
max_lifecycle_actions_per_cycle: int = 1
|
|
105
|
+
auto_experiment_lifecycle: bool = True
|
|
106
|
+
plan_dir: Path | None = None
|
|
107
|
+
agent_runner: str | None = None
|
|
108
|
+
runner_timeout: float = 120.0
|
|
109
|
+
state_file: Path | None = Path(".map/host-bridge-state.json")
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
@dataclass
|
|
113
|
+
class WorkerStats:
|
|
114
|
+
cycles: int = 0
|
|
115
|
+
replies_created: int = 0
|
|
116
|
+
summaries_created: int = 0
|
|
117
|
+
decisions_recorded: int = 0
|
|
118
|
+
experiments_created: int = 0
|
|
119
|
+
plans_revised: int = 0
|
|
120
|
+
experiments_submitted: int = 0
|
|
121
|
+
experiments_approved: int = 0
|
|
122
|
+
experiments_started: int = 0
|
|
123
|
+
experiments_completed: int = 0
|
|
124
|
+
dry_run_actions: int = 0
|
|
125
|
+
runner_invocations: int = 0
|
|
126
|
+
runner_skips: int = 0
|
|
127
|
+
runner_errors: int = 0
|
|
128
|
+
round_advances: int = 0
|
|
129
|
+
lock_acquired: int = 0
|
|
130
|
+
lock_skipped: int = 0
|
|
131
|
+
lock_force_released: int = 0
|
|
132
|
+
|
|
133
|
+
def add(self, other: WorkerStats) -> None:
|
|
134
|
+
self.cycles += other.cycles
|
|
135
|
+
self.replies_created += other.replies_created
|
|
136
|
+
self.summaries_created += other.summaries_created
|
|
137
|
+
self.decisions_recorded += other.decisions_recorded
|
|
138
|
+
self.experiments_created += other.experiments_created
|
|
139
|
+
self.plans_revised += other.plans_revised
|
|
140
|
+
self.experiments_submitted += other.experiments_submitted
|
|
141
|
+
self.experiments_approved += other.experiments_approved
|
|
142
|
+
self.experiments_started += other.experiments_started
|
|
143
|
+
self.experiments_completed += other.experiments_completed
|
|
144
|
+
self.dry_run_actions += other.dry_run_actions
|
|
145
|
+
self.runner_invocations += other.runner_invocations
|
|
146
|
+
self.runner_skips += other.runner_skips
|
|
147
|
+
self.runner_errors += other.runner_errors
|
|
148
|
+
self.round_advances += other.round_advances
|
|
149
|
+
self.lock_acquired += other.lock_acquired
|
|
150
|
+
self.lock_skipped += other.lock_skipped
|
|
151
|
+
self.lock_force_released += other.lock_force_released
|