Skip to content

Commit 462602d

Browse files
committed
format + lint
1 parent 5b1f379 commit 462602d

File tree

6 files changed

+28
-6
lines changed

6 files changed

+28
-6
lines changed

.changeset/convert-to-zod.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
"mycoder-agent": minor
3-
"mycoder": minor
2+
'mycoder-agent': minor
3+
'mycoder': minor
44
---
55

66
Convert from JsonSchema7Type to ZodSchema for tool parameters and returns, required for Vercel AI SDK integration.

docs/LargeCodeBase_Plan.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,19 @@ This document presents research findings on how leading AI coding tools handle l
1111
While detailed technical documentation on Claude Code's internal architecture is limited in public sources, we can infer several approaches from Anthropic's general AI architecture and Claude Code's capabilities:
1212

1313
1. **Chunking and Retrieval Augmentation**:
14+
1415
- Claude Code likely employs retrieval-augmented generation (RAG) to handle large codebases
1516
- Files are likely chunked into manageable segments with semantic understanding
1617
- Relevant code chunks are retrieved based on query relevance
1718

1819
2. **Hierarchical Code Understanding**:
20+
1921
- Builds a hierarchical representation of code (project → modules → files → functions)
2022
- Maintains a graph of relationships between code components
2123
- Prioritizes context based on relevance to the current task
2224

2325
3. **Incremental Context Management**:
26+
2427
- Dynamically adjusts the context window to include only relevant code
2528
- Maintains a "working memory" of recently accessed or modified files
2629
- Uses sliding context windows to process large files sequentially
@@ -35,16 +38,19 @@ While detailed technical documentation on Claude Code's internal architecture is
3538
Aider's approach to handling large codebases can be inferred from its open-source codebase and documentation:
3639

3740
1. **Git Integration**:
41+
3842
- Leverages Git to track file changes and understand repository structure
3943
- Uses Git history to prioritize recently modified files
4044
- Employs Git's diff capabilities to minimize context needed for changes
4145

4246
2. **Selective File Context**:
47+
4348
- Only includes relevant files in the context rather than the entire codebase
4449
- Uses heuristics to identify related files based on imports, references, and naming patterns
4550
- Implements a "map-reduce" approach where it first analyzes the codebase structure, then selectively processes relevant files
4651

4752
3. **Prompt Engineering and Chunking**:
53+
4854
- Designs prompts that can work with limited context by focusing on specific tasks
4955
- Chunks large files and processes them incrementally
5056
- Uses summarization to compress information about non-focal code parts
@@ -90,6 +96,7 @@ Based on the research findings, we recommend the following enhancements to MyCod
9096
```
9197

9298
**Implementation Details:**
99+
93100
- Create a lightweight indexer that runs during project initialization
94101
- Generate embeddings for code files, focusing on API definitions, function signatures, and documentation
95102
- Build a graph of relationships between files based on imports/exports and references
@@ -120,6 +127,7 @@ Based on the research findings, we recommend the following enhancements to MyCod
120127
```
121128

122129
**Implementation Details:**
130+
123131
- Develop a working set manager that tracks currently relevant files
124132
- Implement a relevance scoring algorithm that considers:
125133
- Semantic similarity to the current task
@@ -148,6 +156,7 @@ Based on the research findings, we recommend the following enhancements to MyCod
148156
```
149157

150158
**Implementation Details:**
159+
151160
- Chunk files at meaningful boundaries (functions, classes, modules)
152161
- Implement overlapping chunks to maintain context across boundaries
153162
- Develop a progressive loading strategy:
@@ -181,6 +190,7 @@ Based on the research findings, we recommend the following enhancements to MyCod
181190
```
182191

