merge: sync Kilo runtime branch with main

Bring the latest main branch updates into feat/kilo-runtime-support while preserving KILO_CONFIG resolution, Kilo agent permission conversion, and relative .claude path rewrites.
This commit is contained in:
Alex Alecu
2026-04-02 16:00:09 +03:00
95 changed files with 7754 additions and 384 deletions

View File

@@ -29,7 +29,10 @@ function detectConfigDir(baseDir) {
const globalConfigDir = detectConfigDir(homeDir);
const projectConfigDir = detectConfigDir(cwd);
const cacheDir = path.join(globalConfigDir, 'cache');
// Use a shared, tool-agnostic cache directory to avoid multi-runtime
// resolution mismatches where check-update writes to one runtime's cache
// but statusline reads from another (#1421).
const cacheDir = path.join(homeDir, '.cache', 'gsd');
const cacheFile = path.join(cacheDir, 'gsd-update-check.json');
// VERSION file locations (check project first, then global)
@@ -65,10 +68,10 @@ const child = spawn(process.execPath, ['-e', `
} catch (e) {}
// Check for stale hooks — compare hook version headers against installed VERSION
// Hooks live inside get-shit-done/hooks/, not configDir/hooks/
// Hooks are installed at configDir/hooks/ (e.g. ~/.claude/hooks/) (#1421)
let staleHooks = [];
if (configDir) {
const hooksDir = path.join(configDir, 'get-shit-done', 'hooks');
const hooksDir = path.join(configDir, 'hooks');
try {
if (fs.existsSync(hooksDir)) {
const hookFiles = fs.readdirSync(hooksDir).filter(f => f.startsWith('gsd-') && f.endsWith('.js'));

View File

@@ -92,8 +92,12 @@ process.stdin.on('end', () => {
}
// GSD update available?
// Check shared cache first (#1421), fall back to runtime-specific cache for
// backward compatibility with older gsd-check-update.js versions.
let gsdUpdate = '';
const cacheFile = path.join(claudeDir, 'cache', 'gsd-update-check.json');
const sharedCacheFile = path.join(homeDir, '.cache', 'gsd', 'gsd-update-check.json');
const legacyCacheFile = path.join(claudeDir, 'cache', 'gsd-update-check.json');
const cacheFile = fs.existsSync(sharedCacheFile) ? sharedCacheFile : legacyCacheFile;
if (fs.existsSync(cacheFile)) {
try {
const cache = JSON.parse(fs.readFileSync(cacheFile, 'utf8'));