@codeguide/core 0.0.18 → 0.0.20

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/index.d.ts CHANGED
@@ -2,4 +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 } from './services/codespace/codespace-types';
5
+ export type { CreateCodespaceTaskRequestV2 as CreateCodespaceTaskRequest, CreateCodespaceTaskResponseV2 as CreateCodespaceTaskResponse, CreateBackgroundCodespaceTaskRequest, CreateBackgroundCodespaceTaskResponse, ModelApiKey, GetCodespaceTaskResponse, CodespaceTaskData, TechnicalDocument, GetProjectTasksByCodespaceResponse } from './services/codespace/codespace-types';
@@ -1,9 +1,11 @@
1
1
  import { BaseService } from '../base/base-service';
2
- import { GenerateTaskTitleRequest, GenerateTaskTitleResponse, CreateCodespaceTaskRequest, CreateCodespaceTaskResponse, CreateCodespaceTaskRequestV2, CreateCodespaceTaskResponseV2, CreateBackgroundCodespaceTaskRequest, CreateBackgroundCodespaceTaskResponse } 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
6
  createCodespaceTaskV2(request: CreateCodespaceTaskRequestV2): Promise<CreateCodespaceTaskResponseV2>;
7
7
  createBackgroundCodespaceTask(request: CreateBackgroundCodespaceTaskRequest): Promise<CreateBackgroundCodespaceTaskResponse>;
8
+ getCodespaceTask(codespaceTaskId: string): Promise<GetCodespaceTaskResponse>;
9
+ getProjectTasksByCodespace(codespaceTaskId: string): Promise<GetProjectTasksByCodespaceResponse>;
8
10
  private validateCodespaceTaskRequest;
9
11
  }
@@ -17,6 +17,18 @@ class CodespaceService extends base_service_1.BaseService {
17
17
  this.validateCodespaceTaskRequest(request);
18
18
  return this.post('/codespace/task/background', request);
19
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
+ }
20
32
  validateCodespaceTaskRequest(request) {
21
33
  if (!request.project_id) {
22
34
  throw new Error('project_id is required');
@@ -43,6 +43,74 @@ export interface CreateCodespaceTaskResponseV2 {
43
43
  status?: string;
44
44
  created_at?: string;
45
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
+ }
46
114
  export interface CreateBackgroundCodespaceTaskRequest extends CreateCodespaceTaskRequestV2 {
47
115
  }
48
116
  export interface CreateBackgroundCodespaceTaskResponse extends CreateCodespaceTaskResponseV2 {
@@ -1,3 +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 } 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
@@ -18,5 +18,9 @@ export type {
18
18
  CreateCodespaceTaskResponseV2 as CreateCodespaceTaskResponse,
19
19
  CreateBackgroundCodespaceTaskRequest,
20
20
  CreateBackgroundCodespaceTaskResponse,
21
- ModelApiKey
21
+ ModelApiKey,
22
+ GetCodespaceTaskResponse,
23
+ CodespaceTaskData,
24
+ TechnicalDocument,
25
+ GetProjectTasksByCodespaceResponse
22
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.18",
3
+ "version": "0.0.20",
4
4
  "description": "Core package for code guidance with programmatic API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,6 +8,8 @@ import {
8
8
  CreateCodespaceTaskResponseV2,
9
9
  CreateBackgroundCodespaceTaskRequest,
10
10
  CreateBackgroundCodespaceTaskResponse,
11
+ GetCodespaceTaskResponse,
12
+ GetProjectTasksByCodespaceResponse,
11
13
  } from './codespace-types'
12
14
 
13
15
  export class CodespaceService extends BaseService {
@@ -29,6 +31,20 @@ export class CodespaceService extends BaseService {
29
31
  return this.post<CreateBackgroundCodespaceTaskResponse>('/codespace/task/background', request)
30
32
  }
31
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
+
32
48
  private validateCodespaceTaskRequest(request: CreateCodespaceTaskRequestV2): void {
33
49
  if (!request.project_id) {
34
50
  throw new Error('project_id is required')
@@ -50,6 +50,78 @@ export interface CreateCodespaceTaskResponseV2 {
50
50
  created_at?: string
51
51
  }
52
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
+
53
125
  export interface CreateBackgroundCodespaceTaskRequest extends CreateCodespaceTaskRequestV2 {}
54
126
 
55
127
  export interface CreateBackgroundCodespaceTaskResponse extends CreateCodespaceTaskResponseV2 {}
@@ -7,5 +7,9 @@ export type {
7
7
  CreateCodespaceTaskResponseV2 as CreateCodespaceTaskResponse,
8
8
  CreateBackgroundCodespaceTaskRequest,
9
9
  CreateBackgroundCodespaceTaskResponse,
10
- ModelApiKey
10
+ ModelApiKey,
11
+ GetCodespaceTaskResponse,
12
+ CodespaceTaskData,
13
+ TechnicalDocument,
14
+ GetProjectTasksByCodespaceResponse
11
15
  } from './codespace-types'