ai-sdlc 0.2.0-alpha.6 → 0.2.0-alpha.60
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/README.md +53 -1058
- package/dist/agents/implementation.d.ts +36 -1
- package/dist/agents/implementation.d.ts.map +1 -1
- package/dist/agents/implementation.js +259 -30
- package/dist/agents/implementation.js.map +1 -1
- package/dist/agents/index.d.ts +2 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +2 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/orchestrator.d.ts +61 -0
- package/dist/agents/orchestrator.d.ts.map +1 -0
- package/dist/agents/orchestrator.js +443 -0
- package/dist/agents/orchestrator.js.map +1 -0
- package/dist/agents/planning.d.ts +1 -1
- package/dist/agents/planning.d.ts.map +1 -1
- package/dist/agents/planning.js +55 -4
- package/dist/agents/planning.js.map +1 -1
- package/dist/agents/refinement.d.ts.map +1 -1
- package/dist/agents/refinement.js +22 -3
- package/dist/agents/refinement.js.map +1 -1
- package/dist/agents/research.d.ts +85 -1
- package/dist/agents/research.d.ts.map +1 -1
- package/dist/agents/research.js +506 -16
- package/dist/agents/research.js.map +1 -1
- package/dist/agents/review.d.ts +103 -2
- package/dist/agents/review.d.ts.map +1 -1
- package/dist/agents/review.js +777 -93
- package/dist/agents/review.js.map +1 -1
- package/dist/agents/rework.d.ts.map +1 -1
- package/dist/agents/rework.js +25 -4
- package/dist/agents/rework.js.map +1 -1
- package/dist/agents/single-task.d.ts +41 -0
- package/dist/agents/single-task.d.ts.map +1 -0
- package/dist/agents/single-task.js +357 -0
- package/dist/agents/single-task.js.map +1 -0
- package/dist/agents/state-assessor.d.ts +3 -3
- package/dist/agents/state-assessor.d.ts.map +1 -1
- package/dist/agents/state-assessor.js +6 -6
- package/dist/agents/state-assessor.js.map +1 -1
- package/dist/agents/test-pattern-detector.d.ts +49 -0
- package/dist/agents/test-pattern-detector.d.ts.map +1 -0
- package/dist/agents/test-pattern-detector.js +273 -0
- package/dist/agents/test-pattern-detector.js.map +1 -0
- package/dist/agents/verification.d.ts +11 -0
- package/dist/agents/verification.d.ts.map +1 -1
- package/dist/agents/verification.js +99 -12
- package/dist/agents/verification.js.map +1 -1
- package/dist/cli/commands/migrate.js +1 -1
- package/dist/cli/commands/migrate.js.map +1 -1
- package/dist/cli/commands.d.ts +66 -3
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +1548 -198
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/daemon.d.ts.map +1 -1
- package/dist/cli/daemon.js +25 -3
- package/dist/cli/daemon.js.map +1 -1
- package/dist/cli/runner.d.ts.map +1 -1
- package/dist/cli/runner.js +35 -12
- package/dist/cli/runner.js.map +1 -1
- package/dist/core/auth.d.ts +43 -0
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/auth.js +105 -1
- package/dist/core/auth.js.map +1 -1
- package/dist/core/client.d.ts +25 -1
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +247 -7
- package/dist/core/client.js.map +1 -1
- package/dist/core/config.d.ts +32 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +146 -3
- package/dist/core/config.js.map +1 -1
- package/dist/core/conflict-detector.d.ts +108 -0
- package/dist/core/conflict-detector.d.ts.map +1 -0
- package/dist/core/conflict-detector.js +413 -0
- package/dist/core/conflict-detector.js.map +1 -0
- package/dist/core/git-utils.d.ts +28 -0
- package/dist/core/git-utils.d.ts.map +1 -0
- package/dist/core/git-utils.js +146 -0
- package/dist/core/git-utils.js.map +1 -0
- package/dist/core/index.d.ts +19 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +19 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/kanban.d.ts +1 -1
- package/dist/core/kanban.d.ts.map +1 -1
- package/dist/core/kanban.js +3 -3
- package/dist/core/kanban.js.map +1 -1
- package/dist/core/llm-utils.d.ts +103 -0
- package/dist/core/llm-utils.d.ts.map +1 -0
- package/dist/core/llm-utils.js +368 -0
- package/dist/core/llm-utils.js.map +1 -0
- package/dist/core/logger.d.ts +92 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +221 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/process-manager.d.ts +15 -0
- package/dist/core/process-manager.d.ts.map +1 -0
- package/dist/core/process-manager.js +132 -0
- package/dist/core/process-manager.js.map +1 -0
- package/dist/core/story-logger.d.ts +102 -0
- package/dist/core/story-logger.d.ts.map +1 -0
- package/dist/core/story-logger.js +265 -0
- package/dist/core/story-logger.js.map +1 -0
- package/dist/core/story.d.ts +113 -20
- package/dist/core/story.d.ts.map +1 -1
- package/dist/core/story.js +328 -40
- package/dist/core/story.js.map +1 -1
- package/dist/core/task-parser.d.ts +59 -0
- package/dist/core/task-parser.d.ts.map +1 -0
- package/dist/core/task-parser.js +235 -0
- package/dist/core/task-parser.js.map +1 -0
- package/dist/core/task-progress.d.ts +92 -0
- package/dist/core/task-progress.d.ts.map +1 -0
- package/dist/core/task-progress.js +280 -0
- package/dist/core/task-progress.js.map +1 -0
- package/dist/core/workflow-state.d.ts +45 -6
- package/dist/core/workflow-state.d.ts.map +1 -1
- package/dist/core/workflow-state.js +201 -12
- package/dist/core/workflow-state.js.map +1 -1
- package/dist/core/worktree.d.ts +186 -0
- package/dist/core/worktree.d.ts.map +1 -0
- package/dist/core/worktree.js +554 -0
- package/dist/core/worktree.js.map +1 -0
- package/dist/index.js +145 -5
- package/dist/index.js.map +1 -1
- package/dist/services/error-classifier.d.ts +119 -0
- package/dist/services/error-classifier.d.ts.map +1 -0
- package/dist/services/error-classifier.js +182 -0
- package/dist/services/error-classifier.js.map +1 -0
- package/dist/types/index.d.ts +381 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +5 -2
- package/templates/story.md +5 -0
package/dist/core/client.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { query } from '@anthropic-ai/claude-agent-sdk';
|
|
2
|
-
import { configureAgentSdkAuth, getApiKey, getCredentialType } from './auth.js';
|
|
2
|
+
import { configureAgentSdkAuth, getApiKey, getCredentialType, getTokenExpirationInfo } from './auth.js';
|
|
3
3
|
import { loadConfig, DEFAULT_TIMEOUTS } from './config.js';
|
|
4
|
+
import { getLogger } from './logger.js';
|
|
4
5
|
import { platform, homedir } from 'os';
|
|
5
6
|
import path from 'path';
|
|
6
7
|
/**
|
|
@@ -13,6 +14,15 @@ export class AgentTimeoutError extends Error {
|
|
|
13
14
|
this.name = 'AgentTimeoutError';
|
|
14
15
|
}
|
|
15
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Error thrown when authentication fails (e.g., expired token)
|
|
19
|
+
*/
|
|
20
|
+
export class AuthenticationError extends Error {
|
|
21
|
+
constructor(message) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.name = 'AuthenticationError';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
16
26
|
/**
|
|
17
27
|
* Validate that the working directory is within safe boundaries
|
|
18
28
|
*/
|
|
@@ -28,11 +38,116 @@ function isValidWorkingDirectory(workingDir) {
|
|
|
28
38
|
}
|
|
29
39
|
}
|
|
30
40
|
/**
|
|
31
|
-
*
|
|
32
|
-
* Automatically configures authentication from environment or keychain.
|
|
33
|
-
* CLAUDE.md discovery is handled automatically by the SDK when settingSources includes 'project'.
|
|
41
|
+
* Classify an error as transient (should retry) or permanent (fail immediately)
|
|
34
42
|
*/
|
|
35
|
-
export
|
|
43
|
+
export function classifyApiError(error) {
|
|
44
|
+
// Check for HTTP status codes
|
|
45
|
+
if ('status' in error && typeof error.status === 'number') {
|
|
46
|
+
const status = error.status;
|
|
47
|
+
// Transient errors (should retry)
|
|
48
|
+
if (status === 429)
|
|
49
|
+
return 'transient'; // Rate limit
|
|
50
|
+
if (status === 503)
|
|
51
|
+
return 'transient'; // Service unavailable
|
|
52
|
+
if (status >= 500 && status < 600)
|
|
53
|
+
return 'transient'; // Server errors
|
|
54
|
+
// Permanent errors (don't retry)
|
|
55
|
+
if (status === 400)
|
|
56
|
+
return 'permanent'; // Bad request
|
|
57
|
+
if (status === 401)
|
|
58
|
+
return 'permanent'; // Unauthorized
|
|
59
|
+
if (status === 403)
|
|
60
|
+
return 'permanent'; // Forbidden
|
|
61
|
+
if (status === 404)
|
|
62
|
+
return 'permanent'; // Not found
|
|
63
|
+
}
|
|
64
|
+
// Check for AuthenticationError
|
|
65
|
+
if (error instanceof AuthenticationError) {
|
|
66
|
+
return 'permanent';
|
|
67
|
+
}
|
|
68
|
+
// Check for network errors (should retry)
|
|
69
|
+
if ('code' in error) {
|
|
70
|
+
const code = error.code;
|
|
71
|
+
const transientNetworkCodes = [
|
|
72
|
+
'ETIMEDOUT',
|
|
73
|
+
'ECONNRESET',
|
|
74
|
+
'ENOTFOUND',
|
|
75
|
+
'ECONNREFUSED',
|
|
76
|
+
'EHOSTUNREACH',
|
|
77
|
+
'EPIPE',
|
|
78
|
+
];
|
|
79
|
+
if (transientNetworkCodes.includes(code))
|
|
80
|
+
return 'transient';
|
|
81
|
+
}
|
|
82
|
+
// Default to permanent (fail-safe)
|
|
83
|
+
return 'permanent';
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Determine if an error should be retried based on classification and attempt count
|
|
87
|
+
*/
|
|
88
|
+
export function shouldRetry(error, attemptNumber, maxRetries) {
|
|
89
|
+
// Check if we've exceeded max retries
|
|
90
|
+
if (attemptNumber >= maxRetries) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
// Check error classification
|
|
94
|
+
const classification = classifyApiError(error);
|
|
95
|
+
return classification === 'transient';
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Calculate exponential backoff delay with jitter
|
|
99
|
+
*/
|
|
100
|
+
export function calculateBackoff(attemptNumber, initialDelay, maxDelay) {
|
|
101
|
+
// Exponential backoff: initialDelay * 2^attemptNumber
|
|
102
|
+
const exponentialDelay = initialDelay * Math.pow(2, attemptNumber);
|
|
103
|
+
// Cap at maxDelay
|
|
104
|
+
const cappedDelay = Math.min(exponentialDelay, maxDelay);
|
|
105
|
+
// Apply jitter (±20% variance)
|
|
106
|
+
const jitterFactor = 0.8 + Math.random() * 0.4; // Range: 0.8 to 1.2
|
|
107
|
+
const delayWithJitter = cappedDelay * jitterFactor;
|
|
108
|
+
return Math.round(delayWithJitter);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Sleep for a specified number of milliseconds
|
|
112
|
+
*/
|
|
113
|
+
function sleep(ms) {
|
|
114
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Get human-readable error type label for display
|
|
118
|
+
*/
|
|
119
|
+
function getErrorTypeLabel(error) {
|
|
120
|
+
if ('status' in error && typeof error.status === 'number') {
|
|
121
|
+
const status = error.status;
|
|
122
|
+
if (status === 429)
|
|
123
|
+
return 'rate limit';
|
|
124
|
+
if (status === 503)
|
|
125
|
+
return 'service unavailable';
|
|
126
|
+
if (status >= 500)
|
|
127
|
+
return 'server error';
|
|
128
|
+
}
|
|
129
|
+
if ('code' in error) {
|
|
130
|
+
const code = error.code;
|
|
131
|
+
if (code === 'ETIMEDOUT')
|
|
132
|
+
return 'network timeout';
|
|
133
|
+
if (code === 'ECONNRESET')
|
|
134
|
+
return 'connection reset';
|
|
135
|
+
if (code === 'ENOTFOUND')
|
|
136
|
+
return 'DNS lookup failed';
|
|
137
|
+
if (code === 'ECONNREFUSED')
|
|
138
|
+
return 'connection refused';
|
|
139
|
+
if (code === 'EHOSTUNREACH')
|
|
140
|
+
return 'host unreachable';
|
|
141
|
+
if (code === 'EPIPE')
|
|
142
|
+
return 'broken pipe';
|
|
143
|
+
}
|
|
144
|
+
return 'error';
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Execute the agent query (internal implementation, no retry logic)
|
|
148
|
+
*/
|
|
149
|
+
async function executeAgentQuery(options, queryStartTime) {
|
|
150
|
+
const logger = getLogger();
|
|
36
151
|
// Configure authentication
|
|
37
152
|
const authResult = configureAgentSdkAuth();
|
|
38
153
|
if (!authResult.configured) {
|
|
@@ -47,6 +162,19 @@ export async function runAgentQuery(options) {
|
|
|
47
162
|
errorMessage += '.';
|
|
48
163
|
throw new Error(errorMessage);
|
|
49
164
|
}
|
|
165
|
+
// Check token expiration (only for OAuth tokens from credential file)
|
|
166
|
+
if (authResult.type === 'oauth_token') {
|
|
167
|
+
const tokenInfo = getTokenExpirationInfo();
|
|
168
|
+
// If token is expired, throw authentication error
|
|
169
|
+
if (tokenInfo.isExpired) {
|
|
170
|
+
const source = tokenInfo.source ? `Token from ${tokenInfo.source}` : 'OAuth token';
|
|
171
|
+
throw new AuthenticationError(`${source} has expired. Please run \`claude login\` to refresh your credentials.`);
|
|
172
|
+
}
|
|
173
|
+
// If token expires within 5 minutes, show warning but proceed
|
|
174
|
+
if (tokenInfo.expiresInMs !== null && tokenInfo.expiresInMs < 5 * 60 * 1000) {
|
|
175
|
+
console.warn('⚠️ OAuth token expires in less than 5 minutes. Consider running `claude login`.');
|
|
176
|
+
}
|
|
177
|
+
}
|
|
50
178
|
// Validate and normalize working directory
|
|
51
179
|
const workingDir = path.resolve(options.workingDirectory || process.cwd());
|
|
52
180
|
if (!isValidWorkingDirectory(workingDir)) {
|
|
@@ -56,6 +184,14 @@ export async function runAgentQuery(options) {
|
|
|
56
184
|
const config = loadConfig(workingDir);
|
|
57
185
|
const settingSources = config.settingSources || [];
|
|
58
186
|
const timeout = options.timeout ?? config.timeouts?.agentTimeout ?? DEFAULT_TIMEOUTS.agentTimeout;
|
|
187
|
+
// Log query start
|
|
188
|
+
logger.debug('agent-sdk', 'Starting agent query', {
|
|
189
|
+
model: options.model || 'claude-sonnet-4-5-20250929',
|
|
190
|
+
workingDirectory: workingDir,
|
|
191
|
+
timeoutMs: timeout,
|
|
192
|
+
authType: authResult.type,
|
|
193
|
+
promptLength: options.prompt.length,
|
|
194
|
+
});
|
|
59
195
|
const results = [];
|
|
60
196
|
const response = query({
|
|
61
197
|
prompt: options.prompt,
|
|
@@ -127,9 +263,19 @@ export async function runAgentQuery(options) {
|
|
|
127
263
|
break;
|
|
128
264
|
case 'error':
|
|
129
265
|
options.onProgress?.({ type: 'error', message: message.error?.message || 'Agent error' });
|
|
130
|
-
|
|
266
|
+
const agentError = new Error(message.error?.message || 'Agent error');
|
|
267
|
+
logger.error('agent-sdk', 'Agent query error', {
|
|
268
|
+
durationMs: Date.now() - queryStartTime,
|
|
269
|
+
error: agentError.message,
|
|
270
|
+
});
|
|
271
|
+
throw agentError;
|
|
131
272
|
}
|
|
132
273
|
}
|
|
274
|
+
const queryDuration = Date.now() - queryStartTime;
|
|
275
|
+
logger.info('agent-sdk', 'Agent query completed', {
|
|
276
|
+
durationMs: queryDuration,
|
|
277
|
+
resultLength: results.join('\n').length,
|
|
278
|
+
});
|
|
133
279
|
return results.join('\n');
|
|
134
280
|
}
|
|
135
281
|
finally {
|
|
@@ -139,7 +285,101 @@ export async function runAgentQuery(options) {
|
|
|
139
285
|
}
|
|
140
286
|
};
|
|
141
287
|
// Race between the agent query and the timeout
|
|
142
|
-
|
|
288
|
+
try {
|
|
289
|
+
return await Promise.race([processMessages(), timeoutPromise]);
|
|
290
|
+
}
|
|
291
|
+
catch (error) {
|
|
292
|
+
if (error instanceof AgentTimeoutError) {
|
|
293
|
+
logger.error('agent-sdk', 'Agent query timed out', {
|
|
294
|
+
durationMs: Date.now() - queryStartTime,
|
|
295
|
+
timeoutMs: timeout,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
throw error;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Run an agent query using the Claude Agent SDK with automatic retry logic.
|
|
303
|
+
* Automatically configures authentication from environment or keychain.
|
|
304
|
+
* CLAUDE.md discovery is handled automatically by the SDK when settingSources includes 'project'.
|
|
305
|
+
*/
|
|
306
|
+
export async function runAgentQuery(options) {
|
|
307
|
+
const logger = getLogger();
|
|
308
|
+
const config = loadConfig(options.workingDirectory || process.cwd());
|
|
309
|
+
const retryConfig = config.retry || { maxRetries: 3, initialDelay: 2000, maxDelay: 32000, maxTotalDuration: 60000 };
|
|
310
|
+
const overallStartTime = Date.now();
|
|
311
|
+
let lastError;
|
|
312
|
+
// Retry loop: attempt 0 is the initial try, attempts 1+ are retries
|
|
313
|
+
for (let attempt = 0; attempt <= retryConfig.maxRetries; attempt++) {
|
|
314
|
+
const queryStartTime = Date.now();
|
|
315
|
+
try {
|
|
316
|
+
// Execute the query
|
|
317
|
+
const result = await executeAgentQuery(options, queryStartTime);
|
|
318
|
+
return result;
|
|
319
|
+
}
|
|
320
|
+
catch (error) {
|
|
321
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
322
|
+
// Check if we should retry
|
|
323
|
+
if (!shouldRetry(lastError, attempt, retryConfig.maxRetries)) {
|
|
324
|
+
// Check if this is a permanent error (not retryable) vs max retries exceeded
|
|
325
|
+
const errorType = classifyApiError(lastError);
|
|
326
|
+
if (errorType === 'permanent') {
|
|
327
|
+
// Permanent error - fail immediately with original error
|
|
328
|
+
throw lastError;
|
|
329
|
+
}
|
|
330
|
+
// Max retries exceeded for transient error - break to enhance the error message
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
// Check total duration cap
|
|
334
|
+
const elapsedTime = Date.now() - overallStartTime;
|
|
335
|
+
if (elapsedTime >= retryConfig.maxTotalDuration) {
|
|
336
|
+
logger.warn('agent-sdk', 'Total retry duration exceeded', {
|
|
337
|
+
elapsedMs: elapsedTime,
|
|
338
|
+
maxDurationMs: retryConfig.maxTotalDuration,
|
|
339
|
+
attempt,
|
|
340
|
+
});
|
|
341
|
+
throw lastError;
|
|
342
|
+
}
|
|
343
|
+
// Calculate backoff delay
|
|
344
|
+
const delay = calculateBackoff(attempt, retryConfig.initialDelay, retryConfig.maxDelay);
|
|
345
|
+
// Get error type label for logging/display
|
|
346
|
+
const errorTypeLabel = getErrorTypeLabel(lastError);
|
|
347
|
+
// Log retry attempt
|
|
348
|
+
logger.info('agent-sdk', 'Retrying after transient error', {
|
|
349
|
+
attempt: attempt + 1,
|
|
350
|
+
maxRetries: retryConfig.maxRetries,
|
|
351
|
+
delayMs: delay,
|
|
352
|
+
errorType: errorTypeLabel,
|
|
353
|
+
error: lastError.message,
|
|
354
|
+
});
|
|
355
|
+
// Notify progress callback
|
|
356
|
+
options.onProgress?.({
|
|
357
|
+
type: 'retry',
|
|
358
|
+
attempt: attempt + 1,
|
|
359
|
+
delay,
|
|
360
|
+
error: lastError.message,
|
|
361
|
+
errorType: errorTypeLabel,
|
|
362
|
+
});
|
|
363
|
+
// Show warning after 2nd retry (attempt 2+)
|
|
364
|
+
if (attempt >= 2) {
|
|
365
|
+
console.warn('⚠️ Experiencing temporary issues with API...');
|
|
366
|
+
}
|
|
367
|
+
// Wait before retry
|
|
368
|
+
await sleep(delay);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
// If we get here, we've exhausted retries - enhance error message with context
|
|
372
|
+
if (lastError) {
|
|
373
|
+
const errorTypeLabel = getErrorTypeLabel(lastError);
|
|
374
|
+
const isRateLimit = 'status' in lastError && lastError.status === 429;
|
|
375
|
+
if (isRateLimit) {
|
|
376
|
+
throw new Error(`Rate limit exceeded after ${retryConfig.maxRetries} retry attempts. ` +
|
|
377
|
+
`API may be rate limiting your requests. Try again in a few minutes or reduce concurrent requests.`);
|
|
378
|
+
}
|
|
379
|
+
throw new Error(`API request failed after ${retryConfig.maxRetries} retry attempts. ` +
|
|
380
|
+
`Last error (${errorTypeLabel}): ${lastError.message}`);
|
|
381
|
+
}
|
|
382
|
+
throw new Error('Max retries exceeded');
|
|
143
383
|
}
|
|
144
384
|
/**
|
|
145
385
|
* Get the current credential type being used
|
package/dist/core/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/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D,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB;IACtC,OAAO,iBAAiB,CAAC,SAAS,EAAE,CAAC,CAAC;AACxC,CAAC"}
|
package/dist/core/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Config, StageGateConfig, RefinementConfig, ReviewConfig, ImplementationConfig, TimeoutConfig, DaemonConfig, TDDConfig } from '../types/index.js';
|
|
1
|
+
import { Config, StageGateConfig, RefinementConfig, ReviewConfig, ImplementationConfig, TimeoutConfig, DaemonConfig, TDDConfig, WorktreeConfig, LogConfig, RetryConfig } from '../types/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Default timeout configuration
|
|
4
4
|
*/
|
|
@@ -11,10 +11,22 @@ export declare const DEFAULT_DAEMON_CONFIG: DaemonConfig;
|
|
|
11
11
|
* Default TDD configuration
|
|
12
12
|
*/
|
|
13
13
|
export declare const DEFAULT_TDD_CONFIG: TDDConfig;
|
|
14
|
+
/**
|
|
15
|
+
* Default worktree configuration
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEFAULT_WORKTREE_CONFIG: WorktreeConfig;
|
|
14
18
|
/**
|
|
15
19
|
* Default implementation configuration
|
|
16
20
|
*/
|
|
17
21
|
export declare const DEFAULT_IMPLEMENTATION_CONFIG: ImplementationConfig;
|
|
22
|
+
/**
|
|
23
|
+
* Default logging configuration
|
|
24
|
+
*/
|
|
25
|
+
export declare const DEFAULT_LOGGING_CONFIG: LogConfig;
|
|
26
|
+
/**
|
|
27
|
+
* Default retry configuration
|
|
28
|
+
*/
|
|
29
|
+
export declare const DEFAULT_RETRY_CONFIG: RetryConfig;
|
|
18
30
|
export declare const DEFAULT_CONFIG: Config;
|
|
19
31
|
/**
|
|
20
32
|
* Get the SDLC root folder path
|
|
@@ -57,6 +69,10 @@ export declare function validateReviewConfig(reviewConfig: ReviewConfig): Review
|
|
|
57
69
|
* Update review configuration
|
|
58
70
|
*/
|
|
59
71
|
export declare function updateReviewConfig(reviewConfig: Partial<ReviewConfig>, workingDir?: string): Config;
|
|
72
|
+
/**
|
|
73
|
+
* Validate retry configuration
|
|
74
|
+
*/
|
|
75
|
+
export declare function validateRetryConfig(retryConfig: RetryConfig): RetryConfig;
|
|
60
76
|
/**
|
|
61
77
|
* Validate implementation configuration
|
|
62
78
|
*/
|
|
@@ -65,4 +81,19 @@ export declare function validateImplementationConfig(implementationConfig: Imple
|
|
|
65
81
|
* Update implementation configuration
|
|
66
82
|
*/
|
|
67
83
|
export declare function updateImplementationConfig(implementationConfig: Partial<ImplementationConfig>, workingDir?: string): Config;
|
|
84
|
+
/**
|
|
85
|
+
* Validate and resolve worktree basePath
|
|
86
|
+
* @param basePath - The configured base path (may be relative)
|
|
87
|
+
* @param projectRoot - The project root directory
|
|
88
|
+
* @returns The resolved absolute path
|
|
89
|
+
* @throws Error if the parent directory does not exist
|
|
90
|
+
*/
|
|
91
|
+
export declare function validateWorktreeBasePath(basePath: string, projectRoot: string): string;
|
|
92
|
+
/**
|
|
93
|
+
* Get resolved worktree configuration with validated paths
|
|
94
|
+
* @param config - The loaded configuration
|
|
95
|
+
* @param projectRoot - The project root directory
|
|
96
|
+
* @returns Resolved worktree config with absolute basePath
|
|
97
|
+
*/
|
|
98
|
+
export declare function getWorktreeConfig(config: Config, projectRoot: string): WorktreeConfig;
|
|
68
99
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":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,CACpC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,CAAC,EAC3C,UAAU,GAAE,MAAsB,GACjC,MAAM,CAQR;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,GAAE,MAAsB,GAAG,MAAM,CAGrF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,YAAY,GAAG,YAAY,CA8B7E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,EACnC,UAAU,GAAE,MAAsB,GACjC,MAAM,CASR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CA4BzE;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,oBAAoB,EAAE,oBAAoB,GAAG,oBAAoB,CA8B7G;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,CAAC,EACnD,UAAU,GAAE,MAAsB,GACjC,MAAM,CASR;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAYtF;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,cAAc,CAOrF"}
|
package/dist/core/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
1
|
+
import * as fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
const CONFIG_FILENAME = '.ai-sdlc.json';
|
|
4
4
|
/**
|
|
@@ -31,6 +31,13 @@ export const DEFAULT_TDD_CONFIG = {
|
|
|
31
31
|
requireApprovalPerCycle: false,
|
|
32
32
|
requirePassingTestsForComplete: true,
|
|
33
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Default worktree configuration
|
|
36
|
+
*/
|
|
37
|
+
export const DEFAULT_WORKTREE_CONFIG = {
|
|
38
|
+
enabled: false,
|
|
39
|
+
basePath: '.ai-sdlc/worktrees',
|
|
40
|
+
};
|
|
34
41
|
/**
|
|
35
42
|
* Default implementation configuration
|
|
36
43
|
*/
|
|
@@ -38,6 +45,24 @@ export const DEFAULT_IMPLEMENTATION_CONFIG = {
|
|
|
38
45
|
maxRetries: 3,
|
|
39
46
|
maxRetriesUpperBound: 10,
|
|
40
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* Default logging configuration
|
|
50
|
+
*/
|
|
51
|
+
export const DEFAULT_LOGGING_CONFIG = {
|
|
52
|
+
enabled: true,
|
|
53
|
+
level: 'info',
|
|
54
|
+
maxFileSizeMb: 10,
|
|
55
|
+
maxFiles: 5,
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Default retry configuration
|
|
59
|
+
*/
|
|
60
|
+
export const DEFAULT_RETRY_CONFIG = {
|
|
61
|
+
maxRetries: 3,
|
|
62
|
+
initialDelay: 2000,
|
|
63
|
+
maxDelay: 32000,
|
|
64
|
+
maxTotalDuration: 60000,
|
|
65
|
+
};
|
|
41
66
|
export const DEFAULT_CONFIG = {
|
|
42
67
|
sdlcFolder: '.ai-sdlc',
|
|
43
68
|
stageGates: {
|
|
@@ -57,6 +82,8 @@ export const DEFAULT_CONFIG = {
|
|
|
57
82
|
maxRetriesUpperBound: 10,
|
|
58
83
|
autoCompleteOnApproval: true,
|
|
59
84
|
autoRestartOnRejection: true,
|
|
85
|
+
detectTestAntipatterns: true,
|
|
86
|
+
autoCreatePROnApproval: false, // Set to true in automated mode at runtime
|
|
60
87
|
},
|
|
61
88
|
implementation: { ...DEFAULT_IMPLEMENTATION_CONFIG },
|
|
62
89
|
defaultLabels: [],
|
|
@@ -64,14 +91,22 @@ export const DEFAULT_CONFIG = {
|
|
|
64
91
|
// Test and build commands - auto-detected from package.json if present
|
|
65
92
|
testCommand: 'npm test',
|
|
66
93
|
buildCommand: 'npm run build',
|
|
67
|
-
// Agent SDK settings sources -
|
|
68
|
-
settingSources: [],
|
|
94
|
+
// Agent SDK settings sources - enables Skills discovery from .claude/skills/
|
|
95
|
+
settingSources: ['project'],
|
|
69
96
|
// Timeout configuration
|
|
70
97
|
timeouts: { ...DEFAULT_TIMEOUTS },
|
|
98
|
+
// Retry configuration
|
|
99
|
+
retry: { ...DEFAULT_RETRY_CONFIG },
|
|
71
100
|
// Daemon configuration
|
|
72
101
|
daemon: { ...DEFAULT_DAEMON_CONFIG },
|
|
73
102
|
// TDD configuration
|
|
74
103
|
tdd: { ...DEFAULT_TDD_CONFIG },
|
|
104
|
+
// Worktree configuration
|
|
105
|
+
worktree: { ...DEFAULT_WORKTREE_CONFIG },
|
|
106
|
+
// Logging configuration
|
|
107
|
+
logging: { ...DEFAULT_LOGGING_CONFIG },
|
|
108
|
+
// Orchestrator configuration
|
|
109
|
+
useOrchestrator: false,
|
|
75
110
|
};
|
|
76
111
|
/**
|
|
77
112
|
* Get the SDLC root folder path
|
|
@@ -228,6 +263,29 @@ function sanitizeUserConfig(userConfig) {
|
|
|
228
263
|
}
|
|
229
264
|
}
|
|
230
265
|
}
|
|
266
|
+
// Validate worktree configuration if present
|
|
267
|
+
if (userConfig.worktree !== undefined) {
|
|
268
|
+
if (typeof userConfig.worktree !== 'object' || userConfig.worktree === null) {
|
|
269
|
+
console.warn('Invalid worktree in config (must be object), ignoring');
|
|
270
|
+
delete userConfig.worktree;
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
// Validate worktree.enabled (must be boolean)
|
|
274
|
+
if (userConfig.worktree.enabled !== undefined) {
|
|
275
|
+
if (typeof userConfig.worktree.enabled !== 'boolean') {
|
|
276
|
+
console.warn('Invalid worktree.enabled in config (must be boolean), using default');
|
|
277
|
+
delete userConfig.worktree.enabled;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
// Validate worktree.basePath (must be string)
|
|
281
|
+
if (userConfig.worktree.basePath !== undefined) {
|
|
282
|
+
if (typeof userConfig.worktree.basePath !== 'string') {
|
|
283
|
+
console.warn('Invalid worktree.basePath in config (must be string), using default');
|
|
284
|
+
delete userConfig.worktree.basePath;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
231
289
|
return userConfig;
|
|
232
290
|
}
|
|
233
291
|
/**
|
|
@@ -267,6 +325,10 @@ export function loadConfig(workingDir = process.cwd()) {
|
|
|
267
325
|
...DEFAULT_TIMEOUTS,
|
|
268
326
|
...userConfig.timeouts,
|
|
269
327
|
},
|
|
328
|
+
retry: {
|
|
329
|
+
...DEFAULT_RETRY_CONFIG,
|
|
330
|
+
...userConfig.retry,
|
|
331
|
+
},
|
|
270
332
|
daemon: {
|
|
271
333
|
...DEFAULT_DAEMON_CONFIG,
|
|
272
334
|
...userConfig.daemon,
|
|
@@ -275,6 +337,14 @@ export function loadConfig(workingDir = process.cwd()) {
|
|
|
275
337
|
...DEFAULT_TDD_CONFIG,
|
|
276
338
|
...userConfig.tdd,
|
|
277
339
|
},
|
|
340
|
+
worktree: {
|
|
341
|
+
...DEFAULT_WORKTREE_CONFIG,
|
|
342
|
+
...userConfig.worktree,
|
|
343
|
+
},
|
|
344
|
+
logging: {
|
|
345
|
+
...DEFAULT_LOGGING_CONFIG,
|
|
346
|
+
...userConfig.logging,
|
|
347
|
+
},
|
|
278
348
|
};
|
|
279
349
|
}
|
|
280
350
|
catch (error) {
|
|
@@ -333,10 +403,25 @@ export function loadConfig(workingDir = process.cwd()) {
|
|
|
333
403
|
console.warn(`Invalid AI_SDLC_AUTO_RESTART value "${value}" (must be "true" or "false"), ignoring`);
|
|
334
404
|
}
|
|
335
405
|
}
|
|
406
|
+
if (process.env.AI_SDLC_LOG_LEVEL) {
|
|
407
|
+
const value = process.env.AI_SDLC_LOG_LEVEL.toLowerCase();
|
|
408
|
+
const validLevels = ['debug', 'info', 'warn', 'error'];
|
|
409
|
+
if (validLevels.includes(value)) {
|
|
410
|
+
config.logging = config.logging || { ...DEFAULT_LOGGING_CONFIG };
|
|
411
|
+
config.logging.level = value;
|
|
412
|
+
}
|
|
413
|
+
else {
|
|
414
|
+
console.warn(`Invalid AI_SDLC_LOG_LEVEL value "${process.env.AI_SDLC_LOG_LEVEL}" (must be debug, info, warn, or error), ignoring`);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
336
417
|
// Validate review config
|
|
337
418
|
config.reviewConfig = validateReviewConfig(config.reviewConfig);
|
|
338
419
|
// Validate implementation config
|
|
339
420
|
config.implementation = validateImplementationConfig(config.implementation);
|
|
421
|
+
// Validate retry config
|
|
422
|
+
if (config.retry) {
|
|
423
|
+
config.retry = validateRetryConfig(config.retry);
|
|
424
|
+
}
|
|
340
425
|
return config;
|
|
341
426
|
}
|
|
342
427
|
/**
|
|
@@ -434,6 +519,33 @@ export function updateReviewConfig(reviewConfig, workingDir = process.cwd()) {
|
|
|
434
519
|
saveConfig(config, workingDir);
|
|
435
520
|
return config;
|
|
436
521
|
}
|
|
522
|
+
/**
|
|
523
|
+
* Validate retry configuration
|
|
524
|
+
*/
|
|
525
|
+
export function validateRetryConfig(retryConfig) {
|
|
526
|
+
const validated = { ...retryConfig };
|
|
527
|
+
// Validate maxRetries
|
|
528
|
+
if (typeof validated.maxRetries !== 'number' || validated.maxRetries < 0) {
|
|
529
|
+
console.warn('Warning: retry.maxRetries must be non-negative number, using 3');
|
|
530
|
+
validated.maxRetries = 3;
|
|
531
|
+
}
|
|
532
|
+
// Validate initialDelay
|
|
533
|
+
if (typeof validated.initialDelay !== 'number' || validated.initialDelay < 0) {
|
|
534
|
+
console.warn('Warning: retry.initialDelay must be non-negative number, using 2000');
|
|
535
|
+
validated.initialDelay = 2000;
|
|
536
|
+
}
|
|
537
|
+
// Validate maxDelay
|
|
538
|
+
if (typeof validated.maxDelay !== 'number' || validated.maxDelay < validated.initialDelay) {
|
|
539
|
+
console.warn('Warning: retry.maxDelay must be >= initialDelay, using 32000');
|
|
540
|
+
validated.maxDelay = 32000;
|
|
541
|
+
}
|
|
542
|
+
// Validate maxTotalDuration
|
|
543
|
+
if (typeof validated.maxTotalDuration !== 'number' || validated.maxTotalDuration < 0) {
|
|
544
|
+
console.warn('Warning: retry.maxTotalDuration must be non-negative number, using 60000');
|
|
545
|
+
validated.maxTotalDuration = 60000;
|
|
546
|
+
}
|
|
547
|
+
return validated;
|
|
548
|
+
}
|
|
437
549
|
/**
|
|
438
550
|
* Validate implementation configuration
|
|
439
551
|
*/
|
|
@@ -474,4 +586,35 @@ export function updateImplementationConfig(implementationConfig, workingDir = pr
|
|
|
474
586
|
saveConfig(config, workingDir);
|
|
475
587
|
return config;
|
|
476
588
|
}
|
|
589
|
+
/**
|
|
590
|
+
* Validate and resolve worktree basePath
|
|
591
|
+
* @param basePath - The configured base path (may be relative)
|
|
592
|
+
* @param projectRoot - The project root directory
|
|
593
|
+
* @returns The resolved absolute path
|
|
594
|
+
* @throws Error if the parent directory does not exist
|
|
595
|
+
*/
|
|
596
|
+
export function validateWorktreeBasePath(basePath, projectRoot) {
|
|
597
|
+
const resolvedPath = path.isAbsolute(basePath)
|
|
598
|
+
? basePath
|
|
599
|
+
: path.resolve(projectRoot, basePath);
|
|
600
|
+
// Check parent directory exists (worktree dir itself may not exist yet)
|
|
601
|
+
const parentDir = path.dirname(resolvedPath);
|
|
602
|
+
if (!fs.existsSync(parentDir)) {
|
|
603
|
+
throw new Error(`Worktree basePath parent directory does not exist: ${parentDir}`);
|
|
604
|
+
}
|
|
605
|
+
return resolvedPath;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Get resolved worktree configuration with validated paths
|
|
609
|
+
* @param config - The loaded configuration
|
|
610
|
+
* @param projectRoot - The project root directory
|
|
611
|
+
* @returns Resolved worktree config with absolute basePath
|
|
612
|
+
*/
|
|
613
|
+
export function getWorktreeConfig(config, projectRoot) {
|
|
614
|
+
const worktreeConfig = config.worktree ?? DEFAULT_WORKTREE_CONFIG;
|
|
615
|
+
return {
|
|
616
|
+
enabled: worktreeConfig.enabled,
|
|
617
|
+
basePath: validateWorktreeBasePath(worktreeConfig.basePath, projectRoot),
|
|
618
|
+
};
|
|
619
|
+
}
|
|
477
620
|
//# sourceMappingURL=config.js.map
|