@kosuke-ai/cli 0.0.29 → 0.0.31
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 +2 -2
- package/dist/index.js +32 -16
- package/dist/index.js.map +1 -1
- package/dist/kosuke/commands/ship.d.ts.map +1 -1
- package/dist/kosuke/commands/ship.js +61 -25
- package/dist/kosuke/commands/ship.js.map +1 -1
- package/dist/kosuke/commands/test.d.ts +11 -11
- package/dist/kosuke/commands/test.d.ts.map +1 -1
- package/dist/kosuke/commands/test.js +105 -277
- package/dist/kosuke/commands/test.js.map +1 -1
- package/dist/kosuke/types.d.ts +10 -17
- package/dist/kosuke/types.d.ts.map +1 -1
- package/dist/kosuke/utils/browser-agent.d.ts +33 -0
- package/dist/kosuke/utils/browser-agent.d.ts.map +1 -0
- package/dist/kosuke/utils/browser-agent.js +102 -0
- package/dist/kosuke/utils/browser-agent.js.map +1 -0
- package/dist/kosuke/utils/error-analyzer.d.ts +6 -3
- package/dist/kosuke/utils/error-analyzer.d.ts.map +1 -1
- package/dist/kosuke/utils/error-analyzer.js +35 -57
- package/dist/kosuke/utils/error-analyzer.js.map +1 -1
- package/dist/kosuke/utils/prompt-generator.d.ts +13 -0
- package/dist/kosuke/utils/prompt-generator.d.ts.map +1 -0
- package/dist/kosuke/utils/prompt-generator.js +44 -0
- package/dist/kosuke/utils/prompt-generator.js.map +1 -0
- package/dist/lib.d.ts +1 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/package.json +3 -6
- package/package.json +3 -6
- package/dist/kosuke/utils/playwright-agent.d.ts +0 -39
- package/dist/kosuke/utils/playwright-agent.d.ts.map +0 -1
- package/dist/kosuke/utils/playwright-agent.js +0 -245
- package/dist/kosuke/utils/playwright-agent.js.map +0 -1
- package/dist/kosuke/utils/test-generator.d.ts +0 -22
- package/dist/kosuke/utils/test-generator.d.ts.map +0 -1
- package/dist/kosuke/utils/test-generator.js +0 -174
- package/dist/kosuke/utils/test-generator.js.map +0 -1
- package/dist/kosuke/utils/visual-tester.d.ts +0 -71
- package/dist/kosuke/utils/visual-tester.d.ts.map +0 -1
- package/dist/kosuke/utils/visual-tester.js +0 -202
- package/dist/kosuke/utils/visual-tester.js.map +0 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser Agent - Stagehand-powered browser automation
|
|
3
|
+
*
|
|
4
|
+
* Uses Stagehand with Anthropic Claude for AI-driven browser testing.
|
|
5
|
+
* Provides simple boolean success/failure results with logs.
|
|
6
|
+
*/
|
|
7
|
+
import { Stagehand } from '@browserbasehq/stagehand';
|
|
8
|
+
/**
|
|
9
|
+
* Run browser test using Stagehand
|
|
10
|
+
*/
|
|
11
|
+
export async function runBrowserTest(options) {
|
|
12
|
+
const { url, task, headed = false, debug = false } = options;
|
|
13
|
+
if (!process.env.ANTHROPIC_API_KEY) {
|
|
14
|
+
throw new Error('ANTHROPIC_API_KEY environment variable is required for Stagehand');
|
|
15
|
+
}
|
|
16
|
+
console.log(`🌐 Navigating to: ${url}`);
|
|
17
|
+
console.log(`🎯 Task: ${task}\n`);
|
|
18
|
+
const stagehand = new Stagehand({
|
|
19
|
+
env: 'LOCAL',
|
|
20
|
+
apiKey: process.env.ANTHROPIC_API_KEY,
|
|
21
|
+
headless: !headed,
|
|
22
|
+
debugDom: debug,
|
|
23
|
+
modelName: (process.env.STAGEHAND_MODEL ||
|
|
24
|
+
'claude-3-5-sonnet-20240620'),
|
|
25
|
+
modelClientOptions: {
|
|
26
|
+
apiKey: process.env.ANTHROPIC_API_KEY,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const consoleLogs = [];
|
|
30
|
+
const errors = [];
|
|
31
|
+
try {
|
|
32
|
+
// Initialize Stagehand
|
|
33
|
+
await stagehand.init();
|
|
34
|
+
// Set up log collectors
|
|
35
|
+
stagehand.page.on('console', (msg) => {
|
|
36
|
+
const text = msg.text();
|
|
37
|
+
consoleLogs.push(`[${msg.type()}] ${text}`);
|
|
38
|
+
// Track errors
|
|
39
|
+
if (msg.type() === 'error') {
|
|
40
|
+
errors.push(text);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
stagehand.page.on('pageerror', (error) => {
|
|
44
|
+
errors.push(error.message);
|
|
45
|
+
});
|
|
46
|
+
// Navigate to URL
|
|
47
|
+
await stagehand.page.goto(url, { waitUntil: 'networkidle' });
|
|
48
|
+
// Execute task with Stagehand
|
|
49
|
+
console.log('🤖 Executing task with Claude...');
|
|
50
|
+
const result = await stagehand.act({ action: task });
|
|
51
|
+
// Close browser
|
|
52
|
+
await stagehand.close();
|
|
53
|
+
// Convert result to string for processing
|
|
54
|
+
const resultText = typeof result === 'string' ? result : JSON.stringify(result);
|
|
55
|
+
// Determine success based on result
|
|
56
|
+
const success = !resultText.toLowerCase().includes('error') &&
|
|
57
|
+
!resultText.toLowerCase().includes('failed') &&
|
|
58
|
+
errors.length === 0;
|
|
59
|
+
const output = success
|
|
60
|
+
? `✅ Test passed: ${resultText}`
|
|
61
|
+
: `❌ Test failed: ${resultText}${errors.length > 0 ? `\n\nErrors found:\n${errors.join('\n')}` : ''}`;
|
|
62
|
+
console.log(`\n${output}\n`);
|
|
63
|
+
return {
|
|
64
|
+
success,
|
|
65
|
+
output,
|
|
66
|
+
logs: {
|
|
67
|
+
console: consoleLogs,
|
|
68
|
+
errors,
|
|
69
|
+
},
|
|
70
|
+
tokensUsed: {
|
|
71
|
+
input: 0, // Stagehand doesn't expose this yet
|
|
72
|
+
output: 0,
|
|
73
|
+
cacheCreation: 0,
|
|
74
|
+
cacheRead: 0,
|
|
75
|
+
},
|
|
76
|
+
cost: 0, // Will be added later when Stagehand exposes metrics
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
// Ensure browser is closed on error
|
|
81
|
+
await stagehand.close();
|
|
82
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
83
|
+
errors.push(errorMessage);
|
|
84
|
+
console.error(`\n❌ Browser test failed: ${errorMessage}\n`);
|
|
85
|
+
return {
|
|
86
|
+
success: false,
|
|
87
|
+
output: `❌ Test failed with error: ${errorMessage}`,
|
|
88
|
+
logs: {
|
|
89
|
+
console: consoleLogs,
|
|
90
|
+
errors,
|
|
91
|
+
},
|
|
92
|
+
tokensUsed: {
|
|
93
|
+
input: 0,
|
|
94
|
+
output: 0,
|
|
95
|
+
cacheCreation: 0,
|
|
96
|
+
cacheRead: 0,
|
|
97
|
+
},
|
|
98
|
+
cost: 0,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=browser-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-agent.js","sourceRoot":"","sources":["../../../kosuke/utils/browser-agent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAyBrD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAA2B;IAC9D,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,EAAE,KAAK,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IAE7D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC,CAAC;IAElC,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC;QAC9B,GAAG,EAAE,OAAO;QACZ,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB;QACrC,QAAQ,EAAE,CAAC,MAAM;QACjB,QAAQ,EAAE,KAAK;QACf,SAAS,EAAE,CAAC,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AC,CAAC;QAE5D,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,6BAA6B,YAAY,EAAE;YACnD,IAAI,EAAE;gBACJ,OAAO,EAAE,WAAW;gBACpB,MAAM;aACP;YACD,UAAU,EAAE;gBACV,KAAK,EAAE,CAAC;gBACR,MAAM,EAAE,CAAC;gBACT,aAAa,EAAE,CAAC;gBAChB,SAAS,EAAE,CAAC;aACb;YACD,IAAI,EAAE,CAAC;SACR,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Error Analyzer - Analyze test failures and apply fixes
|
|
3
3
|
*
|
|
4
4
|
* Uses Claude to:
|
|
5
|
-
* - Analyze test failures, console errors,
|
|
5
|
+
* - Analyze browser test failures, console errors, and backend logs
|
|
6
6
|
* - Identify root causes
|
|
7
7
|
* - Apply fixes to the codebase
|
|
8
8
|
*/
|
|
@@ -26,7 +26,10 @@ export interface TestFailure {
|
|
|
26
26
|
received?: string;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* Analyze test failures and apply fixes
|
|
29
|
+
* Analyze browser test failures and apply fixes
|
|
30
30
|
*/
|
|
31
|
-
export declare function analyzeAndFix(ticket: Ticket,
|
|
31
|
+
export declare function analyzeAndFix(ticket: Ticket, testOutput: string, logs: {
|
|
32
|
+
console: string[];
|
|
33
|
+
errors: string[];
|
|
34
|
+
}, dockerLogs?: CollectedLogs, cwd?: string): Promise<AnalysisResult>;
|
|
32
35
|
//# sourceMappingURL=error-analyzer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-analyzer.d.ts","sourceRoot":"","sources":["../../../kosuke/utils/error-analyzer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,cAAc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AO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,EACD,UAAU,CAAC,EAAE,aAAa,EAC1B,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,cAAc,CAAC,CAuBzB"}
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
* Error Analyzer - Analyze test failures and apply fixes
|
|
3
3
|
*
|
|
4
4
|
* Uses Claude to:
|
|
5
|
-
* - Analyze test failures, console errors,
|
|
5
|
+
* - Analyze browser test failures, console errors, and backend logs
|
|
6
6
|
* - Identify root causes
|
|
7
7
|
* - Apply fixes to the codebase
|
|
8
8
|
*/
|
|
9
9
|
import { runAgent } from './claude-agent.js';
|
|
10
10
|
/**
|
|
11
|
-
* Analyze test failures and apply fixes
|
|
11
|
+
* Analyze browser test failures and apply fixes
|
|
12
12
|
*/
|
|
13
|
-
export async function analyzeAndFix(ticket,
|
|
13
|
+
export async function analyzeAndFix(ticket, testOutput, logs, dockerLogs, cwd = process.cwd()) {
|
|
14
14
|
console.log(`\n${'='.repeat(60)}`);
|
|
15
15
|
console.log(`🔍 Analyzing Test Failures`);
|
|
16
16
|
console.log(`${'='.repeat(60)}\n`);
|
|
17
|
-
const systemPrompt = buildAnalysisPrompt(ticket,
|
|
17
|
+
const systemPrompt = buildAnalysisPrompt(ticket, testOutput, logs, dockerLogs);
|
|
18
18
|
const result = await runAgent(`Analyze and fix test failures for ticket ${ticket.id}`, {
|
|
19
19
|
systemPrompt,
|
|
20
20
|
cwd,
|
|
@@ -33,10 +33,10 @@ export async function analyzeAndFix(ticket, testFailures, logs, tracePath, cwd =
|
|
|
33
33
|
/**
|
|
34
34
|
* Build system prompt for error analysis
|
|
35
35
|
*/
|
|
36
|
-
function buildAnalysisPrompt(ticket,
|
|
36
|
+
function buildAnalysisPrompt(ticket, testOutput, logs, dockerLogs) {
|
|
37
37
|
const sections = [];
|
|
38
38
|
// Ticket context
|
|
39
|
-
sections.push(`You are debugging failed
|
|
39
|
+
sections.push(`You are debugging a failed browser test for a feature implementation.
|
|
40
40
|
|
|
41
41
|
**Ticket Information:**
|
|
42
42
|
- ID: ${ticket.id}
|
|
@@ -45,83 +45,61 @@ function buildAnalysisPrompt(ticket, testFailures, logs, tracePath) {
|
|
|
45
45
|
${ticket.description}
|
|
46
46
|
|
|
47
47
|
**Your Task:**
|
|
48
|
-
1. Analyze the test
|
|
49
|
-
2. Identify the root cause of the
|
|
48
|
+
1. Analyze the test output, console logs, and errors below
|
|
49
|
+
2. Identify the root cause of the test failure
|
|
50
50
|
3. Apply fixes to resolve the issues
|
|
51
51
|
4. Make minimal, targeted changes that align with the ticket requirements`);
|
|
52
|
-
// Test
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
sections.push(`\nTest: ${failure.testName}`);
|
|
57
|
-
sections.push(`Error: ${failure.errorMessage}`);
|
|
58
|
-
if (failure.expected) {
|
|
59
|
-
sections.push(`Expected: ${failure.expected}`);
|
|
60
|
-
}
|
|
61
|
-
if (failure.received) {
|
|
62
|
-
sections.push(`Received: ${failure.received}`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
// Console errors
|
|
52
|
+
// Test output
|
|
53
|
+
sections.push(`\n**Browser Test Output:**`);
|
|
54
|
+
sections.push(testOutput);
|
|
55
|
+
// Console logs
|
|
67
56
|
if (logs.console.length > 0) {
|
|
68
|
-
sections.push(`\n**Console
|
|
57
|
+
sections.push(`\n**Browser Console Logs (${logs.console.length}):**`);
|
|
69
58
|
for (const log of logs.console) {
|
|
70
|
-
|
|
71
|
-
sections.push(`[${log.type.toUpperCase()}]${location} ${log.message}`);
|
|
59
|
+
sections.push(log);
|
|
72
60
|
}
|
|
73
61
|
}
|
|
74
|
-
//
|
|
75
|
-
if (logs.
|
|
76
|
-
sections.push(`\n**
|
|
77
|
-
for (const
|
|
78
|
-
sections.push(
|
|
79
|
-
sections.push(`Status: ${log.status} ${log.statusText}`);
|
|
80
|
-
if (log.requestBody) {
|
|
81
|
-
sections.push(`Request: ${log.requestBody.substring(0, 300)}`);
|
|
82
|
-
}
|
|
83
|
-
if (log.responseBody) {
|
|
84
|
-
sections.push(`Response: ${log.responseBody.substring(0, 300)}`);
|
|
85
|
-
}
|
|
62
|
+
// Errors
|
|
63
|
+
if (logs.errors.length > 0) {
|
|
64
|
+
sections.push(`\n**Errors Found (${logs.errors.length}):**`);
|
|
65
|
+
for (const error of logs.errors) {
|
|
66
|
+
sections.push(error);
|
|
86
67
|
}
|
|
87
68
|
}
|
|
88
|
-
// Docker logs
|
|
89
|
-
if (
|
|
90
|
-
sections.push(`\n**Backend Logs (Docker Compose - last ${
|
|
91
|
-
for (const log of
|
|
69
|
+
// Docker logs (if provided)
|
|
70
|
+
if (dockerLogs?.docker && dockerLogs.docker.length > 0) {
|
|
71
|
+
sections.push(`\n**Backend Logs (Docker Compose - last ${dockerLogs.docker.length} entries):**`);
|
|
72
|
+
for (const log of dockerLogs.docker) {
|
|
92
73
|
sections.push(`[${log.service}] ${log.message}`);
|
|
93
74
|
}
|
|
94
75
|
}
|
|
95
|
-
// Trace information
|
|
96
|
-
sections.push(`\n**Playwright Trace:**`);
|
|
97
|
-
sections.push(`Available at: ${tracePath}`);
|
|
98
|
-
sections.push(`(Contains detailed timeline, screenshots, network activity)`);
|
|
99
76
|
// Instructions
|
|
100
77
|
sections.push(`\n**Critical Instructions:**
|
|
101
78
|
1. Read the relevant source files in the current workspace
|
|
102
|
-
2. Identify the root cause by
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
79
|
+
2. Identify the root cause by analyzing:
|
|
80
|
+
- What the test was trying to accomplish
|
|
81
|
+
- What errors occurred in the browser console
|
|
82
|
+
- Any backend errors from Docker logs
|
|
83
|
+
- The current state of the codebase
|
|
107
84
|
3. Determine if the issue is:
|
|
108
|
-
- Frontend code (React components, forms, routing, state)
|
|
109
|
-
- Backend code (
|
|
110
|
-
-
|
|
111
|
-
-
|
|
85
|
+
- Frontend code (React components, forms, routing, state, UI elements)
|
|
86
|
+
- Backend code (API routes, database, validation, authentication)
|
|
87
|
+
- Configuration (environment variables, API endpoints, CORS)
|
|
88
|
+
- Missing implementation (feature not fully implemented)
|
|
112
89
|
4. Apply fixes using search_replace or write tools
|
|
113
90
|
5. Focus on the specific feature described in the ticket
|
|
114
91
|
6. Ensure fixes are production-ready and follow best practices
|
|
115
92
|
|
|
116
93
|
**Common Issues to Check:**
|
|
94
|
+
- Missing UI elements or incorrect component rendering
|
|
117
95
|
- Mismatched field names between frontend and backend
|
|
118
|
-
- Missing
|
|
96
|
+
- Missing API route definitions
|
|
119
97
|
- Incorrect API endpoint URLs
|
|
120
98
|
- Missing form validation
|
|
121
99
|
- Async timing issues (missing awaits, race conditions)
|
|
122
|
-
- Incorrect Playwright selectors (wrong role, text, or ID)
|
|
123
100
|
- CORS or authentication issues
|
|
124
101
|
- Database schema mismatches
|
|
102
|
+
- Missing error handling
|
|
125
103
|
|
|
126
104
|
Begin by exploring the codebase, then identify and fix the root cause.`);
|
|
127
105
|
return sections.join('\n');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-analyzer.js","sourceRoot":"","sources":["../../../kosuke/utils/error-analyzer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAuB7C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAc,EACd,
|
|
1
|
+
{"version":3,"file":"error-analyzer.js","sourceRoot":"","sources":["../../../kosuke/utils/error-analyzer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAuB7C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAc,EACd,UAAkB,EAClB,IAGC,EACD,UAA0B,EAC1B,MAAc,OAAO,CAAC,GAAG,EAA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
|
5
|
+
/**
|
|
6
|
+
* Generate a structured test prompt from a ticket
|
|
7
|
+
*/
|
|
8
|
+
export declare function generateTestPrompt(ticket: Ticket): string;
|
|
9
|
+
/**
|
|
10
|
+
* Generate a test prompt from a custom string
|
|
11
|
+
*/
|
|
12
|
+
export declare function generateCustomTestPrompt(customPrompt: string, url: string): string;
|
|
13
|
+
//# sourceMappingURL=prompt-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-generator.d.ts","sourceRoot":"","sources":["../../../kosuke/utils/prompt-generator.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAsBzD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAUlF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt Generator - Generate structured test prompts from tickets
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Generate a structured test prompt from a ticket
|
|
6
|
+
*/
|
|
7
|
+
export function generateTestPrompt(ticket) {
|
|
8
|
+
return `Test the following feature implementation:
|
|
9
|
+
|
|
10
|
+
**Feature:** ${ticket.title}
|
|
11
|
+
|
|
12
|
+
**Requirements:**
|
|
13
|
+
${ticket.description}
|
|
14
|
+
|
|
15
|
+
**Testing Instructions:**
|
|
16
|
+
1. Navigate to the relevant page(s) for this feature
|
|
17
|
+
2. Verify all functionality described in the requirements works correctly
|
|
18
|
+
3. Check for any console errors or warnings
|
|
19
|
+
4. Confirm the implementation matches the ticket description
|
|
20
|
+
5. Test both happy path and edge cases
|
|
21
|
+
|
|
22
|
+
**Success Criteria:**
|
|
23
|
+
- All functionality works as described
|
|
24
|
+
- No console errors
|
|
25
|
+
- User experience is smooth and intuitive
|
|
26
|
+
- Feature behaves correctly in different scenarios
|
|
27
|
+
|
|
28
|
+
Return a clear success or failure status with details about what was tested and any issues found.`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Generate a test prompt from a custom string
|
|
32
|
+
*/
|
|
33
|
+
export function generateCustomTestPrompt(customPrompt, url) {
|
|
34
|
+
return `${customPrompt}
|
|
35
|
+
|
|
36
|
+
**Testing Instructions:**
|
|
37
|
+
1. Navigate to ${url}
|
|
38
|
+
2. Execute the test scenario described above
|
|
39
|
+
3. Check for console errors or warnings
|
|
40
|
+
4. Verify expected behavior
|
|
41
|
+
|
|
42
|
+
Return success if the test passes, or failure with details about what went wrong.`;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=prompt-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-generator.js","sourceRoot":"","sources":["../../../kosuke/utils/prompt-generator.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,OAAO;;eAEM,MAAM,CAAC,KAAK;;;EAGzB,MAAM,CAAC,WAAW;;;;;;;;;;;;;;;kGAe8E,CAAC;AACnG,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,YAAoB,EAAE,GAAW;IACxE,OAAO,GAAG,YAAY;;;iBAGP,GAAG;;;;;kFAK8D,CAAC;AACnF,CAAC"}
|
package/dist/lib.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export { runLint, runTypecheck, runFormat, runTests, runComprehensiveLinting, de
|
|
|
56
56
|
export { getRepoLocalPath } from './kosuke/utils/repository-manager.js';
|
|
57
57
|
export { validateRepoAccess } from './kosuke/utils/repository-resolver.js';
|
|
58
58
|
export { logger, withCommandTracking, setupCancellationHandler } from './kosuke/utils/logger.js';
|
|
59
|
-
export type { Batch, Fix, AnalyseOptions, LintOptions, SyncRulesOptions, RulesAdaptation, GitInfo, GetCodeOptions, CodeExplorationResult, TicketsOptions, TicketsResult, Ticket, ShipOptions, ShipResult, BuildOptions, ReviewOptions, ReviewResult, TestOptions, TestResult, AnalysisResult, TestFailure, ConsoleLog, NetworkLog, DockerLog, CollectedLogs,
|
|
59
|
+
export type { Batch, Fix, AnalyseOptions, LintOptions, SyncRulesOptions, RulesAdaptation, GitInfo, GetCodeOptions, CodeExplorationResult, TicketsOptions, TicketsResult, Ticket, ShipOptions, ShipResult, BuildOptions, ReviewOptions, ReviewResult, TestOptions, TestResult, AnalysisResult, TestFailure, ConsoleLog, NetworkLog, DockerLog, CollectedLogs, CommandName, ExecutionStatus, CliLogData, CommandExecutionContext, } from './kosuke/types.js';
|
|
60
60
|
export type { ValidationResult } from './kosuke/utils/validator.js';
|
|
61
61
|
export type { AgentVerbosity, AgentConfig, AgentResult } from './kosuke/utils/claude-agent.js';
|
|
62
62
|
export type { RequirementsOptions, RequirementsResult } from './kosuke/commands/requirements.js';
|
package/dist/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAKH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,Y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E,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAyCjG,mCAAmC;AACnC,MAAM,CAAC,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosuke-ai/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"description": "Kosuke CLI - Development automation tool for syncing rules and analyzing code quality",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -60,19 +60,16 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@anthropic-ai/claude-agent-sdk": "^0.1.0",
|
|
62
62
|
"@anthropic-ai/sdk": "^0.32.1",
|
|
63
|
+
"@browserbasehq/stagehand": "^1.5.0",
|
|
63
64
|
"@octokit/rest": "^20.0.0",
|
|
64
65
|
"dotenv": "^16.4.0",
|
|
65
66
|
"glob": "^10.3.0",
|
|
66
67
|
"ignore": "^5.3.0",
|
|
67
|
-
"pixelmatch": "^5.3.0",
|
|
68
|
-
"pngjs": "^7.0.0",
|
|
69
68
|
"simple-git": "^3.22.0"
|
|
70
69
|
},
|
|
71
70
|
"devDependencies": {
|
|
72
|
-
"@playwright/test": "^1.
|
|
71
|
+
"@playwright/test": "^1.49.1",
|
|
73
72
|
"@types/node": "^20.11.0",
|
|
74
|
-
"@types/pixelmatch": "^5.2.6",
|
|
75
|
-
"@types/pngjs": "^6.0.5",
|
|
76
73
|
"@typescript-eslint/eslint-plugin": "^8.19.1",
|
|
77
74
|
"@typescript-eslint/parser": "^8.19.1",
|
|
78
75
|
"@vitest/coverage-v8": "^3.1.3",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosuke-ai/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"description": "Kosuke CLI - Development automation tool for syncing rules and analyzing code quality",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -60,19 +60,16 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@anthropic-ai/claude-agent-sdk": "^0.1.0",
|
|
62
62
|
"@anthropic-ai/sdk": "^0.32.1",
|
|
63
|
+
"@browserbasehq/stagehand": "^1.5.0",
|
|
63
64
|
"@octokit/rest": "^20.0.0",
|
|
64
65
|
"dotenv": "^16.4.0",
|
|
65
66
|
"glob": "^10.3.0",
|
|
66
67
|
"ignore": "^5.3.0",
|
|
67
|
-
"pixelmatch": "^5.3.0",
|
|
68
|
-
"pngjs": "^7.0.0",
|
|
69
68
|
"simple-git": "^3.22.0"
|
|
70
69
|
},
|
|
71
70
|
"devDependencies": {
|
|
72
|
-
"@playwright/test": "^1.
|
|
71
|
+
"@playwright/test": "^1.49.1",
|
|
73
72
|
"@types/node": "^20.11.0",
|
|
74
|
-
"@types/pixelmatch": "^5.2.6",
|
|
75
|
-
"@types/pngjs": "^6.0.5",
|
|
76
73
|
"@typescript-eslint/eslint-plugin": "^8.19.1",
|
|
77
74
|
"@typescript-eslint/parser": "^8.19.1",
|
|
78
75
|
"@vitest/coverage-v8": "^3.1.3",
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Playwright Agent - Test execution orchestration
|
|
3
|
-
*
|
|
4
|
-
* Executes Playwright tests with logging and visual regression
|
|
5
|
-
*/
|
|
6
|
-
import type { TestFailure } from './error-analyzer.js';
|
|
7
|
-
export interface PlaywrightResult {
|
|
8
|
-
success: boolean;
|
|
9
|
-
testsRun: number;
|
|
10
|
-
testsPassed: number;
|
|
11
|
-
testsFailed: number;
|
|
12
|
-
failures: TestFailure[];
|
|
13
|
-
tracePath: string;
|
|
14
|
-
duration: number;
|
|
15
|
-
}
|
|
16
|
-
export interface PlaywrightOptions {
|
|
17
|
-
testFile: string;
|
|
18
|
-
baseUrl: string;
|
|
19
|
-
headed?: boolean;
|
|
20
|
-
debug?: boolean;
|
|
21
|
-
cwd?: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Run Playwright tests
|
|
25
|
-
*/
|
|
26
|
-
export declare function runPlaywrightTests(options: PlaywrightOptions): Promise<PlaywrightResult>;
|
|
27
|
-
/**
|
|
28
|
-
* Check if Playwright is installed
|
|
29
|
-
*/
|
|
30
|
-
export declare function isPlaywrightInstalled(cwd?: string): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Install Playwright
|
|
33
|
-
*/
|
|
34
|
-
export declare function installPlaywright(cwd?: string): Promise<void>;
|
|
35
|
-
/**
|
|
36
|
-
* Ensure Playwright config exists
|
|
37
|
-
*/
|
|
38
|
-
export declare function ensurePlaywrightConfig(cwd?: string): void;
|
|
39
|
-
//# sourceMappingURL=playwright-agent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"playwright-agent.d.ts","sourceRoot":"","sources":["../../../kosuke/utils/playwright-agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA6D9F;AA4HD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAW1E;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBlF;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,GAAE,MAAsB,GAAG,IAAI,CAmCxE"}
|