monty-autonomous-fullstack-dev-multillm 1.0.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/LICENSE +81 -0
- package/README.md +608 -0
- package/bin/cli.js +448 -0
- package/dist/agents/coding.d.ts +15 -0
- package/dist/agents/coding.d.ts.map +1 -0
- package/dist/agents/coding.js +189 -0
- package/dist/agents/coding.js.map +1 -0
- package/dist/agents/initializer.d.ts +15 -0
- package/dist/agents/initializer.d.ts.map +1 -0
- package/dist/agents/initializer.js +87 -0
- package/dist/agents/initializer.js.map +1 -0
- package/dist/agents/prompts/arbitrator.md +143 -0
- package/dist/agents/prompts/coding.md +247 -0
- package/dist/agents/prompts/initializer.md +98 -0
- package/dist/config/agent-config.d.ts +103 -0
- package/dist/config/agent-config.d.ts.map +1 -0
- package/dist/config/agent-config.js +138 -0
- package/dist/config/agent-config.js.map +1 -0
- package/dist/config/auth-config.d.ts +152 -0
- package/dist/config/auth-config.d.ts.map +1 -0
- package/dist/config/auth-config.js +139 -0
- package/dist/config/auth-config.js.map +1 -0
- package/dist/config/mcp-config.d.ts +109 -0
- package/dist/config/mcp-config.d.ts.map +1 -0
- package/dist/config/mcp-config.js +234 -0
- package/dist/config/mcp-config.js.map +1 -0
- package/dist/config/provider-config.d.ts +139 -0
- package/dist/config/provider-config.d.ts.map +1 -0
- package/dist/config/provider-config.js +344 -0
- package/dist/config/provider-config.js.map +1 -0
- package/dist/config/subagents-config.d.ts +85 -0
- package/dist/config/subagents-config.d.ts.map +1 -0
- package/dist/config/subagents-config.js +430 -0
- package/dist/config/subagents-config.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +385 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestrator/arbitrator.d.ts +93 -0
- package/dist/orchestrator/arbitrator.d.ts.map +1 -0
- package/dist/orchestrator/arbitrator.js +330 -0
- package/dist/orchestrator/arbitrator.js.map +1 -0
- package/dist/orchestrator/index.d.ts +113 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +217 -0
- package/dist/orchestrator/index.js.map +1 -0
- package/dist/orchestrator/review-coordinator.d.ts +143 -0
- package/dist/orchestrator/review-coordinator.d.ts.map +1 -0
- package/dist/orchestrator/review-coordinator.js +401 -0
- package/dist/orchestrator/review-coordinator.js.map +1 -0
- package/dist/orchestrator/task-classifier.d.ts +87 -0
- package/dist/orchestrator/task-classifier.d.ts.map +1 -0
- package/dist/orchestrator/task-classifier.js +250 -0
- package/dist/orchestrator/task-classifier.js.map +1 -0
- package/dist/providers/anthropic-provider.d.ts +64 -0
- package/dist/providers/anthropic-provider.d.ts.map +1 -0
- package/dist/providers/anthropic-provider.js +264 -0
- package/dist/providers/anthropic-provider.js.map +1 -0
- package/dist/providers/base-provider.d.ts +219 -0
- package/dist/providers/base-provider.d.ts.map +1 -0
- package/dist/providers/base-provider.js +143 -0
- package/dist/providers/base-provider.js.map +1 -0
- package/dist/providers/cursor-provider.d.ts +82 -0
- package/dist/providers/cursor-provider.d.ts.map +1 -0
- package/dist/providers/cursor-provider.js +321 -0
- package/dist/providers/cursor-provider.js.map +1 -0
- package/dist/providers/google-provider.d.ts +75 -0
- package/dist/providers/google-provider.d.ts.map +1 -0
- package/dist/providers/google-provider.js +274 -0
- package/dist/providers/google-provider.js.map +1 -0
- package/dist/providers/index.d.ts +92 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +233 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/openai-provider.d.ts +83 -0
- package/dist/providers/openai-provider.d.ts.map +1 -0
- package/dist/providers/openai-provider.js +295 -0
- package/dist/providers/openai-provider.js.map +1 -0
- package/dist/templates/feature_list.template.json +66 -0
- package/dist/templates/progress.template.txt +51 -0
- package/dist/utils/auth-manager.d.ts +121 -0
- package/dist/utils/auth-manager.d.ts.map +1 -0
- package/dist/utils/auth-manager.js +560 -0
- package/dist/utils/auth-manager.js.map +1 -0
- package/dist/utils/budget-enforcer.d.ts +181 -0
- package/dist/utils/budget-enforcer.d.ts.map +1 -0
- package/dist/utils/budget-enforcer.js +386 -0
- package/dist/utils/budget-enforcer.js.map +1 -0
- package/dist/utils/chatgpt-detector.d.ts +51 -0
- package/dist/utils/chatgpt-detector.d.ts.map +1 -0
- package/dist/utils/chatgpt-detector.js +274 -0
- package/dist/utils/chatgpt-detector.js.map +1 -0
- package/dist/utils/claude-code-detector.d.ts +39 -0
- package/dist/utils/claude-code-detector.d.ts.map +1 -0
- package/dist/utils/claude-code-detector.js +153 -0
- package/dist/utils/claude-code-detector.js.map +1 -0
- package/dist/utils/code-quality.d.ts +58 -0
- package/dist/utils/code-quality.d.ts.map +1 -0
- package/dist/utils/code-quality.js +258 -0
- package/dist/utils/code-quality.js.map +1 -0
- package/dist/utils/context-primer.d.ts +50 -0
- package/dist/utils/context-primer.d.ts.map +1 -0
- package/dist/utils/context-primer.js +429 -0
- package/dist/utils/context-primer.js.map +1 -0
- package/dist/utils/dependency-management.d.ts +40 -0
- package/dist/utils/dependency-management.d.ts.map +1 -0
- package/dist/utils/dependency-management.js +123 -0
- package/dist/utils/dependency-management.js.map +1 -0
- package/dist/utils/environment-validation.d.ts +33 -0
- package/dist/utils/environment-validation.d.ts.map +1 -0
- package/dist/utils/environment-validation.js +136 -0
- package/dist/utils/environment-validation.js.map +1 -0
- package/dist/utils/error-recovery.d.ts +60 -0
- package/dist/utils/error-recovery.d.ts.map +1 -0
- package/dist/utils/error-recovery.js +183 -0
- package/dist/utils/error-recovery.js.map +1 -0
- package/dist/utils/feature-list.d.ts +102 -0
- package/dist/utils/feature-list.d.ts.map +1 -0
- package/dist/utils/feature-list.js +191 -0
- package/dist/utils/feature-list.js.map +1 -0
- package/dist/utils/gemini-detector.d.ts +65 -0
- package/dist/utils/gemini-detector.d.ts.map +1 -0
- package/dist/utils/gemini-detector.js +340 -0
- package/dist/utils/gemini-detector.js.map +1 -0
- package/dist/utils/git-utils.d.ts +48 -0
- package/dist/utils/git-utils.d.ts.map +1 -0
- package/dist/utils/git-utils.js +110 -0
- package/dist/utils/git-utils.js.map +1 -0
- package/dist/utils/health-check.d.ts +32 -0
- package/dist/utils/health-check.d.ts.map +1 -0
- package/dist/utils/health-check.js +152 -0
- package/dist/utils/health-check.js.map +1 -0
- package/dist/utils/hooks-manager.d.ts +154 -0
- package/dist/utils/hooks-manager.d.ts.map +1 -0
- package/dist/utils/hooks-manager.js +359 -0
- package/dist/utils/hooks-manager.js.map +1 -0
- package/dist/utils/multi-auth-manager.d.ts +144 -0
- package/dist/utils/multi-auth-manager.d.ts.map +1 -0
- package/dist/utils/multi-auth-manager.js +588 -0
- package/dist/utils/multi-auth-manager.js.map +1 -0
- package/dist/utils/progress.d.ts +49 -0
- package/dist/utils/progress.d.ts.map +1 -0
- package/dist/utils/progress.js +209 -0
- package/dist/utils/progress.js.map +1 -0
- package/dist/utils/project-detection.d.ts +40 -0
- package/dist/utils/project-detection.d.ts.map +1 -0
- package/dist/utils/project-detection.js +230 -0
- package/dist/utils/project-detection.js.map +1 -0
- package/dist/utils/session-manager.d.ts +119 -0
- package/dist/utils/session-manager.d.ts.map +1 -0
- package/dist/utils/session-manager.js +389 -0
- package/dist/utils/session-manager.js.map +1 -0
- package/dist/utils/skills-manager.d.ts +113 -0
- package/dist/utils/skills-manager.d.ts.map +1 -0
- package/dist/utils/skills-manager.js +332 -0
- package/dist/utils/skills-manager.js.map +1 -0
- package/dist/utils/structured-output.d.ts +117 -0
- package/dist/utils/structured-output.d.ts.map +1 -0
- package/dist/utils/structured-output.js +191 -0
- package/dist/utils/structured-output.js.map +1 -0
- package/dist/utils/subagent-manager.d.ts +143 -0
- package/dist/utils/subagent-manager.d.ts.map +1 -0
- package/dist/utils/subagent-manager.js +326 -0
- package/dist/utils/subagent-manager.js.map +1 -0
- package/dist/utils/supabase-setup.d.ts +50 -0
- package/dist/utils/supabase-setup.d.ts.map +1 -0
- package/dist/utils/supabase-setup.js +151 -0
- package/dist/utils/supabase-setup.js.map +1 -0
- package/dist/utils/token-refresh.d.ts +21 -0
- package/dist/utils/token-refresh.d.ts.map +1 -0
- package/dist/utils/token-refresh.js +77 -0
- package/dist/utils/token-refresh.js.map +1 -0
- package/dist/utils/tos-warning.d.ts +115 -0
- package/dist/utils/tos-warning.d.ts.map +1 -0
- package/dist/utils/tos-warning.js +304 -0
- package/dist/utils/tos-warning.js.map +1 -0
- package/dist/utils/usage-monitor.d.ts +156 -0
- package/dist/utils/usage-monitor.d.ts.map +1 -0
- package/dist/utils/usage-monitor.js +296 -0
- package/dist/utils/usage-monitor.js.map +1 -0
- package/package.json +105 -0
- package/scripts/init.ps1 +73 -0
- package/scripts/init.sh +86 -0
- package/scripts/test-auth.sh +90 -0
- package/templates/feature_list.template.json +66 -0
- package/templates/progress.template.txt +51 -0
package/bin/cli.js
ADDED
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Monty Full-Stack Agent CLI
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2025 Dobeu Tech Solutions LLC
|
|
7
|
+
* Licensed under CC BY-NC 4.0 - Non-commercial use only
|
|
8
|
+
* https://creativecommons.org/licenses/by-nc/4.0/
|
|
9
|
+
*
|
|
10
|
+
* A Claude Agent SDK framework for autonomous full-stack development.
|
|
11
|
+
* Takes projects from idea to production deployment.
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* monty - Auto-detect mode (init or continue coding)
|
|
15
|
+
* monty init - Initialize a new project
|
|
16
|
+
* monty code - Continue coding session
|
|
17
|
+
* monty --spec="..." - Start with a project specification
|
|
18
|
+
* monty --help - Show help
|
|
19
|
+
*
|
|
20
|
+
* Install globally:
|
|
21
|
+
* npm install -g monty-autonomous-fullstack-dev-multillm
|
|
22
|
+
*
|
|
23
|
+
* Or run directly:
|
|
24
|
+
* npx monty-autonomous-fullstack-dev-multillm
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import { fileURLToPath } from 'url';
|
|
28
|
+
import { dirname, join, resolve } from 'path';
|
|
29
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync, copyFileSync, unlinkSync } from 'fs';
|
|
30
|
+
import { spawn } from 'child_process';
|
|
31
|
+
import { homedir } from 'os';
|
|
32
|
+
|
|
33
|
+
// Import auth manager from the compiled JS if available, or try importing the TS version
|
|
34
|
+
// This handles both development (ts-node) and production (node) environments
|
|
35
|
+
let authManager;
|
|
36
|
+
try {
|
|
37
|
+
// Try importing from the same directory structure (relative to cli.js)
|
|
38
|
+
// For production build: ../utils/auth-manager.js
|
|
39
|
+
const authManagerPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'src', 'utils', 'auth-manager.ts');
|
|
40
|
+
|
|
41
|
+
// We need to use the actual file location based on where we are running
|
|
42
|
+
// If running via tsx/ts-node, we can import .ts files
|
|
43
|
+
// If running via node (production), we need the .js files in dist/
|
|
44
|
+
|
|
45
|
+
// For now, in this CLI wrapper, we'll replicate the core logic needed for bootstrapping
|
|
46
|
+
// but delegate actual authentication handling to the main application logic where possible
|
|
47
|
+
// OR we can dynamically import the auth manager.
|
|
48
|
+
} catch (e) {
|
|
49
|
+
// Fallback
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
53
|
+
const __dirname = dirname(__filename);
|
|
54
|
+
|
|
55
|
+
// Colors for terminal output
|
|
56
|
+
const colors = {
|
|
57
|
+
reset: '\x1b[0m',
|
|
58
|
+
bright: '\x1b[1m',
|
|
59
|
+
dim: '\x1b[2m',
|
|
60
|
+
red: '\x1b[31m',
|
|
61
|
+
green: '\x1b[32m',
|
|
62
|
+
yellow: '\x1b[33m',
|
|
63
|
+
blue: '\x1b[34m',
|
|
64
|
+
magenta: '\x1b[35m',
|
|
65
|
+
cyan: '\x1b[36m',
|
|
66
|
+
white: '\x1b[37m',
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// Auth configuration (Duplicate minimal config needed for CLI bootstrap)
|
|
70
|
+
const AUTH_CONFIG = {
|
|
71
|
+
configDir: join(homedir(), '.monty'),
|
|
72
|
+
get credentialsPath() { return join(this.configDir, 'credentials.json'); },
|
|
73
|
+
envVars: {
|
|
74
|
+
API_KEY: 'ANTHROPIC_API_KEY',
|
|
75
|
+
SUBSCRIPTION_KEY: 'ANTHROPIC_SUBSCRIPTION_KEY',
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
function log(message, color = colors.reset) {
|
|
80
|
+
console.log(`${color}${message}${colors.reset}`);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// ============================================================
|
|
84
|
+
// CLI Functions
|
|
85
|
+
// ============================================================
|
|
86
|
+
|
|
87
|
+
function showBanner() {
|
|
88
|
+
console.log(`
|
|
89
|
+
${colors.cyan}${colors.bright}
|
|
90
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
91
|
+
ā ā
|
|
92
|
+
ā āāāā āāāā āāāāāāā āāāā āāāāāāāāāāāāāāā āāā ā
|
|
93
|
+
ā āāāāā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāā āāāā ā
|
|
94
|
+
ā āāāāāāāāāāāāāā āāāāāāāāā āāā āāā āāāāāāā ā
|
|
95
|
+
ā āāāāāāāāāāāāāā āāāāāāāāāāāāā āāā āāāāā ā
|
|
96
|
+
ā āāā āāā āāāāāāāāāāāāāāā āāāāāā āāā āāā ā
|
|
97
|
+
ā āāā āāā āāāāāāā āāā āāāāā āāā āāā ā
|
|
98
|
+
ā ā
|
|
99
|
+
ā ${colors.white}FULL-STACK AUTONOMOUS DEVELOPMENT AGENT${colors.cyan} ā
|
|
100
|
+
ā ${colors.dim}Powered by Claude Agent SDK${colors.cyan}${colors.bright} ā
|
|
101
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
102
|
+
${colors.reset}`);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function showHelp() {
|
|
106
|
+
showBanner();
|
|
107
|
+
console.log(`
|
|
108
|
+
${colors.bright}USAGE:${colors.reset}
|
|
109
|
+
${colors.cyan}monty${colors.reset} Auto-detect mode
|
|
110
|
+
${colors.cyan}monty init${colors.reset} Initialize new project
|
|
111
|
+
${colors.cyan}monty code${colors.reset} Continue coding session
|
|
112
|
+
${colors.cyan}monty setup${colors.reset} Set up monty in current directory
|
|
113
|
+
${colors.cyan}monty status${colors.reset} Show project progress
|
|
114
|
+
|
|
115
|
+
${colors.bright}AUTHENTICATION:${colors.reset}
|
|
116
|
+
${colors.cyan}monty login${colors.reset} Sign in (Auto-detect / OAuth / API Key)
|
|
117
|
+
${colors.cyan}monty logout${colors.reset} Sign out and clear credentials
|
|
118
|
+
${colors.cyan}monty whoami${colors.reset} Show current authentication status
|
|
119
|
+
|
|
120
|
+
${colors.bright}OPTIONS:${colors.reset}
|
|
121
|
+
${colors.yellow}--spec="..."${colors.reset} Project specification
|
|
122
|
+
${colors.yellow}--context="..."${colors.reset} Additional context for coding
|
|
123
|
+
${colors.yellow}--help, -h${colors.reset} Show this help message
|
|
124
|
+
${colors.yellow}--version, -v${colors.reset} Show version
|
|
125
|
+
|
|
126
|
+
${colors.bright}QUICK START:${colors.reset}
|
|
127
|
+
${colors.dim}# Create a new project${colors.reset}
|
|
128
|
+
${colors.green}mkdir my-app && cd my-app${colors.reset}
|
|
129
|
+
${colors.green}monty init --spec="Build a todo app with React and Supabase"${colors.reset}
|
|
130
|
+
|
|
131
|
+
${colors.dim}# Continue development${colors.reset}
|
|
132
|
+
${colors.green}monty code${colors.reset}
|
|
133
|
+
|
|
134
|
+
${colors.dim}# Or use npx directly${colors.reset}
|
|
135
|
+
${colors.green}npx monty-autonomous-fullstack-dev-multillm init --spec="Your project idea..."${colors.reset}
|
|
136
|
+
|
|
137
|
+
${colors.bright}WORKFLOW:${colors.reset}
|
|
138
|
+
1. ${colors.cyan}monty init${colors.reset} - Analyzes your spec and creates feature list
|
|
139
|
+
2. ${colors.cyan}monty code${colors.reset} - Implements features incrementally with testing
|
|
140
|
+
3. Repeat ${colors.cyan}monty code${colors.reset} until all features pass
|
|
141
|
+
|
|
142
|
+
${colors.bright}FILES CREATED:${colors.reset}
|
|
143
|
+
${colors.dim}.agent/feature_list.json${colors.reset} Feature tracking
|
|
144
|
+
${colors.dim}.agent/claude-progress.txt${colors.reset} Progress between sessions
|
|
145
|
+
|
|
146
|
+
${colors.bright}ENVIRONMENT:${colors.reset}
|
|
147
|
+
${colors.yellow}ANTHROPIC_API_KEY${colors.reset} Anthropic API key (or use "monty login")
|
|
148
|
+
${colors.yellow}ANTHROPIC_SUBSCRIPTION_KEY${colors.reset} Claude Code subscription key
|
|
149
|
+
|
|
150
|
+
${colors.bright}DOCUMENTATION:${colors.reset}
|
|
151
|
+
https://github.com/dobeutech/monty-ai-fullstackdev-coder
|
|
152
|
+
`);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function showVersion() {
|
|
156
|
+
const packagePath = join(__dirname, '..', 'package.json');
|
|
157
|
+
try {
|
|
158
|
+
const pkg = JSON.parse(readFileSync(packagePath, 'utf-8'));
|
|
159
|
+
console.log(`monty-autonomous-fullstack-dev-multillm v${pkg.version}`);
|
|
160
|
+
} catch {
|
|
161
|
+
console.log('monty-autonomous-fullstack-dev-multillm v1.0.0');
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function showStatus() {
|
|
166
|
+
const cwd = process.cwd();
|
|
167
|
+
const agentDir = join(cwd, '.agent');
|
|
168
|
+
const featureListPath = join(agentDir, 'feature_list.json');
|
|
169
|
+
const progressPath = join(agentDir, 'claude-progress.txt');
|
|
170
|
+
|
|
171
|
+
showBanner();
|
|
172
|
+
|
|
173
|
+
if (!existsSync(agentDir)) {
|
|
174
|
+
log('\nā ļø No .agent directory found. Project not initialized.', colors.yellow);
|
|
175
|
+
log(' Run: monty init --spec="Your project idea..."', colors.dim);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (!existsSync(featureListPath)) {
|
|
180
|
+
log('\nā ļø Feature list not found. Run: monty init', colors.yellow);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
try {
|
|
185
|
+
const features = JSON.parse(readFileSync(featureListPath, 'utf-8'));
|
|
186
|
+
const total = features.features?.length || 0;
|
|
187
|
+
const passing = features.features?.filter(f => f.passes).length || 0;
|
|
188
|
+
const percentage = total > 0 ? Math.round((passing / total) * 100) : 0;
|
|
189
|
+
|
|
190
|
+
log('\nš PROJECT STATUS', colors.bright);
|
|
191
|
+
log('ā'.repeat(50), colors.dim);
|
|
192
|
+
log(` Project: ${features.project?.name || 'Unknown'}`, colors.white);
|
|
193
|
+
log(` Total Features: ${total}`, colors.white);
|
|
194
|
+
log(` Passing: ${passing}`, colors.green);
|
|
195
|
+
log(` Remaining: ${total - passing}`, colors.yellow);
|
|
196
|
+
log(` Progress: ${percentage}%`, percentage === 100 ? colors.green : colors.cyan);
|
|
197
|
+
|
|
198
|
+
// Progress bar
|
|
199
|
+
const barWidth = 30;
|
|
200
|
+
const filled = Math.round((percentage / 100) * barWidth);
|
|
201
|
+
const empty = barWidth - filled;
|
|
202
|
+
const bar = 'ā'.repeat(filled) + 'ā'.repeat(empty);
|
|
203
|
+
log(`\n [${bar}] ${percentage}%`, percentage === 100 ? colors.green : colors.cyan);
|
|
204
|
+
|
|
205
|
+
// Show categories
|
|
206
|
+
if (features.features?.length > 0) {
|
|
207
|
+
const categories = {};
|
|
208
|
+
features.features.forEach(f => {
|
|
209
|
+
if (!categories[f.category]) {
|
|
210
|
+
categories[f.category] = { total: 0, passing: 0 };
|
|
211
|
+
}
|
|
212
|
+
categories[f.category].total++;
|
|
213
|
+
if (f.passes) categories[f.category].passing++;
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
log('\n By Category:', colors.bright);
|
|
217
|
+
Object.entries(categories).forEach(([cat, data]) => {
|
|
218
|
+
const catPct = Math.round((data.passing / data.total) * 100);
|
|
219
|
+
const color = catPct === 100 ? colors.green : catPct > 50 ? colors.yellow : colors.red;
|
|
220
|
+
log(` ${cat}: ${data.passing}/${data.total} (${catPct}%)`, color);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
log('\n' + 'ā'.repeat(50), colors.dim);
|
|
225
|
+
log(' Run "monty code" to continue development', colors.dim);
|
|
226
|
+
} catch (err) {
|
|
227
|
+
log(`\nā Error reading feature list: ${err.message}`, colors.red);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
async function setupInDirectory() {
|
|
232
|
+
const cwd = process.cwd();
|
|
233
|
+
showBanner();
|
|
234
|
+
|
|
235
|
+
log('\nš Setting up Monty in current directory...', colors.cyan);
|
|
236
|
+
log(` Directory: ${cwd}`, colors.dim);
|
|
237
|
+
|
|
238
|
+
// Check if already initialized
|
|
239
|
+
if (existsSync(join(cwd, '.agent'))) {
|
|
240
|
+
log('\nā
Project already initialized!', colors.green);
|
|
241
|
+
log(' Run "monty code" to continue development.', colors.dim);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Check for package.json
|
|
246
|
+
if (!existsSync(join(cwd, 'package.json'))) {
|
|
247
|
+
log('\nā ļø No package.json found.', colors.yellow);
|
|
248
|
+
log(' This appears to be a new project.', colors.dim);
|
|
249
|
+
log(' Run: monty init --spec="Your project idea..."', colors.dim);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
log('\nā
Ready to initialize!', colors.green);
|
|
254
|
+
log(' Run: monty init --spec="Your project specification..."', colors.dim);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// To avoid duplicating logic in CLI and potentially having sync issues,
|
|
258
|
+
// we will delegate auth commands to a script that uses the full AuthManager
|
|
259
|
+
async function runAuthCommand(command) {
|
|
260
|
+
const distPath = join(__dirname, '..', 'dist', 'index.js');
|
|
261
|
+
const srcPath = join(__dirname, '..', 'src', 'index.ts');
|
|
262
|
+
|
|
263
|
+
let entryPoint;
|
|
264
|
+
let runner;
|
|
265
|
+
let runnerArgs;
|
|
266
|
+
|
|
267
|
+
if (existsSync(distPath)) {
|
|
268
|
+
entryPoint = distPath;
|
|
269
|
+
runner = 'node';
|
|
270
|
+
runnerArgs = [entryPoint];
|
|
271
|
+
} else if (existsSync(srcPath)) {
|
|
272
|
+
entryPoint = srcPath;
|
|
273
|
+
runner = 'npx';
|
|
274
|
+
runnerArgs = ['tsx', entryPoint];
|
|
275
|
+
} else {
|
|
276
|
+
log('ā Error: Could not find entry point.', colors.red);
|
|
277
|
+
process.exit(1);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// We use the main entry point with specific flags to trigger auth manager logic
|
|
281
|
+
// This ensures we use the robust AuthManager implementation we just wrote
|
|
282
|
+
const child = spawn(runner, [...runnerArgs, `--${command}`], {
|
|
283
|
+
stdio: 'inherit',
|
|
284
|
+
cwd: process.cwd(),
|
|
285
|
+
env: process.env,
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
return new Promise((resolve) => {
|
|
289
|
+
child.on('close', (code) => {
|
|
290
|
+
resolve(code);
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Check auth status by reading file directly (fast check for CLI)
|
|
296
|
+
function checkAuthStatus() {
|
|
297
|
+
if (process.env[AUTH_CONFIG.envVars.API_KEY] || process.env[AUTH_CONFIG.envVars.SUBSCRIPTION_KEY]) {
|
|
298
|
+
return true;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
try {
|
|
302
|
+
if (existsSync(AUTH_CONFIG.credentialsPath)) {
|
|
303
|
+
const data = readFileSync(AUTH_CONFIG.credentialsPath, 'utf-8');
|
|
304
|
+
const creds = JSON.parse(data);
|
|
305
|
+
return !!(creds.apiKey || creds.subscriptionKey);
|
|
306
|
+
}
|
|
307
|
+
} catch (e) {
|
|
308
|
+
// Ignore
|
|
309
|
+
}
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Get API key for environment injection
|
|
314
|
+
function getApiKey() {
|
|
315
|
+
if (process.env[AUTH_CONFIG.envVars.SUBSCRIPTION_KEY]) return process.env[AUTH_CONFIG.envVars.SUBSCRIPTION_KEY];
|
|
316
|
+
if (process.env[AUTH_CONFIG.envVars.API_KEY]) return process.env[AUTH_CONFIG.envVars.API_KEY];
|
|
317
|
+
|
|
318
|
+
try {
|
|
319
|
+
if (existsSync(AUTH_CONFIG.credentialsPath)) {
|
|
320
|
+
const data = readFileSync(AUTH_CONFIG.credentialsPath, 'utf-8');
|
|
321
|
+
const creds = JSON.parse(data);
|
|
322
|
+
return creds.subscriptionKey || creds.apiKey;
|
|
323
|
+
}
|
|
324
|
+
} catch (e) {}
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function getAuthEnv() {
|
|
329
|
+
const env = { ...process.env };
|
|
330
|
+
const apiKey = getApiKey();
|
|
331
|
+
if (apiKey && !env[AUTH_CONFIG.envVars.API_KEY]) {
|
|
332
|
+
env[AUTH_CONFIG.envVars.API_KEY] = apiKey;
|
|
333
|
+
}
|
|
334
|
+
return env;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
async function main() {
|
|
338
|
+
const args = process.argv.slice(2);
|
|
339
|
+
|
|
340
|
+
// Handle help
|
|
341
|
+
if (args.includes('--help') || args.includes('-h') || (args.length === 0 && !existsSync(join(process.cwd(), '.agent')))) {
|
|
342
|
+
showHelp();
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// Handle version
|
|
347
|
+
if (args.includes('--version') || args.includes('-v')) {
|
|
348
|
+
showVersion();
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// Handle status
|
|
353
|
+
if (args.includes('status')) {
|
|
354
|
+
showStatus();
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// Handle setup
|
|
359
|
+
if (args.includes('setup')) {
|
|
360
|
+
await setupInDirectory();
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// Handle auth commands by delegating to the main app
|
|
365
|
+
// This ensures we use the full AuthManager logic
|
|
366
|
+
if (args.includes('login')) {
|
|
367
|
+
await runAuthCommand('login');
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
if (args.includes('logout')) {
|
|
372
|
+
await runAuthCommand('logout');
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
if (args.includes('whoami')) {
|
|
377
|
+
await runAuthCommand('whoami');
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
// Check authentication before running agent commands
|
|
382
|
+
if (!checkAuthStatus()) {
|
|
383
|
+
log('\n' + 'ā'.repeat(50), colors.dim);
|
|
384
|
+
log('Authentication required', colors.yellow);
|
|
385
|
+
log('ā'.repeat(50), colors.dim);
|
|
386
|
+
log('\nYou need to authenticate before running the agent.', colors.white);
|
|
387
|
+
log('\nOptions:', colors.white);
|
|
388
|
+
log(' 1. Run "monty login" to sign in interactively', colors.cyan);
|
|
389
|
+
log(` 2. Set ${AUTH_CONFIG.envVars.API_KEY} environment variable`, colors.cyan);
|
|
390
|
+
log(` 3. Set ${AUTH_CONFIG.envVars.SUBSCRIPTION_KEY} environment variable\n`, colors.cyan);
|
|
391
|
+
process.exit(1);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// Determine the main entry point
|
|
395
|
+
const distPath = join(__dirname, '..', 'dist', 'index.js');
|
|
396
|
+
const srcPath = join(__dirname, '..', 'src', 'index.ts');
|
|
397
|
+
|
|
398
|
+
let entryPoint;
|
|
399
|
+
let runner;
|
|
400
|
+
let runnerArgs;
|
|
401
|
+
|
|
402
|
+
if (existsSync(distPath)) {
|
|
403
|
+
entryPoint = distPath;
|
|
404
|
+
runner = 'node';
|
|
405
|
+
runnerArgs = [entryPoint, ...args];
|
|
406
|
+
} else if (existsSync(srcPath)) {
|
|
407
|
+
// Development mode - use tsx
|
|
408
|
+
entryPoint = srcPath;
|
|
409
|
+
runner = 'npx';
|
|
410
|
+
runnerArgs = ['tsx', entryPoint, ...args];
|
|
411
|
+
} else {
|
|
412
|
+
log('ā Error: Could not find entry point.', colors.red);
|
|
413
|
+
log(' Please run "npm run build" first.', colors.dim);
|
|
414
|
+
process.exit(1);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// Map subcommands to flags
|
|
418
|
+
const commandMap = {
|
|
419
|
+
'init': '--init',
|
|
420
|
+
'code': '--code',
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
// Transform args if needed
|
|
424
|
+
const transformedArgs = args.map(arg => commandMap[arg] || arg);
|
|
425
|
+
|
|
426
|
+
showBanner();
|
|
427
|
+
|
|
428
|
+
// Run the main agent with authenticated environment
|
|
429
|
+
const child = spawn(runner, [...runnerArgs.slice(0, 1), ...transformedArgs.filter(a => !['init', 'code', 'status', 'setup', 'login', 'logout', 'whoami'].includes(a))], {
|
|
430
|
+
stdio: 'inherit',
|
|
431
|
+
cwd: process.cwd(),
|
|
432
|
+
env: getAuthEnv(),
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
child.on('error', (err) => {
|
|
436
|
+
log(`ā Error: ${err.message}`, colors.red);
|
|
437
|
+
process.exit(1);
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
child.on('close', (code) => {
|
|
441
|
+
process.exit(code || 0);
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
main().catch((err) => {
|
|
446
|
+
console.error('Fatal error:', err);
|
|
447
|
+
process.exit(1);
|
|
448
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coding Agent
|
|
3
|
+
* Runs on every session after initialization to make incremental progress.
|
|
4
|
+
* Based on Anthropic's best practices for long-running agents.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Build the complete prompt for the coding agent
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildCodingPrompt(additionalContext?: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Run the coding agent
|
|
12
|
+
*/
|
|
13
|
+
export declare function runCodingAgent(additionalContext?: string): Promise<void>;
|
|
14
|
+
export default runCodingAgent;
|
|
15
|
+
//# sourceMappingURL=coding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding.d.ts","sourceRoot":"","sources":["../../src/agents/coding.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsEH;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,CA4EpE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyC9E;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coding Agent
|
|
3
|
+
* Runs on every session after initialization to make incremental progress.
|
|
4
|
+
* Based on Anthropic's best practices for long-running agents.
|
|
5
|
+
*/
|
|
6
|
+
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
7
|
+
import { readFileSync, existsSync } from "fs";
|
|
8
|
+
import { join, dirname } from "path";
|
|
9
|
+
import { fileURLToPath } from "url";
|
|
10
|
+
import { agentConfig } from "../config/agent-config.js";
|
|
11
|
+
import { getBrowserInstructions } from "../config/mcp-config.js";
|
|
12
|
+
import { getSetupSummary } from "../utils/supabase-setup.js";
|
|
13
|
+
import { generateProjectSummary } from "../utils/project-detection.js";
|
|
14
|
+
import { generateQualitySummary } from "../utils/code-quality.js";
|
|
15
|
+
import { generateDependencySummary } from "../utils/dependency-management.js";
|
|
16
|
+
import { generateGitSummary } from "../utils/git-utils.js";
|
|
17
|
+
import { generateErrorRecoverySummary } from "../utils/error-recovery.js";
|
|
18
|
+
import { generateEnvironmentSummary } from "../utils/environment-validation.js";
|
|
19
|
+
import { generateHealthSummary } from "../utils/health-check.js";
|
|
20
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
21
|
+
const __dirname = dirname(__filename);
|
|
22
|
+
/**
|
|
23
|
+
* Load the coding agent system prompt from markdown file
|
|
24
|
+
*/
|
|
25
|
+
function loadCodingPrompt() {
|
|
26
|
+
const promptPath = join(__dirname, "prompts", "coding.md");
|
|
27
|
+
return readFileSync(promptPath, "utf-8");
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get current progress summary from progress file
|
|
31
|
+
*/
|
|
32
|
+
function getProgressSummary() {
|
|
33
|
+
const progressPath = agentConfig.paths.progressFile;
|
|
34
|
+
if (!existsSync(progressPath)) {
|
|
35
|
+
return "No progress file found. This may indicate an incomplete initialization.";
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
const content = readFileSync(progressPath, "utf-8");
|
|
39
|
+
// Return first 50 lines as a summary
|
|
40
|
+
const lines = content.split("\n").slice(0, 50);
|
|
41
|
+
return lines.join("\n");
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return "Error reading progress file.";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get feature list summary
|
|
49
|
+
*/
|
|
50
|
+
function getFeatureSummary() {
|
|
51
|
+
const featurePath = agentConfig.paths.featureList;
|
|
52
|
+
if (!existsSync(featurePath)) {
|
|
53
|
+
return "No feature list found. Run initialization first.";
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const content = readFileSync(featurePath, "utf-8");
|
|
57
|
+
const data = JSON.parse(content);
|
|
58
|
+
const total = data.features?.length ?? 0;
|
|
59
|
+
const passing = data.features?.filter((f) => f.passes).length ?? 0;
|
|
60
|
+
return `Features: ${passing}/${total} passing`;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return "Error reading feature list.";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Build the complete prompt for the coding agent
|
|
68
|
+
*/
|
|
69
|
+
export function buildCodingPrompt(additionalContext) {
|
|
70
|
+
const systemPrompt = loadCodingPrompt();
|
|
71
|
+
const browserInstructions = getBrowserInstructions();
|
|
72
|
+
const progressSummary = getProgressSummary();
|
|
73
|
+
const featureSummary = getFeatureSummary();
|
|
74
|
+
// Get all status summaries
|
|
75
|
+
const supabaseSummary = getSetupSummary();
|
|
76
|
+
const projectSummary = generateProjectSummary();
|
|
77
|
+
const qualitySummary = generateQualitySummary();
|
|
78
|
+
const dependencySummary = generateDependencySummary();
|
|
79
|
+
const gitSummary = generateGitSummary();
|
|
80
|
+
const errorRecoverySummary = generateErrorRecoverySummary();
|
|
81
|
+
const environmentSummary = generateEnvironmentSummary();
|
|
82
|
+
const healthSummary = generateHealthSummary();
|
|
83
|
+
let prompt = `${systemPrompt}
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
${browserInstructions}
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## WORKING DIRECTORY
|
|
92
|
+
|
|
93
|
+
You are working in: ${agentConfig.paths.projectRoot}
|
|
94
|
+
All file paths should be relative to this directory.
|
|
95
|
+
|
|
96
|
+
CRITICAL SESSION RULES:
|
|
97
|
+
- Do NOT use KillShell or attempt to terminate background processes
|
|
98
|
+
- Do NOT use TaskOutput for shell management
|
|
99
|
+
- Let the harness handle cleanup automatically
|
|
100
|
+
- End your session naturally after providing a summary
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## CURRENT PROJECT STATE
|
|
105
|
+
|
|
106
|
+
**Progress Summary:**
|
|
107
|
+
${progressSummary}
|
|
108
|
+
|
|
109
|
+
**Feature Status:** ${featureSummary}
|
|
110
|
+
${supabaseSummary}
|
|
111
|
+
${projectSummary}
|
|
112
|
+
${qualitySummary}
|
|
113
|
+
${dependencySummary}
|
|
114
|
+
${gitSummary}
|
|
115
|
+
${errorRecoverySummary}
|
|
116
|
+
${environmentSummary}
|
|
117
|
+
${healthSummary}
|
|
118
|
+
|
|
119
|
+
## PATHS
|
|
120
|
+
|
|
121
|
+
- Feature list: ${agentConfig.paths.featureList}
|
|
122
|
+
- Progress file: ${agentConfig.paths.progressFile}
|
|
123
|
+
- Init script (Windows): scripts/init.ps1
|
|
124
|
+
- Init script (Unix): scripts/init.sh
|
|
125
|
+
`;
|
|
126
|
+
if (additionalContext) {
|
|
127
|
+
prompt += `
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## ADDITIONAL CONTEXT FROM USER
|
|
131
|
+
|
|
132
|
+
${additionalContext}
|
|
133
|
+
`;
|
|
134
|
+
}
|
|
135
|
+
prompt += `
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
Begin the development session now. Follow the startup sequence.`;
|
|
139
|
+
return prompt;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Run the coding agent
|
|
143
|
+
*/
|
|
144
|
+
export async function runCodingAgent(additionalContext) {
|
|
145
|
+
const prompt = buildCodingPrompt(additionalContext);
|
|
146
|
+
console.log("šØ Starting Coding Agent Session...");
|
|
147
|
+
console.log("ā".repeat(50));
|
|
148
|
+
console.log(getFeatureSummary());
|
|
149
|
+
console.log("ā".repeat(50));
|
|
150
|
+
for await (const message of query({
|
|
151
|
+
prompt,
|
|
152
|
+
options: {
|
|
153
|
+
allowedTools: agentConfig.tools.coding,
|
|
154
|
+
permissionMode: agentConfig.permissionMode,
|
|
155
|
+
// Explicitly pass credentials to SDK subprocess
|
|
156
|
+
env: {
|
|
157
|
+
ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY || undefined,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
})) {
|
|
161
|
+
if (message.type === "assistant" && message.message?.content) {
|
|
162
|
+
for (const block of message.message.content) {
|
|
163
|
+
if ("text" in block) {
|
|
164
|
+
console.log(block.text);
|
|
165
|
+
}
|
|
166
|
+
else if ("name" in block) {
|
|
167
|
+
console.log(`\nš§ Tool: ${block.name}\n`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
else if (message.type === "result") {
|
|
172
|
+
console.log("\n" + "ā".repeat(50));
|
|
173
|
+
if (message.subtype === "success") {
|
|
174
|
+
console.log("ā
Session completed successfully");
|
|
175
|
+
}
|
|
176
|
+
else if (message.subtype === "error_during_execution") {
|
|
177
|
+
console.log("ā ļø Session ended with errors - check logs above");
|
|
178
|
+
console.log(" Note: This may be due to background process cleanup.");
|
|
179
|
+
console.log(" If features were verified, the work was still saved.");
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
console.log(`ā¹ļø Session ended: ${message.subtype}`);
|
|
183
|
+
}
|
|
184
|
+
console.log(getFeatureSummary());
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
export default runCodingAgent;
|
|
189
|
+
//# sourceMappingURL=coding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding.js","sourceRoot":"","sources":["../../src/agents/coding.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,C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1
|
+
/**
|
|
2
|
+
* Initializer Agent
|
|
3
|
+
* Runs on first execution to set up the project environment.
|
|
4
|
+
* Based on Anthropic's best practices for long-running agents.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Build the complete prompt for the initializer agent
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildInitializerPrompt(userSpec: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Run the initializer agent
|
|
12
|
+
*/
|
|
13
|
+
export declare function runInitializerAgent(userSpec: string): Promise<void>;
|
|
14
|
+
export default runInitializerAgent;
|
|
15
|
+
//# sourceMappingURL=initializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initializer.d.ts","sourceRoot":"","sources":["../../src/agents/initializer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmBH;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA6B/D;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BzE;AAED,eAAe,mBAAmB,CAAC"}
|