@mindfoldhq/trellis 0.3.10-beta.0 → 0.3.10
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/dist/cli/index.js +0 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +31 -203
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +6 -154
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/workflow.d.ts +2 -6
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +58 -88
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/migrations/index.d.ts +0 -1
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +0 -2
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/manifests/0.3.10.json +9 -0
- package/dist/templates/claude/agents/dispatch.md +2 -1
- package/dist/templates/claude/agents/implement.md +3 -2
- package/dist/templates/claude/commands/trellis/before-backend-dev.md +13 -0
- package/dist/templates/claude/commands/trellis/before-frontend-dev.md +13 -0
- package/dist/templates/claude/commands/trellis/check-backend.md +13 -0
- package/dist/templates/claude/commands/trellis/check-frontend.md +13 -0
- package/dist/templates/claude/commands/trellis/create-command.md +2 -2
- package/dist/templates/claude/commands/trellis/onboard.md +13 -13
- package/dist/templates/claude/commands/trellis/parallel.md +2 -1
- package/dist/templates/claude/commands/trellis/record-session.md +2 -2
- package/dist/templates/claude/commands/trellis/start.md +4 -8
- package/dist/templates/claude/hooks/inject-subagent-context.py +13 -21
- package/dist/templates/claude/hooks/session-start.py +2 -170
- package/dist/templates/codex/skills/before-backend-dev/SKILL.md +18 -0
- package/dist/templates/codex/skills/before-frontend-dev/SKILL.md +18 -0
- package/dist/templates/codex/skills/check-backend/SKILL.md +18 -0
- package/dist/templates/codex/skills/check-frontend/SKILL.md +18 -0
- package/dist/templates/codex/skills/create-command/SKILL.md +2 -2
- package/dist/templates/codex/skills/onboard/SKILL.md +11 -11
- package/dist/templates/codex/skills/record-session/SKILL.md +2 -2
- package/dist/templates/codex/skills/start/SKILL.md +3 -8
- package/dist/templates/cursor/commands/trellis-before-backend-dev.md +13 -0
- package/dist/templates/cursor/commands/trellis-before-frontend-dev.md +13 -0
- package/dist/templates/cursor/commands/trellis-check-backend.md +13 -0
- package/dist/templates/cursor/commands/trellis-check-frontend.md +13 -0
- package/dist/templates/cursor/commands/trellis-create-command.md +2 -2
- package/dist/templates/cursor/commands/trellis-onboard.md +13 -13
- package/dist/templates/cursor/commands/trellis-record-session.md +2 -2
- package/dist/templates/cursor/commands/trellis-start.md +16 -7
- package/dist/templates/gemini/commands/trellis/before-backend-dev.toml +17 -0
- package/dist/templates/gemini/commands/trellis/before-frontend-dev.toml +17 -0
- package/dist/templates/gemini/commands/trellis/check-backend.toml +17 -0
- package/dist/templates/gemini/commands/trellis/check-frontend.toml +17 -0
- package/dist/templates/gemini/commands/trellis/create-command.toml +2 -2
- package/dist/templates/gemini/commands/trellis/onboard.toml +2 -2
- package/dist/templates/gemini/commands/trellis/record-session.toml +2 -2
- package/dist/templates/gemini/commands/trellis/start.toml +4 -9
- package/dist/templates/iflow/agents/dispatch.md +2 -1
- package/dist/templates/iflow/agents/implement.md +3 -2
- package/dist/templates/iflow/commands/trellis/before-backend-dev.md +13 -0
- package/dist/templates/iflow/commands/trellis/before-frontend-dev.md +13 -0
- package/dist/templates/iflow/commands/trellis/check-backend.md +13 -0
- package/dist/templates/iflow/commands/trellis/check-frontend.md +13 -0
- package/dist/templates/iflow/commands/trellis/create-command.md +2 -2
- package/dist/templates/iflow/commands/trellis/onboard.md +13 -13
- package/dist/templates/iflow/commands/trellis/parallel.md +2 -1
- package/dist/templates/iflow/commands/trellis/record-session.md +2 -2
- package/dist/templates/iflow/commands/trellis/start.md +4 -8
- package/dist/templates/iflow/hooks/inject-subagent-context.py +13 -21
- package/dist/templates/iflow/hooks/session-start.py +1 -156
- package/dist/templates/kilo/workflows/before-backend-dev.md +13 -0
- package/dist/templates/kilo/workflows/before-frontend-dev.md +13 -0
- package/dist/templates/kilo/workflows/check-backend.md +13 -0
- package/dist/templates/kilo/workflows/check-frontend.md +13 -0
- package/dist/templates/kilo/workflows/create-command.md +2 -2
- package/dist/templates/kilo/workflows/onboard.md +13 -13
- package/dist/templates/kilo/workflows/parallel.md +2 -1
- package/dist/templates/kilo/workflows/record-session.md +2 -2
- package/dist/templates/kilo/workflows/start.md +3 -8
- package/dist/templates/kiro/skills/before-backend-dev/SKILL.md +18 -0
- package/dist/templates/kiro/skills/before-frontend-dev/SKILL.md +18 -0
- package/dist/templates/kiro/skills/check-backend/SKILL.md +18 -0
- package/dist/templates/kiro/skills/check-frontend/SKILL.md +18 -0
- package/dist/templates/kiro/skills/create-command/SKILL.md +2 -2
- package/dist/templates/kiro/skills/onboard/SKILL.md +11 -11
- package/dist/templates/kiro/skills/record-session/SKILL.md +2 -2
- package/dist/templates/kiro/skills/start/SKILL.md +3 -8
- package/dist/templates/markdown/spec/backend/script-conventions.md +0 -93
- package/dist/templates/opencode/agents/dispatch.md +2 -1
- package/dist/templates/opencode/agents/implement.md +2 -2
- package/dist/templates/opencode/agents/research.md +2 -1
- package/dist/templates/opencode/commands/trellis/before-backend-dev.md +13 -0
- package/dist/templates/opencode/commands/trellis/before-frontend-dev.md +13 -0
- package/dist/templates/opencode/commands/trellis/check-backend.md +13 -0
- package/dist/templates/opencode/commands/trellis/check-frontend.md +13 -0
- package/dist/templates/opencode/commands/trellis/create-command.md +2 -2
- package/dist/templates/opencode/commands/trellis/onboard.md +13 -13
- package/dist/templates/opencode/commands/trellis/parallel.md +2 -1
- package/dist/templates/opencode/commands/trellis/record-session.md +2 -2
- package/dist/templates/opencode/commands/trellis/start.md +3 -8
- package/dist/templates/opencode/plugin/inject-subagent-context.js +18 -45
- package/dist/templates/opencode/plugin/session-start.js +1 -149
- package/dist/templates/qoder/skills/before-backend-dev/SKILL.md +18 -0
- package/dist/templates/qoder/skills/before-frontend-dev/SKILL.md +18 -0
- package/dist/templates/qoder/skills/check-backend/SKILL.md +18 -0
- package/dist/templates/qoder/skills/check-frontend/SKILL.md +18 -0
- package/dist/templates/qoder/skills/create-command/SKILL.md +2 -2
- package/dist/templates/qoder/skills/onboard/SKILL.md +13 -13
- package/dist/templates/qoder/skills/record-session/SKILL.md +2 -2
- package/dist/templates/qoder/skills/start/SKILL.md +3 -8
- package/dist/templates/trellis/config.yaml +0 -20
- package/dist/templates/trellis/index.d.ts +0 -11
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +0 -22
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/add_session.py +7 -52
- package/dist/templates/trellis/scripts/common/cli_adapter.py +45 -33
- package/dist/templates/trellis/scripts/common/config.py +0 -152
- package/dist/templates/trellis/scripts/common/git_context.py +586 -23
- package/dist/templates/trellis/scripts/common/paths.py +0 -46
- package/dist/templates/trellis/scripts/common/phase.py +49 -50
- package/dist/templates/trellis/scripts/common/registry.py +72 -41
- package/dist/templates/trellis/scripts/common/task_queue.py +98 -27
- package/dist/templates/trellis/scripts/common/task_utils.py +6 -96
- package/dist/templates/trellis/scripts/create_bootstrap.py +26 -31
- package/dist/templates/trellis/scripts/multi_agent/cleanup.py +48 -43
- package/dist/templates/trellis/scripts/multi_agent/create_pr.py +45 -336
- package/dist/templates/trellis/scripts/multi_agent/plan.py +26 -2
- package/dist/templates/trellis/scripts/multi_agent/start.py +57 -126
- package/dist/templates/trellis/scripts/multi_agent/status.py +753 -12
- package/dist/templates/trellis/scripts/task.py +975 -50
- package/dist/templates/trellis/workflow.md +34 -21
- package/dist/types/migration.d.ts +1 -3
- package/dist/types/migration.d.ts.map +1 -1
- package/dist/utils/project-detector.d.ts +0 -23
- package/dist/utils/project-detector.d.ts.map +1 -1
- package/dist/utils/project-detector.js +0 -364
- package/dist/utils/project-detector.js.map +1 -1
- package/dist/utils/template-fetcher.d.ts +10 -2
- package/dist/utils/template-fetcher.d.ts.map +1 -1
- package/dist/utils/template-fetcher.js +43 -12
- package/dist/utils/template-fetcher.js.map +1 -1
- package/package.json +1 -1
- package/dist/migrations/manifests/0.4.0-beta.1.json +0 -228
- package/dist/templates/claude/commands/trellis/before-dev.md +0 -29
- package/dist/templates/claude/commands/trellis/check.md +0 -25
- package/dist/templates/codex/skills/before-dev/SKILL.md +0 -34
- package/dist/templates/codex/skills/check/SKILL.md +0 -30
- package/dist/templates/cursor/commands/trellis-before-dev.md +0 -29
- package/dist/templates/cursor/commands/trellis-check.md +0 -25
- package/dist/templates/gemini/commands/trellis/before-dev.toml +0 -33
- package/dist/templates/gemini/commands/trellis/check.toml +0 -29
- package/dist/templates/iflow/commands/trellis/before-dev.md +0 -29
- package/dist/templates/iflow/commands/trellis/check.md +0 -25
- package/dist/templates/kilo/workflows/before-dev.md +0 -29
- package/dist/templates/kilo/workflows/check.md +0 -25
- package/dist/templates/kiro/skills/before-dev/SKILL.md +0 -34
- package/dist/templates/kiro/skills/check/SKILL.md +0 -30
- package/dist/templates/opencode/commands/trellis/before-dev.md +0 -29
- package/dist/templates/opencode/commands/trellis/check.md +0 -25
- package/dist/templates/qoder/skills/before-dev/SKILL.md +0 -34
- package/dist/templates/qoder/skills/check/SKILL.md +0 -30
- package/dist/templates/trellis/scripts/common/git.py +0 -31
- package/dist/templates/trellis/scripts/common/io.py +0 -37
- package/dist/templates/trellis/scripts/common/log.py +0 -45
- package/dist/templates/trellis/scripts/common/packages_context.py +0 -233
- package/dist/templates/trellis/scripts/common/session_context.py +0 -466
- package/dist/templates/trellis/scripts/common/task_context.py +0 -384
- package/dist/templates/trellis/scripts/common/task_store.py +0 -534
- package/dist/templates/trellis/scripts/common/tasks.py +0 -109
- package/dist/templates/trellis/scripts/common/types.py +0 -112
- package/dist/templates/trellis/scripts/hooks/linear_sync.py +0 -243
- package/dist/templates/trellis/scripts/multi_agent/_bootstrap.py +0 -17
- package/dist/templates/trellis/scripts/multi_agent/status_display.py +0 -542
- package/dist/templates/trellis/scripts/multi_agent/status_monitor.py +0 -225
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
Multi-Agent Pipeline: Process monitoring and log parsing.
|
|
4
|
-
|
|
5
|
-
Provides:
|
|
6
|
-
tail_follow - Follow a file like 'tail -f'
|
|
7
|
-
get_last_tool - Get last tool call from agent log
|
|
8
|
-
get_last_message - Get last assistant text from agent log
|
|
9
|
-
cmd_watch - Watch agent log in real-time
|
|
10
|
-
cmd_log - Show recent log entries
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
from __future__ import annotations
|
|
14
|
-
|
|
15
|
-
import json
|
|
16
|
-
import time
|
|
17
|
-
from pathlib import Path
|
|
18
|
-
|
|
19
|
-
from common.log import Colors
|
|
20
|
-
|
|
21
|
-
from .status_display import find_agent
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
# =============================================================================
|
|
25
|
-
# Log Parsing
|
|
26
|
-
# =============================================================================
|
|
27
|
-
|
|
28
|
-
def tail_follow(file_path: Path) -> None:
|
|
29
|
-
"""Follow a file like 'tail -f', cross-platform compatible."""
|
|
30
|
-
with open(file_path, "r", encoding="utf-8", errors="replace") as f:
|
|
31
|
-
# Seek to end of file
|
|
32
|
-
f.seek(0, 2)
|
|
33
|
-
|
|
34
|
-
while True:
|
|
35
|
-
line = f.readline()
|
|
36
|
-
if line:
|
|
37
|
-
print(line, end="", flush=True)
|
|
38
|
-
else:
|
|
39
|
-
time.sleep(0.1)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
def get_last_tool(log_file: Path, platform: str = "claude") -> str | None:
|
|
43
|
-
"""Get the last tool call from agent log.
|
|
44
|
-
|
|
45
|
-
Supports both Claude Code and OpenCode log formats.
|
|
46
|
-
|
|
47
|
-
Claude Code format:
|
|
48
|
-
{"type": "assistant", "message": {"content": [{"type": "tool_use", "name": "Read"}]}}
|
|
49
|
-
|
|
50
|
-
OpenCode format:
|
|
51
|
-
{"type": "tool_use", "tool": "bash", "state": {"status": "completed"}}
|
|
52
|
-
"""
|
|
53
|
-
if not log_file.is_file():
|
|
54
|
-
return None
|
|
55
|
-
|
|
56
|
-
try:
|
|
57
|
-
lines = log_file.read_text(encoding="utf-8").splitlines()
|
|
58
|
-
for line in reversed(lines[-100:]):
|
|
59
|
-
try:
|
|
60
|
-
data = json.loads(line)
|
|
61
|
-
|
|
62
|
-
if platform == "opencode":
|
|
63
|
-
# OpenCode format: {"type": "tool_use", "tool": "bash", ...}
|
|
64
|
-
if data.get("type") == "tool_use":
|
|
65
|
-
return data.get("tool")
|
|
66
|
-
else:
|
|
67
|
-
# Claude Code format: {"type": "assistant", "message": {"content": [...]}}
|
|
68
|
-
if data.get("type") == "assistant":
|
|
69
|
-
content = data.get("message", {}).get("content", [])
|
|
70
|
-
for item in content:
|
|
71
|
-
if item.get("type") == "tool_use":
|
|
72
|
-
return item.get("name")
|
|
73
|
-
except json.JSONDecodeError:
|
|
74
|
-
continue
|
|
75
|
-
except Exception:
|
|
76
|
-
pass
|
|
77
|
-
return None
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
def get_last_message(log_file: Path, max_len: int = 100, platform: str = "claude") -> str | None:
|
|
81
|
-
"""Get the last assistant text from agent log.
|
|
82
|
-
|
|
83
|
-
Supports both Claude Code and OpenCode log formats.
|
|
84
|
-
|
|
85
|
-
Claude Code format:
|
|
86
|
-
{"type": "assistant", "message": {"content": [{"type": "text", "text": "..."}]}}
|
|
87
|
-
|
|
88
|
-
OpenCode format:
|
|
89
|
-
{"type": "text", "text": "..."}
|
|
90
|
-
"""
|
|
91
|
-
if not log_file.is_file():
|
|
92
|
-
return None
|
|
93
|
-
|
|
94
|
-
try:
|
|
95
|
-
lines = log_file.read_text(encoding="utf-8").splitlines()
|
|
96
|
-
for line in reversed(lines[-100:]):
|
|
97
|
-
try:
|
|
98
|
-
data = json.loads(line)
|
|
99
|
-
|
|
100
|
-
if platform == "opencode":
|
|
101
|
-
# OpenCode format: {"type": "text", "text": "..."}
|
|
102
|
-
if data.get("type") == "text":
|
|
103
|
-
text = data.get("text", "")
|
|
104
|
-
if text:
|
|
105
|
-
return text[:max_len]
|
|
106
|
-
else:
|
|
107
|
-
# Claude Code format: {"type": "assistant", "message": {"content": [...]}}
|
|
108
|
-
if data.get("type") == "assistant":
|
|
109
|
-
content = data.get("message", {}).get("content", [])
|
|
110
|
-
for item in content:
|
|
111
|
-
if item.get("type") == "text":
|
|
112
|
-
text = item.get("text", "")
|
|
113
|
-
if text:
|
|
114
|
-
return text[:max_len]
|
|
115
|
-
except json.JSONDecodeError:
|
|
116
|
-
continue
|
|
117
|
-
except Exception:
|
|
118
|
-
pass
|
|
119
|
-
return None
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
# =============================================================================
|
|
123
|
-
# Commands
|
|
124
|
-
# =============================================================================
|
|
125
|
-
|
|
126
|
-
def cmd_watch(target: str, repo_root: Path) -> int:
|
|
127
|
-
"""Watch agent log in real-time."""
|
|
128
|
-
agent = find_agent(target, repo_root)
|
|
129
|
-
if not agent:
|
|
130
|
-
print(f"Agent not found: {target}")
|
|
131
|
-
return 1
|
|
132
|
-
|
|
133
|
-
worktree = agent.get("worktree_path", "")
|
|
134
|
-
log_file = Path(worktree) / ".agent-log"
|
|
135
|
-
|
|
136
|
-
if not log_file.is_file():
|
|
137
|
-
print(f"Log file not found: {log_file}")
|
|
138
|
-
return 1
|
|
139
|
-
|
|
140
|
-
print(f"{Colors.BLUE}Watching:{Colors.NC} {log_file}")
|
|
141
|
-
print(f"{Colors.DIM}Press Ctrl+C to stop{Colors.NC}")
|
|
142
|
-
print()
|
|
143
|
-
|
|
144
|
-
try:
|
|
145
|
-
tail_follow(log_file)
|
|
146
|
-
except KeyboardInterrupt:
|
|
147
|
-
print() # Clean newline after Ctrl+C
|
|
148
|
-
return 0
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
def cmd_log(target: str, repo_root: Path) -> int:
|
|
152
|
-
"""Show recent log entries."""
|
|
153
|
-
agent = find_agent(target, repo_root)
|
|
154
|
-
if not agent:
|
|
155
|
-
print(f"Agent not found: {target}")
|
|
156
|
-
return 1
|
|
157
|
-
|
|
158
|
-
worktree = agent.get("worktree_path", "")
|
|
159
|
-
platform = agent.get("platform", "claude")
|
|
160
|
-
log_file = Path(worktree) / ".agent-log"
|
|
161
|
-
|
|
162
|
-
if not log_file.is_file():
|
|
163
|
-
print(f"Log file not found: {log_file}")
|
|
164
|
-
return 1
|
|
165
|
-
|
|
166
|
-
print(f"{Colors.BLUE}=== Recent Log: {target} ==={Colors.NC}")
|
|
167
|
-
print(f"{Colors.DIM}Platform: {platform}{Colors.NC}")
|
|
168
|
-
print()
|
|
169
|
-
|
|
170
|
-
lines = log_file.read_text(encoding="utf-8").splitlines()
|
|
171
|
-
for line in lines[-50:]:
|
|
172
|
-
try:
|
|
173
|
-
data = json.loads(line)
|
|
174
|
-
msg_type = data.get("type", "")
|
|
175
|
-
|
|
176
|
-
if platform == "opencode":
|
|
177
|
-
# OpenCode format
|
|
178
|
-
if msg_type == "text":
|
|
179
|
-
text = data.get("text", "")
|
|
180
|
-
if text:
|
|
181
|
-
display = text[:300]
|
|
182
|
-
if len(text) > 300:
|
|
183
|
-
display += "..."
|
|
184
|
-
print(f"{Colors.BLUE}[TEXT]{Colors.NC} {display}")
|
|
185
|
-
elif msg_type == "tool_use":
|
|
186
|
-
tool_name = data.get("tool", "unknown")
|
|
187
|
-
status = data.get("state", {}).get("status", "")
|
|
188
|
-
print(f"{Colors.YELLOW}[TOOL]{Colors.NC} {tool_name} ({status})")
|
|
189
|
-
elif msg_type == "step_start":
|
|
190
|
-
print(f"{Colors.CYAN}[STEP]{Colors.NC} Start")
|
|
191
|
-
elif msg_type == "step_finish":
|
|
192
|
-
reason = data.get("reason", "")
|
|
193
|
-
print(f"{Colors.CYAN}[STEP]{Colors.NC} Finish ({reason})")
|
|
194
|
-
elif msg_type == "error":
|
|
195
|
-
error_msg = data.get("message", "")
|
|
196
|
-
print(f"{Colors.RED}[ERROR]{Colors.NC} {error_msg}")
|
|
197
|
-
else:
|
|
198
|
-
# Claude Code format
|
|
199
|
-
if msg_type == "system":
|
|
200
|
-
subtype = data.get("subtype", "")
|
|
201
|
-
print(f"{Colors.CYAN}[SYSTEM]{Colors.NC} {subtype}")
|
|
202
|
-
elif msg_type == "user":
|
|
203
|
-
content = data.get("message", {}).get("content", "")
|
|
204
|
-
if content:
|
|
205
|
-
print(f"{Colors.GREEN}[USER]{Colors.NC} {content[:200]}")
|
|
206
|
-
elif msg_type == "assistant":
|
|
207
|
-
content = data.get("message", {}).get("content", [])
|
|
208
|
-
if content:
|
|
209
|
-
item = content[0]
|
|
210
|
-
text = item.get("text")
|
|
211
|
-
tool = item.get("name")
|
|
212
|
-
if text:
|
|
213
|
-
display = text[:300]
|
|
214
|
-
if len(text) > 300:
|
|
215
|
-
display += "..."
|
|
216
|
-
print(f"{Colors.BLUE}[ASSISTANT]{Colors.NC} {display}")
|
|
217
|
-
elif tool:
|
|
218
|
-
print(f"{Colors.YELLOW}[TOOL]{Colors.NC} {tool}")
|
|
219
|
-
elif msg_type == "result":
|
|
220
|
-
tool_name = data.get("tool", "unknown")
|
|
221
|
-
print(f"{Colors.DIM}[RESULT]{Colors.NC} {tool_name} completed")
|
|
222
|
-
except json.JSONDecodeError:
|
|
223
|
-
continue
|
|
224
|
-
|
|
225
|
-
return 0
|