@kosuke-ai/cli 0.0.36 → 0.0.38
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/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -84
- package/dist/index.js.map +1 -1
- package/dist/kosuke/commands/build.d.ts +7 -3
- package/dist/kosuke/commands/build.d.ts.map +1 -1
- package/dist/kosuke/commands/build.js +53 -16
- package/dist/kosuke/commands/build.js.map +1 -1
- package/dist/kosuke/commands/ship.d.ts +22 -15
- package/dist/kosuke/commands/ship.d.ts.map +1 -1
- package/dist/kosuke/commands/ship.js +49 -151
- package/dist/kosuke/commands/ship.js.map +1 -1
- package/dist/kosuke/commands/test.d.ts +2 -1
- package/dist/kosuke/commands/test.d.ts.map +1 -1
- package/dist/kosuke/commands/test.js +75 -23
- package/dist/kosuke/commands/test.js.map +1 -1
- package/dist/kosuke/commands/tickets.d.ts.map +1 -1
- package/dist/kosuke/commands/tickets.js +278 -109
- package/dist/kosuke/commands/tickets.js.map +1 -1
- package/dist/kosuke/types.d.ts +30 -9
- package/dist/kosuke/types.d.ts.map +1 -1
- package/dist/kosuke/utils/prompt-generator.d.ts +0 -4
- package/dist/kosuke/utils/prompt-generator.d.ts.map +1 -1
- package/dist/kosuke/utils/prompt-generator.js +0 -14
- package/dist/kosuke/utils/prompt-generator.js.map +1 -1
- package/dist/kosuke/utils/test-runner.d.ts +15 -0
- package/dist/kosuke/utils/test-runner.d.ts.map +1 -0
- package/dist/kosuke/utils/test-runner.js +94 -0
- package/dist/kosuke/utils/test-runner.js.map +1 -0
- package/dist/lib.d.ts +29 -2
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +28 -1
- package/dist/lib.js.map +1 -1
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/kosuke/utils/browser-agent.d.ts +0 -33
- package/dist/kosuke/utils/browser-agent.d.ts.map +0 -1
- package/dist/kosuke/utils/browser-agent.js +0 -102
- package/dist/kosuke/utils/browser-agent.js.map +0 -1
|
@@ -1,26 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Ship
|
|
2
|
+
* Ship Core - Ticket-agnostic implementation engine
|
|
3
3
|
*
|
|
4
|
-
* This
|
|
5
|
-
*
|
|
4
|
+
* This module provides the core implementation logic for tickets.
|
|
5
|
+
* It is designed to be called programmatically with ticket data,
|
|
6
|
+
* making it independent of tickets.json or any ticket management system.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Implements tickets following CLAUDE.md rules
|
|
10
|
+
* - Runs comprehensive linting
|
|
11
|
+
* - Optionally performs code review with ticket context
|
|
12
|
+
* - Does NOT manage ticket lifecycle (status updates, commits, etc.)
|
|
8
13
|
*
|
|
9
|
-
* Usage:
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
14
|
+
* Usage (Programmatic):
|
|
15
|
+
* import { shipCore } from './commands/ship.js';
|
|
16
|
+
*
|
|
17
|
+
* const result = await shipCore({
|
|
18
|
+
* ticketData: { id: 'SCHEMA-1', title: '...', description: '...' },
|
|
19
|
+
* review: true,
|
|
20
|
+
* directory: './my-project',
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* Note: The CLI command 'kosuke ship' is deprecated.
|
|
24
|
+
* Use 'kosuke build' instead for complete ticket workflow.
|
|
15
25
|
*/
|
|
16
26
|
import { existsSync, statSync } from 'fs';
|
|
17
|
-
import {
|
|
27
|
+
import { resolve } from 'path';
|
|
18
28
|
import { formatCostBreakdown, runAgent } from '../utils/claude-agent.js';
|
|
19
|
-
import { logger, setupCancellationHandler } from '../utils/logger.js';
|
|
20
|
-
import { findTicket, loadTicketsFile, updateTicketStatus } from '../utils/tickets-manager.js';
|
|
21
29
|
import { runComprehensiveLinting } from '../utils/validator.js';
|
|
22
30
|
import { reviewCore } from './review.js';
|
|
23
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Validate ticket data has all required fields
|
|
33
|
+
*/
|
|
34
|
+
function validateTicketData(ticketData) {
|
|
35
|
+
if (!ticketData.id || typeof ticketData.id !== 'string') {
|
|
36
|
+
throw new Error('Invalid ticket: id is required and must be a string');
|
|
37
|
+
}
|
|
38
|
+
if (!ticketData.title || typeof ticketData.title !== 'string') {
|
|
39
|
+
throw new Error('Invalid ticket: title is required and must be a string');
|
|
40
|
+
}
|
|
41
|
+
if (!ticketData.description || typeof ticketData.description !== 'string') {
|
|
42
|
+
throw new Error('Invalid ticket: description is required and must be a string');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
24
45
|
/**
|
|
25
46
|
* Build system prompt for ticket implementation
|
|
26
47
|
*/
|
|
@@ -72,17 +93,21 @@ ${ticket.description}
|
|
|
72
93
|
Begin by exploring the current codebase, then implement the ticket systematically.`;
|
|
73
94
|
}
|
|
74
95
|
/**
|
|
75
|
-
* Core ship logic (
|
|
96
|
+
* Core ship logic (ticket-agnostic, reusable)
|
|
97
|
+
* Implements a ticket without managing its lifecycle (status updates, etc.)
|
|
76
98
|
*/
|
|
77
99
|
export async function shipCore(options) {
|
|
78
|
-
|
|
100
|
+
// Validate ticket data
|
|
101
|
+
validateTicketData(options.ticketData);
|
|
102
|
+
const ticket = options.ticketData;
|
|
103
|
+
const { review = false, directory, dbUrl = 'postgres://postgres:postgres@localhost:5432/postgres', } = options;
|
|
79
104
|
// 1. Validate and resolve directory
|
|
80
105
|
const cwd = directory ? resolve(directory) : process.cwd();
|
|
81
106
|
if (directory) {
|
|
82
107
|
if (!existsSync(cwd)) {
|
|
83
108
|
throw new Error(`Directory not found: ${cwd}\n` +
|
|
84
109
|
`Please provide a valid directory using --directory=<path>\n` +
|
|
85
|
-
`Example:
|
|
110
|
+
`Example: shipCore({ ticketData: ticket, directory: './my-project' })`);
|
|
86
111
|
}
|
|
87
112
|
const stats = statSync(cwd);
|
|
88
113
|
if (!stats.isDirectory()) {
|
|
@@ -90,26 +115,7 @@ export async function shipCore(options) {
|
|
|
90
115
|
}
|
|
91
116
|
console.log(`📁 Using project directory: ${cwd}\n`);
|
|
92
117
|
}
|
|
93
|
-
|
|
94
|
-
// 1. Load and validate ticket
|
|
95
|
-
console.log('📋 Loading ticket...');
|
|
96
|
-
const ticketsData = loadTicketsFile(ticketsPath);
|
|
97
|
-
const ticket = findTicket(ticketsData, ticketId);
|
|
98
|
-
if (!ticket) {
|
|
99
|
-
throw new Error(`Ticket ${ticketId} not found in ${ticketsFile}\n` +
|
|
100
|
-
`Available tickets: ${ticketsData.tickets.map((t) => t.id).join(', ')}`);
|
|
101
|
-
}
|
|
102
|
-
if (ticket.status === 'Done') {
|
|
103
|
-
throw new Error(`Ticket ${ticketId} is already marked as Done.\n` +
|
|
104
|
-
`If you want to re-implement it, manually change its status to "Todo" in ${ticketsFile}`);
|
|
105
|
-
}
|
|
106
|
-
console.log(` ✅ Loaded ticket: ${ticket.id} - ${ticket.title}\n`);
|
|
107
|
-
// 2. Update status to InProgress
|
|
108
|
-
console.log('📝 Updating ticket status to InProgress...');
|
|
109
|
-
updateTicketStatus(ticketsPath, ticketId, 'InProgress');
|
|
110
|
-
console.log(' ✅ Status updated\n');
|
|
111
|
-
// 3. Context ready (using current working directory)
|
|
112
|
-
console.log('📁 Working in current directory context\n');
|
|
118
|
+
console.log(`📋 Implementing ticket: ${ticket.id} - ${ticket.title}\n`);
|
|
113
119
|
// Determine ticket type
|
|
114
120
|
const isSchemaTicket = ticket.id.toUpperCase().startsWith('SCHEMA-');
|
|
115
121
|
// Track metrics
|
|
@@ -121,12 +127,12 @@ export async function shipCore(options) {
|
|
|
121
127
|
let implementationFixCount = 0;
|
|
122
128
|
let reviewFixCount = 0;
|
|
123
129
|
try {
|
|
124
|
-
//
|
|
130
|
+
// 2. Implementation phase
|
|
125
131
|
console.log(`\n${'='.repeat(60)}`);
|
|
126
132
|
console.log(`🚀 Phase 1: Implementation`);
|
|
127
133
|
console.log(`${'='.repeat(60)}\n`);
|
|
128
134
|
const systemPrompt = buildImplementationPrompt(ticket, dbUrl);
|
|
129
|
-
const implementationResult = await runAgent(`Implement ticket ${
|
|
135
|
+
const implementationResult = await runAgent(`Implement ticket ${ticket.id}: ${ticket.title}`, {
|
|
130
136
|
systemPrompt,
|
|
131
137
|
cwd,
|
|
132
138
|
maxTurns: 40,
|
|
@@ -140,13 +146,13 @@ export async function shipCore(options) {
|
|
|
140
146
|
totalCost += implementationResult.cost;
|
|
141
147
|
console.log(`\n✨ Implementation completed (${implementationFixCount} changes made)`);
|
|
142
148
|
console.log(`💰 Implementation cost: ${formatCostBreakdown(implementationResult)}`);
|
|
143
|
-
//
|
|
149
|
+
// 3. Linting phase
|
|
144
150
|
console.log(`\n${'='.repeat(60)}`);
|
|
145
151
|
console.log(`🔧 Phase 2: Linting & Quality Checks`);
|
|
146
152
|
console.log(`${'='.repeat(60)}\n`);
|
|
147
153
|
const lintResult = await runComprehensiveLinting(cwd);
|
|
148
154
|
console.log(`\n✅ Linting completed (${lintResult.fixCount} fixes applied)`);
|
|
149
|
-
//
|
|
155
|
+
// 4. Review phase (if review flag is set) - SKIP for SCHEMA tickets
|
|
150
156
|
if (review && !isSchemaTicket) {
|
|
151
157
|
console.log(`\n${'='.repeat(60)}`);
|
|
152
158
|
console.log(`🔍 Phase 3: Code Review (Git Diff)`);
|
|
@@ -170,70 +176,8 @@ export async function shipCore(options) {
|
|
|
170
176
|
else if (review && isSchemaTicket) {
|
|
171
177
|
console.log('\nℹ️ Skipping code review for SCHEMA ticket (review focuses on application code, not database migrations)');
|
|
172
178
|
}
|
|
173
|
-
//
|
|
174
|
-
let testFixCount = 0;
|
|
175
|
-
let testIterations = 0;
|
|
176
|
-
const maxTestRetries = 3;
|
|
177
|
-
if (test) {
|
|
178
|
-
console.log(`\n${'='.repeat(60)}`);
|
|
179
|
-
console.log(`🧪 Phase ${review ? '4' : '3'}: Testing (Iterative)`);
|
|
180
|
-
console.log(`${'='.repeat(60)}\n`);
|
|
181
|
-
let testsPassing = false;
|
|
182
|
-
for (let attempt = 1; attempt <= maxTestRetries; attempt++) {
|
|
183
|
-
testIterations = attempt;
|
|
184
|
-
console.log(`\n🧪 Test Attempt ${attempt}/${maxTestRetries}\n`);
|
|
185
|
-
// Run atomic test
|
|
186
|
-
const testResult = await testCore({
|
|
187
|
-
ticket: ticketId,
|
|
188
|
-
url: options.url,
|
|
189
|
-
headed: options.headed,
|
|
190
|
-
debug: options.debug,
|
|
191
|
-
ticketsFile,
|
|
192
|
-
directory: cwd,
|
|
193
|
-
});
|
|
194
|
-
totalInputTokens += testResult.tokensUsed.input;
|
|
195
|
-
totalOutputTokens += testResult.tokensUsed.output;
|
|
196
|
-
totalCacheCreationTokens += testResult.tokensUsed.cacheCreation;
|
|
197
|
-
totalCacheReadTokens += testResult.tokensUsed.cacheRead;
|
|
198
|
-
totalCost += testResult.cost;
|
|
199
|
-
if (testResult.success) {
|
|
200
|
-
testsPassing = true;
|
|
201
|
-
console.log('\n✅ Tests passed!');
|
|
202
|
-
break;
|
|
203
|
-
}
|
|
204
|
-
// If not last attempt, analyze and fix
|
|
205
|
-
if (attempt < maxTestRetries) {
|
|
206
|
-
console.log('\n🔍 Analyzing test failures...');
|
|
207
|
-
// Collect Docker logs for backend debugging
|
|
208
|
-
const { LogCollector } = await import('../utils/log-collector.js');
|
|
209
|
-
const logCollector = new LogCollector();
|
|
210
|
-
await logCollector.collectDockerLogs('30s');
|
|
211
|
-
const dockerLogs = logCollector.getErrors();
|
|
212
|
-
// Analyze errors and apply fixes
|
|
213
|
-
const { analyzeAndFix } = await import('../utils/error-analyzer.js');
|
|
214
|
-
const fixResult = await analyzeAndFix(ticket, testResult.output, testResult.logs, dockerLogs, cwd);
|
|
215
|
-
testFixCount += fixResult.fixesApplied;
|
|
216
|
-
totalInputTokens += fixResult.tokensUsed.input;
|
|
217
|
-
totalOutputTokens += fixResult.tokensUsed.output;
|
|
218
|
-
totalCacheCreationTokens += fixResult.tokensUsed.cacheCreation;
|
|
219
|
-
totalCacheReadTokens += fixResult.tokensUsed.cacheRead;
|
|
220
|
-
totalCost += fixResult.cost;
|
|
221
|
-
console.log(`\n🔧 Applied ${fixResult.fixesApplied} fixes`);
|
|
222
|
-
console.log(`💰 Fix cost: $${fixResult.cost.toFixed(4)}`);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
if (!testsPassing) {
|
|
226
|
-
throw new Error(`Tests failed after ${maxTestRetries} attempts`);
|
|
227
|
-
}
|
|
228
|
-
console.log(`\n✨ Testing completed (${testFixCount} fixes applied over ${testIterations} iterations)`);
|
|
229
|
-
console.log(`💰 Testing cost: $${totalCost.toFixed(4)}`);
|
|
230
|
-
}
|
|
231
|
-
// 9. Update status to Done
|
|
232
|
-
console.log('\n📝 Updating ticket status to Done...');
|
|
233
|
-
updateTicketStatus(ticketsPath, ticketId, 'Done');
|
|
234
|
-
console.log(' ✅ Ticket marked as Done\n');
|
|
179
|
+
// 5. Return success result
|
|
235
180
|
return {
|
|
236
|
-
ticketId,
|
|
237
181
|
success: true,
|
|
238
182
|
implementationFixCount,
|
|
239
183
|
lintFixCount: lintResult.fixCount,
|
|
@@ -248,12 +192,10 @@ export async function shipCore(options) {
|
|
|
248
192
|
};
|
|
249
193
|
}
|
|
250
194
|
catch (error) {
|
|
251
|
-
//
|
|
195
|
+
// Return error result
|
|
252
196
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
253
197
|
console.error(`\n❌ Implementation failed: ${errorMessage}`);
|
|
254
|
-
updateTicketStatus(ticketsPath, ticketId, 'Error', errorMessage);
|
|
255
198
|
return {
|
|
256
|
-
ticketId,
|
|
257
199
|
success: false,
|
|
258
200
|
implementationFixCount,
|
|
259
201
|
lintFixCount: 0,
|
|
@@ -269,48 +211,4 @@ export async function shipCore(options) {
|
|
|
269
211
|
};
|
|
270
212
|
}
|
|
271
213
|
}
|
|
272
|
-
/**
|
|
273
|
-
* Main ship command
|
|
274
|
-
*/
|
|
275
|
-
export async function shipCommand(options) {
|
|
276
|
-
const { ticket: ticketId, noLogs = false } = options;
|
|
277
|
-
console.log(`🚢 Shipping Ticket: ${ticketId}\n`);
|
|
278
|
-
// Initialize logging context
|
|
279
|
-
const logContext = logger.createContext('ship', { noLogs });
|
|
280
|
-
const cleanupHandler = setupCancellationHandler(logContext);
|
|
281
|
-
try {
|
|
282
|
-
// Validate environment
|
|
283
|
-
if (!process.env.ANTHROPIC_API_KEY) {
|
|
284
|
-
throw new Error('ANTHROPIC_API_KEY environment variable is required');
|
|
285
|
-
}
|
|
286
|
-
// Run core implementation
|
|
287
|
-
const result = await shipCore(options);
|
|
288
|
-
if (!result.success) {
|
|
289
|
-
throw new Error(result.error || 'Ship failed');
|
|
290
|
-
}
|
|
291
|
-
// Track metrics
|
|
292
|
-
logger.trackTokens(logContext, result.tokensUsed);
|
|
293
|
-
logContext.fixesApplied =
|
|
294
|
-
result.implementationFixCount + result.lintFixCount + result.reviewFixCount;
|
|
295
|
-
// Display summary
|
|
296
|
-
console.log('\n✅ Ship completed successfully!');
|
|
297
|
-
console.log(`📊 Implementation fixes: ${result.implementationFixCount}`);
|
|
298
|
-
console.log(`🔧 Linting fixes: ${result.lintFixCount}`);
|
|
299
|
-
if (result.reviewFixCount > 0) {
|
|
300
|
-
console.log(`🔍 Review fixes: ${result.reviewFixCount}`);
|
|
301
|
-
}
|
|
302
|
-
console.log(`💰 Total cost: $${result.cost.toFixed(4)}`);
|
|
303
|
-
console.log('\nℹ️ Changes applied locally. Commits are handled by the build command.');
|
|
304
|
-
// Log successful execution
|
|
305
|
-
await logger.complete(logContext, 'success');
|
|
306
|
-
cleanupHandler();
|
|
307
|
-
}
|
|
308
|
-
catch (error) {
|
|
309
|
-
console.error('\n❌ Ship failed:', error);
|
|
310
|
-
// Log failed execution
|
|
311
|
-
await logger.complete(logContext, 'error', error);
|
|
312
|
-
cleanupHandler();
|
|
313
|
-
throw error;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
214
|
//# sourceMappingURL=ship.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ship.js","sourceRoot":"","sources":["../../../kosuke/commands/ship.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ship.js","sourceRoot":"","sources":["../../../kosuke/commands/ship.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,SAAS,kBAAkB,CAAC,UAAkB;IAC5C,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,OAAO,UAAU,CAAC,EAAE,KAAK,QAAQ,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,KAAK,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9D,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,WAAW,IAAI,OAAO,UAAU,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QAC1E,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAClF,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,yBAAyB,CAAC,MAAc,EAAE,KAAa;IAC9D,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAErE,MAAM,2BAA2B,GAAG,cAAc;QAChD,CAAC,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FRONTEND-1 # Test with ticket
|
|
14
14
|
* kosuke test --prompt="Test user login flow" # Test with custom prompt
|
|
15
15
|
* kosuke test --ticket=FRONTEND-1 --url=http://localhost:4000
|
|
16
|
-
* kosuke test --prompt="..." --
|
|
16
|
+
* kosuke test --prompt="..." --verbose # Enable verbose output
|
|
17
|
+
* kosuke test --prompt="..." --headless # Run in headless mode (invisible)
|
|
17
18
|
*/
|
|
18
19
|
import type { TestOptions, TestResult } from '../types.js';
|
|
19
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../kosuke/commands/test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../kosuke/commands/test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAU,MAAM,aAAa,CAAC;AAKnE;;GAEG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CA+JxE;AAuBD;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAuCrE"}
|
|
@@ -13,18 +13,19 @@
|
|
|
13
13
|
* kosuke test --ticket=FRONTEND-1 # Test with ticket
|
|
14
14
|
* kosuke test --prompt="Test user login flow" # Test with custom prompt
|
|
15
15
|
* kosuke test --ticket=FRONTEND-1 --url=http://localhost:4000
|
|
16
|
-
* kosuke test --prompt="..." --
|
|
16
|
+
* kosuke test --prompt="..." --verbose # Enable verbose output
|
|
17
|
+
* kosuke test --prompt="..." --headless # Run in headless mode (invisible)
|
|
17
18
|
*/
|
|
19
|
+
import { Stagehand } from '@browserbasehq/stagehand';
|
|
18
20
|
import { join } from 'path';
|
|
19
|
-
import { runBrowserTest } from '../utils/browser-agent.js';
|
|
20
21
|
import { logger, setupCancellationHandler } from '../utils/logger.js';
|
|
21
|
-
import {
|
|
22
|
+
import { generateTestPrompt } from '../utils/prompt-generator.js';
|
|
22
23
|
import { findTicket, loadTicketsFile } from '../utils/tickets-manager.js';
|
|
23
24
|
/**
|
|
24
25
|
* Core test logic (atomic - single execution, no retries, no fixes)
|
|
25
26
|
*/
|
|
26
27
|
export async function testCore(options) {
|
|
27
|
-
const { ticket: ticketId, prompt: customPrompt, url = 'http://localhost:3000',
|
|
28
|
+
const { ticket: ticketId, prompt: customPrompt, url = 'http://localhost:3000', headless = false, verbose = false, ticketsFile = 'tickets.json', directory, } = options;
|
|
28
29
|
const cwd = directory || process.cwd();
|
|
29
30
|
const ticketsPath = join(cwd, ticketsFile);
|
|
30
31
|
// Validate: must provide either ticket OR prompt (not both)
|
|
@@ -37,6 +38,10 @@ export async function testCore(options) {
|
|
|
37
38
|
if (ticketId && customPrompt) {
|
|
38
39
|
throw new Error('Cannot provide both --ticket and --prompt. Please use one or the other.');
|
|
39
40
|
}
|
|
41
|
+
// Validate ANTHROPIC_API_KEY
|
|
42
|
+
if (!process.env.ANTHROPIC_API_KEY) {
|
|
43
|
+
throw new Error('ANTHROPIC_API_KEY environment variable is required');
|
|
44
|
+
}
|
|
40
45
|
let ticket;
|
|
41
46
|
let testPrompt;
|
|
42
47
|
let testIdentifier = '';
|
|
@@ -61,30 +66,68 @@ export async function testCore(options) {
|
|
|
61
66
|
console.log(` ✅ Loaded: ${ticket.id} - ${ticket.title}\n`);
|
|
62
67
|
}
|
|
63
68
|
else {
|
|
64
|
-
// Use custom prompt
|
|
69
|
+
// Use custom prompt directly
|
|
65
70
|
console.log('📋 Using custom prompt...');
|
|
66
71
|
testIdentifier = `custom-${Date.now()}`;
|
|
67
|
-
testPrompt =
|
|
68
|
-
console.log(` ✅
|
|
72
|
+
testPrompt = customPrompt;
|
|
73
|
+
console.log(` ✅ Prompt: ${testPrompt}\n`);
|
|
69
74
|
}
|
|
70
|
-
// 2.
|
|
75
|
+
// 2. Initialize Stagehand
|
|
71
76
|
console.log(`${'='.repeat(60)}`);
|
|
72
77
|
console.log(`🧪 Running Browser Test`);
|
|
73
78
|
console.log(`${'='.repeat(60)}\n`);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
console.log(`🌐 URL: ${url}`);
|
|
80
|
+
console.log(`🔍 Verbose: ${verbose ? 'enabled' : 'disabled'}`);
|
|
81
|
+
console.log(`👁️ Headless: ${headless ? 'enabled' : 'disabled'}\n`);
|
|
82
|
+
const stagehand = new Stagehand({
|
|
83
|
+
env: 'LOCAL',
|
|
84
|
+
verbose: verbose ? 2 : 1, // verbose flag → level 2, otherwise level 1
|
|
85
|
+
localBrowserLaunchOptions: {
|
|
86
|
+
headless,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
await stagehand.init();
|
|
90
|
+
console.log('✅ Stagehand initialized\n');
|
|
91
|
+
// 3. Navigate to URL
|
|
92
|
+
const page = stagehand.context.pages()[0];
|
|
93
|
+
console.log(`🌐 Navigating to ${url}...`);
|
|
94
|
+
await page.goto(url);
|
|
95
|
+
console.log('✅ Navigation complete\n');
|
|
96
|
+
// 4. Create agent with system prompt
|
|
97
|
+
const agent = stagehand.agent({
|
|
98
|
+
systemPrompt: `You are a helpful testing assistant that can control a web browser.
|
|
99
|
+
Execute the given instructions step by step.
|
|
100
|
+
Be thorough and wait for elements to load when necessary.
|
|
101
|
+
Do not ask follow-up questions, trust your judgement to complete the task.`,
|
|
79
102
|
});
|
|
80
|
-
//
|
|
103
|
+
// 5. Execute test instruction
|
|
104
|
+
console.log('🤖 Agent starting execution...\n');
|
|
105
|
+
const result = await agent.execute({
|
|
106
|
+
instruction: testPrompt,
|
|
107
|
+
});
|
|
108
|
+
// 6. Close browser
|
|
109
|
+
console.log('\n🔒 Closing browser session...');
|
|
110
|
+
await stagehand.close();
|
|
111
|
+
console.log('✅ Browser closed\n');
|
|
112
|
+
// 7. Calculate cost from token usage
|
|
113
|
+
const cost = result.usage ? calculateCost(result.usage) : 0;
|
|
114
|
+
// 8. Return TestResult
|
|
81
115
|
return {
|
|
82
116
|
ticketId: testIdentifier,
|
|
83
|
-
success:
|
|
84
|
-
output:
|
|
85
|
-
logs:
|
|
86
|
-
|
|
87
|
-
|
|
117
|
+
success: result.success,
|
|
118
|
+
output: result.message,
|
|
119
|
+
logs: {
|
|
120
|
+
console: [], // Stagehand doesn't expose browser console logs via agent
|
|
121
|
+
errors: result.success ? [] : [result.message],
|
|
122
|
+
},
|
|
123
|
+
tokensUsed: {
|
|
124
|
+
input: result.usage?.input_tokens || 0,
|
|
125
|
+
output: result.usage?.output_tokens || 0,
|
|
126
|
+
cacheCreation: 0, // Not exposed separately by Stagehand
|
|
127
|
+
cacheRead: result.usage?.cached_input_tokens || 0,
|
|
128
|
+
},
|
|
129
|
+
cost,
|
|
130
|
+
error: result.success ? undefined : result.message,
|
|
88
131
|
};
|
|
89
132
|
}
|
|
90
133
|
catch (error) {
|
|
@@ -109,6 +152,19 @@ export async function testCore(options) {
|
|
|
109
152
|
};
|
|
110
153
|
}
|
|
111
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Calculate cost from Stagehand token usage
|
|
157
|
+
* Pricing (per million tokens):
|
|
158
|
+
* - Input: $3.00
|
|
159
|
+
* - Output: $15.00
|
|
160
|
+
* - Cache read: $0.30
|
|
161
|
+
*/
|
|
162
|
+
function calculateCost(usage) {
|
|
163
|
+
const inputCost = (usage.input_tokens / 1000000) * 3.0;
|
|
164
|
+
const outputCost = (usage.output_tokens / 1000000) * 15.0;
|
|
165
|
+
const cacheReadCost = ((usage.cached_input_tokens || 0) / 1000000) * 0.3;
|
|
166
|
+
return inputCost + outputCost + cacheReadCost;
|
|
167
|
+
}
|
|
112
168
|
/**
|
|
113
169
|
* Main test command
|
|
114
170
|
*/
|
|
@@ -122,10 +178,6 @@ export async function testCommand(options) {
|
|
|
122
178
|
const logContext = logger.createContext('test', { noLogs });
|
|
123
179
|
const cleanupHandler = setupCancellationHandler(logContext);
|
|
124
180
|
try {
|
|
125
|
-
// Validate environment
|
|
126
|
-
if (!process.env.ANTHROPIC_API_KEY) {
|
|
127
|
-
throw new Error('ANTHROPIC_API_KEY environment variable is required');
|
|
128
|
-
}
|
|
129
181
|
// Run atomic test
|
|
130
182
|
const result = await testCore(options);
|
|
131
183
|
// Track metrics
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../kosuke/commands/test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../kosuke/commands/test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,MAAM,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE1E;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAAoB;IACjD,MAAM,EACJ,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,YAAY,EACpB,GAAG,GAAG,uBAAuB,EAC7B,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,WAAW,GAAG,cAAc,EAC5B,SAAS,GACV,GAAG,OAAO,CAAC;IAEZ,MAAM,GAAG,GAAG,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACvC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAE3C,4DAA4D;IAC5D,IAAI,CAAC,QAAQ,IAAI,CAAC,YAAY,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,gDA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CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,oBAAoB,MAAM,CAAC,KAAK,IAAI,8BAA8B,EAAE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;QAC/E,OAAO,CAAC,GAAG,CAAC,4DAA4D,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tickets.d.ts","sourceRoot":"","sources":["../../../kosuke/commands/tickets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"tickets.d.ts","sourceRoot":"","sources":["../../../kosuke/commands/tickets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,KAAK,EAAU,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA8XzE;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAwLjF;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAsF3E"}
|