tapps-agents 3.5.41__py3-none-any.whl → 3.6.1__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.
- tapps_agents/__init__.py +2 -2
- tapps_agents/agents/reviewer/scoring.py +1566 -1566
- tapps_agents/agents/reviewer/tools/__init__.py +41 -41
- tapps_agents/cli/commands/health.py +665 -665
- tapps_agents/cli/commands/top_level.py +3586 -3586
- tapps_agents/core/artifact_context_builder.py +293 -0
- tapps_agents/core/config.py +33 -0
- tapps_agents/health/orchestrator.py +271 -271
- tapps_agents/resources/__init__.py +5 -0
- tapps_agents/resources/claude/__init__.py +1 -0
- tapps_agents/resources/claude/commands/README.md +156 -0
- tapps_agents/resources/claude/commands/__init__.py +1 -0
- tapps_agents/resources/claude/commands/build-fix.md +22 -0
- tapps_agents/resources/claude/commands/build.md +77 -0
- tapps_agents/resources/claude/commands/debug.md +53 -0
- tapps_agents/resources/claude/commands/design.md +68 -0
- tapps_agents/resources/claude/commands/docs.md +53 -0
- tapps_agents/resources/claude/commands/e2e.md +22 -0
- tapps_agents/resources/claude/commands/fix.md +54 -0
- tapps_agents/resources/claude/commands/implement.md +53 -0
- tapps_agents/resources/claude/commands/improve.md +53 -0
- tapps_agents/resources/claude/commands/library-docs.md +64 -0
- tapps_agents/resources/claude/commands/lint.md +52 -0
- tapps_agents/resources/claude/commands/plan.md +65 -0
- tapps_agents/resources/claude/commands/refactor-clean.md +21 -0
- tapps_agents/resources/claude/commands/refactor.md +55 -0
- tapps_agents/resources/claude/commands/review.md +67 -0
- tapps_agents/resources/claude/commands/score.md +60 -0
- tapps_agents/resources/claude/commands/security-review.md +22 -0
- tapps_agents/resources/claude/commands/security-scan.md +54 -0
- tapps_agents/resources/claude/commands/tdd.md +24 -0
- tapps_agents/resources/claude/commands/test-coverage.md +21 -0
- tapps_agents/resources/claude/commands/test.md +54 -0
- tapps_agents/resources/claude/commands/update-codemaps.md +20 -0
- tapps_agents/resources/claude/commands/update-docs.md +21 -0
- tapps_agents/resources/claude/skills/__init__.py +1 -0
- tapps_agents/resources/claude/skills/analyst/SKILL.md +272 -0
- tapps_agents/resources/claude/skills/analyst/__init__.py +1 -0
- tapps_agents/resources/claude/skills/architect/SKILL.md +282 -0
- tapps_agents/resources/claude/skills/architect/__init__.py +1 -0
- tapps_agents/resources/claude/skills/backend-patterns/SKILL.md +30 -0
- tapps_agents/resources/claude/skills/backend-patterns/__init__.py +1 -0
- tapps_agents/resources/claude/skills/coding-standards/SKILL.md +29 -0
- tapps_agents/resources/claude/skills/coding-standards/__init__.py +1 -0
- tapps_agents/resources/claude/skills/debugger/SKILL.md +203 -0
- tapps_agents/resources/claude/skills/debugger/__init__.py +1 -0
- tapps_agents/resources/claude/skills/designer/SKILL.md +243 -0
- tapps_agents/resources/claude/skills/designer/__init__.py +1 -0
- tapps_agents/resources/claude/skills/documenter/SKILL.md +252 -0
- tapps_agents/resources/claude/skills/documenter/__init__.py +1 -0
- tapps_agents/resources/claude/skills/enhancer/SKILL.md +307 -0
- tapps_agents/resources/claude/skills/enhancer/__init__.py +1 -0
- tapps_agents/resources/claude/skills/evaluator/SKILL.md +204 -0
- tapps_agents/resources/claude/skills/evaluator/__init__.py +1 -0
- tapps_agents/resources/claude/skills/frontend-patterns/SKILL.md +29 -0
- tapps_agents/resources/claude/skills/frontend-patterns/__init__.py +1 -0
- tapps_agents/resources/claude/skills/implementer/SKILL.md +188 -0
- tapps_agents/resources/claude/skills/implementer/__init__.py +1 -0
- tapps_agents/resources/claude/skills/improver/SKILL.md +218 -0
- tapps_agents/resources/claude/skills/improver/__init__.py +1 -0
- tapps_agents/resources/claude/skills/ops/SKILL.md +281 -0
- tapps_agents/resources/claude/skills/ops/__init__.py +1 -0
- tapps_agents/resources/claude/skills/orchestrator/SKILL.md +390 -0
- tapps_agents/resources/claude/skills/orchestrator/__init__.py +1 -0
- tapps_agents/resources/claude/skills/planner/SKILL.md +254 -0
- tapps_agents/resources/claude/skills/planner/__init__.py +1 -0
- tapps_agents/resources/claude/skills/reviewer/SKILL.md +434 -0
- tapps_agents/resources/claude/skills/reviewer/__init__.py +1 -0
- tapps_agents/resources/claude/skills/security-review/SKILL.md +31 -0
- tapps_agents/resources/claude/skills/security-review/__init__.py +1 -0
- tapps_agents/resources/claude/skills/simple-mode/SKILL.md +695 -0
- tapps_agents/resources/claude/skills/simple-mode/__init__.py +1 -0
- tapps_agents/resources/claude/skills/tester/SKILL.md +219 -0
- tapps_agents/resources/claude/skills/tester/__init__.py +1 -0
- tapps_agents/resources/cursor/.cursorignore +35 -0
- tapps_agents/resources/cursor/__init__.py +1 -0
- tapps_agents/resources/cursor/commands/__init__.py +1 -0
- tapps_agents/resources/cursor/commands/build-fix.md +11 -0
- tapps_agents/resources/cursor/commands/build.md +11 -0
- tapps_agents/resources/cursor/commands/e2e.md +11 -0
- tapps_agents/resources/cursor/commands/fix.md +11 -0
- tapps_agents/resources/cursor/commands/refactor-clean.md +11 -0
- tapps_agents/resources/cursor/commands/review.md +11 -0
- tapps_agents/resources/cursor/commands/security-review.md +11 -0
- tapps_agents/resources/cursor/commands/tdd.md +11 -0
- tapps_agents/resources/cursor/commands/test-coverage.md +11 -0
- tapps_agents/resources/cursor/commands/test.md +11 -0
- tapps_agents/resources/cursor/commands/update-codemaps.md +10 -0
- tapps_agents/resources/cursor/commands/update-docs.md +11 -0
- tapps_agents/resources/cursor/rules/__init__.py +1 -0
- tapps_agents/resources/cursor/rules/agent-capabilities.mdc +687 -0
- tapps_agents/resources/cursor/rules/coding-style.mdc +31 -0
- tapps_agents/resources/cursor/rules/command-reference.mdc +2081 -0
- tapps_agents/resources/cursor/rules/cursor-mode-usage.mdc +125 -0
- tapps_agents/resources/cursor/rules/git-workflow.mdc +29 -0
- tapps_agents/resources/cursor/rules/performance.mdc +29 -0
- tapps_agents/resources/cursor/rules/project-context.mdc +163 -0
- tapps_agents/resources/cursor/rules/project-profiling.mdc +197 -0
- tapps_agents/resources/cursor/rules/quick-reference.mdc +630 -0
- tapps_agents/resources/cursor/rules/security.mdc +32 -0
- tapps_agents/resources/cursor/rules/simple-mode.mdc +500 -0
- tapps_agents/resources/cursor/rules/testing.mdc +31 -0
- tapps_agents/resources/cursor/rules/when-to-use.mdc +156 -0
- tapps_agents/resources/cursor/rules/workflow-presets.mdc +179 -0
- tapps_agents/resources/customizations/__init__.py +1 -0
- tapps_agents/resources/customizations/example-custom.yaml +83 -0
- tapps_agents/resources/hooks/__init__.py +1 -0
- tapps_agents/resources/hooks/templates/README.md +5 -0
- tapps_agents/resources/hooks/templates/__init__.py +1 -0
- tapps_agents/resources/hooks/templates/add-project-context.yaml +8 -0
- tapps_agents/resources/hooks/templates/auto-format-js.yaml +10 -0
- tapps_agents/resources/hooks/templates/auto-format-python.yaml +10 -0
- tapps_agents/resources/hooks/templates/git-commit-check.yaml +7 -0
- tapps_agents/resources/hooks/templates/notify-on-complete.yaml +8 -0
- tapps_agents/resources/hooks/templates/quality-gate.yaml +8 -0
- tapps_agents/resources/hooks/templates/security-scan-on-edit.yaml +10 -0
- tapps_agents/resources/hooks/templates/session-end-log.yaml +7 -0
- tapps_agents/resources/hooks/templates/show-beads-ready.yaml +8 -0
- tapps_agents/resources/hooks/templates/test-on-edit.yaml +10 -0
- tapps_agents/resources/hooks/templates/update-docs-on-complete.yaml +8 -0
- tapps_agents/resources/hooks/templates/user-prompt-log.yaml +7 -0
- tapps_agents/resources/scripts/__init__.py +1 -0
- tapps_agents/resources/scripts/set_bd_path.ps1 +51 -0
- tapps_agents/resources/workflows/__init__.py +1 -0
- tapps_agents/resources/workflows/presets/__init__.py +1 -0
- tapps_agents/resources/workflows/presets/brownfield-analysis.yaml +235 -0
- tapps_agents/resources/workflows/presets/fix.yaml +78 -0
- tapps_agents/resources/workflows/presets/full-sdlc.yaml +122 -0
- tapps_agents/resources/workflows/presets/quality.yaml +82 -0
- tapps_agents/resources/workflows/presets/rapid-dev.yaml +84 -0
- tapps_agents/simple_mode/orchestrators/base.py +185 -185
- tapps_agents/simple_mode/orchestrators/build_orchestrator.py +2700 -2667
- tapps_agents/simple_mode/orchestrators/fix_orchestrator.py +723 -723
- tapps_agents/workflow/cursor_executor.py +2337 -2337
- tapps_agents/workflow/message_formatter.py +188 -188
- {tapps_agents-3.5.41.dist-info → tapps_agents-3.6.1.dist-info}/METADATA +6 -6
- {tapps_agents-3.5.41.dist-info → tapps_agents-3.6.1.dist-info}/RECORD +141 -18
- {tapps_agents-3.5.41.dist-info → tapps_agents-3.6.1.dist-info}/WHEEL +0 -0
- {tapps_agents-3.5.41.dist-info → tapps_agents-3.6.1.dist-info}/entry_points.txt +0 -0
- {tapps_agents-3.5.41.dist-info → tapps_agents-3.6.1.dist-info}/licenses/LICENSE +0 -0
- {tapps_agents-3.5.41.dist-info → tapps_agents-3.6.1.dist-info}/top_level.txt +0 -0
|
@@ -1,185 +1,185 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Base orchestrator interface for Simple Mode.
|
|
3
|
-
|
|
4
|
-
Integrates optional hook system: UserPromptSubmit before workflow,
|
|
5
|
-
PostToolUse after implementer tool use, WorkflowComplete after workflow ends.
|
|
6
|
-
Hooks are opt-in (no behavior change when hooks disabled).
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
from __future__ import annotations
|
|
10
|
-
|
|
11
|
-
import logging
|
|
12
|
-
from abc import ABC, abstractmethod
|
|
13
|
-
from pathlib import Path
|
|
14
|
-
from typing import TYPE_CHECKING, Any
|
|
15
|
-
|
|
16
|
-
from tapps_agents.core.config import ProjectConfig
|
|
17
|
-
|
|
18
|
-
if TYPE_CHECKING:
|
|
19
|
-
from ..intent_parser import Intent
|
|
20
|
-
|
|
21
|
-
logger = logging.getLogger(__name__)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def _get_hook_manager(project_root: Path) -> Any:
|
|
25
|
-
"""
|
|
26
|
-
Load HookManager for project if hooks are configured.
|
|
27
|
-
|
|
28
|
-
Returns None when hooks.yaml is missing or has no enabled hooks (opt-in).
|
|
29
|
-
"""
|
|
30
|
-
try:
|
|
31
|
-
from tapps_agents.hooks.config import load_hooks_config
|
|
32
|
-
from tapps_agents.hooks.manager import HookManager
|
|
33
|
-
|
|
34
|
-
config = load_hooks_config(project_root=project_root)
|
|
35
|
-
has_any = any(
|
|
36
|
-
any(h.enabled for h in hooks)
|
|
37
|
-
for hooks in config.hooks.values()
|
|
38
|
-
)
|
|
39
|
-
if not has_any:
|
|
40
|
-
return None
|
|
41
|
-
return HookManager(project_root=project_root)
|
|
42
|
-
except Exception as e: # pylint: disable=broad-except
|
|
43
|
-
logger.debug("Hooks not loaded (opt-in): %s", e)
|
|
44
|
-
return None
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
class SimpleModeOrchestrator(ABC):
|
|
48
|
-
"""Base class for Simple Mode orchestrators."""
|
|
49
|
-
|
|
50
|
-
def __init__(
|
|
51
|
-
self,
|
|
52
|
-
project_root: Path | None = None,
|
|
53
|
-
config: ProjectConfig | None = None,
|
|
54
|
-
):
|
|
55
|
-
"""
|
|
56
|
-
Initialize orchestrator.
|
|
57
|
-
|
|
58
|
-
Args:
|
|
59
|
-
project_root: Project root directory
|
|
60
|
-
config: Optional project configuration
|
|
61
|
-
"""
|
|
62
|
-
self.project_root = project_root or Path.cwd()
|
|
63
|
-
self.config = config
|
|
64
|
-
self._hook_manager = None # Lazy-loaded when needed
|
|
65
|
-
|
|
66
|
-
def _get_hook_manager(self) -> Any:
|
|
67
|
-
"""Return HookManager if hooks are enabled for this project; else None."""
|
|
68
|
-
if self._hook_manager is None:
|
|
69
|
-
self._hook_manager = _get_hook_manager(self.project_root)
|
|
70
|
-
return self._hook_manager
|
|
71
|
-
|
|
72
|
-
def _trigger_user_prompt_submit(
|
|
73
|
-
self,
|
|
74
|
-
prompt: str,
|
|
75
|
-
workflow_type: str | None = None,
|
|
76
|
-
) -> None:
|
|
77
|
-
"""
|
|
78
|
-
Fire UserPromptSubmit hook before workflow execution.
|
|
79
|
-
|
|
80
|
-
No-op when hooks disabled or no hooks configured for this event.
|
|
81
|
-
"""
|
|
82
|
-
mgr = self._get_hook_manager()
|
|
83
|
-
if not mgr:
|
|
84
|
-
return
|
|
85
|
-
try:
|
|
86
|
-
from tapps_agents.hooks.events import UserPromptSubmitEvent
|
|
87
|
-
|
|
88
|
-
payload = UserPromptSubmitEvent(
|
|
89
|
-
prompt=prompt,
|
|
90
|
-
project_root=str(self.project_root),
|
|
91
|
-
workflow_type=workflow_type,
|
|
92
|
-
)
|
|
93
|
-
mgr.trigger("UserPromptSubmit", payload)
|
|
94
|
-
except Exception as e: # pylint: disable=broad-except
|
|
95
|
-
logger.debug("UserPromptSubmit hook error (non-fatal): %s", e)
|
|
96
|
-
|
|
97
|
-
def _trigger_post_tool_use(
|
|
98
|
-
self,
|
|
99
|
-
tool_name: str,
|
|
100
|
-
file_path: str | None,
|
|
101
|
-
file_paths: list[str] | None = None,
|
|
102
|
-
workflow_id: str | None = None,
|
|
103
|
-
) -> None:
|
|
104
|
-
"""
|
|
105
|
-
Fire PostToolUse hook after implementer Write/Edit.
|
|
106
|
-
|
|
107
|
-
No-op when hooks disabled or no matching hooks.
|
|
108
|
-
"""
|
|
109
|
-
mgr = self._get_hook_manager()
|
|
110
|
-
if not mgr:
|
|
111
|
-
return
|
|
112
|
-
try:
|
|
113
|
-
from tapps_agents.hooks.events import PostToolUseEvent
|
|
114
|
-
|
|
115
|
-
payload = PostToolUseEvent(
|
|
116
|
-
file_path=file_path,
|
|
117
|
-
file_paths=file_paths or ([file_path] if file_path else []),
|
|
118
|
-
tool_name=tool_name,
|
|
119
|
-
project_root=str(self.project_root),
|
|
120
|
-
workflow_id=workflow_id,
|
|
121
|
-
)
|
|
122
|
-
mgr.trigger(
|
|
123
|
-
"PostToolUse",
|
|
124
|
-
payload,
|
|
125
|
-
tool_name=tool_name,
|
|
126
|
-
file_path=file_path,
|
|
127
|
-
)
|
|
128
|
-
except Exception as e: # pylint: disable=broad-except
|
|
129
|
-
logger.debug("PostToolUse hook error (non-fatal): %s", e)
|
|
130
|
-
|
|
131
|
-
def _trigger_workflow_complete(
|
|
132
|
-
self,
|
|
133
|
-
workflow_type: str,
|
|
134
|
-
workflow_id: str,
|
|
135
|
-
status: str,
|
|
136
|
-
beads_issue_id: str | None = None,
|
|
137
|
-
) -> None:
|
|
138
|
-
"""
|
|
139
|
-
Fire WorkflowComplete hook after workflow ends.
|
|
140
|
-
|
|
141
|
-
status: 'completed', 'failed', or 'cancelled'.
|
|
142
|
-
No-op when hooks disabled.
|
|
143
|
-
"""
|
|
144
|
-
mgr = self._get_hook_manager()
|
|
145
|
-
if not mgr:
|
|
146
|
-
return
|
|
147
|
-
try:
|
|
148
|
-
from tapps_agents.hooks.events import WorkflowCompleteEvent
|
|
149
|
-
|
|
150
|
-
payload = WorkflowCompleteEvent(
|
|
151
|
-
workflow_type=workflow_type,
|
|
152
|
-
workflow_id=workflow_id,
|
|
153
|
-
status=status,
|
|
154
|
-
project_root=str(self.project_root),
|
|
155
|
-
beads_issue_id=beads_issue_id,
|
|
156
|
-
)
|
|
157
|
-
mgr.trigger("WorkflowComplete", payload)
|
|
158
|
-
except Exception as e: # pylint: disable=broad-except
|
|
159
|
-
logger.debug("WorkflowComplete hook error (non-fatal): %s", e)
|
|
160
|
-
|
|
161
|
-
@abstractmethod
|
|
162
|
-
async def execute(
|
|
163
|
-
self, intent: Intent, parameters: dict[str, Any] | None = None
|
|
164
|
-
) -> dict[str, Any]:
|
|
165
|
-
"""
|
|
166
|
-
Execute the orchestrator's workflow.
|
|
167
|
-
|
|
168
|
-
Args:
|
|
169
|
-
intent: Parsed user intent
|
|
170
|
-
parameters: Additional parameters from user input
|
|
171
|
-
|
|
172
|
-
Returns:
|
|
173
|
-
Dictionary with execution results
|
|
174
|
-
"""
|
|
175
|
-
pass
|
|
176
|
-
|
|
177
|
-
def get_agent_sequence(self) -> list[str]:
|
|
178
|
-
"""
|
|
179
|
-
Get the sequence of agents this orchestrator coordinates.
|
|
180
|
-
|
|
181
|
-
Returns:
|
|
182
|
-
List of agent names in execution order
|
|
183
|
-
"""
|
|
184
|
-
return []
|
|
185
|
-
|
|
1
|
+
"""
|
|
2
|
+
Base orchestrator interface for Simple Mode.
|
|
3
|
+
|
|
4
|
+
Integrates optional hook system: UserPromptSubmit before workflow,
|
|
5
|
+
PostToolUse after implementer tool use, WorkflowComplete after workflow ends.
|
|
6
|
+
Hooks are opt-in (no behavior change when hooks disabled).
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import logging
|
|
12
|
+
from abc import ABC, abstractmethod
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
from typing import TYPE_CHECKING, Any
|
|
15
|
+
|
|
16
|
+
from tapps_agents.core.config import ProjectConfig
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from ..intent_parser import Intent
|
|
20
|
+
|
|
21
|
+
logger = logging.getLogger(__name__)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _get_hook_manager(project_root: Path) -> Any:
|
|
25
|
+
"""
|
|
26
|
+
Load HookManager for project if hooks are configured.
|
|
27
|
+
|
|
28
|
+
Returns None when hooks.yaml is missing or has no enabled hooks (opt-in).
|
|
29
|
+
"""
|
|
30
|
+
try:
|
|
31
|
+
from tapps_agents.hooks.config import load_hooks_config
|
|
32
|
+
from tapps_agents.hooks.manager import HookManager
|
|
33
|
+
|
|
34
|
+
config = load_hooks_config(project_root=project_root)
|
|
35
|
+
has_any = any(
|
|
36
|
+
any(h.enabled for h in hooks)
|
|
37
|
+
for hooks in config.hooks.values()
|
|
38
|
+
)
|
|
39
|
+
if not has_any:
|
|
40
|
+
return None
|
|
41
|
+
return HookManager(project_root=project_root)
|
|
42
|
+
except Exception as e: # pylint: disable=broad-except
|
|
43
|
+
logger.debug("Hooks not loaded (opt-in): %s", e)
|
|
44
|
+
return None
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class SimpleModeOrchestrator(ABC):
|
|
48
|
+
"""Base class for Simple Mode orchestrators."""
|
|
49
|
+
|
|
50
|
+
def __init__(
|
|
51
|
+
self,
|
|
52
|
+
project_root: Path | None = None,
|
|
53
|
+
config: ProjectConfig | None = None,
|
|
54
|
+
):
|
|
55
|
+
"""
|
|
56
|
+
Initialize orchestrator.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
project_root: Project root directory
|
|
60
|
+
config: Optional project configuration
|
|
61
|
+
"""
|
|
62
|
+
self.project_root = project_root or Path.cwd()
|
|
63
|
+
self.config = config
|
|
64
|
+
self._hook_manager = None # Lazy-loaded when needed
|
|
65
|
+
|
|
66
|
+
def _get_hook_manager(self) -> Any:
|
|
67
|
+
"""Return HookManager if hooks are enabled for this project; else None."""
|
|
68
|
+
if self._hook_manager is None:
|
|
69
|
+
self._hook_manager = _get_hook_manager(self.project_root)
|
|
70
|
+
return self._hook_manager
|
|
71
|
+
|
|
72
|
+
def _trigger_user_prompt_submit(
|
|
73
|
+
self,
|
|
74
|
+
prompt: str,
|
|
75
|
+
workflow_type: str | None = None,
|
|
76
|
+
) -> None:
|
|
77
|
+
"""
|
|
78
|
+
Fire UserPromptSubmit hook before workflow execution.
|
|
79
|
+
|
|
80
|
+
No-op when hooks disabled or no hooks configured for this event.
|
|
81
|
+
"""
|
|
82
|
+
mgr = self._get_hook_manager()
|
|
83
|
+
if not mgr:
|
|
84
|
+
return
|
|
85
|
+
try:
|
|
86
|
+
from tapps_agents.hooks.events import UserPromptSubmitEvent
|
|
87
|
+
|
|
88
|
+
payload = UserPromptSubmitEvent(
|
|
89
|
+
prompt=prompt,
|
|
90
|
+
project_root=str(self.project_root),
|
|
91
|
+
workflow_type=workflow_type,
|
|
92
|
+
)
|
|
93
|
+
mgr.trigger("UserPromptSubmit", payload)
|
|
94
|
+
except Exception as e: # pylint: disable=broad-except
|
|
95
|
+
logger.debug("UserPromptSubmit hook error (non-fatal): %s", e)
|
|
96
|
+
|
|
97
|
+
def _trigger_post_tool_use(
|
|
98
|
+
self,
|
|
99
|
+
tool_name: str,
|
|
100
|
+
file_path: str | None,
|
|
101
|
+
file_paths: list[str] | None = None,
|
|
102
|
+
workflow_id: str | None = None,
|
|
103
|
+
) -> None:
|
|
104
|
+
"""
|
|
105
|
+
Fire PostToolUse hook after implementer Write/Edit.
|
|
106
|
+
|
|
107
|
+
No-op when hooks disabled or no matching hooks.
|
|
108
|
+
"""
|
|
109
|
+
mgr = self._get_hook_manager()
|
|
110
|
+
if not mgr:
|
|
111
|
+
return
|
|
112
|
+
try:
|
|
113
|
+
from tapps_agents.hooks.events import PostToolUseEvent
|
|
114
|
+
|
|
115
|
+
payload = PostToolUseEvent(
|
|
116
|
+
file_path=file_path,
|
|
117
|
+
file_paths=file_paths or ([file_path] if file_path else []),
|
|
118
|
+
tool_name=tool_name,
|
|
119
|
+
project_root=str(self.project_root),
|
|
120
|
+
workflow_id=workflow_id,
|
|
121
|
+
)
|
|
122
|
+
mgr.trigger(
|
|
123
|
+
"PostToolUse",
|
|
124
|
+
payload,
|
|
125
|
+
tool_name=tool_name,
|
|
126
|
+
file_path=file_path,
|
|
127
|
+
)
|
|
128
|
+
except Exception as e: # pylint: disable=broad-except
|
|
129
|
+
logger.debug("PostToolUse hook error (non-fatal): %s", e)
|
|
130
|
+
|
|
131
|
+
def _trigger_workflow_complete(
|
|
132
|
+
self,
|
|
133
|
+
workflow_type: str,
|
|
134
|
+
workflow_id: str,
|
|
135
|
+
status: str,
|
|
136
|
+
beads_issue_id: str | None = None,
|
|
137
|
+
) -> None:
|
|
138
|
+
"""
|
|
139
|
+
Fire WorkflowComplete hook after workflow ends.
|
|
140
|
+
|
|
141
|
+
status: 'completed', 'failed', or 'cancelled'.
|
|
142
|
+
No-op when hooks disabled.
|
|
143
|
+
"""
|
|
144
|
+
mgr = self._get_hook_manager()
|
|
145
|
+
if not mgr:
|
|
146
|
+
return
|
|
147
|
+
try:
|
|
148
|
+
from tapps_agents.hooks.events import WorkflowCompleteEvent
|
|
149
|
+
|
|
150
|
+
payload = WorkflowCompleteEvent(
|
|
151
|
+
workflow_type=workflow_type,
|
|
152
|
+
workflow_id=workflow_id,
|
|
153
|
+
status=status,
|
|
154
|
+
project_root=str(self.project_root),
|
|
155
|
+
beads_issue_id=beads_issue_id,
|
|
156
|
+
)
|
|
157
|
+
mgr.trigger("WorkflowComplete", payload)
|
|
158
|
+
except Exception as e: # pylint: disable=broad-except
|
|
159
|
+
logger.debug("WorkflowComplete hook error (non-fatal): %s", e)
|
|
160
|
+
|
|
161
|
+
@abstractmethod
|
|
162
|
+
async def execute(
|
|
163
|
+
self, intent: Intent, parameters: dict[str, Any] | None = None
|
|
164
|
+
) -> dict[str, Any]:
|
|
165
|
+
"""
|
|
166
|
+
Execute the orchestrator's workflow.
|
|
167
|
+
|
|
168
|
+
Args:
|
|
169
|
+
intent: Parsed user intent
|
|
170
|
+
parameters: Additional parameters from user input
|
|
171
|
+
|
|
172
|
+
Returns:
|
|
173
|
+
Dictionary with execution results
|
|
174
|
+
"""
|
|
175
|
+
pass
|
|
176
|
+
|
|
177
|
+
def get_agent_sequence(self) -> list[str]:
|
|
178
|
+
"""
|
|
179
|
+
Get the sequence of agents this orchestrator coordinates.
|
|
180
|
+
|
|
181
|
+
Returns:
|
|
182
|
+
List of agent names in execution order
|
|
183
|
+
"""
|
|
184
|
+
return []
|
|
185
|
+
|