Refactor setup and tool helpers for improved modularity and clarity

- Moved setup logic into dedicated files: agent.ts, config.ts, index.ts, workspace.ts.
- Introduced tool-helpers.ts for shared functions across tools, reducing boilerplate.
- Updated tools (status, task-comment, task-create, task-update, work-finish, work-start) to utilize new helper functions for workspace resolution and provider creation.
- Enhanced error handling and context detection in tools.
- Improved project resolution logic to streamline tool execution.
- Added new functionality for agent creation and configuration management in setup.
This commit is contained in:
Lauren ten Hoor
2026-02-10 22:51:35 +08:00
parent 55b062ac76
commit 70af40e986
22 changed files with 768 additions and 953 deletions

View File

@@ -4,7 +4,7 @@
* Returns tier names (junior, medior, senior, qa) instead of model aliases.
*/
export type ModelRecommendation = {
export type TierRecommendation = {
tier: string;
reason: string;
};
@@ -47,11 +47,11 @@ const COMPLEX_KEYWORDS = [
* - senior: deep/architectural (system-wide refactoring, novel design)
* - qa: all QA tasks (code inspection, validation, test runs)
*/
export function selectModel(
export function selectTier(
issueTitle: string,
issueDescription: string,
role: "dev" | "qa",
): ModelRecommendation {
): TierRecommendation {
if (role === "qa") {
return {
tier: "qa",