@kosuke-ai/cli 0.0.35 ā 0.0.37
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 +27 -64
- package/dist/index.js.map +1 -1
- package/dist/kosuke/commands/build.d.ts +10 -8
- package/dist/kosuke/commands/build.d.ts.map +1 -1
- package/dist/kosuke/commands/build.js +92 -43
- package/dist/kosuke/commands/build.js.map +1 -1
- package/dist/kosuke/commands/ship.d.ts +23 -16
- package/dist/kosuke/commands/ship.d.ts.map +1 -1
- package/dist/kosuke/commands/ship.js +50 -166
- package/dist/kosuke/commands/ship.js.map +1 -1
- package/dist/kosuke/types.d.ts +28 -10
- package/dist/kosuke/types.d.ts.map +1 -1
- package/dist/kosuke/utils/git.d.ts +0 -4
- package/dist/kosuke/utils/git.d.ts.map +1 -1
- package/dist/kosuke/utils/git.js +0 -19
- package/dist/kosuke/utils/git.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 +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* requirements Interactive requirements gathering
|
|
10
10
|
* getcode Explore GitHub repositories and fetch code
|
|
11
11
|
* tickets Generate implementation tickets from requirements
|
|
12
|
-
* ship --ticket=<ID> Implement a single ticket from tickets.json
|
|
13
12
|
* build Batch process all tickets from tickets.json
|
|
14
13
|
* review Review codebase against CLAUDE.md rules
|
|
15
14
|
* test Run E2E tests with automated fixing (ticket or custom prompt)
|
|
@@ -21,7 +20,6 @@
|
|
|
21
20
|
* bun run kosuke requirements
|
|
22
21
|
* bun run kosuke getcode "query"
|
|
23
22
|
* bun run kosuke tickets
|
|
24
|
-
* bun run kosuke ship --ticket=SCHEMA-1
|
|
25
23
|
* bun run kosuke build
|
|
26
24
|
* bun run kosuke review
|
|
27
25
|
* bun run kosuke test --ticket=FRONTEND-1 OR --prompt="Test login flow"
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* requirements Interactive requirements gathering
|
|
10
10
|
* getcode Explore GitHub repositories and fetch code
|
|
11
11
|
* tickets Generate implementation tickets from requirements
|
|
12
|
-
* ship --ticket=<ID> Implement a single ticket from tickets.json
|
|
13
12
|
* build Batch process all tickets from tickets.json
|
|
14
13
|
* review Review codebase against CLAUDE.md rules
|
|
15
14
|
* test Run E2E tests with automated fixing (ticket or custom prompt)
|
|
@@ -21,7 +20,6 @@
|
|
|
21
20
|
* bun run kosuke requirements
|
|
22
21
|
* bun run kosuke getcode "query"
|
|
23
22
|
* bun run kosuke tickets
|
|
24
|
-
* bun run kosuke ship --ticket=SCHEMA-1
|
|
25
23
|
* bun run kosuke build
|
|
26
24
|
* bun run kosuke review
|
|
27
25
|
* bun run kosuke test --ticket=FRONTEND-1 OR --prompt="Test login flow"
|
|
@@ -31,16 +29,15 @@
|
|
|
31
29
|
* GITHUB_TOKEN - Required for creating PRs
|
|
32
30
|
*/
|
|
33
31
|
import 'dotenv/config';
|
|
34
|
-
import { syncRulesCommand } from './kosuke/commands/sync-rules.js';
|
|
35
32
|
import { analyseCommand } from './kosuke/commands/analyse.js';
|
|
33
|
+
import { buildCommand } from './kosuke/commands/build.js';
|
|
34
|
+
import { getCodeCommand, parseGetCodeArgs } from './kosuke/commands/getcode.js';
|
|
36
35
|
import { lintCommand } from './kosuke/commands/lint.js';
|
|
37
36
|
import { requirementsCommand } from './kosuke/commands/requirements.js';
|
|
38
|
-
import { getCodeCommand, parseGetCodeArgs } from './kosuke/commands/getcode.js';
|
|
39
|
-
import { ticketsCommand } from './kosuke/commands/tickets.js';
|
|
40
|
-
import { shipCommand } from './kosuke/commands/ship.js';
|
|
41
|
-
import { buildCommand } from './kosuke/commands/build.js';
|
|
42
37
|
import { reviewCommand } from './kosuke/commands/review.js';
|
|
38
|
+
import { syncRulesCommand } from './kosuke/commands/sync-rules.js';
|
|
43
39
|
import { testCommand } from './kosuke/commands/test.js';
|
|
40
|
+
import { ticketsCommand } from './kosuke/commands/tickets.js';
|
|
44
41
|
async function main() {
|
|
45
42
|
const args = process.argv.slice(2);
|
|
46
43
|
const command = args[0];
|
|
@@ -104,32 +101,6 @@ async function main() {
|
|
|
104
101
|
await ticketsCommand(options);
|
|
105
102
|
break;
|
|
106
103
|
}
|
|
107
|
-
case 'ship': {
|
|
108
|
-
const ticketArg = args.find((arg) => arg.startsWith('--ticket='))?.split('=')[1];
|
|
109
|
-
if (!ticketArg) {
|
|
110
|
-
console.error('ā --ticket flag is required\n');
|
|
111
|
-
console.log('Usage: kosuke ship --ticket=SCHEMA-1 [--test] [--commit] [--directory=<path>] [--db-url=<url>]');
|
|
112
|
-
console.log('\nExamples:');
|
|
113
|
-
console.log(' kosuke ship --ticket=SCHEMA-1 # Local only');
|
|
114
|
-
console.log(' kosuke ship --ticket=FRONTEND-1 --test # With testing');
|
|
115
|
-
console.log(' kosuke ship --ticket=FRONTEND-1 --commit # Commit to current branch');
|
|
116
|
-
console.log(' kosuke ship --ticket=SCHEMA-1 --directory=./my-project # Specific directory');
|
|
117
|
-
console.log(' kosuke ship --ticket=SCHEMA-1 --db-url=postgres://user:pass@host:5432/db # Custom DB');
|
|
118
|
-
process.exit(1);
|
|
119
|
-
}
|
|
120
|
-
const options = {
|
|
121
|
-
ticket: ticketArg,
|
|
122
|
-
test: args.includes('--test'),
|
|
123
|
-
commit: args.includes('--commit'),
|
|
124
|
-
ticketsFile: args.find((arg) => arg.startsWith('--tickets='))?.split('=')[1],
|
|
125
|
-
directory: args.find((arg) => arg.startsWith('--directory='))?.split('=')[1] ||
|
|
126
|
-
args.find((arg) => arg.startsWith('--dir='))?.split('=')[1],
|
|
127
|
-
dbUrl: args.find((arg) => arg.startsWith('--db-url='))?.split('=')[1],
|
|
128
|
-
noLogs: args.includes('--no-logs'),
|
|
129
|
-
};
|
|
130
|
-
await shipCommand(options);
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
104
|
case 'build': {
|
|
134
105
|
const options = {
|
|
135
106
|
directory: args.find((arg) => arg.startsWith('--directory='))?.split('=')[1] ||
|
|
@@ -137,8 +108,13 @@ async function main() {
|
|
|
137
108
|
ticketsFile: args.find((arg) => arg.startsWith('--tickets='))?.split('=')[1],
|
|
138
109
|
dbUrl: args.find((arg) => arg.startsWith('--db-url='))?.split('=')[1],
|
|
139
110
|
reset: args.includes('--reset'),
|
|
140
|
-
|
|
141
|
-
|
|
111
|
+
askConfirm: args.includes('--ask-confirm'),
|
|
112
|
+
askCommit: args.includes('--ask-commit'),
|
|
113
|
+
review: !args.includes('--no-review'), // Default true, disabled with --no-review
|
|
114
|
+
test: !args.includes('--no-test'), // Default true, disabled with --no-test
|
|
115
|
+
url: args.find((arg) => arg.startsWith('--url='))?.split('=')[1],
|
|
116
|
+
headed: args.includes('--headed'),
|
|
117
|
+
debug: args.includes('--debug'),
|
|
142
118
|
noLogs: args.includes('--no-logs'),
|
|
143
119
|
};
|
|
144
120
|
await buildCommand(options);
|
|
@@ -302,32 +278,12 @@ COMMANDS:
|
|
|
302
278
|
kosuke tickets --directory=./projects/my-app # Analyze specific directory
|
|
303
279
|
kosuke tickets --dir=./my-app --path=docs/spec.md # Custom directory and requirements path
|
|
304
280
|
|
|
305
|
-
ship --ticket=<ID> [options]
|
|
306
|
-
Implement a single ticket from tickets.json
|
|
307
|
-
Follows CLAUDE.md rules, runs linting, and optionally runs tests
|
|
308
|
-
|
|
309
|
-
Options:
|
|
310
|
-
--ticket=<ID> Ticket ID to implement (required, e.g., SCHEMA-1)
|
|
311
|
-
--test Run E2E tests after implementation
|
|
312
|
-
--commit Commit and push to current branch
|
|
313
|
-
--tickets=<file> Path to tickets file (default: tickets.json, relative to directory)
|
|
314
|
-
--directory=<path> Directory to run ship in (default: current directory)
|
|
315
|
-
--dir=<path> Alias for --directory
|
|
316
|
-
--db-url=<url> Database URL for migrations (default: postgres://postgres:postgres@postgres:5432/postgres)
|
|
317
|
-
|
|
318
|
-
Examples:
|
|
319
|
-
kosuke ship --ticket=SCHEMA-1 # Implement locally only
|
|
320
|
-
kosuke ship --ticket=FRONTEND-1 --test # Implement with testing
|
|
321
|
-
kosuke ship --ticket=FRONTEND-1 --commit # Commit to current branch
|
|
322
|
-
kosuke ship --ticket=SCHEMA-1 --tickets=custom.json
|
|
323
|
-
kosuke ship --ticket=SCHEMA-1 --directory=./my-project # Specific directory
|
|
324
|
-
kosuke ship --ticket=SCHEMA-1 --db-url=postgres://user:pass@host:5432/db # Custom DB
|
|
325
|
-
|
|
326
281
|
build [options]
|
|
327
282
|
Batch process all "Todo" and "Error" tickets from tickets.json
|
|
328
|
-
|
|
283
|
+
Implements and commits each ticket individually to current branch
|
|
329
284
|
Processes tickets in order: Schema ā Backend ā Frontend
|
|
330
|
-
Frontend tickets automatically include E2E testing
|
|
285
|
+
Frontend tickets automatically include E2E testing (unless --no-test)
|
|
286
|
+
All tickets include code review by default (unless --no-review)
|
|
331
287
|
|
|
332
288
|
Options:
|
|
333
289
|
--directory=<path> Directory to run build in (default: current directory)
|
|
@@ -335,18 +291,25 @@ COMMANDS:
|
|
|
335
291
|
--tickets=<file> Path to tickets file (default: tickets.json, relative to directory)
|
|
336
292
|
--db-url=<url> Database URL for migrations (default: postgres://postgres:postgres@postgres:5432/postgres)
|
|
337
293
|
--reset Reset all tickets to "Todo" status before processing (start from scratch)
|
|
338
|
-
--confirm
|
|
339
|
-
--
|
|
294
|
+
--ask-confirm Ask for confirmation before proceeding to next ticket (useful for review)
|
|
295
|
+
--ask-commit Ask before committing each ticket (default: auto-commit after each ticket)
|
|
296
|
+
--no-review Skip code review phase (enabled by default)
|
|
297
|
+
--no-test Skip testing phase for frontend tickets (enabled by default)
|
|
298
|
+
--url=<URL> Base URL for testing (default: http://localhost:3000)
|
|
299
|
+
--headed Show browser during testing (visible GUI window for debugging)
|
|
300
|
+
--debug Enable Playwright inspector for tests
|
|
340
301
|
|
|
341
302
|
Examples:
|
|
342
303
|
git checkout -b feat/implement-tickets # Create feature branch first
|
|
343
|
-
kosuke build # Process and commit all tickets
|
|
304
|
+
kosuke build # Process and auto-commit all tickets
|
|
344
305
|
gh pr create # Create PR manually
|
|
345
306
|
|
|
346
|
-
kosuke build --
|
|
307
|
+
kosuke build --ask-commit # Ask before committing each ticket
|
|
308
|
+
kosuke build --ask-confirm # Ask before processing each ticket
|
|
309
|
+
kosuke build --ask-commit --ask-confirm # Fully interactive mode
|
|
347
310
|
kosuke build --reset # Reset all tickets and start from scratch
|
|
348
|
-
kosuke build --
|
|
349
|
-
kosuke build --
|
|
311
|
+
kosuke build --no-review --no-test # Skip review and testing (fastest)
|
|
312
|
+
kosuke build --headed # Show browser during tests
|
|
350
313
|
kosuke build --tickets=custom.json # Use custom tickets file
|
|
351
314
|
kosuke build --directory=./my-project # Run build in specific directory
|
|
352
315
|
kosuke build --db-url=postgres://user:pass@host:5432/db # Custom DB
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;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CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;QACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAS,QAAQ;IACf,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiMb,CAAC,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -2,20 +2,22 @@
|
|
|
2
2
|
* Build command - Batch process all tickets from tickets.json
|
|
3
3
|
*
|
|
4
4
|
* This command processes all "Todo" and "Error" tickets sequentially,
|
|
5
|
-
* implementing each one using the ship
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* All tickets automatically include the --review flag for quality assurance.
|
|
5
|
+
* implementing each one using the ship core engine and committing individually.
|
|
6
|
+
* Frontend tickets automatically run tests (unless --no-test is specified).
|
|
7
|
+
* All tickets include code review by default (unless --no-review is specified).
|
|
9
8
|
*
|
|
10
9
|
* Usage:
|
|
11
|
-
* kosuke build # Process and commit all tickets
|
|
12
|
-
* kosuke build --
|
|
10
|
+
* kosuke build # Process and auto-commit all tickets
|
|
11
|
+
* kosuke build --ask-commit # Ask before committing each ticket
|
|
12
|
+
* kosuke build --ask-confirm # Ask before processing each ticket
|
|
13
13
|
* kosuke build --reset # Reset all tickets to "Todo" and process from scratch
|
|
14
|
-
* kosuke build --
|
|
14
|
+
* kosuke build --no-review # Skip code review phase
|
|
15
|
+
* kosuke build --no-test # Skip testing phase for frontend tickets
|
|
16
|
+
* kosuke build --headed # Show browser during testing
|
|
15
17
|
* kosuke build --tickets=path/to/tickets.json
|
|
16
18
|
* kosuke build --db-url=postgres://user:pass@host:5432/db
|
|
17
19
|
*
|
|
18
|
-
* Note: Create a feature branch before running build
|
|
20
|
+
* Note: Create a feature branch before running build:
|
|
19
21
|
* git checkout -b feat/implement-tickets
|
|
20
22
|
* kosuke build
|
|
21
23
|
* gh pr create
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../kosuke/commands/build.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../kosuke/commands/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAU,MAAM,aAAa,CAAC;AAwExD;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA2MvE"}
|
|
@@ -2,20 +2,22 @@
|
|
|
2
2
|
* Build command - Batch process all tickets from tickets.json
|
|
3
3
|
*
|
|
4
4
|
* This command processes all "Todo" and "Error" tickets sequentially,
|
|
5
|
-
* implementing each one using the ship
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* All tickets automatically include the --review flag for quality assurance.
|
|
5
|
+
* implementing each one using the ship core engine and committing individually.
|
|
6
|
+
* Frontend tickets automatically run tests (unless --no-test is specified).
|
|
7
|
+
* All tickets include code review by default (unless --no-review is specified).
|
|
9
8
|
*
|
|
10
9
|
* Usage:
|
|
11
|
-
* kosuke build # Process and commit all tickets
|
|
12
|
-
* kosuke build --
|
|
10
|
+
* kosuke build # Process and auto-commit all tickets
|
|
11
|
+
* kosuke build --ask-commit # Ask before committing each ticket
|
|
12
|
+
* kosuke build --ask-confirm # Ask before processing each ticket
|
|
13
13
|
* kosuke build --reset # Reset all tickets to "Todo" and process from scratch
|
|
14
|
-
* kosuke build --
|
|
14
|
+
* kosuke build --no-review # Skip code review phase
|
|
15
|
+
* kosuke build --no-test # Skip testing phase for frontend tickets
|
|
16
|
+
* kosuke build --headed # Show browser during testing
|
|
15
17
|
* kosuke build --tickets=path/to/tickets.json
|
|
16
18
|
* kosuke build --db-url=postgres://user:pass@host:5432/db
|
|
17
19
|
*
|
|
18
|
-
* Note: Create a feature branch before running build
|
|
20
|
+
* Note: Create a feature branch before running build:
|
|
19
21
|
* git checkout -b feat/implement-tickets
|
|
20
22
|
* kosuke build
|
|
21
23
|
* gh pr create
|
|
@@ -23,8 +25,10 @@
|
|
|
23
25
|
import { existsSync, statSync } from 'fs';
|
|
24
26
|
import { join, resolve } from 'path';
|
|
25
27
|
import * as readline from 'readline';
|
|
26
|
-
import
|
|
27
|
-
import {
|
|
28
|
+
import simpleGit from 'simple-git';
|
|
29
|
+
import { loadTicketsFile, saveTicketsFile, updateTicketStatus, } from '../utils/tickets-manager.js';
|
|
30
|
+
import { shipCore } from './ship.js';
|
|
31
|
+
import { runTestsWithRetry } from '../utils/test-runner.js';
|
|
28
32
|
/**
|
|
29
33
|
* Prompt user for confirmation to continue
|
|
30
34
|
*/
|
|
@@ -68,6 +72,18 @@ function getTicketsToProcess(ticketsData) {
|
|
|
68
72
|
});
|
|
69
73
|
return tickets;
|
|
70
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Commit ticket changes to current branch
|
|
77
|
+
*/
|
|
78
|
+
async function commitTicket(ticket, cwd) {
|
|
79
|
+
const git = simpleGit(cwd);
|
|
80
|
+
// Stage all changes
|
|
81
|
+
await git.add('.');
|
|
82
|
+
// Commit with ticket info
|
|
83
|
+
const commitMessage = `feat: ${ticket.id} - ${ticket.title}`;
|
|
84
|
+
await git.commit(commitMessage);
|
|
85
|
+
console.log(` ā
Committed: ${commitMessage}`);
|
|
86
|
+
}
|
|
71
87
|
/**
|
|
72
88
|
* Main build command - processes all tickets and commits each one
|
|
73
89
|
*/
|
|
@@ -81,7 +97,7 @@ export async function buildCommand(options) {
|
|
|
81
97
|
if (!process.env.GITHUB_TOKEN) {
|
|
82
98
|
throw new Error('GITHUB_TOKEN environment variable is required for build command');
|
|
83
99
|
}
|
|
84
|
-
const { directory, ticketsFile = 'tickets.json', dbUrl = 'postgres://postgres:postgres@localhost:5432/postgres', reset = false,
|
|
100
|
+
const { directory, ticketsFile = 'tickets.json', dbUrl = 'postgres://postgres:postgres@localhost:5432/postgres', reset = false, askConfirm = false, askCommit = false, review = true, test = true, url, headed, debug, noLogs = false, } = options;
|
|
85
101
|
// 1. Validate and resolve directory
|
|
86
102
|
const cwd = directory ? resolve(directory) : process.cwd();
|
|
87
103
|
if (!existsSync(cwd)) {
|
|
@@ -124,7 +140,7 @@ export async function buildCommand(options) {
|
|
|
124
140
|
console.log(` ${index + 1}. ${ticket.id}: ${ticket.title}`);
|
|
125
141
|
});
|
|
126
142
|
console.log('');
|
|
127
|
-
// 4. Process each ticket sequentially
|
|
143
|
+
// 4. Process each ticket sequentially
|
|
128
144
|
for (let i = 0; i < ticketsToProcess.length; i++) {
|
|
129
145
|
const ticket = ticketsToProcess[i];
|
|
130
146
|
console.log('\n' + '='.repeat(80));
|
|
@@ -132,26 +148,67 @@ export async function buildCommand(options) {
|
|
|
132
148
|
console.log(`š ${ticket.title}`);
|
|
133
149
|
console.log('='.repeat(80) + '\n');
|
|
134
150
|
try {
|
|
135
|
-
//
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
review: true, // Always perform code review during build
|
|
151
|
+
// Step 1: Update status to InProgress
|
|
152
|
+
console.log('š Updating ticket status to InProgress...');
|
|
153
|
+
updateTicketStatus(ticketsPath, ticket.id, 'InProgress');
|
|
154
|
+
console.log(' ā
Status updated\n');
|
|
155
|
+
// Step 2: Ship implements the ticket (no ticket lifecycle management)
|
|
156
|
+
const shipResult = await shipCore({
|
|
157
|
+
ticketData: ticket, // Pass ticket object directly
|
|
158
|
+
review, // Controlled by build options
|
|
144
159
|
directory: cwd,
|
|
145
160
|
dbUrl,
|
|
146
161
|
noLogs,
|
|
147
162
|
});
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
console.log(
|
|
163
|
+
if (!shipResult.success) {
|
|
164
|
+
throw new Error(shipResult.error || 'Ship failed');
|
|
165
|
+
}
|
|
166
|
+
console.log(`\nā
${ticket.id} implemented successfully`);
|
|
167
|
+
console.log(`š Implementation fixes: ${shipResult.implementationFixCount}`);
|
|
168
|
+
console.log(`š§ Linting fixes: ${shipResult.lintFixCount}`);
|
|
169
|
+
if (shipResult.reviewFixCount > 0) {
|
|
170
|
+
console.log(`š Review fixes: ${shipResult.reviewFixCount}`);
|
|
171
|
+
}
|
|
172
|
+
console.log(`š° Ship cost: $${shipResult.cost.toFixed(4)}`);
|
|
173
|
+
// Step 3: Run tests if frontend ticket and test enabled
|
|
174
|
+
const isFrontendTicket = ticket.id.startsWith('FRONTEND-');
|
|
175
|
+
if (test && isFrontendTicket) {
|
|
176
|
+
console.log(`\n${'='.repeat(60)}`);
|
|
177
|
+
console.log(`š§Ŗ Phase: Testing (Iterative)`);
|
|
178
|
+
console.log(`${'='.repeat(60)}\n`);
|
|
179
|
+
const testResult = await runTestsWithRetry({
|
|
180
|
+
ticket,
|
|
181
|
+
cwd,
|
|
182
|
+
url,
|
|
183
|
+
headed,
|
|
184
|
+
debug,
|
|
185
|
+
maxRetries: 3,
|
|
186
|
+
});
|
|
187
|
+
console.log(`\n⨠Testing completed (${testResult.fixesApplied} fixes applied over ${testResult.attempts} iterations)`);
|
|
188
|
+
console.log(`š° Testing cost: $${testResult.cost.toFixed(4)}`);
|
|
189
|
+
}
|
|
190
|
+
// Step 4: Update ticket status to Done
|
|
191
|
+
console.log('\nš Updating ticket status to Done...');
|
|
192
|
+
updateTicketStatus(ticketsPath, ticket.id, 'Done');
|
|
193
|
+
console.log(` ā
Ticket ${ticket.id} marked as Done\n`);
|
|
194
|
+
// Step 5: Commit (if not asking)
|
|
195
|
+
if (askCommit) {
|
|
196
|
+
// Interactive: ask before committing
|
|
197
|
+
const shouldCommit = await promptConfirmation(`\nā Commit changes for ${ticket.id}?`);
|
|
198
|
+
if (shouldCommit) {
|
|
199
|
+
await commitTicket(ticket, cwd);
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
console.log(' āļø Skipped commit\n');
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
// Default: auto-commit
|
|
207
|
+
await commitTicket(ticket, cwd);
|
|
208
|
+
}
|
|
152
209
|
// Ask for confirmation before proceeding to next ticket (if not last ticket)
|
|
153
|
-
if (
|
|
154
|
-
const shouldContinue = await promptConfirmation('ā
|
|
210
|
+
if (askConfirm && i < ticketsToProcess.length - 1) {
|
|
211
|
+
const shouldContinue = await promptConfirmation('\nā Proceed to next ticket?');
|
|
155
212
|
if (!shouldContinue) {
|
|
156
213
|
console.log('\nāøļø Build paused by user');
|
|
157
214
|
console.log(`š Progress: ${i + 1}/${ticketsToProcess.length} tickets completed`);
|
|
@@ -163,6 +220,8 @@ export async function buildCommand(options) {
|
|
|
163
220
|
catch (error) {
|
|
164
221
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
165
222
|
console.error(`\nā Failed to process ${ticket.id}: ${errorMessage}`);
|
|
223
|
+
// Update ticket status to Error
|
|
224
|
+
updateTicketStatus(ticketsPath, ticket.id, 'Error', errorMessage);
|
|
166
225
|
console.error('\nā Build stopped due to ticket failure');
|
|
167
226
|
console.error('ā¹ļø Fix the issue and run build again to resume from failed tickets\n');
|
|
168
227
|
throw error;
|
|
@@ -173,22 +232,12 @@ export async function buildCommand(options) {
|
|
|
173
232
|
console.log('ā
Build Completed Successfully!');
|
|
174
233
|
console.log('='.repeat(80));
|
|
175
234
|
console.log(`š¦ Total tickets processed: ${ticketsToProcess.length}`);
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
console.log(' - Or run build again without --no-commit to auto-commit\n');
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
console.log(`ā
All tickets have been committed to current branch`);
|
|
186
|
-
console.log('='.repeat(80));
|
|
187
|
-
console.log('\nš” Next steps:');
|
|
188
|
-
console.log(' - Review the commits');
|
|
189
|
-
console.log(' - Create a PR using: gh pr create');
|
|
190
|
-
console.log(' - Or push to a remote branch and create PR manually\n');
|
|
191
|
-
}
|
|
235
|
+
console.log(`ā
All tickets have been implemented and committed`);
|
|
236
|
+
console.log('='.repeat(80));
|
|
237
|
+
console.log('\nš” Next steps:');
|
|
238
|
+
console.log(' - Review the commits: git log');
|
|
239
|
+
console.log(' - Create a PR using: gh pr create');
|
|
240
|
+
console.log(' - Or push to remote: git push origin <branch-name>\n');
|
|
192
241
|
}
|
|
193
242
|
catch (error) {
|
|
194
243
|
console.error('\nā Build failed:', error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../kosuke/commands/build.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../kosuke/commands/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EACL,eAAe,EACf,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,CAAC;gBAElE,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;gBACzD,OAAO,CAAC,KAAK,CAAC,uEAAuE,CAAC,CAAC;gBACvF,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;QAED,2BAA2B;QAC3B,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;QAC/C,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,+BAA+B,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;QACtE,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;QACjE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;IACzE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;QAC1C,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1,25 +1,32 @@
|
|
|
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
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
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.)
|
|
13
|
+
*
|
|
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 type { ShipOptions, ShipResult } from '../types.js';
|
|
17
27
|
/**
|
|
18
|
-
* Core ship logic (
|
|
28
|
+
* Core ship logic (ticket-agnostic, reusable)
|
|
29
|
+
* Implements a ticket without managing its lifecycle (status updates, etc.)
|
|
19
30
|
*/
|
|
20
31
|
export declare function shipCore(options: ShipOptions): Promise<ShipResult>;
|
|
21
|
-
/**
|
|
22
|
-
* Main ship command
|
|
23
|
-
*/
|
|
24
|
-
export declare function shipCommand(options: ShipOptions): Promise<void>;
|
|
25
32
|
//# sourceMappingURL=ship.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ship.d.ts","sourceRoot":"","sources":["../../../kosuke/commands/ship.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ship.d.ts","sourceRoot":"","sources":["../../../kosuke/commands/ship.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAU,MAAM,aAAa,CAAC;AAyEnE;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAiJxE"}
|