@team-agent/installer 0.1.4 → 0.1.9
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.
- package/package.json +1 -2
- package/schemas/team.schema.json +1 -1
- package/src/team_agent/runtime.py +535 -30
- package/src/team_agent/spec.py +1 -1
- package/src/team_agent/state.py +15 -5
- package/tests/run_tests.py +0 -5474
package/src/team_agent/spec.py
CHANGED
|
@@ -196,7 +196,7 @@ def _check_runtime(runtime: Any, errors: list[str]) -> None:
|
|
|
196
196
|
return
|
|
197
197
|
if runtime.get("backend") not in {"tmux", "pty"}:
|
|
198
198
|
errors.append("/runtime/backend: invalid backend")
|
|
199
|
-
if runtime.get("display_backend") not in {"none", "tmux_attach", "iterm", "ghostty", "ghostty_window"}:
|
|
199
|
+
if runtime.get("display_backend") not in {"none", "tmux_attach", "iterm", "ghostty", "ghostty_window", "ghostty_workspace"}:
|
|
200
200
|
errors.append("/runtime/display_backend: invalid display backend")
|
|
201
201
|
if "dangerous_auto_approve" in runtime and not isinstance(runtime["dangerous_auto_approve"], bool):
|
|
202
202
|
errors.append("/runtime/dangerous_auto_approve: must be a boolean")
|
package/src/team_agent/state.py
CHANGED
|
@@ -10,12 +10,15 @@ from team_agent.paths import runtime_dir
|
|
|
10
10
|
from team_agent.simple_yaml import dumps
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
SESSION_CAPTURE_FIELDS = [
|
|
14
14
|
"session_id",
|
|
15
15
|
"rollout_path",
|
|
16
16
|
"captured_at",
|
|
17
17
|
"captured_via",
|
|
18
18
|
"attribution_confidence",
|
|
19
|
+
]
|
|
20
|
+
SESSION_STATE_FIELDS = [
|
|
21
|
+
*SESSION_CAPTURE_FIELDS,
|
|
19
22
|
"spawn_cwd",
|
|
20
23
|
]
|
|
21
24
|
|
|
@@ -24,15 +27,22 @@ def runtime_state_path(workspace: Path) -> Path:
|
|
|
24
27
|
return runtime_dir(workspace) / "state.json"
|
|
25
28
|
|
|
26
29
|
|
|
30
|
+
def normalize_agent_session_state(state: dict[str, Any]) -> None:
|
|
31
|
+
agents = state.get("agents", {})
|
|
32
|
+
if not isinstance(agents, dict):
|
|
33
|
+
return
|
|
34
|
+
for agent_state in agents.values():
|
|
35
|
+
if isinstance(agent_state, dict):
|
|
36
|
+
for field in SESSION_STATE_FIELDS:
|
|
37
|
+
agent_state.setdefault(field, None)
|
|
38
|
+
|
|
39
|
+
|
|
27
40
|
def load_runtime_state(workspace: Path) -> dict[str, Any]:
|
|
28
41
|
path = runtime_state_path(workspace)
|
|
29
42
|
if not path.exists():
|
|
30
43
|
return {"agents": {}, "tasks": [], "session_name": None}
|
|
31
44
|
state = json.loads(path.read_text(encoding="utf-8"))
|
|
32
|
-
|
|
33
|
-
if isinstance(agent_state, dict):
|
|
34
|
-
for field in SESSION_STATE_FIELDS:
|
|
35
|
-
agent_state.setdefault(field, None)
|
|
45
|
+
normalize_agent_session_state(state)
|
|
36
46
|
return state
|
|
37
47
|
|
|
38
48
|
|