@ace-sdk/core 2.0.0 → 2.1.0
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/cache/project-index.d.ts +152 -0
- package/dist/cache/project-index.d.ts.map +1 -0
- package/dist/cache/project-index.js +290 -0
- package/dist/cache/project-index.js.map +1 -0
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +15 -0
- package/dist/config/loader.js.map +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/services/bootstrap-stream.d.ts +113 -0
- package/dist/services/bootstrap-stream.d.ts.map +1 -0
- package/dist/services/bootstrap-stream.js +261 -0
- package/dist/services/bootstrap-stream.js.map +1 -0
- package/dist/services/import-graph.d.ts +111 -0
- package/dist/services/import-graph.d.ts.map +1 -0
- package/dist/services/import-graph.js +292 -0
- package/dist/services/import-graph.js.map +1 -0
- package/dist/services/language-detector.d.ts +120 -0
- package/dist/services/language-detector.d.ts.map +1 -0
- package/dist/services/language-detector.js +210 -0
- package/dist/services/language-detector.js.map +1 -0
- package/dist/types/bootstrap-events.d.ts +251 -0
- package/dist/types/bootstrap-events.d.ts.map +1 -0
- package/dist/types/bootstrap-events.js +103 -0
- package/dist/types/bootstrap-events.js.map +1 -0
- package/dist/types/config.d.ts +5 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js.map +1 -1
- package/dist/types/project-dna.d.ts +151 -0
- package/dist/types/project-dna.d.ts.map +1 -0
- package/dist/types/project-dna.js +42 -0
- package/dist/types/project-dna.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bootstrap SSE Event Types
|
|
3
|
+
*
|
|
4
|
+
* Server sends these events during streaming bootstrap.
|
|
5
|
+
* Client displays progress to user.
|
|
6
|
+
*
|
|
7
|
+
* Updated to match ACE Server v3.13.0 response format.
|
|
8
|
+
*
|
|
9
|
+
* @package @ace-sdk/core
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Playbook section names
|
|
13
|
+
*/
|
|
14
|
+
export type PlaybookSection = 'strategies_and_hard_rules' | 'useful_code_snippets' | 'troubleshooting_and_pitfalls' | 'apis_to_use';
|
|
15
|
+
/**
|
|
16
|
+
* Bootstrap processing stages (matches server v3.13.0)
|
|
17
|
+
*/
|
|
18
|
+
export type BootstrapStage = 'received' | 'analyzing' | 'synthesizing' | 'merging' | 'done' | 'error';
|
|
19
|
+
/**
|
|
20
|
+
* Human-readable labels for stages
|
|
21
|
+
*/
|
|
22
|
+
export declare const BOOTSTRAP_STAGE_LABELS: Record<BootstrapStage, string>;
|
|
23
|
+
/**
|
|
24
|
+
* Statistics returned in the done event
|
|
25
|
+
*/
|
|
26
|
+
export interface BootstrapStatistics {
|
|
27
|
+
/** Number of code blocks received */
|
|
28
|
+
blocks_received: number;
|
|
29
|
+
/** Number of patterns extracted */
|
|
30
|
+
patterns_extracted: number;
|
|
31
|
+
/** Compression percentage (can be negative if patterns > blocks) */
|
|
32
|
+
compression_percentage: number;
|
|
33
|
+
/** Patterns by section */
|
|
34
|
+
by_section: Record<PlaybookSection, number>;
|
|
35
|
+
/** Average confidence score */
|
|
36
|
+
average_confidence: number;
|
|
37
|
+
/** Analysis time in seconds */
|
|
38
|
+
analysis_time_seconds: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Data for 'received' stage
|
|
42
|
+
*/
|
|
43
|
+
export interface ReceivedStageData {
|
|
44
|
+
blocks_count?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Data for 'analyzing' stage
|
|
48
|
+
*/
|
|
49
|
+
export interface AnalyzingStageData {
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Data for 'synthesizing' stage
|
|
53
|
+
*/
|
|
54
|
+
export interface SynthesizingStageData {
|
|
55
|
+
insights_count: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Data for 'merging' stage
|
|
59
|
+
*/
|
|
60
|
+
export interface MergingStageData {
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Data for 'done' stage
|
|
64
|
+
*/
|
|
65
|
+
export interface DoneStageData {
|
|
66
|
+
success: boolean;
|
|
67
|
+
bootstrap_statistics: BootstrapStatistics;
|
|
68
|
+
blocks_received: number;
|
|
69
|
+
patterns_extracted: number;
|
|
70
|
+
compression_percentage: number;
|
|
71
|
+
analysis_time_seconds: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Data for 'error' stage
|
|
75
|
+
*/
|
|
76
|
+
export interface ErrorStageData {
|
|
77
|
+
success: false;
|
|
78
|
+
error_code: string;
|
|
79
|
+
message: string;
|
|
80
|
+
retryable: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Union of all stage data types
|
|
84
|
+
*/
|
|
85
|
+
export type BootstrapStageData = ReceivedStageData | AnalyzingStageData | SynthesizingStageData | MergingStageData | DoneStageData | ErrorStageData | null;
|
|
86
|
+
/**
|
|
87
|
+
* Bootstrap SSE Event structure
|
|
88
|
+
*
|
|
89
|
+
* Matches ACE Server v3.13.0 StreamingEvent format.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* // Server sends:
|
|
94
|
+
* // data: {"stage": "received", "message": "Received 5 code blocks", "data": null, "timestamp": "..."}
|
|
95
|
+
*
|
|
96
|
+
* const event: BootstrapSSEEvent = JSON.parse(line.slice(6));
|
|
97
|
+
* console.log(event.stage); // 'received'
|
|
98
|
+
* console.log(event.message); // 'Received 5 code blocks'
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
export interface BootstrapSSEEvent {
|
|
102
|
+
/** Current stage */
|
|
103
|
+
stage: BootstrapStage;
|
|
104
|
+
/** Human-readable status message */
|
|
105
|
+
message: string;
|
|
106
|
+
/** Stage-specific data (can be null) */
|
|
107
|
+
data: BootstrapStageData;
|
|
108
|
+
/** ISO 8601 timestamp */
|
|
109
|
+
timestamp: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Type guard for received stage
|
|
113
|
+
*/
|
|
114
|
+
export declare function isReceivedEvent(event: BootstrapSSEEvent): event is BootstrapSSEEvent & {
|
|
115
|
+
stage: 'received';
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Type guard for analyzing stage
|
|
119
|
+
*/
|
|
120
|
+
export declare function isAnalyzingEvent(event: BootstrapSSEEvent): event is BootstrapSSEEvent & {
|
|
121
|
+
stage: 'analyzing';
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Type guard for synthesizing stage
|
|
125
|
+
*/
|
|
126
|
+
export declare function isSynthesizingEvent(event: BootstrapSSEEvent): event is BootstrapSSEEvent & {
|
|
127
|
+
stage: 'synthesizing';
|
|
128
|
+
data: SynthesizingStageData;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Type guard for merging stage
|
|
132
|
+
*/
|
|
133
|
+
export declare function isMergingEvent(event: BootstrapSSEEvent): event is BootstrapSSEEvent & {
|
|
134
|
+
stage: 'merging';
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Type guard for done stage
|
|
138
|
+
*/
|
|
139
|
+
export declare function isDoneEvent(event: BootstrapSSEEvent): event is BootstrapSSEEvent & {
|
|
140
|
+
stage: 'done';
|
|
141
|
+
data: DoneStageData;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Type guard for error stage
|
|
145
|
+
*/
|
|
146
|
+
export declare function isErrorEvent(event: BootstrapSSEEvent): event is BootstrapSSEEvent & {
|
|
147
|
+
stage: 'error';
|
|
148
|
+
data: ErrorStageData;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Check if event is a terminal event (done or error)
|
|
152
|
+
*/
|
|
153
|
+
export declare function isTerminalEvent(event: BootstrapSSEEvent): boolean;
|
|
154
|
+
/**
|
|
155
|
+
* @deprecated Use BootstrapStage instead
|
|
156
|
+
*/
|
|
157
|
+
export type BootstrapEventType = 'bootstrap:started' | 'bootstrap:stage' | 'bootstrap:progress' | 'bootstrap:patterns' | 'bootstrap:health' | 'bootstrap:complete' | 'bootstrap:error';
|
|
158
|
+
/**
|
|
159
|
+
* @deprecated Use isDoneEvent instead
|
|
160
|
+
*/
|
|
161
|
+
export declare function isCompleteEvent(event: BootstrapSSEEvent): boolean;
|
|
162
|
+
/**
|
|
163
|
+
* @deprecated Use isReceivedEvent instead
|
|
164
|
+
*/
|
|
165
|
+
export declare function isStartedEvent(event: BootstrapSSEEvent): boolean;
|
|
166
|
+
/**
|
|
167
|
+
* @deprecated Use isAnalyzingEvent or isSynthesizingEvent instead
|
|
168
|
+
*/
|
|
169
|
+
export declare function isStageEvent(event: BootstrapSSEEvent): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* @deprecated Progress is embedded in stage messages
|
|
172
|
+
*/
|
|
173
|
+
export declare function isProgressEvent(_event: BootstrapSSEEvent): boolean;
|
|
174
|
+
/**
|
|
175
|
+
* @deprecated Patterns data is in done event
|
|
176
|
+
*/
|
|
177
|
+
export declare function isPatternsEvent(_event: BootstrapSSEEvent): boolean;
|
|
178
|
+
/**
|
|
179
|
+
* @deprecated Health data is in done event
|
|
180
|
+
*/
|
|
181
|
+
export declare function isHealthEvent(_event: BootstrapSSEEvent): boolean;
|
|
182
|
+
/**
|
|
183
|
+
* @deprecated Use DoneStageData instead
|
|
184
|
+
*/
|
|
185
|
+
export interface BootstrapCompleteData {
|
|
186
|
+
success: true;
|
|
187
|
+
sessionId: string;
|
|
188
|
+
playbook: {
|
|
189
|
+
totalPatterns: number;
|
|
190
|
+
bySection: Record<PlaybookSection, number>;
|
|
191
|
+
};
|
|
192
|
+
health: {
|
|
193
|
+
inputPatterns: number;
|
|
194
|
+
outputPatterns: number;
|
|
195
|
+
compressionRatio: number;
|
|
196
|
+
processingTime: number;
|
|
197
|
+
};
|
|
198
|
+
dnaStored: boolean;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* @deprecated Use ErrorStageData instead
|
|
202
|
+
*/
|
|
203
|
+
export interface BootstrapErrorData {
|
|
204
|
+
success: false;
|
|
205
|
+
errorCode: string;
|
|
206
|
+
message: string;
|
|
207
|
+
stage?: BootstrapStage;
|
|
208
|
+
retryable: boolean;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* @deprecated Not used in server response
|
|
212
|
+
*/
|
|
213
|
+
export interface BootstrapStartedData {
|
|
214
|
+
sessionId: string;
|
|
215
|
+
orgId: string;
|
|
216
|
+
projectId: string;
|
|
217
|
+
totalStages: number;
|
|
218
|
+
estimatedDuration?: number;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* @deprecated Progress is embedded in stage messages
|
|
222
|
+
*/
|
|
223
|
+
export interface BootstrapProgressData {
|
|
224
|
+
stage: BootstrapStage;
|
|
225
|
+
current: number;
|
|
226
|
+
total: number;
|
|
227
|
+
percentage: number;
|
|
228
|
+
currentItem?: string;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* @deprecated Patterns data is in done event
|
|
232
|
+
*/
|
|
233
|
+
export interface BootstrapPatternsData {
|
|
234
|
+
section: PlaybookSection;
|
|
235
|
+
patternsFound: number;
|
|
236
|
+
samplePatterns: string[];
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* @deprecated Health data is in done event
|
|
240
|
+
*/
|
|
241
|
+
export interface BootstrapHealthData {
|
|
242
|
+
inputPatterns: number;
|
|
243
|
+
outputPatterns: number;
|
|
244
|
+
compressionRatio: number;
|
|
245
|
+
processingTime: number;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* @deprecated Use BootstrapStageData instead
|
|
249
|
+
*/
|
|
250
|
+
export type BootstrapEventData = BootstrapStartedData | BootstrapProgressData | BootstrapPatternsData | BootstrapHealthData | BootstrapCompleteData | BootstrapErrorData;
|
|
251
|
+
//# sourceMappingURL=bootstrap-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap-events.d.ts","sourceRoot":"","sources":["../../src/types/bootstrap-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB,2BAA2B,GAC3B,sBAAsB,GACtB,8BAA8B,GAC9B,aAAa,CAAC;AAMlB;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,UAAU,GACV,WAAW,GACX,cAAc,GACd,SAAS,GACT,MAAM,GACN,OAAO,CAAC;AAEZ;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAOjE,CAAC;AAMF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,eAAe,EAAE,MAAM,CAAC;IACxB,mCAAmC;IACnC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oEAAoE;IACpE,sBAAsB,EAAE,MAAM,CAAC;IAC/B,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAC5C,+BAA+B;IAC/B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,+BAA+B;IAC/B,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAMD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;CAElC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;CAEhC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,oBAAoB,EAAE,mBAAmB,CAAC;IAE1C,eAAe,EAAE,MAAM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+1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bootstrap SSE Event Types
|
|
3
|
+
*
|
|
4
|
+
* Server sends these events during streaming bootstrap.
|
|
5
|
+
* Client displays progress to user.
|
|
6
|
+
*
|
|
7
|
+
* Updated to match ACE Server v3.13.0 response format.
|
|
8
|
+
*
|
|
9
|
+
* @package @ace-sdk/core
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Human-readable labels for stages
|
|
13
|
+
*/
|
|
14
|
+
export const BOOTSTRAP_STAGE_LABELS = {
|
|
15
|
+
received: 'Receiving code blocks',
|
|
16
|
+
analyzing: 'Analyzing patterns',
|
|
17
|
+
synthesizing: 'Synthesizing insights',
|
|
18
|
+
merging: 'Merging into playbook',
|
|
19
|
+
done: 'Bootstrap complete',
|
|
20
|
+
error: 'Error occurred'
|
|
21
|
+
};
|
|
22
|
+
// =============================================================================
|
|
23
|
+
// Type Guards
|
|
24
|
+
// =============================================================================
|
|
25
|
+
/**
|
|
26
|
+
* Type guard for received stage
|
|
27
|
+
*/
|
|
28
|
+
export function isReceivedEvent(event) {
|
|
29
|
+
return event.stage === 'received';
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Type guard for analyzing stage
|
|
33
|
+
*/
|
|
34
|
+
export function isAnalyzingEvent(event) {
|
|
35
|
+
return event.stage === 'analyzing';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Type guard for synthesizing stage
|
|
39
|
+
*/
|
|
40
|
+
export function isSynthesizingEvent(event) {
|
|
41
|
+
return event.stage === 'synthesizing';
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Type guard for merging stage
|
|
45
|
+
*/
|
|
46
|
+
export function isMergingEvent(event) {
|
|
47
|
+
return event.stage === 'merging';
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Type guard for done stage
|
|
51
|
+
*/
|
|
52
|
+
export function isDoneEvent(event) {
|
|
53
|
+
return event.stage === 'done';
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Type guard for error stage
|
|
57
|
+
*/
|
|
58
|
+
export function isErrorEvent(event) {
|
|
59
|
+
return event.stage === 'error';
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Check if event is a terminal event (done or error)
|
|
63
|
+
*/
|
|
64
|
+
export function isTerminalEvent(event) {
|
|
65
|
+
return event.stage === 'done' || event.stage === 'error';
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated Use isDoneEvent instead
|
|
69
|
+
*/
|
|
70
|
+
export function isCompleteEvent(event) {
|
|
71
|
+
return event.stage === 'done';
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated Use isReceivedEvent instead
|
|
75
|
+
*/
|
|
76
|
+
export function isStartedEvent(event) {
|
|
77
|
+
return event.stage === 'received';
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @deprecated Use isAnalyzingEvent or isSynthesizingEvent instead
|
|
81
|
+
*/
|
|
82
|
+
export function isStageEvent(event) {
|
|
83
|
+
return ['analyzing', 'synthesizing', 'merging'].includes(event.stage);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @deprecated Progress is embedded in stage messages
|
|
87
|
+
*/
|
|
88
|
+
export function isProgressEvent(_event) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated Patterns data is in done event
|
|
93
|
+
*/
|
|
94
|
+
export function isPatternsEvent(_event) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* @deprecated Health data is in done event
|
|
99
|
+
*/
|
|
100
|
+
export function isHealthEvent(_event) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=bootstrap-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap-events.js","sourceRoot":"","sources":["../../src/types/bootstrap-events.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EG;AACH,MAAM,UAAU,cAAc,CAAC,KAAwB;IACrD,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,OAAO,CAAC,WAAW,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACxE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAyB;IACvD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAyB;IACvD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAAyB;IACrD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ export interface OrgConfig {
|
|
|
10
10
|
apiToken: string;
|
|
11
11
|
projects: string[];
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Verbosity level for learn command output
|
|
15
|
+
*/
|
|
16
|
+
export type VerbosityLevel = 'compact' | 'detailed';
|
|
13
17
|
/**
|
|
14
18
|
* ACE Configuration (loaded from config file)
|
|
15
19
|
*/
|
|
@@ -19,6 +23,7 @@ export interface AceConfig {
|
|
|
19
23
|
projectId: string;
|
|
20
24
|
cacheTtlMinutes: number;
|
|
21
25
|
orgs?: Record<string, OrgConfig>;
|
|
26
|
+
verbosity?: VerbosityLevel;
|
|
22
27
|
}
|
|
23
28
|
/**
|
|
24
29
|
* Server-side runtime settings (v3.9.0+)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACj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E,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
|
package/dist/types/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmGH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAuB;IAC1D,kBAAkB;IAClB,UAAU,EAAE,EAAE;IACd,eAAe,EAAE,IAAI;IAErB,oBAAoB;IACpB,eAAe,EAAE,IAAI;IACrB,iBAAiB,EAAE,GAAG;IACtB,qBAAqB,EAAE,IAAI;IAE3B,gBAAgB;IAChB,kBAAkB,EAAE,UAAU;IAC9B,sBAAsB,EAAE,IAAI;IAE5B,oBAAoB;IACpB,iBAAiB,EAAE,CAAC;IACpB,qBAAqB,EAAE,SAAS;IAEhC,YAAY;IACZ,oBAAoB,EAAE,QAAQ;IAC9B,4BAA4B,EAAE,QAAQ;CACvC,CAAC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project DNA - Fingerprint for intelligent pattern matching
|
|
3
|
+
*
|
|
4
|
+
* Shared schema between @ace-sdk/core and ACE Server.
|
|
5
|
+
* Server stores this in `projects.settings_json` field.
|
|
6
|
+
*
|
|
7
|
+
* @package @ace-sdk/core
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Language breakdown from linguist-js
|
|
11
|
+
*/
|
|
12
|
+
export interface LanguageStats {
|
|
13
|
+
/** Language name (e.g., "TypeScript", "Python", "Java") */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Percentage of codebase (0-100) */
|
|
16
|
+
percentage: number;
|
|
17
|
+
/** Number of files with this language */
|
|
18
|
+
files: number;
|
|
19
|
+
/** Total bytes of code */
|
|
20
|
+
bytes: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Detected project type based on folder structure and dependencies
|
|
24
|
+
*/
|
|
25
|
+
export type ProjectType = 'library' | 'webapp' | 'api-server' | 'cli' | 'monorepo' | 'mobile' | 'unknown';
|
|
26
|
+
/**
|
|
27
|
+
* Framework detected from dependencies
|
|
28
|
+
*/
|
|
29
|
+
export interface FrameworkInfo {
|
|
30
|
+
/** Framework name (e.g., "React", "Express", "FastAPI") */
|
|
31
|
+
name: string;
|
|
32
|
+
/** Semver version from package.json/requirements.txt */
|
|
33
|
+
version: string;
|
|
34
|
+
/** Framework category */
|
|
35
|
+
category: 'frontend' | 'backend' | 'testing' | 'build' | 'utility';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Metrics from import graph analysis
|
|
39
|
+
*/
|
|
40
|
+
export interface GraphMetrics {
|
|
41
|
+
/** Total files in the graph */
|
|
42
|
+
totalFiles: number;
|
|
43
|
+
/** Files with 5+ importers (max 20) */
|
|
44
|
+
hubFiles: string[];
|
|
45
|
+
/** Files with no dependents (max 10) */
|
|
46
|
+
entryPoints: string[];
|
|
47
|
+
/** Files with no dependencies (max 20) */
|
|
48
|
+
leafNodes: string[];
|
|
49
|
+
/** Circular dependency chains (max 10) */
|
|
50
|
+
circularDeps: string[][];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Code health indicators from static analysis
|
|
54
|
+
*/
|
|
55
|
+
export interface CodeHealthMetrics {
|
|
56
|
+
/** Percentage of files never imported */
|
|
57
|
+
deadCodePercentage: number;
|
|
58
|
+
/** Number of circular dependency chains */
|
|
59
|
+
circularDepsCount: number;
|
|
60
|
+
/** Number of unused package.json dependencies */
|
|
61
|
+
unusedDepsCount: number;
|
|
62
|
+
/** Average lines per file */
|
|
63
|
+
avgFileSize: number;
|
|
64
|
+
/** Largest file (lines) */
|
|
65
|
+
maxFileSize: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Detected architecture patterns
|
|
69
|
+
*/
|
|
70
|
+
export interface PatternDetection {
|
|
71
|
+
/** Error handling approach */
|
|
72
|
+
errorHandling?: 'centralized' | 'distributed' | 'mixed';
|
|
73
|
+
/** Testing approach */
|
|
74
|
+
testingApproach?: 'unit' | 'integration' | 'e2e' | 'mixed' | 'none';
|
|
75
|
+
/** API style */
|
|
76
|
+
apiStyle?: 'rest' | 'graphql' | 'trpc' | 'grpc' | 'mixed';
|
|
77
|
+
/** State management solution */
|
|
78
|
+
stateManagement?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Recommendation from code analysis
|
|
82
|
+
*/
|
|
83
|
+
export interface Recommendation {
|
|
84
|
+
/** Priority level */
|
|
85
|
+
priority: 'high' | 'medium' | 'low';
|
|
86
|
+
/** Recommendation category */
|
|
87
|
+
category: 'architecture' | 'performance' | 'maintainability' | 'security';
|
|
88
|
+
/** Human-readable message */
|
|
89
|
+
message: string;
|
|
90
|
+
/** Affected files (optional) */
|
|
91
|
+
affectedFiles?: string[];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Complete Project DNA fingerprint
|
|
95
|
+
*
|
|
96
|
+
* This is the main data structure sent to the server for storage
|
|
97
|
+
* and used for cross-project pattern matching.
|
|
98
|
+
*/
|
|
99
|
+
export interface ProjectDNA {
|
|
100
|
+
/** Organization ID */
|
|
101
|
+
orgId: string;
|
|
102
|
+
/** Project ID */
|
|
103
|
+
projectId: string;
|
|
104
|
+
/** ISO 8601 timestamp when analyzed */
|
|
105
|
+
analyzedAt: string;
|
|
106
|
+
/** Git commit hash at analysis time */
|
|
107
|
+
gitCommit?: string;
|
|
108
|
+
/** Detected project type */
|
|
109
|
+
projectType: ProjectType;
|
|
110
|
+
/** Language breakdown (sorted by percentage desc) */
|
|
111
|
+
languages: LanguageStats[];
|
|
112
|
+
/** Primary language name */
|
|
113
|
+
primaryLanguage: string;
|
|
114
|
+
/** Detected frameworks */
|
|
115
|
+
frameworks: FrameworkInfo[];
|
|
116
|
+
/** Detected patterns */
|
|
117
|
+
patterns: PatternDetection;
|
|
118
|
+
/** Import graph metrics */
|
|
119
|
+
graph: GraphMetrics;
|
|
120
|
+
/** Code health metrics */
|
|
121
|
+
health: CodeHealthMetrics;
|
|
122
|
+
/** Analysis recommendations */
|
|
123
|
+
recommendations: Recommendation[];
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Request to store Project DNA on server
|
|
127
|
+
*/
|
|
128
|
+
export interface StoreProjectDNARequest {
|
|
129
|
+
orgId: string;
|
|
130
|
+
projectId: string;
|
|
131
|
+
dna: ProjectDNA;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Response from server after storing DNA
|
|
135
|
+
*/
|
|
136
|
+
export interface StoreProjectDNAResponse {
|
|
137
|
+
/** Whether storage succeeded */
|
|
138
|
+
success: boolean;
|
|
139
|
+
/** Timestamp when stored */
|
|
140
|
+
storedAt: string;
|
|
141
|
+
/** Similar projects for cross-project learning (future) */
|
|
142
|
+
similarProjects?: {
|
|
143
|
+
projectId: string;
|
|
144
|
+
similarity: number;
|
|
145
|
+
}[];
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Create a default empty ProjectDNA structure
|
|
149
|
+
*/
|
|
150
|
+
export declare function createEmptyProjectDNA(orgId: string, projectId: string): ProjectDNA;
|
|
151
|
+
//# sourceMappingURL=project-dna.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-dna.d.ts","sourceRoot":"","sources":["../../src/types/project-dna.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf;AAMD;;GAEG;AACH,MAA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,CAAC;IACjB,2DAA2D;IAC3D,eAAe,CAAC,EAAE;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;CACL;AAMD;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,UAAU,CA0BZ"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project DNA - Fingerprint for intelligent pattern matching
|
|
3
|
+
*
|
|
4
|
+
* Shared schema between @ace-sdk/core and ACE Server.
|
|
5
|
+
* Server stores this in `projects.settings_json` field.
|
|
6
|
+
*
|
|
7
|
+
* @package @ace-sdk/core
|
|
8
|
+
*/
|
|
9
|
+
// =============================================================================
|
|
10
|
+
// Builder Helper
|
|
11
|
+
// =============================================================================
|
|
12
|
+
/**
|
|
13
|
+
* Create a default empty ProjectDNA structure
|
|
14
|
+
*/
|
|
15
|
+
export function createEmptyProjectDNA(orgId, projectId) {
|
|
16
|
+
return {
|
|
17
|
+
orgId,
|
|
18
|
+
projectId,
|
|
19
|
+
analyzedAt: new Date().toISOString(),
|
|
20
|
+
projectType: 'unknown',
|
|
21
|
+
languages: [],
|
|
22
|
+
primaryLanguage: 'Unknown',
|
|
23
|
+
frameworks: [],
|
|
24
|
+
patterns: {},
|
|
25
|
+
graph: {
|
|
26
|
+
totalFiles: 0,
|
|
27
|
+
hubFiles: [],
|
|
28
|
+
entryPoints: [],
|
|
29
|
+
leafNodes: [],
|
|
30
|
+
circularDeps: []
|
|
31
|
+
},
|
|
32
|
+
health: {
|
|
33
|
+
deadCodePercentage: 0,
|
|
34
|
+
circularDepsCount: 0,
|
|
35
|
+
unusedDepsCount: 0,
|
|
36
|
+
avgFileSize: 0,
|
|
37
|
+
maxFileSize: 0
|
|
38
|
+
},
|
|
39
|
+
recommendations: []
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=project-dna.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-dna.js","sourceRoot":"","sources":["../../src/types/project-dna.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA0MH,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAa,EACb,SAAiB;IAEjB,OAAO;QACL,KAAK;QACL,SAAS;QACT,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACpC,WAAW,EAAE,SAAS;QACtB,SAAS,EAAE,EAAE;QACb,eAAe,EAAE,SAAS;QAC1B,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE;YACL,UAAU,EAAE,CAAC;YACb,QAAQ,EAAE,EAAE;YACZ,WAAW,EAAE,EAAE;YACf,SAAS,EAAE,EAAE;YACb,YAAY,EAAE,EAAE;SACjB;QACD,MAAM,EAAE;YACN,kBAAkB,EAAE,CAAC;YACrB,iBAAiB,EAAE,CAAC;YACpB,eAAe,EAAE,CAAC;YAClB,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,CAAC;SACf;QACD,eAAe,EAAE,EAAE;KACpB,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ace-sdk/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "ACE Core - Shared library for ACE pattern learning (HTTP client, caching, config, types)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"better-sqlite3": "^12.4.6",
|
|
41
|
-
"linguist-js": "^2.9.2"
|
|
41
|
+
"linguist-js": "^2.9.2",
|
|
42
|
+
"skott": "^0.35.6"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@types/better-sqlite3": "^7.6.13",
|