@codeguide/core 0.0.17 → 0.0.19

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.
@@ -0,0 +1,260 @@
1
+ import { CodespaceService } from '../../../services/codespace/codespace-service'
2
+ import {
3
+ CreateCodespaceTaskRequestV2,
4
+ CreateBackgroundCodespaceTaskRequest,
5
+ ModelApiKey
6
+ } from '../../../services/codespace/codespace-types'
7
+ import { APIServiceConfig } from '../../../types'
8
+ import axios from 'axios'
9
+ import MockAdapter from 'axios-mock-adapter'
10
+
11
+ describe('CodespaceService - V2 Task Endpoints', () => {
12
+ let mockAxios: MockAdapter
13
+ let codespaceService: CodespaceService
14
+ let config: APIServiceConfig
15
+
16
+ beforeEach(() => {
17
+ mockAxios = new MockAdapter(axios)
18
+ config = {
19
+ baseUrl: 'https://api.example.com',
20
+ databaseApiKey: 'sk_test123',
21
+ }
22
+ codespaceService = new CodespaceService(config)
23
+ })
24
+
25
+ afterEach(() => {
26
+ mockAxios.restore()
27
+ })
28
+
29
+ describe('createCodespaceTaskV2', () => {
30
+ const validRequest: CreateCodespaceTaskRequestV2 = {
31
+ project_id: 'project-123',
32
+ task_description: 'Create a new authentication system',
33
+ title: 'Auth System Implementation',
34
+ execution_mode: 'implementation',
35
+ }
36
+
37
+ it('should create a codespace task successfully', async () => {
38
+ const mockResponse = {
39
+ success: true,
40
+ task_id: 'task-456',
41
+ message: 'Task created successfully',
42
+ status: 'pending',
43
+ created_at: '2023-01-01T00:00:00Z',
44
+ }
45
+
46
+ mockAxios.onPost('/codespace/task', validRequest).reply(200, mockResponse)
47
+
48
+ const result = await codespaceService.createCodespaceTaskV2(validRequest)
49
+
50
+ expect(result).toEqual(mockResponse)
51
+ })
52
+
53
+ it('should throw error for missing project_id', async () => {
54
+ const invalidRequest = {
55
+ task_description: 'Create a new feature',
56
+ }
57
+
58
+ await expect(codespaceService.createCodespaceTaskV2(invalidRequest as any))
59
+ .rejects.toThrow('project_id is required')
60
+ })
61
+
62
+ it('should throw error for missing task_description', async () => {
63
+ const invalidRequest = {
64
+ project_id: 'project-123',
65
+ }
66
+
67
+ await expect(codespaceService.createCodespaceTaskV2(invalidRequest as any))
68
+ .rejects.toThrow('task_description is required')
69
+ })
70
+
71
+ it('should set default base_branch to main', async () => {
72
+ const requestWithoutBaseBranch = {
73
+ project_id: 'project-123',
74
+ task_description: 'Create a feature',
75
+ }
76
+
77
+ const mockResponse = {
78
+ success: true,
79
+ task_id: 'task-456',
80
+ message: 'Task created successfully',
81
+ }
82
+
83
+ mockAxios.onPost('/codespace/task', expect.objectContaining({
84
+ base_branch: 'main'
85
+ })).reply(200, mockResponse)
86
+
87
+ const result = await codespaceService.createCodespaceTaskV2(requestWithoutBaseBranch)
88
+
89
+ expect(result).toEqual(mockResponse)
90
+ })
91
+
92
+ it('should validate execution_mode', async () => {
93
+ const invalidRequest = {
94
+ project_id: 'project-123',
95
+ task_description: 'Create a feature',
96
+ execution_mode: 'invalid-mode' as any,
97
+ }
98
+
99
+ await expect(codespaceService.createCodespaceTaskV2(invalidRequest))
100
+ .rejects.toThrow('execution_mode must be either "implementation" or "docs-only"')
101
+ })
102
+
103
+ it('should accept valid execution modes', async () => {
104
+ const validModes = ['implementation', 'docs-only'] as const
105
+
106
+ for (const mode of validModes) {
107
+ const request = {
108
+ project_id: 'project-123',
109
+ task_description: 'Create a feature',
110
+ execution_mode: mode,
111
+ }
112
+
113
+ const mockResponse = {
114
+ success: true,
115
+ task_id: 'task-456',
116
+ message: 'Task created successfully',
117
+ }
118
+
119
+ mockAxios.onPost('/codespace/task', request).reply(200, mockResponse)
120
+
121
+ const result = await codespaceService.createCodespaceTaskV2(request)
122
+ expect(result).toEqual(mockResponse)
123
+ }
124
+ })
125
+
126
+ it('should validate model_api_keys structure', async () => {
127
+ const invalidRequest = {
128
+ project_id: 'project-123',
129
+ task_description: 'Create a feature',
130
+ model_api_keys: 'not-an-array' as any,
131
+ }
132
+
133
+ await expect(codespaceService.createCodespaceTaskV2(invalidRequest))
134
+ .rejects.toThrow('model_api_keys must be an array')
135
+ })
136
+
137
+ it('should validate individual model_api_key entries', async () => {
138
+ const invalidRequest = {
139
+ project_id: 'project-123',
140
+ task_description: 'Create a feature',
141
+ model_api_keys: [
142
+ { model_name: '', api_key: 'key1' }, // Empty model_name
143
+ { model_name: 'model2', api_key: '' }, // Empty api_key
144
+ ],
145
+ }
146
+
147
+ await expect(codespaceService.createCodespaceTaskV2(invalidRequest))
148
+ .rejects.toThrow('Each model_api_key must have a valid model_name string')
149
+ })
150
+
151
+ it('should accept valid model_api_keys', async () => {
152
+ const validModelApiKeys: ModelApiKey[] = [
153
+ { model_name: 'gpt-4', api_key: 'sk-key1' },
154
+ { model_name: 'claude-3', api_key: 'sk-key2' },
155
+ ]
156
+
157
+ const request = {
158
+ project_id: 'project-123',
159
+ task_description: 'Create a feature',
160
+ model_api_keys: validModelApiKeys,
161
+ }
162
+
163
+ const mockResponse = {
164
+ success: true,
165
+ task_id: 'task-456',
166
+ message: 'Task created successfully',
167
+ }
168
+
169
+ mockAxios.onPost('/codespace/task', request).reply(200, mockResponse)
170
+
171
+ const result = await codespaceService.createCodespaceTaskV2(request)
172
+ expect(result).toEqual(mockResponse)
173
+ })
174
+
175
+ it('should work with all optional fields', async () => {
176
+ const fullRequest: CreateCodespaceTaskRequestV2 = {
177
+ project_id: 'project-123',
178
+ project_repository_id: 'repo-456',
179
+ task_description: 'Create comprehensive feature',
180
+ title: 'Full Feature Implementation',
181
+ branch: 'feature-branch',
182
+ working_branch: 'work-branch',
183
+ base_branch: 'develop',
184
+ docs_url: 'https://docs.example.com',
185
+ model_api_keys: [{ model_name: 'gpt-4', api_key: 'sk-key' }],
186
+ github_token: 'ghp_token123',
187
+ codespace_task_id: 'existing-task-789',
188
+ execution_mode: 'implementation',
189
+ model_name: 'gpt-4',
190
+ starter_kit_repo: 'https://github.com/example/starter-kit',
191
+ }
192
+
193
+ const mockResponse = {
194
+ success: true,
195
+ task_id: 'task-456',
196
+ message: 'Task created successfully',
197
+ status: 'pending',
198
+ created_at: '2023-01-01T00:00:00Z',
199
+ }
200
+
201
+ mockAxios.onPost('/codespace/task', fullRequest).reply(200, mockResponse)
202
+
203
+ const result = await codespaceService.createCodespaceTaskV2(fullRequest)
204
+ expect(result).toEqual(mockResponse)
205
+ })
206
+ })
207
+
208
+ describe('createBackgroundCodespaceTask', () => {
209
+ const validRequest: CreateBackgroundCodespaceTaskRequest = {
210
+ project_id: 'project-123',
211
+ task_description: 'Create background task',
212
+ execution_mode: 'docs-only',
213
+ }
214
+
215
+ it('should create a background codespace task successfully', async () => {
216
+ const mockResponse = {
217
+ success: true,
218
+ task_id: 'bg-task-456',
219
+ message: 'Background task created successfully',
220
+ status: 'queued',
221
+ created_at: '2023-01-01T00:00:00Z',
222
+ }
223
+
224
+ mockAxios.onPost('/codespace/task/background', validRequest).reply(200, mockResponse)
225
+
226
+ const result = await codespaceService.createBackgroundCodespaceTask(validRequest)
227
+
228
+ expect(result).toEqual(mockResponse)
229
+ })
230
+
231
+ it('should apply same validation as regular task creation', async () => {
232
+ const invalidRequest = {
233
+ task_description: 'Missing project_id',
234
+ }
235
+
236
+ await expect(codespaceService.createBackgroundCodespaceTask(invalidRequest as any))
237
+ .rejects.toThrow('project_id is required')
238
+ })
239
+
240
+ it('should work with docs-only mode', async () => {
241
+ const docsOnlyRequest = {
242
+ project_id: 'project-123',
243
+ task_description: 'Generate documentation',
244
+ execution_mode: 'docs-only' as const,
245
+ }
246
+
247
+ const mockResponse = {
248
+ success: true,
249
+ task_id: 'docs-task-789',
250
+ message: 'Documentation task created',
251
+ status: 'pending',
252
+ }
253
+
254
+ mockAxios.onPost('/codespace/task/background', docsOnlyRequest).reply(200, mockResponse)
255
+
256
+ const result = await codespaceService.createBackgroundCodespaceTask(docsOnlyRequest)
257
+ expect(result).toEqual(mockResponse)
258
+ })
259
+ })
260
+ })
package/dist/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export { CodeGuide } from './codeguide';
2
2
  export * from './services';