183192
**Implementation Details:**
193+
184194
- Implement a multi-level caching system:
185195
- Token cache: Store tokenized representations of files to avoid re-tokenization
186196
- Embedding cache: Store vector embeddings for semantic search
@@ -209,6 +219,7 @@ Based on the research findings, we recommend the following enhancements to MyCod
209219
```
210220

211221
**Implementation Details:**
222+
212223
- Improve task decomposition to identify parallelizable sub-tasks
213224
- Implement smart context distribution to sub-agents:
214225
- Provide each sub-agent with only the context it needs
@@ -222,16 +233,19 @@ Based on the research findings, we recommend the following enhancements to MyCod
222233
## Implementation Roadmap
223234

224235
### Phase 1: Foundation (1-2 months)
236+
225237
- Develop the basic indexing system for project structure and file metadata
226238
- Implement a simple relevance-based context selection mechanism
227239
- Create a basic chunking strategy for large files
228240

229241
### Phase 2: Advanced Features (2-3 months)
242+
230243
- Implement the semantic indexing system with code embeddings
231244
- Develop the full context management system with working sets
232245
- Create the multi-level caching system
233246

234247
### Phase 3: Optimization and Integration (1-2 months)
248+
235249
- Enhance sub-agent coordination for parallel processing
236250
- Optimize performance with better caching and context management
237251
- Integrate all components into a cohesive system

docs/SentryIntegration.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ npm install @sentry/node --save
1717
## Configuration
1818

1919
By default, Sentry is:
20+
2021
- Enabled in production environments
2122
- Disabled in development environments (unless explicitly enabled)
2223
- Configured to capture 100% of transactions
@@ -56,7 +57,9 @@ Sentry.init({
5657
tracesSampleRate: 1.0,
5758
environment: process.env.NODE_ENV || 'development',
5859
release: `mycoder@${packageVersion}`,
59-
enabled: process.env.NODE_ENV !== 'development' || process.env.ENABLE_SENTRY === 'true',
60+
enabled:
61+
process.env.NODE_ENV !== 'development' ||
62+
process.env.ENABLE_SENTRY === 'true',
6063
});
6164

6265
// Capture errors
@@ -76,6 +79,7 @@ mycoder test-sentry
7679
```
7780

7881
This command will:
82+
7983
1. Generate a test error that includes the package version
8084
2. Report it to Sentry.io
8185
3. Output the result to the console
@@ -85,6 +89,7 @@ Note: In development environments, you may need to set `ENABLE_SENTRY=true` for
8589
## Privacy
8690

8791
Error reports sent to Sentry include:
92+
8893
- Stack traces
8994
- Error messages
9095
- Environment information

packages/agent/src/core/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export type Tool<TParams = Record<string, any>, TReturn = any> = {
2929
logReturns?: (returns: TReturn, context: ToolContext) => void;
3030

3131
execute: (params: TParams, context: ToolContext) => Promise<TReturn>;
32-
32+
3333
// Keep JsonSchema7Type for backward compatibility and Vercel AI SDK integration
3434
parametersJsonSchema?: JsonSchema7Type;
3535
returnsJsonSchema?: JsonSchema7Type;

packages/agent/src/tools/system/respawn.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ const parameterSchema = z.object({
1111
respawnContext: z.string().describe('The context to keep after respawning'),
1212
});
1313

14-
const returnSchema = z.string().describe('A message indicating that the respawn has been initiated');
14+
const returnSchema = z
15+
.string()
16+
.describe('A message indicating that the respawn has been initiated');
1517

1618
export const respawnTool: Tool = {
1719
name: 'respawn',

packages/cli/src/commands/tools.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export const command: CommandModule<object, ToolsArgs> = {
5454
// Parameters section
5555
console.log('Parameters:');
5656
// Use parametersJsonSchema if available, otherwise convert from ZodSchema
57-
const parametersSchema = (tool as any).parametersJsonSchema || tool.parameters;
57+
const parametersSchema =
58+
(tool as any).parametersJsonSchema || tool.parameters;
5859
console.log(
5960
formatSchema(
6061
parametersSchema as {

0 commit comments

Comments
 (0)