also looking at this
chore(deps): upgrade vendored Stacks framework to 0.70.163
#29
224 files
+3516
-874
| @@ -16,11 +16,12 @@ import type { | ||
| 16 | 16 | RepoState, |
| 17 | 17 | StreamingResult, |
| 18 | 18 | } from './types' |
| 19 | import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs' | |
| 19 | import { existsSync, mkdirSync, writeFileSync } from 'node:fs' | |
| 20 | 20 | import { homedir } from 'node:os' |
| 21 | 21 | import { dirname, join } from 'node:path' |
| 22 | 22 | import { claudeAgent } from './agents' |
| 23 | 23 | import { createAnthropicDriver, createClaudeAgentSDKDriver, createOllamaDriver, createOpenAIDriver } from './drivers' |
| 24 | import { buildProjectContext } from './context' | |
| 24 | 25 | |
| 25 | 26 | // ============================================================================= |
| 26 | 27 | // Configuration |
| @@ -250,29 +251,7 @@ export function getAvailableDrivers(): string[] { | ||
| 250 | 251 | * Get repository structure for context |
| 251 | 252 | */ |
| 252 | 253 | export async function getRepoContext(repoPath: string): Promise<string> { |
| 253 | const { $: _$ } = await import('bun') | |
| 254 | const treeResult = await _$`cd ${repoPath} && find . -type f -not -path "*/node_modules/*" -not -path "*/.git/*" -not -name "*.lock" | head -50`.quiet() | |
| 255 | const files = treeResult.text().trim() | |
| 256 | ||
| 257 | let readme = '' | |
| 258 | const readmePath = join(repoPath, 'README.md') | |
| 259 | if (existsSync(readmePath)) { | |
| 260 | readme = readFileSync(readmePath, 'utf-8').slice(0, 2000) | |
| 261 | } | |
| 262 | ||
| 263 | let packageJson = '' | |
| 264 | const packagePath = join(repoPath, 'package.json') | |
| 265 | if (existsSync(packagePath)) { | |
| 266 | packageJson = readFileSync(packagePath, 'utf-8') | |
| 267 | } | |
| 268 | ||
| 269 | return ` | |
| 270 | Repository Structure: | |
| 271 | ${files} | |
| 272 | ||
| 273 | ${readme ? `README.md (excerpt):\n${readme}\n` : ''} | |
| 274 | ${packageJson ? `package.json:\n${packageJson}\n` : ''} | |
| 275 | `.trim() | |
| 254 | return buildProjectContext(repoPath).text | |
| 276 | 255 | } |
| 277 | 256 | |
| 278 | 257 | /** |