3
3
  export * from './types';
4
4
  export type { ConnectRepositoryRequest, ConnectRepositoryResponse } from './services/projects/project-types';
5
+ export type { CreateCodespaceTaskRequestV2 as CreateCodespaceTaskRequest, CreateCodespaceTaskResponseV2 as CreateCodespaceTaskResponse, CreateBackgroundCodespaceTaskRequest, CreateBackgroundCodespaceTaskResponse, ModelApiKey, GetCodespaceTaskResponse, CodespaceTaskData, TechnicalDocument, GetProjectTasksByCodespaceResponse } from './services/codespace/codespace-types';
@@ -1,6 +1,11 @@
1
1
  import { BaseService } from '../base/base-service';
2
- import { GenerateTaskTitleRequest, GenerateTaskTitleResponse, CreateCodespaceTaskRequest, CreateCodespaceTaskResponse } from './codespace-types';
2
+ import { GenerateTaskTitleRequest, GenerateTaskTitleResponse, CreateCodespaceTaskRequest, CreateCodespaceTaskResponse, CreateCodespaceTaskRequestV2, CreateCodespaceTaskResponseV2, CreateBackgroundCodespaceTaskRequest, CreateBackgroundCodespaceTaskResponse, GetCodespaceTaskResponse, GetProjectTasksByCodespaceResponse } from './codespace-types';
3
3
  export declare class CodespaceService extends BaseService {
4
4
  generateTaskTitle(request: GenerateTaskTitleRequest): Promise<GenerateTaskTitleResponse>;
5
5
  createCodespaceTask(request: CreateCodespaceTaskRequest): Promise<CreateCodespaceTaskResponse>;
6
+ createCodespaceTaskV2(request: CreateCodespaceTaskRequestV2): Promise<CreateCodespaceTaskResponseV2>;
7
+ createBackgroundCodespaceTask(request: CreateBackgroundCodespaceTaskRequest): Promise<CreateBackgroundCodespaceTaskResponse>;
8
+ getCodespaceTask(codespaceTaskId: string): Promise<GetCodespaceTaskResponse>;
9
+ getProjectTasksByCodespace(codespaceTaskId: string): Promise<GetProjectTasksByCodespaceResponse>;
10
+ private validateCodespaceTaskRequest;
6
11
  }
