ai-engineering-loop 1.11.0 → 1.12.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/.agents/skills/animate/RECIPES.md +324 -0
- package/.agents/skills/animate/SKILL.md +207 -0
- package/.agents/skills/animate-expo/RECIPES.md +385 -0
- package/.agents/skills/animate-expo/SKILL.md +263 -0
- package/.agents/skills/animation-vocabulary/SKILL.md +181 -0
- package/.agents/skills/apple-design/SKILL.md +290 -0
- package/.agents/skills/ask-sonner/API.md +64 -0
- package/.agents/skills/ask-sonner/SKILL.md +88 -0
- package/.agents/skills/backend-development/SKILL.md +272 -0
- package/.agents/skills/backend-development/references/api-design-guidelines.md +95 -0
- package/.agents/skills/backend-development/references/query-and-database-best-practices.md +53 -0
- package/.agents/skills/backend-development/references/security-checklist.md +60 -0
- package/.agents/skills/emil-design-eng/SKILL.md +674 -0
- package/.agents/skills/find-animation-opportunities/SKILL.md +140 -0
- package/.agents/skills/improve-animations/AUDIT.md +115 -0
- package/.agents/skills/improve-animations/PLAN-TEMPLATE.md +73 -0
- package/.agents/skills/improve-animations/SKILL.md +109 -0
- package/.agents/skills/mobile-native/SKILL.md +311 -0
- package/.agents/skills/pick-ui-library/SKILL.md +85 -0
- package/.agents/skills/prototype/PICKER.md +197 -0
- package/.agents/skills/prototype/SKILL.md +98 -0
- package/.agents/skills/review-animations/SKILL.md +120 -0
- package/.agents/skills/review-animations/STANDARDS.md +187 -0
- package/.agents/skills/write-swift/SKILL.md +396 -0
- package/.agents/workflows/ai-engineering-loop.md +4 -4
- package/.claude/skills/ai-engineering-loop/SKILL.md +4 -4
- package/.claude/skills/animate/RECIPES.md +324 -0
- package/.claude/skills/animate/SKILL.md +207 -0
- package/.claude/skills/animate-expo/RECIPES.md +385 -0
- package/.claude/skills/animate-expo/SKILL.md +263 -0
- package/.claude/skills/animation-vocabulary/SKILL.md +181 -0
- package/.claude/skills/apple-design/SKILL.md +290 -0
- package/.claude/skills/ask-sonner/API.md +64 -0
- package/.claude/skills/ask-sonner/SKILL.md +88 -0
- package/.claude/skills/backend-development/SKILL.md +272 -0
- package/.claude/skills/backend-development/references/api-design-guidelines.md +95 -0
- package/.claude/skills/backend-development/references/query-and-database-best-practices.md +53 -0
- package/.claude/skills/backend-development/references/security-checklist.md +60 -0
- package/.claude/skills/emil-design-eng/SKILL.md +674 -0
- package/.claude/skills/find-animation-opportunities/SKILL.md +140 -0
- package/.claude/skills/improve-animations/AUDIT.md +115 -0
- package/.claude/skills/improve-animations/PLAN-TEMPLATE.md +73 -0
- package/.claude/skills/improve-animations/SKILL.md +109 -0
- package/.claude/skills/mobile-native/SKILL.md +311 -0
- package/.claude/skills/pick-ui-library/SKILL.md +85 -0
- package/.claude/skills/prototype/PICKER.md +197 -0
- package/.claude/skills/prototype/SKILL.md +98 -0
- package/.claude/skills/review-animations/SKILL.md +120 -0
- package/.claude/skills/review-animations/STANDARDS.md +187 -0
- package/.claude/skills/write-swift/SKILL.md +396 -0
- package/.gemini/skills/ai-engineering-loop/SKILL.md +4 -4
- package/.gemini/skills/animate/RECIPES.md +324 -0
- package/.gemini/skills/animate/SKILL.md +207 -0
- package/.gemini/skills/animate-expo/RECIPES.md +385 -0
- package/.gemini/skills/animate-expo/SKILL.md +263 -0
- package/.gemini/skills/animation-vocabulary/SKILL.md +181 -0
- package/.gemini/skills/apple-design/SKILL.md +290 -0
- package/.gemini/skills/ask-sonner/API.md +64 -0
- package/.gemini/skills/ask-sonner/SKILL.md +88 -0
- package/.gemini/skills/backend-development/SKILL.md +272 -0
- package/.gemini/skills/backend-development/references/api-design-guidelines.md +95 -0
- package/.gemini/skills/backend-development/references/query-and-database-best-practices.md +53 -0
- package/.gemini/skills/backend-development/references/security-checklist.md +60 -0
- package/.gemini/skills/emil-design-eng/SKILL.md +674 -0
- package/.gemini/skills/find-animation-opportunities/SKILL.md +140 -0
- package/.gemini/skills/improve-animations/AUDIT.md +115 -0
- package/.gemini/skills/improve-animations/PLAN-TEMPLATE.md +73 -0
- package/.gemini/skills/improve-animations/SKILL.md +109 -0
- package/.gemini/skills/mobile-native/SKILL.md +311 -0
- package/.gemini/skills/pick-ui-library/SKILL.md +85 -0
- package/.gemini/skills/prototype/PICKER.md +197 -0
- package/.gemini/skills/prototype/SKILL.md +98 -0
- package/.gemini/skills/review-animations/SKILL.md +120 -0
- package/.gemini/skills/review-animations/STANDARDS.md +187 -0
- package/.gemini/skills/write-swift/SKILL.md +396 -0
- package/.grok/skills/ai-engineering-loop/SKILL.md +4 -4
- package/.grok/skills/animate/RECIPES.md +324 -0
- package/.grok/skills/animate/SKILL.md +207 -0
- package/.grok/skills/animate-expo/RECIPES.md +385 -0
- package/.grok/skills/animate-expo/SKILL.md +263 -0
- package/.grok/skills/animation-vocabulary/SKILL.md +181 -0
- package/.grok/skills/apple-design/SKILL.md +290 -0
- package/.grok/skills/ask-sonner/API.md +64 -0
- package/.grok/skills/ask-sonner/SKILL.md +88 -0
- package/.grok/skills/backend-development/SKILL.md +272 -0
- package/.grok/skills/backend-development/references/api-design-guidelines.md +95 -0
- package/.grok/skills/backend-development/references/query-and-database-best-practices.md +53 -0
- package/.grok/skills/backend-development/references/security-checklist.md +60 -0
- package/.grok/skills/emil-design-eng/SKILL.md +674 -0
- package/.grok/skills/find-animation-opportunities/SKILL.md +140 -0
- package/.grok/skills/improve-animations/AUDIT.md +115 -0
- package/.grok/skills/improve-animations/PLAN-TEMPLATE.md +73 -0
- package/.grok/skills/improve-animations/SKILL.md +109 -0
- package/.grok/skills/mobile-native/SKILL.md +311 -0
- package/.grok/skills/pick-ui-library/SKILL.md +85 -0
- package/.grok/skills/prototype/PICKER.md +197 -0
- package/.grok/skills/prototype/SKILL.md +98 -0
- package/.grok/skills/review-animations/SKILL.md +120 -0
- package/.grok/skills/review-animations/STANDARDS.md +187 -0
- package/.grok/skills/write-swift/SKILL.md +396 -0
- package/README.md +11 -1
- package/README.npm.md +5 -0
- package/THIRD_PARTY_NOTICES.md +10 -0
- package/agents/third-party/emilkowalski-skills/LICENSE +21 -0
- package/bin/ai-engineering-loop.js +129 -3
- package/core/runtime-safety.md +18 -1
- package/lib/doctor.js +16 -0
- package/lib/run-compaction.js +170 -0
- package/lib/smart-context.js +267 -8
- package/lib/studio-server.js +19 -2
- package/lib/sync-hosts.js +69 -0
- package/lib/update-manager.js +147 -0
- package/package.json +2 -1
- package/studio/app.js +5 -2
package/lib/smart-context.js
CHANGED
|
@@ -22,6 +22,44 @@ const DIFF_PACK_LIMITS = Object.freeze({
|
|
|
22
22
|
thorough: Object.freeze({ maxFiles: 60, maxHunksPerFile: 20, maxHunkBytes: 12_000, maxTotalBytes: 128_000 })
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
+
const REVIEW_BUDGETS = Object.freeze({
|
|
26
|
+
lean: Object.freeze({ devilAdvocateToolCalls: 8, devilAdvocateMaxFindings: 5, judgeToolCalls: 4, judgeMayReadFullDiff: false }),
|
|
27
|
+
standard: Object.freeze({ devilAdvocateToolCalls: 10, devilAdvocateMaxFindings: 8, judgeToolCalls: 4, judgeMayReadFullDiff: false }),
|
|
28
|
+
thorough: Object.freeze({ devilAdvocateToolCalls: 14, devilAdvocateMaxFindings: 12, judgeToolCalls: 6, judgeMayReadFullDiff: true })
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const SMALL_TASK_LIMITS = Object.freeze({
|
|
32
|
+
maxFiles: 3,
|
|
33
|
+
maxChangedLines: 180
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const SMALL_TASK_HIGH_RISK_PATTERNS = Object.freeze([
|
|
37
|
+
/(^|\/)(auth|authorization|permissions?|access-control)(\/|[._-])/i,
|
|
38
|
+
/(^|\/)(payments?|billing|invoices?|ledger)(\/|[._-])/i,
|
|
39
|
+
/(^|\/)(migrations?|schema)(\/|[._-])/i,
|
|
40
|
+
/(^|\/)(infra|terraform|k8s|kubernetes|deploy)(\/|[._-])/i,
|
|
41
|
+
/(^|\/)(crypto|encryption|secrets?)(\/|[._-])/i,
|
|
42
|
+
/(^|\/)(package-lock|pnpm-lock|yarn\.lock)$/i
|
|
43
|
+
]);
|
|
44
|
+
|
|
45
|
+
const DEFAULT_CONTEXT_IGNORE_PATTERNS = Object.freeze([
|
|
46
|
+
'*.css',
|
|
47
|
+
'*.map',
|
|
48
|
+
'*.min.js',
|
|
49
|
+
'package-lock.json',
|
|
50
|
+
'pnpm-lock.yaml',
|
|
51
|
+
'yarn.lock',
|
|
52
|
+
'bun.lockb',
|
|
53
|
+
'dist/',
|
|
54
|
+
'build/',
|
|
55
|
+
'coverage/',
|
|
56
|
+
'node_modules/',
|
|
57
|
+
'studio/styles.css',
|
|
58
|
+
'studio/assets/',
|
|
59
|
+
'docs/images/',
|
|
60
|
+
'.ai-engineering-loop/'
|
|
61
|
+
]);
|
|
62
|
+
|
|
25
63
|
function smartContextError(message, code = 'SMART_CONTEXT_ERROR') {
|
|
26
64
|
const err = new Error(message);
|
|
27
65
|
err.code = code;
|
|
@@ -48,12 +86,63 @@ function git(rootDir, args) {
|
|
|
48
86
|
});
|
|
49
87
|
}
|
|
50
88
|
|
|
51
|
-
function
|
|
89
|
+
function normalizeRepoPath(relativePath) {
|
|
90
|
+
return String(relativePath || '').replace(/\\/g, '/').replace(/^\.\/+/, '');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function escapeRegExp(value) {
|
|
94
|
+
return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function globToRegExp(pattern) {
|
|
98
|
+
const parts = String(pattern).split('*').map(escapeRegExp);
|
|
99
|
+
return new RegExp(`^${parts.join('.*')}$`);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function readContextIgnorePatterns(rootDir) {
|
|
103
|
+
const ignorePath = path.join(rootDir, '.aelcontextignore');
|
|
104
|
+
if (!fs.existsSync(ignorePath)) return [];
|
|
105
|
+
return fs.readFileSync(ignorePath, 'utf8')
|
|
106
|
+
.split('\n')
|
|
107
|
+
.map((line) => line.trim())
|
|
108
|
+
.filter((line) => line && !line.startsWith('#'));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function matchesContextIgnorePattern(relativePath, pattern) {
|
|
112
|
+
const candidate = normalizeRepoPath(relativePath);
|
|
113
|
+
const normalizedPattern = normalizeRepoPath(pattern);
|
|
114
|
+
if (!normalizedPattern) return false;
|
|
115
|
+
if (normalizedPattern.endsWith('/')) {
|
|
116
|
+
return candidate === normalizedPattern.slice(0, -1) || candidate.startsWith(normalizedPattern);
|
|
117
|
+
}
|
|
118
|
+
if (!normalizedPattern.includes('/')) {
|
|
119
|
+
const basename = path.posix.basename(candidate);
|
|
120
|
+
return normalizedPattern.includes('*')
|
|
121
|
+
? globToRegExp(normalizedPattern).test(basename)
|
|
122
|
+
: basename === normalizedPattern;
|
|
123
|
+
}
|
|
124
|
+
return normalizedPattern.includes('*')
|
|
125
|
+
? globToRegExp(normalizedPattern).test(candidate)
|
|
126
|
+
: candidate === normalizedPattern;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function contextIgnorePatterns(rootDir) {
|
|
130
|
+
return [...DEFAULT_CONTEXT_IGNORE_PATTERNS, ...readContextIgnorePatterns(rootDir)];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function isReviewContextIgnored(rootDir, relativePath, { includeIgnored = false } = {}) {
|
|
134
|
+
if (includeIgnored) return false;
|
|
135
|
+
const candidate = normalizeRepoPath(relativePath);
|
|
136
|
+
return contextIgnorePatterns(rootDir).some((pattern) => matchesContextIgnorePattern(candidate, pattern));
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function listTrackedFiles(rootDir, { includeIgnored = false } = {}) {
|
|
52
140
|
return git(rootDir, ['ls-files'])
|
|
53
141
|
.split('\n')
|
|
54
142
|
.map((line) => line.trim())
|
|
55
143
|
.filter(Boolean)
|
|
56
|
-
.filter((relativePath) => !isSensitivePath(relativePath))
|
|
144
|
+
.filter((relativePath) => !isSensitivePath(relativePath))
|
|
145
|
+
.filter((relativePath) => !isReviewContextIgnored(rootDir, relativePath, { includeIgnored }));
|
|
57
146
|
}
|
|
58
147
|
|
|
59
148
|
function languageFor(relativePath) {
|
|
@@ -143,11 +232,13 @@ function writeCachedSummary(rootDir, summary) {
|
|
|
143
232
|
});
|
|
144
233
|
}
|
|
145
234
|
|
|
146
|
-
function buildContextIndex(rootDir, { files } = {}) {
|
|
235
|
+
function buildContextIndex(rootDir, { files, includeIgnored = false } = {}) {
|
|
147
236
|
ensurePrivateRuntimeIgnores(rootDir);
|
|
148
|
-
const
|
|
237
|
+
const hasExplicitFiles = files && files.length;
|
|
238
|
+
const candidates = (hasExplicitFiles ? files : listTrackedFiles(rootDir, { includeIgnored }))
|
|
149
239
|
.map((file) => String(file).trim())
|
|
150
|
-
.filter(Boolean)
|
|
240
|
+
.filter(Boolean)
|
|
241
|
+
.filter((file) => hasExplicitFiles || !isReviewContextIgnored(rootDir, file, { includeIgnored }));
|
|
151
242
|
const summaries = [];
|
|
152
243
|
const cache = { hits: 0, misses: 0 };
|
|
153
244
|
for (const candidate of [...new Set(candidates)]) {
|
|
@@ -176,6 +267,100 @@ function buildContextIndex(rootDir, { files } = {}) {
|
|
|
176
267
|
};
|
|
177
268
|
}
|
|
178
269
|
|
|
270
|
+
function readOrBuildContextIndex(rootDir) {
|
|
271
|
+
const indexPath = path.join(contextRoot(rootDir), 'index.json');
|
|
272
|
+
if (fs.existsSync(indexPath)) {
|
|
273
|
+
try {
|
|
274
|
+
const index = JSON.parse(fs.readFileSync(indexPath, 'utf8'));
|
|
275
|
+
if (index?.schemaVersion === 1 && Array.isArray(index.files)) {
|
|
276
|
+
return {
|
|
277
|
+
index,
|
|
278
|
+
path: path.relative(rootDir, indexPath).split(path.sep).join('/'),
|
|
279
|
+
cacheStatus: 'existing'
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
} catch {
|
|
283
|
+
// Optional cache corruption should not make metadata-only context queries fail.
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return { ...buildContextIndex(rootDir), cacheStatus: 'rebuilt' };
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function queryContextIndex(rootDir, { query, limit = 10 } = {}) {
|
|
290
|
+
const needle = String(query || '').trim().toLowerCase();
|
|
291
|
+
if (!needle) throw smartContextError('Context query requires a non-empty search term', 'EMPTY_CONTEXT_QUERY');
|
|
292
|
+
const result = readOrBuildContextIndex(rootDir);
|
|
293
|
+
const matches = result.index.files
|
|
294
|
+
.map((file) => {
|
|
295
|
+
const pathScore = file.path.toLowerCase().includes(needle) ? 2 : 0;
|
|
296
|
+
const matchedSymbols = (file.symbols || []).filter((symbol) => String(symbol).toLowerCase().includes(needle));
|
|
297
|
+
const symbolScore = matchedSymbols.length ? 3 : 0;
|
|
298
|
+
return {
|
|
299
|
+
path: file.path,
|
|
300
|
+
language: file.language,
|
|
301
|
+
lines: file.lines,
|
|
302
|
+
sourceBytes: file.sourceBytes,
|
|
303
|
+
symbols: matchedSymbols.slice(0, 8),
|
|
304
|
+
score: pathScore + symbolScore
|
|
305
|
+
};
|
|
306
|
+
})
|
|
307
|
+
.filter((match) => match.score > 0)
|
|
308
|
+
.sort((left, right) => right.score - left.score || left.path.localeCompare(right.path))
|
|
309
|
+
.slice(0, Number(limit) || 10)
|
|
310
|
+
.map(({ score: _score, ...match }) => match);
|
|
311
|
+
return {
|
|
312
|
+
schemaVersion: 1,
|
|
313
|
+
query: needle,
|
|
314
|
+
indexPath: result.path,
|
|
315
|
+
cacheStatus: result.cacheStatus,
|
|
316
|
+
matches
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function pathTokens(relativePath) {
|
|
321
|
+
return new Set(String(relativePath || '')
|
|
322
|
+
.toLowerCase()
|
|
323
|
+
.split(/[^a-z0-9]+/)
|
|
324
|
+
.filter((token) => token.length >= 3));
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function relatedContextIndex(rootDir, { file, limit = 10 } = {}) {
|
|
328
|
+
const target = String(file || '').trim();
|
|
329
|
+
if (!target) throw smartContextError('Related context requires a repository-relative file path', 'EMPTY_RELATED_FILE');
|
|
330
|
+
const result = readOrBuildContextIndex(rootDir);
|
|
331
|
+
const source = result.index.files.find((entry) => entry.path === target);
|
|
332
|
+
if (!source) throw smartContextError(`File is not present in the context index: ${target}`, 'FILE_NOT_INDEXED');
|
|
333
|
+
const sourceTokens = pathTokens(source.path);
|
|
334
|
+
const sourceSymbols = new Set((source.symbols || []).map((symbol) => String(symbol).toLowerCase()));
|
|
335
|
+
const matches = result.index.files
|
|
336
|
+
.filter((entry) => entry.path !== source.path)
|
|
337
|
+
.map((entry) => {
|
|
338
|
+
const tokens = pathTokens(entry.path);
|
|
339
|
+
const tokenOverlap = [...tokens].filter((token) => sourceTokens.has(token)).length;
|
|
340
|
+
const symbolOverlap = (entry.symbols || []).filter((symbol) => sourceSymbols.has(String(symbol).toLowerCase())).length;
|
|
341
|
+
const sameLanguage = entry.language === source.language ? 1 : 0;
|
|
342
|
+
return {
|
|
343
|
+
path: entry.path,
|
|
344
|
+
language: entry.language,
|
|
345
|
+
lines: entry.lines,
|
|
346
|
+
sourceBytes: entry.sourceBytes,
|
|
347
|
+
symbols: (entry.symbols || []).slice(0, 8),
|
|
348
|
+
score: tokenOverlap * 3 + symbolOverlap * 2 + sameLanguage
|
|
349
|
+
};
|
|
350
|
+
})
|
|
351
|
+
.filter((match) => match.score > 0)
|
|
352
|
+
.sort((left, right) => right.score - left.score || left.path.localeCompare(right.path))
|
|
353
|
+
.slice(0, Number(limit) || 10)
|
|
354
|
+
.map(({ score: _score, ...match }) => match);
|
|
355
|
+
return {
|
|
356
|
+
schemaVersion: 1,
|
|
357
|
+
file: source.path,
|
|
358
|
+
indexPath: result.path,
|
|
359
|
+
cacheStatus: result.cacheStatus,
|
|
360
|
+
matches
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
|
|
179
364
|
function parseDiff(diff) {
|
|
180
365
|
const files = [];
|
|
181
366
|
let currentFile = null;
|
|
@@ -288,14 +473,19 @@ function boundedHunks(file, limits, remainingBytes) {
|
|
|
288
473
|
return { hunks, includedBytes, truncated };
|
|
289
474
|
}
|
|
290
475
|
|
|
291
|
-
function createDiffHunkPack(rootDir, { runId, base = 'HEAD', profile } = {}) {
|
|
476
|
+
function createDiffHunkPack(rootDir, { runId, base = 'HEAD', profile, includeIgnored = false } = {}) {
|
|
292
477
|
const run = resolveRun(rootDir, runId);
|
|
293
478
|
const policy = loadPolicy(rootDir);
|
|
294
479
|
const reviewProfile = normalizeReviewProfile(profile || policy.reviewProfile);
|
|
295
480
|
const limits = DIFF_PACK_LIMITS[reviewProfile];
|
|
296
481
|
const contextLimits = CONTEXT_PROFILE_LIMITS[reviewProfile]['devil-advocate'];
|
|
297
482
|
const diff = git(rootDir, ['diff', '--no-ext-diff', '--unified=3', base, '--']);
|
|
298
|
-
const
|
|
483
|
+
const parsedDiffFiles = parseDiff(diff).filter((file) => !isSensitivePath(file.path));
|
|
484
|
+
const ignoredPaths = parsedDiffFiles
|
|
485
|
+
.filter((file) => isReviewContextIgnored(rootDir, file.path, { includeIgnored }))
|
|
486
|
+
.map((file) => file.path);
|
|
487
|
+
const allParsedFiles = parsedDiffFiles
|
|
488
|
+
.filter((file) => !isReviewContextIgnored(rootDir, file.path, { includeIgnored }));
|
|
299
489
|
const parsedFiles = allParsedFiles.slice(0, limits.maxFiles);
|
|
300
490
|
const totalFilesTruncated = allParsedFiles.length > parsedFiles.length;
|
|
301
491
|
const unresolved = unresolvedFindings(rootDir, run.runId);
|
|
@@ -333,6 +523,7 @@ function createDiffHunkPack(rootDir, { runId, base = 'HEAD', profile } = {}) {
|
|
|
333
523
|
createdAt: new Date().toISOString(),
|
|
334
524
|
mode: 'diff-hunks',
|
|
335
525
|
limits,
|
|
526
|
+
reviewBudget: REVIEW_BUDGETS[reviewProfile],
|
|
336
527
|
totalBytes,
|
|
337
528
|
estimatedTokens,
|
|
338
529
|
truncated: totalFilesTruncated || files.some((file) => file.truncated),
|
|
@@ -340,6 +531,7 @@ function createDiffHunkPack(rootDir, { runId, base = 'HEAD', profile } = {}) {
|
|
|
340
531
|
previousDiffHash: run.artifacts?.diff?.sha256 || null,
|
|
341
532
|
currentDiffHash: sha256(diff),
|
|
342
533
|
changedPaths,
|
|
534
|
+
ignoredPaths,
|
|
343
535
|
unresolvedFindingIds: unresolved.map((finding) => finding.id),
|
|
344
536
|
focusPaths
|
|
345
537
|
},
|
|
@@ -354,6 +546,64 @@ function createDiffHunkPack(rootDir, { runId, base = 'HEAD', profile } = {}) {
|
|
|
354
546
|
};
|
|
355
547
|
}
|
|
356
548
|
|
|
549
|
+
function changedLineCount(diff) {
|
|
550
|
+
let count = 0;
|
|
551
|
+
for (const line of String(diff || '').split('\n')) {
|
|
552
|
+
if ((line.startsWith('+') && !line.startsWith('+++')) || (line.startsWith('-') && !line.startsWith('---'))) count += 1;
|
|
553
|
+
}
|
|
554
|
+
return count;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
function assessSmallTaskFastPath(rootDir, { base = 'HEAD', includeIgnored = false } = {}) {
|
|
558
|
+
const diff = git(rootDir, ['diff', '--no-ext-diff', '--unified=0', base, '--']);
|
|
559
|
+
const parsedFiles = parseDiff(diff).filter((file) => !isSensitivePath(file.path));
|
|
560
|
+
const ignoredDiffPaths = parsedFiles
|
|
561
|
+
.filter((file) => isReviewContextIgnored(rootDir, file.path, { includeIgnored }))
|
|
562
|
+
.map((file) => file.path);
|
|
563
|
+
const files = parsedFiles
|
|
564
|
+
.filter((file) => !isReviewContextIgnored(rootDir, file.path, { includeIgnored }));
|
|
565
|
+
const allUntrackedPaths = git(rootDir, ['ls-files', '--others', '--exclude-standard'])
|
|
566
|
+
.split('\n')
|
|
567
|
+
.map((line) => line.trim())
|
|
568
|
+
.filter(Boolean)
|
|
569
|
+
.filter((filePath) => !filePath.startsWith('.ai-engineering-loop/'))
|
|
570
|
+
.filter((filePath) => !isSensitivePath(filePath));
|
|
571
|
+
const ignoredUntrackedPaths = allUntrackedPaths
|
|
572
|
+
.filter((filePath) => isReviewContextIgnored(rootDir, filePath, { includeIgnored }));
|
|
573
|
+
const untrackedPaths = allUntrackedPaths
|
|
574
|
+
.filter((filePath) => !isReviewContextIgnored(rootDir, filePath, { includeIgnored }));
|
|
575
|
+
const changedPaths = [...new Set([...files.map((file) => file.path), ...untrackedPaths])];
|
|
576
|
+
const ignoredPaths = [...new Set([...ignoredDiffPaths, ...ignoredUntrackedPaths])];
|
|
577
|
+
const untrackedLines = untrackedPaths.reduce((sum, filePath) => {
|
|
578
|
+
try {
|
|
579
|
+
const file = resolveSafeRepoFile(rootDir, filePath);
|
|
580
|
+
const raw = fs.readFileSync(file.absolute);
|
|
581
|
+
if (raw.includes(0)) return sum + SMALL_TASK_LIMITS.maxChangedLines + 1;
|
|
582
|
+
return sum + raw.toString('utf8').split('\n').length;
|
|
583
|
+
} catch {
|
|
584
|
+
return sum;
|
|
585
|
+
}
|
|
586
|
+
}, 0);
|
|
587
|
+
const changedLines = changedLineCount(diff) + untrackedLines;
|
|
588
|
+
const riskyPaths = changedPaths.filter((filePath) => SMALL_TASK_HIGH_RISK_PATTERNS.some((pattern) => pattern.test(filePath)));
|
|
589
|
+
const reasons = [];
|
|
590
|
+
if (changedPaths.length === 0) reasons.push('NO_DIFF');
|
|
591
|
+
if (changedPaths.length > SMALL_TASK_LIMITS.maxFiles) reasons.push('TOO_MANY_FILES');
|
|
592
|
+
if (changedLines > SMALL_TASK_LIMITS.maxChangedLines) reasons.push('TOO_MANY_CHANGED_LINES');
|
|
593
|
+
if (riskyPaths.length) reasons.push('HIGH_RISK_PATH');
|
|
594
|
+
return {
|
|
595
|
+
schemaVersion: 1,
|
|
596
|
+
eligible: reasons.length === 0,
|
|
597
|
+
recommendedProfile: reasons.length === 0 ? 'lean' : 'standard',
|
|
598
|
+
limits: SMALL_TASK_LIMITS,
|
|
599
|
+
changedPaths,
|
|
600
|
+
ignoredPaths,
|
|
601
|
+
changedLines,
|
|
602
|
+
riskyPaths,
|
|
603
|
+
reasons
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
|
|
357
607
|
function smartContextSummary(result) {
|
|
358
608
|
if (result.pack) {
|
|
359
609
|
return {
|
|
@@ -365,7 +615,9 @@ function smartContextSummary(result) {
|
|
|
365
615
|
totalBytes: result.pack.totalBytes,
|
|
366
616
|
estimatedTokens: result.pack.estimatedTokens,
|
|
367
617
|
truncated: result.pack.truncated,
|
|
368
|
-
unresolvedFindings: result.pack.unresolvedFindings.length
|
|
618
|
+
unresolvedFindings: result.pack.unresolvedFindings.length,
|
|
619
|
+
ignoredPaths: result.pack.reviewDelta?.ignoredPaths?.length || 0,
|
|
620
|
+
reviewBudget: result.pack.reviewBudget
|
|
369
621
|
};
|
|
370
622
|
}
|
|
371
623
|
return {
|
|
@@ -377,8 +629,15 @@ function smartContextSummary(result) {
|
|
|
377
629
|
|
|
378
630
|
module.exports = {
|
|
379
631
|
DIFF_PACK_LIMITS,
|
|
632
|
+
DEFAULT_CONTEXT_IGNORE_PATTERNS,
|
|
633
|
+
REVIEW_BUDGETS,
|
|
634
|
+
SMALL_TASK_LIMITS,
|
|
635
|
+
assessSmallTaskFastPath,
|
|
380
636
|
buildContextIndex,
|
|
381
637
|
createDiffHunkPack,
|
|
638
|
+
isReviewContextIgnored,
|
|
639
|
+
queryContextIndex,
|
|
640
|
+
relatedContextIndex,
|
|
382
641
|
parseDiff,
|
|
383
642
|
smartContextSummary
|
|
384
643
|
};
|
package/lib/studio-server.js
CHANGED
|
@@ -54,6 +54,7 @@ const {
|
|
|
54
54
|
|
|
55
55
|
const MAX_BODY = 256 * 1024;
|
|
56
56
|
const ASSET_DIR = path.join(__dirname, '..', 'studio');
|
|
57
|
+
const LIVE_WORKFLOW_EVENT_LIMIT = 12;
|
|
57
58
|
|
|
58
59
|
function json(response, status, value) {
|
|
59
60
|
response.writeHead(status, { 'content-type': 'application/json; charset=utf-8', 'cache-control': 'no-store' });
|
|
@@ -108,11 +109,27 @@ function liveSnapshot(rootDir) {
|
|
|
108
109
|
const run = getCurrentRun(rootDir);
|
|
109
110
|
if (!run?.workflow) return null;
|
|
110
111
|
const workflow = workflowStatus(rootDir, { runId: run.runId });
|
|
112
|
+
const eventTail = workflow.events.slice(-LIVE_WORKFLOW_EVENT_LIMIT);
|
|
113
|
+
const edges = edgesFromPlan(workflow.plan, workflow.state);
|
|
111
114
|
return redactedValue({
|
|
112
115
|
run,
|
|
116
|
+
summary: {
|
|
117
|
+
runId: run.runId,
|
|
118
|
+
state: run.state,
|
|
119
|
+
nodeCount: workflow.plan.nodes.length,
|
|
120
|
+
edgeCount: edges.length,
|
|
121
|
+
workflowEventCount: workflow.events.length,
|
|
122
|
+
workflowEventLimit: LIVE_WORKFLOW_EVENT_LIMIT,
|
|
123
|
+
eventsTruncated: workflow.events.length > eventTail.length,
|
|
124
|
+
details: {
|
|
125
|
+
nodeIo: `/api/runs/${encodeURIComponent(run.runId)}/nodes/{nodeId}`,
|
|
126
|
+
artifacts: `/api/runs/${encodeURIComponent(run.runId)}/artifacts?path={path}`,
|
|
127
|
+
lifecycle: `/api/runs/${encodeURIComponent(run.runId)}/lifecycle?after={sequence}`
|
|
128
|
+
}
|
|
129
|
+
},
|
|
113
130
|
plan: workflow.plan,
|
|
114
131
|
nodes: workflow.state.nodes,
|
|
115
|
-
edges
|
|
132
|
+
edges,
|
|
116
133
|
loopGroups: workflow.state.loopGroups,
|
|
117
134
|
journey: (() => {
|
|
118
135
|
try {
|
|
@@ -128,7 +145,7 @@ function liveSnapshot(rootDir) {
|
|
|
128
145
|
}
|
|
129
146
|
})(),
|
|
130
147
|
budget: budgetStatus(rootDir, { runId: run.runId }),
|
|
131
|
-
events:
|
|
148
|
+
events: eventTail.map(({ initialNodes, changes, ...event }) => ({
|
|
132
149
|
...event,
|
|
133
150
|
changedNodes: (changes || []).map((change) => change.nodeId)
|
|
134
151
|
}))
|
package/lib/sync-hosts.js
CHANGED
|
@@ -23,6 +23,65 @@ function applyGrokSkillOverlay(content) {
|
|
|
23
23
|
return `---\n${nextYaml}\n---\n${normalized.slice(match[0].length)}`;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
const BACKEND_SKILL_FILES = [
|
|
27
|
+
'SKILL.md',
|
|
28
|
+
'references/api-design-guidelines.md',
|
|
29
|
+
'references/query-and-database-best-practices.md',
|
|
30
|
+
'references/security-checklist.md'
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const EMIL_KOWALSKI_SKILLS = Object.freeze([
|
|
34
|
+
'animate',
|
|
35
|
+
'animate-expo',
|
|
36
|
+
'animation-vocabulary',
|
|
37
|
+
'apple-design',
|
|
38
|
+
'ask-sonner',
|
|
39
|
+
'emil-design-eng',
|
|
40
|
+
'find-animation-opportunities',
|
|
41
|
+
'improve-animations',
|
|
42
|
+
'mobile-native',
|
|
43
|
+
'pick-ui-library',
|
|
44
|
+
'prototype',
|
|
45
|
+
'review-animations',
|
|
46
|
+
'write-swift'
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
const EMIL_KOWALSKI_SKILL_FILES = Object.freeze({
|
|
50
|
+
animate: ['SKILL.md', 'RECIPES.md'],
|
|
51
|
+
'animate-expo': ['SKILL.md', 'RECIPES.md'],
|
|
52
|
+
'animation-vocabulary': ['SKILL.md'],
|
|
53
|
+
'apple-design': ['SKILL.md'],
|
|
54
|
+
'ask-sonner': ['SKILL.md', 'API.md'],
|
|
55
|
+
'emil-design-eng': ['SKILL.md'],
|
|
56
|
+
'find-animation-opportunities': ['SKILL.md'],
|
|
57
|
+
'improve-animations': ['SKILL.md', 'AUDIT.md', 'PLAN-TEMPLATE.md'],
|
|
58
|
+
'mobile-native': ['SKILL.md'],
|
|
59
|
+
'pick-ui-library': ['SKILL.md'],
|
|
60
|
+
prototype: ['SKILL.md', 'PICKER.md'],
|
|
61
|
+
'review-animations': ['SKILL.md', 'STANDARDS.md'],
|
|
62
|
+
'write-swift': ['SKILL.md']
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
function backendSkillFiles(srcRoot, destRoot, { grokSkillOverlay = false } = {}) {
|
|
66
|
+
return BACKEND_SKILL_FILES.map((file) => ({
|
|
67
|
+
src: path.posix.join(srcRoot, file),
|
|
68
|
+
dest: path.join(destRoot, file),
|
|
69
|
+
mode: 'upsert',
|
|
70
|
+
...(grokSkillOverlay && file === 'SKILL.md' ? { grokSkillOverlay: true } : {})
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function emilKowalskiSkillFiles(srcRoot, destRoot, { grokSkillOverlay = false } = {}) {
|
|
75
|
+
return EMIL_KOWALSKI_SKILLS.flatMap((skill) => (
|
|
76
|
+
EMIL_KOWALSKI_SKILL_FILES[skill].map((file) => ({
|
|
77
|
+
src: path.posix.join(srcRoot, skill, file),
|
|
78
|
+
dest: path.join(destRoot, skill, file),
|
|
79
|
+
mode: 'upsert',
|
|
80
|
+
...(grokSkillOverlay && file === 'SKILL.md' ? { grokSkillOverlay: true } : {})
|
|
81
|
+
}))
|
|
82
|
+
));
|
|
83
|
+
}
|
|
84
|
+
|
|
26
85
|
function hostFileMap(home) {
|
|
27
86
|
const claude = path.join(home, '.claude');
|
|
28
87
|
const grok = path.join(home, '.grok');
|
|
@@ -34,6 +93,8 @@ function hostFileMap(home) {
|
|
|
34
93
|
root: claude,
|
|
35
94
|
files: [
|
|
36
95
|
{ src: '.claude/skills/ai-engineering-loop/SKILL.md', dest: path.join(claude, 'skills/ai-engineering-loop/SKILL.md'), mode: 'upsert' },
|
|
96
|
+
...backendSkillFiles('.claude/skills/backend-development', path.join(claude, 'skills/backend-development')),
|
|
97
|
+
...emilKowalskiSkillFiles('.claude/skills', path.join(claude, 'skills')),
|
|
37
98
|
{ src: 'adapters/dot/skills/task-impact-inquiry/SKILL.md', dest: path.join(claude, 'skills/task-impact-inquiry/SKILL.md'), mode: 'upsert' },
|
|
38
99
|
{ src: 'adapters/generate-adapter/SKILL.md', dest: path.join(claude, 'skills/generate-adapter/SKILL.md'), mode: 'upsert' },
|
|
39
100
|
{ src: 'adapters/generate-workflow/SKILL.md', dest: path.join(claude, 'skills/generate-workflow/SKILL.md'), mode: 'upsert' },
|
|
@@ -47,6 +108,8 @@ function hostFileMap(home) {
|
|
|
47
108
|
root: grok,
|
|
48
109
|
files: [
|
|
49
110
|
{ src: '.grok/skills/ai-engineering-loop/SKILL.md', dest: path.join(grok, 'skills/ai-engineering-loop/SKILL.md'), mode: 'upsert', grokSkillOverlay: true },
|
|
111
|
+
...backendSkillFiles('.grok/skills/backend-development', path.join(grok, 'skills/backend-development'), { grokSkillOverlay: true }),
|
|
112
|
+
...emilKowalskiSkillFiles('.grok/skills', path.join(grok, 'skills'), { grokSkillOverlay: true }),
|
|
50
113
|
{ src: 'adapters/dot/skills/task-impact-inquiry/SKILL.md', dest: path.join(grok, 'skills/task-impact-inquiry/SKILL.md'), mode: 'upsert', grokSkillOverlay: true },
|
|
51
114
|
{ src: 'adapters/generate-adapter/SKILL.md', dest: path.join(grok, 'skills/generate-adapter/SKILL.md'), mode: 'upsert', grokSkillOverlay: true },
|
|
52
115
|
{ src: 'adapters/generate-workflow/SKILL.md', dest: path.join(grok, 'skills/generate-workflow/SKILL.md'), mode: 'upsert', grokSkillOverlay: true },
|
|
@@ -60,6 +123,8 @@ function hostFileMap(home) {
|
|
|
60
123
|
root: gemini,
|
|
61
124
|
files: [
|
|
62
125
|
{ src: '.gemini/skills/ai-engineering-loop/SKILL.md', dest: path.join(gemini, 'config/skills/ai-engineering-loop/SKILL.md'), mode: 'upsert' },
|
|
126
|
+
...backendSkillFiles('.gemini/skills/backend-development', path.join(gemini, 'config/skills/backend-development')),
|
|
127
|
+
...emilKowalskiSkillFiles('.gemini/skills', path.join(gemini, 'config/skills')),
|
|
63
128
|
{ src: 'adapters/dot/skills/task-impact-inquiry/SKILL.md', dest: path.join(gemini, 'config/skills/task-impact-inquiry/SKILL.md'), mode: 'upsert' },
|
|
64
129
|
{ src: 'adapters/generate-adapter/SKILL.md', dest: path.join(gemini, 'config/skills/generate-adapter/SKILL.md'), mode: 'upsert' },
|
|
65
130
|
{ src: 'adapters/generate-workflow/SKILL.md', dest: path.join(gemini, 'config/skills/generate-workflow/SKILL.md'), mode: 'upsert' }
|
|
@@ -69,6 +134,8 @@ function hostFileMap(home) {
|
|
|
69
134
|
id: 'antigravity',
|
|
70
135
|
root: agents,
|
|
71
136
|
files: [
|
|
137
|
+
...backendSkillFiles('.agents/skills/backend-development', path.join(agents, 'skills/backend-development')),
|
|
138
|
+
...emilKowalskiSkillFiles('.agents/skills', path.join(agents, 'skills')),
|
|
72
139
|
{ src: '.agents/devil-advocate.md', dest: path.join(agents, 'devil-advocate.md'), mode: 'upsert' },
|
|
73
140
|
{ src: '.agents/judge.md', dest: path.join(agents, 'judge.md'), mode: 'upsert' },
|
|
74
141
|
{ src: '.agents/workflows/ai-engineering-loop.md', dest: path.join(agents, 'workflows/ai-engineering-loop.md'), mode: 'upsert' }
|
|
@@ -197,6 +264,8 @@ module.exports = {
|
|
|
197
264
|
packageRoot,
|
|
198
265
|
homeDir,
|
|
199
266
|
applyGrokSkillOverlay,
|
|
267
|
+
EMIL_KOWALSKI_SKILLS,
|
|
268
|
+
EMIL_KOWALSKI_SKILL_FILES,
|
|
200
269
|
hostFileMap,
|
|
201
270
|
planHostSync,
|
|
202
271
|
applyHostSync,
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { execFileSync } = require('child_process');
|
|
6
|
+
|
|
7
|
+
const DEFAULT_UPDATE_TIMEOUT_MS = 8_000;
|
|
8
|
+
|
|
9
|
+
function updateError(message, code = 'UPDATE_ERROR') {
|
|
10
|
+
const err = new Error(message);
|
|
11
|
+
err.code = code;
|
|
12
|
+
return err;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function loadPackageMetadata(rootDir) {
|
|
16
|
+
const packagePath = path.join(rootDir, 'package.json');
|
|
17
|
+
const metadata = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
|
|
18
|
+
if (!metadata.name || !metadata.version) {
|
|
19
|
+
throw updateError('package.json must include name and version', 'INVALID_PACKAGE_METADATA');
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
name: metadata.name,
|
|
23
|
+
version: metadata.version
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function parseVersion(version) {
|
|
28
|
+
const match = String(version || '').trim().match(/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/);
|
|
29
|
+
if (!match) throw updateError(`Invalid semantic version: ${version || '(empty)'}`, 'INVALID_VERSION');
|
|
30
|
+
return match.slice(1).map((part) => Number(part));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function compareVersions(leftVersion, rightVersion) {
|
|
34
|
+
const left = parseVersion(leftVersion);
|
|
35
|
+
const right = parseVersion(rightVersion);
|
|
36
|
+
for (let index = 0; index < left.length; index++) {
|
|
37
|
+
if (left[index] > right[index]) return 1;
|
|
38
|
+
if (left[index] < right[index]) return -1;
|
|
39
|
+
}
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function npmViewLatestVersion(packageName, { timeoutMs = DEFAULT_UPDATE_TIMEOUT_MS } = {}) {
|
|
44
|
+
if (process.env.AEL_UPDATE_LATEST_VERSION) return process.env.AEL_UPDATE_LATEST_VERSION;
|
|
45
|
+
try {
|
|
46
|
+
const output = execFileSync('npm', ['view', `${packageName}@latest`, 'version', '--json'], {
|
|
47
|
+
encoding: 'utf8',
|
|
48
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
49
|
+
timeout: timeoutMs
|
|
50
|
+
}).trim();
|
|
51
|
+
return JSON.parse(output);
|
|
52
|
+
} catch (cause) {
|
|
53
|
+
throw updateError(`Unable to check npm for ${packageName}@latest: ${cause.message}`, 'UPDATE_CHECK_FAILED');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function detectInstallScope(rootDir) {
|
|
58
|
+
const override = process.env.AEL_INSTALL_SCOPE;
|
|
59
|
+
if (override === 'global' || override === 'project') return override;
|
|
60
|
+
try {
|
|
61
|
+
const globalRoot = execFileSync('npm', ['root', '--global'], {
|
|
62
|
+
encoding: 'utf8',
|
|
63
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
64
|
+
timeout: 3_000
|
|
65
|
+
}).trim();
|
|
66
|
+
const packageRoot = fs.realpathSync(rootDir);
|
|
67
|
+
const realGlobalRoot = fs.realpathSync(globalRoot);
|
|
68
|
+
const relative = path.relative(realGlobalRoot, packageRoot);
|
|
69
|
+
const isGlobalPackage = relative && !relative.startsWith('..') && !path.isAbsolute(relative);
|
|
70
|
+
return isGlobalPackage ? 'global' : 'project';
|
|
71
|
+
} catch {
|
|
72
|
+
return 'project';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function command(cmd, args) {
|
|
77
|
+
return {
|
|
78
|
+
cmd,
|
|
79
|
+
args,
|
|
80
|
+
display: [cmd, ...args].join(' ')
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function updateCommands(packageName, installScope) {
|
|
85
|
+
if (installScope === 'global') {
|
|
86
|
+
return [
|
|
87
|
+
command('npm', ['install', '--global', `${packageName}@latest`]),
|
|
88
|
+
command('ai-engineering-loop', ['sync-hosts']),
|
|
89
|
+
command('ai-engineering-loop', ['refresh']),
|
|
90
|
+
command('ai-engineering-loop', ['doctor'])
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
return [
|
|
94
|
+
command('npm', ['install', `${packageName}@latest`, '--save-dev']),
|
|
95
|
+
command('npx', ['ai-engineering-loop', 'sync-hosts']),
|
|
96
|
+
command('npx', ['ai-engineering-loop', 'refresh']),
|
|
97
|
+
command('npx', ['ai-engineering-loop', 'doctor'])
|
|
98
|
+
];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function buildUpdatePlan({ packageName, currentVersion, latestVersion, installScope }) {
|
|
102
|
+
const comparison = compareVersions(currentVersion, latestVersion);
|
|
103
|
+
return {
|
|
104
|
+
schemaVersion: 1,
|
|
105
|
+
packageName,
|
|
106
|
+
currentVersion,
|
|
107
|
+
latestVersion,
|
|
108
|
+
installScope,
|
|
109
|
+
updateAvailable: comparison < 0,
|
|
110
|
+
upToDate: comparison >= 0,
|
|
111
|
+
commands: updateCommands(packageName, installScope)
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function checkForUpdate(rootDir, {
|
|
116
|
+
latestVersion,
|
|
117
|
+
installScope,
|
|
118
|
+
timeoutMs = DEFAULT_UPDATE_TIMEOUT_MS
|
|
119
|
+
} = {}) {
|
|
120
|
+
const metadata = loadPackageMetadata(rootDir);
|
|
121
|
+
const resolvedLatestVersion = latestVersion || npmViewLatestVersion(metadata.name, { timeoutMs });
|
|
122
|
+
const resolvedInstallScope = installScope || detectInstallScope(rootDir);
|
|
123
|
+
return buildUpdatePlan({
|
|
124
|
+
packageName: metadata.name,
|
|
125
|
+
currentVersion: metadata.version,
|
|
126
|
+
latestVersion: resolvedLatestVersion,
|
|
127
|
+
installScope: resolvedInstallScope
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function executeUpdatePlan(plan, { stdio = 'inherit' } = {}) {
|
|
132
|
+
for (const item of plan.commands) {
|
|
133
|
+
execFileSync(item.cmd, item.args, { stdio });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
module.exports = {
|
|
138
|
+
DEFAULT_UPDATE_TIMEOUT_MS,
|
|
139
|
+
buildUpdatePlan,
|
|
140
|
+
checkForUpdate,
|
|
141
|
+
compareVersions,
|
|
142
|
+
detectInstallScope,
|
|
143
|
+
executeUpdatePlan,
|
|
144
|
+
npmViewLatestVersion,
|
|
145
|
+
parseVersion,
|
|
146
|
+
updateCommands
|
|
147
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-engineering-loop",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "A visual workspace that helps AI coding agents plan, build, review, and ship reliable software.",
|
|
5
5
|
"main": "bin/ai-engineering-loop.js",
|
|
6
6
|
"bin": {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
".claude/commands/",
|
|
27
27
|
".claude/skills/",
|
|
28
28
|
"LICENSE",
|
|
29
|
+
"THIRD_PARTY_NOTICES.md",
|
|
29
30
|
"SECURITY.md",
|
|
30
31
|
"SUPPORT.md",
|
|
31
32
|
"README.md"
|