File size: 4,433 Bytes
7a1ad33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/**
 * @license
 * Copyright 2026 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */

import type { ToolDefinition } from './types.js';
import {
  TRACKER_CREATE_TASK_TOOL_NAME,
  TRACKER_UPDATE_TASK_TOOL_NAME,
  TRACKER_GET_TASK_TOOL_NAME,
  TRACKER_LIST_TASKS_TOOL_NAME,
  TRACKER_ADD_DEPENDENCY_TOOL_NAME,
  TRACKER_VISUALIZE_TOOL_NAME,
} from '../tool-names.js';

export const TRACKER_CREATE_TASK_DEFINITION: ToolDefinition = {
  base: {
    name: TRACKER_CREATE_TASK_TOOL_NAME,
    description: 'Creates a new task in the tracker.',
    parametersJsonSchema: {
      type: 'object',
      properties: {
        title: {
          type: 'string',
          description:
            'Detailed title of the task. Should be concise but provide enough detail to understand the objective.',
        },
        description: {
          type: 'string',
          description:
            'Detailed description of the task. Must contain more specific details and context than the title.',
        },
        type: {
          type: 'string',
          enum: ['epic', 'task', 'bug'],
          description: 'Type of the task.',
        },
        parentId: {
          type: 'string',
          description: 'Optional ID of the parent task.',
        },
        dependencies: {
          type: 'array',
          items: { type: 'string' },
          description: 'Optional list of task IDs that this task depends on.',
        },
      },
      required: ['title', 'description', 'type'],
    },
  },
};

export const TRACKER_UPDATE_TASK_DEFINITION: ToolDefinition = {
  base: {
    name: TRACKER_UPDATE_TASK_TOOL_NAME,
    description: 'Updates an existing task in the tracker.',
    parametersJsonSchema: {
      type: 'object',
      properties: {
        id: {
          type: 'string',
          description: 'The 6-character hex ID of the task to update.',
        },
        title: {
          type: 'string',
          description: 'New title for the task.',
        },
        description: {
          type: 'string',
          description: 'New detailed description for the task.',
        },
        status: {
          type: 'string',
          enum: ['open', 'in_progress', 'blocked', 'closed'],
          description: 'New status for the task.',
        },
        dependencies: {
          type: 'array',
          items: { type: 'string' },
          description: 'New list of dependency IDs.',
        },
      },
      required: ['id'],
    },
  },
};

export const TRACKER_GET_TASK_DEFINITION: ToolDefinition = {
  base: {
    name: TRACKER_GET_TASK_TOOL_NAME,
    description: 'Retrieves details for a specific task.',
    parametersJsonSchema: {
      type: 'object',
      properties: {
        id: {
          type: 'string',
          description: 'The 6-character hex ID of the task.',
        },
      },
      required: ['id'],
    },
  },
};

export const TRACKER_LIST_TASKS_DEFINITION: ToolDefinition = {
  base: {
    name: TRACKER_LIST_TASKS_TOOL_NAME,
    description:
      'Lists tasks in the tracker, optionally filtered by status, type, or parent.',
    parametersJsonSchema: {
      type: 'object',
      properties: {
        status: {
          type: 'string',
          enum: ['open', 'in_progress', 'blocked', 'closed'],
          description: 'Filter by status.',
        },
        type: {
          type: 'string',
          enum: ['epic', 'task', 'bug'],
          description: 'Filter by type.',
        },
        parentId: {
          type: 'string',
          description: 'Filter by parent task ID.',
        },
      },
    },
  },
};

export const TRACKER_ADD_DEPENDENCY_DEFINITION: ToolDefinition = {
  base: {
    name: TRACKER_ADD_DEPENDENCY_TOOL_NAME,
    description: 'Adds a dependency between two tasks.',
    parametersJsonSchema: {
      type: 'object',
      properties: {
        taskId: {
          type: 'string',
          description: 'The ID of the task that has a dependency.',
        },
        dependencyId: {
          type: 'string',
          description: 'The ID of the task that is being depended upon.',
        },
      },
      required: ['taskId', 'dependencyId'],
    },
  },
};

export const TRACKER_VISUALIZE_DEFINITION: ToolDefinition = {
  base: {
    name: TRACKER_VISUALIZE_TOOL_NAME,
    description: 'Renders an ASCII tree visualization of the task graph.',
    parametersJsonSchema: {
      type: 'object',
      properties: {},
    },
  },
};