@@ -9,5 +9,54 @@ class CodespaceService extends base_service_1.BaseService {
9
9
  async createCodespaceTask(request) {
10
10
  return this.post('/codespace/create-task', request);
11
11
  }
12
+ async createCodespaceTaskV2(request) {
13
+ this.validateCodespaceTaskRequest(request);
14
+ return this.post('/codespace/task', request);
15
+ }
16
+ async createBackgroundCodespaceTask(request) {
17
+ this.validateCodespaceTaskRequest(request);
18
+ return this.post('/codespace/task/background', request);
19
+ }
20
+ async getCodespaceTask(codespaceTaskId) {
21
+ if (!codespaceTaskId) {
22
+ throw new Error('codespace_task_id is required');
23
+ }
24
+ return this.get(`/codespace/task/${codespaceTaskId}`);
25
+ }
26
+ async getProjectTasksByCodespace(codespaceTaskId) {
27
+ if (!codespaceTaskId) {
28
+ throw new Error('codespace_task_id is required');
29
+ }
30
+ return this.get(`/project-tasks/by-codespace/${codespaceTaskId}`);
31
+ }
32
+ validateCodespaceTaskRequest(request) {
33
+ if (!request.project_id) {
34
+ throw new Error('project_id is required');
35
+ }
36
+ if (!request.task_description) {
37
+ throw new Error('task_description is required');
38
+ }
39
+ if (request.execution_mode && !['implementation', 'docs-only'].includes(request.execution_mode)) {
40
+ throw new Error('execution_mode must be either "implementation" or "docs-only"');
41
+ }
42
+ // Validate model_api_keys if provided
43
+ if (request.model_api_keys) {
44
+ if (!Array.isArray(request.model_api_keys)) {
45
+ throw new Error('model_api_keys must be an array');
46
+ }
47
+ for (const key of request.model_api_keys) {
48
+ if (!key.model_name || typeof key.model_name !== 'string') {
49
+ throw new Error('Each model_api_key must have a valid model_name string');
50
+ }
51
+ if (!key.api_key || typeof key.api_key !== 'string') {
52
+ throw new Error('Each model_api_key must have a valid api_key string');
53
+ }
54
+ }
55
+ }
56
+ // Validate base_branch default
57
+ if (request.base_branch === undefined) {
58
+ request.base_branch = 'main';
59
+ }
60
+ }
12
61
  }
