codmir 0.4.0 → 0.6.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/README.md DELETED
@@ -1,547 +0,0 @@
1
- # codmir
2
-
3
- > TypeScript SDK for codmir API - **the AI that prevents wasted engineering time**.
4
-
5
- [![npm version](https://badge.fury.io/js/codmir.svg)](https://www.npmjs.com/package/codmir)
6
-
7
- We've massively expanded the SDK with game-changing AI features:
8
-
9
- - **Codebase Analysis** - Analyze your project in 1-5 seconds, understand structure, dependencies, and patterns
10
- - **Knowledge Base** - Auto-generated project knowledge for AI context
11
- - **AI Task Replication** - Save, clone, and resume AI tasks anywhere (like VM snapshots for AI)
12
- - **Usage Tracking** - Track AI costs per API key with detailed billing
13
- - **Multi-Agent Support** - Coordinate TARS, Cascade, Overseer agents
14
- - **Observability** - Session replay and error tracking (separate @codmir/observe package)
15
- - **IDE Integration** - VSCode extension with project graph visualization
16
-
17
- ## Core Features
18
-
19
- ### AI & Automation
20
- - **AI Assistant** - Interactive AI chat with project context
21
- - **Codebase Analysis** - Local (fast) or Railway (deep) analysis
22
- - **Knowledge Base** - Structured project understanding for AI
23
- - **Task DNA** - Snapshot and replicate AI tasks
24
- - **Cost Tracking** - Monitor AI usage and costs
25
-
26
- ### Project Management
27
- - **Projects** - Create and manage projects
28
- - **Tickets** - Full ticket lifecycle with AI integration
29
- - **Tasks** - Track and automate tasks
30
-
31
- ### Development Tools
32
- - **Authentication** - Secure API key management
33
- - **REST API** - Comprehensive API client
34
- - **TypeScript** - Full type safety
35
- - **CLI** - Powerful command-line interface
36
-
37
- ## Installation
38
-
39
- ### As a Package
40
-
41
- ```bash
42
- npm install codmir
43
- ```
44
-
45
- or with pnpm:
46
-
47
- ```bash
48
- pnpm add codmir
49
- ```
50
-
51
- or with yarn:
52
-
53
- ```bash
54
- yarn add codmir
55
- ```
56
-
57
- ### As a CLI (Global)
58
-
59
- ```bash
60
- pnpm add -g codmir
61
- ```
62
-
63
- **New CLI Commands:**
64
- - `codmir analyze` - Analyze codebase and generate knowledge base
65
- - `codmir ai` - Interactive AI assistant with project context
66
- - `codmir usage` - View API usage and billing stats
67
- - `codmir task` - Manage AI task snapshots and replication
68
-
69
- See [CLI Documentation](./CLI.md) for all commands.
70
-
71
- Then authenticate and link your project:
72
-
73
- ```bash
74
- codmir login # Authenticate via browser
75
- codmir link # Link current directory to a project
76
- codmir init # Initialize with examples
77
- ```
78
-
79
- ### AI Agent Mode
80
-
81
- The CLI includes a powerful AI assistant that understands YOUR codebase:
82
-
83
- ```bash
84
- # Interactive agent session
85
- codmir ai
86
-
87
- # With full project context (uses knowledge base)
88
- codmir ai --context
89
-
90
- # Quick query
91
- codmir ask "How do I setup authentication?"
92
- ```
93
-
94
- **Enhanced Features:**
95
- - 🤖 **Context-Aware AI** - Uses project knowledge base
96
- - 📋 **Clipboard Support** - Attach images automatically
97
- - 🔗 **Execution Context** - Knows if you're in a linked project
98
- - 🖼️ **Media Upload** - Screenshots, diagrams, error messages
99
- - 💰 **Cost Tracking** - See token usage after each query
100
- - 🎯 **Smart Responses** - AI follows YOUR code patterns
101
-
102
- ### Codebase Analysis
103
-
104
- Analyze your project to enable context-aware AI:
105
-
106
- ```bash
107
- # Link project (auto-prompts to analyze)
108
- codmir link
109
-
110
- # Manual analysis
111
- codmir analyze
112
-
113
- # Deep analysis on Railway
114
- codmir analyze --mode railway
115
-
116
- # Force re-analysis
117
- codmir analyze --force
118
- ```
119
-
120
- **What Gets Analyzed:**
121
- - 📁 File structure and organization
122
- - 🔗 Dependencies and imports
123
- - ⚙️ Tech stack (frameworks, libraries, tools)
124
- - 📄 Entry points and scripts
125
- - 📚 Documentation (README, etc.)
126
- - 🎯 Code patterns and best practices
127
-
128
- **Knowledge Base Location:** `.codmir/knowledge/`
129
-
130
- ### Usage Tracking & Billing
131
-
132
- Monitor AI costs and usage per API key:
133
-
134
- ```bash
135
- # View current month usage
136
- codmir usage
137
-
138
- # Detailed breakdown by provider
139
- codmir usage --detailed
140
-
141
- # Specific month
142
- codmir usage --month 2025-12
143
- ```
144
-
145
- **Tracks:**
146
- - 🤖 AI calls per agent (TARS, Cascade, Overseer)
147
- - 🎟️ Token usage (prompt + completion)
148
- - 💰 Cost breakdown by provider (OpenAI, Anthropic)
149
- - 📊 Monthly aggregation
150
- - 🎯 ROI calculation (time saved)
151
-
152
- ### AI Task Replication (Coming Soon)
153
-
154
- Snapshot and clone AI tasks like VM snapshots:
155
-
156
- ```bash
157
- # Create task
158
- codmir task create "Implement feature X"
159
-
160
- # Snapshot current state (50% done)
161
- codmir task snapshot task_123
162
-
163
- # Clone for testing
164
- codmir task clone task_123 --count 3
165
-
166
- # Restore anywhere
167
- codmir task restore task_123.dna
168
-
169
- # Resume from checkpoint
170
- codmir task resume task_123
171
- ```
172
-
173
- **Benefits:**
174
- - 💾 Save AI progress anytime
175
- - 🔄 Resume on different infrastructure
176
- - 🧬 Clone for parallel execution
177
- - ☁️ Migrate between services (Railway → Lambda → Local)
178
- - 📦 Share AI states with team
179
-
180
- See [AI Task Replication Docs](../../AI_TASK_REPLICATION_FRAMEWORK.md) for details.
181
-
182
- See [Agent Mode Quick Start](./AGENT_MODE_QUICK_START.md) and [CLI Documentation](./CLI.md) for more details.
183
-
184
- ## The codmir Ecosystem
185
-
186
- ### Complete Platform
187
-
188
- codmir is more than just an SDK - it's a complete AI-powered development platform:
189
-
190
- ```
191
- ┌──────────────────────────────────────────────┐
192
- │ codmir Platform │
193
- ├──────────────────────────────────────────────┤
194
- │ │
195
- │ 📦 @codmir/sdk │
196
- │ └─ CLI & SDK (this package) │
197
- │ │
198
- │ 🔍 @codmir/observe │
199
- │ └─ Session replay & error tracking │
200
- │ │
201
- │ 🎨 VSCode Extension │
202
- │ └─ IDE integration with project graph │
203
- │ │
204
- │ 🤖 AI Agents │
205
- │ ├─ TARS (code generation) │
206
- │ ├─ Cascade (code review) │
207
- │ └─ Overseer (monitoring) │
208
- │ │
209
- │ 🌐 Web Dashboard │
210
- │ └─ Projects, tickets, reports, analytics │
211
- │ │
212
- └──────────────────────────────────────────────┘
213
- ```
214
-
215
- ### Related Packages
216
-
217
- - **@codmir/observe** - Observability SDK for session replay and error tracking
218
- - **codmir-vscode** - VSCode extension with project graph visualization
219
-
220
- ### Documentation
221
-
222
- - [Complete System Integration](../../COMPLETE_SYSTEM_INTEGRATION.md)
223
- - [Codebase Analysis Architecture](../../CODEBASE_ANALYSIS_ARCHITECTURE.md)
224
- - [AI Task Replication Framework](../../AI_TASK_REPLICATION_FRAMEWORK.md)
225
- - [Observability Platform](../../OBSERVABILITY_PLATFORM_ARCHITECTURE.md)
226
- - [AI Orchestration Vision](../../AI_ORCHESTRATION_VISION.md)
227
-
228
- ## Quick Start
229
-
230
- ```typescript
231
- import { CodmirClient } from 'codmir';
232
-
233
- // Initialize the client
234
- const client = new CodmirClient({
235
- apiKey: 'your-api-key-here',
236
- baseUrl: 'https://codmir.com', // optional, defaults to https://codmir.com
237
- });
238
-
239
- // Create a ticket
240
- const ticket = await client.tickets.create('project-id', 'board-id', {
241
- title: 'Implement user authentication',
242
- description: 'Add OAuth2 support for Google and GitHub',
243
- priority: 'HIGH',
244
- status: 'TODO',
245
- type: 'FEATURE',
246
- });
247
-
248
- console.log('Created ticket:', ticket.id);
249
-
250
- // Create a test case
251
- const testCase = await client.testCases.create('project-id', {
252
- title: 'Test login functionality',
253
- suiteId: 'test-suite-id',
254
- template: 'steps',
255
- priority: 'High',
256
- steps: [
257
- { action: 'Navigate to login page', expected: 'Login form is displayed' },
258
- { action: 'Enter valid credentials', expected: 'User is authenticated' },
259
- { action: 'Click submit button', expected: 'User is redirected to dashboard' },
260
- ],
261
- });
262
-
263
- console.log('Created test case:', testCase.id);
264
- ```
265
-
266
- ## API Reference
267
-
268
- ### Client Configuration
269
-
270
- ```typescript
271
- interface CodmirClientConfig {
272
- apiKey?: string; // Your API key
273
- baseUrl?: string; // API base URL (default: https://codmir.com)
274
- timeout?: number; // Request timeout in ms (default: 30000)
275
- headers?: Record<string, string>; // Additional headers
276
- }
277
- ```
278
-
279
- ### Tickets API
280
-
281
- #### Create Ticket in Board
282
-
283
- ```typescript
284
- const ticket = await client.tickets.createInBoard(
285
- projectId: string,
286
- boardId: string,
287
- data: CreateTicketInput
288
- );
289
- ```
290
-
291
- #### Create Ticket in Workspace
292
-
293
- ```typescript
294
- const ticket = await client.tickets.createInWorkspace(
295
- projectId: string,
296
- workspaceId: string,
297
- data: CreateTicketInput
298
- );
299
- ```
300
-
301
- #### CreateTicketInput
302
-
303
- ```typescript
304
- interface CreateTicketInput {
305
- title: string; // Required
306
- description?: string;
307
- status?: TicketStatus; // BACKLOG | TODO | IN_PROGRESS | DONE | CANCELED
308
- priority?: TicketPriority; // LOW | MEDIUM | HIGH | CRITICAL
309
- type?: TicketType; // TASK | BUG | STORY | EPIC | FEATURE | IMPROVEMENT
310
- assigneeId?: string;
311
- reporterId?: string;
312
- groupId?: string;
313
- parentId?: string;
314
- teamId?: string;
315
- labels?: string;
316
- dueDate?: string; // ISO date string
317
- order?: number;
318
- customFields?: Record<string, any>;
319
- }
320
- ```
321
-
322
- ### Test Cases API
323
-
324
- #### List Test Cases
325
-
326
- ```typescript
327
- const testCases = await client.testCases.list(projectId: string);
328
- ```
329
-
330
- #### Get Test Case
331
-
332
- ```typescript
333
- const testCase = await client.testCases.get(
334
- projectId: string,
335
- testCaseId: string | number
336
- );
337
- ```
338
-
339
- #### Create Test Case
340
-
341
- ```typescript
342
- const result = await client.testCases.create(
343
- projectId: string,
344
- data: CreateTestCaseInput
345
- );
346
- ```
347
-
348
- #### Update Test Case
349
-
350
- ```typescript
351
- const result = await client.testCases.update(
352
- projectId: string,
353
- testCaseId: string | number,
354
- data: UpdateTestCaseInput
355
- );
356
- ```
357
-
358
- #### Delete Test Case
359
-
360
- ```typescript
361
- await client.testCases.delete(
362
- projectId: string,
363
- testCaseId: string | number
364
- );
365
- ```
366
-
367
- #### CreateTestCaseInput
368
-
369
- ```typescript
370
- interface CreateTestCaseInput {
371
- title: string; // Required
372
- suiteId: string; // Required - Test suite ID
373
- template?: 'steps' | 'text'; // Default: 'steps'
374
- type?: string; // Default: 'Functional'
375
- priority?: 'Low' | 'Medium' | 'High'; // Default: 'Medium'
376
- estimate?: string; // e.g., '5m', '1h', '2d'
377
- preconditions?: string;
378
- steps?: TestCaseStep[]; // For 'steps' template
379
- stepsText?: string; // For 'text' template
380
- }
381
-
382
- interface TestCaseStep {
383
- action: string;
384
- expected: string;
385
- }
386
- ```
387
-
388
- #### UpdateTestCaseInput
389
-
390
- ```typescript
391
- interface UpdateTestCaseInput extends Partial<CreateTestCaseInput> {
392
- status?: 'Not Started' | 'In Progress' | 'Passed' | 'Failed' | 'Blocked';
393
- }
394
- ```
395
-
396
- ## Examples
397
-
398
- ### Create a Bug Ticket
399
-
400
- ```typescript
401
- const bug = await client.tickets.create('project-id', 'board-id', {
402
- title: 'Fix memory leak in dashboard',
403
- description: 'Users report increasing memory usage over time',
404
- type: 'BUG',
405
- priority: 'CRITICAL',
406
- status: 'TODO',
407
- assigneeId: 'user-123',
408
- });
409
- ```
410
-
411
- ### Create a Test Case with Steps
412
-
413
- ```typescript
414
- const testCase = await client.testCases.create('project-id', {
415
- title: 'User registration flow',
416
- suiteId: 'suite-123',
417
- template: 'steps',
418
- priority: 'High',
419
- estimate: '15m',
420
- preconditions: 'User is not logged in',
421
- steps: [
422
- {
423
- action: 'Click "Sign Up" button',
424
- expected: 'Registration form is displayed',
425
- },
426
- {
427
- action: 'Fill in email and password',
428
- expected: 'Form validation passes',
429
- },
430
- {
431
- action: 'Submit the form',
432
- expected: 'User account is created and email is sent',
433
- },
434
- ],
435
- });
436
- ```
437
-
438
- ### Update Test Case Status
439
-
440
- ```typescript
441
- await client.testCases.update('project-id', 'TC-123', {
442
- status: 'Passed',
443
- });
444
- ```
445
-
446
- ### Error Handling
447
-
448
- ```typescript
449
- try {
450
- const ticket = await client.tickets.create('project-id', 'board-id', {
451
- title: 'New ticket',
452
- });
453
- } catch (error) {
454
- if (error.statusCode === 401) {
455
- console.error('Invalid API key');
456
- } else if (error.statusCode === 404) {
457
- console.error('Project or board not found');
458
- } else {
459
- console.error('Error:', error.message);
460
- }
461
- }
462
- ```
463
-
464
- ## Authentication
465
-
466
- To use the API, you need an API key. You can obtain one from your codmir account settings.
467
-
468
- Set the API key when initializing the client:
469
-
470
- ```typescript
471
- const client = new CodmirClient({
472
- apiKey: process.env.CODMIR_API_KEY, // Recommended: use environment variables
473
- });
474
- ```
475
-
476
- The API key will be sent in the `X-API-Key` header with each request.
477
-
478
- ## TypeScript Support
479
-
480
- This package is written in TypeScript and includes complete type definitions. You'll get full IDE autocomplete and type checking out of the box.
481
-
482
- ```typescript
483
- import type {
484
- Ticket,
485
- TestCase,
486
- CreateTicketInput,
487
- TicketPriority
488
- } from 'codmir';
489
- ```
490
-
491
- ## What Makes codmir Different?
492
-
493
- ### vs Traditional Tools
494
-
495
- | Feature | codmir | Sentry | Datadog | GitHub |
496
- |---------|--------|--------|---------|--------|
497
- | Codebase Understanding | ✅ AI-powered | ❌ | ❌ | ❌ |
498
- | Usage-Based Billing | ✅ Transparent | ✅ | ✅ | ❌ |
499
- | Session Replay | ✅ 10KB/min | ✅ 50KB/min | ✅ 100KB/min | ❌ |
500
- | AI Task Cloning | ✅ Unique | ❌ | ❌ | ❌ |
501
- | Multi-Agent System | ✅ Built-in | ❌ | ❌ | ❌ |
502
- | Cost Tracking | ✅ Per AI call | ❌ | ❌ | ❌ |
503
- | IDE Integration | ✅ VSCode | ❌ | ❌ | ❌ |
504
- | Knowledge Base | ✅ Auto-generated | ❌ | ❌ | ❌ |
505
-
506
- ### Key Differentiators
507
-
508
- 1. **AI Understands YOUR Code** - Not generic responses, context from your actual codebase
509
- 2. **Task Replication** - Save and clone AI states (no other platform does this)
510
- 3. **Complete Visibility** - Track every AI call, token, and cost
511
- 4. **3-10x More Efficient** - Smaller bundle, less data, better performance
512
- 5. **Unified Platform** - One tool for everything (no juggling multiple services)
513
-
514
- ## Requirements
515
-
516
- - Node.js >= 18.0.0
517
- - TypeScript >= 5.0.0 (if using TypeScript)
518
- - codmir account (free tier available)
519
-
520
- ## Browser Support
521
-
522
- This package uses the Fetch API which is available in all modern browsers and Node.js 18+. For older environments, you may need a polyfill.
523
-
524
- ## License
525
-
526
- **Proprietary - All Rights Reserved**
527
-
528
- Copyright © 2024-2025 codmir, Inc.
529
-
530
- This software is proprietary and confidential. Unauthorized copying, distribution, or use is strictly prohibited.
531
-
532
- - Requires valid codmir account
533
- - Subject to Terms of Service
534
- - Commercial use requires paid subscription
535
-
536
- For licensing inquiries: sales@codmir.com
537
-
538
- ## Links
539
-
540
- - [codmir Website](https://codmir.com)
541
- - [Documentation](https://codmir.com/docs)
542
- - [GitHub Repository](https://github.com/codmir/codmir)
543
- - [Report Issues](https://github.com/codmir/codmir/issues)
544
-
545
- ---
546
-
547
- **codmir is the AI that prevents wasted engineering time.**
@@ -1,7 +0,0 @@
1
- import {
2
- analyzeCommand
3
- } from "./chunk-ASGAT3Z5.mjs";
4
- import "./chunk-EBO3CZXG.mjs";
5
- export {
6
- analyzeCommand
7
- };