13
62
  exports.CodespaceService = CodespaceService;
@@ -16,3 +16,102 @@ export interface CreateCodespaceTaskResponse {
16
16
  task_id: string;
17
17
  message: string;
18
18
  }
19
+ export interface ModelApiKey {
20
+ model_name: string;
21
+ api_key: string;
22
+ }
23
+ export interface CreateCodespaceTaskRequestV2 {
24
+ project_id: string;
25
+ project_repository_id?: string;
26
+ task_description: string;
27
+ title?: string;
28
+ branch?: string;
29
+ working_branch?: string;
30
+ base_branch?: string;
31
+ docs_url?: string;
32
+ model_api_keys?: ModelApiKey[];
33
+ github_token?: string;
34
+ codespace_task_id?: string;
35
+ execution_mode?: 'implementation' | 'docs-only';
36
+ model_name?: string;
37
+ starter_kit_repo?: string;
38
+ }
39
+ export interface CreateCodespaceTaskResponseV2 {
40
+ success: boolean;
41
+ task_id: string;
42
+ message: string;
43
+ status?: string;
44
+ created_at?: string;
45
+ }
46
+ export interface TechnicalDocument {
47
+ version: string;
48
+ generated_at: string;
49
+ task_summary: {
50
+ estimated_scope: string;
51
+ enriched_description: string;
52
+ original_description: string;
53
+ complexity_assessment: string;
54
+ };
55
+ repository_analysis: {
56
+ entry_points: string[];
57
+ key_components: string[];
58
+ technology_stack: string[];
59
+ structure_overview: string;
60
+ architecture_patterns: string[];
61
+ };
62
+ contextual_requirements: {
63
+ dependencies: string[];
64
+ related_functionality: string;
65
+ testing_considerations: string;
66
+ deployment_considerations: string;
67
+ };
68
+ implementation_guidance: {
69
+ best_practices: string[];
70
+ suggested_approach: string;
71
+ key_files_to_modify: string[];
72
+ potential_challenges: string[];
73
+ };
74
+ }
75
+ export interface CodespaceTaskData {
76
+ id: string;
77
+ codespace_task_id: string | null;
78
+ project_id: string;
79
+ project_repository_id: string;
80
+ user_id: string;
81
+ status: string;
82
+ progress: string;
83
+ created_at: string;
84
+ updated_at: string;
85
+ completed_at: string | null;
86
+ title: string;
87
+ task_description: string;
88
+ base_branch: string;
89
+ working_branch: string;
90
+ github_token_hash: string | null;
91
+ pull_request_url: string | null;
92
+ pull_request_number: number | null;
93
+ work_started_at: string | null;
94
+ work_completed_at: string | null;
95
+ estimated_completion_time: string | null;
96
+ ai_implementation_plan: string | null;
97
+ metadata: any;
98
+ model_id: string | null;
99
+ execution_mode: string;
100
+ context_data: any;
101
+ final_report_popup_state: string;
102
+ technical_document: TechnicalDocument | null;
103
+ model: any;
104
+ task_models: any[];
105
+ }
106
+ export interface GetCodespaceTaskResponse {
107
+ status: string;
108
+ data: CodespaceTaskData;
109
+ }
110
+ export interface GetProjectTasksByCodespaceResponse {
111
+ status: string;
112
+ data: any[];
113
+ }
114
+ export interface CreateBackgroundCodespaceTaskRequest extends CreateCodespaceTaskRequestV2 {
115
+ }
116
+ export interface CreateBackgroundCodespaceTaskResponse extends CreateCodespaceTaskResponseV2 {
117
+ }
@@ -1,2 +1,3 @@
1
1
  export { CodespaceService } from './codespace-service';
2
2
  export * from './codespace-types';
3
+ export type { CreateCodespaceTaskRequestV2 as CreateCodespaceTaskRequest, CreateCodespaceTaskResponseV2 as CreateCodespaceTaskResponse, CreateBackgroundCodespaceTaskRequest, CreateBackgroundCodespaceTaskResponse, ModelApiKey, GetCodespaceTaskResponse, CodespaceTaskData, TechnicalDocument, GetProjectTasksByCodespaceResponse } from './codespace-types';
package/index.ts CHANGED
@@ -13,3 +13,14 @@ export * from './types'
13
13
 
14
14
  // Export commonly used types for convenience
15
15
  export type { ConnectRepositoryRequest, ConnectRepositoryResponse } from './services/projects/project-types'
16
+ export type {
17
+ CreateCodespaceTaskRequestV2 as CreateCodespaceTaskRequest,
18
+ CreateCodespaceTaskResponseV2 as CreateCodespaceTaskResponse,
19
+ CreateBackgroundCodespaceTaskRequest,
20
+ CreateBackgroundCodespaceTaskResponse,
21
+ ModelApiKey,
22
+ GetCodespaceTaskResponse,
23
+ CodespaceTaskData,
24
+ TechnicalDocument,
25
+ GetProjectTasksByCodespaceResponse
26
+ } from './services/codespace/codespace-types'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeguide/core",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "Core package for code guidance with programmatic API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -4,6 +4,12 @@ import {
4
4
  GenerateTaskTitleResponse,
5
5
  CreateCodespaceTaskRequest,
6
6
  CreateCodespaceTaskResponse,
7
+ CreateCodespaceTaskRequestV2,
8
+ CreateCodespaceTaskResponseV2,
9
+ CreateBackgroundCodespaceTaskRequest,
10
+ CreateBackgroundCodespaceTaskResponse,
11
+ GetCodespaceTaskResponse,
12
+ GetProjectTasksByCodespaceResponse,
7
13
  } from './codespace-types'
8
14
 
9
15
  export class CodespaceService extends BaseService {
@@ -14,4 +20,63 @@ export class CodespaceService extends BaseService {
14
20
  async createCodespaceTask(request: CreateCodespaceTaskRequest): Promise<CreateCodespaceTaskResponse> {
15
21
  return this.post<CreateCodespaceTaskResponse>('/codespace/create-task', request)
16
22
  }
23
+
24
+ async createCodespaceTaskV2(request: CreateCodespaceTaskRequestV2): Promise<CreateCodespaceTaskResponseV2> {
25
+ this.validateCodespaceTaskRequest(request)
26
+ return this.post<CreateCodespaceTaskResponseV2>('/codespace/task', request)
27
+ }
28
+
29
+ async createBackgroundCodespaceTask(request: CreateBackgroundCodespaceTaskRequest): Promise<CreateBackgroundCodespaceTaskResponse> {
30
+ this.validateCodespaceTaskRequest(request)
31
+ return this.post<CreateBackgroundCodespaceTaskResponse>('/codespace/task/background', request)
32
+ }
33
+
34
+ async getCodespaceTask(codespaceTaskId: string): Promise<GetCodespaceTaskResponse> {
35
+ if (!codespaceTaskId) {
36
+ throw new Error('codespace_task_id is required')
37
+ }
38
+ return this.get<GetCodespaceTaskResponse>(`/codespace/task/${codespaceTaskId}`)
39
+ }
40
+
41
+ async getProjectTasksByCodespace(codespaceTaskId: string): Promise<GetProjectTasksByCodespaceResponse> {
42
+ if (!codespaceTaskId) {
43
+ throw new Error('codespace_task_id is required')
44
+ }
45
+ return this.get<GetProjectTasksByCodespaceResponse>(`/project-tasks/by-codespace/${codespaceTaskId}`)
46
+ }
47
+
48
+ private validateCodespaceTaskRequest(request: CreateCodespaceTaskRequestV2): void {
49
+ if (!request.project_id) {
50
+ throw new Error('project_id is required')
51
+ }
52
+
53
+ if (!request.task_description) {
54
+ throw new Error('task_description is required')
55
+ }
56
+
57
+ if (request.execution_mode && !['implementation', 'docs-only'].includes(request.execution_mode)) {
58
+ throw new Error('execution_mode must be either "implementation" or "docs-only"')
59
+ }
60
+
61
+ // Validate model_api_keys if provided
62
+ if (request.model_api_keys) {
63
+ if (!Array.isArray(request.model_api_keys)) {
64
+ throw new Error('model_api_keys must be an array')
65
+ }
66
+
67
+ for (const key of request.model_api_keys) {
68
+ if (!key.model_name || typeof key.model_name !== 'string') {
69
+ throw new Error('Each model_api_key must have a valid model_name string')
70
+ }
71
+ if (!key.api_key || typeof key.api_key !== 'string') {
72
+ throw new Error('Each model_api_key must have a valid api_key string')
73
+ }
74
+ }
75
+ }
76
+
77
+ // Validate base_branch default
78
+ if (request.base_branch === undefined) {
79
+ request.base_branch = 'main'
80
+ }
81
+ }
17
82
  }
@@ -18,4 +18,110 @@ export interface CreateCodespaceTaskResponse {
18
18
  success: boolean
19
19
  task_id: string
20
20
  message: string
21
- }
21
+ }
22
+
23
+ export interface ModelApiKey {
24
+ model_name: string
25
+ api_key: string
26
+ }
27
+
28
+ export interface CreateCodespaceTaskRequestV2 {
29
+ project_id: string
30
+ project_repository_id?: string
31
+ task_description: string
32
+ title?: string
33
+ branch?: string
34
+ working_branch?: string
35
+ base_branch?: string
36
+ docs_url?: string
37
+ model_api_keys?: ModelApiKey[]
38
+ github_token?: string
39
+ codespace_task_id?: string
40
+ execution_mode?: 'implementation' | 'docs-only'
41
+ model_name?: string
42
+ starter_kit_repo?: string
43
+ }
44
+
45
+ export interface CreateCodespaceTaskResponseV2 {
46
+ success: boolean
47
+ task_id: string
48
+ message: string
49
+ status?: string
50
+ created_at?: string
51
+ }
52
+
53
+ export interface TechnicalDocument {
54
+ version: string
55
+ generated_at: string
56
+ task_summary: {
57
+ estimated_scope: string
58
+ enriched_description: string
59
+ original_description: string
60
+ complexity_assessment: string
61
+ }
62
+ repository_analysis: {
63
+ entry_points: string[]
64
+ key_components: string[]
65
+ technology_stack: string[]
66
+ structure_overview: string
67
+ architecture_patterns: string[]
68
+ }
69
+ contextual_requirements: {
70
+ dependencies: string[]
71
+ related_functionality: string
72
+ testing_considerations: string
73
+ deployment_considerations: string
74
+ }
75
+ implementation_guidance: {
76
+ best_practices: string[]
77
+ suggested_approach: string
78
+ key_files_to_modify: string[]
79
+ potential_challenges: string[]
80
+ }
81
+ }
82
+
83
+ export interface CodespaceTaskData {
84
+ id: string
85
+ codespace_task_id: string | null
86
+ project_id: string
87
+ project_repository_id: string
88
+ user_id: string
89
+ status: string
90
+ progress: string
91
+ created_at: string
92
+ updated_at: string
93
+ completed_at: string | null
94
+ title: string
95
+ task_description: string
96
+ base_branch: string
97
+ working_branch: string
98
+ github_token_hash: string | null
99
+ pull_request_url: string | null
100
+ pull_request_number: number | null
101
+ work_started_at: string | null
102
+ work_completed_at: string | null
103
+ estimated_completion_time: string | null
104
+ ai_implementation_plan: string | null
105
+ metadata: any
106
+ model_id: string | null
107
+ execution_mode: string
108
+ context_data: any
109
+ final_report_popup_state: string
110
+ technical_document: TechnicalDocument | null
111
+ model: any
112
+ task_models: any[]
113
+ }
114
+
115
+ export interface GetCodespaceTaskResponse {
116
+ status: string
117
+ data: CodespaceTaskData
118
+ }
119
+
120
+ export interface GetProjectTasksByCodespaceResponse {
121
+ status: string
122
+ data: any[] // Will be defined based on the actual response structure
123
+ }
124
+
125
+ export interface CreateBackgroundCodespaceTaskRequest extends CreateCodespaceTaskRequestV2 {}
126
+
127
+ export interface CreateBackgroundCodespaceTaskResponse extends CreateCodespaceTaskResponseV2 {}
@@ -1,2 +1,15 @@
1
1
  export { CodespaceService } from './codespace-service'
2
- export * from './codespace-types'
2
+ export * from './codespace-types'
3
+
4
+ // Re-export commonly used V2 types for convenience
5
+ export type {
6
+ CreateCodespaceTaskRequestV2 as CreateCodespaceTaskRequest,
7
+ CreateCodespaceTaskResponseV2 as CreateCodespaceTaskResponse,
8
+ CreateBackgroundCodespaceTaskRequest,
9
+ CreateBackgroundCodespaceTaskResponse,
10
+ ModelApiKey,
11
+ GetCodespaceTaskResponse,
12
+ CodespaceTaskData,
13
+ TechnicalDocument,
14
+ GetProjectTasksByCodespaceResponse
15
+ } from './codespace-types'